opencode-ship 0.9.0 → 0.10.0-rc.17

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 (137) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +3 -1
  3. package/THIRD_PARTY_NOTICES.md +77 -19
  4. package/assets/agents/ship-controller.md +122 -0
  5. package/assets/agents/ship-final-spec-reviewer.md +87 -0
  6. package/assets/agents/ship-final-standards-reviewer.md +83 -0
  7. package/assets/agents/ship-planner.md +78 -0
  8. package/assets/agents/ship-task-builder.md +91 -0
  9. package/assets/agents/ship-task-reviewer.md +78 -0
  10. package/assets/commands/ship-deliver.md +30 -0
  11. package/assets/commands/ship-resume.md +28 -0
  12. package/assets/commands/ship-status.md +25 -0
  13. package/assets/skills/brainstorming/SKILL.md +160 -0
  14. package/assets/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  15. package/assets/skills/brainstorming/visual-companion.md +298 -0
  16. package/assets/skills/code-review/SKILL.md +98 -0
  17. package/assets/skills/codebase-design/DEEPENING.md +37 -0
  18. package/assets/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  19. package/assets/skills/codebase-design/SKILL.md +123 -0
  20. package/assets/skills/dispatching-parallel-agents/SKILL.md +176 -0
  21. package/assets/skills/domain-modeling/ADR-FORMAT.md +47 -0
  22. package/assets/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  23. package/assets/skills/domain-modeling/SKILL.md +83 -0
  24. package/assets/skills/engineering-workflow/SKILL.md +125 -0
  25. package/assets/skills/engineering-workflow/domain.md +51 -0
  26. package/assets/skills/engineering-workflow/issue-tracker-github.md +45 -0
  27. package/assets/skills/engineering-workflow/issue-tracker-gitlab.md +46 -0
  28. package/assets/skills/engineering-workflow/issue-tracker-local.md +30 -0
  29. package/assets/skills/engineering-workflow/triage-labels.md +15 -0
  30. package/assets/skills/executing-plans/SKILL.md +73 -0
  31. package/assets/skills/grill-with-docs/SKILL.md +10 -14
  32. package/assets/skills/grilling/SKILL.md +21 -0
  33. package/assets/skills/handoff/SKILL.md +25 -0
  34. package/assets/skills/prototype/LOGIC.md +79 -0
  35. package/assets/skills/prototype/SKILL.md +35 -0
  36. package/assets/skills/prototype/UI.md +112 -0
  37. package/assets/skills/receiving-code-review/SKILL.md +214 -0
  38. package/assets/skills/requesting-code-review/SKILL.md +104 -0
  39. package/assets/skills/requesting-code-review/code-reviewer.md +172 -0
  40. package/assets/skills/research/SKILL.md +21 -0
  41. package/assets/skills/setup-engineering-workflow/SKILL.md +125 -0
  42. package/assets/skills/setup-engineering-workflow/domain.md +51 -0
  43. package/assets/skills/setup-engineering-workflow/issue-tracker-github.md +45 -0
  44. package/assets/skills/setup-engineering-workflow/issue-tracker-gitlab.md +46 -0
  45. package/assets/skills/setup-engineering-workflow/issue-tracker-local.md +30 -0
  46. package/assets/skills/setup-engineering-workflow/triage-labels.md +15 -0
  47. package/assets/skills/subagent-driven-development/SKILL.md +512 -0
  48. package/assets/skills/subagent-driven-development/implementer-prompt.md +142 -0
  49. package/assets/skills/subagent-driven-development/re-review-prompt.md +106 -0
  50. package/assets/skills/subagent-driven-development/task-reviewer-prompt.md +185 -0
  51. package/assets/skills/systematic-debugging/CREATION-LOG.md +119 -0
  52. package/assets/skills/systematic-debugging/SKILL.md +292 -0
  53. package/assets/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  54. package/assets/skills/systematic-debugging/condition-based-waiting.md +115 -0
  55. package/assets/skills/systematic-debugging/defense-in-depth.md +122 -0
  56. package/assets/skills/systematic-debugging/find-polluter.sh +72 -0
  57. package/assets/skills/systematic-debugging/root-cause-tracing.md +169 -0
  58. package/assets/skills/systematic-debugging/test-academic.md +14 -0
  59. package/assets/skills/systematic-debugging/test-pressure-1.md +58 -0
  60. package/assets/skills/systematic-debugging/test-pressure-2.md +68 -0
  61. package/assets/skills/systematic-debugging/test-pressure-3.md +69 -0
  62. package/assets/skills/test-driven-development/SKILL.md +329 -0
  63. package/assets/skills/test-driven-development/writing-good-tests.md +198 -0
  64. package/assets/skills/to-spec/SKILL.md +84 -0
  65. package/assets/skills/to-tickets/SKILL.md +114 -0
  66. package/assets/skills/triage/AGENT-BRIEF.md +207 -0
  67. package/assets/skills/triage/OUT-OF-SCOPE.md +105 -0
  68. package/assets/skills/triage/SKILL.md +114 -15
  69. package/assets/skills/verification-before-completion/SKILL.md +129 -0
  70. package/assets/skills/wayfinder/SKILL.md +137 -0
  71. package/assets/skills/writing-plans/SKILL.md +177 -0
  72. package/assets/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  73. package/dist/cli.js +1146 -435
  74. package/dist/core.js +210 -61
  75. package/dist/plugin.js +2368 -230
  76. package/package.json +3 -1
  77. package/schema/ship-config.schema.json +63 -2
  78. package/schema/ship-lock.schema.json +5 -3
  79. package/tests/plugin/plugin-load.test.mjs +85 -0
  80. package/vendor/mattpocock/LICENSE +30 -0
  81. package/vendor/obra/LICENSE +30 -0
  82. package/vendor/sources.json +976 -0
  83. package/vendor/superpowers/LICENSE +30 -0
  84. package/vendor/upstreams/mattpocock/skills/engineering/code-review/SKILL.md +89 -0
  85. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DEEPENING.md +37 -0
  86. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
  87. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/SKILL.md +114 -0
  88. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/ADR-FORMAT.md +47 -0
  89. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/CONTEXT-FORMAT.md +60 -0
  90. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/SKILL.md +74 -0
  91. package/vendor/upstreams/mattpocock/skills/engineering/grill-with-docs/SKILL.md +7 -0
  92. package/vendor/upstreams/mattpocock/skills/engineering/prototype/LOGIC.md +79 -0
  93. package/vendor/upstreams/mattpocock/skills/engineering/prototype/SKILL.md +26 -0
  94. package/vendor/upstreams/mattpocock/skills/engineering/prototype/UI.md +112 -0
  95. package/vendor/upstreams/mattpocock/skills/engineering/research/SKILL.md +12 -0
  96. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/SKILL.md +116 -0
  97. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/domain.md +51 -0
  98. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  99. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  100. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  101. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
  102. package/vendor/upstreams/mattpocock/skills/engineering/to-spec/SKILL.md +75 -0
  103. package/vendor/upstreams/mattpocock/skills/engineering/to-tickets/SKILL.md +105 -0
  104. package/vendor/upstreams/mattpocock/skills/engineering/triage/AGENT-BRIEF.md +207 -0
  105. package/vendor/upstreams/mattpocock/skills/engineering/triage/OUT-OF-SCOPE.md +105 -0
  106. package/vendor/upstreams/mattpocock/skills/engineering/triage/SKILL.md +112 -0
  107. package/vendor/upstreams/mattpocock/skills/engineering/wayfinder/SKILL.md +128 -0
  108. package/vendor/upstreams/mattpocock/skills/productivity/grilling/SKILL.md +12 -0
  109. package/vendor/upstreams/mattpocock/skills/productivity/handoff/SKILL.md +16 -0
  110. package/vendor/upstreams/obra/skills/brainstorming/SKILL.md +151 -0
  111. package/vendor/upstreams/obra/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  112. package/vendor/upstreams/obra/skills/brainstorming/visual-companion.md +298 -0
  113. package/vendor/upstreams/obra/skills/dispatching-parallel-agents/SKILL.md +167 -0
  114. package/vendor/upstreams/obra/skills/executing-plans/SKILL.md +64 -0
  115. package/vendor/upstreams/obra/skills/receiving-code-review/SKILL.md +205 -0
  116. package/vendor/upstreams/obra/skills/requesting-code-review/SKILL.md +95 -0
  117. package/vendor/upstreams/obra/skills/requesting-code-review/code-reviewer.md +172 -0
  118. package/vendor/upstreams/obra/skills/subagent-driven-development/SKILL.md +503 -0
  119. package/vendor/upstreams/obra/skills/subagent-driven-development/implementer-prompt.md +142 -0
  120. package/vendor/upstreams/obra/skills/subagent-driven-development/re-review-prompt.md +106 -0
  121. package/vendor/upstreams/obra/skills/subagent-driven-development/task-reviewer-prompt.md +185 -0
  122. package/vendor/upstreams/obra/skills/systematic-debugging/CREATION-LOG.md +119 -0
  123. package/vendor/upstreams/obra/skills/systematic-debugging/SKILL.md +283 -0
  124. package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  125. package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting.md +115 -0
  126. package/vendor/upstreams/obra/skills/systematic-debugging/defense-in-depth.md +122 -0
  127. package/vendor/upstreams/obra/skills/systematic-debugging/find-polluter.sh +72 -0
  128. package/vendor/upstreams/obra/skills/systematic-debugging/root-cause-tracing.md +169 -0
  129. package/vendor/upstreams/obra/skills/systematic-debugging/test-academic.md +14 -0
  130. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-1.md +58 -0
  131. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-2.md +68 -0
  132. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-3.md +69 -0
  133. package/vendor/upstreams/obra/skills/test-driven-development/SKILL.md +320 -0
  134. package/vendor/upstreams/obra/skills/test-driven-development/writing-good-tests.md +198 -0
  135. package/vendor/upstreams/obra/skills/verification-before-completion/SKILL.md +120 -0
  136. package/vendor/upstreams/obra/skills/writing-plans/SKILL.md +168 -0
  137. package/vendor/upstreams/obra/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
@@ -0,0 +1,106 @@
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
+ ## Scope
47
+
48
+ Your scope is the findings list and the fix diff. Verdict every finding.
49
+ Inspect the fix diff for new problems the fix itself introduced. Do NOT
50
+ re-review code the fix did not touch: if you notice an issue entirely
51
+ outside the fix diff, report it under Out-of-Scope Observations — it
52
+ does not block this task and does not extend the loop. A broad
53
+ whole-branch review happens after all tasks are complete.
54
+
55
+ ## Tests
56
+
57
+ The implementer re-ran the tests covering the amended code and appended
58
+ the results to the report file. Treat the report as unverified claims:
59
+ confirm the fix report names the covering tests and shows their output,
60
+ and verify the claims against the diff. Do not re-run the suite to
61
+ confirm their report. Run a test only when reading the code raises a
62
+ specific doubt that no existing run answers — and then a focused test,
63
+ never a package-wide suite.
64
+
65
+ ## Output Format
66
+
67
+ Your final message is the report itself: begin directly with the first
68
+ finding's verdict. Every line is a verdict, a finding with file:line,
69
+ or a check you ran — no preamble, no process narration.
70
+
71
+ ### Finding Verdicts
72
+
73
+ For each finding in The Findings Under Verification, in order:
74
+ - **[finding one-liner]** — ADDRESSED | NOT ADDRESSED, with file:line
75
+ evidence. "Attempted" is not addressed: the specific defect must no
76
+ longer exist.
77
+
78
+ ### New Breakage in the Fix Diff
79
+
80
+ Anything the fix itself broke or introduced, with severity
81
+ (Critical/Important/Minor) and file:line. "None" if clean.
82
+
83
+ ### Out-of-Scope Observations
84
+
85
+ Issues you noticed entirely outside the fix diff. Non-blocking; the
86
+ controller ledgers these for the final review. "None" if none.
87
+
88
+ ### Verdict
89
+
90
+ **Fix round:** [All findings addressed, no new Critical/Important
91
+ breakage | Findings remain open] — list the open ones.
92
+ ```
93
+
94
+ **Placeholders:**
95
+ - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection; scoped
96
+ re-reviews of small fix diffs take a cheap-to-mid tier
97
+ - `[BRIEF_FILE]` — the task brief file (same file the implementer worked from)
98
+ - `[FINDINGS]` — the Critical/Important findings and spec gaps from the
99
+ previous review, copied verbatim, one per bullet
100
+ - `[REPORT_FILE]` — the implementer's report file (fix reports appended)
101
+ - `[FIX_BASE_SHA]` — the head the previous review saw
102
+ - `[HEAD_SHA]` — current commit
103
+ - `[DIFF_FILE]` — the path `scripts/review-package PLAN_FILE FIX_BASE HEAD` printed
104
+
105
+ **Re-reviewer returns:** per-finding verdicts (ADDRESSED / NOT ADDRESSED),
106
+ new breakage in the fix diff, out-of-scope observations, and a round verdict.
@@ -0,0 +1,185 @@
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
+ ## Do Not Trust the Report
56
+
57
+ Treat the implementer's report as unverified claims about the code. It
58
+ may be incomplete, inaccurate, or optimistic. Verify the claims against
59
+ the diff. Design rationales in the report are claims too: "left it per
60
+ YAGNI," "kept it simple deliberately," or any other justification is the
61
+ implementer grading their own work. Judge the code on its merits — a
62
+ stated rationale never downgrades a finding's severity.
63
+
64
+ ## Tests
65
+
66
+ The implementer already ran the tests and reported results with TDD
67
+ evidence for exactly this code. Do not re-run the suite to confirm their
68
+ report. Run a test only when reading the code raises a specific doubt
69
+ that no existing run answers — and then a focused test, never a
70
+ package-wide suite, race detector run, or repeated/high-count loop. If
71
+ heavy validation seems warranted, recommend it in your report instead of
72
+ running it. If you cannot run commands in this environment, name the
73
+ test you would run.
74
+
75
+ Warnings or other noise in the implementer's reported test output are
76
+ findings — test output should be pristine.
77
+
78
+ ## Part 1: Spec Compliance
79
+
80
+ Compare the diff against What Was Requested:
81
+
82
+ - **Missing:** requirements they skipped, missed, or claimed without
83
+ implementing
84
+ - **Extra:** features that weren't requested, over-engineering, unneeded
85
+ "nice to haves"
86
+ - **Misunderstood:** right feature built the wrong way, wrong problem
87
+ solved
88
+
89
+ If a requirement cannot be verified from this diff alone (it lives in
90
+ unchanged code or spans tasks), report it as a ⚠️ item instead of
91
+ broadening your search.
92
+
93
+ ## Part 2: Code Quality
94
+
95
+ **Code quality:**
96
+ - Clean separation of concerns?
97
+ - Proper error handling?
98
+ - DRY without premature abstraction?
99
+ - Edge cases handled?
100
+
101
+ **Tests:**
102
+ - Do the new and changed tests verify real behavior, not mocks?
103
+ - Are the task's edge cases covered?
104
+
105
+ **Structure:**
106
+ - Does each file have one clear responsibility with a well-defined interface?
107
+ - Are units decomposed so they can be understood and tested independently?
108
+ - Is the implementation following the file structure from the plan?
109
+ - Did this change create new files that are already large, or
110
+ significantly grow existing files? (Don't flag pre-existing file
111
+ sizes — focus on what this change contributed.)
112
+
113
+ Your report should point at evidence: file:line references for every
114
+ finding and for any check you would otherwise answer with a bare
115
+ "yes." A tight report that cites lines gives the controller everything
116
+ it needs.
117
+
118
+ Your final message is the report itself: begin directly with the
119
+ spec-compliance verdict. Every line is a verdict, a finding with
120
+ file:line, or a check you ran — no preamble, no process narration,
121
+ no closing summary.
122
+
123
+ ## Calibration
124
+
125
+ Categorize issues by actual severity. Not everything is Critical.
126
+ Important means this task cannot be trusted until it is fixed: incorrect
127
+ or fragile behavior, a missed requirement, or maintainability damage you
128
+ would block a merge over — verbatim duplication of a logic block,
129
+ swallowed errors, tests that assert nothing. "Coverage could be broader"
130
+ and polish suggestions are Minor.
131
+ If the plan or brief explicitly mandates something this rubric calls a
132
+ defect (a test that asserts nothing, verbatim duplication of a logic
133
+ block), that IS a finding — report it as Important, labeled
134
+ plan-mandated. The plan's authorship does not grade its own work; the
135
+ human decides.
136
+ Acknowledge what was done well before listing issues — accurate praise
137
+ helps the implementer trust the rest of the feedback.
138
+
139
+ ## Output Format
140
+
141
+ ### Spec Compliance
142
+
143
+ - ✅ Spec compliant | ❌ Issues found: [what's missing/extra/misunderstood,
144
+ with file:line references]
145
+ - ⚠️ Cannot verify from diff: [requirements you could not verify from the
146
+ diff alone, and what the controller should check — report alongside the
147
+ ✅/❌ verdict for everything you could verify]
148
+
149
+ ### Strengths
150
+ [What's well done? Be specific.]
151
+
152
+ ### Issues
153
+
154
+ #### Critical (Must Fix)
155
+ #### Important (Should Fix)
156
+ #### Minor (Nice to Have)
157
+
158
+ For each issue: file:line, what's wrong, why it matters, how to fix
159
+ (if not obvious).
160
+
161
+ ### Assessment
162
+
163
+ **Task quality:** [Approved | Needs fixes]
164
+
165
+ **Reasoning:** [1-2 sentence technical assessment]
166
+ ```
167
+
168
+ **Placeholders:**
169
+ - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection
170
+ - `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`
171
+ prints the path; same file the implementer worked from)
172
+ - `[GLOBAL_CONSTRAINTS]` — the binding requirements copied verbatim from
173
+ the plan's Global Constraints section or the spec: exact values, formats,
174
+ and stated relationships between components (not process rules — those
175
+ are already in this template)
176
+ - `[REPORT_FILE]` — REQUIRED: the file the implementer wrote its detailed
177
+ report to
178
+ - `[BASE_SHA]` — commit before this task
179
+ - `[HEAD_SHA]` — current commit
180
+ - `[DIFF_FILE]` — REQUIRED: the path the controller wrote the review
181
+ package to (`scripts/review-package PLAN_FILE BASE HEAD` prints the unique
182
+ path it wrote; the package never enters the controller's context)
183
+
184
+ **Reviewer returns:** Spec Compliance verdict (✅/❌/⚠️), Strengths, Issues
185
+ (Critical/Important/Minor), Task quality verdict
@@ -0,0 +1,119 @@
1
+ # Creation Log: Systematic Debugging Skill
2
+
3
+ Reference example of extracting, structuring, and bulletproofing a critical skill.
4
+
5
+ ## Source Material
6
+
7
+ Extracted debugging framework from `~/.claude/CLAUDE.md`:
8
+ - 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
9
+ - Core mandate: ALWAYS find root cause, NEVER fix symptoms
10
+ - Rules designed to resist time pressure and rationalization
11
+
12
+ ## Extraction Decisions
13
+
14
+ **What to include:**
15
+ - Complete 4-phase framework with all rules
16
+ - Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
17
+ - Pressure-resistant language ("even if faster", "even if I seem in a hurry")
18
+ - Concrete steps for each phase
19
+
20
+ **What to leave out:**
21
+ - Project-specific context
22
+ - Repetitive variations of same rule
23
+ - Narrative explanations (condensed to principles)
24
+
25
+ ## Structure Following skill-creation/SKILL.md
26
+
27
+ 1. **Rich when_to_use** - Included symptoms and anti-patterns
28
+ 2. **Type: technique** - Concrete process with steps
29
+ 3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
30
+ 4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
31
+ 5. **Phase-by-phase breakdown** - Scannable checklist format
32
+ 6. **Anti-patterns section** - What NOT to do (critical for this skill)
33
+
34
+ ## Bulletproofing Elements
35
+
36
+ Framework designed to resist rationalization under pressure:
37
+
38
+ ### Language Choices
39
+ - "ALWAYS" / "NEVER" (not "should" / "try to")
40
+ - "even if faster" / "even if I seem in a hurry"
41
+ - "STOP and re-analyze" (explicit pause)
42
+ - "Don't skip past" (catches the actual behavior)
43
+
44
+ ### Structural Defenses
45
+ - **Phase 1 required** - Can't skip to implementation
46
+ - **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
47
+ - **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
48
+ - **Anti-patterns section** - Shows exactly what shortcuts look like
49
+
50
+ ### Redundancy
51
+ - Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
52
+ - "NEVER fix symptom" appears 4 times in different contexts
53
+ - Each phase has explicit "don't skip" guidance
54
+
55
+ ## Testing Approach
56
+
57
+ Created 4 validation tests following skills/meta/testing-skills-with-subagents:
58
+
59
+ ### Test 1: Academic Context (No Pressure)
60
+ - Simple bug, no time pressure
61
+ - **Result:** Perfect compliance, complete investigation
62
+
63
+ ### Test 2: Time Pressure + Obvious Quick Fix
64
+ - User "in a hurry", symptom fix looks easy
65
+ - **Result:** Resisted shortcut, followed full process, found real root cause
66
+
67
+ ### Test 3: Complex System + Uncertainty
68
+ - Multi-layer failure, unclear if can find root cause
69
+ - **Result:** Systematic investigation, traced through all layers, found source
70
+
71
+ ### Test 4: Failed First Fix
72
+ - Hypothesis doesn't work, temptation to add more fixes
73
+ - **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
74
+
75
+ **All tests passed.** No rationalizations found.
76
+
77
+ ## Iterations
78
+
79
+ ### Initial Version
80
+ - Complete 4-phase framework
81
+ - Anti-patterns section
82
+ - Flowchart for "fix failed" decision
83
+
84
+ ### Enhancement 1: TDD Reference
85
+ - Added link to skills/testing/test-driven-development
86
+ - Note explaining TDD's "simplest code" ≠ debugging's "root cause"
87
+ - Prevents confusion between methodologies
88
+
89
+ ## Final Outcome
90
+
91
+ Bulletproof skill that:
92
+ - ✅ Clearly mandates root cause investigation
93
+ - ✅ Resists time pressure rationalization
94
+ - ✅ Provides concrete steps for each phase
95
+ - ✅ Shows anti-patterns explicitly
96
+ - ✅ Tested under multiple pressure scenarios
97
+ - ✅ Clarifies relationship to TDD
98
+ - ✅ Ready for use
99
+
100
+ ## Key Insight
101
+
102
+ **Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
103
+
104
+ ## Usage Example
105
+
106
+ When encountering a bug:
107
+ 1. Load skill: skills/debugging/systematic-debugging
108
+ 2. Read overview (10 sec) - reminded of mandate
109
+ 3. Follow Phase 1 checklist - forced investigation
110
+ 4. If tempted to skip - see anti-pattern, stop
111
+ 5. Complete all phases - root cause found
112
+
113
+ **Time investment:** 5-10 minutes
114
+ **Time saved:** Hours of symptom-whack-a-mole
115
+
116
+ ---
117
+
118
+ *Created: 2025-10-03*
119
+ *Purpose: Reference example for skill extraction and bulletproofing*
@@ -0,0 +1,283 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+
6
+ # Systematic Debugging
7
+
8
+ ## Overview
9
+
10
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
11
+
12
+ **Violating the letter of this process is violating the spirit of debugging.**
13
+
14
+ ## The Iron Law
15
+
16
+ ```
17
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
18
+ ```
19
+
20
+ If you haven't completed Phase 1, you cannot propose fixes.
21
+
22
+ ## When to Use
23
+
24
+ Use for ANY technical issue:
25
+ - Test failures
26
+ - Bugs in production
27
+ - Unexpected behavior
28
+ - Performance problems
29
+ - Build failures
30
+ - Integration issues
31
+
32
+ **Use this ESPECIALLY when:**
33
+ - Under time pressure (emergencies make guessing tempting)
34
+ - "Just one quick fix" seems obvious
35
+ - You've already tried multiple fixes
36
+ - Previous fix didn't work
37
+ - You don't fully understand the issue
38
+
39
+ **Don't skip when:**
40
+ - Issue seems simple (simple bugs have root causes too)
41
+ - You're in a hurry (rushing guarantees rework)
42
+ - Manager wants it fixed NOW (systematic is faster than thrashing)
43
+
44
+ ## The Four Phases
45
+
46
+ You MUST complete each phase before proceeding to the next.
47
+
48
+ ### Phase 1: Root Cause Investigation
49
+
50
+ **BEFORE attempting ANY fix:**
51
+
52
+ 1. **Read Error Messages Carefully**
53
+ - Don't skip past errors or warnings
54
+ - They often contain the exact solution
55
+ - Read stack traces completely
56
+ - Note line numbers, file paths, error codes
57
+
58
+ 2. **Reproduce Consistently**
59
+ - Can you trigger it reliably?
60
+ - What are the exact steps?
61
+ - Does it happen every time?
62
+ - If not reproducible → gather more data, don't guess
63
+
64
+ 3. **Check Recent Changes**
65
+ - What changed that could cause this?
66
+ - Git diff, recent commits
67
+ - New dependencies, config changes
68
+ - Environmental differences
69
+
70
+ 4. **Gather Evidence in Multi-Component Systems**
71
+
72
+ **WHEN system has multiple components (CI → build → signing, API → service → database):**
73
+
74
+ **BEFORE proposing fixes, add diagnostic instrumentation:**
75
+ ```
76
+ For EACH component boundary:
77
+ - Log what data enters component
78
+ - Log what data exits component
79
+ - Verify environment/config propagation
80
+ - Check state at each layer
81
+
82
+ Run once to gather evidence showing WHERE it breaks
83
+ THEN analyze evidence to identify failing component
84
+ THEN investigate that specific component
85
+ ```
86
+
87
+ **Example (multi-layer system):**
88
+ ```bash
89
+ # Layer 1: Workflow
90
+ echo "=== Secrets available in workflow: ==="
91
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
92
+
93
+ # Layer 2: Build script
94
+ echo "=== Env vars in build script: ==="
95
+ env | grep IDENTITY || echo "IDENTITY not in environment"
96
+
97
+ # Layer 3: Signing script
98
+ echo "=== Keychain state: ==="
99
+ security list-keychains
100
+ security find-identity -v
101
+
102
+ # Layer 4: Actual signing
103
+ codesign --sign "$IDENTITY" --verbose=4 "$APP"
104
+ ```
105
+
106
+ **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
107
+
108
+ 5. **Trace Data Flow**
109
+
110
+ **WHEN error is deep in call stack:**
111
+
112
+ See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
113
+
114
+ **Quick version:**
115
+ - Where does bad value originate?
116
+ - What called this with bad value?
117
+ - Keep tracing up until you find the source
118
+ - Fix at source, not at symptom
119
+
120
+ ### Phase 2: Pattern Analysis
121
+
122
+ **Find the pattern before fixing:**
123
+
124
+ 1. **Find Working Examples**
125
+ - Locate similar working code in same codebase
126
+ - What works that's similar to what's broken?
127
+
128
+ 2. **Compare Against References**
129
+ - If implementing pattern, read reference implementation COMPLETELY
130
+ - Don't skim - read every line
131
+ - Understand the pattern fully before applying
132
+
133
+ 3. **Identify Differences**
134
+ - What's different between working and broken?
135
+ - List every difference, however small
136
+ - Don't assume "that can't matter"
137
+
138
+ 4. **Understand Dependencies**
139
+ - What other components does this need?
140
+ - What settings, config, environment?
141
+ - What assumptions does it make?
142
+
143
+ ### Phase 3: Hypothesis and Testing
144
+
145
+ **Scientific method:**
146
+
147
+ 1. **Form Single Hypothesis**
148
+ - State clearly: "I think X is the root cause because Y"
149
+ - Write it down
150
+ - Be specific, not vague
151
+
152
+ 2. **Test Minimally**
153
+ - Make the SMALLEST possible change to test hypothesis
154
+ - One variable at a time
155
+ - Don't fix multiple things at once
156
+
157
+ 3. **Verify Before Continuing**
158
+ - Did it work? Yes → Phase 4
159
+ - Didn't work? Form NEW hypothesis
160
+ - DON'T add more fixes on top
161
+
162
+ 4. **When You Don't Know**
163
+ - Say "I don't understand X"
164
+ - Don't pretend to know
165
+ - Ask for help
166
+ - Research more
167
+
168
+ ### Phase 4: Implementation
169
+
170
+ **Fix the root cause, not the symptom:**
171
+
172
+ 1. **Create Failing Test Case**
173
+ - Simplest possible reproduction
174
+ - Automated test if possible
175
+ - One-off test script if no framework
176
+ - MUST have before fixing
177
+ - Use the `superpowers:test-driven-development` skill for writing proper failing tests
178
+
179
+ 2. **Implement Single Fix**
180
+ - Address the root cause identified
181
+ - ONE change at a time
182
+ - No "while I'm here" improvements
183
+ - No bundled refactoring
184
+
185
+ 3. **Verify Fix**
186
+ - Test passes now?
187
+ - No other tests broken?
188
+ - Issue actually resolved?
189
+ - Use the `superpowers:verification-before-completion` skill before claiming success
190
+
191
+ 4. **If Fix Doesn't Work**
192
+ - STOP
193
+ - Count: How many fixes have you tried?
194
+ - If < 3: Return to Phase 1, re-analyze with new information
195
+ - **If ≥ 3: STOP and question the architecture (step 5 below)**
196
+ - DON'T attempt Fix #4 without architectural discussion
197
+
198
+ 5. **If 3+ Fixes Failed: Question Architecture**
199
+
200
+ **Pattern indicating architectural problem:**
201
+ - Each fix reveals new shared state/coupling/problem in different place
202
+ - Fixes require "massive refactoring" to implement
203
+ - Each fix creates new symptoms elsewhere
204
+
205
+ **STOP and question fundamentals:**
206
+ - Is this pattern fundamentally sound?
207
+ - Are we "sticking with it through sheer inertia"?
208
+ - Should we refactor architecture vs. continue fixing symptoms?
209
+
210
+ **Discuss with your human partner before attempting more fixes**
211
+
212
+ This is NOT a failed hypothesis - this is a wrong architecture.
213
+
214
+ ## Red Flags - STOP and Follow Process
215
+
216
+ If you catch yourself thinking:
217
+ - "Quick fix for now, investigate later"
218
+ - "Just try changing X and see if it works"
219
+ - "Add multiple changes, run tests"
220
+ - "Skip the test, I'll manually verify"
221
+ - "It's probably X, let me fix that"
222
+ - "I don't fully understand but this might work"
223
+ - "Pattern says X but I'll adapt it differently"
224
+ - "Here are the main problems: [lists fixes without investigation]"
225
+ - Proposing solutions before tracing data flow
226
+ - **"One more fix attempt" (when already tried 2+)**
227
+ - **Each fix reveals new problem in different place**
228
+
229
+ **ALL of these mean: STOP. Return to Phase 1.**
230
+
231
+ **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
232
+
233
+ ## your human partner's Signals You're Doing It Wrong
234
+
235
+ **Watch for these redirections:**
236
+ - "Is that not happening?" - You assumed without verifying
237
+ - "Will it show us...?" - You should have added evidence gathering
238
+ - "Stop guessing" - You're proposing fixes without understanding
239
+ - "Ultra-think this" - Question fundamentals, not just symptoms
240
+ - "We're stuck?" (frustrated) - Your approach isn't working
241
+
242
+ **When you see these:** STOP. Return to Phase 1.
243
+
244
+ ## Common Rationalizations
245
+
246
+ | Excuse | Reality |
247
+ |--------|---------|
248
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
249
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
250
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
251
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
252
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
253
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
254
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
255
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
256
+
257
+ ## Quick Reference
258
+
259
+ | Phase | Key Activities | Success Criteria |
260
+ |-------|---------------|------------------|
261
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
262
+ | **2. Pattern** | Find working examples, compare | Identify differences |
263
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
264
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
265
+
266
+ ## When Process Reveals "No Root Cause"
267
+
268
+ If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
269
+
270
+ 1. You've completed the process
271
+ 2. Document what you investigated
272
+ 3. Implement appropriate handling (retry, timeout, error message)
273
+ 4. Add monitoring/logging for future investigation
274
+
275
+ **But:** 95% of "no root cause" cases are incomplete investigation.
276
+
277
+ ## Supporting Techniques
278
+
279
+ These techniques are part of systematic debugging and available in this directory:
280
+
281
+ - **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
282
+ - **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
283
+ - **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling