# AI Self-Review — mandatory before claiming Done After coding, check every item. **Canonical gate:** `.ai/definition-of-done.md` — output **Review Report** (§7) when claiming Done. Below checklist may be used as detail; labels: Demo | Feature Complete | P1 Complete. ## Checklist | Area | Ask | |---|---| | Architecture | Layers respected? No Handler→DB? | | Naming | Consistent domain terms? | | Performance | Obvious N+1 / unbounded lists? | | Security | AuthZ, validation, no secrets? | | Readability | Files ≤400, funcs ≤50? | | Error handling | Wrapped errors / user-safe messages? | | Logging | Structured, no PII spam? | | Test | Critical path covered or smoke listed? | | Deployment | Migration / health / env noted if needed? | | Docs | OpenAPI / PRD touch if public behavior changed? | | Design | UI change? Tokens + catalog + platform contract followed? | | Environment | Local workflow still host Go/Vite + deps-only compose? No Docker-only coding? | | Scope | No unrelated files modified? | ## Output format (required) ``` ## Review - Architecture: PASS | FAIL — - Naming: PASS | FAIL — - Performance: PASS | FAIL — - Security: PASS | FAIL — - Readability: PASS | FAIL — - Error handling: PASS | FAIL — - Logging: PASS | FAIL — - Test: PASS | FAIL — - Deployment: PASS | FAIL — - Docs: PASS | FAIL — - Design: PASS | FAIL | N/A — - Environment: PASS | FAIL | N/A — - Scope: PASS | FAIL — ``` Any FAIL → fix before finishing. Do not hide FAILs.