opencode-thrum-pro 0.1.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 (101) hide show
  1. package/assets/commands/thrum-_deviations-protocol.md +87 -0
  2. package/assets/commands/thrum-_generator-idempotency-protocol.md +15 -0
  3. package/assets/commands/thrum-_project-rules-protocol.md +18 -0
  4. package/assets/commands/thrum-_snapshot-protocol.md +265 -0
  5. package/assets/commands/thrum-_stamp-protocol.md +112 -0
  6. package/assets/commands/thrum-_verify-before-write-protocol.md +27 -0
  7. package/assets/commands/thrum-inbox.md +22 -0
  8. package/assets/commands/thrum-load-context.md +17 -0
  9. package/assets/commands/thrum-overview.md +17 -0
  10. package/assets/commands/thrum-prime.md +30 -0
  11. package/assets/commands/thrum-quickstart.md +14 -0
  12. package/assets/commands/thrum-reply.md +28 -0
  13. package/assets/commands/thrum-restart-extended.md +195 -0
  14. package/assets/commands/thrum-restart.md +293 -0
  15. package/assets/commands/thrum-send.md +31 -0
  16. package/assets/commands/thrum-sleep-extended.md +186 -0
  17. package/assets/commands/thrum-sleep.md +212 -0
  18. package/assets/commands/thrum-team.md +12 -0
  19. package/assets/commands/thrum-update-project.md +259 -0
  20. package/assets/commands/thrum-wait.md +14 -0
  21. package/assets/skills/adversarial-critique/SKILL.md +242 -0
  22. package/assets/skills/brainstorm-queue-aware/SKILL.md +167 -0
  23. package/assets/skills/brainstorm-steward/SKILL.md +181 -0
  24. package/assets/skills/choosing-subagent-models/SKILL.md +244 -0
  25. package/assets/skills/closing-findings-while-warm/SKILL.md +104 -0
  26. package/assets/skills/configure-roles/SKILL.md +229 -0
  27. package/assets/skills/coordinator-assessing-agent-completion/SKILL.md +205 -0
  28. package/assets/skills/coordinator-assessing-agent-completion/scan.py +117 -0
  29. package/assets/skills/coordinator-branch-split-on-block/SKILL.md +168 -0
  30. package/assets/skills/coordinator-context-monitoring/SKILL.md +674 -0
  31. package/assets/skills/coordinator-dispatching-work/SKILL.md +288 -0
  32. package/assets/skills/coordinator-hotpath-merge-gate/SKILL.md +522 -0
  33. package/assets/skills/coordinator-interacting-with-the-owner/SKILL.md +171 -0
  34. package/assets/skills/coordinator-maintaining-memory/SKILL.md +89 -0
  35. package/assets/skills/coordinator-managing-state-and-lifecycle/SKILL.md +192 -0
  36. package/assets/skills/coordinator-merging-code/SKILL.md +331 -0
  37. package/assets/skills/coordinator-philosophy-merge-gate/SKILL.md +442 -0
  38. package/assets/skills/coordinator-plan-reconcile-gate/SKILL.md +198 -0
  39. package/assets/skills/coordinator-post-restart-sweep/SKILL.md +135 -0
  40. package/assets/skills/coordinator-running-autonomous-feature-development/SKILL.md +199 -0
  41. package/assets/skills/coordinator-running-brainstorm-cycles/SKILL.md +654 -0
  42. package/assets/skills/coordinator-running-review-cycles/SKILL.md +153 -0
  43. package/assets/skills/coordinator-single-responsibility-merge-gate/SKILL.md +14 -0
  44. package/assets/skills/diagnosing-fleet-and-daemon/SKILL.md +255 -0
  45. package/assets/skills/efficient-multi-agent-research/SKILL.md +177 -0
  46. package/assets/skills/fixing-documentation-errors/SKILL.md +258 -0
  47. package/assets/skills/implementer-maintaining-memory/SKILL.md +84 -0
  48. package/assets/skills/implementer-orchestrating-execution/SKILL.md +125 -0
  49. package/assets/skills/implementer-receiving-dispatch/SKILL.md +127 -0
  50. package/assets/skills/implementer-receiving-review-feedback/SKILL.md +125 -0
  51. package/assets/skills/implementer-status-and-handoff/SKILL.md +150 -0
  52. package/assets/skills/implementer-tdd-and-quality/SKILL.md +99 -0
  53. package/assets/skills/memory-audit-recover/SKILL.md +153 -0
  54. package/assets/skills/memory-curate/SKILL.md +139 -0
  55. package/assets/skills/memory-maintenance/SKILL.md +87 -0
  56. package/assets/skills/memory-read-discipline/SKILL.md +164 -0
  57. package/assets/skills/memory-search-advanced/SKILL.md +217 -0
  58. package/assets/skills/memory-write-discipline/SKILL.md +135 -0
  59. package/assets/skills/orchestrate/SKILL.md +795 -0
  60. package/assets/skills/persistent-watcher-archetype/SKILL.md +225 -0
  61. package/assets/skills/prime-agent/SKILL.md +92 -0
  62. package/assets/skills/project-hotpath-gate/SKILL.md +255 -0
  63. package/assets/skills/project-philosophy/SKILL.md +418 -0
  64. package/assets/skills/project-philosophy/resources/philosophy-template.md +155 -0
  65. package/assets/skills/project-philosophy/resources/reliability-class-library.md +653 -0
  66. package/assets/skills/project-setup/SKILL.md +1007 -0
  67. package/assets/skills/project-setup/resources/implementation-agent.md +826 -0
  68. package/assets/skills/researcher-answering-queries/SKILL.md +100 -0
  69. package/assets/skills/researcher-investigating/SKILL.md +152 -0
  70. package/assets/skills/researcher-maintaining-memory/SKILL.md +176 -0
  71. package/assets/skills/state-migration/SKILL.md +54 -0
  72. package/assets/skills/thrum/SKILL.md +161 -0
  73. package/assets/skills/thrum/resources/ANTI_PATTERNS.md +132 -0
  74. package/assets/skills/thrum/resources/BOUNDARIES.md +56 -0
  75. package/assets/skills/thrum/resources/CLI_REFERENCE.md +1066 -0
  76. package/assets/skills/thrum/resources/IDENTITY.md +49 -0
  77. package/assets/skills/thrum/resources/LISTENER_PATTERN.md +64 -0
  78. package/assets/skills/thrum/resources/MESSAGING.md +163 -0
  79. package/assets/skills/thrum/resources/TMUX_SESSIONS.md +118 -0
  80. package/assets/skills/thrum/resources/WORKTREES.md +117 -0
  81. package/assets/skills/thrum-memory/SKILL.md +138 -0
  82. package/assets/skills/trace-spec-to-plan/SKILL.md +104 -0
  83. package/assets/skills/trace-spec-to-plan/resources/sweep-agent-prompt.md +57 -0
  84. package/assets/skills/update-queue/SKILL.md +149 -0
  85. package/assets/skills/using-the-queue/SKILL.md +172 -0
  86. package/assets/skills/using-thrum-state/SKILL.md +104 -0
  87. package/assets/skills/verify-against-plan/SKILL.md +323 -0
  88. package/assets/skills/verify-against-source/SKILL.md +237 -0
  89. package/assets/skills/watcher-archetype/SKILL.md +84 -0
  90. package/assets/skills/writing-durable-markdown/SKILL.md +66 -0
  91. package/dist/hooks/block-sync-cd.d.ts +9 -0
  92. package/dist/hooks/block-sync-cd.js +71 -0
  93. package/dist/hooks/block-sync-cd.test.d.ts +1 -0
  94. package/dist/hooks/block-sync-cd.test.js +61 -0
  95. package/dist/hooks/shell-env.d.ts +8 -0
  96. package/dist/hooks/shell-env.js +22 -0
  97. package/dist/index.d.ts +6 -0
  98. package/dist/index.js +25 -0
  99. package/dist/installer.d.ts +2 -0
  100. package/dist/installer.js +86 -0
  101. package/package.json +49 -0
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: fixing-documentation-errors
3
+ description: "Use the moment you notice documentation is wrong, stale, incomplete, or contradicts what a command actually does - a doc that omits a flag or subcommand that exists, a README/llms.txt/CLI-help/docstring/comment that disagrees with observed behaviour, a version-stamped section that predates a feature, an example that would fail if run, a doc claim you were about to cite and could not confirm. Illustrative (non-exhaustive) triggers - 'the docs don't mention X', 'llms.txt is out of date', 'the help text says Y but it actually does Z', 'that flag isn't documented', 'this example is wrong', 'the docs are stale here', 'I should file a bead about the docs', 'I'll note the doc gap' - but the trigger is NOTICING A DOC DEFECT, not matching a phrase. Fires regardless of what you were originally doing; a doc error found mid-task is still in scope."
4
+ ---
5
+
6
+ # Fixing Documentation Errors
7
+
8
+ ## The rule
9
+
10
+ **You found it, you can verify it, you fix it — in this turn.**
11
+
12
+ No triage. No coordinator approval. No bead-then-wait. Documentation you can
13
+ verify is the one class where the person who found the defect is already the
14
+ best-placed person to fix it, and every step you insert between finding and
15
+ fixing destroys the thing that made you well-placed.
16
+
17
+ File a bead recording that you **did** it. Never file a bead **instead of**
18
+ doing it.
19
+
20
+ ## This applies to EVERY role — what changes is the action, never whether you act
21
+
22
+ **No agent may ignore a doc defect, and no agent may file-and-move-on.** Those
23
+ are the two forbidden responses for everyone. What differs by role is only
24
+ whether you fix it yourself or ask first.
25
+
26
+ | Role | What you do, IN THIS TURN |
27
+ |---|---|
28
+ | Coordinator · orchestrator · researcher · gate · watcher | **Fix it.** You hold the authority. Verify, edit every copy, then file the record. |
29
+ | Implementer **between tasks / idle** | **Fix it.** Same as above. |
30
+ | Implementer **mid-task** | **ASK your orchestrator or coordinator, in this turn** — one line: *"Found a doc error: `<file:line>` says X, actual behaviour is Y (verified how). Want me to fix it now, or carry it?"* |
31
+ | Sub-agent | **Report it to whoever dispatched you**, in your final report, with file:line and the measured truth. Do not fix outside your assigned scope. |
32
+
33
+ **For the mid-task implementer, THE ASK IS THE ACTION.** It is not a deferral and
34
+ it is not a bead. It goes out in the turn you found the defect, while you still
35
+ hold the file, the line, and the evidence — so that whoever answers can say
36
+ "yes, now" and you are already warm.
37
+
38
+ ⚠️ **Do not ask and then drop it.** If no answer arrives before you finish your
39
+ task, say so explicitly in your completion report, with the file:line and the
40
+ measured truth attached. An unanswered ask that vanishes is the same outcome as
41
+ never asking.
42
+
43
+ ⚠️ **Do not ask for permission you already have.** If the fix is inside the file
44
+ you were already sent to change, and it is unambiguous, just fix it. The ask
45
+ exists for scope discipline, not as a ritual.
46
+
47
+ **Manager side — if you receive one of these asks, answer it in the turn you
48
+ read it.** "Yes, fix it" is almost always right, and it is cheapest at the moment
49
+ the reporter is still warm. Every hour you sit on it converts a five-minute edit
50
+ into a re-derivation. If you say "not now", say what happens to it instead —
51
+ never leave the reporter holding it.
52
+
53
+ ## Why deferring is worse than it looks
54
+
55
+ Filing while warm does not defer the work. **It duplicates it and throws away
56
+ the expensive half.**
57
+
58
+ To write a useful doc bead you must state the file, the line, the wrong text,
59
+ the correct text, and how you know. That *is* the fix specification — writing it
60
+ costs roughly what performing the edit costs. So the real choice is never "fix
61
+ now vs fix later." It is:
62
+
63
+ - **fix once now**, or
64
+ - **specify it now**, then have someone re-read it, **re-verify it** (a bead is
65
+ a claim, not evidence), re-acquire the context you already had, and only then
66
+ fix it.
67
+
68
+ Four passes over work you had already finished.
69
+
70
+ **The one-question check — ask it before writing any doc bead:**
71
+
72
+ > Does this bead body contain what I would need to do the fix?
73
+
74
+ If **yes**, you are the person with the context and the decision is already
75
+ made. Do the fix. File the bead afterwards as a record.
76
+
77
+ ## What defeats this rule
78
+
79
+ These are the observed failure modes, not hypotheticals. Expect them.
80
+
81
+ - **A thorough write-up registers as having acted.** A thin note nags at you; a
82
+ well-argued bead closes the loop in your head. Diligence in the write-up is
83
+ the *cause*, not the mitigation.
84
+ - **A severity label disguises a deferral.** "P1, do it later" reads as triage
85
+ rather than avoidance, because assigning P1 *feels* like taking it seriously.
86
+ - **"Not my task."** A doc error found mid-task is in scope. The cost of coming
87
+ back is what this skill exists to avoid.
88
+ - **"Someone owns these docs."** Nobody owns a stale line. Ownership is the
89
+ reason it is still stale.
90
+
91
+ ## Verify before you edit — never fix a doc from another doc
92
+
93
+ **Documentation drifts; runtime behaviour does not lie.** Correcting a doc from
94
+ your memory, from a bead, or from another doc propagates the error into a new
95
+ place while making it look freshly checked.
96
+
97
+ Establish ground truth by **direct observation**, then edit:
98
+
99
+ 1. **Read the tool's own help** for every subcommand and flag you are about to
100
+ document — `<cmd> --help`, `<cmd> <sub> --help`. Enumerate the FULL
101
+ subcommand list; do not grep for the one you have in mind.
102
+ ⚠️ **A too-narrow search key returns a confident wrong answer.** Grepping
103
+ help for `^\s+start` cannot match `restart`, and "the command doesn't exist"
104
+ is the result. Read the full list unfiltered.
105
+ 2. **Exercise the behaviour on a THROWAWAY**, never on live state. This is the
106
+ part people skip, and it is the part that settles disagreements between the
107
+ docs, the help text, and a bead.
108
+ 3. **Read bare exit codes.** Never `$?` after a pipe — it returns the last
109
+ command's status, not the one you care about. Redirect to a file, capture the
110
+ code, then print the file.
111
+ 4. **Verify effects by re-reading state**, not by trusting a success message.
112
+
113
+ ### Worked example — the CRUD probe
114
+
115
+ To document a lifecycle (create / modify / remove) correctly, walk the whole
116
+ cycle on a disposable object and record what actually happens at each step:
117
+
118
+ ```
119
+ create -> confirm it exists, capture its ID
120
+ stop -> does the record persist? is the name still held?
121
+ update -> does it work while stopped? while running? which fields changed?
122
+ restart -> by name? by ID? is the ID preserved?
123
+ delete -> is the name freed? does recreating give a NEW ID?
124
+ ```
125
+
126
+ Then re-read state (`list --all`, `show`) after each step rather than trusting
127
+ the printed output. Run a step twice when the result is surprising, to exclude a
128
+ fluke.
129
+
130
+ **Safety rules for the probe, all learned the hard way:**
131
+
132
+ - Use a **unique throwaway name** that cannot collide with anything real.
133
+ - Pick parameters so **nothing actually executes** (a schedule far in the
134
+ future, a match pattern that cannot fire).
135
+ - **Enumerate the real objects you must not touch, by name AND ID**, before you
136
+ start.
137
+ - **Clean up, and prove it by effect** — then confirm every real object is still
138
+ in its original state.
139
+ - Never run the probe against something live to find out whether it is
140
+ destructive. Read the current value first so you have a BEFORE.
141
+
142
+ ## Find every copy before you edit one
143
+
144
+ Documentation is almost never in one file. A point fix leaves a sibling surface,
145
+ and the copies then **contradict each other**, which is worse than one stale
146
+ copy because the reader cannot tell which is current.
147
+
148
+ 1. **Grep for a distinctive phrase** from the wrong text across the repo.
149
+ 2. **Establish which copies are GENERATED and which are SOURCE** before editing
150
+ anything. Look for a sync script, a Makefile target, a generator.
151
+ 3. **Edit the source; never hand-edit a generated file** and leave the generator
152
+ to silently revert you.
153
+ 4. **Check for embedded copies.** A file compiled into a binary (`go:embed`) is
154
+ **deploy-gated**: your edit is inert until a binary carrying it ships. Say so
155
+ explicitly in your report — otherwise the fix reads as live when it is not.
156
+ 5. **Re-assert the sync invariant afterwards** (e.g. the copies are
157
+ byte-identical) with a control that could have failed.
158
+
159
+ ## 🔴 NEVER RUN A SYNC SCRIPT TO PROPAGATE YOUR FIX — USE A SUB-AGENT TO MIRROR
160
+
161
+ A repo with a source dir and a synced dir will have a script that regenerates
162
+ the target. **Running it is the single most destructive thing you can do in a
163
+ doc fix**, and it looks like the correct, sanctioned move.
164
+
165
+ **Propagate with a SUB-AGENT that mirrors your specific change into each copy,
166
+ not with the script.** A sub-agent copies the hunks you name and leaves
167
+ everything else alone; the script rewrites whole files from one side. The
168
+ sub-agent cannot destroy what it was not asked to touch.
169
+
170
+ ⚠️ **THIS IS NOT LIMITED TO DOCS.** It applies to every sync/generation script
171
+ in the repo — skills, plugin assets, templates, generated reference files. Any
172
+ script whose job is "make B look like A" will erase anything that exists only in
173
+ B. The hazard does not announce itself, and knowing about it is demonstrably not
174
+ sufficient to avoid it.
175
+
176
+ **The trap:** the convention says "author in the source dir, then sync." Reality
177
+ is that people edit the target directly too. So the target can hold changes the
178
+ source has never seen. A sync run silently overwrites all of them, and the loss
179
+ is invisible — the script succeeds, the diff looks like a sync, and nobody can
180
+ tell that unrelated work was destroyed.
181
+
182
+ **The direction rule: THE NEWER CONTENT UPDATES THE OLDER ONE — whichever file
183
+ that is.** Not "source always wins." Establish direction by evidence, per
184
+ region, before you touch anything:
185
+
186
+ ```
187
+ git log -1 --format="%h %ad %s" --date=short -- <source-file>
188
+ git log -1 --format="%h %ad %s" --date=short -- <target-file>
189
+ git log --format="%h %ad %s" --date=short -- <target-file> # target-only commits = at risk
190
+ ```
191
+
192
+ Then check whether any commit touched the target **without** touching the
193
+ source — those are direct edits to the sync target, and they are exactly what a
194
+ sync run would erase:
195
+
196
+ ```
197
+ git show --stat --format="" <sha> | grep <basename>
198
+ ```
199
+
200
+ **Then diff the two and read the drift, do not assume it:**
201
+
202
+ - Lines present only in the TARGET may be **newer content** (must be preserved,
203
+ and must be ported back to the source) **or merely the OLD version of text the
204
+ source has since corrected** (safe to overwrite). **These look identical in a
205
+ diff.** Read the content and decide; never infer from position.
206
+ - If the drift is large, **do not regenerate.** Port only the hunks you are
207
+ fixing, byte-identical, and leave every unrelated difference untouched.
208
+ - **Prove you did not over-sync:** count the non-target differences before and
209
+ after your edit. The count must be unchanged.
210
+
211
+ **Prefer a targeted mirror over a full regeneration, always.** A targeted mirror
212
+ can only damage the region you are editing; a regeneration can damage anything.
213
+
214
+ ⚠️ Sync scripts commonly also invoke formatters (prettier, markdownlint,
215
+ `gofmt -w`, `golangci-lint --fix`). Those are **write-capable**. Check what the
216
+ script actually invokes before running it, and treat any `--fix`/`-w` target as
217
+ a mutator.
218
+
219
+ ## State only what you measured
220
+
221
+ When correcting a false claim, **do not replace it with another unverified
222
+ one.** A doc sentence often bundles a measured half and an untested half:
223
+
224
+ > "Stopping removes it from persistence — it won't respawn on restart."
225
+
226
+ If you measured the first half false and never tested the second, **drop the
227
+ untested clause entirely** rather than asserting it in either direction. If you
228
+ cannot phrase the correction without implying something untested, say so in your
229
+ report instead of guessing.
230
+
231
+ **A confident wrong correction propagates harder than the error it replaces**,
232
+ because it presents as the output of checking and therefore reads as already
233
+ scrutinised.
234
+
235
+ ## When NOT to fix it yourself
236
+
237
+ Escalate for someone else's **authority**, never for your own **willingness**:
238
+
239
+ - The correct behaviour is **genuinely unknown** and cannot be settled by
240
+ observation — that is a product question, not a doc fix.
241
+ - The doc is right and **the code is wrong**. Fixing the doc would document a
242
+ bug as intended behaviour. File the code defect and leave the doc alone.
243
+ - Fixing it requires a **product decision** (which of two behaviours is
244
+ intended).
245
+ - The doc states a **policy or ruling** owned by someone else.
246
+
247
+ In every one of those, the doc edit is not the fix. Everything else, you fix.
248
+
249
+ ## Close the loop
250
+
251
+ After the edit:
252
+
253
+ 1. **File a bead recording what you fixed** — the defect, the files, and how you
254
+ verified. This is a record, not a request.
255
+ 2. **Report the deploy-gating status** if any copy is embedded or generated.
256
+ 3. **Name what you did NOT fix** — a sixth copy you found, an untested claim you
257
+ dropped, a help-text defect outside your scope. An unnamed remainder is how
258
+ the next person inherits a "fixed" area that is still wrong.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: implementer-maintaining-memory
3
+ description: "Use when the implementer writes a role-rule after user correction, or looks up implementer rules at session start. Loads implementer-specific memory discipline — single write path (agent_rule), refactoring opportunities go to bd not memory, stay minimal."
4
+ ---
5
+
6
+ # Implementer memory discipline
7
+
8
+ You are the implementer. Your memory discipline is intentionally narrow: you
9
+ READ rules at session start and you WRITE rules when the user corrects your judgment
10
+ mid-implementation. Refactoring opportunities, lessons learned, design questions
11
+ — those flow elsewhere. Common memory operations live in the common memory
12
+ skills — invoke them for basics. THIS skill carries implementer-specific
13
+ extensions only.
14
+
15
+ ## When to invoke the commons
16
+
17
+ | Situation | Skill to invoke |
18
+ | ----------------------------------- | ------------------------- |
19
+ | Drafting a new role-rule | `memory-write-discipline` |
20
+ | Loading role-rules at session start | `memory-read-discipline` |
21
+ | Editing or deleting a stale rule | `memory-maintenance` |
22
+
23
+ ## Single write path: role-rules
24
+
25
+ When the user corrects your behavior mid-implementation, capture an
26
+ implementer-rule:
27
+
28
+ ```bash
29
+ cat > /tmp/role-rule-body.md <<'EOF'
30
+ <rule>
31
+
32
+ Why: <reason>
33
+ How to apply: <when/where>
34
+ EOF
35
+ thrum memory create --kind agent_rule --scope role \
36
+ --title "<short rule prose — what you must do or not do>" \
37
+ --oneline "<rule one-liner>" \
38
+ --short "@/tmp/role-rule-body.md" \
39
+ --tag <slug>
40
+ ```
41
+
42
+ `--short`/`--full` carry real prose — compose via heredoc or file, never
43
+ double-quoted inline; see your role preamble's 🔴 PROSE INTO A COMMAND rule.
44
+
45
+ Body shape is uniform across all role-rule writes — see
46
+ `memory-write-discipline`. The `Why:` line is load-bearing: future-you needs the
47
+ reason to judge edge cases the rule doesn't literally cover.
48
+
49
+ ## Implementer does NOT write
50
+
51
+ - **Refactoring opportunities discovered mid-task** → file under the project's
52
+ refactoring epic, e.g. `<refactor-epic-id>`, NOT memory. Memory is for AGENT
53
+ BEHAVIOR rules; bd tracks code work.
54
+ - **Research findings about the codebase** → ping the researcher; they own
55
+ `kind: research_note` writes.
56
+ - **Per-task notes / scratch state** → use the conversation context or task
57
+ description. Ephemeral.
58
+ - **Project-state updates** → coordinator's job; do not touch project_state.md.
59
+
60
+ ## Triggering condition for an implementer write
61
+
62
+ Capture a user correction as a NEW rule only when BOTH conditions hold:
63
+
64
+ 1. The correction applies broadly — next time you encounter the same situation,
65
+ you should behave differently.
66
+ 2. The correction is non-obvious from the code — the WHY is project context, not
67
+ derivable from reading files.
68
+
69
+ If the correction is one-off (specific to this task only) OR obvious from the
70
+ code (a syntax fix, a typo), do NOT capture it as a memory entry. Memory
71
+ accumulates load; write only when the rule has durable value.
72
+
73
+ ## Session-start read
74
+
75
+ At session start, load implementer role-rules:
76
+
77
+ ```bash
78
+ thrum memory list --kind agent_rule --scope role
79
+ ```
80
+
81
+ The `--scope role` filter auto-infers your role via daemon identity binding.
82
+ Scan the returned `body_oneline` summaries; pull full bodies via
83
+ `thrum memory show <id>` only for rules whose one-liner doesn't fully convey the
84
+ constraint.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: implementer-orchestrating-execution
3
+ description: "Use when starting execution of a scoped implementation task — about to implement, ready to write code, executing a bd task. Loads the orchestration procedure — dispatch research, implementation, and verification to sub-agents and synthesize their output instead of doing the legwork inline."
4
+ ---
5
+
6
+ # Implementer: Orchestrating Execution
7
+
8
+ You implement by **orchestrating sub-agents**, not by doing research, edits, and
9
+ verification yourself. Your Opus context is for judgment — synthesizing
10
+ research, targeting edits, judging verification against the plan. The legwork
11
+ goes to cheaper sub-agents. This skill is the procedure; invoke it at the start
12
+ of executing any scoped task.
13
+
14
+ ## Step 0 — Scoping gate (before you dispatch anything)
15
+
16
+ Classify the WHOLE task first:
17
+
18
+ - **Tiny + fully-known** — the entire task is a bounded change (≤ ~15 lines, ≤ 2
19
+ files) whose targets you already know, where any file-reading is purely to
20
+ **locate** an insertion point, not to **understand** unknown structure. Do it
21
+ inline as a correction-class edit; skip steps 1-4. This is the documented path
22
+ for atomic tiny tasks (a known rename-everywhere, a single-symbol change).
23
+ - **Anything larger or not-fully-known** — orchestrate (steps 1-4).
24
+
25
+ The size bound (~15 lines / 2 files) is the project default; a project-local
26
+ `implementer-rule-` may tune it.
27
+
28
+ ## Subagent model selection
29
+
30
+ > **Model tiers:** pass an explicit `model:` on every dispatch — `sonnet`
31
+ > (low effort) mechanical, `sonnet` (medium effort) judgment, Opus only on
32
+ > operator-ask or a skill step that names it. See the
33
+ > `choosing-subagent-models` skill for the full policy.
34
+
35
+ ## Step 1 — Dispatch research
36
+
37
+ Spawn `Explore` or general-purpose sub-agent(s) to map the target files,
38
+ interfaces, and call sites and return a written report. You read the report —
39
+ you do not read the code into your own context. Label the dispatch
40
+ `description="research: <what>"`.
41
+
42
+ ## Step 2 — Target and dispatch implementation
43
+
44
+ From the report, decide exactly what changes where, then dispatch
45
+ general-purpose sub-agent(s) to make the edits. Give each the bd task ID, the
46
+ exact files, the acceptance criteria, and the relevant slice of the report.
47
+ Model: `sonnet`; use `sonnet` (low effort) for purely mechanical edits
48
+ (find/replace, rename). Label `description="implement: <what>"`. Parallelize independent
49
+ edit-targets; serialize edits to shared files.
50
+
51
+ ## Step 3 — Dispatch verification
52
+
53
+ Spawn a `sonnet` verifier against **the plan the implementation sub-agent was
54
+ given** — does the diff satisfy the acceptance criteria and honor the plan?
55
+ Label `description="verify: <what>"`. (For the full code-quality +
56
+ spec-compliance review at DONE, `implementer-tdd-and-quality` and the
57
+ coordinator's review cycle still apply — this per-task verify is the lightweight
58
+ in-loop check.)
59
+
60
+ ## Step 4 — Synthesize and correct
61
+
62
+ Read the verifier's report. If a sub-agent's edit is wrong, you may **correct it
63
+ inline** — that is a legitimate exception, not a return to inline working. If
64
+ the work is sound, proceed to the next task or to DONE.
65
+
66
+ ## The inline-vs-dispatch boundary (the rule that keeps you honest)
67
+
68
+ > **Default verb is dispatch.** Inline editing is permitted in exactly three
69
+ > cases:
70
+ >
71
+ > 1. **Correcting** a sub-agent's edit that came back wrong.
72
+ > 2. An edit whose change you **already fully know**, where any reading is
73
+ > purely to **locate** the insertion point (not to understand), AND the
74
+ > change is bounded (≤ ~15 lines, ≤ 2 files).
75
+ > 3. The Step-0 scoping-gate case: the whole task meets the bound in (2).
76
+ >
77
+ > **The moment you must read code to _understand what to change_ — reading to
78
+ > discover unknown structure, not to find a known target — that is a research
79
+ > dispatch, not an inline edit.**
80
+
81
+ The test is objective: _did I have to explore to do this?_ "I opened three files
82
+ to figure out the change" is exploratory and cannot be relabeled "a single edit
83
+ I already knew." A known one-liner that needs one `grep` to find its line stays
84
+ inline. This is NOT the old "Sequential (direct work)" escape hatch — that keyed
85
+ on subjective "complexity"; this keys on an objective read-purpose test plus a
86
+ hard size bound.
87
+
88
+ ## Model tiers (always pass `model:` explicitly)
89
+
90
+ | Dispatch | Model |
91
+ | ------------------ | -------------------------------------------------- |
92
+ | research / explore | `sonnet` (or the `Explore` agent type) |
93
+ | implementation | `sonnet`; `sonnet` (low effort) for purely mechanical edits |
94
+ | verification | `sonnet` |
95
+
96
+ Use the bare `sonnet` alias (resolves to the current Sonnet); do not hard-pin a
97
+ version id. Never let a sub-agent inherit the parent (Opus) model.
98
+
99
+ ## Sub-agent label convention (required)
100
+
101
+ Every dispatch's `description` starts with one of: `research:`, `implement:`,
102
+ `verify:`. This is load-bearing for the evaluation harness, which classifies
103
+ delegation shape from these labels.
104
+
105
+ ## Anti-patterns
106
+
107
+ ❌ **Inline Worker** — does the research and edits itself instead of
108
+ dispatching. Your Opus context is for orchestration judgment, not hand-typing
109
+ edits a Sonnet sub-agent should make.
110
+
111
+ ❌ **Over-orchestrator** — dispatches a sub-agent for a known one-line change,
112
+ paying more in prompt-composition than the edit costs. The Step-0 scoping gate
113
+ and the size bound exist to prevent this; trivia stays inline.
114
+
115
+ ❌ **Unlabelled dispatch** — omits the `research:`/`implement:`/`verify:`
116
+ prefix, blinding the evaluation harness.
117
+
118
+ ## Project-specific rules (already loaded)
119
+
120
+ Read the shared partial at the absolute path:
121
+ `claude-plugin/commands/_project-rules-protocol.md`
122
+
123
+ Capture new rules mid-session via the `implementer-maintaining-memory` skill —
124
+ it references the `memory-write-discipline` common for the canonical
125
+ `thrum memory create` shape.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: implementer-receiving-dispatch
3
+ description: "Use when receiving a new task from the coordinator, starting implementation, scoping a fresh task, or receiving dispatch. Loads implementer-specific discipline for kicking off work cleanly."
4
+ ---
5
+
6
+ # Implementer: Receiving Dispatch
7
+
8
+ ## Reconcile your queue first
9
+
10
+ Before reading further: lift this dispatch into a bundle (`thrum queue add
11
+ --from-message <msg-id>`, the exact id of the dispatch you're acting on),
12
+ then `thrum queue start <bundle-id>`; drop/close any finished bundles. Full
13
+ lifecycle: `using-the-queue`.
14
+
15
+ ## Read the full implementation prompt before any tool call
16
+
17
+ **Why:** The dispatch message is the source of truth for scope, acceptance
18
+ criteria, file paths, and the worktree to work in. Skimming the first paragraph
19
+ and starting work means you'll miss either a constraint (the "don't do X" lines)
20
+ or a piece of context (the spec/plan paths). Both lead to wasted work that has
21
+ to be redone after review.
22
+
23
+ **How to apply:** When a dispatch lands in your inbox, read it end-to-end before
24
+ opening any file or running any command. Read the linked spec and plan paths to
25
+ the section relevant to your starting task. Only after that read should you
26
+ claim the task and begin tool calls. If anything in the prompt is unclear or
27
+ contradictory, reply `NEEDS_CONTEXT` rather than guessing.
28
+
29
+ ## Search for existing abstractions before writing new helpers
30
+
31
+ **Why:** A common failure mode is hand-rolling a helper for something the
32
+ codebase already has. The cost of the grep is seconds; the cost of reinvention
33
+ is a review round-trip plus a delete-and-replace patch.
34
+
35
+ **How to apply:** Before writing any new helper (path resolution, exec wrappers,
36
+ config loading, string sanitization, validation), run a targeted grep.
37
+ `grep -rn "FunctionNameHint\|relatedPattern" internal/` takes 2 seconds. If
38
+ something similar exists, use it. If it needs extension, extend it. Only create
39
+ a new function when nothing exists.
40
+
41
+ ## Don't refactor for free — log opportunities, don't implement them
42
+
43
+ **Why:** A bug fix doesn't need surrounding cleanup. A one-shot operation
44
+ doesn't need a helper. Inlining "improvements" into a scoped task expands the
45
+ diff, complicates review, and risks introducing bugs unrelated to the work.
46
+ Three similar lines is better than a premature abstraction.
47
+
48
+ **How to apply:** When you spot duplicated patterns, hardcoded values that
49
+ should be shared, or missed abstractions during implementation, log them to the
50
+ project's refactor backlog (a beads epic, e.g. `<refactor-epic-id>`):
51
+
52
+ `--description` is multi-line prose — never double-quoted inline. On
53
+ `scripts/bd-shared`, `--stdin`/`--body-file` are refused (remote-path
54
+ resolution + silent-empty-body hazards), so write it to a scratch file and
55
+ pass `-d "$(cat <file>)"`; see your role preamble's 🔴 PROSE INTO A COMMAND
56
+ rule.
57
+
58
+ ```bash
59
+ cat > /tmp/refactor-task-desc.md <<'EOF'
60
+ **Discovered during:** <task-id>
61
+ **Files:** <paths>
62
+ **Opportunity:** <what could be improved>
63
+ **Effort:** small/medium/large
64
+ EOF
65
+ bd create --title="Refactor: <short description>" --type=task \
66
+ --parent=<refactor-epic-id> --priority=3 -d "$(cat /tmp/refactor-task-desc.md)"
67
+ ```
68
+
69
+ Then continue with the assigned work. Do not implement the refactoring.
70
+
71
+ ## Flag scope deviations immediately — not in the final report
72
+
73
+ **Why:** If the assigned scope diverges from what you actually need to do
74
+ (missing context, wrong file paths, requirement implies more work than
75
+ described), the right time to surface it is the moment you notice — not buried
76
+ in a `DONE_WITH_CONCERNS` after hours of work in the wrong direction. Late
77
+ surfacing wastes the time between noticing and reporting.
78
+
79
+ **How to apply:** The moment you spot a scope deviation, send a `NEEDS_CONTEXT`
80
+ or `BLOCKED` message to the coordinator with the specific question and your
81
+ proposed alternative. Wait for confirmation before expanding scope unilaterally.
82
+ Coordinator-confirmed scope expansions become the new acceptance criteria;
83
+ un-confirmed expansions risk being unwound in review.
84
+
85
+ ## Verify spec/plan paths exist before starting
86
+
87
+ **Why:** Dispatch prompts reference spec and plan files in `dev-docs/specs/` and
88
+ `dev-docs/plans/`. If the paths don't exist (older session, mistyped path, file
89
+ moved), you'll either start without the authoritative source of truth or burn
90
+ time hunting for it.
91
+
92
+ **How to apply:** First tool call after reading a dispatch should verify the
93
+ referenced paths: `ls /path/to/dev-docs/specs/<file>.md`. If anything is
94
+ missing, reply `NEEDS_CONTEXT` with the missing path. Don't try to infer from
95
+ related files.
96
+
97
+ ## Project-specific rules (already loaded)
98
+
99
+ Read the shared partial at the absolute path:
100
+ `claude-plugin/commands/_project-rules-protocol.md`
101
+
102
+ If you accumulate a new rule mid-session (the user corrects you), capture it via
103
+ the `implementer-maintaining-memory` skill — it references the
104
+ `memory-write-discipline` common for the canonical `thrum memory create` shape.
105
+
106
+ ## Pattern D self-write — set `agent_status=working` on dispatch ACK
107
+
108
+ Immediately after sending the dispatch ACK, write `agent_status="working"` to
109
+ your local identity file. This is the Pattern D self-write that makes
110
+ `agent_status` carry signal across the fleet — the sweep script +
111
+ coordinator-context-monitoring skill use it to flag agents that go tmux-quiet
112
+ despite claiming `working` (STUCK-WORKING classification).
113
+
114
+ ```bash
115
+ # Step 1: ACK the dispatch within 2 minutes
116
+ thrum reply <MSG_ID> --stdin <<'EOF'
117
+ Received. Starting <scope>. ETA <rough>.
118
+ EOF
119
+
120
+ # Step 2: Mark yourself working (RPC-preferred; falls back to a local identity-file write if the daemon is unreachable)
121
+ thrum agent set-status working
122
+ ```
123
+
124
+ The local-write path updates your own identity file only — coord overrides
125
+ remote agents via `--agent <name>`. The companion `set-status idle` call on
126
+ DONE handoff lives in the
127
+ `implementer-status-and-handoff` skill.