| name | code-patterns |
| description | Enforces LSP-first exploration, subagent delegation, and mandatory code review patterns. Use before starting any code work. |
Code Patterns Enforcer
Purpose
์ฝ๋ ์์
์ ์ผ๊ด๋ ํจํด์ ๊ฐ์ ํฉ๋๋ค:
- LSP First: grep/glob ๋์ LSP ๋๊ตฌ ์ฌ์ฉ
- Subagent Delegation: ๋ณต์กํ ์์
์ ์ ๋ฌธ ์์ด์ ํธ์ ์์
- Mandatory Code Review: ์ฝ๋ ๋ณ๊ฒฝ ํ ๋ฆฌ๋ทฐ ํ์
When to Use
- ์ฝ๋ ํ์/๋ถ์ ์์
์์ ์
- ์๋ก์ด ๊ธฐ๋ฅ ๊ตฌํ ์์ ์
- ๋ฆฌํฉํ ๋ง ๋๋ ๋ฒ๊ทธ ์์ ์
- "ํจํด ์ฒดํฌ", "๊ท์น ํ์ธ" ์์ฒญ ์
LSP-First Pattern (MANDATORY)
Before ANY Code Exploration
STOP and ask: Can LSP do this?
| Task | LSP Operation | FORBIDDEN Alternative |
|---|
| ํจ์/ํด๋์ค ์ ์ ์ฐพ๊ธฐ | goToDefinition | โ grep/glob |
| ํ์ผ ๋ด ์ฌ๋ณผ ๊ฐ์ | documentSymbol | โ cat/read entire file |
| ํ๋ก์ ํธ ์ฌ๋ณผ ๊ฒ์ | workspaceSymbol | โ grep |
| ์ฐธ์กฐ ์ถ์ | findReferences | โ grep |
| ํ์
/๋ฌธ์ ์ ๋ณด | hover | โ read entire file |
| ์ธํฐํ์ด์ค ๊ตฌํ์ฒด | goToImplementation | โ grep |
| ํธ์ถ ๊ทธ๋ํ ๋ถ์ | incomingCalls/outgoingCalls | โ manual trace |
LSP Usage Examples
LSP goToDefinition file.ts:25:10
LSP documentSymbol file.ts:1:1
LSP workspaceSymbol file.ts:1:1
LSP findReferences file.ts:25:10
LSP hover file.ts:25:10
When LSP is NOT Available
- LSP ์๋ฒ๊ฐ ํด๋น ํ์ผ ํ์
๋ฏธ์ง์ ์
- ํ
์คํธ ๊ฒ์์ด ๋ช
ํํ ํ์ํ ๊ฒฝ์ฐ (๋ก๊ทธ ๋ฉ์์ง, ์ฃผ์)
- ํ์ผ ํจํด ๊ธฐ๋ฐ ํ์ (์ค์ ํ์ผ ์ฐพ๊ธฐ)
Subagent Delegation Pattern (MANDATORY)
Auto-Trigger Rules
Before starting work, check:
| Condition | Required Agent | Trigger |
|---|
| 3+ ํ์ผ ํ์ ํ์ | Explore | ์๋ |
| 3+ ๋จ๊ณ ๊ตฌํ ํ์ | Plan | ์๋ |
| ์ํคํ
์ฒ ์ดํด ํ์ | Explore | ์๋ |
| ํ์ผ ๋ถ๋ฆฌ/ํด๋์ค ์ถ์ถ | refactoring-expert | ์๋ |
| ์ฝ๋ ๋ณ๊ฒฝ ์๋ฃ | superpowers:code-reviewer | ํญ์ |
| ์์ธ ๋ถ๋ช
ํํ ๋ฒ๊ทธ | root-cause-analyst | ๋ฒ๊ทธ ๋ถ์ |
| ์ธ์ฆ/๊ถํ/API ๋ณด์ | security-engineer | ๋ณด์ ๊ฒํ |
| ์ฑ๋ฅ ์ด์ | performance-engineer | ์ฑ๋ฅ ๋ถ์ |
| ์ธ๋ถ ์ ๋ณด ํ์ | deep-research-agent | ๋ฆฌ์์น |
Delegation Examples
# Explore agent for codebase understanding
Task(Explore, "Find all authentication-related files and understand the auth flow")
# Plan agent for implementation
Task(Plan, "Design implementation strategy for user notification feature")
# Parallel agents for independent tasks
Task(Explore, "Find API endpoints") || Task(Explore, "Find test files")
# Code review after changes (MANDATORY)
Task(superpowers:code-reviewer, "Review the authentication changes")
Self-Check Before Action
Before ANY code work:
โก ์ด ์์
์ด 3๋จ๊ณ ์ด์์ธ๊ฐ? โ Plan agent ์ฌ์ฉ
โก ์ฌ๋ฌ ํ์ผ์ ํ์ํด์ผ ํ๋๊ฐ? โ Explore agent ์ฌ์ฉ
โก ์ฝ๋ ๊ตฌ์กฐ๋ฅผ ๋ณ๊ฒฝํ๋๊ฐ? โ refactoring-expert ์ฌ์ฉ
After ANY code change:
โก ์ฝ๋๋ฅผ ์์ ํ๋๊ฐ? โ code-reviewer ์ฌ์ฉ (ํ์!)
Mandatory Code Review Pattern
When Code Review is REQUIRED
- ๋ชจ๋ ์ฝ๋ ๋ณ๊ฒฝ ํ
- ์ ๊ธฐ๋ฅ ๊ตฌํ ์๋ฃ ํ
- ๋ฒ๊ทธ ์์ ์๋ฃ ํ
- ๋ฆฌํฉํ ๋ง ์๋ฃ ํ
- PR/์ปค๋ฐ ์์ฑ ์
Code Review Workflow
1. ์ฝ๋ ๋ณ๊ฒฝ ์๋ฃ
2. ๋ณ๊ฒฝ ์ฌํญ ํ์ธ (git diff)
3. Code reviewer ํธ์ถ:
Task(superpowers:code-reviewer, "Review changes for [feature/fix]")
4. ํผ๋๋ฐฑ ๋ฐ์
5. ํ์์ ์ฌ๋ฆฌ๋ทฐ
6. ์ปค๋ฐ/PR ์์ฑ
Red Flags - STOP
์ด๋ฐ ์๊ฐ์ด ๋ค๋ฉด ๋ฉ์ถ๊ณ ํจํด ํ์ธ:
| ์๋ชป๋ ์๊ฐ | ์ฌ๋ฐ๋ฅธ ํ๋ |
|---|
| "grep์ผ๋ก ๋นจ๋ฆฌ ์ฐพ์" | LSP workspaceSymbol ์ฌ์ฉ |
| "ํ์ผ ์ฝ์ด์ ํ์ธํ์" | LSP documentSymbol ์ฌ์ฉ |
| "๊ฐ๋จํด์ ๋ฐ๋ก ์์ " | 3๋จ๊ณ ์ด์์ด๋ฉด Plan agent |
| "ํ
์คํธ ํต๊ณผํ์ผ๋ ์๋ฃ" | code-reviewer ํธ์ถ ํ์ |
| "ํผ์ ํ ์ ์์ด" | ๋ณต์กํ๋ฉด subagent ์์ |
Pattern Compliance Checklist
Before Starting
During Work
After Completion
Integration
- superpowers:code-reviewer: ์ฝ๋ ๋ฆฌ๋ทฐ ์์ฒญ
- superpowers:systematic-debugging: ๋ฒ๊ทธ ๋ถ์
- superpowers:test-driven-development: TDD ์ํฌํ๋ก์ฐ