AID Phase 4 - Development phase. Use for implementing features, TDD practices, code reviews, transitioning from planning to QA.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Comprehensive code review for commits and pull requests. Covers security, TDD, code quality, and documentation standards.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Review in this order, stopping only to record findings:
Code Changes -> Security Scan (P1) -> TDD Validation (P2) -> Code Quality -> Verdict
Deep examples live in references/. Do not re-derive them here:
references/security-patterns.md - per-language vulnerable/safe pairsreferences/tdd-patterns.md - TDD process + test quality examplesreferences/review-templates.md - copy-paste review templatesreferences/iso27001-guidelines.md - compliance checklistreferences/validation-false-positives.md - anti-patterns when reviewing validation/audit code| Vulnerability | Red Flag |
|---|---|
| Injection | String concatenation in queries |
| Broken Auth | Plain text passwords, weak tokens |
| Sensitive Data Exposure | Secrets in logs |
| XSS | innerHTML, dangerouslySetInnerHTML |
| Broken Access Control | Missing permission checks |
| Risk | BAD | GOOD |
|---|---|---|
| SQL Injection | const query = `SELECT * FROM users WHERE id = ${userId}`; | const query = 'SELECT * FROM users WHERE id = ?'; db.query(query, [userId]); |
| XSS | element.innerHTML = userInput; | element.textContent = userInput; |
| Command injection | exec(`ls ${userPath}`); | fs.readdir(userPath); |
| Hardcoded secrets | const apiKey = 'sk-1234567890'; | const apiKey = process.env.API_KEY; |
| Question | Expected | Red Flag |
|---|---|---|
| Tests written first? | Yes | Implementation without tests |
| Tests define behavior? | WHAT not HOW | Internal implementation tested |
| Coverage adequate? | Critical paths covered | Only happy path |
| Tests independent? | Run in isolation | Order-dependent |
| Rule | BAD | GOOD |
|---|---|---|
| Test behavior, not internals | jest.spyOn(service, '_privateMethod') then expect(spy).toHaveBeenCalled() (HOW) | const result = service.doThing(); expect(result).toEqual(expectedOutput); (WHAT) |
| Realistic test data | const mockUser = { id: 1, name: 'test' }; | const mockUser = { id: 'usr_abc123', name: 'Jane Smith', email: 'jane@example.com', createdAt: new Date('2024-01-15'), roles: ['user', 'admin'] }; |
| Cover edge cases, not just happy path | only test('creates user', ...) | plus throws on missing email, throws on duplicate username, handles unicode names |
| Pattern | Problem |
|---|---|
catch (e) { } | Silent exception |
| TODO, FIXME, HACK | Incomplete work |
| Commented-out code | Dead code |
any overuse | Type safety bypassed |
| Bad | Good |
|---|---|
if (status === 3) | if (status === Status.APPROVED) |
setTimeout(fn, 5000) | setTimeout(fn, TIMEOUT_MS) |
'http://localhost:3000' | process.env.API_URL |
| Symptom Fix (Bad) | Root Cause Fix (Good) |
|---|---|
| Add null check where crash occurs | Validate data at entry point |
| Retry failed request 3 times | Fix why request fails |
| Catch and ignore error | Handle error appropriately |
| Add delay to avoid race condition | Fix the race condition |
| Level | Required |
|---|---|
| File | @file, @description, @related |
| Class | Purpose, responsibilities |
| Function | @param, @returns, @throws |
// BAD: No documentation
export function createUser(data) {
return db.create(data);
}
// GOOD: Full documentation
/**
* Creates a new user account with validation.
*
* @param data - User creation input
* @returns Created user object
* @throws {ValidationError} If email invalid
*
* @related
* - ./UserRepository.ts - Database persistence
* - ../validators/email.ts - Email validation
*/
export async function createUser(data: CreateUserInput): Promise<User>
| Flag | Severity | Action |
|---|---|---|
| SQL/Command injection | CRITICAL | Block |
| Hardcoded secrets | CRITICAL | Block |
| XSS vulnerability | CRITICAL | Block |
| No tests for new code | MAJOR | Request tests |
| Tests modified to pass | MAJOR | Investigate |
| Silent exception catch | MAJOR | Require logging |
| Missing file header | MAJOR | Add docs |
# Code Review: [Branch/PR]
## Summary
| Metric | Value |
|--------|-------|
| Files reviewed | X |
| Security issues | X (Y critical) |
| TDD compliance | Y/N |
| Verdict | Ready/Review/Rework |
## Security Issues
### Critical
1. **[Type]** - `file:line`
- Problem: [desc]
- Impact: [potential damage]
- Fix: [solution]
## TDD Issues
1. **[Issue]** - `file:line`
- Fix: [tests to add]
## Code Quality Issues
[issues]
## Verdict
[decision + reasoning]
### Required Before Merge
- [ ] [action item]
# Check for secrets
grep -r "password\|secret\|api_key\|token" --include="*.ts"
# Check for SQL injection
grep -r "SELECT.*\${" --include="*.ts"
# Check for XSS
grep -r "innerHTML\|dangerouslySetInnerHTML" --include="*.tsx"
# Check test coverage
npm test -- --coverage
# Verify tests exist for changed files
| Condition | Verdict |
|---|---|
| Any critical security | Needs Rework |
| No tests for new functionality | Needs Review |
| Minor issues only | Ready (with suggestions) |
| No issues | Ready to merge |
<decision-transparency>
**Decision:** Approve with minor suggestions (Ready)
**Reasoning:**
- **Security**: No vulnerabilities found
- **Testing**: All new code has tests
- **Quality**: Minor naming suggestions only
**Issues Found:**
1. Minor: Variable name `d` could be `data` (line 42)
2. Minor: Consider extracting magic number 5 to constant
**Confidence:** High - Standard approval scenario
</decision-transparency>
<debate-invitation>
**Topic:** Handling of deprecated API usage
**Option A: Block Until Fixed**
- Pros: No technical debt
- Cons: Delays release
**Option B: Approve with Follow-up Task**
- Pros: Pragmatic, allows progress
- Cons: Debt may linger
**My Lean:** Option B - Create ticket, set deadline
**Your Input Needed:** Is there a release deadline? How critical is this code path?
</debate-invitation>
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
AID Phase 4 - Development phase. Use for implementing features, TDD practices, code reviews, transitioning from planning to QA.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AID Phase 0 - Research & discovery. Use for validating problem spaces, identifying stakeholders, defining success metrics, deciding whether to proceed.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AID Phase 3 - Implementation Planning with consolidation-first approach. Resolves contradictions between PRD and Tech Spec, creates consolidated master document, then breaks down into actionable tasks and populates Jira. Includes sprint planning and risk assessment.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AID Phase 1 - PRD creation. Use for user stories, acceptance criteria, scoping features, transitioning from discovery to tech spec.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AID Phase 5 - QA and Release. Use for validating implementations, acceptance tests, preparing releases, deployment, operational readiness.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AID Phase 2 - Technical Specification. Use for system architecture, API contracts, data models, security architecture, transitioning from PRD to implementation.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.