LogoSkills

code-review

Systematic code review based on 8 categories

ํ•ญ๋ชฉ๋‚ด์šฉ
Invoke/code-review
Aliases/review, /pr:review
Categorykobic-development
Complexitymoderate
MCP Serversserena, context7

/code-review โ€” ์ฝ”๋“œ 8๊ฐœ ํ•ญ๋ชฉ ์ž๋™ ์ ๊ฒ€#

ํ•œ๋งˆ๋””๋กœ#

์ž‘์„ฑํ•œ ์ฝ”๋“œ๋ฅผ PR(๋ณ‘ํ•ฉ ์š”์ฒญ)์— ์˜ฌ๋ฆฌ๊ธฐ ์ „, ์ˆ™๋ จ๋œ ๊ฒ€ํ† ์ž๊ฐ€ 8๊ฐ€์ง€ ๊ธฐ์ค€์œผ๋กœ ๊ผผ๊ผผํžˆ ์‚ดํŽด๋ณด๋Š” ๊ฒƒ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ถœํŒ ์ „ ์›๊ณ ๋ฅผ ๊ต์ • ๋ณด๋Š” ๊ฒƒ์ฒ˜๋Ÿผ, ๋ณด์•ˆยท์„ฑ๋Šฅยทํ…Œ์ŠคํŠธ ๋“ฑ ๋น ๋œจ๋ฆฌ๊ธฐ ์‰ฌ์šด ๋ถ€๋ถ„์„ ์ž๋™์œผ๋กœ ์งš์–ด์ค๋‹ˆ๋‹ค.

๋ˆ„๊ฐ€ยท์–ธ์ œ ์“ฐ๋‚˜์š”#

  • ๋™๋ฃŒ์˜ PR์„ ๊ฒ€ํ† (๋ฆฌ๋ทฐ)ํ•ด์•ผ ํ•  ๋•Œ
  • ์ฝ”๋“œ ํ’ˆ์งˆ์„ ํ•œ๋ฒˆ ์ ๊ฒ€ํ•˜๊ณ  ์‹ถ์„ ๋•Œ
  • ์ปค๋ฐ‹(์ฝ”๋“œ ์ €์žฅ)ํ•˜๊ธฐ ์ „์— ์Šค์Šค๋กœ ๋จผ์ € ์‚ดํŽด๋ณด๊ณ  ์‹ถ์„ ๋•Œ

๋ฌด์—‡์„ ํ•ด์ฃผ๋‚˜์š”#

์ฝ”๋“œ๋ฅผ 8๊ฐœ ํ•ญ๋ชฉ์œผ๋กœ ๋‚˜๋ˆ„์–ด ์ ๊ฒ€ํ•˜๊ณ , ๋ณ„์  ์š”์•ฝํ‘œ + ๋ฌธ์ œ ๋ชฉ๋ก์„ ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค.

  • 8๊ฐœ ์ ๊ฒ€ ํ•ญ๋ชฉ: ์•„ํ‚คํ…์ฒ˜ / ์ƒํƒœ ๊ด€๋ฆฌ / ๋ณด์•ˆ / ์„ฑ๋Šฅ / ํ…Œ์ŠคํŠธ / ๊ฐ€๋…์„ฑ / ๋‹ค๊ตญ์–ด(i18n) / ์ ‘๊ทผ์„ฑ
  • ๋ฐœ๊ฒฌ๋œ ๋ฌธ์ œ๋Š” ์‹ฌ๊ฐ๋„๋ณ„๋กœ ๋ถ„๋ฅ˜ โ€” ๐Ÿ”ด ์น˜๋ช…์  / ๐ŸŸก ๊ฐœ์„  / ๐ŸŸข ์ œ์•ˆ
  • ํ”ํ•œ ์˜คํƒ(์ž˜๋ชป๋œ ์ง€์ )์€ ์ž๋™์œผ๋กœ ๊ฑธ๋Ÿฌ์คŒ(์–ต์ œ ๊ทœ์น™). ๊ฑธ๋Ÿฌ์ง„ ํ•ญ๋ชฉ๋„ ๋”ฐ๋กœ ๋ณด์—ฌ์ค˜์„œ ๋น ์ง์—†์ด ํ™•์ธ ๊ฐ€๋Šฅ
  • --gate-mode์—์„œ๋Š” "ํ†ต๊ณผ/์ฐจ๋‹จ" ํ˜•ํƒœ์˜ ๊ด€๋ฌธ(Gate) ๊ฒฐ๊ณผํ‘œ๋กœ ์ •๋ฆฌ โ€” PR ์ƒ์„ฑ์„ ๋ง‰์„ ์น˜๋ช…์  ๋ฌธ์ œ์™€ PR ๋ณธ๋ฌธ์— ๋„ฃ์„ ์ฐธ๊ณ  ์‚ฌํ•ญ์„ ๋ถ„๋ฆฌํ•ด์„œ ๋ณด์—ฌ์คŒ

์–ด๋–ป๊ฒŒ ์“ฐ๋‚˜์š”#

# ํŠน์ • ํŒŒ์ผ ๊ฒ€ํ† 
/code-review feature/auth/lib/src/presentation/bloc/login_bloc.dart

# ๋ณด์•ˆ์— ์ง‘์ค‘ํ•ด์„œ ๊ฒ€ํ† 
/code-review feature/auth/ --focus security

# ๋น ๋ฅด๊ฒŒ ํ›‘์–ด๋ณด๊ธฐ
/code-review . --quick
  • --focus : ํ•œ ํ•ญ๋ชฉ์— ์ง‘์ค‘ (์˜ˆ: security ๋ณด์•ˆ, performance ์„ฑ๋Šฅ)
  • --quick : ๋น ๋ฅธ ๊ฒ€ํ†  ๋ชจ๋“œ / --verbose : ๋” ์ž์„ธํ•œ ๊ฒ€ํ†  ๋ชจ๋“œ
  • --no-suppress : ์˜คํƒ ๊ฑธ๋Ÿฌ๋‚ด๊ธฐ๋ฅผ ๋„๊ณ  ๋ชจ๋“  ์ง€์ ์„ ๋‹ค ๋ณด๊ธฐ
  • --gate-mode : ๊ด€๋ฌธ(Gate) ๊ฒฐ๊ณผํ‘œ ํ˜•ํƒœ๋กœ ์ถœ๋ ฅ (์น˜๋ช…์  ๋ฌธ์ œ์™€ ์ฐธ๊ณ  ์‚ฌํ•ญ ๋ถ„๋ฆฌ)

์•ˆ์—์„œ ๋ฌด์Šจ ์ผ์ด ๋ฒŒ์–ด์ง€๋‚˜์š”#

  1. ์˜คํƒ ๊ฑธ๋Ÿฌ๋‚ด๊ธฐ ์ค€๋น„ โ€” ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ธฐ๋ณธ ๊ทœ์น™๊ณผ ํ”„๋กœ์ ํŠธ ์ž์ฒด ๊ทœ์น™(.code-review-suppress.md)์„ ๋ถˆ๋Ÿฌ์™€ ์ž˜๋ชป๋œ ์ง€์ ์„ ๋ฏธ๋ฆฌ ๊ฑฐ๋ฅผ ์ค€๋น„๋ฅผ ํ•ฉ๋‹ˆ๋‹ค.
  2. 8๊ฐœ ํ•ญ๋ชฉ ์ ๊ฒ€ โ€” ์•„ํ‚คํ…์ฒ˜๋ถ€ํ„ฐ ์ ‘๊ทผ์„ฑ๊นŒ์ง€ 8๊ฐœ ๊ธฐ์ค€์œผ๋กœ ์ฝ”๋“œ๋ฅผ ํ•˜๋‚˜์”ฉ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค. (ํ•„์š”ํ•˜๋ฉด Serena๋กœ ์ฝ”๋“œ ๊ตฌ์กฐ๋ฅผ, Context7๋กœ ๋ชจ๋ฒ” ์‚ฌ๋ก€๋ฅผ ํ•จ๊ป˜ ํ™•์ธ)
  3. ๊ฒฐ๊ณผ ์ •๋ฆฌ โ€” ํ•ญ๋ชฉ๋ณ„ ๋ณ„์  ์š”์•ฝํ‘œ์™€ ํ•จ๊ป˜ ๋ฌธ์ œ๋ฅผ ๐Ÿ”ด์น˜๋ช…์ ยท๐ŸŸก๊ฐœ์„ ยท๐ŸŸข์ œ์•ˆ์œผ๋กœ ๋‚˜๋ˆ  ๋ณด์—ฌ์ฃผ๊ณ , ๊ฑธ๋Ÿฌ๋‚ธ ํ•ญ๋ชฉ๋„ ๋”ฐ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

โš™๏ธ ์ƒ์„ธ ์˜ต์…˜ยท์‹คํ–‰ ๋ช…์„ธ (๊ฐœ๋ฐœ์ž / AI ์—์ด์ „ํŠธ์šฉ)

Triggers#

  • When a PR review is requested
  • When code quality inspection is needed
  • For self-review before committing

Context Trigger Pattern#

/code-review {target} [--options]

Parameters#

ParameterRequiredDescriptionExample
targetโœ…Review targetFile path, PR link
--focusโŒFocus categorysecurity, performance
--quickโŒQuick review mode
--verboseโŒDetailed review mode
--no-suppressโŒDisable suppression
--gate-modeโŒReview Gate mode (separates Critical/Informational output)

Suppression List#

Automatically applies suppression rules during review to reduce false positives.

Loading Order#

  1. Plugin default: cc-code-quality/rules/suppression.md
  2. Project custom: project root .code-review-suppress.md (if exists)

Application Method#

  • Each review finding is compared against the suppression list
  • Matching items are excluded from review results
  • Can be disabled with --no-suppress option

Result Display#

## Suppressed (3 items excluded)
- [Readability] `*.g.dart` generated code pattern (suppression: code generation related)
- [Performance] const not applied (suppression: style/convention related)
- [Architecture] melos import path (suppression: project structure related)

Review Categories#

1. Architecture#

  • Clean Architecture layer separation followed
  • Domain โ†’ Data โ†’ Presentation dependency direction
  • Business logic accessed through UseCases
  • Repository interface separation
  • Feature module independence

2. State Management#

  • BLoC/Cubit pattern followed
  • Event โ†’ BLoC โ†’ State flow
  • Immutable state via sealed class extends Equatable + copyWith (no @freezed)
  • Proper error handling
  • Loading state management

3. Security#

  • No hardcoded API keys or secrets
  • No sensitive information in logs
  • User input sanitization
  • Authentication/authorization properly applied

4. Performance#

  • const widgets utilized
  • BlocBuilder buildWhen used
  • Image cacheWidth/cacheHeight applied
  • Resources released in dispose
  • Stream subscriptions cancelled

5. Testing#

  • UseCase unit tests
  • Repository tests (mocked)
  • BLoC tests
  • Edge cases covered
  • Arrange-Act-Assert pattern

6. Readability#

  • Clear and meaningful naming
  • Project convention followed
  • Appropriate file/class size
  • Single Responsibility Principle
  • Duplicate code removed

7. Internationalization (i18n)#

  • All UI text uses translation keys
  • context.t.* pattern used
  • Proper pluralization
  • Dynamic values parameterized

8. Accessibility#

  • Appropriate semantic labels
  • Minimum 48x48 touch target
  • WCAG color contrast criteria met

Review Output Template#

## Summary

**Overall**: โญโญโญโญโ˜† (4/5)

| Category | Score | Key Issues |
|----------|-------|------------|
| Architecture | โœ… | - |
| State Management | โš ๏ธ | BlocBuilder optimization needed |
| Security | โœ… | - |
| Performance | โš ๏ธ | Image cache size not specified |
| Testing | โŒ | UseCase tests missing |
| Readability | โœ… | - |
| i18n | โœ… | - |
| Accessibility | โš ๏ธ | Some semantic labels missing |

### Critical Issues ๐Ÿ”ด

1. **[Security]** API key hardcoded
   - File: `lib/core/config.dart:15`
   - Fix: Use environment variables via Envied

### Improvements ๐ŸŸก

1. **[Performance]** Image cache size needs to be specified
   - File: `lib/presentation/widget/product_card.dart:42`
   - Recommended: Add `cacheWidth: 200`

### Suggestions ๐ŸŸข

1. **[Readability]** Variable name improvement suggestion
   - `data` โ†’ `userProfile`

### Suppressed (N items excluded)
 >   Items excluded by suppression rules. Use `--no-suppress` to see all.

Gate Mode Output (--gate-mode)#

Structured output for workflow gate when running /code-review --gate-mode:

## Code Review Gate Result

**Status**: โœ… PASS / โŒ BLOCKED

### Critical Issues (Pass 1) ๐Ÿ”ด
 >   Issues that block PR creation

| # | Category | Issue | File | Auto-fix |
|---|----------|-------|------|----------|
| 1 | Security | API key hardcoded | config.dart:15 | โœ… Possible |

### Informational (Pass 2) ๐Ÿ“‹
 >   Improvement suggestions to include in PR body

| # | Category | Issue | File |
|---|----------|-------|------|
| 1 | Performance | Image cache not specified | product_card.dart:42 |

### Summary
- Critical: 0 items โ†’ โœ… Gate passed
- Informational: 3 items โ†’ Included in PR body
- Suppressed: 2 items โ†’ Excluded

Automation Commands#

# Lint check
melos run analyze
melos run lint:check

# Test execution
melos run test
melos run test:with-html-coverage

# Formatting (kobic uses dcm format, not dart format)
melos run format

MCP Integration#

StepMCP ServerPurpose
Code analysisSerenaSymbol and reference search
Pattern verificationContext7Best practices validation

Examples#

File review#

/code-review feature/auth/lib/src/presentation/bloc/login_bloc.dart

Security-focused review#

/code-review feature/auth/ --focus security

Quick review#

/code-review . --quick

References#

  • Detailed checklist: .claude/prompts/code-review.md
  • PR review guide: .claude/checklists/pr-review.md