flow-workflows 0.78.0 → 0.79.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.
- package/adapters/codex/CORE.md +64 -1
- package/adapters/codex/skills/flow-bug-review/SKILL.md +1 -0
- package/adapters/codex/skills/flow-bug-ship/SKILL.md +1 -0
- package/adapters/codex/skills/flow-feat-review/SKILL.md +2 -1
- package/adapters/codex/skills/flow-feat-ship/SKILL.md +27 -2
- package/adapters/codex/skills/flow-work-README/SKILL.md +8 -0
- package/adapters/codex/skills/flow-work-respond/SKILL.md +2 -1
- package/adapters/gemini/CORE.md +64 -1
- package/adapters/gemini/commands/flow/bug/review.toml +1 -0
- package/adapters/gemini/commands/flow/bug/ship.toml +1 -0
- package/adapters/gemini/commands/flow/feat/review.toml +2 -1
- package/adapters/gemini/commands/flow/feat/ship.toml +27 -2
- package/adapters/gemini/commands/flow/work/README.toml +8 -0
- package/adapters/gemini/commands/flow/work/respond.toml +2 -1
- package/adapters/hermes/CORE.md +64 -1
- package/adapters/hermes/skills/flow-bug-review/SKILL.md +1 -0
- package/adapters/hermes/skills/flow-bug-ship/SKILL.md +1 -0
- package/adapters/hermes/skills/flow-feat-review/SKILL.md +2 -1
- package/adapters/hermes/skills/flow-feat-ship/SKILL.md +27 -2
- package/adapters/hermes/skills/flow-work-README/SKILL.md +8 -0
- package/adapters/hermes/skills/flow-work-respond/SKILL.md +2 -1
- package/adapters/opencode/CORE.md +64 -1
- package/adapters/opencode/commands/flow-bug-review.md +1 -0
- package/adapters/opencode/commands/flow-bug-ship.md +1 -0
- package/adapters/opencode/commands/flow-feat-review.md +2 -1
- package/adapters/opencode/commands/flow-feat-ship.md +27 -2
- package/adapters/opencode/commands/flow-work-README.md +8 -0
- package/adapters/opencode/commands/flow-work-respond.md +2 -1
- package/package.json +1 -1
- package/plugins/flow/.claude-plugin/plugin.json +1 -1
- package/plugins/flow/CHANGELOG.md +20 -0
- package/plugins/flow/examples/FLOW.template.md +3 -0
package/adapters/codex/CORE.md
CHANGED
|
@@ -17,7 +17,7 @@ Every `$flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
17
17
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
18
18
|
`flow-core`" means this file.
|
|
19
19
|
|
|
20
|
-
**This file belongs to flow `0.
|
|
20
|
+
**This file belongs to flow `0.79.0`.** Compare it once, at the start of the session, against
|
|
21
21
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
22
22
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
23
23
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -610,6 +610,69 @@ Record what you picked where a default would be recorded (§0): *"`agents.fronte
|
|
|
610
610
|
`react-expert` (installed)"*. That line is also the evidence for writing the role down when the
|
|
611
611
|
next stop offers it.
|
|
612
612
|
|
|
613
|
+
### 6.7 — An agent that missed something learns it, once
|
|
614
|
+
|
|
615
|
+
A reviewer that let a defect through will let the same one through next time: nothing it is given
|
|
616
|
+
changes between works. The fix is to its definition, and the evidence that it needs one arrives
|
|
617
|
+
here, in the flow, where somebody else caught what it did not. So a phase that holds that evidence
|
|
618
|
+
records it, and the work's close offers to write it into the agent.
|
|
619
|
+
|
|
620
|
+
**Only evidence from outside the agent counts.** An agent judging its own performance almost
|
|
621
|
+
always finds it good, and a lesson learned from that is a transient failure written down as a
|
|
622
|
+
permanent rule. Three signals, and nothing else:
|
|
623
|
+
|
|
624
|
+
- **Missed** — a finding that survived (§6 verification, or the user's acceptance) falls squarely in
|
|
625
|
+
the category a panel member or a named `agents.<role>` owns, and **that agent did not report it**
|
|
626
|
+
while another source did: the built-in review, another pass, a reinforcement, a human.
|
|
627
|
+
- **Produced** — a surviving finding sits in code a delegated agent wrote (a `build` piece, the
|
|
628
|
+
testing agent's suite): the lesson goes to the agent that wrote it.
|
|
629
|
+
- **Human caught** — a reviewer's thread in `$flow-work-respond` that ended in a code change, in a
|
|
630
|
+
category a panel member owns: the whole panel missed it, and the owner is the one to learn.
|
|
631
|
+
|
|
632
|
+
**The same test as a convention (§8), aimed at the agent.** Would this lesson help that agent on an
|
|
633
|
+
unrelated work in its domain? No → it belongs to this ticket, record nothing. Yes, but it is a fact
|
|
634
|
+
about the **repo** rather than the agent's craft (*"the test command is `make test-unit`"*) → it is a
|
|
635
|
+
`conventions_candidates[]` row, not a lesson. Yes, and it is about the craft (*"check that every
|
|
636
|
+
state change inside a loop is flushed once, not per iteration"*) → a lesson.
|
|
637
|
+
|
|
638
|
+
Record it in `meta.json.agent_lessons[]`, asking nothing:
|
|
639
|
+
|
|
640
|
+
`{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human", "phase":
|
|
641
|
+
"review", "evidence": "<finding or thread, one line, with file:line or URL>", "lesson": "<one
|
|
642
|
+
imperative line, general, no ticket id>", "status": null }`
|
|
643
|
+
|
|
644
|
+
**What is never edited**, and the lesson stays recorded in `meta.json` for you to read:
|
|
645
|
+
|
|
646
|
+
- an agent installed from a plugin or a marketplace — it is someone else's file, and the next
|
|
647
|
+
update would overwrite the edit anyway;
|
|
648
|
+
- a skill (`quality.review_skill`) — it orchestrates agents rather than being one;
|
|
649
|
+
- `general-purpose` and the improvised specialists of §6.6 that were not saved — no file to edit.
|
|
650
|
+
|
|
651
|
+
**Writing it — only at the work's close** (`$flow-feat-ship` §5.2, `$flow-work-respond` §8), with
|
|
652
|
+
`agents.learn` (empty → `offer`; `off` → nothing is recorded or offered):
|
|
653
|
+
|
|
654
|
+
- **Your agents** (written by hand, or shared through the repo) → shown as a diff and written only
|
|
655
|
+
on an explicit yes, **in every mode**: it is your configuration, and in the repo it is your team's.
|
|
656
|
+
- **Agents flow created** (§6.6 saved with `created_by: flow` in their frontmatter) → the same
|
|
657
|
+
question in `manual`; in `guided`/`auto` written directly and reported in one line.
|
|
658
|
+
|
|
659
|
+
**How it is kept small** — without this, the file grows one line per incident until the rules
|
|
660
|
+
nobody reads crowd out the ones that matter:
|
|
661
|
+
|
|
662
|
+
1. Lessons live in one section at the end of the file, `## Lessons from past work`, one line each.
|
|
663
|
+
The rest of the file is never rewritten.
|
|
664
|
+
2. **Already there, in any wording → the lesson is not added.** The agent had the rule and missed
|
|
665
|
+
anyway, which says the rule is weak, not absent: offer instead to move it out of the lessons
|
|
666
|
+
into the body of the brief, rewritten as a check the agent must perform.
|
|
667
|
+
3. **At `agents.lessons_max` lines (empty → 10), adding one means consolidating first**: merge
|
|
668
|
+
lines that say the same thing, generalise two narrow ones into the rule they share, drop one a
|
|
669
|
+
later lesson supersedes. Show the section before and after in the same question.
|
|
670
|
+
4. **Before any edit, copy the file** to `.claude/work/<work>/agent-backups/<name>.md` and record
|
|
671
|
+
the path in the lesson's entry. Undoing is copying it back. A file is never deleted.
|
|
672
|
+
|
|
673
|
+
Then `status`: `"written"` (with the path) · `"declined"` (never offered again) · `"later"` ·
|
|
674
|
+
`"not-editable"` (one of the three cases above, with which).
|
|
675
|
+
|
|
613
676
|
## 7. Deferred work — `followups[]`
|
|
614
677
|
|
|
615
678
|
Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
|
|
@@ -234,6 +234,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
|
|
|
234
234
|
- Without blockers: `phase = "review"`, add to `phases_done`. Suggest `$flow-bug-postmortem` (M/L) or `$flow-bug-ship` (XS/S).
|
|
235
235
|
- **Record *what* you reviewed, and separately what you changed after reading it** — `$flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `$flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
|
|
236
236
|
- **Record which pass found what** — `$flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow cost` reads them back per origin, and the retirement rule is the same: a pass with no exclusive surviving finding across twenty reviews comes out of the command.
|
|
237
|
+
- **Record what the agents missed** — `$flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
|
|
237
238
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `$flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
|
|
238
239
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
239
240
|
- Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
|
|
@@ -187,6 +187,7 @@ nothing was measured. A slowness bug is the case where this comment *is* the pro
|
|
|
187
187
|
- **Cross-repo contract handoff**: for each such entry with `contract_handoff: "pending"` — the fix changed a surface that sibling consumes — hand the new shape over as `$flow-feat-ship` §6.3 (publish the **literal** shape to the tracker ticket, mandatory preview in every autonomy mode, then record `published → <location>`; versioned-file fallback when there is no tracker). A bug flow has no §"External contracts": take the literal from the fix itself — the actual key, code, route or event the code now emits — read it off the code, never from memory.
|
|
188
188
|
- **Follow-up triage — `$flow-feat-ship` §6.4, in full and unchanged.** Read `meta.json.followups[]`; nothing `proposed` → skip silently. Otherwise §6.4 step 0 first — **3 or more candidates go to a skeptic** whose job is to refute that each deserves a ticket, and only the strongest `tracker.followup_ask_max` (empty → **2**) reach the user (flow-core §7) — then one batched `AskUserQuestion` (**Do it** / **Not worth it** / **Later**; `decision` entries asked as their question, `tooling` and everything `log`ged never asked), the accepted ones get their tracker issue created (outward-facing → **asks in every mode**), the logged ones nothing but `status: "logged"` in `meta.json`, then one offer to start the first. A bug flow is where the gate earns its keep: the prevention actions `$flow-bug-postmortem` wrote, the neighbouring bugs `$flow-bug-validate` found and the similar-risk patterns `$flow-bug-fix` flagged all land here — half a dozen of them, from one fix, and «similar risk elsewhere» that no skeptic ever read is exactly the entry that turns a closed bug into six open questions. Repeat for anything still `proposed` on the re-run that confirms the merge.
|
|
189
189
|
- **Specialists created — `$flow-feat-ship` §5.1, in full and unchanged.** Read `meta.json.specialists[]` (flow-core §6.6); nothing `useful` and pending → skip silently. Otherwise one batched offer to save each as an agent, after the MR/PR and after the knowledge `$flow-bug-postmortem` §4 already consolidated — asked in every mode, never overwriting an agent that exists.
|
|
190
|
+
- **What the agents missed — `$flow-feat-ship` §5.2, in full and unchanged.** Read `meta.json.agent_lessons[]` (flow-core §6.7); `agents.learn: off` or nothing pending → skip silently. Otherwise one question per agent with the resulting lessons section, backup first, your agents asked in every mode.
|
|
190
191
|
- **Conventions learned — `$flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
|
|
191
192
|
- **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
|
|
192
193
|
- **Only once `phase` is `done`**: delete the candidate anchor `$flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run.
|
|
@@ -386,6 +386,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
386
386
|
**The retirement rule, written down before the data arrives** so it cannot be argued backwards later: a pass that contributes **no exclusive surviving finding across twenty reviews** is removed from this command. Zero is zero, and the decision is made against the number rather than against whoever is most attached to the pass.
|
|
387
387
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `$flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
|
|
388
388
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
389
|
-
- **
|
|
389
|
+
- **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
|
|
390
|
+
- **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
|
|
390
391
|
- Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
|
|
391
392
|
- **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `$flow-feat-validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `$flow-feat-validate` automatically** in this same turn. Never chain into `$flow-feat-ship` from here — ship is reached through `validate`.
|
|
@@ -248,8 +248,8 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
248
248
|
3. **Asked in every mode**, `auto` included: it writes to your agent configuration, outside the
|
|
249
249
|
tree, and that is never flow mechanics.
|
|
250
250
|
4. **Save** → write the agent where and in the format your harness reads agents from (on Claude
|
|
251
|
-
Code, `~/.claude/agents/<name>.md`: frontmatter `name
|
|
252
|
-
use it, then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
251
|
+
Code, `~/.claude/agents/<name>.md`: frontmatter `name`, a one-line `description` of when to
|
|
252
|
+
use it and `created_by: flow` (flow-core §6.7 reads it), then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
253
253
|
the checks and the typical mistakes). A file with that name already there → never overwrite:
|
|
254
254
|
suffix the name and say so. **Save and use it** → also write `agents.<role>: <name>` to the
|
|
255
255
|
active overlay (a harness-owned agent name, flow-core §0). Then `status: "saved"`, with the path.
|
|
@@ -257,6 +257,31 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
257
257
|
close.
|
|
258
258
|
5. **One line on screen**: how many agents were saved and where.
|
|
259
259
|
|
|
260
|
+
## 5.2 What the agents missed (offer)
|
|
261
|
+
|
|
262
|
+
Read `meta.json.agent_lessons[]` (flow-core §6.7). `agents.learn: off`, or no entry with `status`
|
|
263
|
+
unset or `"later"` → skip this section and say nothing. Last of the three offers on purpose: the
|
|
264
|
+
MR/PR is open, the knowledge is saved, the specialists have their files — now the agents that
|
|
265
|
+
exist get what this work showed they lacked.
|
|
266
|
+
|
|
267
|
+
1. **Group by agent**, and resolve each agent's file (`~/.claude/agents`, the repo's agent folder,
|
|
268
|
+
the overlay's harness equivalent). Plugin- or marketplace-installed, a skill, or no file →
|
|
269
|
+
`status: "not-editable"` with which, and one line on screen; the lesson stays readable in
|
|
270
|
+
`meta.json`.
|
|
271
|
+
2. **Apply the size rules of §6.7 before asking** — drop what the file already says (and turn it
|
|
272
|
+
into the "promote to a check" option instead), consolidate when the section is at
|
|
273
|
+
`agents.lessons_max` — so the question shows the section as it would end up, not a line to append.
|
|
274
|
+
3. **One `AskUserQuestion`**, one entry per agent (at most 4, most lessons first): the agent, the
|
|
275
|
+
evidence in one line per lesson, and the resulting `## Lessons from past work` section. Options:
|
|
276
|
+
**Write it** · **No** · **Later**. Your agents are asked **in every mode**; agents with
|
|
277
|
+
`created_by: flow` are asked in `manual` and written directly in `guided`/`auto`.
|
|
278
|
+
4. **Write it** → back up the file (§6.7), replace only that section, record the path and the
|
|
279
|
+
backup in each entry, `status: "written"`. A file tracked by the repo is left modified in the
|
|
280
|
+
tree, uncommitted, and said so in one line: it is the team's file and the team's commit.
|
|
281
|
+
**No** → `"declined"`. **Later** → `"later"`, offered again by the re-run of this close or by
|
|
282
|
+
`$flow-work-respond`.
|
|
283
|
+
5. **One line on screen**: how many agents learned something, and where the backups are.
|
|
284
|
+
|
|
260
285
|
## 5.5 A worktree does not own the tree its tools wrote into
|
|
261
286
|
|
|
262
287
|
`meta.json.worktree` null → skip silently; there is nothing here that can go wrong.
|
|
@@ -142,6 +142,13 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
142
142
|
"useful": true | false | null,
|
|
143
143
|
"status": null | "saved" | "declined" | "later", "path": null }
|
|
144
144
|
],
|
|
145
|
+
"agent_lessons": [
|
|
146
|
+
{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human",
|
|
147
|
+
"phase": "review", "evidence": "finding or thread, one line, file:line or URL",
|
|
148
|
+
"lesson": "one imperative line, general, no ticket id",
|
|
149
|
+
"status": null | "written" | "declined" | "later" | "not-editable",
|
|
150
|
+
"path": null, "backup": null }
|
|
151
|
+
],
|
|
145
152
|
"origin": { "work": "{PREFIX}XXXXX", "followup": "F1" },
|
|
146
153
|
"started_at": "2026-05-11T10:00:00Z",
|
|
147
154
|
"updated_at": "2026-05-11T11:30:00Z",
|
|
@@ -159,6 +166,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
159
166
|
- **`defaults_used`**: an empty `FLOW.md` key a phase resolved with its default instead of asking — written in `guided`/`auto`, where asking would breach the never-a-question contract (flow-core §0). Not an error and not deferred work: a record, aggregated by `$flow-doctor` across every work including `_archive/`, so a key that keeps defaulting can be pinned once instead of decided every time. `[]` when nothing defaulted.
|
|
160
167
|
- **`conventions_candidates`**: rules the user taught **this repo's flow** while correcting a phase — *«not a listener, a message handler»*, *«the test command is `make test-unit`»*. Written by the phase that heard one, asking nothing, only when it would apply to an unrelated ticket in this repo; read by `review`'s idiom audit in the same work; offered once at `ship`'s Close (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace**), in every mode, because it edits a file in the tree. Never domain knowledge — that filter is unchanged. Shape and rules: flow-core §8. `[]` when the work taught nothing.
|
|
161
168
|
- **`specialists`**: agents a phase **created for this work** because nothing installed fit a role, under `agents.selection: open` (flow-core §6.6) — the brief it wrote and ran on `general-purpose`, and whether anything it returned was kept. Nothing is written to the harness's agent folders while the work runs; `$flow-feat-ship` §5.1 offers the useful ones for saving as real agents once the MR/PR is open and the knowledge is saved, and records where each went.
|
|
169
|
+
- **`agent_lessons`**: what an agent was shown to lack **by evidence from outside it** — a surviving finding in its category that it did not report, a finding in code it wrote, a human review thread in its category that ended in a change (flow-core §6.7). Written by `review` and `respond` asking nothing; offered for the agent's file by `$flow-feat-ship` §5.2 and at `respond`'s close, with a backup under `agent-backups/`, never on plugin-installed agents or skills.
|
|
162
170
|
- **`origin`**: set when this work *is* a follow-up someone accepted — which work raised it and which entry. Lets `start` carry the recorded "why" into `01-context.md` instead of re-deriving it, and lets that entry move to `done` when this work does. Absent for a work that came straight from a ticket.
|
|
163
171
|
- Ticket format follows `tracker.prefix`; empty → free-form.
|
|
164
172
|
|
|
@@ -165,12 +165,13 @@ After the push (or immediately, for reply-only threads), post the agreed respons
|
|
|
165
165
|
## 8. Log, loop, and domain knowledge
|
|
166
166
|
|
|
167
167
|
- **Artifact.** Append this round to `.claude/work/<TICKET>/08-feedback.md` (create it the first round). Per round: the date, and per thread — location, category, decision (reply-only / code-change / defer / held / handled-by-user), the reply posted, and the commit/edit if any. **For a `G` thread, the measurement table goes in whole** — variants, plans, timings, keys served, how the data set was built — plus what stayed unresolved. A later round reads it to avoid re-litigating settled threads.
|
|
168
|
+
- **What the panel missed.** Each thread this round that ended in a code change and falls in a category a `quality.reviewers` member or a named `agents.<role>` owns → one `meta.json.agent_lessons[]` row, `signal: "human"` (flow-core §6.7), when the lesson passes that section's test. A human had to catch what the agent is there to catch; that is the strongest evidence this flow ever gets that an agent needs a line.
|
|
168
169
|
- **Knowledge.** `knowledge.stage` is set and the debate produced a non-obvious "why" worth keeping (a reviewer-surfaced constraint, an integration gotcha, a decision that reversed the design) → `knowledge.stage` for this branch (silence by default; only on a clear signal). Consolidated at `knowledge.save` time.
|
|
169
170
|
- **Count the round in the artifact, not in your head.** Increment `respond_rounds` for this MR/PR in `meta.json` (its `mrs[]` entry; work-level when there are no `mrs`) in the same write that appends the round to `08-feedback.md` — the §1 ceiling is worth exactly as much as this counter. Lightweight mode: nothing to write, no ceiling to enforce; say so once and carry on.
|
|
170
171
|
- **Re-post the performance comment when this round changed a measured path.** A push that touches a query or an entry point already benchmarked (`$flow-feat-ship` §4.3) makes the standing comment wrong — and a wrong number is worse than none. Re-run those rows against the same base and post a new comment; never edit the old one. Nothing measured changed → post nothing.
|
|
171
172
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5). Not in lightweight mode.
|
|
172
173
|
- **A repeated answer spends the budget and buys nothing.** A reply this round that says what an earlier round said — same position, same reasoning, no new evidence → stop **now**, before the ceiling, and escalate that thread by name: your position, the reviewer's counter, the fact that neither has moved.
|
|
173
|
-
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `$flow-work-respond` picks up the next round. All threads answered and code pushed → summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `$flow-feat-ship §6` / `$flow-bug-ship` close applies (and `$flow-work-watch` for the post-deploy).
|
|
174
|
+
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `$flow-work-respond` picks up the next round. All threads answered and code pushed → **offer the agent lessons first** — `$flow-feat-ship §5.2`, in full and unchanged, over the rows still pending (this round's and any earlier ship left as `later`) — then summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `$flow-feat-ship §6` / `$flow-bug-ship` close applies (and `$flow-work-watch` for the post-deploy).
|
|
174
175
|
|
|
175
176
|
## Notes
|
|
176
177
|
|
package/adapters/gemini/CORE.md
CHANGED
|
@@ -16,7 +16,7 @@ Every `/flow:*` command assumes these rules. They are stated once, here, so a co
|
|
|
16
16
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
17
17
|
`flow-core`" means this file.
|
|
18
18
|
|
|
19
|
-
**This file belongs to flow `0.
|
|
19
|
+
**This file belongs to flow `0.79.0`.** Compare it once, at the start of the session, against
|
|
20
20
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
21
21
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
22
22
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -609,6 +609,69 @@ Record what you picked where a default would be recorded (§0): *"`agents.fronte
|
|
|
609
609
|
`react-expert` (installed)"*. That line is also the evidence for writing the role down when the
|
|
610
610
|
next stop offers it.
|
|
611
611
|
|
|
612
|
+
### 6.7 — An agent that missed something learns it, once
|
|
613
|
+
|
|
614
|
+
A reviewer that let a defect through will let the same one through next time: nothing it is given
|
|
615
|
+
changes between works. The fix is to its definition, and the evidence that it needs one arrives
|
|
616
|
+
here, in the flow, where somebody else caught what it did not. So a phase that holds that evidence
|
|
617
|
+
records it, and the work's close offers to write it into the agent.
|
|
618
|
+
|
|
619
|
+
**Only evidence from outside the agent counts.** An agent judging its own performance almost
|
|
620
|
+
always finds it good, and a lesson learned from that is a transient failure written down as a
|
|
621
|
+
permanent rule. Three signals, and nothing else:
|
|
622
|
+
|
|
623
|
+
- **Missed** — a finding that survived (§6 verification, or the user's acceptance) falls squarely in
|
|
624
|
+
the category a panel member or a named `agents.<role>` owns, and **that agent did not report it**
|
|
625
|
+
while another source did: the built-in review, another pass, a reinforcement, a human.
|
|
626
|
+
- **Produced** — a surviving finding sits in code a delegated agent wrote (a `build` piece, the
|
|
627
|
+
testing agent's suite): the lesson goes to the agent that wrote it.
|
|
628
|
+
- **Human caught** — a reviewer's thread in `/flow:work:respond` that ended in a code change, in a
|
|
629
|
+
category a panel member owns: the whole panel missed it, and the owner is the one to learn.
|
|
630
|
+
|
|
631
|
+
**The same test as a convention (§8), aimed at the agent.** Would this lesson help that agent on an
|
|
632
|
+
unrelated work in its domain? No → it belongs to this ticket, record nothing. Yes, but it is a fact
|
|
633
|
+
about the **repo** rather than the agent's craft (*"the test command is `make test-unit`"*) → it is a
|
|
634
|
+
`conventions_candidates[]` row, not a lesson. Yes, and it is about the craft (*"check that every
|
|
635
|
+
state change inside a loop is flushed once, not per iteration"*) → a lesson.
|
|
636
|
+
|
|
637
|
+
Record it in `meta.json.agent_lessons[]`, asking nothing:
|
|
638
|
+
|
|
639
|
+
`{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human", "phase":
|
|
640
|
+
"review", "evidence": "<finding or thread, one line, with file:line or URL>", "lesson": "<one
|
|
641
|
+
imperative line, general, no ticket id>", "status": null }`
|
|
642
|
+
|
|
643
|
+
**What is never edited**, and the lesson stays recorded in `meta.json` for you to read:
|
|
644
|
+
|
|
645
|
+
- an agent installed from a plugin or a marketplace — it is someone else's file, and the next
|
|
646
|
+
update would overwrite the edit anyway;
|
|
647
|
+
- a skill (`quality.review_skill`) — it orchestrates agents rather than being one;
|
|
648
|
+
- `general-purpose` and the improvised specialists of §6.6 that were not saved — no file to edit.
|
|
649
|
+
|
|
650
|
+
**Writing it — only at the work's close** (`/flow:feat:ship` §5.2, `/flow:work:respond` §8), with
|
|
651
|
+
`agents.learn` (empty → `offer`; `off` → nothing is recorded or offered):
|
|
652
|
+
|
|
653
|
+
- **Your agents** (written by hand, or shared through the repo) → shown as a diff and written only
|
|
654
|
+
on an explicit yes, **in every mode**: it is your configuration, and in the repo it is your team's.
|
|
655
|
+
- **Agents flow created** (§6.6 saved with `created_by: flow` in their frontmatter) → the same
|
|
656
|
+
question in `manual`; in `guided`/`auto` written directly and reported in one line.
|
|
657
|
+
|
|
658
|
+
**How it is kept small** — without this, the file grows one line per incident until the rules
|
|
659
|
+
nobody reads crowd out the ones that matter:
|
|
660
|
+
|
|
661
|
+
1. Lessons live in one section at the end of the file, `## Lessons from past work`, one line each.
|
|
662
|
+
The rest of the file is never rewritten.
|
|
663
|
+
2. **Already there, in any wording → the lesson is not added.** The agent had the rule and missed
|
|
664
|
+
anyway, which says the rule is weak, not absent: offer instead to move it out of the lessons
|
|
665
|
+
into the body of the brief, rewritten as a check the agent must perform.
|
|
666
|
+
3. **At `agents.lessons_max` lines (empty → 10), adding one means consolidating first**: merge
|
|
667
|
+
lines that say the same thing, generalise two narrow ones into the rule they share, drop one a
|
|
668
|
+
later lesson supersedes. Show the section before and after in the same question.
|
|
669
|
+
4. **Before any edit, copy the file** to `.claude/work/<work>/agent-backups/<name>.md` and record
|
|
670
|
+
the path in the lesson's entry. Undoing is copying it back. A file is never deleted.
|
|
671
|
+
|
|
672
|
+
Then `status`: `"written"` (with the path) · `"declined"` (never offered again) · `"later"` ·
|
|
673
|
+
`"not-editable"` (one of the three cases above, with which).
|
|
674
|
+
|
|
612
675
|
## 7. Deferred work — `followups[]`
|
|
613
676
|
|
|
614
677
|
Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
|
|
@@ -230,6 +230,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
|
|
|
230
230
|
- Without blockers: `phase = "review"`, add to `phases_done`. Suggest `/flow:bug:postmortem` (M/L) or `/flow:bug:ship` (XS/S).
|
|
231
231
|
- **Record *what* you reviewed, and separately what you changed after reading it** — `/flow:feat:review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `/flow:bug:ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
|
|
232
232
|
- **Record which pass found what** — `/flow:feat:review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow cost` reads them back per origin, and the retirement rule is the same: a pass with no exclusive surviving finding across twenty reviews comes out of the command.
|
|
233
|
+
- **Record what the agents missed** — `/flow:feat:review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
|
|
233
234
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
|
|
234
235
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
235
236
|
- Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
|
|
@@ -183,6 +183,7 @@ nothing was measured. A slowness bug is the case where this comment *is* the pro
|
|
|
183
183
|
- **Cross-repo contract handoff**: for each such entry with `contract_handoff: "pending"` — the fix changed a surface that sibling consumes — hand the new shape over as `/flow:feat:ship` §6.3 (publish the **literal** shape to the tracker ticket, mandatory preview in every autonomy mode, then record `published → <location>`; versioned-file fallback when there is no tracker). A bug flow has no §"External contracts": take the literal from the fix itself — the actual key, code, route or event the code now emits — read it off the code, never from memory.
|
|
184
184
|
- **Follow-up triage — `/flow:feat:ship` §6.4, in full and unchanged.** Read `meta.json.followups[]`; nothing `proposed` → skip silently. Otherwise §6.4 step 0 first — **3 or more candidates go to a skeptic** whose job is to refute that each deserves a ticket, and only the strongest `tracker.followup_ask_max` (empty → **2**) reach the user (flow-core §7) — then one batched `AskUserQuestion` (**Do it** / **Not worth it** / **Later**; `decision` entries asked as their question, `tooling` and everything `log`ged never asked), the accepted ones get their tracker issue created (outward-facing → **asks in every mode**), the logged ones nothing but `status: "logged"` in `meta.json`, then one offer to start the first. A bug flow is where the gate earns its keep: the prevention actions `/flow:bug:postmortem` wrote, the neighbouring bugs `/flow:bug:validate` found and the similar-risk patterns `/flow:bug:fix` flagged all land here — half a dozen of them, from one fix, and «similar risk elsewhere» that no skeptic ever read is exactly the entry that turns a closed bug into six open questions. Repeat for anything still `proposed` on the re-run that confirms the merge.
|
|
185
185
|
- **Specialists created — `/flow:feat:ship` §5.1, in full and unchanged.** Read `meta.json.specialists[]` (flow-core §6.6); nothing `useful` and pending → skip silently. Otherwise one batched offer to save each as an agent, after the MR/PR and after the knowledge `/flow:bug:postmortem` §4 already consolidated — asked in every mode, never overwriting an agent that exists.
|
|
186
|
+
- **What the agents missed — `/flow:feat:ship` §5.2, in full and unchanged.** Read `meta.json.agent_lessons[]` (flow-core §6.7); `agents.learn: off` or nothing pending → skip silently. Otherwise one question per agent with the resulting lessons section, backup first, your agents asked in every mode.
|
|
186
187
|
- **Conventions learned — `/flow:feat:ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
|
|
187
188
|
- **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
|
|
188
189
|
- **Only once `phase` is `done`**: delete the candidate anchor `/flow:bug:review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run.
|
|
@@ -382,7 +382,8 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
382
382
|
**The retirement rule, written down before the data arrives** so it cannot be argued backwards later: a pass that contributes **no exclusive surviving finding across twenty reviews** is removed from this command. Zero is zero, and the decision is made against the number rather than against whoever is most attached to the pass.
|
|
383
383
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
|
|
384
384
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
385
|
-
- **
|
|
385
|
+
- **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
|
|
386
|
+
- **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
|
|
386
387
|
- Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
|
|
387
388
|
- **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `/flow:feat:validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow:feat:validate` automatically** in this same turn. Never chain into `/flow:feat:ship` from here — ship is reached through `validate`.
|
|
388
389
|
"""
|
|
@@ -244,8 +244,8 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
244
244
|
3. **Asked in every mode**, `auto` included: it writes to your agent configuration, outside the
|
|
245
245
|
tree, and that is never flow mechanics.
|
|
246
246
|
4. **Save** → write the agent where and in the format your harness reads agents from (on Claude
|
|
247
|
-
Code, `~/.claude/agents/<name>.md`: frontmatter `name
|
|
248
|
-
use it, then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
247
|
+
Code, `~/.claude/agents/<name>.md`: frontmatter `name`, a one-line `description` of when to
|
|
248
|
+
use it and `created_by: flow` (flow-core §6.7 reads it), then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
249
249
|
the checks and the typical mistakes). A file with that name already there → never overwrite:
|
|
250
250
|
suffix the name and say so. **Save and use it** → also write `agents.<role>: <name>` to the
|
|
251
251
|
active overlay (a harness-owned agent name, flow-core §0). Then `status: "saved"`, with the path.
|
|
@@ -253,6 +253,31 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
253
253
|
close.
|
|
254
254
|
5. **One line on screen**: how many agents were saved and where.
|
|
255
255
|
|
|
256
|
+
## 5.2 What the agents missed (offer)
|
|
257
|
+
|
|
258
|
+
Read `meta.json.agent_lessons[]` (flow-core §6.7). `agents.learn: off`, or no entry with `status`
|
|
259
|
+
unset or `"later"` → skip this section and say nothing. Last of the three offers on purpose: the
|
|
260
|
+
MR/PR is open, the knowledge is saved, the specialists have their files — now the agents that
|
|
261
|
+
exist get what this work showed they lacked.
|
|
262
|
+
|
|
263
|
+
1. **Group by agent**, and resolve each agent's file (`~/.claude/agents`, the repo's agent folder,
|
|
264
|
+
the overlay's harness equivalent). Plugin- or marketplace-installed, a skill, or no file →
|
|
265
|
+
`status: "not-editable"` with which, and one line on screen; the lesson stays readable in
|
|
266
|
+
`meta.json`.
|
|
267
|
+
2. **Apply the size rules of §6.7 before asking** — drop what the file already says (and turn it
|
|
268
|
+
into the "promote to a check" option instead), consolidate when the section is at
|
|
269
|
+
`agents.lessons_max` — so the question shows the section as it would end up, not a line to append.
|
|
270
|
+
3. **One `AskUserQuestion`**, one entry per agent (at most 4, most lessons first): the agent, the
|
|
271
|
+
evidence in one line per lesson, and the resulting `## Lessons from past work` section. Options:
|
|
272
|
+
**Write it** · **No** · **Later**. Your agents are asked **in every mode**; agents with
|
|
273
|
+
`created_by: flow` are asked in `manual` and written directly in `guided`/`auto`.
|
|
274
|
+
4. **Write it** → back up the file (§6.7), replace only that section, record the path and the
|
|
275
|
+
backup in each entry, `status: "written"`. A file tracked by the repo is left modified in the
|
|
276
|
+
tree, uncommitted, and said so in one line: it is the team's file and the team's commit.
|
|
277
|
+
**No** → `"declined"`. **Later** → `"later"`, offered again by the re-run of this close or by
|
|
278
|
+
`/flow:work:respond`.
|
|
279
|
+
5. **One line on screen**: how many agents learned something, and where the backups are.
|
|
280
|
+
|
|
256
281
|
## 5.5 A worktree does not own the tree its tools wrote into
|
|
257
282
|
|
|
258
283
|
`meta.json.worktree` null → skip silently; there is nothing here that can go wrong.
|
|
@@ -138,6 +138,13 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
138
138
|
"useful": true | false | null,
|
|
139
139
|
"status": null | "saved" | "declined" | "later", "path": null }
|
|
140
140
|
],
|
|
141
|
+
"agent_lessons": [
|
|
142
|
+
{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human",
|
|
143
|
+
"phase": "review", "evidence": "finding or thread, one line, file:line or URL",
|
|
144
|
+
"lesson": "one imperative line, general, no ticket id",
|
|
145
|
+
"status": null | "written" | "declined" | "later" | "not-editable",
|
|
146
|
+
"path": null, "backup": null }
|
|
147
|
+
],
|
|
141
148
|
"origin": { "work": "{PREFIX}XXXXX", "followup": "F1" },
|
|
142
149
|
"started_at": "2026-05-11T10:00:00Z",
|
|
143
150
|
"updated_at": "2026-05-11T11:30:00Z",
|
|
@@ -155,6 +162,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
155
162
|
- **`defaults_used`**: an empty `FLOW.md` key a phase resolved with its default instead of asking — written in `guided`/`auto`, where asking would breach the never-a-question contract (flow-core §0). Not an error and not deferred work: a record, aggregated by `/flow:doctor` across every work including `_archive/`, so a key that keeps defaulting can be pinned once instead of decided every time. `[]` when nothing defaulted.
|
|
156
163
|
- **`conventions_candidates`**: rules the user taught **this repo's flow** while correcting a phase — *«not a listener, a message handler»*, *«the test command is `make test-unit`»*. Written by the phase that heard one, asking nothing, only when it would apply to an unrelated ticket in this repo; read by `review`'s idiom audit in the same work; offered once at `ship`'s Close (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace**), in every mode, because it edits a file in the tree. Never domain knowledge — that filter is unchanged. Shape and rules: flow-core §8. `[]` when the work taught nothing.
|
|
157
164
|
- **`specialists`**: agents a phase **created for this work** because nothing installed fit a role, under `agents.selection: open` (flow-core §6.6) — the brief it wrote and ran on `general-purpose`, and whether anything it returned was kept. Nothing is written to the harness's agent folders while the work runs; `/flow:feat:ship` §5.1 offers the useful ones for saving as real agents once the MR/PR is open and the knowledge is saved, and records where each went.
|
|
165
|
+
- **`agent_lessons`**: what an agent was shown to lack **by evidence from outside it** — a surviving finding in its category that it did not report, a finding in code it wrote, a human review thread in its category that ended in a change (flow-core §6.7). Written by `review` and `respond` asking nothing; offered for the agent's file by `/flow:feat:ship` §5.2 and at `respond`'s close, with a backup under `agent-backups/`, never on plugin-installed agents or skills.
|
|
158
166
|
- **`origin`**: set when this work *is* a follow-up someone accepted — which work raised it and which entry. Lets `start` carry the recorded "why" into `01-context.md` instead of re-deriving it, and lets that entry move to `done` when this work does. Absent for a work that came straight from a ticket.
|
|
159
167
|
- Ticket format follows `tracker.prefix`; empty → free-form.
|
|
160
168
|
|
|
@@ -161,12 +161,13 @@ After the push (or immediately, for reply-only threads), post the agreed respons
|
|
|
161
161
|
## 8. Log, loop, and domain knowledge
|
|
162
162
|
|
|
163
163
|
- **Artifact.** Append this round to `.claude/work/<TICKET>/08-feedback.md` (create it the first round). Per round: the date, and per thread — location, category, decision (reply-only / code-change / defer / held / handled-by-user), the reply posted, and the commit/edit if any. **For a `G` thread, the measurement table goes in whole** — variants, plans, timings, keys served, how the data set was built — plus what stayed unresolved. A later round reads it to avoid re-litigating settled threads.
|
|
164
|
+
- **What the panel missed.** Each thread this round that ended in a code change and falls in a category a `quality.reviewers` member or a named `agents.<role>` owns → one `meta.json.agent_lessons[]` row, `signal: "human"` (flow-core §6.7), when the lesson passes that section's test. A human had to catch what the agent is there to catch; that is the strongest evidence this flow ever gets that an agent needs a line.
|
|
164
165
|
- **Knowledge.** `knowledge.stage` is set and the debate produced a non-obvious "why" worth keeping (a reviewer-surfaced constraint, an integration gotcha, a decision that reversed the design) → `knowledge.stage` for this branch (silence by default; only on a clear signal). Consolidated at `knowledge.save` time.
|
|
165
166
|
- **Count the round in the artifact, not in your head.** Increment `respond_rounds` for this MR/PR in `meta.json` (its `mrs[]` entry; work-level when there are no `mrs`) in the same write that appends the round to `08-feedback.md` — the §1 ceiling is worth exactly as much as this counter. Lightweight mode: nothing to write, no ceiling to enforce; say so once and carry on.
|
|
166
167
|
- **Re-post the performance comment when this round changed a measured path.** A push that touches a query or an entry point already benchmarked (`/flow:feat:ship` §4.3) makes the standing comment wrong — and a wrong number is worse than none. Re-run those rows against the same base and post a new comment; never edit the old one. Nothing measured changed → post nothing.
|
|
167
168
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5). Not in lightweight mode.
|
|
168
169
|
- **A repeated answer spends the budget and buys nothing.** A reply this round that says what an earlier round said — same position, same reasoning, no new evidence → stop **now**, before the ceiling, and escalate that thread by name: your position, the reviewer's counter, the fact that neither has moved.
|
|
169
|
-
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow:work:respond` picks up the next round. All threads answered and code pushed → summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow:feat:ship §6` / `/flow:bug:ship` close applies (and `/flow:work:watch` for the post-deploy).
|
|
170
|
+
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow:work:respond` picks up the next round. All threads answered and code pushed → **offer the agent lessons first** — `/flow:feat:ship §5.2`, in full and unchanged, over the rows still pending (this round's and any earlier ship left as `later`) — then summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow:feat:ship §6` / `/flow:bug:ship` close applies (and `/flow:work:watch` for the post-deploy).
|
|
170
171
|
|
|
171
172
|
## Notes
|
|
172
173
|
|
package/adapters/hermes/CORE.md
CHANGED
|
@@ -17,7 +17,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
17
17
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
18
18
|
`flow-core`" means this file.
|
|
19
19
|
|
|
20
|
-
**This file belongs to flow `0.
|
|
20
|
+
**This file belongs to flow `0.79.0`.** Compare it once, at the start of the session, against
|
|
21
21
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
22
22
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
23
23
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -610,6 +610,69 @@ Record what you picked where a default would be recorded (§0): *"`agents.fronte
|
|
|
610
610
|
`react-expert` (installed)"*. That line is also the evidence for writing the role down when the
|
|
611
611
|
next stop offers it.
|
|
612
612
|
|
|
613
|
+
### 6.7 — An agent that missed something learns it, once
|
|
614
|
+
|
|
615
|
+
A reviewer that let a defect through will let the same one through next time: nothing it is given
|
|
616
|
+
changes between works. The fix is to its definition, and the evidence that it needs one arrives
|
|
617
|
+
here, in the flow, where somebody else caught what it did not. So a phase that holds that evidence
|
|
618
|
+
records it, and the work's close offers to write it into the agent.
|
|
619
|
+
|
|
620
|
+
**Only evidence from outside the agent counts.** An agent judging its own performance almost
|
|
621
|
+
always finds it good, and a lesson learned from that is a transient failure written down as a
|
|
622
|
+
permanent rule. Three signals, and nothing else:
|
|
623
|
+
|
|
624
|
+
- **Missed** — a finding that survived (§6 verification, or the user's acceptance) falls squarely in
|
|
625
|
+
the category a panel member or a named `agents.<role>` owns, and **that agent did not report it**
|
|
626
|
+
while another source did: the built-in review, another pass, a reinforcement, a human.
|
|
627
|
+
- **Produced** — a surviving finding sits in code a delegated agent wrote (a `build` piece, the
|
|
628
|
+
testing agent's suite): the lesson goes to the agent that wrote it.
|
|
629
|
+
- **Human caught** — a reviewer's thread in `/flow-work-respond` that ended in a code change, in a
|
|
630
|
+
category a panel member owns: the whole panel missed it, and the owner is the one to learn.
|
|
631
|
+
|
|
632
|
+
**The same test as a convention (§8), aimed at the agent.** Would this lesson help that agent on an
|
|
633
|
+
unrelated work in its domain? No → it belongs to this ticket, record nothing. Yes, but it is a fact
|
|
634
|
+
about the **repo** rather than the agent's craft (*"the test command is `make test-unit`"*) → it is a
|
|
635
|
+
`conventions_candidates[]` row, not a lesson. Yes, and it is about the craft (*"check that every
|
|
636
|
+
state change inside a loop is flushed once, not per iteration"*) → a lesson.
|
|
637
|
+
|
|
638
|
+
Record it in `meta.json.agent_lessons[]`, asking nothing:
|
|
639
|
+
|
|
640
|
+
`{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human", "phase":
|
|
641
|
+
"review", "evidence": "<finding or thread, one line, with file:line or URL>", "lesson": "<one
|
|
642
|
+
imperative line, general, no ticket id>", "status": null }`
|
|
643
|
+
|
|
644
|
+
**What is never edited**, and the lesson stays recorded in `meta.json` for you to read:
|
|
645
|
+
|
|
646
|
+
- an agent installed from a plugin or a marketplace — it is someone else's file, and the next
|
|
647
|
+
update would overwrite the edit anyway;
|
|
648
|
+
- a skill (`quality.review_skill`) — it orchestrates agents rather than being one;
|
|
649
|
+
- `general-purpose` and the improvised specialists of §6.6 that were not saved — no file to edit.
|
|
650
|
+
|
|
651
|
+
**Writing it — only at the work's close** (`/flow-feat-ship` §5.2, `/flow-work-respond` §8), with
|
|
652
|
+
`agents.learn` (empty → `offer`; `off` → nothing is recorded or offered):
|
|
653
|
+
|
|
654
|
+
- **Your agents** (written by hand, or shared through the repo) → shown as a diff and written only
|
|
655
|
+
on an explicit yes, **in every mode**: it is your configuration, and in the repo it is your team's.
|
|
656
|
+
- **Agents flow created** (§6.6 saved with `created_by: flow` in their frontmatter) → the same
|
|
657
|
+
question in `manual`; in `guided`/`auto` written directly and reported in one line.
|
|
658
|
+
|
|
659
|
+
**How it is kept small** — without this, the file grows one line per incident until the rules
|
|
660
|
+
nobody reads crowd out the ones that matter:
|
|
661
|
+
|
|
662
|
+
1. Lessons live in one section at the end of the file, `## Lessons from past work`, one line each.
|
|
663
|
+
The rest of the file is never rewritten.
|
|
664
|
+
2. **Already there, in any wording → the lesson is not added.** The agent had the rule and missed
|
|
665
|
+
anyway, which says the rule is weak, not absent: offer instead to move it out of the lessons
|
|
666
|
+
into the body of the brief, rewritten as a check the agent must perform.
|
|
667
|
+
3. **At `agents.lessons_max` lines (empty → 10), adding one means consolidating first**: merge
|
|
668
|
+
lines that say the same thing, generalise two narrow ones into the rule they share, drop one a
|
|
669
|
+
later lesson supersedes. Show the section before and after in the same question.
|
|
670
|
+
4. **Before any edit, copy the file** to `.claude/work/<work>/agent-backups/<name>.md` and record
|
|
671
|
+
the path in the lesson's entry. Undoing is copying it back. A file is never deleted.
|
|
672
|
+
|
|
673
|
+
Then `status`: `"written"` (with the path) · `"declined"` (never offered again) · `"later"` ·
|
|
674
|
+
`"not-editable"` (one of the three cases above, with which).
|
|
675
|
+
|
|
613
676
|
## 7. Deferred work — `followups[]`
|
|
614
677
|
|
|
615
678
|
Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
|
|
@@ -234,6 +234,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
|
|
|
234
234
|
- Without blockers: `phase = "review"`, add to `phases_done`. Suggest `/flow-bug-postmortem` (M/L) or `/flow-bug-ship` (XS/S).
|
|
235
235
|
- **Record *what* you reviewed, and separately what you changed after reading it** — `/flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `/flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
|
|
236
236
|
- **Record which pass found what** — `/flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow cost` reads them back per origin, and the retirement rule is the same: a pass with no exclusive surviving finding across twenty reviews comes out of the command.
|
|
237
|
+
- **Record what the agents missed** — `/flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
|
|
237
238
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
|
|
238
239
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
239
240
|
- Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
|
|
@@ -187,6 +187,7 @@ nothing was measured. A slowness bug is the case where this comment *is* the pro
|
|
|
187
187
|
- **Cross-repo contract handoff**: for each such entry with `contract_handoff: "pending"` — the fix changed a surface that sibling consumes — hand the new shape over as `/flow-feat-ship` §6.3 (publish the **literal** shape to the tracker ticket, mandatory preview in every autonomy mode, then record `published → <location>`; versioned-file fallback when there is no tracker). A bug flow has no §"External contracts": take the literal from the fix itself — the actual key, code, route or event the code now emits — read it off the code, never from memory.
|
|
188
188
|
- **Follow-up triage — `/flow-feat-ship` §6.4, in full and unchanged.** Read `meta.json.followups[]`; nothing `proposed` → skip silently. Otherwise §6.4 step 0 first — **3 or more candidates go to a skeptic** whose job is to refute that each deserves a ticket, and only the strongest `tracker.followup_ask_max` (empty → **2**) reach the user (flow-core §7) — then one batched `AskUserQuestion` (**Do it** / **Not worth it** / **Later**; `decision` entries asked as their question, `tooling` and everything `log`ged never asked), the accepted ones get their tracker issue created (outward-facing → **asks in every mode**), the logged ones nothing but `status: "logged"` in `meta.json`, then one offer to start the first. A bug flow is where the gate earns its keep: the prevention actions `/flow-bug-postmortem` wrote, the neighbouring bugs `/flow-bug-validate` found and the similar-risk patterns `/flow-bug-fix` flagged all land here — half a dozen of them, from one fix, and «similar risk elsewhere» that no skeptic ever read is exactly the entry that turns a closed bug into six open questions. Repeat for anything still `proposed` on the re-run that confirms the merge.
|
|
189
189
|
- **Specialists created — `/flow-feat-ship` §5.1, in full and unchanged.** Read `meta.json.specialists[]` (flow-core §6.6); nothing `useful` and pending → skip silently. Otherwise one batched offer to save each as an agent, after the MR/PR and after the knowledge `/flow-bug-postmortem` §4 already consolidated — asked in every mode, never overwriting an agent that exists.
|
|
190
|
+
- **What the agents missed — `/flow-feat-ship` §5.2, in full and unchanged.** Read `meta.json.agent_lessons[]` (flow-core §6.7); `agents.learn: off` or nothing pending → skip silently. Otherwise one question per agent with the resulting lessons section, backup first, your agents asked in every mode.
|
|
190
191
|
- **Conventions learned — `/flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
|
|
191
192
|
- **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
|
|
192
193
|
- **Only once `phase` is `done`**: delete the candidate anchor `/flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run.
|
|
@@ -386,6 +386,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
386
386
|
**The retirement rule, written down before the data arrives** so it cannot be argued backwards later: a pass that contributes **no exclusive surviving finding across twenty reviews** is removed from this command. Zero is zero, and the decision is made against the number rather than against whoever is most attached to the pass.
|
|
387
387
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
|
|
388
388
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
389
|
-
- **
|
|
389
|
+
- **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
|
|
390
|
+
- **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
|
|
390
391
|
- Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
|
|
391
392
|
- **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `/flow-feat-validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow-feat-validate` automatically** in this same turn. Never chain into `/flow-feat-ship` from here — ship is reached through `validate`.
|
|
@@ -248,8 +248,8 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
248
248
|
3. **Asked in every mode**, `auto` included: it writes to your agent configuration, outside the
|
|
249
249
|
tree, and that is never flow mechanics.
|
|
250
250
|
4. **Save** → write the agent where and in the format your harness reads agents from (on Claude
|
|
251
|
-
Code, `~/.claude/agents/<name>.md`: frontmatter `name
|
|
252
|
-
use it, then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
251
|
+
Code, `~/.claude/agents/<name>.md`: frontmatter `name`, a one-line `description` of when to
|
|
252
|
+
use it and `created_by: flow` (flow-core §6.7 reads it), then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
253
253
|
the checks and the typical mistakes). A file with that name already there → never overwrite:
|
|
254
254
|
suffix the name and say so. **Save and use it** → also write `agents.<role>: <name>` to the
|
|
255
255
|
active overlay (a harness-owned agent name, flow-core §0). Then `status: "saved"`, with the path.
|
|
@@ -257,6 +257,31 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
257
257
|
close.
|
|
258
258
|
5. **One line on screen**: how many agents were saved and where.
|
|
259
259
|
|
|
260
|
+
## 5.2 What the agents missed (offer)
|
|
261
|
+
|
|
262
|
+
Read `meta.json.agent_lessons[]` (flow-core §6.7). `agents.learn: off`, or no entry with `status`
|
|
263
|
+
unset or `"later"` → skip this section and say nothing. Last of the three offers on purpose: the
|
|
264
|
+
MR/PR is open, the knowledge is saved, the specialists have their files — now the agents that
|
|
265
|
+
exist get what this work showed they lacked.
|
|
266
|
+
|
|
267
|
+
1. **Group by agent**, and resolve each agent's file (`~/.claude/agents`, the repo's agent folder,
|
|
268
|
+
the overlay's harness equivalent). Plugin- or marketplace-installed, a skill, or no file →
|
|
269
|
+
`status: "not-editable"` with which, and one line on screen; the lesson stays readable in
|
|
270
|
+
`meta.json`.
|
|
271
|
+
2. **Apply the size rules of §6.7 before asking** — drop what the file already says (and turn it
|
|
272
|
+
into the "promote to a check" option instead), consolidate when the section is at
|
|
273
|
+
`agents.lessons_max` — so the question shows the section as it would end up, not a line to append.
|
|
274
|
+
3. **One `AskUserQuestion`**, one entry per agent (at most 4, most lessons first): the agent, the
|
|
275
|
+
evidence in one line per lesson, and the resulting `## Lessons from past work` section. Options:
|
|
276
|
+
**Write it** · **No** · **Later**. Your agents are asked **in every mode**; agents with
|
|
277
|
+
`created_by: flow` are asked in `manual` and written directly in `guided`/`auto`.
|
|
278
|
+
4. **Write it** → back up the file (§6.7), replace only that section, record the path and the
|
|
279
|
+
backup in each entry, `status: "written"`. A file tracked by the repo is left modified in the
|
|
280
|
+
tree, uncommitted, and said so in one line: it is the team's file and the team's commit.
|
|
281
|
+
**No** → `"declined"`. **Later** → `"later"`, offered again by the re-run of this close or by
|
|
282
|
+
`/flow-work-respond`.
|
|
283
|
+
5. **One line on screen**: how many agents learned something, and where the backups are.
|
|
284
|
+
|
|
260
285
|
## 5.5 A worktree does not own the tree its tools wrote into
|
|
261
286
|
|
|
262
287
|
`meta.json.worktree` null → skip silently; there is nothing here that can go wrong.
|
|
@@ -142,6 +142,13 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
142
142
|
"useful": true | false | null,
|
|
143
143
|
"status": null | "saved" | "declined" | "later", "path": null }
|
|
144
144
|
],
|
|
145
|
+
"agent_lessons": [
|
|
146
|
+
{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human",
|
|
147
|
+
"phase": "review", "evidence": "finding or thread, one line, file:line or URL",
|
|
148
|
+
"lesson": "one imperative line, general, no ticket id",
|
|
149
|
+
"status": null | "written" | "declined" | "later" | "not-editable",
|
|
150
|
+
"path": null, "backup": null }
|
|
151
|
+
],
|
|
145
152
|
"origin": { "work": "{PREFIX}XXXXX", "followup": "F1" },
|
|
146
153
|
"started_at": "2026-05-11T10:00:00Z",
|
|
147
154
|
"updated_at": "2026-05-11T11:30:00Z",
|
|
@@ -159,6 +166,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
159
166
|
- **`defaults_used`**: an empty `FLOW.md` key a phase resolved with its default instead of asking — written in `guided`/`auto`, where asking would breach the never-a-question contract (flow-core §0). Not an error and not deferred work: a record, aggregated by `/flow-doctor` across every work including `_archive/`, so a key that keeps defaulting can be pinned once instead of decided every time. `[]` when nothing defaulted.
|
|
160
167
|
- **`conventions_candidates`**: rules the user taught **this repo's flow** while correcting a phase — *«not a listener, a message handler»*, *«the test command is `make test-unit`»*. Written by the phase that heard one, asking nothing, only when it would apply to an unrelated ticket in this repo; read by `review`'s idiom audit in the same work; offered once at `ship`'s Close (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace**), in every mode, because it edits a file in the tree. Never domain knowledge — that filter is unchanged. Shape and rules: flow-core §8. `[]` when the work taught nothing.
|
|
161
168
|
- **`specialists`**: agents a phase **created for this work** because nothing installed fit a role, under `agents.selection: open` (flow-core §6.6) — the brief it wrote and ran on `general-purpose`, and whether anything it returned was kept. Nothing is written to the harness's agent folders while the work runs; `/flow-feat-ship` §5.1 offers the useful ones for saving as real agents once the MR/PR is open and the knowledge is saved, and records where each went.
|
|
169
|
+
- **`agent_lessons`**: what an agent was shown to lack **by evidence from outside it** — a surviving finding in its category that it did not report, a finding in code it wrote, a human review thread in its category that ended in a change (flow-core §6.7). Written by `review` and `respond` asking nothing; offered for the agent's file by `/flow-feat-ship` §5.2 and at `respond`'s close, with a backup under `agent-backups/`, never on plugin-installed agents or skills.
|
|
162
170
|
- **`origin`**: set when this work *is* a follow-up someone accepted — which work raised it and which entry. Lets `start` carry the recorded "why" into `01-context.md` instead of re-deriving it, and lets that entry move to `done` when this work does. Absent for a work that came straight from a ticket.
|
|
163
171
|
- Ticket format follows `tracker.prefix`; empty → free-form.
|
|
164
172
|
|
|
@@ -165,12 +165,13 @@ After the push (or immediately, for reply-only threads), post the agreed respons
|
|
|
165
165
|
## 8. Log, loop, and domain knowledge
|
|
166
166
|
|
|
167
167
|
- **Artifact.** Append this round to `.claude/work/<TICKET>/08-feedback.md` (create it the first round). Per round: the date, and per thread — location, category, decision (reply-only / code-change / defer / held / handled-by-user), the reply posted, and the commit/edit if any. **For a `G` thread, the measurement table goes in whole** — variants, plans, timings, keys served, how the data set was built — plus what stayed unresolved. A later round reads it to avoid re-litigating settled threads.
|
|
168
|
+
- **What the panel missed.** Each thread this round that ended in a code change and falls in a category a `quality.reviewers` member or a named `agents.<role>` owns → one `meta.json.agent_lessons[]` row, `signal: "human"` (flow-core §6.7), when the lesson passes that section's test. A human had to catch what the agent is there to catch; that is the strongest evidence this flow ever gets that an agent needs a line.
|
|
168
169
|
- **Knowledge.** `knowledge.stage` is set and the debate produced a non-obvious "why" worth keeping (a reviewer-surfaced constraint, an integration gotcha, a decision that reversed the design) → `knowledge.stage` for this branch (silence by default; only on a clear signal). Consolidated at `knowledge.save` time.
|
|
169
170
|
- **Count the round in the artifact, not in your head.** Increment `respond_rounds` for this MR/PR in `meta.json` (its `mrs[]` entry; work-level when there are no `mrs`) in the same write that appends the round to `08-feedback.md` — the §1 ceiling is worth exactly as much as this counter. Lightweight mode: nothing to write, no ceiling to enforce; say so once and carry on.
|
|
170
171
|
- **Re-post the performance comment when this round changed a measured path.** A push that touches a query or an entry point already benchmarked (`/flow-feat-ship` §4.3) makes the standing comment wrong — and a wrong number is worse than none. Re-run those rows against the same base and post a new comment; never edit the old one. Nothing measured changed → post nothing.
|
|
171
172
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5). Not in lightweight mode.
|
|
172
173
|
- **A repeated answer spends the budget and buys nothing.** A reply this round that says what an earlier round said — same position, same reasoning, no new evidence → stop **now**, before the ceiling, and escalate that thread by name: your position, the reviewer's counter, the fact that neither has moved.
|
|
173
|
-
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow-work-respond` picks up the next round. All threads answered and code pushed → summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow-feat-ship §6` / `/flow-bug-ship` close applies (and `/flow-work-watch` for the post-deploy).
|
|
174
|
+
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow-work-respond` picks up the next round. All threads answered and code pushed → **offer the agent lessons first** — `/flow-feat-ship §5.2`, in full and unchanged, over the rows still pending (this round's and any earlier ship left as `later`) — then summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow-feat-ship §6` / `/flow-bug-ship` close applies (and `/flow-work-watch` for the post-deploy).
|
|
174
175
|
|
|
175
176
|
## Notes
|
|
176
177
|
|
|
@@ -16,7 +16,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
16
16
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
17
17
|
`flow-core`" means this file.
|
|
18
18
|
|
|
19
|
-
**This file belongs to flow `0.
|
|
19
|
+
**This file belongs to flow `0.79.0`.** Compare it once, at the start of the session, against
|
|
20
20
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
21
21
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
22
22
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -609,6 +609,69 @@ Record what you picked where a default would be recorded (§0): *"`agents.fronte
|
|
|
609
609
|
`react-expert` (installed)"*. That line is also the evidence for writing the role down when the
|
|
610
610
|
next stop offers it.
|
|
611
611
|
|
|
612
|
+
### 6.7 — An agent that missed something learns it, once
|
|
613
|
+
|
|
614
|
+
A reviewer that let a defect through will let the same one through next time: nothing it is given
|
|
615
|
+
changes between works. The fix is to its definition, and the evidence that it needs one arrives
|
|
616
|
+
here, in the flow, where somebody else caught what it did not. So a phase that holds that evidence
|
|
617
|
+
records it, and the work's close offers to write it into the agent.
|
|
618
|
+
|
|
619
|
+
**Only evidence from outside the agent counts.** An agent judging its own performance almost
|
|
620
|
+
always finds it good, and a lesson learned from that is a transient failure written down as a
|
|
621
|
+
permanent rule. Three signals, and nothing else:
|
|
622
|
+
|
|
623
|
+
- **Missed** — a finding that survived (§6 verification, or the user's acceptance) falls squarely in
|
|
624
|
+
the category a panel member or a named `agents.<role>` owns, and **that agent did not report it**
|
|
625
|
+
while another source did: the built-in review, another pass, a reinforcement, a human.
|
|
626
|
+
- **Produced** — a surviving finding sits in code a delegated agent wrote (a `build` piece, the
|
|
627
|
+
testing agent's suite): the lesson goes to the agent that wrote it.
|
|
628
|
+
- **Human caught** — a reviewer's thread in `/flow-work-respond` that ended in a code change, in a
|
|
629
|
+
category a panel member owns: the whole panel missed it, and the owner is the one to learn.
|
|
630
|
+
|
|
631
|
+
**The same test as a convention (§8), aimed at the agent.** Would this lesson help that agent on an
|
|
632
|
+
unrelated work in its domain? No → it belongs to this ticket, record nothing. Yes, but it is a fact
|
|
633
|
+
about the **repo** rather than the agent's craft (*"the test command is `make test-unit`"*) → it is a
|
|
634
|
+
`conventions_candidates[]` row, not a lesson. Yes, and it is about the craft (*"check that every
|
|
635
|
+
state change inside a loop is flushed once, not per iteration"*) → a lesson.
|
|
636
|
+
|
|
637
|
+
Record it in `meta.json.agent_lessons[]`, asking nothing:
|
|
638
|
+
|
|
639
|
+
`{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human", "phase":
|
|
640
|
+
"review", "evidence": "<finding or thread, one line, with file:line or URL>", "lesson": "<one
|
|
641
|
+
imperative line, general, no ticket id>", "status": null }`
|
|
642
|
+
|
|
643
|
+
**What is never edited**, and the lesson stays recorded in `meta.json` for you to read:
|
|
644
|
+
|
|
645
|
+
- an agent installed from a plugin or a marketplace — it is someone else's file, and the next
|
|
646
|
+
update would overwrite the edit anyway;
|
|
647
|
+
- a skill (`quality.review_skill`) — it orchestrates agents rather than being one;
|
|
648
|
+
- `general-purpose` and the improvised specialists of §6.6 that were not saved — no file to edit.
|
|
649
|
+
|
|
650
|
+
**Writing it — only at the work's close** (`/flow-feat-ship` §5.2, `/flow-work-respond` §8), with
|
|
651
|
+
`agents.learn` (empty → `offer`; `off` → nothing is recorded or offered):
|
|
652
|
+
|
|
653
|
+
- **Your agents** (written by hand, or shared through the repo) → shown as a diff and written only
|
|
654
|
+
on an explicit yes, **in every mode**: it is your configuration, and in the repo it is your team's.
|
|
655
|
+
- **Agents flow created** (§6.6 saved with `created_by: flow` in their frontmatter) → the same
|
|
656
|
+
question in `manual`; in `guided`/`auto` written directly and reported in one line.
|
|
657
|
+
|
|
658
|
+
**How it is kept small** — without this, the file grows one line per incident until the rules
|
|
659
|
+
nobody reads crowd out the ones that matter:
|
|
660
|
+
|
|
661
|
+
1. Lessons live in one section at the end of the file, `## Lessons from past work`, one line each.
|
|
662
|
+
The rest of the file is never rewritten.
|
|
663
|
+
2. **Already there, in any wording → the lesson is not added.** The agent had the rule and missed
|
|
664
|
+
anyway, which says the rule is weak, not absent: offer instead to move it out of the lessons
|
|
665
|
+
into the body of the brief, rewritten as a check the agent must perform.
|
|
666
|
+
3. **At `agents.lessons_max` lines (empty → 10), adding one means consolidating first**: merge
|
|
667
|
+
lines that say the same thing, generalise two narrow ones into the rule they share, drop one a
|
|
668
|
+
later lesson supersedes. Show the section before and after in the same question.
|
|
669
|
+
4. **Before any edit, copy the file** to `.claude/work/<work>/agent-backups/<name>.md` and record
|
|
670
|
+
the path in the lesson's entry. Undoing is copying it back. A file is never deleted.
|
|
671
|
+
|
|
672
|
+
Then `status`: `"written"` (with the path) · `"declined"` (never offered again) · `"later"` ·
|
|
673
|
+
`"not-editable"` (one of the three cases above, with which).
|
|
674
|
+
|
|
612
675
|
## 7. Deferred work — `followups[]`
|
|
613
676
|
|
|
614
677
|
Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
|
|
@@ -232,6 +232,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
|
|
|
232
232
|
- Without blockers: `phase = "review"`, add to `phases_done`. Suggest `/flow-bug-postmortem` (M/L) or `/flow-bug-ship` (XS/S).
|
|
233
233
|
- **Record *what* you reviewed, and separately what you changed after reading it** — `/flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `/flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
|
|
234
234
|
- **Record which pass found what** — `/flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow cost` reads them back per origin, and the retirement rule is the same: a pass with no exclusive surviving finding across twenty reviews comes out of the command.
|
|
235
|
+
- **Record what the agents missed** — `/flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
|
|
235
236
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
|
|
236
237
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
237
238
|
- Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
|
|
@@ -185,6 +185,7 @@ nothing was measured. A slowness bug is the case where this comment *is* the pro
|
|
|
185
185
|
- **Cross-repo contract handoff**: for each such entry with `contract_handoff: "pending"` — the fix changed a surface that sibling consumes — hand the new shape over as `/flow-feat-ship` §6.3 (publish the **literal** shape to the tracker ticket, mandatory preview in every autonomy mode, then record `published → <location>`; versioned-file fallback when there is no tracker). A bug flow has no §"External contracts": take the literal from the fix itself — the actual key, code, route or event the code now emits — read it off the code, never from memory.
|
|
186
186
|
- **Follow-up triage — `/flow-feat-ship` §6.4, in full and unchanged.** Read `meta.json.followups[]`; nothing `proposed` → skip silently. Otherwise §6.4 step 0 first — **3 or more candidates go to a skeptic** whose job is to refute that each deserves a ticket, and only the strongest `tracker.followup_ask_max` (empty → **2**) reach the user (flow-core §7) — then one batched `AskUserQuestion` (**Do it** / **Not worth it** / **Later**; `decision` entries asked as their question, `tooling` and everything `log`ged never asked), the accepted ones get their tracker issue created (outward-facing → **asks in every mode**), the logged ones nothing but `status: "logged"` in `meta.json`, then one offer to start the first. A bug flow is where the gate earns its keep: the prevention actions `/flow-bug-postmortem` wrote, the neighbouring bugs `/flow-bug-validate` found and the similar-risk patterns `/flow-bug-fix` flagged all land here — half a dozen of them, from one fix, and «similar risk elsewhere» that no skeptic ever read is exactly the entry that turns a closed bug into six open questions. Repeat for anything still `proposed` on the re-run that confirms the merge.
|
|
187
187
|
- **Specialists created — `/flow-feat-ship` §5.1, in full and unchanged.** Read `meta.json.specialists[]` (flow-core §6.6); nothing `useful` and pending → skip silently. Otherwise one batched offer to save each as an agent, after the MR/PR and after the knowledge `/flow-bug-postmortem` §4 already consolidated — asked in every mode, never overwriting an agent that exists.
|
|
188
|
+
- **What the agents missed — `/flow-feat-ship` §5.2, in full and unchanged.** Read `meta.json.agent_lessons[]` (flow-core §6.7); `agents.learn: off` or nothing pending → skip silently. Otherwise one question per agent with the resulting lessons section, backup first, your agents asked in every mode.
|
|
188
189
|
- **Conventions learned — `/flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
|
|
189
190
|
- **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
|
|
190
191
|
- **Only once `phase` is `done`**: delete the candidate anchor `/flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run.
|
|
@@ -384,6 +384,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
384
384
|
**The retirement rule, written down before the data arrives** so it cannot be argued backwards later: a pass that contributes **no exclusive surviving finding across twenty reviews** is removed from this command. Zero is zero, and the decision is made against the number rather than against whoever is most attached to the pass.
|
|
385
385
|
- **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
|
|
386
386
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
|
|
387
|
-
- **
|
|
387
|
+
- **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
|
|
388
|
+
- **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
|
|
388
389
|
- Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
|
|
389
390
|
- **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `/flow-feat-validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow-feat-validate` automatically** in this same turn. Never chain into `/flow-feat-ship` from here — ship is reached through `validate`.
|
|
@@ -246,8 +246,8 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
246
246
|
3. **Asked in every mode**, `auto` included: it writes to your agent configuration, outside the
|
|
247
247
|
tree, and that is never flow mechanics.
|
|
248
248
|
4. **Save** → write the agent where and in the format your harness reads agents from (on Claude
|
|
249
|
-
Code, `~/.claude/agents/<name>.md`: frontmatter `name
|
|
250
|
-
use it, then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
249
|
+
Code, `~/.claude/agents/<name>.md`: frontmatter `name`, a one-line `description` of when to
|
|
250
|
+
use it and `created_by: flow` (flow-core §6.7 reads it), then the brief as the body — drop what only made sense for this ticket, keep the stack,
|
|
251
251
|
the checks and the typical mistakes). A file with that name already there → never overwrite:
|
|
252
252
|
suffix the name and say so. **Save and use it** → also write `agents.<role>: <name>` to the
|
|
253
253
|
active overlay (a harness-owned agent name, flow-core §0). Then `status: "saved"`, with the path.
|
|
@@ -255,6 +255,31 @@ the knowledge is saved, and what is left is whether an agent this work improvise
|
|
|
255
255
|
close.
|
|
256
256
|
5. **One line on screen**: how many agents were saved and where.
|
|
257
257
|
|
|
258
|
+
## 5.2 What the agents missed (offer)
|
|
259
|
+
|
|
260
|
+
Read `meta.json.agent_lessons[]` (flow-core §6.7). `agents.learn: off`, or no entry with `status`
|
|
261
|
+
unset or `"later"` → skip this section and say nothing. Last of the three offers on purpose: the
|
|
262
|
+
MR/PR is open, the knowledge is saved, the specialists have their files — now the agents that
|
|
263
|
+
exist get what this work showed they lacked.
|
|
264
|
+
|
|
265
|
+
1. **Group by agent**, and resolve each agent's file (`~/.claude/agents`, the repo's agent folder,
|
|
266
|
+
the overlay's harness equivalent). Plugin- or marketplace-installed, a skill, or no file →
|
|
267
|
+
`status: "not-editable"` with which, and one line on screen; the lesson stays readable in
|
|
268
|
+
`meta.json`.
|
|
269
|
+
2. **Apply the size rules of §6.7 before asking** — drop what the file already says (and turn it
|
|
270
|
+
into the "promote to a check" option instead), consolidate when the section is at
|
|
271
|
+
`agents.lessons_max` — so the question shows the section as it would end up, not a line to append.
|
|
272
|
+
3. **One `AskUserQuestion`**, one entry per agent (at most 4, most lessons first): the agent, the
|
|
273
|
+
evidence in one line per lesson, and the resulting `## Lessons from past work` section. Options:
|
|
274
|
+
**Write it** · **No** · **Later**. Your agents are asked **in every mode**; agents with
|
|
275
|
+
`created_by: flow` are asked in `manual` and written directly in `guided`/`auto`.
|
|
276
|
+
4. **Write it** → back up the file (§6.7), replace only that section, record the path and the
|
|
277
|
+
backup in each entry, `status: "written"`. A file tracked by the repo is left modified in the
|
|
278
|
+
tree, uncommitted, and said so in one line: it is the team's file and the team's commit.
|
|
279
|
+
**No** → `"declined"`. **Later** → `"later"`, offered again by the re-run of this close or by
|
|
280
|
+
`/flow-work-respond`.
|
|
281
|
+
5. **One line on screen**: how many agents learned something, and where the backups are.
|
|
282
|
+
|
|
258
283
|
## 5.5 A worktree does not own the tree its tools wrote into
|
|
259
284
|
|
|
260
285
|
`meta.json.worktree` null → skip silently; there is nothing here that can go wrong.
|
|
@@ -140,6 +140,13 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
140
140
|
"useful": true | false | null,
|
|
141
141
|
"status": null | "saved" | "declined" | "later", "path": null }
|
|
142
142
|
],
|
|
143
|
+
"agent_lessons": [
|
|
144
|
+
{ "agent": "query-reviewer", "signal": "missed" | "produced" | "human",
|
|
145
|
+
"phase": "review", "evidence": "finding or thread, one line, file:line or URL",
|
|
146
|
+
"lesson": "one imperative line, general, no ticket id",
|
|
147
|
+
"status": null | "written" | "declined" | "later" | "not-editable",
|
|
148
|
+
"path": null, "backup": null }
|
|
149
|
+
],
|
|
143
150
|
"origin": { "work": "{PREFIX}XXXXX", "followup": "F1" },
|
|
144
151
|
"started_at": "2026-05-11T10:00:00Z",
|
|
145
152
|
"updated_at": "2026-05-11T11:30:00Z",
|
|
@@ -157,6 +164,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
|
|
|
157
164
|
- **`defaults_used`**: an empty `FLOW.md` key a phase resolved with its default instead of asking — written in `guided`/`auto`, where asking would breach the never-a-question contract (flow-core §0). Not an error and not deferred work: a record, aggregated by `/flow-doctor` across every work including `_archive/`, so a key that keeps defaulting can be pinned once instead of decided every time. `[]` when nothing defaulted.
|
|
158
165
|
- **`conventions_candidates`**: rules the user taught **this repo's flow** while correcting a phase — *«not a listener, a message handler»*, *«the test command is `make test-unit`»*. Written by the phase that heard one, asking nothing, only when it would apply to an unrelated ticket in this repo; read by `review`'s idiom audit in the same work; offered once at `ship`'s Close (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace**), in every mode, because it edits a file in the tree. Never domain knowledge — that filter is unchanged. Shape and rules: flow-core §8. `[]` when the work taught nothing.
|
|
159
166
|
- **`specialists`**: agents a phase **created for this work** because nothing installed fit a role, under `agents.selection: open` (flow-core §6.6) — the brief it wrote and ran on `general-purpose`, and whether anything it returned was kept. Nothing is written to the harness's agent folders while the work runs; `/flow-feat-ship` §5.1 offers the useful ones for saving as real agents once the MR/PR is open and the knowledge is saved, and records where each went.
|
|
167
|
+
- **`agent_lessons`**: what an agent was shown to lack **by evidence from outside it** — a surviving finding in its category that it did not report, a finding in code it wrote, a human review thread in its category that ended in a change (flow-core §6.7). Written by `review` and `respond` asking nothing; offered for the agent's file by `/flow-feat-ship` §5.2 and at `respond`'s close, with a backup under `agent-backups/`, never on plugin-installed agents or skills.
|
|
160
168
|
- **`origin`**: set when this work *is* a follow-up someone accepted — which work raised it and which entry. Lets `start` carry the recorded "why" into `01-context.md` instead of re-deriving it, and lets that entry move to `done` when this work does. Absent for a work that came straight from a ticket.
|
|
161
169
|
- Ticket format follows `tracker.prefix`; empty → free-form.
|
|
162
170
|
|
|
@@ -163,12 +163,13 @@ After the push (or immediately, for reply-only threads), post the agreed respons
|
|
|
163
163
|
## 8. Log, loop, and domain knowledge
|
|
164
164
|
|
|
165
165
|
- **Artifact.** Append this round to `.claude/work/<TICKET>/08-feedback.md` (create it the first round). Per round: the date, and per thread — location, category, decision (reply-only / code-change / defer / held / handled-by-user), the reply posted, and the commit/edit if any. **For a `G` thread, the measurement table goes in whole** — variants, plans, timings, keys served, how the data set was built — plus what stayed unresolved. A later round reads it to avoid re-litigating settled threads.
|
|
166
|
+
- **What the panel missed.** Each thread this round that ended in a code change and falls in a category a `quality.reviewers` member or a named `agents.<role>` owns → one `meta.json.agent_lessons[]` row, `signal: "human"` (flow-core §6.7), when the lesson passes that section's test. A human had to catch what the agent is there to catch; that is the strongest evidence this flow ever gets that an agent needs a line.
|
|
166
167
|
- **Knowledge.** `knowledge.stage` is set and the debate produced a non-obvious "why" worth keeping (a reviewer-surfaced constraint, an integration gotcha, a decision that reversed the design) → `knowledge.stage` for this branch (silence by default; only on a clear signal). Consolidated at `knowledge.save` time.
|
|
167
168
|
- **Count the round in the artifact, not in your head.** Increment `respond_rounds` for this MR/PR in `meta.json` (its `mrs[]` entry; work-level when there are no `mrs`) in the same write that appends the round to `08-feedback.md` — the §1 ceiling is worth exactly as much as this counter. Lightweight mode: nothing to write, no ceiling to enforce; say so once and carry on.
|
|
168
169
|
- **Re-post the performance comment when this round changed a measured path.** A push that touches a query or an entry point already benchmarked (`/flow-feat-ship` §4.3) makes the standing comment wrong — and a wrong number is worse than none. Re-run those rows against the same base and post a new comment; never edit the old one. Nothing measured changed → post nothing.
|
|
169
170
|
- Overwrite `00-summary.md` whole (≤15 lines, flow-core §5). Not in lightweight mode.
|
|
170
171
|
- **A repeated answer spends the budget and buys nothing.** A reply this round that says what an earlier round said — same position, same reasoning, no new evidence → stop **now**, before the ceiling, and escalate that thread by name: your position, the reviewer's counter, the fact that neither has moved.
|
|
171
|
-
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow-work-respond` picks up the next round. All threads answered and code pushed → summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow-feat-ship §6` / `/flow-bug-ship` close applies (and `/flow-work-watch` for the post-deploy).
|
|
172
|
+
- **Loop / close.** Threads open awaiting the reviewer → tell the user the ball is in their court; a later `/flow-work-respond` picks up the next round. All threads answered and code pushed → **offer the agent lessons first** — `/flow-feat-ship §5.2`, in full and unchanged, over the rows still pending (this round's and any earlier ship left as `later`) — then summarize: threads addressed, code changes made, threads **ready for the user to resolve**, follow-up tickets proposed. Once approved and merged, the normal `/flow-feat-ship §6` / `/flow-bug-ship` close applies (and `/flow-work-watch` for the post-deploy).
|
|
172
173
|
|
|
173
174
|
## Notes
|
|
174
175
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flow-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "flow",
|
|
4
4
|
"displayName": "Flow — guided dev workflows",
|
|
5
5
|
"description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.79.0",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Alberto Vioque",
|
|
9
9
|
"email": "mashware@gmail.com"
|
|
@@ -5,6 +5,26 @@ plugin and is what `/flow:news` reads to show you what changed since your previo
|
|
|
5
5
|
|
|
6
6
|
The canonical, richest notes live in the [GitHub Releases](https://github.com/mashware/flow-workflows/releases).
|
|
7
7
|
|
|
8
|
+
## v0.79.0 — The reviewer that missed it was never told · 2026-09-23
|
|
9
|
+
|
|
10
|
+
**In short**
|
|
11
|
+
- **An agent that let something through gets a one-line lesson in its own file.** A panel reviewer
|
|
12
|
+
that missed a finding in its category, a delegated agent whose code a finding landed in, a
|
|
13
|
+
reviewer whose category a colleague's MR comment exposed — recorded as the flow sees it, offered
|
|
14
|
+
when the work closes.
|
|
15
|
+
- **Only outside evidence counts.** Another pass, the built-in review or a human caught it; an agent
|
|
16
|
+
grading itself is never the source.
|
|
17
|
+
- **It stays small**: one section per agent, no repeats (a rule the agent already had becomes an
|
|
18
|
+
offer to turn it into a check), and a consolidation once it reaches `agents.lessons_max` (10).
|
|
19
|
+
- **Your agents are asked in every mode, with a backup first**; agents flow created itself are
|
|
20
|
+
written directly in `guided`/`auto`. Plugin-installed agents and skills are never edited.
|
|
21
|
+
- **The review stops offering to fill agent roles**, finishing what v0.78.0 started.
|
|
22
|
+
|
|
23
|
+
Idea taken from Hermes Agent, which patches the skills it wrote and curates them so they do not
|
|
24
|
+
pile up. What flow does differently is the signal: Hermes reviews its own transcript and admits it
|
|
25
|
+
tends to think it did well; flow only learns when something outside the agent caught what it did
|
|
26
|
+
not. `agents.learn: off` turns it off.
|
|
27
|
+
|
|
8
28
|
## v0.78.0 — The specialist was installed; the flow asked for a generalist · 2026-09-23
|
|
9
29
|
|
|
10
30
|
**In short**
|
|
@@ -180,6 +180,9 @@ the step if it was optional** (flow-core §6.6).
|
|
|
180
180
|
# covers, and records each substitution. Nothing installed fits → it writes an expert brief and runs it
|
|
181
181
|
# on the general-purpose agent; a useful one is offered for saving as an agent when `ship` closes.
|
|
182
182
|
# Never touches `quality.reviewers`/`review_skill`
|
|
183
|
+
- `learn:` # agents learn from what they missed (flow-core §6.7). Empty = `offer`: when a reviewer or a delegated agent let
|
|
184
|
+
# through something another source caught, `ship` offers a one-line lesson for its file, with a backup. `off` = never
|
|
185
|
+
- `lessons_max:` # lines the lessons section of one agent may hold before a new lesson forces a consolidation. Empty = 10
|
|
183
186
|
|
|
184
187
|
- `architecture:` # design/layers/architecture
|
|
185
188
|
- `persistence:` # DB/ORM/mappings/migrations/queries
|