opencode-ship 0.8.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 +108 -0
  2. package/README.md +5 -3
  3. package/THIRD_PARTY_NOTICES.md +77 -18
  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,198 @@
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"
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: to-spec
3
+ description: Turn the current conversation into a spec and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ This skill takes the current conversation context and codebase understanding and produces a spec (you may know this document as a PRD). Do NOT interview the user — just synthesize what you already know.
8
+
9
+ The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
10
+
11
+ ## Process
12
+
13
+ 1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the spec, and respect any ADRs in the area you're touching.
14
+
15
+ 2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
16
+
17
+ Check with the user that these seams match their expectations.
18
+
19
+ 3. Write the spec using the template below, then publish it to the project issue tracker. Apply the `ready-for-agent` triage label - no need for additional triage.
20
+
21
+ <spec-template>
22
+
23
+ ## Problem Statement
24
+
25
+ The problem that the user is facing, from the user's perspective.
26
+
27
+ ## Solution
28
+
29
+ The solution to the problem, from the user's perspective.
30
+
31
+ ## User Stories
32
+
33
+ A LONG, numbered list of user stories. Each user story should be in the format of:
34
+
35
+ 1. As an <actor>, I want a <feature>, so that <benefit>
36
+
37
+ <user-story-example>
38
+ 1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
39
+ </user-story-example>
40
+
41
+ This list of user stories should be extremely extensive and cover all aspects of the feature.
42
+
43
+ ## Implementation Decisions
44
+
45
+ A list of implementation decisions that were made. This can include:
46
+
47
+ - The modules that will be built/modified
48
+ - The interfaces of those modules that will be modified
49
+ - Technical clarifications from the developer
50
+ - Architectural decisions
51
+ - Schema changes
52
+ - API contracts
53
+ - Specific interactions
54
+
55
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
56
+
57
+ Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
58
+
59
+ ## Testing Decisions
60
+
61
+ A list of testing decisions that were made. Include:
62
+
63
+ - A description of what makes a good test (only test external behavior, not implementation details)
64
+ - Which modules will be tested
65
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
66
+
67
+ ## Out of Scope
68
+
69
+ A description of the things that are out of scope for this spec.
70
+
71
+ ## Further Notes
72
+
73
+ Any further notes about the feature.
74
+
75
+ </spec-template>
76
+
77
+ ## Ship integration
78
+
79
+ This skill is part of the engineering profile shipped by
80
+ `opencode-ship@1.0`. The strong planner child session is
81
+ configured with `openai/gpt-5.6-sol` and the durable workflow
82
+ state lives under `<git-common-dir>/opencode-ship/`. All
83
+ GitHub mutations go through Ship's typed tools; never use
84
+ `gh api` or raw shell.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: to-tickets
3
+ description: Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker — edges as text in one file per ticket locally, or native blocking links on a real tracker.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # To Tickets
8
+
9
+ Break a plan, spec, or conversation into a set of **tickets** — tracer-bullet vertical slices, each declaring the tickets that **block** it.
10
+
11
+ The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
12
+
13
+ ## Process
14
+
15
+ ### 1. Gather context
16
+
17
+ Work from whatever is already in the conversation context. If the user passes a reference (a spec path, an issue number or URL) as an argument, fetch it and read its full body and comments.
18
+
19
+ ### 2. Explore the codebase (optional)
20
+
21
+ If you have not already explored the codebase, do so to understand the current state of the code. Ticket titles and descriptions should use the project's domain glossary vocabulary, and respect ADRs in the area you're touching.
22
+
23
+ Look for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
24
+
25
+ ### 3. Draft vertical slices
26
+
27
+ Break the work into **tracer bullet** tickets.
28
+
29
+ <vertical-slice-rules>
30
+
31
+ - Each slice cuts a narrow but COMPLETE path through every layer (schema, API, UI, tests) — vertical, NOT a horizontal slice of one layer
32
+ - A completed slice is demoable or verifiable on its own
33
+ - Each slice is sized to fit in a single fresh context window
34
+ - Any prefactoring should be done first
35
+
36
+ </vertical-slice-rules>
37
+
38
+ Give each ticket its **blocking edges** — the other tickets that must complete before it can start. A ticket with no blockers can start immediately.
39
+
40
+ **Wide refactors are the exception to vertical slicing.** A **wide refactor** is one mechanical change — rename a column, retype a shared symbol — whose **blast radius** fans across the whole codebase, so a single edit breaks thousands of call sites at once and no vertical slice can land green. Don't force it into a tracer bullet; sequence it as **expand–contract**. First expand: add the new form beside the old so nothing breaks. Then migrate the call sites over in batches sized by blast radius (per package, per directory), each batch its own ticket blocked by the expand, keeping CI green batch to batch because the old form still exists. Finally contract: delete the old form once no caller remains, in a ticket blocked by every migrate batch. When even the batches can't stay green alone, keep the sequence but let them share an integration branch that all block a final integrate-and-verify ticket — green is promised only there.
41
+
42
+ ### 4. Quiz the user
43
+
44
+ Present the proposed breakdown as a numbered list. For each ticket, show:
45
+
46
+ - **Title**: short descriptive name
47
+ - **Blocked by**: which other tickets (if any) must complete first
48
+ - **What it delivers**: the end-to-end behaviour this ticket makes work
49
+
50
+ Ask the user:
51
+
52
+ - Does the granularity feel right? (too coarse / too fine)
53
+ - Are the blocking edges correct — does each ticket only depend on tickets that genuinely gate it?
54
+ - Should any tickets be merged or split further?
55
+
56
+ Iterate until the user approves the breakdown.
57
+
58
+ ### 5. Publish the tickets to the configured tracker
59
+
60
+ Publish the approved tickets. **How** depends on the tracker `/setup-matt-pocock-skills` configured — the tickets are the same either way, only the shape of the blocking edges changes:
61
+
62
+ - **Local files** → write one file per ticket under `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01` in dependency order (blockers first). Each file's "Blocked by" lists the numbers/titles it depends on. Use the per-ticket file template below — one ticket per file, never a single combined file.
63
+ - **A real issue tracker (GitHub, Linear, …)** → publish one issue per ticket in dependency order (blockers first) so each ticket's blocking edges can reference real identifiers. Use the platform's native blocking / sub-issue relationship where it has one; otherwise set each ticket's "Blocked by" to the blocking issues. Apply the `ready-for-agent` triage label unless instructed otherwise — the tickets are agent-grabbable by construction.
64
+
65
+ Work the **frontier**: any ticket whose blockers are all done. For a purely linear chain that means top to bottom.
66
+
67
+ Do NOT close or modify any parent issue.
68
+
69
+ <local-ticket-template>
70
+
71
+ # <NN> — <Ticket title>
72
+
73
+ **What to build:** the end-to-end behaviour this ticket makes work, from the user's perspective — not a layer-by-layer implementation list.
74
+
75
+ **Blocked by:** the numbers/titles of the tickets that gate this one, or "None — can start immediately".
76
+
77
+ **Status:** ready-for-agent
78
+
79
+ - [ ] Acceptance criterion 1
80
+ - [ ] Acceptance criterion 2
81
+
82
+ </local-ticket-template>
83
+
84
+ <issue-template>
85
+
86
+ ## Parent
87
+
88
+ A reference to the parent issue on the tracker (if the source was an existing issue, otherwise omit this section).
89
+
90
+ ## What to build
91
+
92
+ The end-to-end behaviour this ticket makes work, from the user's perspective — not layer-by-layer implementation.
93
+
94
+ ## Acceptance criteria
95
+
96
+ - [ ] Criterion 1
97
+ - [ ] Criterion 2
98
+
99
+ ## Blocked by
100
+
101
+ - A reference to each blocking ticket, or "None — can start immediately".
102
+
103
+ </issue-template>
104
+
105
+ In either form, avoid specific file paths or code snippets — they go stale fast. Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
106
+
107
+ ## Ship integration
108
+
109
+ This skill is part of the engineering profile shipped by
110
+ `opencode-ship@1.0`. The strong planner child session is
111
+ configured with `openai/gpt-5.6-sol` and the durable workflow
112
+ state lives under `<git-common-dir>/opencode-ship/`. All
113
+ GitHub mutations go through Ship's typed tools; never use
114
+ `gh api` or raw shell.
@@ -0,0 +1,207 @@
1
+ # Writing Agent Briefs
2
+
3
+ An agent brief is a structured comment posted on a GitHub issue or PR when it moves to `ready-for-agent`. It is the authoritative specification that an AFK agent will work from. The original body and discussion are context — the agent brief is the contract.
4
+
5
+ The brief states **what the agent should do**, which stretches to both surfaces: for an issue, that's building the change from nothing; for a PR, it's what's left to do *to the existing diff* — finish it, close gaps, address review points. Same principles either way; the PR example below shows the difference.
6
+
7
+ ## Principles
8
+
9
+ ### Durability over precision
10
+
11
+ The issue may sit in `ready-for-agent` for days or weeks. The codebase will change in the meantime. Write the brief so it stays useful even as files are renamed, moved, or refactored.
12
+
13
+ - **Do** describe interfaces, types, and behavioral contracts
14
+ - **Do** name specific types, function signatures, or config shapes that the agent should look for or modify
15
+ - **Don't** reference file paths — they go stale
16
+ - **Don't** reference line numbers
17
+ - **Don't** assume the current implementation structure will remain the same
18
+
19
+ ### Behavioral, not procedural
20
+
21
+ Describe **what** the system should do, not **how** to implement it. The agent will explore the codebase fresh and make its own implementation decisions.
22
+
23
+ - **Good:** "The `SkillConfig` type should accept an optional `schedule` field of type `CronExpression`"
24
+ - **Bad:** "Open src/types/skill.ts and add a schedule field on line 42"
25
+ - **Good:** "When a user runs `/triage` with no arguments, they should see a summary of issues needing attention"
26
+ - **Bad:** "Add a switch statement in the main handler function"
27
+
28
+ ### Complete acceptance criteria
29
+
30
+ The agent needs to know when it's done. Every agent brief must have concrete, testable acceptance criteria. Each criterion should be independently verifiable.
31
+
32
+ - **Good:** "Running `gh issue list --label needs-triage` returns issues that have been through initial classification"
33
+ - **Bad:** "Triage should work correctly"
34
+
35
+ ### Explicit scope boundaries
36
+
37
+ State what is out of scope. This prevents the agent from gold-plating or making assumptions about adjacent features.
38
+
39
+ ## Template
40
+
41
+ ```markdown
42
+ ## Agent Brief
43
+
44
+ **Category:** bug / enhancement
45
+ **Summary:** one-line description of what needs to happen
46
+
47
+ **Current behavior:**
48
+ Describe what happens now. For bugs, this is the broken behavior.
49
+ For enhancements, this is the status quo the feature builds on.
50
+
51
+ **Desired behavior:**
52
+ Describe what should happen after the agent's work is complete.
53
+ Be specific about edge cases and error conditions.
54
+
55
+ **Key interfaces:**
56
+ - `TypeName` — what needs to change and why
57
+ - `functionName()` return type — what it currently returns vs what it should return
58
+ - Config shape — any new configuration options needed
59
+
60
+ **Acceptance criteria:**
61
+ - [ ] Specific, testable criterion 1
62
+ - [ ] Specific, testable criterion 2
63
+ - [ ] Specific, testable criterion 3
64
+
65
+ **Out of scope:**
66
+ - Thing that should NOT be changed or addressed in this issue
67
+ - Adjacent feature that might seem related but is separate
68
+ ```
69
+
70
+ ## Examples
71
+
72
+ ### Good agent brief (bug)
73
+
74
+ ```markdown
75
+ ## Agent Brief
76
+
77
+ **Category:** bug
78
+ **Summary:** Skill description truncation drops mid-word, producing broken output
79
+
80
+ **Current behavior:**
81
+ When a skill description exceeds 1024 characters, it is truncated at exactly
82
+ 1024 characters regardless of word boundaries. This produces descriptions
83
+ that end mid-word (e.g. "Use when the user wants to confi").
84
+
85
+ **Desired behavior:**
86
+ Truncation should break at the last word boundary before 1024 characters
87
+ and append "..." to indicate truncation.
88
+
89
+ **Key interfaces:**
90
+ - The `SkillMetadata` type's `description` field — no type change needed,
91
+ but the validation/processing logic that populates it needs to respect
92
+ word boundaries
93
+ - Any function that reads SKILL.md frontmatter and extracts the description
94
+
95
+ **Acceptance criteria:**
96
+ - [ ] Descriptions under 1024 chars are unchanged
97
+ - [ ] Descriptions over 1024 chars are truncated at the last word boundary
98
+ before 1024 chars
99
+ - [ ] Truncated descriptions end with "..."
100
+ - [ ] The total length including "..." does not exceed 1024 chars
101
+
102
+ **Out of scope:**
103
+ - Changing the 1024 char limit itself
104
+ - Multi-line description support
105
+ ```
106
+
107
+ ### Good agent brief (enhancement)
108
+
109
+ ```markdown
110
+ ## Agent Brief
111
+
112
+ **Category:** enhancement
113
+ **Summary:** Add `.out-of-scope/` directory support for tracking rejected feature requests
114
+
115
+ **Current behavior:**
116
+ When a feature request is rejected, the issue is closed with a `wontfix` label
117
+ and a comment. There is no persistent record of the decision or reasoning.
118
+ Future similar requests require the maintainer to recall or search for the
119
+ prior discussion.
120
+
121
+ **Desired behavior:**
122
+ Rejected feature requests should be documented in `.out-of-scope/<concept>.md`
123
+ files that capture the decision, reasoning, and links to all issues that
124
+ requested the feature. When triaging new issues, these files should be
125
+ checked for matches.
126
+
127
+ **Key interfaces:**
128
+ - Markdown file format in `.out-of-scope/` — each file should have a
129
+ `# Concept Name` heading, a `**Decision:**` line, a `**Reason:**` line,
130
+ and a `**Prior requests:**` list with issue links
131
+ - The triage workflow should read all `.out-of-scope/*.md` files early
132
+ and match incoming issues against them by concept similarity
133
+
134
+ **Acceptance criteria:**
135
+ - [ ] Closing a feature as wontfix creates/updates a file in `.out-of-scope/`
136
+ - [ ] The file includes the decision, reasoning, and link to the closed issue
137
+ - [ ] If a matching `.out-of-scope/` file already exists, the new issue is
138
+ appended to its "Prior requests" list rather than creating a duplicate
139
+ - [ ] During triage, existing `.out-of-scope/` files are checked and surfaced
140
+ when a new issue matches a prior rejection
141
+
142
+ **Out of scope:**
143
+ - Automated matching (human confirms the match)
144
+ - Reopening previously rejected features
145
+ - Bug reports (only enhancement rejections go to `.out-of-scope/`)
146
+ ```
147
+
148
+ ### Good agent brief (PR)
149
+
150
+ For a PR, "Current behavior" describes the state of the diff, and the brief asks the agent to finish or fix it rather than build from scratch.
151
+
152
+ ```markdown
153
+ ## Agent Brief
154
+
155
+ **Category:** enhancement
156
+ **Summary:** Finish the contributor's `--json` output flag for `triage list`
157
+
158
+ **Current behavior:**
159
+ The PR adds a `--json` flag that serializes the issue list to JSON. The happy
160
+ path works and the diff matches the project's command structure. Two gaps
161
+ remain: errors are still printed as human text (not JSON), and the new flag has
162
+ no test coverage.
163
+
164
+ **Desired behavior:**
165
+ With `--json`, all output — including errors — is well-formed JSON on stdout,
166
+ and the command's exit codes are unchanged. The existing human-readable output
167
+ is untouched when the flag is absent.
168
+
169
+ **Key interfaces:**
170
+ - The command's error path should emit `{ "error": string }` under `--json`
171
+ instead of the plain-text error
172
+ - Reuse the existing serializer the PR already added; don't introduce a second
173
+
174
+ **Acceptance criteria:**
175
+ - [ ] `triage list --json` emits valid JSON for both success and error cases
176
+ - [ ] Exit codes match the non-JSON command
177
+ - [ ] A test covers the `--json` success output and one error case
178
+ - [ ] Default (non-JSON) output is byte-for-byte unchanged
179
+
180
+ **Out of scope:**
181
+ - Adding `--json` to any other command
182
+ - Changing the JSON shape of the success payload the PR already defined
183
+ ```
184
+
185
+ ### Bad agent brief
186
+
187
+ ```markdown
188
+ ## Agent Brief
189
+
190
+ **Summary:** Fix the triage bug
191
+
192
+ **What to do:**
193
+ The triage thing is broken. Look at the main file and fix it.
194
+ The function around line 150 has the issue.
195
+
196
+ **Files to change:**
197
+ - src/triage/handler.ts (line 150)
198
+ - src/types.ts (line 42)
199
+ ```
200
+
201
+ This is bad because:
202
+ - No category
203
+ - Vague description ("the triage thing is broken")
204
+ - References file paths and line numbers that will go stale
205
+ - No acceptance criteria
206
+ - No scope boundaries
207
+ - No description of current vs desired behavior