sdtk-code-kit 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 (55) hide show
  1. package/README.md +138 -0
  2. package/assets/manifest/toolkit-bundle.manifest.json +147 -0
  3. package/assets/manifest/toolkit-bundle.sha256.txt +28 -0
  4. package/assets/toolkit/toolkit/AGENTS.md +210 -0
  5. package/assets/toolkit/toolkit/install.ps1 +126 -0
  6. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -0
  7. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +127 -0
  8. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -0
  9. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +53 -0
  10. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -0
  11. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -0
  12. package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +56 -0
  13. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +297 -0
  14. package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +69 -0
  15. package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -0
  16. package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +75 -0
  17. package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +206 -0
  18. package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +65 -0
  19. package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +27 -0
  20. package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +114 -0
  21. package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +62 -0
  22. package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +86 -0
  23. package/assets/toolkit/toolkit/skills/code-review/SKILL.md +80 -0
  24. package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +126 -0
  25. package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +147 -0
  26. package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +53 -0
  27. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +379 -0
  28. package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +300 -0
  29. package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +145 -0
  30. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +229 -0
  31. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +112 -0
  32. package/bin/sdtk-code.js +14 -0
  33. package/package.json +44 -0
  34. package/src/commands/build.js +53 -0
  35. package/src/commands/generate.js +11 -0
  36. package/src/commands/help.js +169 -0
  37. package/src/commands/init.js +86 -0
  38. package/src/commands/plan.js +52 -0
  39. package/src/commands/runtime.js +205 -0
  40. package/src/commands/ship.js +54 -0
  41. package/src/commands/start.js +89 -0
  42. package/src/commands/verify.js +57 -0
  43. package/src/index.js +70 -0
  44. package/src/lib/args.js +107 -0
  45. package/src/lib/errors.js +41 -0
  46. package/src/lib/powershell.js +65 -0
  47. package/src/lib/scope.js +55 -0
  48. package/src/lib/toolkit-payload.js +72 -0
  49. package/src/lib/workflow-artifact.js +453 -0
  50. package/src/lib/workflow-build.js +127 -0
  51. package/src/lib/workflow-handoff.js +427 -0
  52. package/src/lib/workflow-intake.js +100 -0
  53. package/src/lib/workflow-plan.js +96 -0
  54. package/src/lib/workflow-ship.js +163 -0
  55. package/src/lib/workflow-verify.js +212 -0
@@ -0,0 +1,69 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../../THIRD_PARTY_NOTICES.md for details. -->
2
+ # Root Cause Tracing
3
+
4
+ ## Overview
5
+
6
+ Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom.
7
+
8
+ **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source.
9
+
10
+ ## When to Use
11
+
12
+ ```dot
13
+ digraph when_to_use {
14
+ "Bug appears deep in stack?" [shape=diamond];
15
+ "Can trace backwards?" [shape=diamond];
16
+ "Fix at symptom point" [shape=box];
17
+ "Trace to original trigger" [shape=box];
18
+ "Add validation at the source and boundary checks" [shape=box];
19
+
20
+ "Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"];
21
+ "Can trace backwards?" -> "Trace to original trigger" [label="yes"];
22
+ "Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"];
23
+ "Trace to original trigger" -> "Add validation at the source and boundary checks";
24
+ }
25
+ ```
26
+
27
+ **Use when:**
28
+ - Error happens deep in execution (not at entry point)
29
+ - Stack trace shows long call chain
30
+ - Unclear where invalid data originated
31
+ - Need to find which test/code triggers the problem
32
+
33
+ ## The Tracing Process
34
+
35
+ ### 1. Observe the Symptom
36
+ ```
37
+ Error: git init failed in /Users/jesse/project/packages/core
38
+ ```
39
+
40
+ ### 2. Find Immediate Cause
41
+ **What code directly causes this?**
42
+ ```typescript
43
+ await execFileAsync('git', ['init'], { cwd: projectDir });
44
+ ```
45
+
46
+ ### 3. Ask: What Called This?
47
+ ```typescript
48
+ WorktreeManager.createSessionWorktree(projectDir, sessionId)
49
+ -> called by Session.initializeWorkspace()
50
+ -> called by Session.create()
51
+ -> called by test at Project.create()
52
+ ```
53
+
54
+ ### 4. Keep Tracing Up
55
+ **What value was passed?**
56
+ - `projectDir = ''` (empty string!)
57
+ - Empty string as `cwd` resolves to `process.cwd()`
58
+ - That's the source code directory!
59
+
60
+ ### 5. Find Original Trigger
61
+ **Where did empty string come from?**
62
+ ```typescript
63
+ const context = setupCoreTest(); // Returns { tempDir: '' }
64
+ Project.create('name', context.tempDir); // Accessed before beforeEach!
65
+ ```
66
+
67
+ ## Adding Stack Traces
68
+
69
+ Capture stack context before the dangerous operation, then trace the call chain backward to the original trigger.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: code-discover
3
+ description: Discover SDTK-CODE skills. Use when starting a conversation or unsure which skill to use -- establishes skill discovery and invocation.
4
+ ---
5
+
6
+ # Code Discover
7
+
8
+ ## Critical Constraints
9
+ - I do not guess a workflow when a clearer skill match exists.
10
+ - I do not route straight to implementation when planning, verification, or review should happen first.
11
+
12
+ ## Overview
13
+ Use this skill when you need to discover which SDTK-CODE skill should be used next.
14
+
15
+ ## Skill Catalog
16
+ | Skill | Trigger | Purpose |
17
+ |---|---|---|
18
+ | `code-tdd` | Before writing implementation code | Enforces failing-test-first discipline. |
19
+ | `code-debug` | When a bug or failure appears | Finds root cause before any fix. |
20
+ | `code-verify` | Before claiming work is complete | Requires fresh command evidence. |
21
+ | `code-plan` | When requirements need an implementation plan | Produces executable task order and verification steps. |
22
+ | `code-execute` | When an approved plan exists | Executes work sequentially with checkpoints. |
23
+ | `code-review` | When code needs review or review feedback must be handled | Runs spec-first, quality-second review. |
24
+ | `code-ship` | When the code is ready to prepare for merge or release | Handles pre-flight, versioning, and release prep. |
25
+ | `code-parallel` | When 2+ independent tasks can run safely in parallel | Fans out task slices, then curates fan-in. |
26
+ | `code-brainstorm` | Before creative or ambiguous coding work | Explores approaches before planning. |
27
+ | `code-finish` | When branch work is complete | Presents merge, PR, keep, or discard options. |
28
+ | `code-worktree` | When feature isolation is needed | Creates a safe isolated worktree. |
29
+ | `code-discover` | When you are unsure where to start | Explains the toolkit and routing order. |
30
+
31
+ ## Process
32
+ 1. Read the request and determine whether the user needs planning, execution, verification, review, or shipping.
33
+ 2. Choose the earliest skill in the workflow that closes the biggest risk.
34
+ 3. Route to that skill and explain the handoff in one sentence.
35
+ 4. If multiple skills apply, prefer the one that prevents irreversible mistakes first.
36
+
37
+ ## Priority Order
38
+ 1. Design and plan first: `code-brainstorm`, `code-plan`
39
+ 2. Implementation discipline: `code-tdd`, `code-execute`, `code-parallel`
40
+ 3. Verification and review: `code-debug`, `code-verify`, `code-review`
41
+ 4. Shipping and closure: `code-ship`, `code-finish`, `code-worktree`
42
+
43
+ ## Red Flags
44
+ | Situation | Use Instead |
45
+ |---|---|
46
+ | Writing code without a failing test | `code-tdd` |
47
+ | Fixing a bug by guessing | `code-debug` |
48
+ | Saying "done" without proof | `code-verify` |
49
+ | Jumping into execution without a plan | `code-plan` |
50
+ | Reviewing quality before checking spec compliance | `code-review` |
51
+ | Shipping before verification and review finish | `code-ship` |
52
+
53
+ ## Routing Rule
54
+ If more than one skill seems applicable, choose the earliest skill in the workflow chain that closes the biggest risk.
@@ -0,0 +1,75 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../THIRD_PARTY_NOTICES.md for details. -->
2
+ ---
3
+ name: code-execute
4
+ description: Executing implementation plans. Use when you have a written plan and need to execute it step by step with review checkpoints.
5
+ ---
6
+
7
+ # Code Execute
8
+
9
+ ## Critical Constraints
10
+ - I do not skip ahead of the written plan or silently change task order.
11
+ - I do not continue after a failed checkpoint without recording the issue and correcting course.
12
+
13
+
14
+ ## Overview
15
+
16
+ Load the approved implementation plan, review it critically, execute tasks in order, and stop whenever checkpoints fail.
17
+
18
+ **Announce at start:** "I'm using the code-execute skill to implement this plan."
19
+
20
+
21
+ ## Process
22
+
23
+ ### Step 1: Load and Review Plan
24
+ 1. Read plan file
25
+ 2. Review critically - identify any questions or concerns about the plan
26
+ 3. If concerns: Raise them with the user before starting
27
+ 4. If no concerns: create a task list and proceed
28
+
29
+ ### Step 2: Execute Tasks
30
+
31
+ For each task:
32
+ 1. Mark as in_progress
33
+ 2. Follow each step exactly (plan has bite-sized steps)
34
+ 3. Run verifications as specified
35
+ 4. Mark as completed
36
+
37
+ ### Step 3: Complete Development
38
+
39
+ After all tasks complete and verified:
40
+ - Announce: "I'm using the code-finish skill to complete this work."
41
+ - **REQUIRED SUB-SKILL:** Use code-finish
42
+ - Follow that skill to verify tests, present options, execute choice
43
+
44
+ ## When to Stop and Ask for Help
45
+
46
+ **STOP executing immediately when:**
47
+ - Hit a blocker (missing dependency, test fails, instruction unclear)
48
+ - Plan has critical gaps preventing starting
49
+ - You don't understand an instruction
50
+ - Verification fails repeatedly
51
+
52
+ **Ask for clarification rather than guessing.**
53
+
54
+ ## When to Revisit Earlier Steps
55
+
56
+ **Return to Review (Step 1) when:**
57
+ - Partner updates the plan based on your feedback
58
+ - Fundamental approach needs rethinking
59
+
60
+ **Don't force through blockers** - stop and ask.
61
+
62
+ ## Remember
63
+ - Review plan critically first
64
+ - Follow plan steps exactly
65
+ - Don't skip verifications
66
+ - Reference skills when plan says to
67
+ - Stop when blocked, don't guess
68
+ - Never start implementation on main/master branch without explicit user consent
69
+
70
+ ## Integration
71
+
72
+ **Required workflow skills:**
73
+ - **code-worktree** - Set up an isolated workspace before starting when the work should not happen in the current tree.
74
+ - **code-plan** - Creates the plan this skill executes
75
+ - **code-finish** - Complete development after all tasks
@@ -0,0 +1,206 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../THIRD_PARTY_NOTICES.md for details. -->
2
+ ---
3
+ name: code-finish
4
+ description: Finishing a development branch. Use when implementation is complete and tests pass -- guides merge, PR creation, or cleanup options.
5
+ ---
6
+
7
+ # Code Finish
8
+
9
+ ## Critical Constraints
10
+ - I do not present merge or cleanup options until tests pass for the current branch state.
11
+ - I do not discard work without explicit destructive confirmation.
12
+
13
+
14
+ ## Overview
15
+
16
+ Guide completion of development work by presenting clear options and handling chosen workflow.
17
+
18
+ **Core principle:** Verify tests -> Present options -> Execute choice -> Clean up.
19
+
20
+ **Announce at start:** "I'm using the code-finish skill to complete this work."
21
+
22
+ ## Process
23
+
24
+ ### Step 1: Verify Tests
25
+
26
+ **Before presenting options, verify tests pass:**
27
+
28
+ ```bash
29
+ # Run project's test suite
30
+ npm test / cargo test / pytest / go test ./...
31
+ ```
32
+
33
+ **If tests fail:**
34
+ ```
35
+ Tests failing (<N> failures). Must fix before completing:
36
+
37
+ [Show failures]
38
+
39
+ Cannot proceed with merge/PR until tests pass.
40
+ ```
41
+
42
+ Stop. Don't proceed to Step 2.
43
+
44
+ **If tests pass:** Continue to Step 2.
45
+
46
+ ### Step 2: Determine Base Branch
47
+
48
+ ```bash
49
+ # Try common base branches
50
+ git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
51
+ ```
52
+
53
+ Or ask: "This branch split from main - is that correct?"
54
+
55
+ ### Step 3: Present Options
56
+
57
+ Present exactly these 4 options:
58
+
59
+ ```
60
+ Implementation complete. What would you like to do?
61
+
62
+ 1. Merge back to <base-branch> locally
63
+ 2. Push and create a Pull Request
64
+ 3. Keep the branch as-is (I'll handle it later)
65
+ 4. Discard this work
66
+
67
+ Which option?
68
+ ```
69
+
70
+ **Don't add explanation** - keep options concise.
71
+
72
+ ### Step 4: Execute Choice
73
+
74
+ #### Option 1: Merge Locally
75
+
76
+ ```bash
77
+ # Switch to base branch
78
+ git checkout <base-branch>
79
+
80
+ # Pull latest
81
+ git pull
82
+
83
+ # Merge feature branch
84
+ git merge <feature-branch>
85
+
86
+ # Verify tests on merged result
87
+ <test command>
88
+
89
+ # If tests pass
90
+ git branch -d <feature-branch>
91
+ ```
92
+
93
+ Then: Cleanup worktree (Step 5)
94
+
95
+ #### Option 2: Push and Create PR
96
+
97
+ ```bash
98
+ # Push branch
99
+ git push -u origin <feature-branch>
100
+
101
+ # Create PR
102
+ gh pr create --title "<title>" --body "$(cat <<'EOF'
103
+ ## Summary
104
+ <2-3 bullets of what changed>
105
+
106
+ ## Test Plan
107
+ - [ ] <verification steps>
108
+ EOF
109
+ )"
110
+ ```
111
+
112
+ Then: Cleanup worktree (Step 5)
113
+
114
+ #### Option 3: Keep As-Is
115
+
116
+ Report: "Keeping branch <name>. Worktree preserved at <path>."
117
+
118
+ **Don't cleanup worktree.**
119
+
120
+ #### Option 4: Discard
121
+
122
+ **Confirm first:**
123
+ ```
124
+ This will permanently delete:
125
+ - Branch <name>
126
+ - All commits: <commit-list>
127
+ - Worktree at <path>
128
+
129
+ Type 'discard' to confirm.
130
+ ```
131
+
132
+ Wait for exact confirmation.
133
+
134
+ If confirmed:
135
+ ```bash
136
+ git checkout <base-branch>
137
+ git branch -D <feature-branch>
138
+ ```
139
+
140
+ Then: Cleanup worktree (Step 5)
141
+
142
+ ### Step 5: Cleanup Worktree
143
+
144
+ **For Options 1, 2, 4:**
145
+
146
+ Check if in worktree:
147
+ ```bash
148
+ git worktree list | grep $(git branch --show-current)
149
+ ```
150
+
151
+ If yes:
152
+ ```bash
153
+ git worktree remove <worktree-path>
154
+ ```
155
+
156
+ **For Option 3:** Keep worktree.
157
+
158
+ ## Quick Reference
159
+
160
+ | Option | Merge | Push | Keep Worktree | Cleanup Branch |
161
+ |--------|-------|------|---------------|----------------|
162
+ | 1. Merge locally | | - | - | |
163
+ | 2. Create PR | - | | | - |
164
+ | 3. Keep as-is | - | - | | - |
165
+ | 4. Discard | - | - | - | (force) |
166
+
167
+ ## Common Mistakes
168
+
169
+ **Skipping test verification**
170
+ - **Problem:** Merge broken code, create failing PR
171
+ - **Fix:** Always verify tests before offering options
172
+
173
+ **Open-ended questions**
174
+ - **Problem:** "What should I do next?" -> ambiguous
175
+ - **Fix:** Present exactly 4 structured options
176
+
177
+ **Automatic worktree cleanup**
178
+ - **Problem:** Remove worktree when might need it (Option 2, 3)
179
+ - **Fix:** Only cleanup for Options 1 and 4
180
+
181
+ **No confirmation for discard**
182
+ - **Problem:** Accidentally delete work
183
+ - **Fix:** Require typed "discard" confirmation
184
+
185
+ ## Red Flags
186
+
187
+ **Never:**
188
+ - Proceed with failing tests
189
+ - Merge without verifying tests on result
190
+ - Delete work without confirmation
191
+ - Force-push without explicit request
192
+
193
+ **Always:**
194
+ - Verify tests before offering options
195
+ - Present exactly 4 options
196
+ - Get typed confirmation for Option 4
197
+ - Clean up worktree for Options 1 & 4 only
198
+
199
+ ## Integration
200
+
201
+ **Called by:**
202
+ - **code-parallel** (Step 7) - After all tasks complete
203
+ - **code-execute** (Step 5) - After all batches complete
204
+
205
+ **Pairs with:**
206
+ - **code-worktree** - Cleans up worktree created by that skill
@@ -0,0 +1,65 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../THIRD_PARTY_NOTICES.md for details. -->
2
+ ---
3
+ name: code-parallel
4
+ description: Parallel development with subagents. Use when facing 2+ independent tasks -- dispatch agents in parallel with context isolation, controller curates results.
5
+ ---
6
+
7
+ # Code Parallel
8
+
9
+ ## Critical Constraints
10
+ - I do not parallelize tasks that share mutable state, shared files, or unresolved sequencing dependencies.
11
+ - I do not mark a task complete until the implementer result and review result are both reconciled by the controller.
12
+
13
+ ## Overview
14
+ Use parallel execution only when the work can be safely decomposed into independent task slices.
15
+
16
+ ## Codex Runtime Note
17
+ On Codex, collab or subagent dispatch may be unavailable. When that happens, keep the same decomposition logic but execute the slices sequentially in a single session.
18
+
19
+ ## Process
20
+ 1. Read the approved implementation plan.
21
+ 2. Identify tasks that are independent enough to run in parallel.
22
+ 3. Reject parallelization when tasks:
23
+ - touch the same files or shared mutable state
24
+ - depend on the same unfinished migration or contract change
25
+ - require the same reviewer context at the same time
26
+ 4. For each safe task slice, prepare a self-contained prompt using:
27
+ - `./references/implementer-prompt.md`
28
+ - `./references/spec-reviewer-prompt.md`
29
+ - `./references/code-quality-reviewer-prompt.md`
30
+ 5. Dispatch the implementer with:
31
+ - full task text
32
+ - local context
33
+ - required verification command
34
+ - expected output files or code areas
35
+ 6. Review each returned slice in order:
36
+ - spec compliance first
37
+ - code quality second
38
+ 7. Aggregate the accepted outputs back into the main branch or controller state.
39
+ 8. Re-run the top-level verification needed for the combined result.
40
+ 9. If any slice is blocked, either:
41
+ - provide more context
42
+ - split the slice further
43
+ - fall back to sequential execution
44
+
45
+ ## Fan-Out / Fan-In Rules
46
+ - Fan out by task, not by file if the task still shares behavior.
47
+ - The controller owns context selection, result curation, and final decision making.
48
+ - The implementer owns only the assigned slice.
49
+ - Reviewers do not trust implementer claims; they verify artifacts directly.
50
+
51
+ ## When To Use
52
+ - 2+ independent bug fixes
53
+ - isolated implementation tasks under one approved plan
54
+ - a task split where each slice can be verified without waiting on another slice
55
+
56
+ ## Do Not Use When
57
+ - a shared refactor spans the same files
58
+ - the architecture is still unsettled
59
+ - one slice defines the API or schema another slice depends on
60
+
61
+ ## Red Flags
62
+ - "We can parallelize this" without proving task independence.
63
+ - Reusing the same vague context for every subagent.
64
+ - Accepting subagent status without review.
65
+ - Hiding Codex sequential fallback from the user.
@@ -0,0 +1,27 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../../THIRD_PARTY_NOTICES.md for details. -->
2
+ # Code Quality Reviewer Prompt Template
3
+
4
+ Use this template when dispatching a code quality reviewer subagent.
5
+
6
+ **Purpose:** Verify implementation is well-built (clean, tested, maintainable)
7
+
8
+ **Only dispatch after spec compliance review passes.**
9
+
10
+ ```
11
+ Task tool (SDTK-CODE:code-reviewer):
12
+ Use template at code-review/code-reviewer.md
13
+
14
+ WHAT_WAS_IMPLEMENTED: [from implementer's report]
15
+ PLAN_OR_REQUIREMENTS: Task N from [plan-file]
16
+ BASE_SHA: [commit before task]
17
+ HEAD_SHA: [current commit]
18
+ DESCRIPTION: [task summary]
19
+ ```
20
+
21
+ **In addition to standard code quality concerns, the reviewer should check:**
22
+ - Does each file have one clear responsibility with a well-defined interface?
23
+ - Are units decomposed so they can be understood and tested independently?
24
+ - Is the implementation following the file structure from the plan?
25
+ - Did this implementation create new files that are already large, or significantly grow existing files? (Don't flag pre-existing file sizes -- focus on what this change contributed.)
26
+
27
+ **Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment
@@ -0,0 +1,114 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../../THIRD_PARTY_NOTICES.md for details. -->
2
+ # Implementer Subagent Prompt Template
3
+
4
+ Use this template when dispatching an implementer subagent.
5
+
6
+ ```
7
+ Task tool (general-purpose):
8
+ description: "Implement Task N: [task name]"
9
+ prompt: |
10
+ You are implementing Task N: [task name]
11
+
12
+ ## Task Description
13
+
14
+ [FULL TEXT of task from plan - paste it here, don't make subagent read file]
15
+
16
+ ## Context
17
+
18
+ [Scene-setting: where this fits, dependencies, architectural context]
19
+
20
+ ## Before You Begin
21
+
22
+ If you have questions about:
23
+ - The requirements or acceptance criteria
24
+ - The approach or implementation strategy
25
+ - Dependencies or assumptions
26
+ - Anything unclear in the task description
27
+
28
+ **Ask them now.** Raise any concerns before starting work.
29
+
30
+ ## Your Job
31
+
32
+ Once you're clear on requirements:
33
+ 1. Implement exactly what the task specifies
34
+ 2. Write tests (following TDD if task says to)
35
+ 3. Verify implementation works
36
+ 4. Commit your work
37
+ 5. Self-review (see below)
38
+ 6. Report back
39
+
40
+ Work from: [directory]
41
+
42
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
43
+ It's always OK to pause and clarify. Don't guess or make assumptions.
44
+
45
+ ## Code Organization
46
+
47
+ You reason best about code you can hold in context at once, and your edits are more
48
+ reliable when files are focused. Keep this in mind:
49
+ - Follow the file structure defined in the plan
50
+ - Each file should have one clear responsibility with a well-defined interface
51
+ - If a file you're creating is growing beyond the plan's intent, stop and report
52
+ it as DONE_WITH_CONCERNS -- don't split files on your own without plan guidance
53
+ - If an existing file you're modifying is already large or tangled, work carefully
54
+ and note it as a concern in your report
55
+ - In existing codebases, follow established patterns. Improve code you're touching
56
+ the way a good developer would, but don't restructure things outside your task.
57
+
58
+ ## When You're in Over Your Head
59
+
60
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
61
+ no work. You will not be penalized for escalating.
62
+
63
+ **STOP and escalate when:**
64
+ - The task requires architectural decisions with multiple valid approaches
65
+ - You need to understand code beyond what was provided and can't find clarity
66
+ - You feel uncertain about whether your approach is correct
67
+ - The task involves restructuring existing code in ways the plan didn't anticipate
68
+ - You've been reading file after file trying to understand the system without progress
69
+
70
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
71
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
72
+ The controller can provide more context, re-dispatch with a more capable model,
73
+ or break the task into smaller pieces.
74
+
75
+ ## Before Reporting Back: Self-Review
76
+
77
+ Review your work with fresh eyes. Ask yourself:
78
+
79
+ **Completeness:**
80
+ - Did I fully implement everything in the spec?
81
+ - Did I miss any requirements?
82
+ - Are there edge cases I didn't handle?
83
+
84
+ **Quality:**
85
+ - Is this my best work?
86
+ - Are names clear and accurate (match what things do, not how they work)?
87
+ - Is the code clean and maintainable?
88
+
89
+ **Discipline:**
90
+ - Did I avoid overbuilding (YAGNI)?
91
+ - Did I only build what was requested?
92
+ - Did I follow existing patterns in the codebase?
93
+
94
+ **Testing:**
95
+ - Do tests actually verify behavior (not just mock behavior)?
96
+ - Did I follow TDD if required?
97
+ - Are tests comprehensive?
98
+
99
+ If you find issues during self-review, fix them now before reporting.
100
+
101
+ ## Report Format
102
+
103
+ When done, report:
104
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
105
+ - What you implemented (or what you attempted, if blocked)
106
+ - What you tested and test results
107
+ - Files changed
108
+ - Self-review findings (if any)
109
+ - Any issues or concerns
110
+
111
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
112
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
113
+ information that wasn't provided. Never silently produce work you're unsure about.
114
+ ```
@@ -0,0 +1,62 @@
1
+ <!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../../THIRD_PARTY_NOTICES.md for details. -->
2
+ # Spec Compliance Reviewer Prompt Template
3
+
4
+ Use this template when dispatching a spec compliance reviewer subagent.
5
+
6
+ **Purpose:** Verify implementer built what was requested (nothing more, nothing less)
7
+
8
+ ```
9
+ Task tool (general-purpose):
10
+ description: "Review spec compliance for Task N"
11
+ prompt: |
12
+ You are reviewing whether an implementation matches its specification.
13
+
14
+ ## What Was Requested
15
+
16
+ [FULL TEXT of task requirements]
17
+
18
+ ## What Implementer Claims They Built
19
+
20
+ [From implementer's report]
21
+
22
+ ## CRITICAL: Do Not Trust the Report
23
+
24
+ The implementer finished suspiciously quickly. Their report may be incomplete,
25
+ inaccurate, or optimistic. You MUST verify everything independently.
26
+
27
+ **DO NOT:**
28
+ - Take their word for what they implemented
29
+ - Trust their claims about completeness
30
+ - Accept their interpretation of requirements
31
+
32
+ **DO:**
33
+ - Read the actual code they wrote
34
+ - Compare actual implementation to requirements line by line
35
+ - Check for missing pieces they claimed to implement
36
+ - Look for extra features they didn't mention
37
+
38
+ ## Your Job
39
+
40
+ Read the implementation code and verify:
41
+
42
+ **Missing requirements:**
43
+ - Did they implement everything that was requested?
44
+ - Are there requirements they skipped or missed?
45
+ - Did they claim something works but didn't actually implement it?
46
+
47
+ **Extra/unneeded work:**
48
+ - Did they build things that weren't requested?
49
+ - Did they over-engineer or add unnecessary features?
50
+ - Did they add "nice to haves" that weren't in spec?
51
+
52
+ **Misunderstandings:**
53
+ - Did they interpret requirements differently than intended?
54
+ - Did they solve the wrong problem?
55
+ - Did they implement the right feature but wrong way?
56
+
57
+ **Verify by reading code, not by trusting report.**
58
+
59
+ Report:
60
+ - Spec compliant (if everything matches after code inspection)
61
+ - Issues found: [list specifically what's missing or extra, with file:line references]
62
+ ```