| name | review-conventions |
| description | Code review checklists and common pitfalls for this codebase — security, correctness, conventions, and verification commands. TRIGGER when: reviewing a PR or diff; user asks to review, check, or validate changes; running /review or /security-review; verifying tool implementation correctness before committing. |
Review Conventions
Priority Order
- Security — path traversal, scope correctness, error message leakage
- Correctness — API contract, response formatting, error handling
- Conventions — helper usage, naming, annotations, test structure
- Quality — readability, duplication, edge cases
Tool Implementation Checklist
Common Pitfalls
| Pitfall | What to look for |
|---|
| Missing path traversal protection | Any ID parameter in a URL path not using safePathSegmentSchema |
| Missing destructiveHint | DELETE or destructive operations without annotations: { destructiveHint: true } |
| Hardcoded scopes | Scopes written inline in makeAuthenticatedRequest() instead of referencing the SCOPES const |
| Raw JSON response | Returning JSON.stringify(data) without formatSuccess() — loses transaction ID |
| Theme data loss | Theme update/delete operations that don't preserve isDefault or other realm data |
| AM helper bypass | AM tools not using buildAMRealmUrl() and AM_API_HEADERS from amHelpers |
Test Review Checklist
Verification Commands
Run these to verify changes:
npm test
npm run typecheck
npm run lint
npm run format:check
npm run build
npm run test:snapshots:update