@jspg-ai/coding-bb 0.0.1

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 (183) hide show
  1. package/README.md +41 -0
  2. package/cbb/dev-standards/rules/cbb-ai-behavior.md +104 -0
  3. package/cbb/dev-standards/rules/cbb-coding-rule.md +50 -0
  4. package/cbb/dev-standards/rules/cbb-priority.md +56 -0
  5. package/cbb/dev-standards/skills/architecture-specs/SKILL.md +129 -0
  6. package/cbb/dev-standards/skills/coding-specs/SKILL.md +376 -0
  7. package/cbb/dev-standards/skills/coding-specs/references/concurrency.md +53 -0
  8. package/cbb/dev-standards/skills/coding-specs/references/config-center.md +16 -0
  9. package/cbb/dev-standards/skills/coding-specs/references/distributed.md +42 -0
  10. package/cbb/dev-standards/skills/coding-specs/references/es-coding.md +60 -0
  11. package/cbb/dev-standards/skills/coding-specs/references/scheduled-task.md +25 -0
  12. package/cbb/dev-standards/skills/coding-specs/references/security.md +11 -0
  13. package/cbb/dev-standards/skills/coding-specs/references/unit-testing.md +43 -0
  14. package/cbb/dev-standards/skills/es-design-specs/SKILL.md +104 -0
  15. package/cbb/dev-standards/skills/mysql-design-specs/SKILL.md +89 -0
  16. package/cbb/lib/install/claude-code.js +20 -0
  17. package/cbb/lib/install/cleanup.js +64 -0
  18. package/cbb/lib/install/init.js +1875 -0
  19. package/cbb/lib/install/qoder.js +20 -0
  20. package/cbb/lib/install/workspaces.js +232 -0
  21. package/cbb/lib/openspec/index.js +554 -0
  22. package/cbb/lib/superpowers/index.js +265 -0
  23. package/cbb/lib/utils/check-update.js +147 -0
  24. package/cbb/lib/utils/checkbox.js +383 -0
  25. package/cbb/lib/utils/gitignore.js +69 -0
  26. package/cbb/lib/utils/output.js +64 -0
  27. package/cbb/lib/utils/settings.js +119 -0
  28. package/cbb/lib/utils/version.js +135 -0
  29. package/cbb/lib/wiki/api-client.js +358 -0
  30. package/cbb/lib/wiki/cli.js +427 -0
  31. package/cbb/lib/wiki/convert.js +464 -0
  32. package/cbb/lib/wiki/index.js +218 -0
  33. package/cbb/lib/wiki/mermaid-guard.js +103 -0
  34. package/cbb/lib/wiki/split.js +131 -0
  35. package/cbb/tools/cbb-decompile-jar/SKILL.md +220 -0
  36. package/cbb/tools/cbb-decompile-jar/scripts/decompile.py +863 -0
  37. package/cbb/tools/cbb-design-to-wiki/SKILL.md +180 -0
  38. package/cbb/tools/cbb-mvn-guide/SKILL.md +281 -0
  39. package/cbb/tools/cbb-mvn-guide/scripts/mvn_jdk_manager.py +378 -0
  40. package/cbb/tools/cbb-mvn-guide/scripts/mvn_pom_jdk_reader.py +197 -0
  41. package/cbb/tools/cbb-plantuml-authoring/SKILL.md +448 -0
  42. package/cbb/tools/cbb-plantuml-authoring/references/drawing-templates.md +479 -0
  43. package/cbb/tools/cbb-wiki-ops/SKILL.md +134 -0
  44. package/cbb/tools/cbb-wiki-ops/scripts/check-auth.js +44 -0
  45. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +96 -0
  46. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +67 -0
  47. package/cbb/worktrees/_shared/scripts/push-core.js +136 -0
  48. package/cbb/worktrees/_shared/scripts/silence-popup.js +23 -0
  49. package/cbb/worktrees/commands/close.md +64 -0
  50. package/cbb/worktrees/commands/extend.md +65 -0
  51. package/cbb/worktrees/commands/init.md +55 -0
  52. package/cbb/worktrees/commands/push.md +42 -0
  53. package/cbb/worktrees/skills/openspec-close-worktree/SKILL.md +449 -0
  54. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-env.js +76 -0
  55. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-unarchived.js +48 -0
  56. package/cbb/worktrees/skills/openspec-close-worktree/scripts/delete-branches.js +136 -0
  57. package/cbb/worktrees/skills/openspec-close-worktree/scripts/discover-apps.js +76 -0
  58. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +96 -0
  59. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-workspace-root.js +67 -0
  60. package/cbb/worktrees/skills/openspec-close-worktree/scripts/remove-worktrees.js +124 -0
  61. package/cbb/worktrees/skills/openspec-close-worktree/scripts/safety-check.js +174 -0
  62. package/cbb/worktrees/skills/openspec-close-worktree/scripts/silence-popup.js +23 -0
  63. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +390 -0
  64. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +95 -0
  65. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +98 -0
  66. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +135 -0
  67. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-target-worktree.js +96 -0
  68. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-workspace-root.js +67 -0
  69. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +150 -0
  70. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +88 -0
  71. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/push-core.js +136 -0
  72. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/silence-popup.js +23 -0
  73. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +93 -0
  74. package/cbb/worktrees/skills/openspec-init-worktree/SKILL.md +539 -0
  75. package/cbb/worktrees/skills/openspec-init-worktree/scripts/auto-open.js +136 -0
  76. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env-deep.js +87 -0
  77. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env.js +90 -0
  78. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-repos.js +171 -0
  79. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-branches.js +103 -0
  80. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-worktrees.js +154 -0
  81. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +67 -0
  82. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +93 -0
  83. package/cbb/worktrees/skills/openspec-init-worktree/scripts/install-ai.js +177 -0
  84. package/cbb/worktrees/skills/openspec-init-worktree/scripts/parse-config.js +67 -0
  85. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-branches.js +101 -0
  86. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +136 -0
  87. package/cbb/worktrees/skills/openspec-init-worktree/scripts/silence-popup.js +23 -0
  88. package/cbb/worktrees/skills/openspec-init-worktree/scripts/sync-repos.js +95 -0
  89. package/cbb/worktrees/skills/openspec-init-worktree/scripts/update-gitignore.js +134 -0
  90. package/cbb/worktrees/skills/openspec-push-worktrees/SKILL.md +307 -0
  91. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/commit-worktrees.js +269 -0
  92. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-target-worktree.js +96 -0
  93. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-workspace-root.js +67 -0
  94. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-core.js +136 -0
  95. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-worktrees.js +159 -0
  96. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +23 -0
  97. package/config/cbb.yaml +6 -0
  98. package/config/config.sample.json +16 -0
  99. package/config/openspec/config.yaml +28 -0
  100. package/config/openspec/schemas/spec-driven/schema.yaml +247 -0
  101. package/config/openspec/schemas/spec-driven/templates/design.md +475 -0
  102. package/config/openspec/schemas/spec-driven/templates/proposal.md +58 -0
  103. package/config/openspec/schemas/spec-driven/templates/spec.md +8 -0
  104. package/config/openspec/schemas/spec-driven/templates/tasks.md +9 -0
  105. package/config/workspaces.json +15 -0
  106. package/openspec/.version +6 -0
  107. package/openspec/commands/apply.md +182 -0
  108. package/openspec/commands/archive.md +223 -0
  109. package/openspec/commands/bulk-archive.md +334 -0
  110. package/openspec/commands/continue.md +112 -0
  111. package/openspec/commands/explore.md +206 -0
  112. package/openspec/commands/ff.md +111 -0
  113. package/openspec/commands/new.md +70 -0
  114. package/openspec/commands/onboard.md +555 -0
  115. package/openspec/commands/propose.md +157 -0
  116. package/openspec/commands/sync.md +256 -0
  117. package/openspec/commands/update.md +85 -0
  118. package/openspec/commands/verify.md +169 -0
  119. package/openspec/skills/openspec-apply-change/SKILL.md +187 -0
  120. package/openspec/skills/openspec-archive-change/SKILL.md +181 -0
  121. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -0
  122. package/openspec/skills/openspec-continue-change/SKILL.md +117 -0
  123. package/openspec/skills/openspec-explore/SKILL.md +342 -0
  124. package/openspec/skills/openspec-ff-change/SKILL.md +116 -0
  125. package/openspec/skills/openspec-new-change/SKILL.md +76 -0
  126. package/openspec/skills/openspec-onboard/SKILL.md +560 -0
  127. package/openspec/skills/openspec-propose/SKILL.md +162 -0
  128. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -0
  129. package/openspec/skills/openspec-update-change/SKILL.md +90 -0
  130. package/openspec/skills/openspec-verify-change/SKILL.md +174 -0
  131. package/package.json +46 -0
  132. package/superpowers/.version +6 -0
  133. package/superpowers/skills/brainstorming/SKILL.md +250 -0
  134. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -0
  135. package/superpowers/skills/brainstorming/scripts/helper.js +167 -0
  136. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -0
  137. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -0
  138. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -0
  139. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  140. package/superpowers/skills/brainstorming/visual-companion.md +299 -0
  141. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -0
  142. package/superpowers/skills/executing-plans/SKILL.md +64 -0
  143. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -0
  144. package/superpowers/skills/receiving-code-review/SKILL.md +205 -0
  145. package/superpowers/skills/requesting-code-review/SKILL.md +95 -0
  146. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -0
  147. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -0
  148. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -0
  149. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -0
  150. package/superpowers/skills/subagent-driven-development/scripts/review-package +46 -0
  151. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +40 -0
  152. package/superpowers/skills/subagent-driven-development/scripts/task-brief +41 -0
  153. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -0
  154. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -0
  155. package/superpowers/skills/systematic-debugging/SKILL.md +283 -0
  156. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  157. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -0
  158. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -0
  159. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -0
  160. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -0
  161. package/superpowers/skills/systematic-debugging/test-academic.md +14 -0
  162. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -0
  163. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -0
  164. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -0
  165. package/superpowers/skills/test-driven-development/SKILL.md +320 -0
  166. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -0
  167. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -0
  168. package/superpowers/skills/using-superpowers/SKILL.md +63 -0
  169. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -0
  170. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -0
  171. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -0
  172. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -0
  173. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -0
  174. package/superpowers/skills/verification-before-completion/SKILL.md +120 -0
  175. package/superpowers/skills/writing-plans/SKILL.md +171 -0
  176. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  177. package/superpowers/skills/writing-skills/SKILL.md +679 -0
  178. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -0
  179. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  180. package/superpowers/skills/writing-skills/graphviz-conventions.dot +172 -0
  181. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -0
  182. package/superpowers/skills/writing-skills/render-graphs.js +169 -0
  183. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,154 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementer subagent.
4
+
5
+ ```
6
+ Subagent (general-purpose):
7
+ description: "Implement Task N: [task name]"
8
+ model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
9
+ model silently inherits the session's most expensive one]
10
+ prompt: |
11
+ You are implementing Task N: [task name]
12
+
13
+ ## Task Description
14
+
15
+ Read your task brief first: [BRIEF_FILE]
16
+ It contains the full task text from the plan.
17
+
18
+ ## Context
19
+
20
+ [Scene-setting: where this fits, dependencies, architectural context]
21
+
22
+ ## Before You Begin
23
+
24
+ If you have questions about:
25
+ - The requirements or acceptance criteria
26
+ - The approach or implementation strategy
27
+ - Dependencies or assumptions
28
+ - Anything unclear in the task description
29
+
30
+ **Ask them now.** Raise any concerns before starting work.
31
+
32
+ ## Your Job
33
+
34
+ Once you're clear on requirements:
35
+ 1. Implement exactly what the task specifies
36
+ 2. Write tests (following TDD if task says to)
37
+ 3. Verify implementation works
38
+ 4. Commit your work
39
+ 5. Self-review (see below)
40
+ 6. Report back
41
+
42
+ Work from: [directory]
43
+
44
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
45
+ It's always OK to pause and clarify. Don't guess or make assumptions.
46
+
47
+ While iterating, run the focused test for what you're changing; run the
48
+ full suite once before committing, not after every edit.
49
+
50
+ ## You Do Not Dispatch Subagents
51
+
52
+ Do all of this task's work yourself. Never spawn a subagent to
53
+ implement part of the task, and above all never spawn a reviewer to
54
+ check your work. Self-review (below) means reading your own diff.
55
+ Review is the controller's job: after you report, it dispatches a
56
+ fresh reviewer against your diff. A reviewer you spawn duplicates
57
+ that review at full cost, and its approval counts for nothing in
58
+ the process. If you catch yourself thinking "an independent review
59
+ would strengthen my report" — that review is already scheduled.
60
+ Report instead.
61
+
62
+ ## Code Organization
63
+
64
+ You reason best about code you can hold in context at once, and your edits are more
65
+ reliable when files are focused. Keep this in mind:
66
+ - Follow the file structure defined in the plan
67
+ - Each file should have one clear responsibility with a well-defined interface
68
+ - If a file you're creating is growing beyond the plan's intent, stop and report
69
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
70
+ - If an existing file you're modifying is already large or tangled, work carefully
71
+ and note it as a concern in your report
72
+ - In existing codebases, follow established patterns. Improve code you're touching
73
+ the way a good developer would, but don't restructure things outside your task.
74
+
75
+ ## When You're in Over Your Head
76
+
77
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
78
+ no work. You will not be penalized for escalating.
79
+
80
+ **STOP and escalate when:**
81
+ - The task requires architectural decisions with multiple valid approaches
82
+ - You need to understand code beyond what was provided and can't find clarity
83
+ - You feel uncertain about whether your approach is correct
84
+ - The task involves restructuring existing code in ways the plan didn't anticipate
85
+ - You've been reading file after file trying to understand the system without progress
86
+
87
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
88
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
89
+ The controller can provide more context, re-dispatch with a more capable model,
90
+ or break the task into smaller pieces.
91
+
92
+ ## Before Reporting Back: Self-Review
93
+
94
+ Review your work with fresh eyes. Ask yourself:
95
+
96
+ **Completeness:**
97
+ - Did I fully implement everything in the spec?
98
+ - Did I miss any requirements?
99
+ - Are there edge cases I didn't handle?
100
+
101
+ **Quality:**
102
+ - Is this my best work?
103
+ - Are names clear and accurate (match what things do, not how they work)?
104
+ - Is the code clean and maintainable?
105
+
106
+ **Discipline:**
107
+ - Did I avoid overbuilding (YAGNI)?
108
+ - Did I only build what was requested?
109
+ - Did I follow existing patterns in the codebase?
110
+
111
+ **Testing:**
112
+ - Do tests actually verify behavior (not just mock behavior)?
113
+ - Did I follow TDD if required?
114
+ - Are tests comprehensive?
115
+ - Is the test output pristine (no stray warnings or noise)?
116
+
117
+ If you find issues during self-review, fix them now before reporting.
118
+
119
+ ## After Review Findings
120
+
121
+ If the task review finds issues, you will be resumed with the findings.
122
+ Fix them, re-run the tests that cover the amended code, and append a fix
123
+ report to your report file: what you changed, the covering tests you
124
+ ran, the command, and the output. Reviewers will not re-run tests for
125
+ you — your report is the test evidence. Then reply with the same short
126
+ status contract as your first report.
127
+
128
+ ## Report Format
129
+
130
+ Write your full report to [REPORT_FILE]:
131
+ - What you implemented (or what you attempted, if blocked)
132
+ - What you tested and test results
133
+ - **TDD Evidence** (if TDD was required for this task):
134
+ - RED: command run, relevant failing output before implementation, and why the failure was expected
135
+ - GREEN: command run and relevant passing output after implementation
136
+ - Files changed
137
+ - Self-review findings (if any)
138
+ - Any issues or concerns
139
+
140
+ Then report back with ONLY (under 15 lines — the detail lives in the
141
+ report file):
142
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
143
+ - Commits created (short SHA + subject)
144
+ - One-line test summary (e.g. "14/14 passing, output pristine")
145
+ - Your concerns, if any
146
+ - The report file path
147
+
148
+ If BLOCKED or NEEDS_CONTEXT, put the specifics in the final message
149
+ itself — the controller acts on it directly.
150
+
151
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
152
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
153
+ information that wasn't provided. Never silently produce work you're unsure about.
154
+ ```
@@ -0,0 +1,115 @@
1
+ # Scoped Re-Review Prompt Template
2
+
3
+ Use this template when dispatching a re-review after a fix round. The
4
+ re-reviewer verifies the findings were addressed and checks the fix diff for
5
+ new breakage. It is not a fresh review — the full review already happened.
6
+
7
+ **Purpose:** Verify each finding from the previous review was addressed, and
8
+ that the fix itself broke nothing.
9
+
10
+ ```
11
+ Subagent (general-purpose):
12
+ description: "Re-review Task N fix round R"
13
+ model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
14
+ model silently inherits the session's most expensive one]
15
+ prompt: |
16
+ You are re-reviewing one task's fix round. A previous review produced
17
+ findings; an implementer has attempted to fix them. Your job is to
18
+ verdict each finding and inspect the fix diff — nothing else.
19
+
20
+ ## The Task
21
+
22
+ Read the task brief: [BRIEF_FILE]
23
+
24
+ ## The Findings Under Verification
25
+
26
+ [FINDINGS]
27
+
28
+ ## The Fix
29
+
30
+ Read the implementer's report (fix reports are appended at the end):
31
+ [REPORT_FILE]
32
+
33
+ **Fix base:** [FIX_BASE_SHA] (the head the previous review saw)
34
+ **Head:** [HEAD_SHA]
35
+ **Diff file:** [DIFF_FILE]
36
+
37
+ Read the diff file once — it contains the fix commits, a stat summary,
38
+ and the fix diff with surrounding context. Do not re-run git commands.
39
+ If the diff file is missing, fetch the diff yourself:
40
+ `git diff --stat [FIX_BASE_SHA]..[HEAD_SHA]` and
41
+ `git diff [FIX_BASE_SHA]..[HEAD_SHA]`.
42
+
43
+ Your review is read-only on this checkout. Do not mutate the working
44
+ tree, the index, HEAD, or branch state in any way.
45
+
46
+ ## You Do Not Dispatch Subagents
47
+
48
+ Do all of this review yourself. Never spawn a subagent to review part
49
+ of the diff, and never spawn another reviewer for a second opinion.
50
+ This process already provides every review seat the work gets; a
51
+ reviewer you spawn duplicates one of them at full cost, and its
52
+ verdict counts for nothing. If the diff feels too large for one
53
+ pass, review it in passes yourself and say so in your report.
54
+
55
+ ## Scope
56
+
57
+ Your scope is the findings list and the fix diff. Verdict every finding.
58
+ Inspect the fix diff for new problems the fix itself introduced. Do NOT
59
+ re-review code the fix did not touch: if you notice an issue entirely
60
+ outside the fix diff, report it under Out-of-Scope Observations — it
61
+ does not block this task and does not extend the loop. A broad
62
+ whole-branch review happens after all tasks are complete.
63
+
64
+ ## Tests
65
+
66
+ The implementer re-ran the tests covering the amended code and appended
67
+ the results to the report file. Treat the report as unverified claims:
68
+ confirm the fix report names the covering tests and shows their output,
69
+ and verify the claims against the diff. Do not re-run the suite to
70
+ confirm their report. Run a test only when reading the code raises a
71
+ specific doubt that no existing run answers — and then a focused test,
72
+ never a package-wide suite.
73
+
74
+ ## Output Format
75
+
76
+ Your final message is the report itself: begin directly with the first
77
+ finding's verdict. Every line is a verdict, a finding with file:line,
78
+ or a check you ran — no preamble, no process narration.
79
+
80
+ ### Finding Verdicts
81
+
82
+ For each finding in The Findings Under Verification, in order:
83
+ - **[finding one-liner]** — ADDRESSED | NOT ADDRESSED, with file:line
84
+ evidence. "Attempted" is not addressed: the specific defect must no
85
+ longer exist.
86
+
87
+ ### New Breakage in the Fix Diff
88
+
89
+ Anything the fix itself broke or introduced, with severity
90
+ (Critical/Important/Minor) and file:line. "None" if clean.
91
+
92
+ ### Out-of-Scope Observations
93
+
94
+ Issues you noticed entirely outside the fix diff. Non-blocking; the
95
+ controller ledgers these for the final review. "None" if none.
96
+
97
+ ### Verdict
98
+
99
+ **Fix round:** [All findings addressed, no new Critical/Important
100
+ breakage | Findings remain open] — list the open ones.
101
+ ```
102
+
103
+ **Placeholders:**
104
+ - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection; scoped
105
+ re-reviews of small fix diffs take a cheap-to-mid tier
106
+ - `[BRIEF_FILE]` — the task brief file (same file the implementer worked from)
107
+ - `[FINDINGS]` — the Critical/Important findings and spec gaps from the
108
+ previous review, copied verbatim, one per bullet
109
+ - `[REPORT_FILE]` — the implementer's report file (fix reports appended)
110
+ - `[FIX_BASE_SHA]` — the head the previous review saw
111
+ - `[HEAD_SHA]` — current commit
112
+ - `[DIFF_FILE]` — the path `scripts/review-package PLAN_FILE FIX_BASE HEAD` printed
113
+
114
+ **Re-reviewer returns:** per-finding verdicts (ADDRESSED / NOT ADDRESSED),
115
+ new breakage in the fix diff, out-of-scope observations, and a round verdict.
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env bash
2
+ # Generate a review package: commit list, stat summary, and the net
3
+ # diff with extended context, written to a file the reviewer reads in one
4
+ # call. Using the recorded per-task BASE (not HEAD~1) keeps multi-commit
5
+ # tasks intact.
6
+ #
7
+ # Usage: review-package PLAN_FILE BASE HEAD [OUTFILE]
8
+ # Default OUTFILE: <repo-root>/.superpowers/sdd/<plan-basename>/review-<base7>..<head7>.diff
9
+ # (named per range, so a re-review after fixes gets a distinct fresh file).
10
+ set -euo pipefail
11
+
12
+ if [ $# -lt 3 ] || [ $# -gt 4 ]; then
13
+ echo "usage: review-package PLAN_FILE BASE HEAD [OUTFILE]" >&2
14
+ exit 2
15
+ fi
16
+
17
+ plan=$1
18
+ base=$2
19
+ head=$3
20
+ [ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }
21
+
22
+ git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; }
23
+ git rev-parse --verify --quiet "$head" >/dev/null || { echo "bad HEAD: $head" >&2; exit 2; }
24
+
25
+ if [ $# -eq 4 ]; then
26
+ out=$4
27
+ else
28
+ dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
29
+ out="$dir/review-$(git rev-parse --short "$base")..$(git rev-parse --short "$head").diff"
30
+ fi
31
+
32
+ {
33
+ echo "# Review package: ${base}..${head}"
34
+ echo
35
+ echo "## Commits"
36
+ git log --oneline "${base}..${head}"
37
+ echo
38
+ echo "## Files changed"
39
+ git diff --stat "${base}..${head}"
40
+ echo
41
+ echo "## Diff"
42
+ git diff -U10 "${base}..${head}"
43
+ } > "$out"
44
+
45
+ commits=$(git rev-list --count "${base}..${head}")
46
+ echo "wrote ${out}: ${commits} commit(s), $(wc -c < "$out" | tr -d ' ') bytes"
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+ # Resolve and ensure the working-tree directory SDD uses for one plan's
3
+ # short-lived artifacts: task briefs, implementer reports, review packages,
4
+ # and the progress ledger. Print the plan directory's absolute path.
5
+ #
6
+ # One directory per plan (.superpowers/sdd/<plan-basename>/) so a follow-up
7
+ # plan in the same working tree can never read or overwrite another plan's
8
+ # artifacts. A stale ledger misread as current progress makes controllers
9
+ # skip whole task sequences — plan-scoping removes that failure structurally.
10
+ #
11
+ # The workspace lives in the working tree (not under .git/) because Claude Code
12
+ # treats .git/ as a protected path and denies agent writes there — which blocks
13
+ # an implementer subagent from writing its report file. A self-ignoring
14
+ # .gitignore at .superpowers/sdd/ keeps every plan's workspace out of
15
+ # `git status` and out of accidental commits without modifying any tracked file.
16
+ #
17
+ # Single source of truth for the workspace location, so task-brief and
18
+ # review-package cannot drift to different directories.
19
+ #
20
+ # Usage: sdd-workspace PLAN_FILE
21
+ set -euo pipefail
22
+
23
+ if [ $# -ne 1 ]; then
24
+ echo "usage: sdd-workspace PLAN_FILE" >&2
25
+ exit 2
26
+ fi
27
+
28
+ plan=$1
29
+ [ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }
30
+
31
+ slug=$(basename "$plan" .md)
32
+ [ -n "$slug" ] && [ "$slug" != "." ] && [ "$slug" != ".." ] \
33
+ || { echo "cannot derive a workspace name from: $plan" >&2; exit 2; }
34
+
35
+ root=$(git rev-parse --show-toplevel)
36
+ base="$root/.superpowers/sdd"
37
+ dir="$base/$slug"
38
+ mkdir -p "$dir"
39
+ printf '*\n' > "$base/.gitignore"
40
+ cd "$dir" && pwd
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env bash
2
+ # Extract one task's full text from an implementation plan into a file the
3
+ # implementer reads in one call, so the task text never has to be pasted
4
+ # through the controller's context.
5
+ #
6
+ # Usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]
7
+ # Default OUTFILE: <repo-root>/.superpowers/sdd/<plan-basename>/task-<N>-brief.md
8
+ # (per plan and per worktree; concurrent runs of the SAME plan in the same
9
+ # working tree share it).
10
+ set -euo pipefail
11
+
12
+ if [ $# -lt 2 ] || [ $# -gt 3 ]; then
13
+ echo "usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]" >&2
14
+ exit 2
15
+ fi
16
+
17
+ plan=$1
18
+ n=$2
19
+ [ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }
20
+
21
+ if [ $# -eq 3 ]; then
22
+ out=$3
23
+ else
24
+ dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
25
+ out="$dir/task-${n}-brief.md"
26
+ fi
27
+
28
+ awk -v n="$n" '
29
+ /^```/ { infence = !infence }
30
+ !infence && /^#+[ \t]+Task[ \t]+[0-9]+/ {
31
+ intask = ($0 ~ ("^#+[ \t]+Task[ \t]+" n "([^0-9]|$)"))
32
+ }
33
+ intask { print }
34
+ ' "$plan" > "$out"
35
+
36
+ if [ ! -s "$out" ]; then
37
+ echo "task ${n} not found in ${plan} (no heading matching 'Task ${n}')" >&2
38
+ exit 3
39
+ fi
40
+
41
+ echo "wrote ${out}: $(wc -l < "$out" | tr -d ' ') lines"
@@ -0,0 +1,207 @@
1
+ # Task Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a task reviewer subagent. The reviewer
4
+ reads the task's diff once and returns two verdicts: spec compliance and
5
+ code quality.
6
+
7
+ **Purpose:** Verify one task's implementation matches its requirements (nothing
8
+ more, nothing less) and is well-built (clean, tested, maintainable)
9
+
10
+ ```
11
+ Subagent (general-purpose):
12
+ description: "Review Task N (spec + quality)"
13
+ model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
14
+ model silently inherits the session's most expensive one]
15
+ prompt: |
16
+ You are reviewing one task's implementation: first whether it matches its
17
+ requirements, then whether it is well-built. This is a task-scoped gate,
18
+ not a merge review — a broad whole-branch review happens separately after
19
+ all tasks are complete.
20
+
21
+ ## What Was Requested
22
+
23
+ Read the task brief: [BRIEF_FILE]
24
+
25
+ Global constraints from the spec/design that bind this task:
26
+ [GLOBAL_CONSTRAINTS]
27
+
28
+ ## What the Implementer Claims They Built
29
+
30
+ Read the implementer's report: [REPORT_FILE]
31
+
32
+ ## Diff Under Review
33
+
34
+ **Base:** [BASE_SHA]
35
+ **Head:** [HEAD_SHA]
36
+ **Diff file:** [DIFF_FILE]
37
+
38
+ Read the diff file once — it contains the commit list, a stat summary,
39
+ and the full diff with surrounding context, and it is your view of the
40
+ change. The diff's context lines ARE the changed files: do not Read a
41
+ changed file separately unless a hunk you must judge is cut off
42
+ mid-function — and say so in your report. Do not re-run git commands.
43
+ If the diff file is missing, fetch the diff yourself:
44
+ `git diff --stat [BASE_SHA]..[HEAD_SHA]` and `git diff [BASE_SHA]..[HEAD_SHA]`.
45
+ Do not crawl the broader codebase. Inspect code outside the diff only
46
+ to evaluate a concrete risk you can name — one focused check per named
47
+ risk, and name both the risk and what you checked in your report.
48
+ Cross-cutting changes are legitimate named risks: if the diff changes
49
+ lock ordering, a function or API contract, or shared mutable state,
50
+ checking the call sites is the right method.
51
+
52
+ Your review is read-only on this checkout. Do not mutate the working
53
+ tree, the index, HEAD, or branch state in any way.
54
+
55
+ ## You Do Not Dispatch Subagents
56
+
57
+ Do all of this review yourself. Never spawn a subagent to review part
58
+ of the diff, and never spawn another reviewer for a second opinion.
59
+ This process already provides every review seat the work gets; a
60
+ reviewer you spawn duplicates one of them at full cost, and its
61
+ verdict counts for nothing. If the diff feels too large for one
62
+ pass, review it in passes yourself and say so in your report.
63
+
64
+ ## Do Not Trust the Report
65
+
66
+ Treat the implementer's report as unverified claims about the code. It
67
+ may be incomplete, inaccurate, or optimistic. Verify the claims against
68
+ the diff. Design rationales in the report are claims too: "left it per
69
+ YAGNI," "kept it simple deliberately," or any other justification is the
70
+ implementer grading their own work. Judge the code on its merits — a
71
+ stated rationale never downgrades a finding's severity.
72
+
73
+ ## Tests
74
+
75
+ The implementer already ran the tests and reported results with TDD
76
+ evidence for exactly this code. Do not re-run the suite to confirm their
77
+ report. Run a test only when reading the code raises a specific doubt
78
+ that no existing run answers — and then a focused test, never a
79
+ package-wide suite, race detector run, or repeated/high-count loop. If
80
+ heavy validation seems warranted, recommend it in your report instead of
81
+ running it. If you cannot run commands in this environment, name the
82
+ test you would run.
83
+
84
+ Warnings or other noise in the implementer's reported test output are
85
+ findings — test output should be pristine.
86
+
87
+ Evidence you cannot see is not evidence that doesn't exist. If the
88
+ report or its test evidence looks truncated, or you cannot locate the
89
+ results it claims, re-read the file at its stated path — and if it is
90
+ genuinely missing or garbled, report that as a gap for the controller.
91
+ Re-running the suite to regenerate what you failed to read is not
92
+ verification; illegibility of the evidence is not invalidation of it.
93
+
94
+ ## Part 1: Spec Compliance
95
+
96
+ Compare the diff against What Was Requested:
97
+
98
+ - **Missing:** requirements they skipped, missed, or claimed without
99
+ implementing
100
+ - **Extra:** features that weren't requested, over-engineering, unneeded
101
+ "nice to haves"
102
+ - **Misunderstood:** right feature built the wrong way, wrong problem
103
+ solved
104
+
105
+ If the brief lists several files each with its own change (a batched
106
+ dispatch), check the diff against that list file by file: every listed
107
+ file must have its corresponding hunk. A listed file the diff never
108
+ touches is a Missing finding, no matter how clean the rest of the
109
+ batch looks.
110
+
111
+ If a requirement cannot be verified from this diff alone (it lives in
112
+ unchanged code or spans tasks), report it as a ⚠️ item instead of
113
+ broadening your search.
114
+
115
+ ## Part 2: Code Quality
116
+
117
+ **Code quality:**
118
+ - Clean separation of concerns?
119
+ - Proper error handling?
120
+ - DRY without premature abstraction?
121
+ - Edge cases handled?
122
+
123
+ **Tests:**
124
+ - Do the new and changed tests verify real behavior, not mocks?
125
+ - Are the task's edge cases covered?
126
+
127
+ **Structure:**
128
+ - Does each file have one clear responsibility with a well-defined interface?
129
+ - Are units decomposed so they can be understood and tested independently?
130
+ - Is the implementation following the file structure from the plan?
131
+ - Did this change create new files that are already large, or
132
+ significantly grow existing files? (Don't flag pre-existing file
133
+ sizes — focus on what this change contributed.)
134
+
135
+ Your report should point at evidence: file:line references for every
136
+ finding and for any check you would otherwise answer with a bare
137
+ "yes." A tight report that cites lines gives the controller everything
138
+ it needs.
139
+
140
+ Your final message is the report itself: begin directly with the
141
+ spec-compliance verdict. Every line is a verdict, a finding with
142
+ file:line, or a check you ran — no preamble, no process narration,
143
+ no closing summary.
144
+
145
+ ## Calibration
146
+
147
+ Categorize issues by actual severity. Not everything is Critical.
148
+ Important means this task cannot be trusted until it is fixed: incorrect
149
+ or fragile behavior, a missed requirement, or maintainability damage you
150
+ would block a merge over — verbatim duplication of a logic block,
151
+ swallowed errors, tests that assert nothing. "Coverage could be broader"
152
+ and polish suggestions are Minor.
153
+ If the plan or brief explicitly mandates something this rubric calls a
154
+ defect (a test that asserts nothing, verbatim duplication of a logic
155
+ block), that IS a finding — report it as Important, labeled
156
+ plan-mandated. The plan's authorship does not grade its own work; the
157
+ human decides.
158
+ Acknowledge what was done well before listing issues — accurate praise
159
+ helps the implementer trust the rest of the feedback.
160
+
161
+ ## Output Format
162
+
163
+ ### Spec Compliance
164
+
165
+ - ✅ Spec compliant | ❌ Issues found: [what's missing/extra/misunderstood,
166
+ with file:line references]
167
+ - ⚠️ Cannot verify from diff: [requirements you could not verify from the
168
+ diff alone, and what the controller should check — report alongside the
169
+ ✅/❌ verdict for everything you could verify]
170
+
171
+ ### Strengths
172
+ [What's well done? Be specific.]
173
+
174
+ ### Issues
175
+
176
+ #### Critical (Must Fix)
177
+ #### Important (Should Fix)
178
+ #### Minor (Nice to Have)
179
+
180
+ For each issue: file:line, what's wrong, why it matters, how to fix
181
+ (if not obvious).
182
+
183
+ ### Assessment
184
+
185
+ **Task quality:** [Approved | Needs fixes]
186
+
187
+ **Reasoning:** [1-2 sentence technical assessment]
188
+ ```
189
+
190
+ **Placeholders:**
191
+ - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection
192
+ - `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`
193
+ prints the path; same file the implementer worked from)
194
+ - `[GLOBAL_CONSTRAINTS]` — the binding requirements copied verbatim from
195
+ the plan's Global Constraints section or the spec: exact values, formats,
196
+ and stated relationships between components (not process rules — those
197
+ are already in this template)
198
+ - `[REPORT_FILE]` — REQUIRED: the file the implementer wrote its detailed
199
+ report to
200
+ - `[BASE_SHA]` — commit before this task
201
+ - `[HEAD_SHA]` — current commit
202
+ - `[DIFF_FILE]` — REQUIRED: the path the controller wrote the review
203
+ package to (`scripts/review-package PLAN_FILE BASE HEAD` prints the unique
204
+ path it wrote; the package never enters the controller's context)
205
+
206
+ **Reviewer returns:** Spec Compliance verdict (✅/❌/⚠️), Strengths, Issues
207
+ (Critical/Important/Minor), Task quality verdict