add-reviewer
[ADD v0.11.0] Review code for spec compliance and quality — produces review report
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
[ADD v0.11.0] Review code for spec compliance and quality — produces review report
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
[ADD v0.11.0] Generate or sync a portable AGENTS.md from ADD project state — writes, checks drift, or merges with hand-curated content
[ADD v0.11.0] Declare absence — get autonomous work plan for the duration
[ADD v0.11.0] Return from absence — get briefing on autonomous work
[ADD v0.11.0] View project branding — accent color, palette, drift detection, image gen status
[ADD v0.11.0] Update project branding — new colors, fonts, tone, audit artifacts
[ADD v0.11.0] Generate or refresh CHANGELOG.md from conventional commits
| name | add-reviewer |
| description | [ADD v0.11.0] Review code for spec compliance and quality — produces review report |
| argument-hint | specs/{feature}.md [--scope backend|frontend|full] |
Conduct a comprehensive code review focused on specification compliance, code quality, and ADD methodology adherence. This is a READ-ONLY skill that produces a detailed structured review report.
The Reviewer analyzes implementation against the spec and quality standards without modifying code. It checks:
Verify spec file exists
Verify implementation exists
Verify tests exist and pass
npm test or python -m pytestLoad configuration
Determine review scope
Check for session handoff — per the Session-Handoff Preflight in ~/.codex/add/references/skill-epilogue.md
For each acceptance criterion:
Find corresponding test(s)
Verify test passes
Examine test quality
Find implementation code
Compare implementation to AC
Document findings:
AC-001: User can submit form with valid data
✓ Test exists: test_AC_001_submit_valid_data
✓ Test passes
✓ Implementation found: submitForm() in src/form.ts
✓ Behavior matches specification
Note: Good error message when validation fails
Examine code for quality across dimensions:
Readability
✓ Function names are clear (submitForm, validateEmail)
✓ Variables well-named (userEmail, isValid)
⚠ Long function parseFormData (120 lines) could be split
Maintainability
⚠ Email validation regex appears 3 times (use constant)
⚠ API endpoint "/api/submit" hard-coded in 2 places
✓ Class structure is clear
Style Adherence
✓ Follows camelCase naming convention
✓ Consistent 2-space indentation
⚠ Missing trailing semicolons (config requires them)
✓ Imports alphabetically sorted
Error Handling
✓ Email input validated before submission
⚠ Generic "Error" message instead of "Invalid email format"
✓ Network error handled with retry logic
Comments & Documentation
✓ Public functions have JSDoc comments
⚠ Complex validation logic lacks explanation
✓ Workaround for IE11 bug well-documented
Coverage metrics
AC-to-Test mapping
Edge case coverage
✓ Happy path tested
✓ Network timeout tested
⚠ Empty string input not tested
✓ Maximum form size tested
Test quality
Separation of concerns
Dependency management
Data structures
API design
Test naming
test_AC_NNN_description pattern?Implementation traceability
Spec-Test-Code alignment
Minimal implementation
Depth scales with maturity level (read from .add/config.json):
Checks:
Injection scanning
exec(, eval(, raw SQL string concatenation, innerHTML =, dangerouslySetInnerHTMLAuth pattern review (Beta+)
Data handling (Beta+)
Dependency review (Beta+)
npm audit / pip audit / cargo audit)Infrastructure (GA)
Score: X/10 based on findings count and severity
## 6. SECURITY REVIEW ({maturity} depth)
Score: 8/10
### Injection Scanning
- ✓ No raw SQL concatenation found
- ✓ All user input sanitized before template usage
- ⚠ src/api.ts:34 — input used in template literal without escaping
### Auth Patterns (Beta+)
- ✓ Protected routes have auth middleware
- ✓ JWT validated with signature + expiry check
- ⚠ src/auth.ts:89 — password comparison not constant-time
### Data Handling (Beta+)
- ✓ No PII in log statements
- ✓ No hardcoded credentials
- ✓ Input validation on all API endpoints
### Dependencies (Beta+)
- ✓ No known CVEs (npm audit clean)
- ✓ All dependencies on latest patch versions
Only executed at Beta and above. At Alpha, this step is skipped entirely.
Checks:
N+1 query detection
for / forEach / map containing query calls).find(, .query(, .get() inside loop bodiesBlocking async detection
readFileSync, execSync, blocking HTTP calls)await inside loops where Promise.all could be usedMemory patterns
removeEventListener / unsubscribe)Bundle size (if applicable)
npm run build or equivalent and check output sizePerformance tests (GA only)
Score: X/10 based on findings count and severity
## 7. PERFORMANCE REVIEW (Beta+ only)
Score: 9/10
### N+1 Detection
- ✓ No queries inside loops found
- ✓ Batch loading used for related entities
### Async Patterns
- ✓ No synchronous I/O in async contexts
- ⚠ src/batch.ts:45 — sequential await in loop, consider Promise.all
### Memory Patterns
- ✓ Event listeners cleaned up in teardown
- ✓ No unbounded collections detected
### Bundle Size
- ✓ Build output: 142KB gzipped (threshold: 500KB)
- ✓ Tree-shaking active, no dead code detected
Generate a comprehensive structured report:
# Code Review Report
## Feature
{feature-name} v{spec-version}
## Review Scope
Backend [or Frontend or Full System]
## Executive Summary
Overall quality: {Excellent / Good / Fair / Needs Work}
Spec compliance: {percentage}%
Test coverage: {percentage}%
Code quality score: {N}/10
Security score: {N}/10
Performance score: {N}/10 (Beta+ only)
---
## 1. SPEC COMPLIANCE ✓/{total}
### Acceptance Criteria Coverage
| AC ID | Description | Test | Status | Notes |
|-------|-------------|------|--------|-------|
| AC-001 | requirement | test_AC_001_* | ✓ Pass | Implementation aligns well |
| AC-002 | requirement | test_AC_002_* | ✓ Pass | Edge case handled properly |
### User Test Cases Coverage
| UT ID | Scenario | Test | Status | Notes |
|-------|----------|------|--------|-------|
| UT-001 | user scenario | test_UT_001_* | ✓ Pass | Clear test naming |
### Findings
- ✓ All acceptance criteria have passing tests
- ✓ All user test cases are covered
- ⚠ [If any issues] AC-003 missing edge case test for empty input
---
## 2. CODE QUALITY
### Readability
- ✓ Function names are clear and descriptive
- ✓ Variables use meaningful names
- ✓ Code structure is logical
- ⚠ [Issue] parseFormData() function is 120 lines, consider splitting
- ⚠ [Issue] Magic string "/api/submit" appears 3 times
### Maintainability
- ✓ DRY principle followed (no significant duplication)
- ✓ Classes are focused and single-purpose
- ⚠ [Issue] Email regex hard-coded in validator, should be constant
### Style Adherence
- ✓ Follows camelCase naming convention
- ✓ Consistent indentation (2 spaces)
- ✓ Imports alphabetically sorted
- ⚠ [Issue] Missing trailing semicolons (config requires them)
### Error Handling
- ✓ Input validation on all entry points
- ✓ Network errors handled with retry
- ⚠ [Issue] Error messages are generic ("Error") instead of specific
- ⚠ [Issue] Missing validation for email format
### Documentation
- ✓ Public functions have JSDoc comments
- ✓ Complex logic commented
- ⚠ [Issue] API endpoint contracts not documented
- ⚠ [Issue] Missing README for module
---
## 3. TEST COVERAGE
### Coverage Metrics
- Line Coverage: 87% (target: 80%) ✓
- Branch Coverage: 82% (target: 80%) ✓
- Function Coverage: 100% ✓
### Coverage Gaps
- [If any] Lines 45-52 in form.ts not covered (error path)
- [If any] Branch for IE11 workaround not tested
### Edge Cases
- ✓ Network timeout tested
- ✓ Invalid email tested
- ⚠ [Issue] Empty string input not tested
- ✓ Maximum form size tested
- ✓ Concurrent submissions tested
### Test Quality
- ✓ Tests are independent (pass in any order)
- ✓ Setup/teardown properly isolated
- ✓ Assertions are specific and clear
- ✓ Tests verify behavior, not implementation
---
## 4. ARCHITECTURE & DESIGN
### Separation of Concerns
- ✓ Business logic separated from UI
- ✓ API layer distinct from business logic
- ✓ Validation centralized in one module
### Dependency Management
- ✓ Dependencies injected via constructors
- ✓ No circular dependencies detected
- ✓ Coupling is loose and appropriate
### Data Structures
- ✓ TypeScript interfaces used effectively
- ✓ Models are well-defined
- ✓ Type safety enforced
### API Design
- ✓ Public API is clean and intuitive
- ✓ Parameters well-named and documented
- ✓ Return types are appropriate
---
## 6. SECURITY REVIEW ({maturity} depth)
Score: {N}/10
### Injection Scanning
- {findings}
### Auth Patterns (Beta+)
- {findings}
### Data Handling (Beta+)
- {findings}
### Dependencies (Beta+)
- {findings}
---
## 7. PERFORMANCE REVIEW (Beta+ only)
Score: {N}/10
### N+1 Detection
- {findings}
### Async Patterns
- {findings}
### Memory Patterns
- {findings}
### Bundle Size
- {findings}
---
## 5. ADD METHODOLOGY
### Test Naming & Traceability
- ✓ Tests follow AC naming pattern (test_AC_NNN_*)
- ✓ Test mapping file exists and is accurate
- ✓ Can trace test → code → spec
### Implementation Quality
- ✓ Minimal viable implementation (no over-engineering)
- ✓ No unused code paths
- ✓ No premature optimization
### Documentation
- ✓ Test mapping file present and complete
- ⚠ [If missing] No plan document (docs/plans/{feature}-plan.md)
---
## ISSUES & RECOMMENDATIONS
### Critical Issues (Must Fix)
1. [Issue description] - Severity: High
- Location: {file}:{line}
- Impact: {explanation}
- Recommendation: {fix}
### Major Issues (Should Fix)
2. [Issue description] - Severity: Medium
- Location: {file}:{line}
- Recommendation: {fix}
### Minor Issues (Nice to Have)
3. [Issue description] - Severity: Low
- Location: {file}:{line}
- Recommendation: {fix}
---
## APPROVAL STATUS
- [✓] Spec Compliance: All ACs implemented and tested
- [✓] Test Coverage: Above minimum threshold
- [✓] Code Quality: Acceptable for production
- [✓] Security Review: No blocking findings
- [✓] Performance Review: No blocking findings (Beta+ only)
- [⚠] Ready for Production: [Yes / Needs Fixes]
---
## Next Steps
1. [Fix critical issues if any]
2. Run /add-tdd-cycle REFACTOR phase to address findings
3. Re-review after fixes
4. Proceed to staging deployment
Tasks to create (mechanics per ~/.codex/add/references/skill-epilogue.md):
| Phase | Subject | activeForm |
|---|---|---|
| Load | Loading spec and config | Loading spec and config... |
| Spec compliance | Checking spec compliance | Checking spec compliance... |
| Code quality | Reviewing code quality | Reviewing code quality... |
| Test coverage | Analyzing test coverage | Analyzing test coverage... |
| Architecture | Reviewing architecture | Reviewing architecture... |
| Security | Running security review | Running security review... |
| Performance | Running performance review | Running performance review... |
| Report | Generating review report | Generating review report... |
Tests are not passing
Spec file is incomplete
Implementation files missing
Code cannot be parsed
End-of-skill epilogue: follow ~/.codex/add/references/skill-epilogue.md (observation + learning checkpoint + progress tracking). Note: this skill is READ-ONLY with respect to project code — the epilogue's observation line and learning entry are the only writes it makes.