| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /code-review |
| Aliases | /review, /pr:review |
| Category | kobic-development |
| Complexity | moderate |
| MCP Servers | serena, 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) ๊ฒฐ๊ณผํ ํํ๋ก ์ถ๋ ฅ (์น๋ช ์ ๋ฌธ์ ์ ์ฐธ๊ณ ์ฌํญ ๋ถ๋ฆฌ)
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
-
์คํ ๊ฑธ๋ฌ๋ด๊ธฐ ์ค๋น โ ํ๋ฌ๊ทธ์ธ ๊ธฐ๋ณธ ๊ท์น๊ณผ ํ๋ก์ ํธ ์์ฒด ๊ท์น(
.code-review-suppress.md)์ ๋ถ๋ฌ์ ์๋ชป๋ ์ง์ ์ ๋ฏธ๋ฆฌ ๊ฑฐ๋ฅผ ์ค๋น๋ฅผ ํฉ๋๋ค. - 8๊ฐ ํญ๋ชฉ ์ ๊ฒ โ ์ํคํ ์ฒ๋ถํฐ ์ ๊ทผ์ฑ๊น์ง 8๊ฐ ๊ธฐ์ค์ผ๋ก ์ฝ๋๋ฅผ ํ๋์ฉ ์ดํด๋ด ๋๋ค. (ํ์ํ๋ฉด Serena๋ก ์ฝ๋ ๊ตฌ์กฐ๋ฅผ, Context7๋ก ๋ชจ๋ฒ ์ฌ๋ก๋ฅผ ํจ๊ป ํ์ธ)
- ๊ฒฐ๊ณผ ์ ๋ฆฌ โ ํญ๋ชฉ๋ณ ๋ณ์ ์์ฝํ์ ํจ๊ป ๋ฌธ์ ๋ฅผ ๐ด์น๋ช ์ ยท๐ก๊ฐ์ ยท๐ข์ ์์ผ๋ก ๋๋ ๋ณด์ฌ์ฃผ๊ณ , ๊ฑธ๋ฌ๋ธ ํญ๋ชฉ๋ ๋ฐ๋ก ํ์ํฉ๋๋ค.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / 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#
| Parameter | Required | Description | Example |
|---|---|---|---|
target | โ | Review target | File path, PR link |
--focus | โ | Focus category | security, 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#
- Plugin default:
cc-code-quality/rules/suppression.md - 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-suppressoption
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 โ ExcludedAutomation 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 formatMCP Integration#
| Step | MCP Server | Purpose |
|---|---|---|
| Code analysis | Serena | Symbol and reference search |
| Pattern verification | Context7 | Best practices validation |
Examples#
File review#
/code-review feature/auth/lib/src/presentation/bloc/login_bloc.dartSecurity-focused review#
/code-review feature/auth/ --focus securityQuick review#
/code-review . --quickReferences#
- Detailed checklist:
.claude/prompts/code-review.md - PR review guide:
.claude/checklists/pr-review.md