1---2name: code-review3description: Reviews code against project coding standards and provides a structured pass/fail verdict. Use when performing code reviews, checking code quality, validating coding standards compliance, or when user mentions "code review", "review code", or "check standards".4---56## Instructions78- Review code against project coding standards — only check HOW it is written, not WHETHER it works9- Code to review: $ARGUMENTS (if no arguments, use `git diff` to identify recent changes)10- Read context files before reviewing: `project/docs/architecture/coding-standards.md`, `project/docs/architecture/architecture.md`, `project/docs/architecture/decisions.md`11- Evaluate code across 5 categories: Type Safety, Naming and Structure, Error Handling, Domain-Specific Standards, Test Quality12- Produce a structured pass/fail verdict with max 5 prioritized issues1314## Workflow1516### Phase 1: Gather Context1718- Read `project/docs/architecture/coding-standards.md` for conventions to check against19- Read `project/docs/architecture/architecture.md` for expected file structure and patterns20- Read `project/docs/architecture/decisions.md` for settled technical choices to verify compliance21- Identify the code to review from $ARGUMENTS or `git diff`2223### Phase 2: Review Against Categories2425- **Type Safety and Language Standards**26 - TypeScript: strict mode compliance (no `any` without justification), explicit return types on exported functions, proper type definitions, interfaces/types for all data structures27 - Python: type hints on all public function signatures, no bare `except:`, dataclasses or Pydantic models for data structures28 - General: no hardcoded magic numbers/strings without named constants, no commented-out code, functions do one thing29- **Naming and Structure**30 - File/class/function naming follows coding-standards.md conventions31 - Files in correct directories per architecture.md32 - One component/class/module per file33 - Tests co-located or in designated test directory per standards34- **Error Handling**35 - External service calls wrapped with proper error handling36 - No silent error swallowing — at minimum log with context37 - User-facing errors handled gracefully (not raw stack traces)38 - Fail fast: inputs validated at boundaries39- **Domain-Specific Standards**40 - Web Frontend: components are presentational, no direct API/database calls from components, accessibility basics41 - AI/ML Integration: prompts stored in designated directory, AI/ML responses validated before use, timeout handling on external AI calls42- **Test Quality**43 - Tests exist for new logic44 - Tests are meaningful (not just "it runs without crashing")45 - Test names describe expected behavior: "should [outcome] when [condition]"46 - No shared mutable state between tests4748### Phase 3: Compile Report4950- Use the report template from [templates/report.md](templates/report.md)51- Use the issue template from [templates/issue.md](templates/issue.md) for each finding52- Score each category as PASS / FAIL / N/A with a one-line note if issue found53- Determine overall verdict: PASS or FAIL54- If FAIL, list max 5 issues prioritized by impact55- Add non-blocking warnings for things that could be better but are not violations5657## Rules5859- Max 5 issues — prioritize the most impactful60- Only fail on actual standard violations, not preferences61- Do not suggest refactors unless something violates coding-standards.md or decisions.md62- Do not re-evaluate whether the feature works — QA already verified that63- If everything follows standards, say PASS and stop64- Be specific — "Error handling could be better" is useless; "userService.py get_user() has no try/except around the database query" is useful6566## Acceptance Criteria6768- All 5 review categories evaluated with PASS / FAIL / N/A verdict69- Each finding includes specific file, function/line reference, and concrete fix action70- Overall verdict (PASS/FAIL) provided71- Findings reference rules from coding-standards.md, architecture.md, or decisions.md72- Report structured for immediate action by the builder