How to Run Code Review
Use the code-review workflow to perform a thorough quality review of implemented code.
When to Use This
Section titled âWhen to Use Thisâ- After dev-story completes implementation
- Before marking a story as DONE
- Every story goes through code review - no exceptions
Prerequisites
Section titled âPrerequisitesâ- BMad Method installed
- DEV agent available
- Story implementation complete
- Tests written and passing
1. Load the DEV Agent
Section titled â1. Load the DEV AgentâStart a fresh chat (or continue from dev-story) and load the DEV agent.
2. Run the Workflow
Section titled â2. Run the Workflowâ*code-review3. Provide Context
Section titled â3. Provide ContextâPoint the agent to:
- The story file
- Files changed during implementation
- Test files
4. Review Findings
Section titled â4. Review FindingsâThe agent performs a senior developer code review and reports findings.
5. Address Issues
Section titled â5. Address IssuesâIf issues are found:
- Fix issues using dev-story
- Re-run tests
- Run code-review again
What Gets Reviewed
Section titled âWhat Gets ReviewedâThe code review checks:
Code Quality
Section titled âCode Qualityâ- Clean, readable code
- Appropriate abstractions
- No code smells
- Proper error handling
Architecture Alignment
Section titled âArchitecture Alignmentâ- Follows ADRs and architecture decisions
- Consistent with existing patterns
- Proper separation of concerns
Testing
Section titled âTestingâ- Adequate test coverage
- Tests are meaningful (not just for coverage)
- Edge cases handled
- Tests follow project patterns
Security
Section titled âSecurityâ- No hardcoded secrets
- Input validation
- Authentication/authorization proper
- No common vulnerabilities
Performance
Section titled âPerformanceâ- No obvious performance issues
- Appropriate data structures
- Efficient queries
Review Outcomes
Section titled âReview Outcomesââ Approved
Section titled ââ Approvedâ- Code meets quality standards
- Tests pass
- Action: Mark story as DONE in sprint-status.yaml
đ§ Changes Requested
Section titled âđ§ Changes Requestedâ- Issues identified that need fixing
- Action: Fix issues in dev-story, then re-run code-review
Quality Gates
Section titled âQuality GatesâEvery story goes through code-review before being marked done. This ensures:
- Consistent code quality
- Architecture adherence
- Test coverage
- Security review
- Donât skip code review for âsimpleâ changes
- Address all findings, not just critical ones
- Use findings as learning opportunities
- Re-run review after fixes
After Code Review
Section titled âAfter Code Reviewâ- If approved: Update sprint-status.yaml to mark story DONE
- If changes requested: Fix issues and re-run review
- Move to next story: Run create-story for the next item
Related
Section titled âRelatedâ- Implement Story - Before code review
- Create Story - Move to next story
- Run Sprint Planning - Sprint organization