@martinffx/atelier 1.2.2 → 1.3.0

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 (57) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +22 -24
  3. package/agents/architect.md +1 -1
  4. package/agents/oracle.md +1 -1
  5. package/dist/atelier.js +12 -14
  6. package/package.json +1 -1
  7. package/skills/code-commit/SKILL.md +5 -13
  8. package/skills/code-pull-request/SKILL.md +36 -0
  9. package/skills/code-pull-request/references/common.md +76 -0
  10. package/skills/code-pull-request/references/create-pr.md +122 -0
  11. package/skills/code-pull-request/references/default-template.md +25 -0
  12. package/skills/code-pull-request/references/leave-comment.md +53 -0
  13. package/skills/code-pull-request/references/merge-pr.md +94 -0
  14. package/skills/code-pull-request/references/read-comments.md +61 -0
  15. package/skills/code-pull-request/references/respond-to-comment.md +66 -0
  16. package/skills/code-review/SKILL.md +21 -12
  17. package/skills/code-review/references/reviewers.md +142 -41
  18. package/skills/code-review/references/rq.md +48 -32
  19. package/skills/oracle-debug/SKILL.md +218 -0
  20. package/skills/{code-debug → oracle-debug}/references/bug-patterns.md +3 -3
  21. package/skills/oracle-domain-modelling/SKILL.md +84 -0
  22. package/skills/oracle-grill-me/SKILL.md +20 -0
  23. package/skills/spec-brainstorm/SKILL.md +91 -71
  24. package/skills/spec-finish/SKILL.md +20 -14
  25. package/skills/spec-implement/SKILL.md +3 -2
  26. package/skills/spec-orchestrator/SKILL.md +4 -15
  27. package/skills/spec-plan/SKILL.md +1 -1
  28. package/agents/scout.md +0 -40
  29. package/skills/code-commit/references/pr-workflow.md +0 -145
  30. package/skills/code-debug/SKILL.md +0 -199
  31. package/skills/code-docs/SKILL.md +0 -171
  32. package/skills/code-docs/references/api-docs.md +0 -116
  33. package/skills/code-docs/references/changelog.md +0 -64
  34. package/skills/code-docs/references/readme-structure.md +0 -94
  35. package/skills/oracle-architect/SKILL.md +0 -327
  36. package/skills/oracle-architect/references/api-design.md +0 -345
  37. package/skills/oracle-architect/references/data-modeling.md +0 -318
  38. package/skills/oracle-architect/references/ddd-patterns.md +0 -348
  39. package/skills/oracle-architect/references/interface-design.md +0 -203
  40. package/skills/oracle-challenge/SKILL.md +0 -126
  41. package/skills/oracle-doubt/SKILL.md +0 -252
  42. package/skills/oracle-doubt/references/adversarial-prompt.md +0 -47
  43. package/skills/oracle-grillme/SKILL.md +0 -160
  44. package/skills/oracle-security/SKILL.md +0 -225
  45. package/skills/oracle-security/references/security-patterns.md +0 -236
  46. package/skills/oracle-security/references/threat-modeling-guide.md +0 -137
  47. package/skills/oracle-testing/SKILL.md +0 -237
  48. package/skills/oracle-testing/references/anti-patterns.md +0 -618
  49. package/skills/oracle-testing/references/boundaries.md +0 -579
  50. package/skills/oracle-testing/references/core-testing.md +0 -691
  51. package/skills/oracle-testing/references/edge-testing.md +0 -794
  52. package/skills/oracle-testing/references/stub-driven-tdd.md +0 -322
  53. package/skills/oracle-thinkdeep/SKILL.md +0 -164
  54. /package/skills/{code-debug → oracle-debug}/references/language-tools.md +0 -0
  55. /package/skills/{code-debug → oracle-debug}/references/techniques.md +0 -0
  56. /package/skills/{oracle-grillme → oracle-domain-modelling}/references/ADR-FORMAT.md +0 -0
  57. /package/skills/{oracle-grillme → oracle-domain-modelling}/references/CONTEXT-FORMAT.md +0 -0
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: oracle-debug
3
+ description: >
4
+ Disciplined debugging methodology. Triggers on bug reports, test failures, "debug this",
5
+ "diagnose this", unexpected behavior, build failures, integration issues, or performance
6
+ regressions. Always find root cause before attempting any fix.
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Oracle Debug
11
+
12
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
13
+
14
+ **Core principle:** find root cause before attempting any fix. Symptom fixes are failure.
15
+
16
+ **Violating the letter of this process is violating the spirit of debugging.**
17
+
18
+ ## The Iron Law
19
+
20
+ ```
21
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
22
+ ```
23
+
24
+ If you haven't completed Phase 1, you cannot propose fixes.
25
+
26
+ ## When to Use
27
+
28
+ Use for any technical issue:
29
+
30
+ - Test failures
31
+ - Bugs in production
32
+ - Unexpected behavior
33
+ - Performance regressions
34
+ - Build or integration failures
35
+ - Intermittent failures
36
+
37
+ **Use this especially when:**
38
+
39
+ - Under time pressure
40
+ - "Just one quick fix" seems obvious
41
+ - You've already tried multiple fixes
42
+ - The previous fix didn't work
43
+ - You don't fully understand the issue
44
+
45
+ ## The Four Phases
46
+
47
+ You must complete each phase before proceeding to the next.
48
+
49
+ ---
50
+
51
+ ## Phase 1 — Root Cause Investigation
52
+
53
+ **Before attempting any fix:**
54
+
55
+ Use the project's domain glossary and ADRs to build a clear mental model of the
56
+ relevant modules before tracing.
57
+
58
+ 1. **Read error messages carefully.** Read the full stack trace, line numbers, file paths, and error codes. Don't skip warnings.
59
+ 2. **Build a fast feedback loop.** If you don't have a fast, deterministic, pass/fail signal for the bug, no amount of code-reading will save you. Spend disproportionate effort here.
60
+
61
+ Try these in order:
62
+ - Failing test at the seam that reaches the bug
63
+ - Curl / HTTP script against a running dev server
64
+ - CLI invocation with fixture input
65
+ - Headless browser script (Playwright/Puppeteer)
66
+ - Replay a captured trace (network payload, event log)
67
+ - Throwaway harness (minimal subset of the system)
68
+ - Property/fuzz loop for "sometimes wrong" bugs
69
+ - Bisection harness (e.g., `git bisect run`)
70
+ - Differential loop (old vs new version)
71
+ - HITL bash script (last resort — structure the human clicks)
72
+
73
+ Iterate on the loop: make it faster, sharper, and more deterministic. A 30-second flaky loop is barely better than no loop.
74
+
75
+ 3. **Reproduce the bug.** Run the loop. Confirm the failure matches what the user described, is reproducible across runs, and the exact symptom is captured.
76
+ 4. **Check recent changes.** `git diff`, recent commits, new dependencies, config changes, environment differences.
77
+ 5. **Trace data flow.** In multi-component systems, add diagnostic instrumentation at each boundary:
78
+ - Log what data enters each component
79
+ - Log what data exits each component
80
+ - Verify environment/config propagation
81
+ - Check state at each layer
82
+
83
+ Run once to gather evidence, then narrow to the failing component.
84
+ 6. **Trace backward through the call stack.** Where does the bad value originate? What called this with the bad value? Trace up until you find the source. Fix at the source, not at the symptom.
85
+
86
+ ### Non-deterministic bugs
87
+
88
+ The goal is not a clean repro but a **higher reproduction rate**. Loop the trigger 100×, parallelize, add stress, narrow timing windows, inject sleeps. A 50% flake is debuggable; 1% is not — keep raising the rate until it is.
89
+
90
+ ### When you genuinely cannot build a loop
91
+
92
+ Stop and say so explicitly. Ask the user for:
93
+
94
+ - Access to the environment that reproduces it
95
+ - A captured artifact (HAR, log dump, core dump, screen recording)
96
+ - Permission to add temporary production instrumentation
97
+
98
+ **Do not proceed to Phase 2 without a loop you believe in.**
99
+
100
+ ---
101
+
102
+ ## Phase 2 — Pattern Analysis
103
+
104
+ Find the pattern before fixing.
105
+
106
+ 1. **Find working examples.** Locate similar working code in the same codebase.
107
+ 2. **Compare against references.** If implementing a known pattern, read the reference implementation completely.
108
+ 3. **Identify differences.** List every difference between working and broken, however small.
109
+ 4. **Understand dependencies.** What components, config, settings, and assumptions does this code rely on?
110
+
111
+ ---
112
+
113
+ ## Phase 3 — Hypothesis and Testing
114
+
115
+ Use the scientific method.
116
+
117
+ 1. **Generate 3–5 ranked hypotheses.** Single-hypothesis generation anchors on the first plausible idea. Each hypothesis must be falsifiable: state the prediction it makes. **Show the ranked list to the user before testing** — they often have domain knowledge that re-ranks instantly.
118
+
119
+ > Format: "If `<X>` is the cause, then `<changing Y>` will make the bug disappear / `<changing Z>` will make it worse."
120
+
121
+ 2. **Test one variable at a time.** Make the smallest possible change to test the hypothesis.
122
+ 3. **Instrument mapped to predictions.** Each probe must map to a specific prediction. Prefer a debugger/REPL over logs; prefer targeted logs at boundaries over "log everything and grep".
123
+
124
+ **Tag every debug log** with a unique prefix, e.g. `[DEBUG-a4f2]`. Cleanup becomes a single grep.
125
+
126
+ 4. **Performance regressions.** Logs are usually wrong. Establish a baseline measurement (timing harness, profiler, query plan), then bisect. Measure first, fix second.
127
+
128
+ 5. **When you don't know, say so.** Don't pretend. Ask for help or research more.
129
+
130
+ ---
131
+
132
+ ## Phase 4 — Implementation
133
+
134
+ Fix the root cause, not the symptom.
135
+
136
+ 1. **Create a failing test case.** The simplest possible reproduction. MUST exist before the fix.
137
+
138
+ A **correct seam** is one where the test exercises the real bug pattern as it occurs at the call site. If the only available seam is too shallow, note that the codebase architecture is preventing the bug from being locked down.
139
+
140
+ 2. **Implement a single fix.** Address the root cause. One change at a time. No "while I'm here" improvements. No bundled refactoring.
141
+ 3. **Verify the fix.** Does the test pass? Do other tests still pass? Does the original repro no longer reproduce?
142
+ 4. **If the fix doesn't work:**
143
+ - STOP
144
+ - Count the failed fix attempts
145
+ - If < 3: return to Phase 1 with the new information
146
+ - If ≥ 3: **question the architecture**. Pattern problems, hidden coupling, and shared state that each fix reveals are signs of a wrong pattern. Discuss with the user before attempting Fix #4.
147
+
148
+ ### Cleanup + post-mortem
149
+
150
+ Before declaring done:
151
+
152
+ - [ ] Original repro no longer reproduces (re-run Phase 1 loop)
153
+ - [ ] Regression test passes (or absence of seam is documented)
154
+ - [ ] All `[DEBUG-...]` instrumentation removed
155
+ - [ ] Throwaway prototypes deleted or moved to a clearly-marked debug location
156
+ - [ ] The correct hypothesis is stated in the commit / PR message
157
+ - [ ] You asked: "What would have prevented this bug?"
158
+
159
+ ---
160
+
161
+ ## Red Flags — Stop and Return to Phase 1
162
+
163
+ If you catch yourself thinking:
164
+
165
+ - "Quick fix for now, investigate later"
166
+ - "Just try changing X and see if it works"
167
+ - "Add multiple changes, run tests"
168
+ - "Skip the test, I'll manually verify"
169
+ - "It's probably X, let me fix that"
170
+ - "I don't fully understand but this might work"
171
+ - "Pattern says X but I'll adapt it differently"
172
+ - "One more fix attempt" (after 2+ failures)
173
+ - Each fix reveals a new problem in a different place
174
+
175
+ All of these mean: stop. Return to Phase 1.
176
+
177
+ ## Common Rationalizations
178
+
179
+ | Excuse | Reality |
180
+ |---|---|
181
+ | "Issue is simple, don't need process" | Simple issues have root causes too. |
182
+ | "Emergency, no time for process" | Systematic debugging is faster than thrashing. |
183
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
184
+ | "I'll write the test after confirming the fix" | Untested fixes don't stick. Test first proves the bug. |
185
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
186
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. |
187
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
188
+
189
+ ## Quick Reference
190
+
191
+ | Phase | Key Activities | Success Criteria |
192
+ |---|---|---|
193
+ | 1. Root cause | Read errors, build loop, reproduce, trace data flow | Understand what and why |
194
+ | 2. Pattern analysis | Find working examples, compare | Identify differences |
195
+ | 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
196
+ | 4. Implementation | Failing test, single fix, verify | Bug resolved, tests pass |
197
+
198
+ ## Debug Summary
199
+
200
+ After each session, summarize:
201
+
202
+ ```
203
+ ## Debug Summary
204
+
205
+ **Problem:** [One sentence]
206
+ **Root Cause:** [What actually was wrong]
207
+ **Fix:** [How you fixed it]
208
+ **Verification:** [Test results]
209
+ **Prevention:** [Regression test added? Architectural finding?]
210
+ ```
211
+
212
+ ## References
213
+
214
+ - **Language-specific tools** → `references/language-tools.md`
215
+ - **Common bug patterns** → `references/bug-patterns.md`
216
+ - **Logging & techniques** → `references/techniques.md`
217
+
218
+ Structure inspired by [obra/superpowers systematic-debugging](https://github.com/obra/superpowers).
@@ -1,6 +1,6 @@
1
1
  # Common Bug Patterns
2
2
 
3
- Quick reference for recognising and fixing recurring bug categories.
3
+ Quick reference for recognizing and fixing recurring bug categories.
4
4
 
5
5
  ---
6
6
 
@@ -45,7 +45,7 @@ const name = user.profile.name;
45
45
 
46
46
  ## Logic Errors
47
47
 
48
- **Symptoms:** Wrong output, wrong behaviour
48
+ **Symptoms:** Wrong output, wrong behavior
49
49
 
50
50
  **Debug approach:**
51
51
  1. Trace through the logic manually
@@ -68,4 +68,4 @@ const name = user.profile.name;
68
68
  2. Identify hot paths
69
69
  3. Optimize the bottleneck
70
70
 
71
- **See also:** Phase 4 "Perf branch" in SKILL.md for the disciplined approach.
71
+ **See also:** Phase 3 "Performance regressions" in SKILL.md for the disciplined approach.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: oracle-domain-modelling
3
+ description: >
4
+ Build and sharpen a project's domain model. Use when the user wants to pin down
5
+ domain terminology or a ubiquitous language, record an architectural decision,
6
+ or when another skill needs to maintain the domain model.
7
+ user-invocable: false
8
+ ---
9
+
10
+ # Domain Modelling
11
+
12
+ Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `CONTEXT.md` for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
13
+
14
+ ## File structure
15
+
16
+ Most repos have a single context:
17
+
18
+ ```
19
+ /
20
+ ├── CONTEXT.md
21
+ ├── docs/
22
+ │ └── adr/
23
+ │ ├── 0001-event-sourced-orders.md
24
+ │ └── 0002-postgres-for-write-model.md
25
+ └── src/
26
+ ```
27
+
28
+ If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
29
+
30
+ ```
31
+ /
32
+ ├── CONTEXT-MAP.md
33
+ ├── docs/
34
+ │ └── adr/ ← system-wide decisions
35
+ ├── src/
36
+ │ ├── ordering/
37
+ │ │ ├── CONTEXT.md
38
+ │ │ └── docs/adr/ ← context-specific decisions
39
+ │ └── billing/
40
+ │ ├── CONTEXT.md
41
+ │ └── docs/adr/
42
+ ```
43
+
44
+ Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
45
+
46
+ ## During the session
47
+
48
+ ### Challenge against the glossary
49
+
50
+ When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately:
51
+
52
+ > "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
53
+
54
+ ### Sharpen fuzzy language
55
+
56
+ When the user uses vague or overloaded terms, propose a precise canonical term:
57
+
58
+ > "You're saying 'account' — do you mean the Customer or the User? Those are different things."
59
+
60
+ ### Discuss concrete scenarios
61
+
62
+ When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
63
+
64
+ ### Cross-reference with code
65
+
66
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it:
67
+
68
+ > "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
69
+
70
+ ### Update CONTEXT.md inline
71
+
72
+ When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [references/CONTEXT-FORMAT.md](./references/CONTEXT-FORMAT.md).
73
+
74
+ `CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
75
+
76
+ ### Offer ADRs sparingly
77
+
78
+ Only offer to create an ADR when all three are true:
79
+
80
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
81
+ 2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
82
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
83
+
84
+ If any of the three is missing, skip the ADR. Use the format in [references/ADR-FORMAT.md](./references/ADR-FORMAT.md).
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: oracle-grill-me
3
+ description: >
4
+ Grill the user relentlessly about a plan, decision, or idea, maintaining the project's
5
+ domain model (CONTEXT.md, ADRs) as decisions crystallise. Use when the user wants to
6
+ stress-test their thinking, or uses any 'grill' trigger phrases.
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Grill Me
11
+
12
+ Interview me relentlessly about every aspect of this until we reach a shared understanding. Walk down each branch of the decision tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
13
+
14
+ Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
15
+
16
+ If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
17
+
18
+ Do not act on it until I confirm we have reached a shared understanding.
19
+
20
+ Run this session using the `oracle-domain-modelling` skill.
@@ -2,8 +2,9 @@
2
2
  name: spec-brainstorm
3
3
  description: >
4
4
  Conversational design workshop for new features. Interviews the human one question
5
- at a time, explores 2-3 approaches with trade-offs, then produces a focused spec.
6
- Combines requirements discovery with codebase research and architecture design.
5
+ at a time, explores 2-3 approaches with trade-offs, and presents the design
6
+ section by section for approval before writing the spec. Combines requirements
7
+ discovery with codebase research and architecture design.
7
8
  Use when the user says "create a spec", "design this feature", "let's brainstorm",
8
9
  "what should we build", or at the start of any feature/refactor/complex-bug workflow.
9
10
  user-invocable: true
@@ -14,13 +15,14 @@ argument-hint: <topic or feature description>
14
15
 
15
16
  Conversational design workshop that produces a focused, reviewed spec.
16
17
 
17
- One question at a time. Multiple approaches explored. Ruthless scope control.
18
- No implementation until design is approved.
18
+ One question at a time. Multiple approaches explored. Design approved in
19
+ sections. Ruthless scope control. No implementation until design is approved.
19
20
 
20
21
  ## Artifact
21
22
 
22
23
  ```
23
- docs/specs/YYYY-MM-DD-<topic>-design.md ← This skill's output
24
+ docs/specs/YYYY-MM-DD-<feature>/
25
+ └── design.md ← This skill's output
24
26
  ```
25
27
 
26
28
  Requirements are inline — no separate requirements.json needed.
@@ -156,11 +158,14 @@ review before I continue with the design."
156
158
 
157
159
  ---
158
160
 
159
- ## Step 4: Design — Explore Approaches
161
+ ## Step 4: Design
160
162
 
161
- Before settling on a design, present **2-3 approaches** with trade-offs.
163
+ Design happens in three phases: explore approaches, present the design in sections,
164
+ then write the spec file.
165
+
166
+ ### 4a. Explore approaches
162
167
 
163
- ### Approach exploration
168
+ Before settling on a design, present **2-3 approaches** with trade-offs.
164
169
 
165
170
  For each approach, address:
166
171
 
@@ -169,7 +174,7 @@ For each approach, address:
169
174
  3. **Cons** — What's painful, expensive, or risky
170
175
  4. **Complexity estimate** — Rough sense of implementation effort
171
176
 
172
- Then make a recommendation and explain why.
177
+ Lead with your recommended option and explain why it wins.
173
178
 
174
179
  **Example:**
175
180
 
@@ -186,23 +191,60 @@ Then make a recommendation and explain why.
186
191
  > **Recommendation:** Approach B — the query flexibility matters more here than
187
192
  > implementation speed.
188
193
 
189
- ### Design approval gate
194
+ Get explicit approval on the chosen approach before presenting the design.
190
195
 
191
- Get explicit approval on the chosen approach before writing the full spec.
192
-
193
- **Tell the human:** "Which approach should we go with? Or should I explore a different
194
- direction?"
196
+ **Tell the human:** "Which approach should we go with? Or should I explore a
197
+ different direction?"
195
198
 
196
199
  **STOP. Wait for human to choose an approach.**
197
200
 
198
- ### Write the spec
201
+ ### 4b. Present the design in sections
202
+
203
+ Present the design in batches. Get approval after each batch before continuing.
204
+
205
+ Sections already confirmed in earlier steps (Problem, Scope, Constraints, Context)
206
+ are written into the spec from those confirmations — do not re-present them.
207
+
208
+ **Batch A: User Stories** — the contract you're designing against. Formal stories
209
+ with acceptance criteria and priorities. If rejected: revise. If the rejection
210
+ reveals a scope misunderstanding, loop back to Discovery (Step 2).
211
+
212
+ **Batch B: Architecture** — component design, domain modeling, and layer
213
+ boundaries. Use `python-architecture` or `typescript-api-design` as relevant to
214
+ your stack. Then present: component structure, domain model, where business
215
+ logic lives, where IO lives. If rejected: revise. If the rejection undermines
216
+ the chosen approach, offer to return to approach exploration (4a). If it
217
+ reveals a fundamental gap, loop back to Research (Step 3). If the detail reveals
218
+ the work is far more complex than estimated, say so and offer to revisit the
219
+ approach.
220
+
221
+ **Batch C: API Design + Data Model** — contracts derived from the approved
222
+ architecture. Skip sections that don't apply, but say so explicitly ("No API
223
+ changes — moving to Trade-offs"). Never skip silently. If rejected: revise. If
224
+ the rejection implicates the architecture, go back to Batch B.
199
225
 
200
- Once an approach is chosen, write the full spec document.
226
+ **Batch D: Trade-offs + Open Questions** — alternatives considered, why this
227
+ approach wins, known limitations, anything unresolved. Usually revisable inline.
201
228
 
202
- Use the Skill tool to invoke **oracle-architect** for component design, domain modeling,
203
- and layer boundaries.
229
+ Each batch ends with:
204
230
 
205
- ### What the spec should contain
231
+ **Tell the human:** "Does this look right?"
232
+
233
+ **STOP. Wait for approval before continuing.**
234
+
235
+ If you loop twice on the same batch, stop and ask:
236
+
237
+ > "We've looped on [batch] twice. Should we reconsider the approach?"
238
+
239
+ **Terminology discipline:** while drafting batches, challenge terms against
240
+ `CONTEXT.md` and update it inline as terms resolve, using the **oracle-domain-modelling**
241
+ skill. If domain confusion runs deep, suggest pausing for **oracle-grill-me** before continuing.
242
+
243
+ ### 4c. Write the spec
244
+
245
+ Once all batches are approved, write the full spec document.
246
+
247
+ #### What the spec should contain
206
248
 
207
249
  ```markdown
208
250
  # Feature Name
@@ -256,70 +298,48 @@ and layer boundaries.
256
298
  Scale each section to complexity — a few sentences if straightforward, detailed if
257
299
  nuanced.
258
300
 
259
- ### Reference implementations
260
-
261
- If human provides reference code — from open source, from elsewhere in codebase — use it
262
- as a concrete guide. Working from a reference produces dramatically better designs.
301
+ #### Reference implementations
263
302
 
264
- ---
265
-
266
- ## Step 5: Self-Review
267
-
268
- Before presenting the spec to the human, run this checklist silently:
269
-
270
- ### 1. Placeholder scan
271
-
272
- Are there any TBD, TODO, FIXME, or incomplete sections? Every section should have real
273
- content or be removed.
274
-
275
- ### 2. Internal consistency
276
-
277
- Do sections contradict each other? If the Architecture section says "stateless" but the
278
- Data Model includes session state, resolve the conflict before presenting.
279
-
280
- ### 3. Scope check
281
-
282
- Is this focused enough for a single implementation plan? If the spec covers more than
283
- one independent subsystem, it should have been decomposed in Step 2. If it's still too
284
- broad, flag it now.
303
+ If the human provides reference code — from open source, from elsewhere in the
304
+ codebase — use it as a concrete guide. Working from a reference produces
305
+ dramatically better designs.
285
306
 
286
- ### 4. Ambiguity check
307
+ #### Self-review
287
308
 
288
- Could any requirement be interpreted two ways? If so, pick one interpretation, state it
289
- explicitly, and let the human correct you.
309
+ After writing the file, check it with fresh eyes:
290
310
 
291
- Fix any issues found. Then present.
311
+ 1. **Placeholder scan** — Any TBD, TODO, FIXME, or incomplete sections? Every
312
+ section should have real content or be removed.
313
+ 2. **Internal consistency** — Do sections contradict each other? If the
314
+ Architecture section says "stateless" but the Data Model includes session
315
+ state, resolve the conflict.
316
+ 3. **Scope check** — Is this focused enough for a single implementation plan?
317
+ If the spec covers more than one independent subsystem, it should have been
318
+ decomposed in Step 2. If it's still too broad, flag it now.
319
+ 4. **Ambiguity check** — Could any requirement be interpreted two ways? If so,
320
+ pick one interpretation, state it explicitly, and let the human correct you.
292
321
 
293
- **Tell the human:** "The spec is complete. Ready for your review."
294
-
295
- **STOP. Wait for human review.**
322
+ **Substance rule:** if a fix changes the substance of an approved section,
323
+ re-present that section for approval. Wording and consistency fixes go inline —
324
+ note them at handoff.
296
325
 
297
326
  ---
298
327
 
299
- ## Step 6: Annotation
300
-
301
- Human may annotate the spec directly — adding corrections, rejections, domain knowledge,
302
- or "remove this section entirely."
303
-
304
- When they say "I added notes":
328
+ ## Step 5: Handoff
305
329
 
306
- 1. Re-read the full document
307
- 2. Address every note
308
- 3. Update the spec
309
- 4. Run the self-review checklist again (Step 5)
310
- 5. **Do not move to planning**
330
+ **Tell the human:**
311
331
 
312
- This may repeat 1-6 times. Spec is not approved until human explicitly says so.
332
+ > "Spec written to `docs/specs/<path>`. Every section was approved during our
333
+ > conversation — review it if you'd like, or we can go straight to the
334
+ > implementation plan. Ready for spec-plan?"
313
335
 
314
- ---
315
-
316
- ## Handoff
336
+ If the human requests changes — in conversation or by annotating the file —
337
+ address every note, update the spec, and re-run the self-review. If a change
338
+ alters the substance of an approved section, re-present that section for
339
+ approval before continuing.
317
340
 
318
- When the spec is approved, the next step is **spec-plan**.
319
-
320
- > "Spec is approved. Ready to write the implementation plan?"
341
+ The next step is **spec-plan**. Do not start planning without the human's
342
+ go-ahead. Do not write code.
321
343
 
322
344
  If planning reveals design flaws, loop back to research. See **spec-orchestrator**
323
345
  for iteration patterns.
324
-
325
- Do not start planning without explicit approval. Do not write code.
@@ -2,8 +2,9 @@
2
2
  name: spec-finish
3
3
  description: >
4
4
  Post-implementation completion workflow. Use after spec-implement completes to validate,
5
- review, create stacked commits, and prepare for PR. Triggers when implementation is done,
6
- when the user says "finish", "done", "complete", or after implementation tasks are finished.
5
+ review, create stacked commits, and open a PR via code-pull-request. Triggers when
6
+ implementation is done, when the user says "finish", "done", "complete", or after
7
+ implementation tasks are finished.
7
8
  user-invocable: true
8
9
  ---
9
10
 
@@ -99,29 +100,26 @@ Use the Skill tool to invoke code-review skill for comprehensive code review.
99
100
 
100
101
  ## Step 4: Update Documentation
101
102
 
102
- Optional - use code-docs skill if needed.
103
-
104
103
  ### Check for Updates
105
104
  - README changes needed?
106
105
  - API documentation updated?
107
106
  - Changelog updated?
108
107
 
109
108
  ### If documentation needed
110
- - Load code-docs
111
109
  - Update relevant docs
112
110
  - Commit with docs
113
111
 
114
112
  ---
115
113
 
116
- ## Step 5: Prepare for PR
114
+ ## Step 5: Open the PR
115
+
116
+ Steps 1-4 (validate, review, stack commits, update docs) must all be complete
117
+ before proceeding. **If code-review found blocking issues, stop — return to
118
+ spec-implement to fix them. Do not proceed to Step 5b.**
117
119
 
118
- ### Verify
119
- - All tests passing
120
- - All reviews complete
121
- - Documentation updated
122
- - Commits stacked properly
120
+ ### Step 5a: Present Completion Summary
123
121
 
124
- ### Summary for Human
122
+ Before creating the PR, present a summary to the human:
125
123
 
126
124
  ```
127
125
  ## Completion Summary
@@ -130,13 +128,21 @@ Optional - use code-docs skill if needed.
130
128
  **Tests:** [passed/failed]
131
129
  **Type Check:** [passed/failed]
132
130
  **Lint:** [passed/failed]
131
+ **Review:** [passed/issues found]
133
132
  **Commits:** [N commits in stack]
134
133
  **Ready for PR:** [yes/no]
135
134
  ```
136
135
 
136
+ ### Step 5b: Invoke code-pull-request
137
+
138
+ Only when the summary shows **Ready for PR: yes**, invoke the
139
+ [code-pull-request](../code-pull-request/SKILL.md) skill to create the PR. It
140
+ detects the platform (GitHub/GitLab), checks for an existing PR, finds a
141
+ template, generates the body from commits, and opens the PR via `gh` or `glab`.
142
+
137
143
  ### Handoff
138
144
 
139
- > "Implementation complete. [N] commits stacked. Ready for [submit/open PR]."
145
+ > "Implementation complete. [N] commits stacked. Opening PR now."
140
146
 
141
147
  ---
142
148
 
@@ -145,7 +151,7 @@ Optional - use code-docs skill if needed.
145
151
  This skill orchestrates other skills:
146
152
 
147
153
  - Invokes code-review for quality check
148
- - Invokes code-docs if documentation needs updates
154
+ - Invokes code-pull-request as the final step to open the PR
149
155
 
150
156
  ---
151
157
 
@@ -108,8 +108,9 @@ Update the todo status to in_progress.
108
108
  Read the task's **inputs** first — understand what context you need.
109
109
  Then read the **description** — know what to build and the constraints.
110
110
 
111
- Invoke **oracle-testing** for test design. Write tests that cover the validation
112
- criteria before writing implementation.
111
+ Write tests that cover the validation criteria before writing implementation.
112
+ Invoke `typescript-testing` or `python-testing` (whichever matches the project)
113
+ for test design patterns when needed.
113
114
 
114
115
  ```
115
116
  1. Read task inputs and description