flow-workflows 0.62.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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +320 -0
  3. package/adapters/README.md +128 -0
  4. package/adapters/codex/AGENTS.md +82 -0
  5. package/adapters/codex/CORE.md +522 -0
  6. package/adapters/codex/PRIMITIVES.md +64 -0
  7. package/adapters/codex/README.md +126 -0
  8. package/adapters/codex/config.snippet.toml +88 -0
  9. package/adapters/codex/skills/flow-bug-fix/SKILL.md +171 -0
  10. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +216 -0
  11. package/adapters/codex/skills/flow-bug-postmortem/SKILL.md +98 -0
  12. package/adapters/codex/skills/flow-bug-review/SKILL.md +190 -0
  13. package/adapters/codex/skills/flow-bug-ship/SKILL.md +187 -0
  14. package/adapters/codex/skills/flow-bug-start/SKILL.md +212 -0
  15. package/adapters/codex/skills/flow-bug-validate/SKILL.md +99 -0
  16. package/adapters/codex/skills/flow-doctor/SKILL.md +254 -0
  17. package/adapters/codex/skills/flow-feat-build/SKILL.md +350 -0
  18. package/adapters/codex/skills/flow-feat-design/SKILL.md +399 -0
  19. package/adapters/codex/skills/flow-feat-plan/SKILL.md +165 -0
  20. package/adapters/codex/skills/flow-feat-review/SKILL.md +350 -0
  21. package/adapters/codex/skills/flow-feat-ship/SKILL.md +417 -0
  22. package/adapters/codex/skills/flow-feat-start/SKILL.md +289 -0
  23. package/adapters/codex/skills/flow-feat-validate/SKILL.md +216 -0
  24. package/adapters/codex/skills/flow-init/SKILL.md +153 -0
  25. package/adapters/codex/skills/flow-news/SKILL.md +57 -0
  26. package/adapters/codex/skills/flow-next/SKILL.md +55 -0
  27. package/adapters/codex/skills/flow-work-README/SKILL.md +247 -0
  28. package/adapters/codex/skills/flow-work-abandon/SKILL.md +103 -0
  29. package/adapters/codex/skills/flow-work-clean/SKILL.md +228 -0
  30. package/adapters/codex/skills/flow-work-daily/SKILL.md +114 -0
  31. package/adapters/codex/skills/flow-work-green/SKILL.md +162 -0
  32. package/adapters/codex/skills/flow-work-query/SKILL.md +169 -0
  33. package/adapters/codex/skills/flow-work-respond/SKILL.md +176 -0
  34. package/adapters/codex/skills/flow-work-resume/SKILL.md +123 -0
  35. package/adapters/codex/skills/flow-work-status/SKILL.md +127 -0
  36. package/adapters/codex/skills/flow-work-try/SKILL.md +94 -0
  37. package/adapters/codex/skills/flow-work-watch/SKILL.md +223 -0
  38. package/adapters/gemini/CORE.md +521 -0
  39. package/adapters/gemini/PRIMITIVES.md +117 -0
  40. package/adapters/gemini/README.md +149 -0
  41. package/adapters/gemini/commands/flow/bug/fix.toml +168 -0
  42. package/adapters/gemini/commands/flow/bug/investigate.toml +213 -0
  43. package/adapters/gemini/commands/flow/bug/postmortem.toml +95 -0
  44. package/adapters/gemini/commands/flow/bug/review.toml +187 -0
  45. package/adapters/gemini/commands/flow/bug/ship.toml +184 -0
  46. package/adapters/gemini/commands/flow/bug/start.toml +209 -0
  47. package/adapters/gemini/commands/flow/bug/validate.toml +96 -0
  48. package/adapters/gemini/commands/flow/doctor.toml +251 -0
  49. package/adapters/gemini/commands/flow/feat/build.toml +347 -0
  50. package/adapters/gemini/commands/flow/feat/design.toml +396 -0
  51. package/adapters/gemini/commands/flow/feat/plan.toml +162 -0
  52. package/adapters/gemini/commands/flow/feat/review.toml +347 -0
  53. package/adapters/gemini/commands/flow/feat/ship.toml +414 -0
  54. package/adapters/gemini/commands/flow/feat/start.toml +286 -0
  55. package/adapters/gemini/commands/flow/feat/validate.toml +213 -0
  56. package/adapters/gemini/commands/flow/init.toml +150 -0
  57. package/adapters/gemini/commands/flow/news.toml +54 -0
  58. package/adapters/gemini/commands/flow/next.toml +52 -0
  59. package/adapters/gemini/commands/flow/work/README.toml +244 -0
  60. package/adapters/gemini/commands/flow/work/abandon.toml +100 -0
  61. package/adapters/gemini/commands/flow/work/clean.toml +225 -0
  62. package/adapters/gemini/commands/flow/work/daily.toml +111 -0
  63. package/adapters/gemini/commands/flow/work/green.toml +159 -0
  64. package/adapters/gemini/commands/flow/work/query.toml +166 -0
  65. package/adapters/gemini/commands/flow/work/respond.toml +173 -0
  66. package/adapters/gemini/commands/flow/work/resume.toml +120 -0
  67. package/adapters/gemini/commands/flow/work/status.toml +124 -0
  68. package/adapters/gemini/commands/flow/work/try.toml +91 -0
  69. package/adapters/gemini/commands/flow/work/watch.toml +220 -0
  70. package/adapters/gemini/settings.snippet.json +11 -0
  71. package/adapters/hermes/CORE.md +522 -0
  72. package/adapters/hermes/PRIMITIVES.md +86 -0
  73. package/adapters/hermes/README.md +145 -0
  74. package/adapters/hermes/config.snippet.yaml +63 -0
  75. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +171 -0
  76. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +216 -0
  77. package/adapters/hermes/skills/flow-bug-postmortem/SKILL.md +98 -0
  78. package/adapters/hermes/skills/flow-bug-review/SKILL.md +190 -0
  79. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +187 -0
  80. package/adapters/hermes/skills/flow-bug-start/SKILL.md +212 -0
  81. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +99 -0
  82. package/adapters/hermes/skills/flow-doctor/SKILL.md +254 -0
  83. package/adapters/hermes/skills/flow-feat-build/SKILL.md +350 -0
  84. package/adapters/hermes/skills/flow-feat-design/SKILL.md +399 -0
  85. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +165 -0
  86. package/adapters/hermes/skills/flow-feat-review/SKILL.md +350 -0
  87. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +417 -0
  88. package/adapters/hermes/skills/flow-feat-start/SKILL.md +289 -0
  89. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +216 -0
  90. package/adapters/hermes/skills/flow-init/SKILL.md +153 -0
  91. package/adapters/hermes/skills/flow-news/SKILL.md +57 -0
  92. package/adapters/hermes/skills/flow-next/SKILL.md +55 -0
  93. package/adapters/hermes/skills/flow-work-README/SKILL.md +247 -0
  94. package/adapters/hermes/skills/flow-work-abandon/SKILL.md +103 -0
  95. package/adapters/hermes/skills/flow-work-clean/SKILL.md +228 -0
  96. package/adapters/hermes/skills/flow-work-daily/SKILL.md +114 -0
  97. package/adapters/hermes/skills/flow-work-green/SKILL.md +162 -0
  98. package/adapters/hermes/skills/flow-work-query/SKILL.md +169 -0
  99. package/adapters/hermes/skills/flow-work-respond/SKILL.md +176 -0
  100. package/adapters/hermes/skills/flow-work-resume/SKILL.md +123 -0
  101. package/adapters/hermes/skills/flow-work-status/SKILL.md +127 -0
  102. package/adapters/hermes/skills/flow-work-try/SKILL.md +94 -0
  103. package/adapters/hermes/skills/flow-work-watch/SKILL.md +223 -0
  104. package/adapters/install.sh +99 -0
  105. package/adapters/opencode/CORE.md +521 -0
  106. package/adapters/opencode/PRIMITIVES.md +118 -0
  107. package/adapters/opencode/README.md +113 -0
  108. package/adapters/opencode/commands/flow-bug-fix.md +169 -0
  109. package/adapters/opencode/commands/flow-bug-investigate.md +214 -0
  110. package/adapters/opencode/commands/flow-bug-postmortem.md +96 -0
  111. package/adapters/opencode/commands/flow-bug-review.md +188 -0
  112. package/adapters/opencode/commands/flow-bug-ship.md +185 -0
  113. package/adapters/opencode/commands/flow-bug-start.md +210 -0
  114. package/adapters/opencode/commands/flow-bug-validate.md +97 -0
  115. package/adapters/opencode/commands/flow-doctor.md +252 -0
  116. package/adapters/opencode/commands/flow-feat-build.md +348 -0
  117. package/adapters/opencode/commands/flow-feat-design.md +397 -0
  118. package/adapters/opencode/commands/flow-feat-plan.md +163 -0
  119. package/adapters/opencode/commands/flow-feat-review.md +348 -0
  120. package/adapters/opencode/commands/flow-feat-ship.md +415 -0
  121. package/adapters/opencode/commands/flow-feat-start.md +287 -0
  122. package/adapters/opencode/commands/flow-feat-validate.md +214 -0
  123. package/adapters/opencode/commands/flow-init.md +151 -0
  124. package/adapters/opencode/commands/flow-news.md +55 -0
  125. package/adapters/opencode/commands/flow-next.md +53 -0
  126. package/adapters/opencode/commands/flow-work-README.md +245 -0
  127. package/adapters/opencode/commands/flow-work-abandon.md +101 -0
  128. package/adapters/opencode/commands/flow-work-clean.md +226 -0
  129. package/adapters/opencode/commands/flow-work-daily.md +112 -0
  130. package/adapters/opencode/commands/flow-work-green.md +160 -0
  131. package/adapters/opencode/commands/flow-work-query.md +167 -0
  132. package/adapters/opencode/commands/flow-work-respond.md +174 -0
  133. package/adapters/opencode/commands/flow-work-resume.md +121 -0
  134. package/adapters/opencode/commands/flow-work-status.md +125 -0
  135. package/adapters/opencode/commands/flow-work-try.md +92 -0
  136. package/adapters/opencode/commands/flow-work-watch.md +221 -0
  137. package/adapters/opencode/opencode.json +8 -0
  138. package/bin/cli.mjs +222 -0
  139. package/package.json +43 -0
  140. package/plugins/flow/.claude-plugin/plugin.json +21 -0
  141. package/plugins/flow/CHANGELOG.md +1744 -0
  142. package/plugins/flow/examples/FLOW.template.md +324 -0
@@ -0,0 +1,522 @@
1
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/skills/flow-core/SKILL.md — do not edit; change the plugin file and run the script. -->
2
+
3
+ # flow-core — the rules shared by every `/flow` command
4
+
5
+ > **hermes adapter — how the Claude Code primitives named below map here.**
6
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
7
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `delegate_task`, which creates the child on the spot from the `goal` and `context` you give it: the name in `agents.<role>` in `FLOW.md` is a role to state in that prompt, not an agent to declare anywhere; empty → do it in this context.
8
+ > - Parallel fan-out → several `delegate_task` calls in one response, capped at `agents.fanout_max` (empty → 4) and, above that, by `delegation.max_concurrent_children` in `config.yaml` (default 10); `agents.fanout_tool` is Claude Code-only, ignore it.
9
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → Hermes schedules itself: the `cronjob` tool, or `/cron add "every 30m" "<this command>"`. Each firing is a fresh session with no history, so the state still lives in `monitor.md` and the scheduled text must stand alone; retiring the job from inside a firing needs `cron.allow_agent_scheduling: true`.
10
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
11
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
12
+ > - `/model <value>` → Hermes's own `/model`; a subagent's model is `delegation.model` in `config.yaml`, one value for every child of a round.
13
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared under `mcp_servers` in `~/.hermes/config.yaml` (see `config.snippet.yaml`).
14
+ > - `$ARGUMENTS` → what the user typed after the skill name: Hermes takes everything from the first non-skill token on as the instruction.
15
+
16
+ Every `/flow-*` command assumes these rules. They are stated once, here, so a command file only
17
+ carries what is specific to its phase. Read this once per session; a command that says "load
18
+ `flow-core`" means this file.
19
+
20
+ ## 0. Effective FLOW config — base plus harness overlay
21
+
22
+ - Read `FLOW.md` at the repo root as the base, then the optional overlay for the harness running
23
+ this command: `FLOW.claude.md`, `FLOW.codex.md`, `FLOW.opencode.md`, `FLOW.gemini.md`, or
24
+ `FLOW.hermes.md`. The
25
+ harness is the product executing the command, never guessed from a model name. An overlay is
26
+ valid without a base file; unknown `FLOW.*.md` names are ignored. Throughout every command,
27
+ **"FLOW.md" means this effective merged configuration** unless the command explicitly names a
28
+ file it will edit.
29
+ - Merge by section and key. A key present in the active overlay replaces the base value; a key
30
+ absent there inherits the base. **A present-but-empty overlay key masks the base** and resolves
31
+ to the normal empty-key fallback — this is how Codex can inherit its session model while a legacy
32
+ `FLOW.md` still names a Claude model. A list-valued key is replaced as a whole, never appended.
33
+ `conventions` is the one unkeyed section: its overlay lines are added after the base lines, so
34
+ both sets apply. Keep the source file of every effective value; `doctor` reports it and later
35
+ edits preserve it.
36
+ - The sections in either file are tracker, git, autonomy, quality, agents, models, data,
37
+ conventions, notes, knowledge, and observability. Both files missing, or an effective empty key
38
+ → the default or auto-discovery each step names. Never stop because a file or key is empty.
39
+ - **An empty key that is a real decision for this repo is offered where it first matters**, and
40
+ nowhere else. Three steps, in order:
41
+ 1. Resolve the default or auto-discover, as above. The step never waits for configuration.
42
+ 2. The key is on the short list below **and** this phase was going to stop anyway **and** the mode
43
+ is `manual` → add **one option** to that stop: *"write `<key>: <value>` to `<destination>`"*,
44
+ alongside whatever it was already asking. Resolve the destination by the ownership rule below.
45
+ Never a question of its own, never a key off the list, and at most **one key per work** — the
46
+ second one waits for the next work or for `/flow-init`.
47
+ 3. `guided`/`auto` → take the default and **record** it: one line in the phase artifact as today,
48
+ plus an entry in `meta.json.defaults_used[]` — `{ "key": "agents.security", "default":
49
+ "general-purpose", "phase": "review" }`. Asking here would break the never-a-question contract
50
+ (§2); recording keeps the decision readable afterwards, and `/flow-doctor` aggregates it.
51
+
52
+ **The list, and it is short on purpose**: `agents.<role>` when a panel is about to improvise that
53
+ role on an M/L or sensitive diff · `quality.review_depth` after a review's cost line went over
54
+ `agents.budget_max` · `data.volumes` or `data.explain_cmd` when the query duel came back
55
+ schema-only · `quality.functional_check` when `validate` found a runnable app and no way to drive
56
+ it · `tracker.start_cmd`/`done_cmd`/`abandon_cmd` the first time a ticket could have been
57
+ transitioned. A key whose default is fine forever — `request_sections`, `worktree_path`,
58
+ `knowledge.timeout_s` — never appears here, in any mode.
59
+
60
+ The FLOW config is personal, so writing a line is not a team decision; it is still an edit to the
61
+ tree, so the option is an explicit choice the user makes, never a default action (same bar as
62
+ flow-core §8's convention offer, and the two share their wording). Update a value in the file it
63
+ came from. A new repo fact or shared preference goes to `FLOW.md`; a new harness-owned model,
64
+ agent, skill, orchestration tool, or knowledge-tool name goes to the active overlay. Never edit an
65
+ inactive harness's overlay.
66
+ - **Knowledge sources, by role** (`knowledge` section): `search` (one or more tools or commands
67
+ that return context for a query — all consulted in parallel, results merged as material to weigh),
68
+ `stage` (record one finding for this branch), `read_staging` (what this branch staged), `save`
69
+ (consolidate into the store). A step names the role, never a product. Missing role → that step
70
+ degrades: no `search` → skip the lookup silently; no `stage` → the finding goes to the phase
71
+ artifact only; no `read_staging` → the artifacts are the staging; no `save` →
72
+ the consolidation appends to `KNOWLEDGE.md` at the repo root. Per-call timeout
73
+ `knowledge.timeout_s` (empty = 2 s); a failure or timeout → continue without it, silently.
74
+ **How a consolidation runs** (`ship`, `postmortem`, `abandon`, and the offer in `/flow-work-status`
75
+ when `read_staging` has entries). No role set at all → say so in one line and stop; nothing here is
76
+ worth a command of its own, which is why there is no longer one:
77
+
78
+ 1. **Read the staging** for this branch with `knowledge.read_staging`; the role empty → the "why"
79
+ findings already written in this work's artifacts (`03-design.md` ADR-light and challenges,
80
+ `03-investigation.md`, `06-review.md`, `99-postmortem.md`). Nothing there and nothing new in the
81
+ session → *"nothing to consolidate on this branch"*, and stop.
82
+ 2. **Combine** the staged findings with what this session learned and has not staged, applying the
83
+ why-vs-what rule: anything the code already states — a path, a class, how it works — is discarded
84
+ here, not saved.
85
+ 3. **Per finding**: `knowledge.search` set → query it with the topic and the finding's paths, then
86
+ decide *create* · *update* · *enrich with a new angle* · *conflict*. A conflict is asked
87
+ immediately (`AskUserQuestion`) and nothing is saved until it is resolved. Then `knowledge.save`,
88
+ one call per finding; the role empty → append to **`KNOWLEDGE.md` at the repo root** under a
89
+ `## <topic>` heading — the finding, its evidence line, the date and the branch. Creating that file
90
+ the first time edits the tree, so it is asked once, in every mode; appending to an existing one is
91
+ recorded, not asked.
92
+ 4. **Report** in one line: *"Created N · Updated M · Conflicts resolved J"*, or *"Appended N
93
+ finding(s) to KNOWLEDGE.md"*.
94
+ 5. **Clear the staging** for the branch afterwards, when the store has that notion.
95
+
96
+ A tool call that fails is **reported, never swallowed** — this is the one knowledge path that is
97
+ explicit rather than degrading in silence.
98
+
99
+ - `notes.<command>` (or `notes.all`) → mandatory extra instructions for that command.
100
+ - Key names, merge rules, and defaults: the template shipped with the plugin
101
+ (`examples/FLOW.template.md`).
102
+
103
+ ## 1. Models — which model runs a step
104
+
105
+ Two keys, and they govern **subagents only**: `models.agents` for every subagent a command
106
+ improvises, `models.workers` for the parallel fan-out rounds (falling back to `models.agents`).
107
+ Empty, absent, or no section → everything runs on the model you were launched with, and you say
108
+ nothing.
109
+
110
+ - Pass the resolved value to every subagent you launch, **except** an agent named in `agents.<role>`,
111
+ which keeps the model its own definition sets.
112
+ - **You cannot switch your own model**, so no key names the phases the main agent performs itself.
113
+ A phase that wants another model says it in one line at the handoff (`this step reads better on
114
+ <value>, you are on <current>` → `/model <value>`), records it in the artifact, and continues.
115
+ Never a question, never a gate.
116
+ - A harness that cannot set a model per subagent: note it once, continue with the inherited one.
117
+
118
+ **A wide round inherits in silence — say what it inherits, never what it should be.** An empty key is
119
+ the right default and stays it: which model is cheap, capable or appropriate changes every few
120
+ months, differs per harness and per account, and belongs to whoever pays for the tokens. But
121
+ inheriting is unremarkable for one subagent and a blank cheque for a round of fifteen. So before
122
+ launching a round of **4 or more** subagents with both keys (`models.workers`, then `models.agents`)
123
+ empty, say it in one line: how many agents, and that they run on this thread's
124
+ model because no key is set. **Name the key, never a model** — no default, no suggestion, no ranking.
125
+ A harness that cannot report the model it runs on says the round inherits it, and that is the whole
126
+ line. Never a question, never a gate; the artifact's cost line carries the same fact.
127
+
128
+ Agents named in `agents.<role>` are the exception here as above: they keep whatever their own
129
+ definition sets, so a round can mix inherited and self-declared models. Report which, not whether it
130
+ was wise.
131
+
132
+ ## 2. Autonomy — `autonomy.mode`
133
+
134
+ `manual` (default) · `guided` · `auto`. Read it once and apply it throughout the command.
135
+
136
+ | Mode | Decisions | End of the command |
137
+ |---|---|---|
138
+ | `manual` | Stop at every decision point | Propose the next command with one `AskUserQuestion` (recommended step as default). Invoke it only on confirmation. Never make the user type it. |
139
+ | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically. |
140
+ | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing. |
141
+
142
+ **Hard gates — stop and ask in every mode, no exceptions:**
143
+ 1. Any push or MR/PR creation (all of `ship`).
144
+ 2. Creating or switching a branch when the base is ambiguous (not on a clean main, or a possible train/stacked branch).
145
+ 3. DB schema changes or migrations.
146
+ 4. A `review` that surfaced high-severity findings — never chain into `ship` on those.
147
+ 5. The business brief written before touching code (`build`, `fix`).
148
+
149
+ `respond` and `green` add their own gates (posting a reply, re-running a pipeline, integrating the
150
+ base) — see the command.
151
+
152
+ Rule of thumb for everything else: ask only when a decision is (a) irreversible or costly to undo,
153
+ (b) ambiguous and not resolved by ticket + knowledge search, or (c) a hard gate. Otherwise take the
154
+ sensible default and record it.
155
+
156
+ **Never a question in `guided`/`auto` — decide, record, continue:**
157
+ - (a) **Flow mechanics** — whether to launch a panel, challengers, skeptics or a fan-out, how wide, how many reviewers, inline vs subagent. Each step's recommended default *is* the answer.
158
+ - (b) **WIP commits** on the work branch.
159
+ - (c) **Continuing to the next MR/PR of a train** — asked in `manual`, taken and recorded in `guided`/`auto`.
160
+ - (d) **Size confirmation** — take the proposed size, record it, move on.
161
+ - (e) **Anything already decided and recorded** in the work's artifacts or `meta.json.notes`. Reopen only when new evidence contradicts the premise — then lead with the evidence.
162
+
163
+ Asking these anyway is how an unattended run degrades into a manual one.
164
+
165
+ ## 3. Reporting — how every stop reads
166
+
167
+ The user comes back to a screen they walked away from, often with other works in other panes.
168
+ They have read none of your tool calls, subagent reports or artifacts. So every stop — a question,
169
+ a hard gate, the end of the turn — **opens with this header**, before any prose:
170
+
171
+ ```
172
+ <TICKET> · <size> · phase <phase> · MR #<n> of <N>
173
+ Plan: <k> of <N> shipped — #1 <url/id> <state> · #2 <state> · #3–#N pending
174
+ Now: <one line — what just finished>
175
+ I need: <one line — the decision or action needed, or "nothing, continuing with X">
176
+ ```
177
+
178
+ - Every fact from `meta.json` (`ticket`, `size`, `phase`, `mrs[]`), never from memory. Drop the `MR #` and `Plan:` lines when the work has no `mrs`.
179
+ - **Body: at most ~10 lines**, only what could change a decision. Everything else goes to the phase artifact.
180
+ - **Product altitude.** Say what changed for whoever uses the software, not what you built. A code identifier earns a line only when the user must decide about it, asked something technical, or named it first.
181
+ - **Short lines.** One or two lines of headline, then two to five bullets, one idea each. No "for context", no restating an earlier stop. When the user asks a technical question, answer it in full.
182
+ - **Out of the chat, into the artifact:** your own process, your mistakes, corrections to subagent reports, bookkeeping. Subagent completion or idle notifications never earn a turn of their own.
183
+ - **Zero-context rule.** First mention of an identifier carries 4–6 words of what it is. Never cite a section number without naming what it is. No jargon the user has not used first.
184
+ - **If it is a question, it is `AskUserQuestion`.** Never end a message with a question in prose. If it does not deserve the menu, it is a decision you take and record.
185
+
186
+ ## 4. Live panel — `panel.json`
187
+
188
+ Whenever the state a panel would show changes, overwrite `.claude/work/<work>/panel.json`
189
+ **whole** (never patch) from `meta.json` plus what you know right now:
190
+
191
+ ```json
192
+ {
193
+ "updated_at": "2026-08-06T16:45:00+02:00",
194
+ "phase": "validate",
195
+ "header": true,
196
+ "lines": [
197
+ {"text": "Expose a thread's tracking state and events", "style": "title"},
198
+ "",
199
+ {"ref": "#1", "text": "batch read sources", "mark": "wait", "link": "https://gitlab.com/…/merge_requests/9977"},
200
+ {"ref": "#2", "text": "per-event and per-recipient counters", "mark": "current"},
201
+ {"ref": "#3–#6", "text": "channel map · use case · document detail · route", "mark": "pending"},
202
+ "",
203
+ {"ref": "Now", "text": "unit suite and the test agent over #2", "mark": "info"},
204
+ {"ref": "Next", "text": "ship #2", "mark": "info"},
205
+ {"ref": "Decision", "text": "confirm the MR/PR body before I create it", "mark": "wait"},
206
+ "",
207
+ {"text": "sibling-repo still needs the endpoint contract", "mark": "block"}
208
+ ]
209
+ }
210
+ ```
211
+
212
+ - **`mark` says what a line is**; the reader draws it. `done` · `current` (at most one) · `pending` · `wait` (waiting on someone else: an open MR/PR, a user decision) · `block` · `info`. Marked lines form an aligned column: symbol, `ref`, text, link pinned right. Do not set `style` on a marked line — except `mark: "info"` + `style: ok|warn|error` when the colour *is* the information (a monitoring verdict).
213
+ - **`ref` need not be a number**: `#1`, `#3–#6`, `Now`, `Next`, `Decision`. Column width is per block; blocks are separated by blank lines — use them so the MR/PR train and the labels below do not drag each other wide.
214
+ - **`link` is a field, never a URL inside `text`.**
215
+ - **Order:** (1) work title (`style: title`, no mark); (2) the MR/PR train, one entry per `meta.json.mrs[]` with `ref` `#n`, short title, real-state `mark`, `link` when there is a URL — not-started entries collapse into one `#a–#z` `pending` line; omit the block without `mrs`; (3) `Now` — what is running, the one fact `meta.json` cannot hold; (4) `Next`; (5) `Decision`, `mark: wait`, **only** when parked on the user; (6) blockers, `mark: block` (a sibling repo with `contract_handoff: pending`, a red pipeline, an unmerged dependency).
216
+ - **When:** (a) in pre-flight, as soon as `meta.json` is loaded; (b) immediately **before** every stop header; (c) **before** any long stretch (fan-out, full suite, CI poll) — never after, so a step that dies halfway is not shown as finished. When the stretch will outlast the ~30 min staleness warning, set `stale_after_minutes` to what it will really take; (d) wherever `## Close` updates `meta.json`.
217
+ - **Rules:** `phase` is the phase you are **running now** (not `meta.json.phase`, which advances only at Close). `header: true` means ticket, type, phase and age are drawn by the reader — do not repeat them in `lines`. Keep it under ~14 lines. Every fact from `meta.json` and the artifacts — an invented MR/PR state is worse than a blank panel. `updated_at` from the real clock (`date -Iseconds`), never carried over. Write in the language of the work's artifacts. No work folder (lightweight `respond`/`green`) → nothing to write.
218
+
219
+ ## 5. Work summary — `00-summary.md`
220
+
221
+ Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
222
+ single largest token cost of a work, so every work carries a short handoff:
223
+
224
+ - `.claude/work/<work>/00-summary.md`, **≤ 15 lines**, overwritten whole at every `## Close`:
225
+ what the work is (one line), size and current MR/PR, the decisions that stand (one line each),
226
+ the contracts declared or received (names and where the literal shape lives), what is pending,
227
+ what the next phase must open in full.
228
+ - **Pre-flight of every phase reads `meta.json` and `00-summary.md` first.** Open a full artifact
229
+ only when the step needs it: `build` opens `03-design.md` (contracts, verbatim) and the current
230
+ MR/PR of `04-mr-plan.md`; `review` opens the design's contracts and the implementation log;
231
+ `ship` opens the brief and the review verdict. A summary that does not answer the question you
232
+ have is the cue to open the artifact — never a licence to guess.
233
+ - Missing summary (a work started before this rule) → read the artifacts as before, write the
234
+ summary at your Close.
235
+ - **Name the phase, never the command.** An artifact outlives the session that wrote it and may be
236
+ resumed from a different agent, where the same phase is invoked under another name. Write the
237
+ phase — `validate`, `review`, `ship #2` — not the invocation. Applies to `00-summary.md`,
238
+ `panel.json`'s `Next` line and every numbered artifact; the prose you *say* at a stop is exempt.
239
+
240
+ ## 6. Delegating — what every brief owes the parent
241
+
242
+ A brief that says what to look at and nothing about what to send back is how a round of agents goes
243
+ quiet: the work gets done and the parent never sees it. The prompts this plugin writes out in full
244
+ already carry a report contract (`Under 250 words`, *findings only, one line each*). **A brief you
245
+ compose yourself carries the same one:**
246
+
247
+ > Report in under `agents.report_max_words` words (empty → 250): findings only, one line each as
248
+ > `file:line` + what is wrong + the fix. No method, no preamble, no apology.
249
+
250
+ The cap is not style. **A long report can be truncated in transit and reach you as nothing at all** —
251
+ Claude Code discards a subagent result over ~16 000 characters and hands the parent a placeholder,
252
+ which from here is indistinguishable from an agent that did no work. An uncapped brief over a large
253
+ diff hits that every time, and a stronger model hits it sooner, because it writes more.
254
+
255
+ **Bulk output is a file, not a report.** When the agent produces volume — a translation, a generated
256
+ test suite, a migration, a batch of edits — name the **path it writes** and require it to **save
257
+ after each finished piece, not at the end**. Then verify the artifact instead of believing the
258
+ report: half a chunk on disk is recoverable, what lives only in the agent's context is not.
259
+
260
+ **A size in a brief is a thermometer, not a budget.** When the brief hands an agent a `lines_est`,
261
+ a size or a review threshold, it says which one it is (§9). An agent that reads a number as a target
262
+ returns shorter, worse code — fewer comments, fewer tests, denser statements — and returns it looking
263
+ finished.
264
+
265
+ **A brief over a large corpus needs a bounded first step.** *"Review this 8 700-line diff"* has no
266
+ first move, and an agent handed one can sit for hours producing nothing. Split it: by path, by
267
+ numbered question, or by the concrete command that answers each one.
268
+
269
+ **Fan-out has a deadline, because a stall raises no event.** The harness reports an agent that
270
+ *finishes* and never one that *stops advancing*, so a stuck round is invisible unless you look. On
271
+ launching a round, record the time and what you expect it to take. At **every stop of the command** —
272
+ not only the last — check it: whatever your harness offers for listing running agents, and failing
273
+ that, the named path each one was told to write. An agent past `agents.stall_after_minutes`
274
+ (empty → 25) with nothing written is stopped, its brief split in two, and relaunched. An agent that
275
+ went idle with an empty or truncated result is **asked for it directly** before it is written off.
276
+
277
+ Dropping a silent agent is always allowed, and always reported (`N/M` reported). Waiting on one with
278
+ no deadline is what costs a session.
279
+
280
+ **The budget belongs to the command, not to the round.** `agents.fanout_max` caps *one* parallel
281
+ round; nothing capped what a command spends across all of its rounds, and the phases that fan out
282
+ compose: a review can run a panel, then area reinforcements, then a coverage sweep that relaunches
283
+ the panel, then one skeptic per finding — each round inside its own cap and the command an order of
284
+ magnitude over what anyone intended.
285
+
286
+ - **`agents.budget_max`** (empty → **12**) is the ceiling on subagents **one command run may launch
287
+ in total**, summed over every round, including relaunched rounds. `0` = no ceiling (not
288
+ recommended). A skill invoked as one reviewer counts as the agents it launches when you know the
289
+ number, and as 1 when you do not.
290
+ - **Count before you launch, not after.** Before each round: budget minus spent = what is left. The
291
+ round does not fit whole → launch what fits and report the truncation (`4/7`). Nothing left → skip
292
+ the phase and say which one, in one line, in the artifact.
293
+ - **Each command that fans out declares its own give-up order** — which phase is dropped first when
294
+ the budget runs out — so a truncation is deterministic and reviewable, never the model's mood on
295
+ the day.
296
+ - **Grouping does not raise a ceiling.** Both ceilings count *agents launched*, whatever the split
297
+ of findings, files or hypotheses between them. Twelve agents under `fanout_max: 4` is a breach,
298
+ not an optimisation; four agents carrying three findings each is the intended shape.
299
+ - **The cost is reported where the user reads it**, as `spent/budget`: a phase silently skipped for
300
+ budget and a phase that found nothing are not the same result.
301
+
302
+ ## 7. Deferred work — `followups[]`
303
+
304
+ Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
305
+ step finds a neighbouring defect, a plan names a piece as out of scope, a design records a risk it
306
+ does not mitigate, a validation leaves an edge case unchecked, a postmortem lists what would prevent
307
+ the next incident. Refusing to widen the diff is correct. Writing the note into an artifact and
308
+ walking away is where it stops being correct — `.claude/work/` is git-ignored in most repos and
309
+ archived once the work ships, so the note is gone the moment it would have mattered.
310
+
311
+ **The bar — most of what a phase notices is not a deferral.** A developer who spends a day inside
312
+ unfamiliar code sees twenty things: something that works but is not pretty, a failure mode that
313
+ needs three unlikely events at once, a name that stopped fitting, a coupling nobody enjoys. They
314
+ report one or two, and they are right to. Left without a bar, this section produces seven entries
315
+ out of one ticket — and seven entries is not seven problems, it is one problem and six reading
316
+ notes wearing its clothes. An entry is written only when it clears three questions, in order:
317
+
318
+ 1. **Who notices, and when?** Name them — a user, an operator, a consumer of this API, the next
319
+ person who has to change this file — and the moment they notice. No subject, no entry.
320
+ 2. **How likely is what it describes?** A path that needs a conjunction nobody has ever seen is a
321
+ note, not deferred work. Frequency is part of the finding, not colour on top of it.
322
+ 3. **Does waiting cost more than doing it now?** When it does not, waiting is free — and free is
323
+ the answer.
324
+
325
+ Three yeses → `followups[]`. Anything less stays in the phase artifact, where it is already written
326
+ in context, and travels no further: not lost, **not escalated**. What fails this bar nearly every
327
+ time: «this could be extracted», «the state is not trimmed», a coupling with no symptom, generic
328
+ missing coverage, a correct-but-unpretty shape, a rename. None of those is thoroughness; each is
329
+ one more thing the user has to decide about.
330
+
331
+ **A deferral is a record, not a sentence.** Whenever a phase parks work, it appends to
332
+ `meta.json.followups[]`:
333
+
334
+ ```json
335
+ { "id": "F1",
336
+ "kind": "prevention" | "audit" | "out-of-scope" | "risk" | "edge-case" | "other-bug"
337
+ | "tooling" | "decision",
338
+ "title": "one line, what would be done",
339
+ "why": "one line, why it was parked and why it still matters",
340
+ "source": "design" | "plan" | "build" | "validate" | "fix" | "postmortem",
341
+ "status": "proposed" | "accepted" | "declined" | "logged" | "done",
342
+ "ticket": null, "work": null, "note": "" }
343
+ ```
344
+
345
+ The artifact keeps its human-readable section exactly as before, with the `F<n>` id in front of each
346
+ row so the prose and the record never drift. **The record is the addition, not a replacement**: a
347
+ reader of `05-implementation.md` still sees the ideas in context.
348
+
349
+ **Two kinds are not work, and are treated apart.**
350
+
351
+ - **`tooling`** — a gap in the repository's own machinery rather than in what it ships: a test that
352
+ does not bind, a guard, ratchet or lint floor with slack in it, a stale knowledge card, prose that
353
+ drifted from the code. Real, worth writing down, and nobody's next task — a tracker where these
354
+ outnumber the product's defects makes the number lie and buries «a console goes silent and says
355
+ nothing» under «a floor has no subject». Their destination is the **debt log**, a versioned file
356
+ in the repo, not the tracker — **and it is not a question**: choosing the kind already decided it
357
+ (survey below).
358
+ - **`decision`** — a product question the current diff depends on: what the user sees when X,
359
+ whether closing Y also does Z, how much of the surface a notice may take. **A missing decision is
360
+ not deferred work.** Parking it does not shrink the diff, it makes the diff guess — and the guess
361
+ ships, gets reviewed, and comes back as a ticket that costs a whole work to answer what was two
362
+ minutes of the user's. The test is one line: **if the answer changes what the code being written
363
+ does now, ask now; if it changes what someone builds later, record it.** Asked now means one
364
+ `AskUserQuestion` the moment it surfaces, **in every `autonomy.mode`, `auto` included** — the
365
+ never-ask list of §2 is about flow mechanics, and a product decision is the opposite of mechanics —
366
+ phrased as the question itself with the options that were on the table, recommended one first. The
367
+ answer goes where the phase keeps its decisions (the brief in `04-fix.md`, the ADR-light in
368
+ `03-design.md`, `05-implementation.md`), never into `followups[]`. A `decision` entry exists only
369
+ when the user, asked, chose to defer: it stays `proposed` and is asked again at `ship` — **as its
370
+ question, never as *do it / not worth it***. A `followups[]` entry whose `title` is a question is
371
+ the signature of this mistake: rewrite it as the question and ask it.
372
+
373
+ **One survey, at the end, not one question per phase.** Nothing is asked when the note is written —
374
+ mid-build is the worst moment to judge whether a neighbouring defect is worth a ticket, and a
375
+ question there is exactly the interruption `guided`/`auto` exist to avoid. The triage happens once,
376
+ at `ship`'s Close, when the work is done and the user can see the whole set.
377
+
378
+ **A skeptic sorts them before the user sees them.** `/flow-*-review` already refuses to hand over an
379
+ unverified finding: its §6 gives each ambiguous one to a skeptic whose job is to *refute* it, burden
380
+ of proof on the finding. Deferred work reached the user through no filter at all, judged only by the
381
+ phase that parked it — the one party that cannot judge it, having just found it. So at Close, when
382
+ **3 or more** entries are still `proposed`, they go to a skeptic first (grouped into at most
383
+ `agents.fanout_max` briefs, the ceilings of §6 unchanged; **fewer than 3 → no agent**, the command
384
+ applies the bar itself):
385
+
386
+ > You are a skeptic. These are pieces of work a phase deliberately parked while shipping a ticket:
387
+ > <entries, each with `id`, `kind`, `title`, `why`, `source`>. For each one, try to REFUTE that it
388
+ > deserves a tracker issue. **The burden of proof is on the entry**: read the real code and say who
389
+ > notices it, how likely the path is, and what waiting actually costs. One verdict per entry —
390
+ > `ticket` (named subject, plausible path, waiting costs more), `log` (real, and nobody's next
391
+ > task), `drop` (no subject, or a path needing a conjunction nobody has seen). When the evidence is
392
+ > genuinely ambiguous, **do not** say `ticket`. Be concrete about why, citing what you read.
393
+
394
+ - **`drop`** → `declined`, the skeptic's reason in `note`. Still readable in the artifact and in
395
+ `meta.json`, never asked, never counted, never shown again by `status`/`daily`/`next`.
396
+ - **`log`** → straight to the debt log, no question, same destination as `tooling`.
397
+ - **`ticket`** → these are what the user is asked about, and **only the strongest
398
+ `tracker.followup_ask_max`** of them (empty → **2**). The rest are logged, with one line saying
399
+ how many and where they went. **A finished work never becomes more than `followup_ask_max`
400
+ questions**, whatever the phases found. `0` → nothing is ever asked and everything is logged.
401
+
402
+ Then, and only then, the survey:
403
+
404
+ - One `AskUserQuestion`, **one batch**, at most `followup_ask_max` entries, options **Do it** ·
405
+ **Not worth it** · **Later**. The `title` and `why` are the entire prompt. **`decision` entries
406
+ are asked as their product question** — they never go to the skeptic, a question's value not being
407
+ a thing to refute — and sit outside the ceiling.
408
+ - **`tooling` asks nothing.** One line in the debt log, `logged`, and a count on screen. Asking
409
+ **Log it** about a lint floor with slack in it was one question too many.
410
+ - **Not worth it** → `declined`, with the reason if given. Never asked again.
411
+ - **The debt log**: `tracker.debt_log` from FLOW.md (empty → `docs/DEBT.md`), a versioned Markdown
412
+ file created on first use — `- <date> · <ticket> · <title> — <why>` — committed on the work branch
413
+ so it travels with the MR/PR. Read by whoever next works on the machinery, triaged by nobody;
414
+ `status` and `daily` stop showing it. It is a file on the branch, not a queue.
415
+ - **A `decision` answered** → the answer is written into the artifact that owns it and the entry
416
+ becomes `done` with the answer in `note`. Deferred again → stays `proposed`.
417
+ - **Later** → stays `proposed`, and surfaces in `status`, `daily` and `next` until it is decided.
418
+ - **Do it** → `accepted`, then create the tracker issue with the tool's native command, exactly as
419
+ `/flow-feat-start` §2.5.4 does for a ticket-less draft — same commands, same best-effort fallback
420
+ to local-only when `tracker.tool` is `none`/empty or creation fails. Record the id in `ticket`.
421
+ - No entries still `proposed` → **the step does not exist**. Never show an empty survey.
422
+
423
+ **One line on screen, not one per entry.** However many were written, a stop mentions deferred work
424
+ in **at most one line** (§3): the one that escalated, named in product terms, plus a count and a
425
+ destination for the rest — «2 more went to `docs/DEBT.md`». Never a list of seven titles, and never
426
+ «7 findings are waiting for triage» as the last thing the user reads before closing the pane.
427
+
428
+ **Creating an issue is outward-facing, so it asks in every mode**, `auto` included — the same
429
+ category as the MR/PR gate, never flow mechanics. Writing a `followups[]` entry asks nothing, ever.
430
+
431
+ **What stays open is published.** Entries still `proposed` or `accepted` when the MR/PR is created
432
+ get a line in its description: what was consciously left out, and why. A reviewer cannot weigh a
433
+ diff against what the author decided not to do unless someone tells them.
434
+
435
+ **Where an accepted one goes next.** `/flow-feat-start` and `/flow-bug-start` on that ticket record
436
+ `meta.json.origin` — `{ "work": "<originating work>", "followup": "F1" }` — and carry the `why` into
437
+ `01-context.md` instead of re-deriving it. The originating entry moves to `in_progress` with `work`
438
+ pointing at the new folder, and to `done` when that work does.
439
+
440
+ **Archiving does not close anything.** `status` and `daily` read `_archive/*/meta.json` for entries
441
+ not `declined`/`logged`/`done`: a work being finished is precisely when its deferrals become invisible.
442
+
443
+ ## 8. Conventions learned — `conventions_candidates[]`
444
+
445
+ Mid-phase, the user corrects you. *«We don't put that in a listener here, use a message handler.»*
446
+ *«Never mock the repository in that layer.»* *«The test command is `make test-unit`, not
447
+ `bin/phpunit`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
448
+ and the next work on the same repo proposes the same thing again. The place for these exists —
449
+ `FLOW.md`'s `conventions` and `quality` — and nothing on the path from the correction to that file is
450
+ automatic: the user has to notice they have said it three times and go and edit it.
451
+
452
+ **The test is one question: would the same correction apply to an unrelated ticket in this repo?**
453
+ Yes → it is a convention. No → it is this ticket, and the artifact of the phase that heard it is
454
+ where it belongs. A scope change, a naming preference about this diff, the answer to a product
455
+ question: all about the work, none about the repo.
456
+
457
+ **Capture, never interpret, never ask.** When the user's reply to a stop overrides something you
458
+ proposed and it passes that test, append to `meta.json.conventions_candidates[]`:
459
+
460
+ ```json
461
+ { "id": "C1",
462
+ "text": "the rule, one line, in the user's own words",
463
+ "target": "conventions" | "quality.<key>",
464
+ "phase": "build",
465
+ "evidence": "the stop it came from" }
466
+ ```
467
+
468
+ and write the same row under a `## Conventions learned` heading in the phase artifact, same `C<n>`
469
+ id — as `followups[]` does with its own sections. Do not rewrite the sentence into policy prose: the
470
+ value of the line is that it is what they said. `target` is `quality.<key>` when the correction names
471
+ a command the flow runs (a test, a linter, a formatter) and `conventions` for everything else.
472
+
473
+ **`review` reads them in the same work.** The idiom audit is already handed *the project's primitive
474
+ vocabulary from its effective conventions*; this work's candidates join that input, so a rule
475
+ learned during `build` is enforced in the review of that same MR/PR, not of the next one.
476
+
477
+ **`ship` offers them once, at Close** — one `AskUserQuestion`, batched up to 4, options **Add to
478
+ FLOW.md** · **Not a rule** · **Later**, the `text` being the whole prompt. *Add* appends a convention
479
+ to the base `FLOW.md`. A `quality` correction updates the file its effective value came from, or the
480
+ base when the key was absent: otherwise an overlay would immediately hide the correction. The FLOW
481
+ config is personal, but this is still an edit to a file in the tree, so **it is asked in every
482
+ mode**, like `KNOWLEDGE.md`'s first creation. No candidates → the step does not exist and says
483
+ nothing.
484
+
485
+ **Duplicates and contradictions, before anything is shown.** Already in `conventions`, in any wording
486
+ → dropped silently, no question. Contradicting a line that is there → the option is **Replace**
487
+ rather than **Add**, and both lines are shown, the existing one first. A candidate the user declines
488
+ is `declined` and never offered again, in this work or a later one.
489
+
490
+ **These are not domain knowledge.** `knowledge.stage`/`save` is for the *why* of the business, and
491
+ that filter does not move: a repo convention is the *what* of the code, it goes to `FLOW.md`, and it
492
+ never reaches the knowledge store. Two buckets, two destinations, no overlap.
493
+
494
+ ## 9. Size is a route, never a target
495
+
496
+ Two numbers decide how much apparatus a change gets. `meta.json.size` and each `lines_est` in
497
+ `meta.json.mrs` route the phases (`/flow-feat-start §4`, `/flow-feat-plan`), and the **diff's own
498
+ size** picks the review tier and opens or closes the skeptic round (`/flow-feat-review §2.0`, §6).
499
+ Both are doing their job: a 40-line change does not need the apparatus an 800-line one does, and
500
+ scaling the review to the diff in front of you instead of to the feature it belongs to is the single
501
+ largest saving the review has.
502
+
503
+ **What follows from that is a temptation, and it belongs to the diff, not to the plan.** A threshold
504
+ that buys a lighter review pays whoever lands just under it: twelve lines below 150 is a review at
505
+ `medium` with no project panel and no §6 round, twelve above it is the panel. So, in every phase:
506
+
507
+ **The diff reports the change; the change is never shaped to fit the number.** Never delete a
508
+ comment, a test, a blank line or a log line, never compress readable code into fewer statements,
509
+ never add an abstraction because it shortens the diff, and never cut at a point that is not coherent
510
+ — not to land under a `lines_est`, and not to land under a review threshold. Each of those makes the
511
+ diff smaller without making the change smaller, which is the only way a number here can lie: the
512
+ review that arrives is the one a different, smaller change had earned.
513
+
514
+ **The honest moves are already written down.** Over the estimate, and the cut would be artificial →
515
+ `/flow-feat-build §2.3`'s "continue and record the overrun". Genuinely two deliverables → a cut at a
516
+ coherent point, which is a different act with its own justification (`/flow-feat-plan`'s four
517
+ criteria). Under the estimate because the change turned out smaller → nothing to do; that is a good
518
+ estimate meeting a good change.
519
+
520
+ **It travels into every brief.** A subagent handed a size or a `lines_est` is handed a thermometer,
521
+ never a budget, and the brief says so (§6). An agent optimising for a number nobody told it was
522
+ advisory is the one that returns tidier, shorter, worse code — and it returns it looking finished.
@@ -0,0 +1,86 @@
1
+ # PRIMITIVES.md — primitive translation table
2
+
3
+ How each Claude Code-specific primitive maps to the Hermes Agent adapter, and what has no equivalent.
4
+
5
+ > The generated skills carry a short **legend** right after their title; it comes from the `LEGEND`
6
+ > dict in `script/adapter-build.py`. This document is the long form of that legend. The skill body
7
+ > itself is the plugin's, untouched — the legend defines the terms, the body keeps using them.
8
+
9
+ ## Translation table
10
+
11
+ | Primitive (Claude Code) | Meaning | Hermes translation |
12
+ |-------------------------|---------|--------------------|
13
+ | `Agent <role>` / subagent | Delegates isolated work to a subagent | **`delegate_task`**, which builds the child from the `goal` and `context` it is handed — Hermes has no predeclared agents. The name in `agents.<role>` of `FLOW.md` is therefore a role to state in that prompt, not a definition to install. Empty in FLOW.md → do it in this context. |
14
+ | `AskUserQuestion` | Structured option menu to the user (built-in UI in Claude Code) | **Plain text question**: ask with numbered options and wait for the reply. No structured UI in Hermes. |
15
+ | `ScheduleWakeup` (watch autopilot) | Re-wake in N min within the current session | **The closest of the four adapters**: Hermes has its own scheduler (`cronjob` tool · `/cron add`), so the repetition is native rather than OS cron. Not the same thing, though — see below. |
16
+ | Parallel fan-out | N subagents in one round + synthesis by the main agent | **Ports directly** — several `delegate_task` calls in one response. Two ceilings apply, and the lower one wins: `agents.fanout_max` from FLOW.md (empty → 4) and `delegation.max_concurrent_children` in `config.yaml` (default 10). Leave `agents.fanout_tool` empty, it names a harness-specific orchestrator Hermes does not have. |
17
+ | `Skill commit-commands:commit-push-pr` | Create commit + push + MR/PR | Manual sequence: `git add`, `git commit`, `git push -u origin HEAD`, and the `git.cli` CLI from FLOW.md (e.g. `glab mr create` or `gh pr create`). |
18
+ | `Skill save-knowledge` | Consolidate the branch's knowledge findings | `/flow-save-knowledge` from this adapter. |
19
+ | `Skill flow:flow-core` | Load the shared rules once per session | **Read `~/.claude/flow/CORE.hermes.md`** — `install.sh` puts it there from `CORE.md`. |
20
+ | `/model <value>` | Switch the session's model | Hermes's own `/model`. For children, `delegation.model` in `config.yaml` — see `models` below. |
21
+ | `mcp__domain-memory__<tool>` | Call the domain-memory MCP | The **same MCP server** (same tool name). Only the configuration moves: `mcp_servers` in `~/.hermes/config.yaml`, or `hermes mcp install`. See `config.snippet.yaml`. |
22
+ | `TaskCreate` / `TaskStop` | Track steps with Claude Code's task UI | Track progress through the markdown artifact log (`05-implementation.md`, `04-fix.md`) and report it to the user in text. (Hermes has a kanban of its own; the flow does not assume it.) |
23
+ | `$ARGUMENTS` | What the user typed after the command | Hermes reads the leading `/skill` tokens and hands the agent everything from the first non-skill token on. So `/flow-feat-start PROJ-412` arrives with `PROJ-412` as the instruction. |
24
+
25
+ ## What does NOT port 1:1
26
+
27
+ ### AskUserQuestion
28
+ Claude Code presents options as buttons. Hermes has no such primitive, so every question is plain
29
+ text in the response. The behavior is equivalent: the agent asks and waits before continuing.
30
+ Options are listed in prose (e.g. "Options: (1) Yes, go ahead. (2) No, something's missing. (3) Cancel.").
31
+
32
+ ### ScheduleWakeup (watch autopilot)
33
+ `ScheduleWakeup` lets a Claude Code session re-wake itself N minutes later **inside the same
34
+ session**, so the watch keeps its context from cycle to cycle. Hermes does not re-wake a session —
35
+ it starts a new one on a schedule:
36
+
37
+ ```
38
+ /cron add "every 30m" "/flow-work-watch PROJ-412"
39
+ ```
40
+
41
+ What that changes, and why the flow is written the way it is:
42
+
43
+ - One firing is **one watch cycle**, and it carries **no chat history**. The scheduled text has to
44
+ stand alone — which is what the plugin prose already assumes.
45
+ - State between cycles lives in `.claude/work/<TICKET>/monitor.md` (watched surface, approved plan,
46
+ concrete queries, baseline values, last readings). On re-entry the prose finds the approved plan
47
+ there and jumps straight to the cycle, without repeating discovery or re-asking for confirmation.
48
+ - Job output lands in `~/.hermes/cron/output/{job_id}/{timestamp}.md`, and the jobs themselves in
49
+ `~/.hermes/cron/jobs.json`. `hermes cron` (or `/cron`) lists and removes them.
50
+ - **A firing cannot retire its own job** unless you set `cron.allow_agent_scheduling: true`. Off (the
51
+ default), the watch runs until you stop it by hand; on, it can delete the job when the window closes.
52
+ - Each firing resolves its model as per-job pin → `cron.model` → the global default, snapshotted when
53
+ the job was created.
54
+
55
+ So: the repetition is native, the continuity is not. That is still one degradation fewer than the
56
+ opencode, Gemini and Codex adapters, which need OS cron for the same loop.
57
+
58
+ ### TaskCreate / TaskStop
59
+ Claude Code's task UI does not exist here. Step tracking is done through the workflow's markdown
60
+ artifacts (`05-implementation.md`, `04-fix.md`) and reports to the user at the end of each step.
61
+
62
+ ---
63
+
64
+ ## `models` in the effective FLOW config
65
+
66
+ The `models` section has two keys: `agents` for every improvised subagent and `workers` for the
67
+ parallel fan-out rounds (`workers` falls back to `agents`). Both are optional; empty means inherit
68
+ the model the session was launched with. Values are free text handed to the harness: flow neither
69
+ validates nor ranks model names.
70
+
71
+ Put Hermes-specific values in `FLOW.hermes.md`. Hermes reads it after `FLOW.md`, key by key; an
72
+ explicitly empty overlay key masks the base, and an absent key inherits it. A repo with only
73
+ `FLOW.md` behaves exactly as before.
74
+
75
+ How it lands here:
76
+
77
+ - **Subagent steps** — `delegate_task` has **no per-task model parameter**: every child runs on
78
+ `delegation.model` from `config.yaml` (falling back to the session's model). So `models.agents` and
79
+ `models.workers` are honoured by setting that key, and a round cannot mix two models. If the two
80
+ FLOW keys differ, the one you put in `delegation.model` is the one that runs; the other is reported
81
+ at the phase handoff and not enforced.
82
+ - **What the conductor does itself** — reading the ticket, designing, and writing the code in
83
+ `build`/`fix` (single-thread on XS/S/M): neither key applies, because a session cannot switch its
84
+ own model mid-run. It continues with the model it was launched with.
85
+
86
+ Full reference: `docs/CONFIGURATION.md` §`models` in the repo.