skills/code-review/SKILL.md
Systematic code review for implementation phases verifying architectural principles, framework standards, ADR compliance, and code quality. This skill is invoked by implement-phase as part of its quality gate pipeline, or manually when reviewing code changes. Triggers on "review code", "code review", "/code-review", or automatically as Step 3 of implement-phase.
npx skillsauth add mhylle/claude-skills-collection code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematic code review skill that validates implementation quality across six dimensions: service delegation, framework standards, ADR compliance, plan synchronization, coding standards, and general code quality.
This skill acts as a quality gate between implementation phases. It ensures code meets established standards before proceeding, catching issues early when they're cheapest to fix.
Automatically invoked by implement-plan:
Manually invoked when:
Verify that implementation follows proper separation of concerns:
| Check | What to Look For | |-------|------------------| | Controller thin | Controllers only handle HTTP concerns, delegate to services | | Service focused | Each service has one clear responsibility | | No god objects | No classes/modules doing too many things | | Dependency direction | Dependencies flow inward (controllers → services → repositories) | | No business logic in wrong layer | Controllers don't contain business rules, repositories don't transform data |
Verify code follows the project's established patterns:
| Check | What to Verify | |-------|----------------| | Naming conventions | Files, classes, methods follow project conventions | | Module structure | New code follows existing module organization | | Error handling | Uses project's error handling patterns | | Logging | Follows established logging conventions | | Configuration | Uses project's config management approach | | Testing patterns | Tests follow existing test structure and naming |
Verify architectural decisions are followed and documented:
| Check | What to Do | |-------|------------| | Read relevant ADRs | Check INDEX.md, identify ADRs related to this change | | Verify compliance | Implementation follows documented decisions | | New decisions documented | Any new architectural choices have corresponding ADRs | | No contradictions | Changes don't violate existing accepted ADRs |
Verify the plan document reflects current state:
| Check | What to Verify |
|-------|----------------|
| Checkboxes updated | Completed tasks marked with [x] |
| Exit conditions recorded | All exit condition statuses updated |
| Deviations noted | Any plan deviations documented with rationale |
| ADR references added | New ADRs linked in plan where relevant |
| Phase status accurate | Current phase progress matches reality |
Standard code review concerns:
| Check | What to Look For | |-------|------------------| | No security issues | No injection vulnerabilities, proper auth checks | | No hardcoded secrets | No API keys, passwords, or tokens in code | | Error handling | Errors handled gracefully, not swallowed | | Resource cleanup | Connections, streams, handlers properly closed | | No dead code | No commented-out code, unused imports/variables | | Test coverage | New code has appropriate test coverage | | Documentation | Complex logic has explanatory comments |
Verify implementation follows project coding standards:
| Check | What to Verify |
|-------|----------------|
| File size limits | Services <500 lines, controllers <250 lines |
| Service delegation | Controllers thin, services focused |
| Interface usage | DTOs and response types have interfaces |
| Error handling | Domain exceptions, no swallowed errors |
| Logging | Project logger used, no console.log |
| Configuration | Via ConfigService, no hardcoded values |
| Forbidden patterns | No empty catch blocks, no unhandled promises |
Reference: docs/standards/CODING_STANDARDS.md
1. READ the plan file to understand:
- Current phase being reviewed
- Expected deliverables
- Exit conditions that should be met
2. READ docs/decisions/INDEX.md to identify:
- ADRs relevant to this change
- Recently added ADRs
3. IDENTIFY changed files using git:
- git diff --name-only [base]...HEAD
- Or use provided file list
1. SPAWN codebase-pattern-finder to identify project conventions:
- Service patterns
- Controller patterns
- Test patterns
- Error handling patterns
2. COMPARE changed code against identified patterns
Execute reviews in parallel where possible:
Task (parallel): "Review service delegation in [files]"
Task (parallel): "Compare code against framework patterns found"
Task (parallel): "Check ADR compliance for [relevant ADRs]"
Task (parallel): "Verify plan file [path] is synchronized"
Task (parallel): "General code quality review of [files]"
Task (parallel): "Coding standards compliance check against docs/standards/CODING_STANDARDS.md"
Output a structured review report:
# Code Review: [Phase/Feature Name]
**Date:** YYYY-MM-DD
**Files Reviewed:** [count]
**Verdict:** PASS | PASS_WITH_NOTES | NEEDS_CHANGES
## Summary
[1-2 sentence overall assessment]
## Review Results
### Service Delegation & Single Responsibility
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
### Framework Standards Compliance
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
### ADR Compliance
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
### Plan Synchronization
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
### General Code Quality
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
### Coding Standards Compliance
Status: PASS | NEEDS_CHANGES
[Findings or "All checks passed"]
## Required Changes
[Numbered list of changes required before approval, or "None"]
## Recommendations
[Optional improvements that don't block approval]
## Files Reviewed
| File | Status | Notes |
|------|--------|-------|
| `path/to/file.ts` | OK | |
| `path/to/other.ts` | ISSUE | [Brief note] |
When invoked by implement-phase (Step 3 of the phase pipeline), this skill:
STATUS: PASS | NEEDS_CHANGES
VERDICT: [Brief summary]
CHANGES_REQUIRED: [Count or "None"]
BLOCKING_ISSUES:
- [List of blocking issues, or "None"]
RECOMMENDATIONS:
- [List of non-blocking suggestions]
REPORT: [Path to full review report, if written to disk]
This skill is Step 3 in the implement-phase pipeline:
Step 1: Implementation (subagents)
Step 2: Exit condition verification
Step 3: CODE-REVIEW (this skill) ←
Step 4: ADR compliance check
Step 5: Plan synchronization
Step 6: Completion report
The implement-phase skill handles retry logic:
1. INVOKE code-review skill for the phase
2. IF code-review returns NEEDS_CHANGES:
a. PRESENT blocking issues
b. SPAWN fix subagents for each issue
c. Re-run code-review
d. REPEAT until PASS (max 3 retries)
3. PROCEED to Step 4 (ADR compliance)
Skill(skill="code-review"): Review Phase 2 implementation.
Context:
- Plan: docs/plans/auth-implementation.md
- Phase: 2 (Authentication Service)
- Changed files: src/auth/auth.service.ts, src/auth/auth.guard.ts, src/auth/jwt.strategy.ts
Return structured result for implement-phase orchestrator.
/code-review
Review the authentication changes in src/auth/.
Focus on: service delegation, NestJS patterns, and ADR-0012 compliance.
Detailed checklists are available in references:
| Level | Meaning | Action | |-------|---------|--------| | BLOCKING | Must fix before proceeding | Phase cannot complete | | WARNING | Should fix, but doesn't block | Note for follow-up | | INFO | Suggestion for improvement | Optional enhancement |
Every phase ends with a clean baseline (exit conditions pass). Therefore, ANY error present at code review time was introduced by this phase.
The implement-phase pipeline guarantees:
Previous Phase → Exit Conditions PASS → Clean State
↓
Current Phase Implementation
↓
Code Review ← ANY errors here are from THIS phase
Since each phase must pass exit conditions (build, lint, typecheck, tests) before completion:
| State | Implication | |-------|-------------| | Lint passed before this phase | Any lint errors now = we caused them | | Build passed before this phase | Any build errors now = we caused them | | Tests passed before this phase | Any test failures now = we caused them | | No type errors before this phase | Any type errors now = we caused them |
There is no "pre-existing error" exception because:
Even errors in files we didn't directly modify are our responsibility:
Example: We modify src/auth/types.ts
This causes type errors in src/api/endpoints.ts (which imports our types)
→ The error in endpoints.ts is OUR error
→ We broke it by changing the types it depends on
→ This is BLOCKING
When implementing on an existing codebase with pre-existing errors:
The principle is simple: every phase must end clean. If we inherit a mess, cleaning it up is our job before we can complete the phase.
implement-phase: Step 2 (exit conditions) passed. Running Step 3: code review.
code-review: Reviewing Phase 2: Authentication Service
Files: src/auth/auth.service.ts, auth.guard.ts, jwt.strategy.ts
● Checking service delegation...
- ✅ Controllers thin, delegate to AuthService
- ✅ AuthService focused on authentication only
- ✅ No business logic in guards
● Checking framework standards...
- ✅ Follows NestJS injectable patterns
- ✅ Uses project's config service
- ⚠️ Logger not using project's custom logger
● Checking ADR compliance...
- ✅ ADR-0012 (JWT auth): Compliant
- ✅ No contradictions with existing ADRs
● Checking plan synchronization...
- ✅ All Phase 2 tasks marked complete
- ✅ Exit conditions recorded
- ⚠️ Missing link to ADR-0012 in plan
● Checking general quality...
- ✅ No security issues
- ✅ Test coverage adequate
- ✅ No dead code
STATUS: PASS_WITH_NOTES
VERDICT: Code meets standards with minor improvements suggested
CHANGES_REQUIRED: 0
BLOCKING_ISSUES: None
RECOMMENDATIONS:
- Use project's CustomLogger instead of NestJS Logger
- Add ADR-0012 reference to plan's Phase 2 section
tools
--- name: tt-workflow-build description: Tasktracker-native trigger for a PARALLEL build via the Claude Code Workflow tool. Thin by design — it does two things, then drives to done: (1) ensure a tasktracker project exists (use the existing one, or create one), then (2) start a dynamic `Workflow` that builds it, tracking the work in tasktracker and using the build + verify skills. It does NOT analyze parallelism up front, ask the user to choose a mode, hand back, or fall back to a sequential skil
tools
--- name: grumpy-reviewer description: A single grumpy, nitpicky structural code reviewer that runs as an isolated subagent and treats the code as third-party work submitted by a junior programmer for validation. It cares about exactly one thing — maintainability — judged through separation of concerns, service-oriented design, helper-method extraction, small files, and the rule of 7 (as any grouping nears 7 members, it pushes for sub-groupings). It is deliberately kept OUT of the implementation
development
--- name: tt-workflow-run description: Tasktracker-native autonomous build-loop orchestrator. Drives a first-class `workflow_run` end-to-end — create the run (Gate 1 lifecycle completeness + Gate 2 zero-defects-in), then loop while `getNextReadyTask(projectId)` returns a slice — `setActiveTask` → record a pre-slice `scanArchitectureDrift` baseline → delegate the slice to `/tt-implement-phase` (which does the code work, registers the architecture delta in-slice, and auto-logs defects/learnings/fr
tools
Tasktracker-native project-wide parallel audit using the Claude Code Workflow tool (dynamic workflows). Partitions a repo / backlog / architecture and fans out read-only agents (one per partition) that return schema-checked findings, aggregates them into a deduplicated, ranked risk register, and OPTIONALLY writes fixes back as tasks under a Bug Fix phase — with all tasktracker writes done by the PARENT, never the parallel agents (single global active-task pointer). Journaled and resumable, so a rate-limit or crash mid-audit resumes without re-running completed partitions. Use for large, embarrassingly-parallel, read/analyze-heavy jobs where each unit is self-contained and the output aggregates — audit every file/component for risk, find all architecture drift (scanArchitectureDrift) or duplicate tasks (detectDuplicates/auditDuplicates), per-file tech-debt sweep, test-coverage or security-surface scan across a whole project. Triggers on "/tt-workflow-audit", "audit the whole repo", "parallel audit", "scan every file/component", "find all drift/duplicates", "tech-debt sweep (tasktracker)", or any whole-project analyze-at-scale request inside a session with a tasktracker project. Prefer this over /codebase-audit or /code-quality-audit when the project is tracked in tasktracker AND you want the findings written back as tasks; prefer it over team-* modes when the units don't need to negotiate live (they just report).