I am batman
This commit is contained in:
5
.github/instructions/00-main.md
vendored
Normal file
5
.github/instructions/00-main.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Backend Instruction Entry Point (Do Not Edit)
|
||||
|
||||
1. Read the user's prompt input completely before taking action.
|
||||
2. Act as a backend and database engineer for this repository's architecture.
|
||||
3. Update only the scoped instruction files in this directory when requested; do not modify this file.
|
||||
16
.github/instructions/api.md
vendored
Normal file
16
.github/instructions/api.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# API Instructions
|
||||
|
||||
## Scope
|
||||
- Applies to Fiber handlers and route registration under `internal/handlers` and `internal/server/routes.go`.
|
||||
|
||||
## Rules
|
||||
- Keep API contracts stable; if changing request/response shape, document backward compatibility in PR notes.
|
||||
- Prefer snake_case JSON request fields for backend payloads and accept legacy aliases only when needed.
|
||||
- Validate required fields explicitly in handlers and return clear `400` errors with actionable messages.
|
||||
- Return `404` for missing resources, `500` only for unexpected server/database failures.
|
||||
- Keep route naming consistent (`/resource`, `/resource/:id`) and group related routes in `routes.go`.
|
||||
|
||||
## Implementation Notes
|
||||
- Use `database.DB()` directly in handlers unless a service layer exists for that feature.
|
||||
- Preload only required relations for performance-sensitive list endpoints.
|
||||
- Keep list endpoints sorted deterministically (e.g., `position asc, id asc`).
|
||||
15
.github/instructions/containerization.md
vendored
Normal file
15
.github/instructions/containerization.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Containerization Instructions
|
||||
|
||||
## Scope
|
||||
- Applies to Dockerfiles, `docker-compose.yml`, and make targets that run services.
|
||||
|
||||
## Rules
|
||||
- Keep service startup deterministic: API, chat, webrtc, and seed images should build independently.
|
||||
- Avoid embedding secrets in Dockerfiles; rely on `.env` and compose environment wiring.
|
||||
- Preserve fast local iteration paths (`dev-local`, seed commands) when changing build contexts.
|
||||
- Keep images minimal and purpose-specific (`Dockerfile`, `Dockerfile.chat`, `Dockerfile.webrtc`, `Dockerfile.seed`).
|
||||
- If ports or health behavior change, update compose and README usage notes together.
|
||||
|
||||
## Operational Notes
|
||||
- Prefer non-destructive changes to compose volumes and DB state in dev.
|
||||
- When build/runtime differs between local and CI, document the reason in PR notes.
|
||||
15
.github/instructions/database.md
vendored
Normal file
15
.github/instructions/database.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Database Instructions
|
||||
|
||||
## Scope
|
||||
- Applies to GORM models in `internal/models` and migration behavior in `internal/database/database.go`.
|
||||
|
||||
## Rules
|
||||
- Define explicit foreign keys for non-trivial relations (`foreignKey`, `references`) to avoid inference errors.
|
||||
- Avoid introducing `NOT NULL` constraints on existing populated tables without a backfill plan.
|
||||
- Keep `AutoMigrate` additive-first; prefer safe schema transitions over breaking changes.
|
||||
- Use deterministic ordering fields (`position`) for UI-driven entities (kanban sections/tasks).
|
||||
- Ensure seed data aligns with current schema and relation requirements.
|
||||
|
||||
## Migration Safety
|
||||
- For legacy data, introduce nullable columns first, backfill, then tighten constraints in a later step.
|
||||
- Never assume empty tables in shared dev environments.
|
||||
Reference in New Issue
Block a user