pi-superpowers 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +83 -0
  3. package/banner.jpg +0 -0
  4. package/extensions/plan-tracker.ts +324 -0
  5. package/package.json +29 -0
  6. package/skills/brainstorming/SKILL.md +55 -0
  7. package/skills/dispatching-parallel-agents/SKILL.md +184 -0
  8. package/skills/executing-plans/SKILL.md +86 -0
  9. package/skills/finishing-a-development-branch/SKILL.md +202 -0
  10. package/skills/receiving-code-review/SKILL.md +213 -0
  11. package/skills/requesting-code-review/SKILL.md +111 -0
  12. package/skills/requesting-code-review/code-reviewer.md +146 -0
  13. package/skills/subagent-driven-development/SKILL.md +249 -0
  14. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
  15. package/skills/subagent-driven-development/implementer-prompt.md +78 -0
  16. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  17. package/skills/systematic-debugging/SKILL.md +298 -0
  18. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  19. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  20. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  21. package/skills/systematic-debugging/find-polluter.sh +63 -0
  22. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  23. package/skills/test-driven-development/SKILL.md +373 -0
  24. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  25. package/skills/using-git-worktrees/SKILL.md +217 -0
  26. package/skills/verification-before-completion/SKILL.md +139 -0
  27. package/skills/writing-plans/SKILL.md +118 -0
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: requesting-code-review
3
+ description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
4
+ ---
5
+
6
+ > **Related skills:** Before requesting review, verify with `/skill:verification-before-completion` that tests pass.
7
+
8
+ # Requesting Code Review
9
+
10
+ Dispatch a subagent with the code-reviewer prompt template to catch issues before they cascade.
11
+
12
+ **Core principle:** Review early, review often.
13
+
14
+ ## When to Request Review
15
+
16
+ **Mandatory:**
17
+ - After each task in subagent-driven development
18
+ - After completing major feature
19
+ - Before merge to main
20
+
21
+ **Optional but valuable:**
22
+ - When stuck (fresh perspective)
23
+ - Before refactoring (baseline check)
24
+ - After fixing complex bug
25
+
26
+ ## How to Request
27
+
28
+ **1. Get git SHAs:**
29
+ ```bash
30
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
31
+ HEAD_SHA=$(git rev-parse HEAD)
32
+ ```
33
+
34
+ **2. Dispatch code-reviewer subagent:**
35
+
36
+ Fill the template at `code-reviewer.md` in this skill directory, then dispatch a subagent with it.
37
+
38
+ **How to dispatch:**
39
+ - If a dispatch tool is available (e.g. pi-superteam's `team` tool), use it
40
+ - Otherwise, run a second pi instance: `pi -p "prompt from template"`
41
+
42
+ **Placeholders:**
43
+ - `{WHAT_WAS_IMPLEMENTED}` - What you just built
44
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
45
+ - `{BASE_SHA}` - Starting commit
46
+ - `{HEAD_SHA}` - Ending commit
47
+ - `{DESCRIPTION}` - Brief summary
48
+
49
+ **3. Act on feedback:**
50
+ - Fix Critical issues immediately
51
+ - Fix Important issues before proceeding
52
+ - Note Minor issues for later
53
+ - Push back if reviewer is wrong (with reasoning)
54
+
55
+ ## Example
56
+
57
+ ```
58
+ [Just completed Task 2: Add verification function]
59
+
60
+ You: Let me request code review before proceeding.
61
+
62
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
63
+ HEAD_SHA=$(git rev-parse HEAD)
64
+
65
+ [Dispatch code-reviewer subagent]
66
+ WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
67
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
68
+ BASE_SHA: a7981ec
69
+ HEAD_SHA: 3df7661
70
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
71
+
72
+ [Subagent returns]:
73
+ Strengths: Clean architecture, real tests
74
+ Issues:
75
+ Important: Missing progress indicators
76
+ Minor: Magic number (100) for reporting interval
77
+ Assessment: Ready to proceed
78
+
79
+ You: [Fix progress indicators]
80
+ [Continue to Task 3]
81
+ ```
82
+
83
+ ## Integration with Workflows
84
+
85
+ **Subagent-Driven Development:**
86
+ - Review after EACH task
87
+ - Catch issues before they compound
88
+ - Fix before moving to next task
89
+
90
+ **Executing Plans:**
91
+ - Review after each batch (3 tasks)
92
+ - Get feedback, apply, continue
93
+
94
+ **Ad-Hoc Development:**
95
+ - Review before merge
96
+ - Review when stuck
97
+
98
+ ## Red Flags
99
+
100
+ **Never:**
101
+ - Skip review because "it's simple"
102
+ - Ignore Critical issues
103
+ - Proceed with unfixed Important issues
104
+ - Argue with valid technical feedback
105
+
106
+ **If reviewer wrong:**
107
+ - Push back with technical reasoning
108
+ - Show code/tests that prove it works
109
+ - Request clarification
110
+
111
+ See template at: `code-reviewer.md` in this skill directory
@@ -0,0 +1,146 @@
1
+ # Code Review Agent
2
+
3
+ You are reviewing code changes for production readiness.
4
+
5
+ **Your task:**
6
+ 1. Review {WHAT_WAS_IMPLEMENTED}
7
+ 2. Compare against {PLAN_OR_REQUIREMENTS}
8
+ 3. Check code quality, architecture, testing
9
+ 4. Categorize issues by severity
10
+ 5. Assess production readiness
11
+
12
+ ## What Was Implemented
13
+
14
+ {DESCRIPTION}
15
+
16
+ ## Requirements/Plan
17
+
18
+ {PLAN_REFERENCE}
19
+
20
+ ## Git Range to Review
21
+
22
+ **Base:** {BASE_SHA}
23
+ **Head:** {HEAD_SHA}
24
+
25
+ ```bash
26
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
27
+ git diff {BASE_SHA}..{HEAD_SHA}
28
+ ```
29
+
30
+ ## Review Checklist
31
+
32
+ **Code Quality:**
33
+ - Clean separation of concerns?
34
+ - Proper error handling?
35
+ - Type safety (if applicable)?
36
+ - DRY principle followed?
37
+ - Edge cases handled?
38
+
39
+ **Architecture:**
40
+ - Sound design decisions?
41
+ - Scalability considerations?
42
+ - Performance implications?
43
+ - Security concerns?
44
+
45
+ **Testing:**
46
+ - Tests actually test logic (not mocks)?
47
+ - Edge cases covered?
48
+ - Integration tests where needed?
49
+ - All tests passing?
50
+
51
+ **Requirements:**
52
+ - All plan requirements met?
53
+ - Implementation matches spec?
54
+ - No scope creep?
55
+ - Breaking changes documented?
56
+
57
+ **Production Readiness:**
58
+ - Migration strategy (if schema changes)?
59
+ - Backward compatibility considered?
60
+ - Documentation complete?
61
+ - No obvious bugs?
62
+
63
+ ## Output Format
64
+
65
+ ### Strengths
66
+ [What's well done? Be specific.]
67
+
68
+ ### Issues
69
+
70
+ #### Critical (Must Fix)
71
+ [Bugs, security issues, data loss risks, broken functionality]
72
+
73
+ #### Important (Should Fix)
74
+ [Architecture problems, missing features, poor error handling, test gaps]
75
+
76
+ #### Minor (Nice to Have)
77
+ [Code style, optimization opportunities, documentation improvements]
78
+
79
+ **For each issue:**
80
+ - File:line reference
81
+ - What's wrong
82
+ - Why it matters
83
+ - How to fix (if not obvious)
84
+
85
+ ### Recommendations
86
+ [Improvements for code quality, architecture, or process]
87
+
88
+ ### Assessment
89
+
90
+ **Ready to merge?** [Yes/No/With fixes]
91
+
92
+ **Reasoning:** [Technical assessment in 1-2 sentences]
93
+
94
+ ## Critical Rules
95
+
96
+ **DO:**
97
+ - Categorize by actual severity (not everything is Critical)
98
+ - Be specific (file:line, not vague)
99
+ - Explain WHY issues matter
100
+ - Acknowledge strengths
101
+ - Give clear verdict
102
+
103
+ **DON'T:**
104
+ - Say "looks good" without checking
105
+ - Mark nitpicks as Critical
106
+ - Give feedback on code you didn't review
107
+ - Be vague ("improve error handling")
108
+ - Avoid giving a clear verdict
109
+
110
+ ## Example Output
111
+
112
+ ```
113
+ ### Strengths
114
+ - Clean database schema with proper migrations (db.ts:15-42)
115
+ - Comprehensive test coverage (18 tests, all edge cases)
116
+ - Good error handling with fallbacks (summarizer.ts:85-92)
117
+
118
+ ### Issues
119
+
120
+ #### Important
121
+ 1. **Missing help text in CLI wrapper**
122
+ - File: index-conversations:1-31
123
+ - Issue: No --help flag, users won't discover --concurrency
124
+ - Fix: Add --help case with usage examples
125
+
126
+ 2. **Date validation missing**
127
+ - File: search.ts:25-27
128
+ - Issue: Invalid dates silently return no results
129
+ - Fix: Validate ISO format, throw error with example
130
+
131
+ #### Minor
132
+ 1. **Progress indicators**
133
+ - File: indexer.ts:130
134
+ - Issue: No "X of Y" counter for long operations
135
+ - Impact: Users don't know how long to wait
136
+
137
+ ### Recommendations
138
+ - Add progress reporting for user experience
139
+ - Consider config file for excluded projects (portability)
140
+
141
+ ### Assessment
142
+
143
+ **Ready to merge: With fixes**
144
+
145
+ **Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
146
+ ```
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: subagent-driven-development
3
+ description: Use when executing implementation plans with independent tasks in the current session
4
+ ---
5
+
6
+ > **Related skills:** Need an isolated workspace? `/skill:using-git-worktrees`. Need a plan first? `/skill:writing-plans`. Done? `/skill:finishing-a-development-branch`.
7
+
8
+ # Subagent-Driven Development
9
+
10
+ Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
11
+
12
+ **Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
13
+
14
+ ## When to Use
15
+
16
+ ```dot
17
+ digraph when_to_use {
18
+ "Have implementation plan?" [shape=diamond];
19
+ "Tasks mostly independent?" [shape=diamond];
20
+ "Stay in this session?" [shape=diamond];
21
+ "subagent-driven-development" [shape=box];
22
+ "executing-plans" [shape=box];
23
+ "Manual execution or brainstorm first" [shape=box];
24
+
25
+ "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
26
+ "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
27
+ "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
28
+ "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
29
+ "Stay in this session?" -> "subagent-driven-development" [label="yes"];
30
+ "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
31
+ }
32
+ ```
33
+
34
+ **vs. Executing Plans (parallel session):**
35
+ - Same session (no context switch)
36
+ - Fresh subagent per task (no context pollution)
37
+ - Two-stage review after each task: spec compliance first, then code quality
38
+ - Faster iteration (no human-in-loop between tasks)
39
+
40
+ ## The Process
41
+
42
+ ```dot
43
+ digraph process {
44
+ rankdir=TB;
45
+
46
+ subgraph cluster_per_task {
47
+ label="Per Task";
48
+ "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
49
+ "Implementer subagent asks questions?" [shape=diamond];
50
+ "Answer questions, provide context" [shape=box];
51
+ "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
52
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
53
+ "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
54
+ "Implementer subagent fixes spec gaps" [shape=box];
55
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
56
+ "Code quality reviewer subagent approves?" [shape=diamond];
57
+ "Implementer subagent fixes quality issues" [shape=box];
58
+ "Mark task complete via plan_tracker tool" [shape=box];
59
+ }
60
+
61
+ "Read plan, extract all tasks with full text, note context, initialize plan_tracker tool" [shape=box];
62
+ "More tasks remain?" [shape=diamond];
63
+ "Dispatch final code reviewer subagent for entire implementation" [shape=box];
64
+ "Use /skill:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
65
+
66
+ "Read plan, extract all tasks with full text, note context, initialize plan_tracker tool" -> "Dispatch implementer subagent (./implementer-prompt.md)";
67
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
68
+ "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
69
+ "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
70
+ "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
71
+ "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
72
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
73
+ "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
74
+ "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
75
+ "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
76
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
77
+ "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
78
+ "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
79
+ "Code quality reviewer subagent approves?" -> "Mark task complete via plan_tracker tool" [label="yes"];
80
+ "Mark task complete via plan_tracker tool" -> "More tasks remain?";
81
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
82
+ "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
83
+ "Dispatch final code reviewer subagent for entire implementation" -> "Use /skill:finishing-a-development-branch";
84
+ }
85
+ ```
86
+
87
+ ## Prompt Templates
88
+
89
+ - `./implementer-prompt.md` - Dispatch implementer subagent
90
+ - `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
91
+ - `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
92
+
93
+ **How to dispatch:**
94
+ - If a dispatch tool is available (e.g. pi-superteam's `team` tool), use it
95
+ - Otherwise, run a second pi instance: `pi -p "prompt from template"`
96
+ - For parallel tasks, use multiple terminal panes (one per task)
97
+
98
+ ## Example Workflow
99
+
100
+ ```
101
+ You: I'm using Subagent-Driven Development to execute this plan.
102
+
103
+ [Read plan file once: docs/plans/feature-plan.md]
104
+ [Extract all 5 tasks with full text and context]
105
+ [Initialize plan_tracker tool with all tasks]
106
+
107
+ Task 1: Hook installation script
108
+
109
+ [Get Task 1 text and context (already extracted)]
110
+ [Dispatch implementation subagent with full task text + context]
111
+
112
+ Implementer: "Before I begin - should the hook be installed at user or system level?"
113
+
114
+ You: "User level (~/.config/superpowers/hooks/)"
115
+
116
+ Implementer: "Got it. Implementing now..."
117
+ [Later] Implementer:
118
+ - Implemented install-hook command
119
+ - Added tests, 5/5 passing
120
+ - Self-review: Found I missed --force flag, added it
121
+ - Committed
122
+
123
+ [Dispatch spec compliance reviewer]
124
+ Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
125
+
126
+ [Get git SHAs, dispatch code quality reviewer]
127
+ Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
128
+
129
+ [Mark Task 1 complete]
130
+
131
+ Task 2: Recovery modes
132
+
133
+ [Get Task 2 text and context (already extracted)]
134
+ [Dispatch implementation subagent with full task text + context]
135
+
136
+ Implementer: [No questions, proceeds]
137
+ Implementer:
138
+ - Added verify/repair modes
139
+ - 8/8 tests passing
140
+ - Self-review: All good
141
+ - Committed
142
+
143
+ [Dispatch spec compliance reviewer]
144
+ Spec reviewer: ❌ Issues:
145
+ - Missing: Progress reporting (spec says "report every 100 items")
146
+ - Extra: Added --json flag (not requested)
147
+
148
+ [Implementer fixes issues]
149
+ Implementer: Removed --json flag, added progress reporting
150
+
151
+ [Spec reviewer reviews again]
152
+ Spec reviewer: ✅ Spec compliant now
153
+
154
+ [Dispatch code quality reviewer]
155
+ Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
156
+
157
+ [Implementer fixes]
158
+ Implementer: Extracted PROGRESS_INTERVAL constant
159
+
160
+ [Code reviewer reviews again]
161
+ Code reviewer: ✅ Approved
162
+
163
+ [Mark Task 2 complete]
164
+
165
+ ...
166
+
167
+ [After all tasks]
168
+ [Dispatch final code-reviewer]
169
+ Final reviewer: All requirements met, ready to merge
170
+
171
+ Done!
172
+ ```
173
+
174
+ ## Advantages
175
+
176
+ **vs. Manual execution:**
177
+ - Subagents follow TDD naturally
178
+ - Fresh context per task (no confusion)
179
+ - Parallel-safe (subagents don't interfere)
180
+ - Subagent can ask questions (before AND during work)
181
+
182
+ **vs. Executing Plans:**
183
+ - Same session (no handoff)
184
+ - Continuous progress (no waiting)
185
+ - Review checkpoints automatic
186
+
187
+ **Efficiency gains:**
188
+ - No file reading overhead (controller provides full text)
189
+ - Controller curates exactly what context is needed
190
+ - Subagent gets complete information upfront
191
+ - Questions surfaced before work begins (not after)
192
+
193
+ **Quality gates:**
194
+ - Self-review catches issues before handoff
195
+ - Two-stage review: spec compliance, then code quality
196
+ - Review loops ensure fixes actually work
197
+ - Spec compliance prevents over/under-building
198
+ - Code quality ensures implementation is well-built
199
+
200
+ **Cost:**
201
+ - More subagent invocations (implementer + 2 reviewers per task)
202
+ - Controller does more prep work (extracting all tasks upfront)
203
+ - Review loops add iterations
204
+ - But catches issues early (cheaper than debugging later)
205
+
206
+ ## Red Flags
207
+
208
+ **Never:**
209
+ - Start implementation on main/master branch without explicit user consent
210
+ - Skip reviews (spec compliance OR code quality)
211
+ - Proceed with unfixed issues
212
+ - Dispatch multiple implementation subagents in parallel (conflicts)
213
+ - Make subagent read plan file (provide full text instead)
214
+ - Skip scene-setting context (subagent needs to understand where task fits)
215
+ - Ignore subagent questions (answer before letting them proceed)
216
+ - Accept "close enough" on spec compliance (spec reviewer found issues = not done)
217
+ - Skip review loops (reviewer found issues = implementer fixes = review again)
218
+ - Let implementer self-review replace actual review (both are needed)
219
+ - **Start code quality review before spec compliance is ✅** (wrong order)
220
+ - Move to next task while either review has open issues
221
+
222
+ **If subagent asks questions:**
223
+ - Answer clearly and completely
224
+ - Provide additional context if needed
225
+ - Don't rush them into implementation
226
+
227
+ **If reviewer finds issues:**
228
+ - Implementer (same subagent) fixes them
229
+ - Reviewer reviews again
230
+ - Repeat until approved
231
+ - Don't skip the re-review
232
+
233
+ **If subagent fails task:**
234
+ - Dispatch fix subagent with specific instructions
235
+ - Don't try to fix manually (context pollution)
236
+
237
+ ## Integration
238
+
239
+ **Required workflow skills:**
240
+ - **`/skill:using-git-worktrees`** - REQUIRED: Set up isolated workspace before starting
241
+ - **`/skill:writing-plans`** - Creates the plan this skill executes
242
+ - **`/skill:requesting-code-review`** - Code review template for reviewer subagents
243
+ - **`/skill:finishing-a-development-branch`** - Complete development after all tasks
244
+
245
+ **Subagents should use:**
246
+ - **`/skill:test-driven-development`** - Subagents follow TDD for each task
247
+
248
+ **Alternative workflow:**
249
+ - **`/skill:executing-plans`** - Use for parallel session instead of same-session execution
@@ -0,0 +1,20 @@
1
+ # Code Quality Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code quality reviewer subagent.
4
+
5
+ **Purpose:** Verify implementation is well-built (clean, tested, maintainable)
6
+
7
+ **Only dispatch after spec compliance review passes.**
8
+
9
+ ```
10
+ Dispatch a subagent with the code-reviewer template:
11
+ Use the template at ./code-reviewer.md (in the requesting-code-review skill directory)
12
+
13
+ WHAT_WAS_IMPLEMENTED: [from implementer's report]
14
+ PLAN_OR_REQUIREMENTS: Task N from [plan-file]
15
+ BASE_SHA: [commit before task]
16
+ HEAD_SHA: [current commit]
17
+ DESCRIPTION: [task summary]
18
+ ```
19
+
20
+ **Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment
@@ -0,0 +1,78 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementer subagent.
4
+
5
+ ```
6
+ Dispatch a subagent with this prompt:
7
+ description: "Implement Task N: [task name]"
8
+ prompt: |
9
+ You are implementing Task N: [task name]
10
+
11
+ ## Task Description
12
+
13
+ [FULL TEXT of task from plan - paste it here, don't make subagent read file]
14
+
15
+ ## Context
16
+
17
+ [Scene-setting: where this fits, dependencies, architectural context]
18
+
19
+ ## Before You Begin
20
+
21
+ If you have questions about:
22
+ - The requirements or acceptance criteria
23
+ - The approach or implementation strategy
24
+ - Dependencies or assumptions
25
+ - Anything unclear in the task description
26
+
27
+ **Ask them now.** Raise any concerns before starting work.
28
+
29
+ ## Your Job
30
+
31
+ Once you're clear on requirements:
32
+ 1. Implement exactly what the task specifies
33
+ 2. Write tests (following TDD if task says to)
34
+ 3. Verify implementation works
35
+ 4. Commit your work
36
+ 5. Self-review (see below)
37
+ 6. Report back
38
+
39
+ Work from: [directory]
40
+
41
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
42
+ It's always OK to pause and clarify. Don't guess or make assumptions.
43
+
44
+ ## Before Reporting Back: Self-Review
45
+
46
+ Review your work with fresh eyes. Ask yourself:
47
+
48
+ **Completeness:**
49
+ - Did I fully implement everything in the spec?
50
+ - Did I miss any requirements?
51
+ - Are there edge cases I didn't handle?
52
+
53
+ **Quality:**
54
+ - Is this my best work?
55
+ - Are names clear and accurate (match what things do, not how they work)?
56
+ - Is the code clean and maintainable?
57
+
58
+ **Discipline:**
59
+ - Did I avoid overbuilding (YAGNI)?
60
+ - Did I only build what was requested?
61
+ - Did I follow existing patterns in the codebase?
62
+
63
+ **Testing:**
64
+ - Do tests actually verify behavior (not just mock behavior)?
65
+ - Did I follow TDD if required?
66
+ - Are tests comprehensive?
67
+
68
+ If you find issues during self-review, fix them now before reporting.
69
+
70
+ ## Report Format
71
+
72
+ When done, report:
73
+ - What you implemented
74
+ - What you tested and test results
75
+ - Files changed
76
+ - Self-review findings (if any)
77
+ - Any issues or concerns
78
+ ```
@@ -0,0 +1,61 @@
1
+ # Spec Compliance Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a spec compliance reviewer subagent.
4
+
5
+ **Purpose:** Verify implementer built what was requested (nothing more, nothing less)
6
+
7
+ ```
8
+ Dispatch a subagent with this prompt:
9
+ description: "Review spec compliance for Task N"
10
+ prompt: |
11
+ You are reviewing whether an implementation matches its specification.
12
+
13
+ ## What Was Requested
14
+
15
+ [FULL TEXT of task requirements]
16
+
17
+ ## What Implementer Claims They Built
18
+
19
+ [From implementer's report]
20
+
21
+ ## CRITICAL: Do Not Trust the Report
22
+
23
+ The implementer finished suspiciously quickly. Their report may be incomplete,
24
+ inaccurate, or optimistic. You MUST verify everything independently.
25
+
26
+ **DO NOT:**
27
+ - Take their word for what they implemented
28
+ - Trust their claims about completeness
29
+ - Accept their interpretation of requirements
30
+
31
+ **DO:**
32
+ - Read the actual code they wrote
33
+ - Compare actual implementation to requirements line by line
34
+ - Check for missing pieces they claimed to implement
35
+ - Look for extra features they didn't mention
36
+
37
+ ## Your Job
38
+
39
+ Read the implementation code and verify:
40
+
41
+ **Missing requirements:**
42
+ - Did they implement everything that was requested?
43
+ - Are there requirements they skipped or missed?
44
+ - Did they claim something works but didn't actually implement it?
45
+
46
+ **Extra/unneeded work:**
47
+ - Did they build things that weren't requested?
48
+ - Did they over-engineer or add unnecessary features?
49
+ - Did they add "nice to haves" that weren't in spec?
50
+
51
+ **Misunderstandings:**
52
+ - Did they interpret requirements differently than intended?
53
+ - Did they solve the wrong problem?
54
+ - Did they implement the right feature but wrong way?
55
+
56
+ **Verify by reading code, not by trusting report.**
57
+
58
+ Report:
59
+ - ✅ Spec compliant (if everything matches after code inspection)
60
+ - ❌ Issues found: [list specifically what's missing or extra, with file:line references]
61
+ ```