@greenrenge/skills 0.0.0-stage → 0.2.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 (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -2
  3. package/bin/cli.mjs +525 -0
  4. package/bin/lib/onboard.mjs +1168 -0
  5. package/bin/lib/probe.mjs +631 -0
  6. package/catalog.json +590 -0
  7. package/package.json +50 -4
  8. package/skills/deck-story/SKILL.md +258 -0
  9. package/skills/deck-story/check-svg-text.mjs +94 -0
  10. package/skills/deck-story/check.mjs +348 -0
  11. package/skills/diagram-router/LICENSE +21 -0
  12. package/skills/diagram-router/SKILL.md +193 -0
  13. package/skills/diagram-router/THIRD_PARTY_NOTICES.md +15 -0
  14. package/skills/diagram-router/references/channels.md +213 -0
  15. package/skills/diagram-router/references/evals.md +85 -0
  16. package/skills/diagram-router/references/gathering.md +101 -0
  17. package/skills/diagram-router/references/prior-art.md +65 -0
  18. package/skills/diagram-router/references/routing.md +166 -0
  19. package/skills/diagram-router/skill-release.json +17 -0
  20. package/skills/frontend-design/SKILL.md +443 -0
  21. package/skills/frontend-design/references/rtl.md +72 -0
  22. package/skills/frontend-design/scripts/.upstream-sha +1 -0
  23. package/skills/frontend-design/scripts/LICENSE +21 -0
  24. package/skills/frontend-design/scripts/README.md +24 -0
  25. package/skills/frontend-design/scripts/gates.md +243 -0
  26. package/skills/frontend-design/scripts/sloplint-render.mjs +1283 -0
  27. package/skills/frontend-design/scripts/sloplint.mjs +4426 -0
  28. package/skills/open-code-review-rules/SKILL.md +59 -0
  29. package/skills/open-code-review-rules/references/ocr-allowlists.json +161 -0
  30. package/skills/open-code-review-rules/references/ocr-rule-semantics.md +39 -0
  31. package/skills/open-code-review-rules/scripts/verify_ocr_rules.py +836 -0
  32. package/skills/plain-english-mode/SKILL.md +41 -0
  33. package/skills/pr-diagram-portfolio/SKILL.md +75 -0
  34. package/skills/pr-diagram-portfolio/references/angle-framework.md +124 -0
  35. package/skills/pr-diagram-portfolio/references/portfolio-delivery.md +79 -0
  36. package/skills/pr-diagram-portfolio/scripts/restore_still_css.py +180 -0
  37. package/skills/pr-lens/LICENSE-upstream +21 -0
  38. package/skills/pr-lens/SKILL.md +99 -0
  39. package/skills/pr-lens/VENDOR.md +47 -0
  40. package/skills/pr-lens/package-lock.json +91 -0
  41. package/skills/pr-lens/package.json +9 -0
  42. package/skills/pr-lens/references/config.md +90 -0
  43. package/skills/pr-lens/references/example.graph.json +580 -0
  44. package/skills/pr-lens/references/graph-document.md +233 -0
  45. package/skills/pr-lens/skill-release.json +16 -0
  46. package/skills/security-remediation-epic/SKILL.md +316 -0
  47. package/skills/security-remediation-epic/prompt-template.md +33 -0
  48. package/skills/skill-maintainer/SKILL.md +99 -0
  49. package/skills/skill-maintainer/references/placement-and-coupling.md +43 -0
  50. package/skills/skill-maintainer/scripts/audit_skills.py +297 -0
  51. package/skills/t3-successor-handoff/SKILL.md +141 -0
  52. package/skills/t3-thread-bridge/SKILL.md +175 -0
  53. package/skills/t3-thread-bridge/references/launch-recipes.md +123 -0
  54. package/skills/t3-thread-bridge/references/ping-back.md +108 -0
  55. package/skills/t3-thread-bridge/scripts/thread_ledger.py +203 -0
  56. package/skills/t3-ticket-orchestrator/SKILL.md +304 -0
  57. package/skills/t3-ticket-orchestrator/references/proving-the-gates.md +63 -0
  58. package/skills/ticket-scheme/SKILL.md +144 -0
  59. package/skills/ulw-plan/SKILL.md +98 -0
  60. package/skills/ulw-plan/references/full-workflow.md +255 -0
  61. package/skills/ulw-plan/references/intent-clear.md +44 -0
  62. package/skills/ulw-plan/references/intent-unclear.md +44 -0
  63. package/skills/ulw-plan/scripts/plan-templates.mjs +180 -0
  64. package/skills/ulw-plan/scripts/scaffold-plan.mjs +187 -0
@@ -0,0 +1,304 @@
1
+ ---
2
+ name: t3-ticket-orchestrator
3
+ description: Run or resume an orchestrated ticket-queue run driving tracker tickets through top-level T3 threads — one ticket per thread in its own worktree, merging each finished thread locally into a dedicated base/epic branch, pushing that branch after every merge, and opening one final PR into the run's target branch for the user to review. Use when the user says go on a ticket queue, asks to continue or resume the orchestration, or when deciding which ticket launches, blocks, or unblocks next.
4
+ metadata:
5
+ opencode/autoinvoke: true
6
+ ---
7
+
8
+ # Orchestrate a ticket queue
9
+
10
+ The run's shape: **you** are the orchestrator, T3 top-level threads are the workers (never
11
+ subagents or delegates), a **base branch** is the one integration line, and the **target
12
+ branch** — what the base was forked from, `main` in a first-generation run — is untouchable
13
+ until the final PR. The tracker is the run's state: derive order from the dependency edges
14
+ and open/closed tickets, never from memory.
15
+
16
+ The queue is produced by the repo's planning skill (decision-complete tickets, batch
17
+ prefixes, branch footers, a Way-of-work block each); this skill runs that queue. A ticket
18
+ that cannot be implemented as written is the run's one failure mode — everything else is
19
+ execution.
20
+
21
+ ## Repo & Run Contract (injected by invoking prompt or repo `AGENTS.md`)
22
+
23
+ This skill is repo-agnostic. Read these repo-specific values from the invoking prompt or
24
+ the target repository's `AGENTS.md` before starting:
25
+
26
+ | Slot | Meaning | Example |
27
+ |---|---|---|
28
+ | `plan_skill` | Skill that authored the ticket queue | repo's ticket-planning skill |
29
+ | `implement_command` | Worker skill/command opening each brief | `/implement` (if present in repo) |
30
+ | `bootstrap_command` | Heavy/canonical checkout setup at run start | `tools/bootstrap.sh --heavy` |
31
+ | `env_flags` | Env vars fresh worktrees need | `NX_DAEMON=false` |
32
+ | `verify_targets` | Exact target list from the PR-gating CI job | `lint, test, test-integration, build` |
33
+ | `evidence_skill` | Optional live-stack evidence skill for serving paths | `<repo>-evidence` |
34
+ | `pr_review_label` | Optional label triggering the repo's review bot | `agent-review` |
35
+ | `gate_config_paths` | Repo gate configs whose change re-fires gate proofs | `pyproject.toml`, `.opencodereview/rule.json`, `tools/check-*.py` |
36
+
37
+ ## Gate
38
+
39
+ A run starts on the user's explicit go; a paused run resumes when they say continue. While a
40
+ thread works, report state and end the turn — the child's ping-back wakes you, and the
41
+ user's nudge is the fallback. Threads are not polled.
42
+
43
+ ## First act: name yourself
44
+
45
+ The thread list is the run's dashboard — a reader sees what a thread is doing without
46
+ opening it. **Loading this skill makes you an orchestrator: rename your own thread before
47
+ any other work, and keep that name current for the whole run.**
48
+
49
+ | phase | title |
50
+ | --- | --- |
51
+ | on load, before the run's final PR exists | `Orchestrator: <run name> → ticket #<N>` |
52
+ | the final PR opens | `Orchestrator: <run name> → PR #<number>` |
53
+
54
+ `<run name>` is the run's subject in a few words (`web-scraper upsert-from-bucket`); `<N>`
55
+ is the ticket the run is anchored on. Rename the T3 thread with `t3_thread_update` —
56
+ `action: 'rename'`, `title`, and no `threadId` (it renames the thread you are in).
57
+ `opencode.session_rename` renames the OpenCode session only.
58
+
59
+ Done when `t3_thread_list` shows your own thread carrying the title you sent.
60
+
61
+ ## The run
62
+
63
+ 1. **Setup, once.** Cut the base branch from `origin/<target>` — the target this run will
64
+ finally PR into; `main` for a first-generation run, the parent epic branch for a kit cut
65
+ under one — name it with the user when unset (`epic/<topic>` is the house pattern), and
66
+ push it immediately. Then edit the queue's tickets: the `Base Branch` footer becomes the
67
+ base branch, and a supersession note under the ticket's Way-of-work block says gh is
68
+ authenticated, there is no per-ticket PR, and done means commits on the agent branch.
69
+ and **drop the per-ticket OCR gate (Way-of-work step 7)** — OCR now runs once,
70
+ orchestrator-side, on the full base branch before the final PR (see step 4).
71
+ The run's verify means one thing all run: bring the checkout's verify environment to the
72
+ repo's canonical shape once at setup — using the Run Contract's `bootstrap_command` when
73
+ defined — so drift found mid-run is fixed at the environment. The run's gates and their
74
+ proofs are ledged in `references/proving-the-gates.md` beside this skill: proofs run
75
+ orchestrator-side, never inside a worker loop, and re-fire when any path in
76
+ `gate_config_paths` or this skill's gate lines changes.
77
+ 2. **Launch, per ticket.** Gate on blockers (GitHub native dependencies, else the ticket's
78
+ Blocked by; an operational prerequisite — a runbook step the ticket requires — gates the
79
+ launch the same way). Independent tickets may run in parallel without an in-flight cap —
80
+ launch every ticket the merged set has unblocked. Launch with `t3_thread_launch`: a
81
+ worktree strategy on branch `agent-<kit>/<NN>-<slug>`, `baseRef` the base branch,
82
+ `startFromOrigin: true`, and a **readable title** — `Implement #<N> — <short subject>` —
83
+ so the thread list tells the run's story at a glance; the orchestrator's own title
84
+ follows **First act: name yourself**. The thread inherits your active provider and model — set another only when the user
85
+ names it. Every brief carries the orchestrator's
86
+ own thread id (from `t3_thread_list`'s `currentThreadId`) with a ping-back clause: the
87
+ child messages that id — `t3_thread_send`, mode `auto` — the moment its report is ready
88
+ or it hits a blocker the ticket cannot resolve; a send to an idle orchestrator thread
89
+ starts it, the one wake that reliably arrives on this bridge. Every brief also carries the
90
+ **environment facts**, so the child's first hour is spent on the ticket: the bootstrap
91
+ mode its worktree needs, any fresh-worktree `env_flags` from the Run Contract, which suites need the heavy env, and that a light-env failure of a
92
+ heavy suite is the environment's, not the code's. After launching, one short
93
+ `t3_thread_wait` per worker does double duty: it confirms the run started, and its timeout
94
+ **arms the platform's completion wake** — the orchestrator is woken when that run finishes,
95
+ ping or no ping. Never depend on the child's ping alone: a worker that drops the
96
+ instruction still wakes you. On any wake, **the branch is the report** — read
97
+ `git log`/diff and run the ticket gates on it first; read the thread's hand-off after the
98
+ branch convinces you. Register every worker in the thread ledger (`t3-thread-bridge`) at
99
+ launch and `ack` it at close, so `ledger check` is the silent-thread sweep. End the turn on
100
+ the wait's timeout.
101
+ 3. **On each thread's finish.** A run that ends before its report — idle, the branch short
102
+ of the work — is resumed with a short continue message (`t3_thread_send`, mode `auto`),
103
+ never relaunched: its context is intact, and so is a thread parked waiting on one of its
104
+ own background gates. Merge its agent branch into the base branch locally (`--no-ff`,
105
+ message naming the ticket); a merge conflict of *wording* — two tickets telling one story
106
+ in different vocabularies — resolves by combining both truths, the incoming ticket's
107
+ prose adapting to the vocabulary already on the base. Then run the repo's verify line,
108
+ **push the base branch immediately**, close the ticket with a comment, remove the
109
+ worktree, **settle the thread** (`t3_thread_organize`, action `settle` — its code is
110
+ merged, so its lifecycle ends here), then launch every ticket this merge unblocked.
111
+
112
+ **The pushed tree carries no ignored path.** Before every commit and every push, the
113
+ staged paths must pass `git check-ignore`: `git diff --cached --name-only | git
114
+ check-ignore --stdin` answers nothing, or the commit stops and the path comes out
115
+ (`git restore --staged`). At push time the same probe runs over the tip — `git ls-tree
116
+ -r HEAD --name-only | git check-ignore --stdin` — because a worker may force-add past
117
+ the commit gate (`git add -f .scratch/…`: a ticket ordering that is a fork to report,
118
+ never to obey; evidence lives on the ticket or a never-pushed branch). A tool that
119
+ writes a new preview directory lands its ignore line in the same change that first
120
+ commits beside it — `git add -A` sweeps whatever no line names yet.
121
+
122
+ **Drift merges; a fork stops.** A conflict whose other side came from upstream — the
123
+ target moved under them — is drift: re-apply the run's intent onto the newer upstream
124
+ shape, disclose the per-file resolution, and merge. A conflict over a *contract*, where
125
+ two tickets changed the same behaviour, is a fork: stop with the merge uncommitted,
126
+ surface it to the user, and never pick a side silently.
127
+
128
+ **Ticket gates, when present.** Beside the verify line, run
129
+ `tools/check-blast-radius.py --base <merge-base> --head <agent branch> --area <ticket's area
130
+ label> [--allow …]` and `tools/check-facts.py --tickets <kit dir> --base … --head …` when the
131
+ tools exist (the OCR gate's conditional pattern). Exit 1 is a **fork to report** — surface it
132
+ on the ticket, never auto-fail the merge. Spot-check two claims from the hand-off's claims
133
+ ledger per merge, preferring machine-checkable evidence (a command plus its digest) over prose
134
+ claims.
135
+
136
+ **CI's line is the verify line.** Copy `verify_targets` directly from the CI job that
137
+ gates the PR. A local run of a shorter list leaves its missing target unproven. A target that cannot run
138
+ here — a heavy environment this host refuses, a native crash in one process — gets
139
+ reproduced at the base and named in the ticket's close comment.
140
+
141
+ **Foreign code lands by behaviour.** When a ticket extracts modules from another branch,
142
+ pin the behaviour and the file set, and read the target branch's conventions — lint
143
+ contracts, one-runner rules, banned imports — before pinning identity: a copy that
144
+ violates them cannot land. Where the two disagree, the target's conventions win and the
145
+ foreign branch gets a follow-up ticket to adopt them; the ticket says the extracted
146
+ files are deliberately adapted.
147
+
148
+ **On a blocked ping (the STOP path).** Verify the stop is clean first — the branch
149
+ carries no commits and the tree is clean; then remove the worktree, or keep it when a
150
+ rerun is expected (the rerun cuts a fresh one from the updated base, and the
151
+ measurements live in the ticket, not in the worktree). Comment the fork on the ticket
152
+ with the options and one recommendation, relabel it `ready-for-human`, and leave the
153
+ decision to the user: a decision that spawns a follow-up ticket re-queues the stopped
154
+ ticket behind it (its measurements and comments stand as recorded), a decision to drop
155
+ closes it wontfix.
156
+ 4. **Drained.** Merge `origin/<target>` — the branch this run's base was forked from,
157
+ recorded at setup — into the base first: the PR's checks must never be the first place
158
+ the combination runs. Re-run the verify on the combined tree, push.
159
+ **OCR review, once for the run.** Run `ocr review --from origin/<target> --to <base branch>
160
+ --audience agent --background "<run subject>"` on the full base branch — the epic-level diff,
161
+ the single OCR gate for the run (per-ticket OCR is retired). Fix each finding or record its
162
+ rejection reason in the run's closing note, then re-run once. A run whose every request
163
+ failed is reported as "OCR gate: not run — <reason>"; the gate passes only on a completed run.
164
+ The reviewer may request a test only by naming an uncovered fact from the run's Facts to prove,
165
+ with its silent-breakage path. **Then** open one PR,
166
+ base branch → `<target>`, adding the Run Contract's `pr_review_label` when configured
167
+ (e.g. `gh pr create --label <pr_review_label>`) so the repo's review bot reviews it, and its body opens with the
168
+ merge-danger line (`Merge danger: <one-way|two-way> door — blast radius <areas touched>`) —
169
+ and rename your own thread
170
+ per **First act: name yourself**, whose title now names that PR. Then **link and watch
171
+ the PR — required, not conditional**: the watch is this run's only reliable wake (PR
172
+ events have arrived where thread wakes never did), so the orchestrator stays on it from
173
+ opening until the PR merges or closes — checks green, every bot round answered (small
174
+ findings fixed on the base as one batched push per round, replies in their threads), and
175
+ on the merge event it confirms the landing (the target carries the merge), deletes the
176
+ PR's diagram comment (below), `unwatch_pull_request`s, and hands the run back: the
177
+ user's merge decision needs no nudge to be noticed. **Harvest before the run ends:** walk
178
+ the run's review findings — OCR rejections, bot threads, spot-check misses, fork reports;
179
+ every finding that recurred ≥2× across the run becomes a rule (a `rule.json` entry, an
180
+ evidence-bar line, a banned-api entry, or a ticket-template line), each new rule proven per
181
+ `references/proving-the-gates.md`, and findings seen once are listed as candidates in the
182
+ run's closing note. The run ends when they say so.
183
+
184
+ **Evidence before ready.** When the Run Contract defines an `evidence_skill` and the
185
+ run changes a live serving or runtime path, run that evidence skill before declaring the
186
+ PR ready: wire the real local dependency stack, exercise the live path, capture verbatim
187
+ transcripts and resource measurements, and tear everything down. Findings become tickets
188
+ of their own. Always state what the evidence does and does not prove.
189
+
190
+ ## The PR's diagram comment
191
+
192
+ Every run's PR carries one diagram comment — a picture of what the run changed — posted
193
+ when the PR opens, patched when a bot-fix push changes the diff, deleted when the PR lands
194
+ or dies. It never touches the base branch: no review-turn spend, nothing to re-vendor.
195
+
196
+ Generate the SVG with `pr-lens` (deterministic: validated graph document, delta semantics;
197
+ `~/.agents/skills/pr-lens/`) or, when the run's story is narrative rather than mechanics, a
198
+ subagent under the `diagram-router` skill.
199
+
200
+ **The module picture.** A run that re-architects how modules relate — a new seam, a moved
201
+ dependency, not just added files — also posts a **C4 component-level diagram** of the code it
202
+ touched: the modules as components, imports and data flow as edges, drawn from repo evidence
203
+ by a subagent under `diagram-router`. pr-lens answers what the diff touched; the C4 answers
204
+ what the code now is. It lands as a second marker comment `<!-- diagram:c4:v1 -->` through the
205
+ same user-attachment upload, is patched on the same pushes, and is deleted with the pr-lens
206
+ one on landing. Then upload it as a **user-attachment** — a
207
+ committed file would put the picture in the diff, and a fenced ` ```svg ` block renders as
208
+ code — and post a marker comment:
209
+
210
+ ```bash
211
+ REPO_ID=$(gh api repos/$REPO -q .id)
212
+ TOKEN="$(gh auth token)"
213
+ ASSET=$(curl -sS -X POST \
214
+ "https://uploads.github.com/user-attachments/assets?name=diagram.svg&content_type=image%2Fsvg%2Bxml&repository_id=$REPO_ID" \
215
+ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/octet-stream" \
216
+ -H "Accept: application/vnd.github+json" --data-binary @diagram.svg | jq -r .url)
217
+ printf '<!-- diagram:v1 -->\n<details open>\n<summary>PR diagram</summary>\n\n![diagram](%s)\n\n</details>\n' "$ASSET" >/tmp/pr-diagram.md
218
+ CID=$(gh api "repos/$REPO/issues/$PR/comments" -q '.[] | select(.body|startswith("<!-- diagram:v1 -->"))|.id' | head -1)
219
+ if [ -n "$CID" ]; then gh api --method PATCH "repos/$REPO/issues/comments/$CID" -F body=@/tmp/pr-diagram.md
220
+ else gh api --method POST "repos/$REPO/issues/$PR/comments" -F body=@/tmp/pr-diagram.md; fi
221
+ ```
222
+
223
+ The facts these commands depend on:
224
+
225
+ - **Content type** is percent-encoded (`image%2Fsvg%2Bxml`); the plain spelling is a 422.
226
+ - **The token comes from the host's own gh credentials**: `gh auth token` is an OAuth user
227
+ token with `repo` scope and satisfies the endpoint. Keep it in a variable. Reach for
228
+ `request_secret` when gh is unauthenticated or its token is rejected; a token belongs in
229
+ a request or a file, never in chat or a brief. An installation token (`ghs_`) may be
230
+ rejected: test one upload, then fall back to the fence.
231
+ - **A private repository's attachment answers 404 to an anonymous fetch** — GitHub's
232
+ markdown renderer fetches it with the reader's repo access. Verify with the auth header
233
+ (`curl -sSL -H "Authorization: Bearer $(gh auth token)" -o /dev/null -w '%{http_code}
234
+ %{content_type}' "$ASSET"`); an anonymous 404 on a private repo is a healthy upload.
235
+ - **The marker** makes the comment findable for patch and delete; the CID lookup makes
236
+ re-posting idempotent.
237
+
238
+ **Cleanup** — on the merge event, and on a close that ends the run:
239
+
240
+ ```bash
241
+ gh api "repos/$REPO/issues/$PR/comments" -q '.[] | select(.body|startswith("<!-- diagram:v1 -->"))|.id' \
242
+ | xargs -r -n1 gh api --method DELETE "repos/$REPO/issues/comments/{}"
243
+ ```
244
+
245
+ The attachment itself is **undeletable by design** ("an upload cannot be undone") — one
246
+ immutable asset per PR is the accepted cost. A diagram that could carry a secret takes the
247
+ fence instead: text only, any token works, cleanup optional.
248
+
249
+ ## Invariants
250
+
251
+ - The target branch is never merged into, locally or remotely, mid-run.
252
+ - One ticket per thread; the thread follows its ticket strictly — acceptance list and
253
+ Way-of-work — inside its own worktree. The OCR gate is retired from the per-ticket
254
+ Way-of-work; it runs once, orchestrator-side, on the full base branch before the final PR.
255
+ - Every implementing thread works under the implement skill: the brief opens with the
256
+ `/implement` command (the skill at `.agents/skills/implement/SKILL.md` is user-invoked, so
257
+ the brief itself is its trigger), and its flow — `/tdd` at pre-agreed seams, `/code-review`
258
+ at the end — runs inside the ticket's Way-of-work.
259
+ - The only remote objects are the base branch (pushed after every merge) and the final PR;
260
+ no per-ticket PRs, no per-ticket pushes.
261
+ - After the final PR opens, the base branch takes only bot-fix pushes — each push spends
262
+ one of the review bot's 10 turns: anything else (docs tweaks, ride-along tickets) waits
263
+ for the next run's PR, unless the user explicitly orders it onto this one. Ordered onto
264
+ the open PR, a ticket is an ordinary ticket again: its own branch, its own merge into the
265
+ base, its own verify — the PR picks it up on the next push, and the diagram comment is
266
+ patched because the diff moved.
267
+ - **Plan vocabulary stays in prose.** A qualifier that marks a temporary state — interim,
268
+ provisional, temporary, legacy — belongs to the plan, not to an identifier: the tree
269
+ outlives the plan, and renaming a shipped class breaks its callers. The seam keeps its
270
+ role name; an implementation that does less names its class by that role and says in its
271
+ docstring what it does not yet answer.
272
+ - Thread briefs are crafted per ticket and always carry: the ticket URL, the worktree and
273
+ branch facts, the environment facts, "follow the ticket strictly", done = report (no PR,
274
+ no push), and the stop rule — a decision that cannot be implemented as written is
275
+ reported, never re-decided silently. In local-files mode the ticket is staged at a host path outside every repo (house pattern: ~/.t3/tmp/<kit>/) and the brief points at it by absolute path — never inline a ticket as pasted text, which corrupts. Every brief that expects red-once evidence carries the evidence-dir contract: artifacts land in the orchestrator's kit evidence directory (git-ignored, never staged), not the worker's own scratch.
276
+ - All artifacts are English only — issues, commits, PRs, briefs, docs, skills. Non-English
277
+ lives in chat with the user alone.
278
+ - Mid-run corrections to a live thread go as a steer (`t3_thread_send`, mode `steer`) naming
279
+ exactly what changed in the ticket and nothing else.
280
+
281
+ ## Thread brief template
282
+
283
+ ```
284
+ /implement — the work is ticket <N>: <ticket URL>, followed strictly (every acceptance
285
+ item and its full Way-of-work). Wake contract: the moment you are done or blocked you MUST
286
+ t3_thread_send the orchestrator thread (block at the end of this brief) — a finished run
287
+ that never pinged counts as a failed run. Read it with `gh issue view <N>` (gh is authenticated);
288
+ its Way-of-work's no-gh constraint is superseded by the note directly under it. You are
289
+ in a fresh worktree on <branch> cut from <base branch>; work only here. <one or two repo
290
+ context pointers the ticket does not already carry>. <the environment facts: bootstrap
291
+ mode for this worktree, the daemon flag a fresh worktree needs, which suites need the
292
+ heavy env>. Done = every acceptance item green, the repo's full lint/test/build green,
293
+ commits on this branch — no PR, no push, and nothing `git check-ignore` names ever staged
294
+ (a ticket ordering an ignored path into the tree is a fork to report, not to obey). Your gate is the app's own suite and its pins —
295
+ never the heavy env in a throwaway worktree; the full affected verify is the
296
+ orchestrator's, run on the base at merge. Finish with a short report; if a ticket
297
+ decision cannot be implemented as written, stop and report the conflict instead of
298
+ re-deciding.
299
+
300
+ When your report is ready — or you hit a blocker the ticket cannot resolve — send it to
301
+ the orchestrator thread first: `t3_thread_send` with threadId `<orchestrator-thread-id>`,
302
+ mode `auto`, message `ticket <N> done: <one line>` (or `ticket <N> blocked: <one line>`);
303
+ then finish your turn with the full report as briefed.
304
+ ```
@@ -0,0 +1,63 @@
1
+ # Proving the gates
2
+
3
+ The run's guardrails are their own authors' claims until each one is proven to fail. This is the
4
+ runbook that keeps them honest — mutation testing's discipline lifted from tests to gates: the
5
+ judge is never the author, one level up.
6
+
7
+ ## The proof recipe
8
+
9
+ For every gate in the ledger below:
10
+
11
+ 1. Cut a throwaway local branch (never pushed).
12
+ 2. Plant the gate's named violation.
13
+ 3. Run the gate; capture its verbatim **red** output.
14
+ 4. Revert; re-run; capture the **green** output.
15
+ 5. Save both as `.scratch/<kit>/evidence/gate-<slug>.red` and `.green` (first + last lines of
16
+ each run, plus the command that produced them) and log them in the ledger's *last proof* column.
17
+ 6. Delete the branch. No planted violation ever survives the proof.
18
+
19
+ A gate that cannot be made to fail is **fixed or deleted on the spot** — a guard that never fires
20
+ is not a guard, it is comfort.
21
+
22
+ **REFUSE.** A check that inspected zero targets (empty dir, no facts, wrong range) is a *failed*
23
+ check, never a pass. Every `tools/check-*.py` enforces this by construction.
24
+
25
+ ## LLM gates get both controls
26
+
27
+ Deterministic gates need the positive control (the plant). LLM gates (the `ocr` CLI, the
28
+ ai-passport review bot) also need the **negative control**: run them on a known-clean diff and
29
+ record what they report. A reviewer that fabricates findings burns the bot's 10-turn budget as
30
+ effectively as one that misses them.
31
+
32
+ ## The gate ledger
33
+
34
+ | Gate | Detects | Severity | Cadence | Re-prove when | Last proof |
35
+ |---|---|---|---|---|---|
36
+ | `lint` → ruff / static purity rules | banned primitives in pure core modules | fail | every run | linter config changes | logged per repo |
37
+ | `lint` → import-boundary contracts | import-graph violations across architecture layers | fail | every run | boundary contracts change | logged per repo |
38
+ | `tools/check-tickets.py` | malformed staged kits before publication | fail | every publish | the script or the scheme's ticket shape changes | ticket 05 (2026-11) |
39
+ | `tools/check-rules.py` | shadowed `rule.json` entries (dead rules) | fail | on rule.json change | `.opencodereview/rule.json` changes | ticket 05 (2026-11) |
40
+ | `tools/check-blast-radius.py` | a ticket's diff leaving its area | fork-to-report | every merge | the allowlist or area vocabulary changes | ticket 05 (2026-11) |
41
+ | `tools/check-facts.py` | unmapped facts, orphan markers, missing red-once | fail | every merge | the fact-marker grammar changes | ticket 05 (2026-11) |
42
+ | OCR gate (`ocr review`) | diff defects an LLM reviewer can see | fix-or-reject | once per run (final PR) | invocation flags change | ticket 05 (both controls) |
43
+ | `git check-ignore` commit probe | ignored paths staged for commit | fail | every commit/push | ignore rules change | ticket 05 (2026-11) |
44
+
45
+ ## On-change trigger
46
+
47
+ Proofs re-run **when the gate changes, not on every run** — the cost control the literature
48
+ insists on (Jain: same sensors ~7× cost for zero acceptance delta on strong models; Böckeler:
49
+ 3–8.5× tokens for no quality delta inside the loop; PIT scopes mutation to changed code). Fires
50
+ on any change to: `ml/pyproject.toml` gate config, `.opencodereview/rule.json`,
51
+ `tools/check-*.py`, or this skill's gate lines. Anthropic runs its own eval suite on exactly this
52
+ trigger (any change to CLAUDE.md, skills, or hooks).
53
+
54
+ ## Deletion discipline
55
+
56
+ A gate that has not fired legitimately across a full run (or N tickets) is up for removal — SRE
57
+ ch. 6's rule for rarely-exercised alerting configuration. Gates earn their slot by catching real
58
+ things; the harvest step retires the ones that only ever pass.
59
+
60
+ ## Where proofs run
61
+
62
+ Orchestrator-side, outside every worker loop — never charged to a ticket's context. The ledger's
63
+ *last proof* column is the memory: a proof older than the gate's last config change is stale.
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: ticket-scheme
3
+ description: "Structured PRD → spec → decision-complete ticket planning overlay for orchestrated runs: applies [<epic>] B<batch>/<NN> parallel-batch title prefixes, Base/Agent branch footers on specs and subtickets, a standardised Way-of-work kickoff block on subtickets only, and a decision-completeness gate over to-spec and to-tickets. Use when planning an epic or feature ticket queue for t3-ticket-orchestrator, or when asked to plan batched decision-complete tickets from a PRD or spec."
4
+ license: MIT
5
+ metadata:
6
+ version: "1.0"
7
+ ---
8
+
9
+ # Ticket Scheme: Spec → Decision-Complete Batched Tickets
10
+
11
+ A repo-agnostic overlay on `to-spec` and `to-tickets` that produces a deterministic,
12
+ parallel-runnable ticket queue ready for `t3-ticket-orchestrator` (or manual execution).
13
+
14
+ Run `to-spec` first to produce the spec, then `to-tickets` for the breakdown under that spec.
15
+ Both stand unchanged except for the five rules below; where they conflict, these rules win.
16
+
17
+ ## Repo & Run Contract Slots
18
+
19
+ Read repo-specific values from the invoking prompt, the target repo's `AGENTS.md`, or a
20
+ Run Contract rule (`~/.agents/rules/<repo>-contract.md` / `docs/agents/orchestrator-contract.md`):
21
+
22
+ | Slot | Default when omitted |
23
+ |---|---|
24
+ | `target_branch` | `main` |
25
+ | `implement_command` | `implement` skill |
26
+ | `verify_targets` | Repo's full PR-gating lint / build / test suite |
27
+ | `env_flags` | *(none)* |
28
+ | `triage_labels_doc` | *(none — do not invent labels)* |
29
+
30
+ ## Rule 1: Bracket & Batch Prefix on Every Issue Title
31
+
32
+ Every issue title carries `[<epic>] <title>` — both the spec issue and every subticket.
33
+
34
+ - `<epic>` is the planning branch minus the `epic/` prefix (`epic/auth-v2` → `[auth-v2]`),
35
+ or the PRD short slug when no `epic/` branch exists. A child kit planned under
36
+ `epic/<epic>-<kit>` keeps the parent epic's name. Never invent an unrelated name.
37
+ - Every **subticket** title (never the spec's) carries its execution batch before the stable
38
+ ticket number: `[<epic>] B<batch>/<NN>: <title>` (for example,
39
+ `[auth-v2] B2/05: Token refresh middleware`).
40
+ - `B1` holds every ticket with no blockers.
41
+ - A ticket sits in `B<n>` when every direct blocker is in an earlier batch and at least one
42
+ blocker is in `B(n-1)`.
43
+ - One batch is one round of parallel work: every ticket in `B<n>` may run simultaneously
44
+ once `B(n-1)` has merged.
45
+ - `<NN>` is the ticket's stable identifier (its file name and agent-branch slug): if
46
+ re-blocked, a ticket changes its batch number, never `<NN>`.
47
+
48
+ ## Rule 2: Standardised Way-of-Work Kickoff on Subtickets Only
49
+
50
+ Every **subticket** ends with the block below (filling in the repo's `verify_targets` /
51
+ `env_flags` from the Run Contract when defined). It is placed immediately after the Rule 4
52
+ branch footer — nothing follows it.
53
+
54
+ The **spec never carries this block.** A spec states what to build, not how an implementer
55
+ runs a ticket.
56
+
57
+ ```markdown
58
+ ---
59
+
60
+ # Way of work
61
+ 1. Load the `implement` skill (`implement_command` from the Run Contract if specified).
62
+ 2. Read this ticket file + its referenced spec sections + repo README + `AGENTS.md` rules.
63
+ 3. Handle one ticket per session.
64
+ 4. Apply `tdd` at pre-agreed seams.
65
+ 5. Run the repo's full verify suite (`verify_targets`, with any required `env_flags` from the Run Contract) before finishing.
66
+ 6. Run the `code-review` skill on the finished diff.
67
+ 7. OCR gate, when `command -v ocr` finds it: run `ocr review --from origin/<Base Branch above> --to HEAD --audience agent --background "<this ticket's title>"`. Fix each finding or record its rejection reason in the handoff, then re-run once. If every LLM request fails (rate limit, auth), report `"OCR gate: not run — <reason>"`; the gate passes only on a completed run.
68
+ 8. If the repo defines doc-reconciliation or comment-trimming skills, run them last on the finished diff so docs and comments match the reviewed code.
69
+ 9. Finish with the `handoff` skill summarizing commits, verification evidence, and any follow-ups.
70
+
71
+ ---
72
+
73
+ ## Operational Constraints
74
+ - Unless the Run Contract explicitly enables GitHub operations for worker sessions, keep tickets local and do not call `gh` or GitHub APIs from worker sessions (an orchestrator handles tracker updates and the final PR).
75
+ ```
76
+
77
+ ## Rule 3: Branch Footer on the Spec
78
+
79
+ Append this footer to the spec (and nothing else — no `# Way of work`):
80
+
81
+ ```markdown
82
+ ---
83
+
84
+ Base Branch: <base branch>
85
+ Agent Branch: <planning branch>
86
+ ```
87
+
88
+ - `<base branch>`: the branch this planning branch is cut from (`target_branch` for a
89
+ first-generation epic; the parent `epic/<name>` branch for a child kit).
90
+ - `<planning branch>`: the branch this kit is planned on (`epic/<name>`, or
91
+ `epic/<epic>-<kit-slug>` for a child kit). Cut or verify the branch name before writing
92
+ the footer so no stale branch name is ever copied across kits.
93
+
94
+ ## Rule 4: Branch Footer on Every Subticket
95
+
96
+ Every subticket carries this footer immediately before the Rule 2 kickoff block:
97
+
98
+ ```markdown
99
+ ---
100
+
101
+ Base Branch: <planning branch>
102
+ Agent Branch: agent-<main-spec-name>/<NN>-<slug>
103
+ ```
104
+
105
+ - `Base Branch` must equal the spec's `Agent Branch`.
106
+ - `Agent Branch` uses `<main-spec-name>` from the parent spec, `<NN>` from the ticket id,
107
+ and `<slug>` from the ticket title.
108
+
109
+ ## Rule 5: Decision-Complete Tickets — Always, No Detail Knob
110
+
111
+ Every ticket closes every decision it touches. An undecided detail is silently decided
112
+ mid-flight by a worker thread — drift with extra steps. Trivial tickets naturally stay
113
+ short without needing a "lightweight mode".
114
+
115
+ A ticket is decision-complete when:
116
+
117
+ - Every quantity is pinned: defaults, bounds, thresholds, env var names, file formats, and
118
+ each format's failure modes.
119
+ - Every state set is enumerated: state machines, alive/terminal sets, key derivations, and
120
+ mode rules.
121
+ - Every transitional state names the ticket that removes it.
122
+ - Acceptance criteria cover the negative space — what must *not* exist afterwards (removed
123
+ seams, dead identifiers, prose-only diffs).
124
+ - Any decision that cannot be closed at planning time is explicitly out of scope in the spec
125
+ or split into its own ticket — never left as an open question inside an implementation
126
+ ticket.
127
+
128
+ **Publication test:** Read each ticket as its implementer and ask *"can I make even one
129
+ silently-arguable choice?"* Every "yes" is a hole to close before publishing.
130
+
131
+ ## Publish Mode
132
+
133
+ Default to **local-files mode**: write the spec and subtickets under
134
+ `.scratch/<feature-slug>/issues/<NN>-<slug>.md` with every rule above applied verbatim
135
+ (bracket prefixes, batch tags, branch footers, kickoff block) so a later tracker push needs
136
+ zero reformatting. Never invent issue labels outside the repo's documented label set.
137
+
138
+ Publish to GitHub Issues only when **both** hold:
139
+
140
+ 1. The user explicitly asks to publish to GitHub in this session, and
141
+ 2. `gh` (or a GitHub API token) is available and authenticated.
142
+
143
+ Verify availability before promising a push. If either condition is missing, stay in local
144
+ mode and state why.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: ulw-plan
3
+ description: "Explore-first planning consultant that writes one decision-complete work plan before coding. Use only on an explicit user request for the ulw-plan workflow or a plan before implementation; it never self-activates on a bare ulw run."
4
+ metadata:
5
+ short-description: Explore-first planning consultant that waits for your okay before planning
6
+ ---
7
+
8
+ # ulw-plan
9
+
10
+ You are **Prometheus**, a planning consultant. You turn a vague or large request into ONE **decision-complete** work plan a downstream worker executes with zero further interview. You read, search, run read-only analysis, and write ONLY plan artifacts under `.omo/`. You are a PLANNER - you never edit product code and never implement.
11
+
12
+ **Plan mode is sticky.** "do X" / "fix X" / "build X" / "just do it" all mean "plan X". You **never start implementation** - not for small, obvious, or urgent work, and not through a subagent: delegated implementation is still implementation. Execution belongs to a separate worker session that only the user starts (e.g. launching the Atlas executor on the plan).
13
+
14
+ Outcome-first: explore a lot, ask few sharp questions - or none, when the intent is fuzzy (see routing) - and stop the moment the plan is done.
15
+
16
+ ## MANDATORY OPENING ANNOUNCEMENT
17
+
18
+ The FIRST user-visible line of the turn that activates this skill MUST be exactly:
19
+
20
+ `ULW-PLAN MODE ENABLED!`
21
+
22
+ If another active mode mandates its own first line (ultrawork does), print that line first and this marker on the next line - both contracts stay satisfied.
23
+
24
+ Directly under the marker, before any exploration, state the working contract once, in your own words, carrying ALL of these commitments:
25
+
26
+ 1. **Persona + no-implementation pledge** - from now on you work as Prometheus, a planning consultant, and you will never start implementation - no product-code edits, no implementer subagents - until the user explicitly says okay; even then, approval authorizes writing the plan only, and execution starts in a separate worker session (e.g. the Atlas executor session the user starts).
27
+ 2. **Workflow preview** - the order of what happens next: parallel read-only exploration (plus outside research when the repo cannot answer) until the open unknowns are resolved; the affected user, the ideal state, and the gap list, announced; the intent verdict from INTENT ROUTING, announced; questions to the user ONLY when a genuine owner-decision survives exploration - or when exploration and research both come back empty on a fork the plan cannot proceed without; then the approval brief, and the plan is written only after the explicit okay.
28
+
29
+ Example opening (adapt the wording, keep every commitment):
30
+
31
+ > ULW-PLAN MODE ENABLED!
32
+ > From now on I am working as Prometheus, a planning consultant. I will not start any implementation until you explicitly say okay - and approval authorizes writing the plan only; execution starts separately (e.g. the Atlas executor session you start).
33
+ > Next, in order: (1) parallel read-only exploration and research, (2) the affected user, the ideal state for them, and every gap from today, announced, (3) intent verdict announced (CLEAR or UNCLEAR, plus whether high-accuracy review is required), (4) questions only for the forks the ideal state and exploration cannot settle - or where research finds nothing on a blocking decision, (5) approval brief, then (6) the plan is written after your okay.
34
+
35
+ ## INTENT ROUTING - pick ONE intent reference
36
+
37
+ **Review modifiers are a gate trigger, not a style cue.** If the user says "high accuracy", "ultra high accuracy", "고정밀", "deep review", or equivalent - in ANY turn, even appended to a follow-up question and even after the plan already exists - set `review_required: true` in the draft: the dual high-accuracy review (native `momus` + the independent Oracle review) is now REQUIRED before handoff, and if the plan already exists you run it this same turn. The review runs under the bounded convergence contract in `full-workflow.md`: a 5-round cap (unlimited only on explicit user request), evidence-backed blocker eligibility, and approval-with-notes counting as approval. Answering the current question more carefully does NOT satisfy it. This does NOT choose CLEAR/UNCLEAR and does NOT suppress interview.
38
+
39
+ After grounding, make ONE judgment, record `intent: clear|unclear` plus `review_required`, **ANNOUNCE both to the user in one line**, then load ONE intent reference (you ALSO read `references/full-workflow.md` for the shared mechanics - see below). The test keys on whether the desired **OUTCOME** is clear, NOT on request length. This verdict line and the opening announcement above are the two mandatory user-visible signals of a planning session - it tells the user whether they will be interviewed and whether high-accuracy review is already requested; never skip either.
40
+
41
+ > "Intent: **CLEAR**, review required - you specified the endpoint and asked for high accuracy. I will ask only the genuine forks, then run the high-accuracy review after approval."
42
+ > "Intent: **UNCLEAR**, review required - 'make auth better' is open-ended and you asked for high accuracy. I will choose best-practice defaults, then run the high-accuracy review automatically."
43
+
44
+ - **OVERRIDE - explicit ask wins:** if the user explicitly asks to be questioned or interviewed ("ask me", "interview me", "why aren't you asking me" - in any language), route **CLEAR**, run the interview, and turn the adopt-default filter OFF: the user has claimed the forks, so every surviving one is ASKED, not defaulted. This beats the OUTCOME test below, even on a fuzzy brief.
45
+ - **CLEAR** - the user knows the outcome; the only open items are preferences/tradeoffs the repo cannot answer (genuine owner-decisions). Read **`references/intent-clear.md`**: ask the surviving forks with WHY, run the normal approval gate, and offer high-accuracy review only when `review_required` is false.
46
+ - **UNCLEAR** - the outcome itself is fuzzy (a vague brief, a bootstrap, an executor start with no selectable plan, a goal the user cannot yet articulate). Asking would offload your own job onto the user. Read **`references/intent-unclear.md`**: research maximally, adopt and ANNOUNCE best-practice defaults, do NOT ask the user extra questions, and, unless Classify sized the work Trivial, set `review_required: true` before the approval gate and run high-accuracy review AUTOMATICALLY.
47
+ - **ON THE FENCE** - when CLEAR vs UNCLEAR is genuinely ambiguous, treat it as CLEAR and ask exactly ONE question. A user wrongly silenced is worse than one extra question. The dominant failure to guard against is mis-routing a CLEAR request to UNCLEAR, which silently applies defaults and overrides forks the user wanted to own.
48
+
49
+ WORKED: "add a 5/min-per-IP rate-limit to `/login`" = CLEAR. "make auth better" = UNCLEAR.
50
+
51
+ Both intent paths ALSO read **`references/full-workflow.md`** for the shared mechanics - the plan template, the final verification wave, the APPEND protocol, and the full delegation/wait syntax. Read the phase you are in.
52
+
53
+ ## RUN THE SCRIPT - do not hand-build artifacts
54
+
55
+ As soon as `<slug>` and intent are known, before recording draft state, RUN:
56
+
57
+ ```
58
+ node "<skill-root>/scripts/scaffold-plan.mjs" <slug> [--clear|--unclear] --draft-only [--review-required]
59
+ ```
60
+
61
+ (Replace `<skill-root>` with this skill's own directory; `bun` is accepted.) This creates only `.omo/drafts/<slug>.md`, the compaction-safe resume point; it does not create a plan before approval. Include `--review-required` when an explicit modifier requires review or the classified route is non-Trivial UNCLEAR, so the first durable write contains the complete pending review request. After approval, rerun without `--draft-only` to create `.omo/plans/<slug>.md`, then **APPEND** task batches into `## Todos` - never rewrite script-emitted headers.
62
+
63
+ Both invocations are resume-safe no-ops for artifacts already present. Do NOT hand-build them; use `--reset` only for a structural reset (`--reset --force` discards edits). If a same-named non-artifact file exists, choose another slug.
64
+
65
+ ## Plan artifact producer contract
66
+
67
+ When producing the plan, encode every executable item as a column-zero Markdown task row: implementation rows MUST match `- [ ] N. <title>` (where `N` is a positive decimal integer), and final-verifier rows MUST match `- [ ] F<number>. <title>`. Prose headings, numbered paragraphs, and ordinary bullets are not task substitutes and MUST NOT be counted as implementation or final-verifier tasks. Before handoff, run a structural self-check over the plan: verify that every implementation row and final-verifier row is column-zero, matches its required grammar, and appears in the intended `## Todos` or `## Final verification wave` section; verify that no prose heading or bullet is being used as a task; verify that every implementation row carries a nested `Recommended task executor:` line naming a roster agent (final-verifier rows default to `momus` when unannotated); and repair the plan before handoff if any check fails.
68
+
69
+ ## Universal invariants (hold on every path)
70
+
71
+ - **The ideal state for the affected user is the north star.** Before the brief, name who this output touches - a customer, another programmer, a program or agent consuming it, often more than one - and how each uses it today and will use it after; write the state in which nothing snags, feels odd, regresses, or degrades for them, one row per property with its reason, then every difference between that state and today, each with its reason. Record both in the draft; the plan exists to close every gap row. "MVP", "v1", "phase 1", or any reduced subset is never an option you invent or ask about; when the ideal state is larger than the literal request, say so in one line and plan the ideal state.
72
+ - **Decision-complete is how the plan gets there.** The executor has NO interview context - spell out exact paths, "every X in Y", and an explicit Must-NOT-Have (a guardrail against unrequested additions, never a reduction). Leave the implementer ZERO judgment calls.
73
+ - **Explore before asking.** Discoverable facts (repo/system/docs truth) -> research and cite, never ask. Preferences/tradeoffs -> the only things you bring to the user. When unsure which, treat it as a user-decision.
74
+ - **Two filters** on every candidate question, in order: (1) Could collected evidence answer it? -> explore instead. (2) Does the ideal state for the affected user settle it - or, failing that, the stated intent plus a defensible default? -> resolve to that, record it, do not ask - UNLESS it is an owner-decision, which always survives as a question even when a default exists: anything irreversible / destructive / safety-critical, or a cross-cutting product choice the user lives with (public config surface, distribution / packaging, external dependency or pinned SHA, data / schema shape, real budget / paid-service spend, expected scale or capacity target, target-audience / compliance limits). Extrinsic constraints (budget, mandated stack, scale, audience) leave no repo evidence, so exploration can never surface them - sweep those axes explicitly once per plan and classify each as explored, defaulted (ledger), or asked. Default the reversible internals; surface the owner-decisions.
75
+ - **Explore to sufficiency, then STOP.** One research wave per open question; stop when the clearance check is answerable; never re-explore to double-check.
76
+ - **Parallel-dispatch** independent research in ONE turn and keep working while it runs. Subagent outputs are CLAIMS until you independently verify them.
77
+ - **Approval is not execution.** Approval authorizes writing the plan ONLY, never implementation. ONE request -> ONE plan, however large.
78
+ - **The durable draft is the resume point.** Record `intent`, `review_required`, decisions, the approval gate, and the ledgers to `.omo/drafts/<slug>.md` as you go; on any later turn read it and resume from those fields instead of rerouting from memory.
79
+ - **Agent-executed QA per todo** (happy + failure, exact tool + invocation, evidence path). Zero human-intervention verification. Confirm test strategy every time (TDD / tests-after / none - agent-executed QA is always included).
80
+
81
+ ## Approval gate
82
+
83
+ When exploration is exhausted and the unknowns are answered, record the gate in the draft (`status: awaiting-approval`, approach, and the next workflow action), present a short brief once, then **wait for the user's explicit okay**. Approval authorizes plan creation only; any already-required review runs afterward under its existing authorization. Full mechanics: `references/full-workflow.md`.
84
+
85
+ ## Delegation (OpenCode-native)
86
+
87
+ Fan out read-only research before deciding. Every delegated prompt names TASK / DELIVERABLE / SCOPE / VERIFY, states the role inside the prompt, and includes only the context the child needs:
88
+
89
+ ```
90
+ subagent(agent="explore", background=true, description="Map the implementation surface", prompt="TASK: act as an explorer. DELIVERABLE: ... SCOPE: ... VERIFY: ...")
91
+ ```
92
+
93
+ Roles - the ONLY subagents you may spawn (all read-only, plus `oracle` for the high-accuracy review): `explore` (internal patterns/conventions/tests), `librarian` (external docs/contracts), `metis` (gap analysis), `momus` (high-accuracy plan review). Never instruct a child to edit files. Fire the wave in the background, end your turn, and integrate results from the completion notifications; follow up a child via its returned `sessionID`. Full delegation/wait/fallback discipline is in `references/full-workflow.md`.
94
+
95
+ ## Stop rules
96
+
97
+ - Plan file exists, template filled, every todo has references + acceptance + QA + commit, dependency matrix consistent, and any required high-accuracy receipts are recorded: present the handoff explanation (Phase 4 delivery format in `references/full-workflow.md`), then (CLEAR without `review_required`) ask the start-or-high-accuracy question, or (CLEAR with `review_required` / UNCLEAR) report the review result - and stop. **Never begin execution yourself.**
98
+ - Brief presented and `status: awaiting-approval` recorded: wait. Do not re-explore unless the user changes scope.