freecodego 0.1.6-alpha.2

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 (106) hide show
  1. package/LICENSE +23 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +85 -0
  4. package/README.zh.md +85 -0
  5. package/cordis.patch.yml +56 -0
  6. package/dist/agent-team.js +16296 -0
  7. package/dist/assets/engineering/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  8. package/dist/assets/engineering/skills/ask-matt/SKILL.md +89 -0
  9. package/dist/assets/engineering/skills/ask-matt/agents/openai.yaml +5 -0
  10. package/dist/assets/engineering/skills/code-review/SKILL.md +87 -0
  11. package/dist/assets/engineering/skills/code-review/agents/openai.yaml +3 -0
  12. package/dist/assets/engineering/skills/codebase-design/DEEPENING.md +37 -0
  13. package/dist/assets/engineering/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  14. package/dist/assets/engineering/skills/codebase-design/SKILL.md +114 -0
  15. package/dist/assets/engineering/skills/codebase-design/agents/openai.yaml +3 -0
  16. package/dist/assets/engineering/skills/domain-modeling/ADR-FORMAT.md +47 -0
  17. package/dist/assets/engineering/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  18. package/dist/assets/engineering/skills/domain-modeling/SKILL.md +74 -0
  19. package/dist/assets/engineering/skills/domain-modeling/agents/openai.yaml +3 -0
  20. package/dist/assets/engineering/skills/engineering-code-review/SKILL.md +13 -0
  21. package/dist/assets/engineering/skills/engineering-context-control/SKILL.md +13 -0
  22. package/dist/assets/engineering/skills/engineering-release-readiness/SKILL.md +13 -0
  23. package/dist/assets/engineering/skills/engineering-security-review/SKILL.md +13 -0
  24. package/dist/assets/engineering/skills/engineering-silent-failure/SKILL.md +13 -0
  25. package/dist/assets/engineering/skills/engineering-spec-mining/SKILL.md +13 -0
  26. package/dist/assets/engineering/skills/engineering-tdd/SKILL.md +13 -0
  27. package/dist/assets/engineering/skills/grill-with-docs/SKILL.md +7 -0
  28. package/dist/assets/engineering/skills/grill-with-docs/agents/openai.yaml +5 -0
  29. package/dist/assets/engineering/skills/implement/SKILL.md +15 -0
  30. package/dist/assets/engineering/skills/implement/agents/openai.yaml +5 -0
  31. package/dist/assets/engineering/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  32. package/dist/assets/engineering/skills/improve-codebase-architecture/SKILL.md +71 -0
  33. package/dist/assets/engineering/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  34. package/dist/assets/engineering/skills/prototype/LOGIC.md +67 -0
  35. package/dist/assets/engineering/skills/prototype/SKILL.md +26 -0
  36. package/dist/assets/engineering/skills/prototype/UI.md +112 -0
  37. package/dist/assets/engineering/skills/prototype/agents/openai.yaml +3 -0
  38. package/dist/assets/engineering/skills/resolving-merge-conflicts/SKILL.md +14 -0
  39. package/dist/assets/engineering/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  40. package/dist/assets/engineering/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  41. package/dist/assets/engineering/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  42. package/dist/assets/engineering/skills/setup-matt-pocock-skills/domain.md +51 -0
  43. package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  44. package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  45. package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  46. package/dist/assets/engineering/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  47. package/dist/assets/engineering/skills/to-spec/SKILL.md +75 -0
  48. package/dist/assets/engineering/skills/to-spec/agents/openai.yaml +5 -0
  49. package/dist/assets/engineering/skills/to-tickets/SKILL.md +105 -0
  50. package/dist/assets/engineering/skills/to-tickets/agents/openai.yaml +5 -0
  51. package/dist/assets/engineering/skills/triage/AGENT-BRIEF.md +207 -0
  52. package/dist/assets/engineering/skills/triage/OUT-OF-SCOPE.md +105 -0
  53. package/dist/assets/engineering/skills/triage/SKILL.md +112 -0
  54. package/dist/assets/engineering/skills/triage/agents/openai.yaml +5 -0
  55. package/dist/assets/engineering/skills/wayfinder/SKILL.md +128 -0
  56. package/dist/assets/engineering/skills/wayfinder/agents/openai.yaml +5 -0
  57. package/dist/assets/engineering/skills/wizard/SKILL.md +44 -0
  58. package/dist/assets/engineering/skills/wizard/agents/openai.yaml +3 -0
  59. package/dist/assets/engineering/skills/wizard/template.sh +204 -0
  60. package/dist/assets/engineering/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  61. package/dist/assets/engineering/skills/writing-for-agents/SKILL.md +81 -0
  62. package/dist/assets/engineering/skills/writing-for-agents/agents/openai.yaml +3 -0
  63. package/dist/assets/engineering/skills-starter/engineering-debug/SKILL.md +13 -0
  64. package/dist/assets/engineering/skills-starter/engineering-plan/SKILL.md +26 -0
  65. package/dist/assets/engineering/skills-starter/engineering-search-first/SKILL.md +13 -0
  66. package/dist/assets/engineering/skills-starter/engineering-verification/SKILL.md +67 -0
  67. package/dist/assets/engineering/skills-starter/grill-me/SKILL.md +7 -0
  68. package/dist/assets/engineering/skills-starter/grill-me/agents/openai.yaml +5 -0
  69. package/dist/assets/engineering/skills-starter/grilling/SKILL.md +28 -0
  70. package/dist/assets/engineering/skills-starter/grilling/agents/openai.yaml +3 -0
  71. package/dist/assets/engineering/skills-starter/handoff/SKILL.md +16 -0
  72. package/dist/assets/engineering/skills-starter/handoff/agents/openai.yaml +5 -0
  73. package/dist/assets/engineering/skills-starter/prompt-techniques/SKILL.md +84 -0
  74. package/dist/assets/engineering/skills-starter/to-questionnaire/SKILL.md +54 -0
  75. package/dist/assets/engineering/skills-starter/to-questionnaire/agents/openai.yaml +5 -0
  76. package/dist/assets/engineering/skills-starter/wait-what/SKILL.md +7 -0
  77. package/dist/assets/engineering/skills-starter/wait-what/agents/openai.yaml +5 -0
  78. package/dist/assets/engineering/skills-superpowers/brainstorming/SKILL.md +240 -0
  79. package/dist/assets/engineering/skills-superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
  80. package/dist/assets/engineering/skills-superpowers/dispatching-parallel-agents/SKILL.md +167 -0
  81. package/dist/assets/engineering/skills-superpowers/executing-plans/SKILL.md +64 -0
  82. package/dist/assets/engineering/skills-superpowers/finishing-a-development-branch/SKILL.md +225 -0
  83. package/dist/assets/engineering/skills-superpowers/receiving-code-review/SKILL.md +205 -0
  84. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/SKILL.md +567 -0
  85. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/final-reviewer-prompt.md +181 -0
  86. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/implementer-prompt.md +154 -0
  87. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/re-review-prompt.md +115 -0
  88. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/review-package +46 -0
  89. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/sdd-workspace +40 -0
  90. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/task-brief +41 -0
  91. package/dist/assets/engineering/skills-superpowers/subagent-driven-development/task-reviewer-prompt.md +207 -0
  92. package/dist/assets/engineering/skills-superpowers/using-git-worktrees/SKILL.md +167 -0
  93. package/dist/assets/engineering/skills-superpowers/writing-plans/SKILL.md +171 -0
  94. package/dist/assets/engineering/skills-superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
  95. package/dist/assets/presets/augmentcode/agent.cordis.yml +238 -0
  96. package/dist/assets/presets/augmentcode/preset.yml +4 -0
  97. package/dist/assets/presets/freecodego/agent.cordis.yml +220 -0
  98. package/dist/assets/presets/freecodego/preset.yml +4 -0
  99. package/dist/auto-review.js +429 -0
  100. package/dist/bootstrap.js +65223 -0
  101. package/dist/client.cjs +39382 -0
  102. package/dist/schedule.js +15846 -0
  103. package/dist/session-events.js +10 -0
  104. package/dist/tool-agent-team.js +16825 -0
  105. package/dist/workers/codex-worker.js +1127 -0
  106. package/package.json +113 -0
@@ -0,0 +1,181 @@
1
+ # Code Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code reviewer subagent.
4
+
5
+ **Purpose:** Review completed work against requirements and code quality standards before it cascades into more work.
6
+
7
+ ```
8
+ Subagent (general-purpose):
9
+ description: "Review code changes"
10
+ prompt: |
11
+ You are a Senior Code Reviewer with expertise in software architecture,
12
+ design patterns, and best practices. Your job is to review completed work
13
+ against its plan or requirements and identify issues before they cascade.
14
+
15
+ ## What Was Implemented
16
+
17
+ [DESCRIPTION]
18
+
19
+ ## Requirements / Plan
20
+
21
+ [PLAN_OR_REQUIREMENTS]
22
+
23
+ ## Git Range to Review
24
+
25
+ **Base:** [BASE_SHA]
26
+ **Head:** [HEAD_SHA]
27
+
28
+ ```bash
29
+ git diff --stat [BASE_SHA]..[HEAD_SHA]
30
+ git diff [BASE_SHA]..[HEAD_SHA]
31
+ ```
32
+
33
+ ## Read-Only Review
34
+
35
+ Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.
36
+
37
+ ## You Do Not Dispatch Subagents
38
+
39
+ Do all of this review yourself. Never spawn a subagent to review part
40
+ of the diff, and never spawn another reviewer for a second opinion.
41
+ This process already provides every review seat the work gets; a
42
+ reviewer you spawn duplicates one of them at full cost, and its
43
+ verdict counts for nothing. If the diff feels too large for one
44
+ pass, review it in passes yourself and say so in your report.
45
+
46
+ ## What to Check
47
+
48
+ **Plan alignment:**
49
+ - Does the implementation match the plan / requirements?
50
+ - Are deviations justified improvements, or problematic departures?
51
+ - Is all planned functionality present?
52
+
53
+ **Code quality:**
54
+ - Clean separation of concerns?
55
+ - Proper error handling?
56
+ - Type safety where applicable?
57
+ - DRY without premature abstraction?
58
+ - Edge cases handled?
59
+
60
+ **Architecture:**
61
+ - Sound design decisions?
62
+ - Reasonable scalability and performance?
63
+ - Security concerns?
64
+ - Integrates cleanly with surrounding code?
65
+
66
+ **Testing:**
67
+ - Tests verify real behavior, not mocks?
68
+ - Edge cases covered?
69
+ - Integration tests where they matter?
70
+ - All tests passing?
71
+
72
+ **Production readiness:**
73
+ - Migration strategy if schema changed?
74
+ - Backward compatibility considered?
75
+ - Documentation complete?
76
+ - No obvious bugs?
77
+
78
+ ## Calibration
79
+
80
+ Categorize issues by actual severity. Not everything is Critical.
81
+ Acknowledge what was done well before listing issues — accurate praise
82
+ helps the implementer trust the rest of the feedback.
83
+
84
+ If you find significant deviations from the plan, flag them specifically
85
+ so the implementer can confirm whether the deviation was intentional.
86
+ If you find issues with the plan itself rather than the implementation,
87
+ say so.
88
+
89
+ ## Output Format
90
+
91
+ ### Strengths
92
+ [What's well done? Be specific.]
93
+
94
+ ### Issues
95
+
96
+ #### Critical (Must Fix)
97
+ [Bugs, security issues, data loss risks, broken functionality]
98
+
99
+ #### Important (Should Fix)
100
+ [Architecture problems, missing features, poor error handling, test gaps]
101
+
102
+ #### Minor (Nice to Have)
103
+ [Code style, optimization opportunities, documentation polish]
104
+
105
+ For each issue:
106
+ - File:line reference
107
+ - What's wrong
108
+ - Why it matters
109
+ - How to fix (if not obvious)
110
+
111
+ ### Recommendations
112
+ [Improvements for code quality, architecture, or process]
113
+
114
+ ### Assessment
115
+
116
+ **Ready to merge?** [Yes | No | With fixes]
117
+
118
+ **Reasoning:** [1-2 sentence technical assessment]
119
+
120
+ ## Critical Rules
121
+
122
+ **DO:**
123
+ - Categorize by actual severity
124
+ - Be specific (file:line, not vague)
125
+ - Explain WHY each issue matters
126
+ - Acknowledge strengths
127
+ - Give a clear verdict
128
+
129
+ **DON'T:**
130
+ - Say "looks good" without checking
131
+ - Mark nitpicks as Critical
132
+ - Give feedback on code you didn't actually read
133
+ - Be vague ("improve error handling")
134
+ - Avoid giving a clear verdict
135
+ ```
136
+
137
+ **Placeholders:**
138
+ - `[DESCRIPTION]` — brief summary of what was built
139
+ - `[PLAN_OR_REQUIREMENTS]` — what it should do (plan file path, task text, or requirements)
140
+ - `[BASE_SHA]` — starting commit
141
+ - `[HEAD_SHA]` — ending commit
142
+
143
+ **Reviewer returns:** Strengths, Issues (Critical / Important / Minor), Recommendations, Assessment
144
+
145
+ ## Example Output
146
+
147
+ ```
148
+ ### Strengths
149
+ - Clean database schema with proper migrations (db.ts:15-42)
150
+ - Comprehensive test coverage (18 tests, all edge cases)
151
+ - Good error handling with fallbacks (summarizer.ts:85-92)
152
+
153
+ ### Issues
154
+
155
+ #### Important
156
+ 1. **Missing help text in CLI wrapper**
157
+ - File: index-conversations:1-31
158
+ - Issue: No --help flag, users won't discover --concurrency
159
+ - Fix: Add --help case with usage examples
160
+
161
+ 2. **Date validation missing**
162
+ - File: search.ts:25-27
163
+ - Issue: Invalid dates silently return no results
164
+ - Fix: Validate ISO format, throw error with example
165
+
166
+ #### Minor
167
+ 1. **Progress indicators**
168
+ - File: indexer.ts:130
169
+ - Issue: No "X of Y" counter for long operations
170
+ - Impact: Users don't know how long to wait
171
+
172
+ ### Recommendations
173
+ - Add progress reporting for user experience
174
+ - Consider config file for excluded projects (portability)
175
+
176
+ ### Assessment
177
+
178
+ **Ready to merge: With fixes**
179
+
180
+ **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.
181
+ ```
@@ -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"