opencode-ship 1.1.2-rc.2 → 1.1.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.
- package/CHANGELOG.md +96 -1
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/assets/agents/delivery-reviewer.md +1 -0
- package/assets/agents/delivery-verifier.md +1 -0
- package/assets/agents/ship-controller.md +20 -7
- package/assets/agents/ship-final-spec-reviewer.md +5 -3
- package/assets/agents/ship-final-standards-reviewer.md +5 -3
- package/assets/agents/ship-planner.md +1 -0
- package/assets/agents/ship-task-builder.md +1 -0
- package/assets/agents/ship-task-reviewer.md +1 -0
- package/dist/cli.js +2274 -362
- package/dist/core.js +794 -10
- package/dist/plugin.js +3487 -1795
- package/package.json +9 -4
- package/tests/plugin/expected-tools.mjs +2 -2
- package/tests/plugin/plugin-load.test.mjs +8 -3
- package/assets/_archive/issue-tracker-gitlab.md +0 -46
- package/assets/_archive/issue-tracker-local.md +0 -30
- package/docs/adr/0001-opencode-ship-redesign.md +0 -168
- package/docs/release/1.0.0-execution-plan.md +0 -1063
- package/docs/release/1.1.1-stabilization-plan.md +0 -655
- package/vendor/upstreams/mattpocock/skills/engineering/code-review/SKILL.md +0 -89
- package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DEEPENING.md +0 -37
- package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/SKILL.md +0 -114
- package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/ADR-FORMAT.md +0 -47
- package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/SKILL.md +0 -74
- package/vendor/upstreams/mattpocock/skills/engineering/grill-with-docs/SKILL.md +0 -7
- package/vendor/upstreams/mattpocock/skills/engineering/prototype/LOGIC.md +0 -79
- package/vendor/upstreams/mattpocock/skills/engineering/prototype/SKILL.md +0 -26
- package/vendor/upstreams/mattpocock/skills/engineering/prototype/UI.md +0 -112
- package/vendor/upstreams/mattpocock/skills/engineering/research/SKILL.md +0 -12
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/SKILL.md +0 -116
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/domain.md +0 -51
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
- package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/triage-labels.md +0 -15
- package/vendor/upstreams/mattpocock/skills/engineering/to-spec/SKILL.md +0 -75
- package/vendor/upstreams/mattpocock/skills/engineering/to-tickets/SKILL.md +0 -105
- package/vendor/upstreams/mattpocock/skills/engineering/triage/AGENT-BRIEF.md +0 -207
- package/vendor/upstreams/mattpocock/skills/engineering/triage/OUT-OF-SCOPE.md +0 -105
- package/vendor/upstreams/mattpocock/skills/engineering/triage/SKILL.md +0 -112
- package/vendor/upstreams/mattpocock/skills/engineering/wayfinder/SKILL.md +0 -128
- package/vendor/upstreams/mattpocock/skills/productivity/grilling/SKILL.md +0 -12
- package/vendor/upstreams/mattpocock/skills/productivity/handoff/SKILL.md +0 -16
- package/vendor/upstreams/obra/skills/brainstorming/SKILL.md +0 -151
- package/vendor/upstreams/obra/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/vendor/upstreams/obra/skills/brainstorming/visual-companion.md +0 -298
- package/vendor/upstreams/obra/skills/dispatching-parallel-agents/SKILL.md +0 -167
- package/vendor/upstreams/obra/skills/executing-plans/SKILL.md +0 -64
- package/vendor/upstreams/obra/skills/receiving-code-review/SKILL.md +0 -205
- package/vendor/upstreams/obra/skills/requesting-code-review/SKILL.md +0 -95
- package/vendor/upstreams/obra/skills/requesting-code-review/code-reviewer.md +0 -172
- package/vendor/upstreams/obra/skills/subagent-driven-development/SKILL.md +0 -503
- package/vendor/upstreams/obra/skills/subagent-driven-development/implementer-prompt.md +0 -142
- package/vendor/upstreams/obra/skills/subagent-driven-development/re-review-prompt.md +0 -106
- package/vendor/upstreams/obra/skills/subagent-driven-development/task-reviewer-prompt.md +0 -185
- package/vendor/upstreams/obra/skills/systematic-debugging/CREATION-LOG.md +0 -119
- package/vendor/upstreams/obra/skills/systematic-debugging/SKILL.md +0 -283
- package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting.md +0 -115
- package/vendor/upstreams/obra/skills/systematic-debugging/defense-in-depth.md +0 -122
- package/vendor/upstreams/obra/skills/systematic-debugging/find-polluter.sh +0 -72
- package/vendor/upstreams/obra/skills/systematic-debugging/root-cause-tracing.md +0 -169
- package/vendor/upstreams/obra/skills/systematic-debugging/test-academic.md +0 -14
- package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-1.md +0 -58
- package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-2.md +0 -68
- package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-3.md +0 -69
- package/vendor/upstreams/obra/skills/test-driven-development/SKILL.md +0 -320
- package/vendor/upstreams/obra/skills/test-driven-development/writing-good-tests.md +0 -198
- package/vendor/upstreams/obra/skills/verification-before-completion/SKILL.md +0 -120
- package/vendor/upstreams/obra/skills/writing-plans/SKILL.md +0 -168
- package/vendor/upstreams/obra/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
# Writing Good Tests
|
|
2
|
-
|
|
3
|
-
**Load this reference when:** writing or changing tests, adding mocks, or
|
|
4
|
-
adding cleanup/helper methods for tests.
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
|
|
8
|
-
A test exists to catch a specific break. Two principles govern everything
|
|
9
|
-
here:
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
1. Every test names the break it catches
|
|
13
|
-
2. Every test exercises the real thing
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Strict TDD produces both naturally: a test written first and watched
|
|
17
|
-
failing against real code has already proven it can fail, and only earns
|
|
18
|
-
a mock when the real dependency proves slow or external.
|
|
19
|
-
|
|
20
|
-
## Principle 1: Name the Break
|
|
21
|
-
|
|
22
|
-
Before writing the test body, answer: **what production change should
|
|
23
|
-
make this test fail — and is that change a bug or a decision?** A test
|
|
24
|
-
earns its place by catching a wrong branch, missing side effect, wrong
|
|
25
|
-
argument, boundary case, or broken contract.
|
|
26
|
-
|
|
27
|
-
**Derive expectations independently.** Use literals and hand-checked
|
|
28
|
-
fixtures; table-driven tests with literal `want` values are the preferred
|
|
29
|
-
shape. An expectation computed by the code under test — or its helpers —
|
|
30
|
-
passes no matter what that code does:
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// ❌ Mirror assertion: the same builder computes both sides — always true
|
|
34
|
-
const expected = buildSearchQuery({ tag: 'urgent' });
|
|
35
|
-
expect(buildSearchQuery({ tag: 'urgent' })).toBe(expected);
|
|
36
|
-
|
|
37
|
-
// ✅ Hand-derived literal
|
|
38
|
-
expect(buildSearchQuery({ tag: 'urgent' })).toBe('tag:"urgent"');
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**No change detectors.** If only intentional decisions can fail a test —
|
|
42
|
-
a constant's value, exact message wording, private structure — it fires
|
|
43
|
-
on redesign and sleeps through bugs. Test the behavior that depends on
|
|
44
|
-
the decision: not `expect(MAX_RETRIES).toBe(5)` but "a failing call is
|
|
45
|
-
retried 5 times and the 6th attempt never happens."
|
|
46
|
-
|
|
47
|
-
**Behavior, not text.** Asserting that a script, skill, or config
|
|
48
|
-
contains an exact line proves only that the source is the source. Run
|
|
49
|
-
scripts against controlled inputs and assert outputs, side effects, or
|
|
50
|
-
exit codes. Documents that instruct agents are tested by the consuming
|
|
51
|
-
agent's behavior (superpowers:writing-skills); prose for humans earns no
|
|
52
|
-
test at all.
|
|
53
|
-
|
|
54
|
-
**Your code, not the framework.** Test the contract your code makes at
|
|
55
|
-
its boundaries — the route you register, the query you emit, the payload
|
|
56
|
-
you produce. Upstream mechanics are their maintainers' tests to write
|
|
57
|
-
(the classic: asserting your router invokes a registered handler — that
|
|
58
|
-
is the framework's test, not yours). When upstream behavior genuinely
|
|
59
|
-
surprised you, write one narrow characterization test naming the
|
|
60
|
-
assumption. The same boundary applies inside your code: constructors,
|
|
61
|
-
getters, constants, and trivial forwarding earn tests only when they
|
|
62
|
-
validate, normalize, default, derive, enforce, or cause side effects —
|
|
63
|
-
otherwise assert the first consumer-visible result that depends on them.
|
|
64
|
-
|
|
65
|
-
### Gate Function
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
BEFORE writing the test body:
|
|
69
|
-
Name the production change that would make this test fail.
|
|
70
|
-
|
|
71
|
-
Cannot name one → redesign around an observable behavior
|
|
72
|
-
"The source text changed" → run the artifact and assert its effects
|
|
73
|
-
Only intentional decisions → change detector; test the behavior
|
|
74
|
-
that depends on the decision
|
|
75
|
-
|
|
76
|
-
Confirm the expected value is derived without the code under test.
|
|
77
|
-
IF it reuses the code's logic or helpers:
|
|
78
|
-
Replace it with a literal or hand-checked fixture
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Principle 2: Exercise the Real Thing
|
|
82
|
-
|
|
83
|
-
**The mock earns no assertions.** A mock assertion passes when the mock
|
|
84
|
-
is present and fails when it is absent — it says nothing about the
|
|
85
|
-
component. Assert the real component's behavior; if the mock is what you
|
|
86
|
-
are checking, unmock it or delete the assertion.
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
// ✅ Real behavior
|
|
90
|
-
expect(screen.getByRole('navigation')).toBeInTheDocument();
|
|
91
|
-
|
|
92
|
-
// ❌ Mock existence
|
|
93
|
-
expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**your human partner's correction:** "Are we testing the behavior of a
|
|
97
|
-
mock?"
|
|
98
|
-
|
|
99
|
-
**Mock at the right level.** Learn every side effect of the real method
|
|
100
|
-
before replacing it; mock the slow or external operation and keep what
|
|
101
|
-
the test depends on real. When unsure, run the test against the real
|
|
102
|
-
implementation first and observe what actually needs to happen.
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
// ❌ The mock swallows the config write that duplicate detection reads
|
|
106
|
-
vi.mock('ToolCatalog', () => ({
|
|
107
|
-
discoverAndCacheTools: vi.fn().mockResolvedValue(undefined)
|
|
108
|
-
}));
|
|
109
|
-
|
|
110
|
-
// ✅ Mock only the slow server startup; the config write stays real
|
|
111
|
-
vi.mock('MCPServerManager');
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Make doubles specific.** When arguments, call counts, or ordering are
|
|
115
|
-
part of the contract, assert them — a fake that accepts anything verifies
|
|
116
|
-
nothing. Give each branch (success, error, malformed) its own fixture or
|
|
117
|
-
spy, so the wrong branch cannot satisfy the expectation.
|
|
118
|
-
|
|
119
|
-
**Mirror real data completely.** Mock the complete structure as it exists
|
|
120
|
-
in reality — all documented fields — not just the ones your test reads.
|
|
121
|
-
Partial mocks fail silently when downstream code reads an omitted field:
|
|
122
|
-
the test passes while integration breaks.
|
|
123
|
-
|
|
124
|
-
**Production classes carry production methods only.** Cleanup that only
|
|
125
|
-
tests need lives in test utilities, never as a `destroy()` on the
|
|
126
|
-
production class. Ask: is this method called only from tests? Does this
|
|
127
|
-
class own this resource's lifecycle? Wrong answers → test utility.
|
|
128
|
-
|
|
129
|
-
**Prefer real components over complex mocks.** When mock setup outgrows
|
|
130
|
-
the test logic, mocks miss methods the real components have, or tests
|
|
131
|
-
break when the mock changes, switch to an integration test with real
|
|
132
|
-
components. **your human partner's question:** "Do we need to be using a
|
|
133
|
-
mock here?"
|
|
134
|
-
|
|
135
|
-
### Gate Function
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
BEFORE adding a mock or test helper:
|
|
139
|
-
List the real method's side effects; keep the ones the test
|
|
140
|
-
depends on real — mock the slow/external level below them.
|
|
141
|
-
|
|
142
|
-
Mock responses mirror the complete real structure.
|
|
143
|
-
|
|
144
|
-
A method only tests call lives in test utilities, not production.
|
|
145
|
-
|
|
146
|
-
About to assert on the mock itself?
|
|
147
|
-
Unmock it or delete the assertion.
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Tests Ship With the Implementation
|
|
151
|
-
|
|
152
|
-
The TDD cycle — failing test, minimal implementation, refactor — is what
|
|
153
|
-
"complete" means. Ship the tests the behavior needs and only those:
|
|
154
|
-
trivial code and human prose earn none, and a test written to satisfy
|
|
155
|
-
process costs maintenance forever.
|
|
156
|
-
|
|
157
|
-
## The Mutation Check
|
|
158
|
-
|
|
159
|
-
Before finishing, mentally mutate the production code; at least one test
|
|
160
|
-
should fail for each realistic mutation:
|
|
161
|
-
|
|
162
|
-
- Wrong constant or argument
|
|
163
|
-
- Wrong branch handler
|
|
164
|
-
- Missing state change or side effect
|
|
165
|
-
- Empty or default return
|
|
166
|
-
- Missing validation for zero, empty, nil, unauthorized, or malformed input
|
|
167
|
-
|
|
168
|
-
A mutation nothing catches marks the behavior as unprotected — or the
|
|
169
|
-
test as tautological.
|
|
170
|
-
|
|
171
|
-
## Quick Reference
|
|
172
|
-
|
|
173
|
-
| When you... | Do |
|
|
174
|
-
|-------------|-----|
|
|
175
|
-
| Write any test | Name the break it catches — a bug, not a decision |
|
|
176
|
-
| Build an expected value | Derive it by hand; never with the code under test |
|
|
177
|
-
| Test a script or document | Run it / pressure-test its consumer; never grep its text |
|
|
178
|
-
| Reach for a dependency test | Test your boundary contract, not their documented mechanics |
|
|
179
|
-
| Want to assert on a mocked element | Test the real component, or unmock it |
|
|
180
|
-
| Are about to mock a method | Learn its side effects; mock the slow/external level |
|
|
181
|
-
| Build a mock response | Mirror the real structure completely |
|
|
182
|
-
| Need cleanup only tests use | Put it in test utilities |
|
|
183
|
-
| Watch mock setup balloon | Switch to an integration test with real components |
|
|
184
|
-
| Finish a test file | Run the mutation check |
|
|
185
|
-
|
|
186
|
-
## Warning Signs
|
|
187
|
-
|
|
188
|
-
- Setup and assertion share the same object, guaranteeing equality
|
|
189
|
-
- The test can fail only through a panic, crash, or missing selector
|
|
190
|
-
- The test fails on every intentional change, never on accidental breakage
|
|
191
|
-
- Expected values are hidden behind loops, builders, or helpers
|
|
192
|
-
- The test greps source text, or asserts a removed symbol stays removed
|
|
193
|
-
- The test would still matter if only the framework remained
|
|
194
|
-
- The test exists for coverage, checking no side effect or outcome
|
|
195
|
-
- An assertion checks a `*-mock` test ID, or fails if you remove the mock
|
|
196
|
-
- A method is called only from test files
|
|
197
|
-
- Mock setup is more than half the test, or you can't explain why the mock is needed
|
|
198
|
-
- Mocking "just to be safe"
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: verification-before-completion
|
|
3
|
-
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Verification Before Completion
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
**Core principle:** Evidence before claims, always.
|
|
11
|
-
|
|
12
|
-
**Violating the letter of this rule is violating the spirit of this rule.**
|
|
13
|
-
|
|
14
|
-
## The Iron Law
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
21
|
-
|
|
22
|
-
## The Gate Function
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
BEFORE claiming any status or expressing satisfaction:
|
|
26
|
-
|
|
27
|
-
1. IDENTIFY: What command proves this claim?
|
|
28
|
-
2. RUN: Execute the FULL command (fresh, complete)
|
|
29
|
-
3. READ: Full output, check exit code, count failures
|
|
30
|
-
4. VERIFY: Does output confirm the claim?
|
|
31
|
-
- If NO: State actual status with evidence
|
|
32
|
-
- If YES: State claim WITH evidence
|
|
33
|
-
5. ONLY THEN: Make the claim
|
|
34
|
-
|
|
35
|
-
Skip any step = lying, not verifying
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Common Failures
|
|
39
|
-
|
|
40
|
-
| Claim | Requires | Not Sufficient |
|
|
41
|
-
|-------|----------|----------------|
|
|
42
|
-
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
43
|
-
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
44
|
-
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
45
|
-
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
46
|
-
| Regression test works | Red-green cycle verified | Test passes once |
|
|
47
|
-
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
|
48
|
-
| Requirements met | Line-by-line checklist | Tests passing |
|
|
49
|
-
|
|
50
|
-
## Red Flags - STOP
|
|
51
|
-
|
|
52
|
-
- Using "should", "probably", "seems to"
|
|
53
|
-
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
|
|
54
|
-
- About to commit/push/PR without verification
|
|
55
|
-
- Trusting agent success reports
|
|
56
|
-
- Relying on partial verification
|
|
57
|
-
- Thinking "just this once"
|
|
58
|
-
- Tired and wanting work over
|
|
59
|
-
- **ANY wording implying success without having run verification**
|
|
60
|
-
|
|
61
|
-
## Rationalization Prevention
|
|
62
|
-
|
|
63
|
-
| Excuse | Reality |
|
|
64
|
-
|--------|---------|
|
|
65
|
-
| "Should work now" | RUN the verification |
|
|
66
|
-
| "I'm confident" | Confidence ≠ evidence |
|
|
67
|
-
| "Just this once" | No exceptions |
|
|
68
|
-
| "Linter passed" | Linter ≠ compiler |
|
|
69
|
-
| "Agent said success" | Verify independently |
|
|
70
|
-
| "I'm tired" | Exhaustion ≠ excuse |
|
|
71
|
-
| "Partial check is enough" | Partial proves nothing |
|
|
72
|
-
| "Different words so rule doesn't apply" | Spirit over letter |
|
|
73
|
-
|
|
74
|
-
## Key Patterns
|
|
75
|
-
|
|
76
|
-
**Tests:**
|
|
77
|
-
```
|
|
78
|
-
✅ [Run test command] [See: 34/34 pass] "All tests pass"
|
|
79
|
-
❌ "Should pass now" / "Looks correct"
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Regression tests (TDD Red-Green):**
|
|
83
|
-
```
|
|
84
|
-
✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
|
|
85
|
-
❌ "I've written a regression test" (without red-green verification)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Build:**
|
|
89
|
-
```
|
|
90
|
-
✅ [Run build] [See: exit 0] "Build passes"
|
|
91
|
-
❌ "Linter passed" (linter doesn't check compilation)
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
**Requirements:**
|
|
95
|
-
```
|
|
96
|
-
✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
|
|
97
|
-
❌ "Tests pass, phase complete"
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Agent delegation:**
|
|
101
|
-
```
|
|
102
|
-
✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
|
|
103
|
-
❌ Trust agent report
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## When To Apply
|
|
107
|
-
|
|
108
|
-
**ALWAYS before:**
|
|
109
|
-
- ANY variation of success/completion claims
|
|
110
|
-
- ANY expression of satisfaction
|
|
111
|
-
- ANY positive statement about work state
|
|
112
|
-
- Committing, PR creation, task completion
|
|
113
|
-
- Moving to next task
|
|
114
|
-
- Delegating to agents
|
|
115
|
-
|
|
116
|
-
**Rule applies to:**
|
|
117
|
-
- Exact phrases
|
|
118
|
-
- Paraphrases and synonyms
|
|
119
|
-
- Implications of success
|
|
120
|
-
- ANY communication suggesting completion/correctness
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: writing-plans
|
|
3
|
-
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Writing Plans
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
-
|
|
12
|
-
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
13
|
-
|
|
14
|
-
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
15
|
-
|
|
16
|
-
**Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
|
|
17
|
-
|
|
18
|
-
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
|
-
- (User preferences for plan location override this default)
|
|
20
|
-
|
|
21
|
-
## Scope Check
|
|
22
|
-
|
|
23
|
-
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
24
|
-
|
|
25
|
-
## File Structure
|
|
26
|
-
|
|
27
|
-
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
28
|
-
|
|
29
|
-
- Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
|
|
30
|
-
- You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
|
|
31
|
-
- Files that change together should live together. Split by responsibility, not by technical layer.
|
|
32
|
-
- In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
|
|
33
|
-
|
|
34
|
-
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
|
|
35
|
-
|
|
36
|
-
## Task Right-Sizing
|
|
37
|
-
|
|
38
|
-
A task is the smallest unit that carries its own test cycle and is worth a
|
|
39
|
-
fresh reviewer's gate. When drawing task boundaries: fold setup,
|
|
40
|
-
configuration, scaffolding, and documentation steps into the task whose
|
|
41
|
-
deliverable needs them; split only where a reviewer could meaningfully
|
|
42
|
-
reject one task while approving its neighbor. Each task ends with an
|
|
43
|
-
independently testable deliverable.
|
|
44
|
-
|
|
45
|
-
## Bite-Sized Task Granularity
|
|
46
|
-
|
|
47
|
-
**Each step is one action (2-5 minutes):**
|
|
48
|
-
- "Write the failing test" - step
|
|
49
|
-
- "Run it to make sure it fails" - step
|
|
50
|
-
- "Implement the minimal code to make the test pass" - step
|
|
51
|
-
- "Run the tests and make sure they pass" - step
|
|
52
|
-
- "Commit" - step
|
|
53
|
-
|
|
54
|
-
## Plan Document Header
|
|
55
|
-
|
|
56
|
-
**Every plan MUST start with this header:**
|
|
57
|
-
|
|
58
|
-
```markdown
|
|
59
|
-
# [Feature Name] Implementation Plan
|
|
60
|
-
|
|
61
|
-
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
62
|
-
|
|
63
|
-
**Goal:** [One sentence describing what this builds]
|
|
64
|
-
|
|
65
|
-
**Architecture:** [2-3 sentences about approach]
|
|
66
|
-
|
|
67
|
-
**Tech Stack:** [Key technologies/libraries]
|
|
68
|
-
|
|
69
|
-
## Global Constraints
|
|
70
|
-
|
|
71
|
-
[The spec's project-wide requirements — version floors, dependency limits,
|
|
72
|
-
naming and copy rules, platform requirements — one line each, with exact
|
|
73
|
-
values copied verbatim from the spec. Every task's requirements implicitly
|
|
74
|
-
include this section.]
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Task Structure
|
|
80
|
-
|
|
81
|
-
````markdown
|
|
82
|
-
### Task N: [Component Name]
|
|
83
|
-
|
|
84
|
-
**Files:**
|
|
85
|
-
- Create: `exact/path/to/file.py`
|
|
86
|
-
- Modify: `exact/path/to/existing.py:123-145`
|
|
87
|
-
- Test: `tests/exact/path/to/test.py`
|
|
88
|
-
|
|
89
|
-
**Interfaces:**
|
|
90
|
-
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
91
|
-
- Produces: [what later tasks rely on — exact function names, parameter
|
|
92
|
-
and return types. A task's implementer sees only their own task; this
|
|
93
|
-
block is how they learn the names and types neighboring tasks use.]
|
|
94
|
-
|
|
95
|
-
- [ ] **Step 1: Write the failing test**
|
|
96
|
-
|
|
97
|
-
```python
|
|
98
|
-
def test_specific_behavior():
|
|
99
|
-
result = function(input)
|
|
100
|
-
assert result == expected
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
- [ ] **Step 2: Run test to verify it fails**
|
|
104
|
-
|
|
105
|
-
Run: `pytest tests/path/test.py::test_name -v`
|
|
106
|
-
Expected: FAIL with "function not defined"
|
|
107
|
-
|
|
108
|
-
- [ ] **Step 3: Write minimal implementation**
|
|
109
|
-
|
|
110
|
-
```python
|
|
111
|
-
def function(input):
|
|
112
|
-
return expected
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
- [ ] **Step 4: Run test to verify it passes**
|
|
116
|
-
|
|
117
|
-
Run: `pytest tests/path/test.py::test_name -v`
|
|
118
|
-
Expected: PASS
|
|
119
|
-
|
|
120
|
-
- [ ] **Step 5: Commit**
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
git add tests/path/test.py src/path/file.py
|
|
124
|
-
git commit -m "feat: add specific feature"
|
|
125
|
-
```
|
|
126
|
-
````
|
|
127
|
-
|
|
128
|
-
## No Placeholders
|
|
129
|
-
|
|
130
|
-
Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
|
|
131
|
-
- "TBD", "TODO", "implement later", "fill in details"
|
|
132
|
-
- "Add appropriate error handling" / "add validation" / "handle edge cases"
|
|
133
|
-
- "Write tests for the above" (without actual test code)
|
|
134
|
-
- "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
|
|
135
|
-
- Steps that describe what to do without showing how (code blocks required for code steps)
|
|
136
|
-
- References to types, functions, or methods not defined in any task
|
|
137
|
-
|
|
138
|
-
## Self-Review
|
|
139
|
-
|
|
140
|
-
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
|
|
141
|
-
|
|
142
|
-
**1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
|
|
143
|
-
|
|
144
|
-
**2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
|
|
145
|
-
|
|
146
|
-
**3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
147
|
-
|
|
148
|
-
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
|
|
149
|
-
|
|
150
|
-
## Execution Handoff
|
|
151
|
-
|
|
152
|
-
After saving the plan, offer execution choice:
|
|
153
|
-
|
|
154
|
-
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
|
|
155
|
-
|
|
156
|
-
**1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
|
|
157
|
-
|
|
158
|
-
**2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
|
|
159
|
-
|
|
160
|
-
**Which approach?"**
|
|
161
|
-
|
|
162
|
-
**If Subagent-Driven chosen:**
|
|
163
|
-
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
|
|
164
|
-
- Fresh subagent per task + two-stage review
|
|
165
|
-
|
|
166
|
-
**If Inline Execution chosen:**
|
|
167
|
-
- **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
|
|
168
|
-
- Batch execution with checkpoints for review
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Plan Document Reviewer Prompt Template
|
|
2
|
-
|
|
3
|
-
Use this template when dispatching a plan document reviewer subagent.
|
|
4
|
-
|
|
5
|
-
**Purpose:** Verify the plan is complete, matches the spec, and has proper task decomposition.
|
|
6
|
-
|
|
7
|
-
**Dispatch after:** The complete plan is written.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Subagent (general-purpose):
|
|
11
|
-
description: "Review plan document"
|
|
12
|
-
prompt: |
|
|
13
|
-
You are a plan document reviewer. Verify this plan is complete and ready for implementation.
|
|
14
|
-
|
|
15
|
-
**Plan to review:** [PLAN_FILE_PATH]
|
|
16
|
-
**Spec for reference:** [SPEC_FILE_PATH]
|
|
17
|
-
|
|
18
|
-
## What to Check
|
|
19
|
-
|
|
20
|
-
| Category | What to Look For |
|
|
21
|
-
|----------|------------------|
|
|
22
|
-
| Completeness | TODOs, placeholders, incomplete tasks, missing steps |
|
|
23
|
-
| Spec Alignment | Plan covers spec requirements, no major scope creep |
|
|
24
|
-
| Task Decomposition | Tasks have clear boundaries, steps are actionable |
|
|
25
|
-
| Buildability | Could an engineer follow this plan without getting stuck? |
|
|
26
|
-
|
|
27
|
-
## Calibration
|
|
28
|
-
|
|
29
|
-
**Only flag issues that would cause real problems during implementation.**
|
|
30
|
-
An implementer building the wrong thing or getting stuck is an issue.
|
|
31
|
-
Minor wording, stylistic preferences, and "nice to have" suggestions are not.
|
|
32
|
-
|
|
33
|
-
Approve unless there are serious gaps — missing requirements from the spec,
|
|
34
|
-
contradictory steps, placeholder content, or tasks so vague they can't be acted on.
|
|
35
|
-
|
|
36
|
-
## Output Format
|
|
37
|
-
|
|
38
|
-
## Plan Review
|
|
39
|
-
|
|
40
|
-
**Status:** Approved | Issues Found
|
|
41
|
-
|
|
42
|
-
**Issues (if any):**
|
|
43
|
-
- [Task X, Step Y]: [specific issue] - [why it matters for implementation]
|
|
44
|
-
|
|
45
|
-
**Recommendations (advisory, do not block approval):**
|
|
46
|
-
- [suggestions for improvement]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Reviewer returns:** Status, Issues (if any), Recommendations
|