flow-workflows 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +320 -0
  3. package/adapters/README.md +128 -0
  4. package/adapters/codex/AGENTS.md +82 -0
  5. package/adapters/codex/CORE.md +522 -0
  6. package/adapters/codex/PRIMITIVES.md +64 -0
  7. package/adapters/codex/README.md +126 -0
  8. package/adapters/codex/config.snippet.toml +88 -0
  9. package/adapters/codex/skills/flow-bug-fix/SKILL.md +171 -0
  10. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +216 -0
  11. package/adapters/codex/skills/flow-bug-postmortem/SKILL.md +98 -0
  12. package/adapters/codex/skills/flow-bug-review/SKILL.md +190 -0
  13. package/adapters/codex/skills/flow-bug-ship/SKILL.md +187 -0
  14. package/adapters/codex/skills/flow-bug-start/SKILL.md +212 -0
  15. package/adapters/codex/skills/flow-bug-validate/SKILL.md +99 -0
  16. package/adapters/codex/skills/flow-doctor/SKILL.md +254 -0
  17. package/adapters/codex/skills/flow-feat-build/SKILL.md +350 -0
  18. package/adapters/codex/skills/flow-feat-design/SKILL.md +399 -0
  19. package/adapters/codex/skills/flow-feat-plan/SKILL.md +165 -0
  20. package/adapters/codex/skills/flow-feat-review/SKILL.md +350 -0
  21. package/adapters/codex/skills/flow-feat-ship/SKILL.md +417 -0
  22. package/adapters/codex/skills/flow-feat-start/SKILL.md +289 -0
  23. package/adapters/codex/skills/flow-feat-validate/SKILL.md +216 -0
  24. package/adapters/codex/skills/flow-init/SKILL.md +153 -0
  25. package/adapters/codex/skills/flow-news/SKILL.md +57 -0
  26. package/adapters/codex/skills/flow-next/SKILL.md +55 -0
  27. package/adapters/codex/skills/flow-work-README/SKILL.md +247 -0
  28. package/adapters/codex/skills/flow-work-abandon/SKILL.md +103 -0
  29. package/adapters/codex/skills/flow-work-clean/SKILL.md +228 -0
  30. package/adapters/codex/skills/flow-work-daily/SKILL.md +114 -0
  31. package/adapters/codex/skills/flow-work-green/SKILL.md +162 -0
  32. package/adapters/codex/skills/flow-work-query/SKILL.md +169 -0
  33. package/adapters/codex/skills/flow-work-respond/SKILL.md +176 -0
  34. package/adapters/codex/skills/flow-work-resume/SKILL.md +123 -0
  35. package/adapters/codex/skills/flow-work-status/SKILL.md +127 -0
  36. package/adapters/codex/skills/flow-work-try/SKILL.md +94 -0
  37. package/adapters/codex/skills/flow-work-watch/SKILL.md +223 -0
  38. package/adapters/gemini/CORE.md +521 -0
  39. package/adapters/gemini/PRIMITIVES.md +117 -0
  40. package/adapters/gemini/README.md +149 -0
  41. package/adapters/gemini/commands/flow/bug/fix.toml +168 -0
  42. package/adapters/gemini/commands/flow/bug/investigate.toml +213 -0
  43. package/adapters/gemini/commands/flow/bug/postmortem.toml +95 -0
  44. package/adapters/gemini/commands/flow/bug/review.toml +187 -0
  45. package/adapters/gemini/commands/flow/bug/ship.toml +184 -0
  46. package/adapters/gemini/commands/flow/bug/start.toml +209 -0
  47. package/adapters/gemini/commands/flow/bug/validate.toml +96 -0
  48. package/adapters/gemini/commands/flow/doctor.toml +251 -0
  49. package/adapters/gemini/commands/flow/feat/build.toml +347 -0
  50. package/adapters/gemini/commands/flow/feat/design.toml +396 -0
  51. package/adapters/gemini/commands/flow/feat/plan.toml +162 -0
  52. package/adapters/gemini/commands/flow/feat/review.toml +347 -0
  53. package/adapters/gemini/commands/flow/feat/ship.toml +414 -0
  54. package/adapters/gemini/commands/flow/feat/start.toml +286 -0
  55. package/adapters/gemini/commands/flow/feat/validate.toml +213 -0
  56. package/adapters/gemini/commands/flow/init.toml +150 -0
  57. package/adapters/gemini/commands/flow/news.toml +54 -0
  58. package/adapters/gemini/commands/flow/next.toml +52 -0
  59. package/adapters/gemini/commands/flow/work/README.toml +244 -0
  60. package/adapters/gemini/commands/flow/work/abandon.toml +100 -0
  61. package/adapters/gemini/commands/flow/work/clean.toml +225 -0
  62. package/adapters/gemini/commands/flow/work/daily.toml +111 -0
  63. package/adapters/gemini/commands/flow/work/green.toml +159 -0
  64. package/adapters/gemini/commands/flow/work/query.toml +166 -0
  65. package/adapters/gemini/commands/flow/work/respond.toml +173 -0
  66. package/adapters/gemini/commands/flow/work/resume.toml +120 -0
  67. package/adapters/gemini/commands/flow/work/status.toml +124 -0
  68. package/adapters/gemini/commands/flow/work/try.toml +91 -0
  69. package/adapters/gemini/commands/flow/work/watch.toml +220 -0
  70. package/adapters/gemini/settings.snippet.json +11 -0
  71. package/adapters/hermes/CORE.md +522 -0
  72. package/adapters/hermes/PRIMITIVES.md +86 -0
  73. package/adapters/hermes/README.md +145 -0
  74. package/adapters/hermes/config.snippet.yaml +63 -0
  75. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +171 -0
  76. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +216 -0
  77. package/adapters/hermes/skills/flow-bug-postmortem/SKILL.md +98 -0
  78. package/adapters/hermes/skills/flow-bug-review/SKILL.md +190 -0
  79. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +187 -0
  80. package/adapters/hermes/skills/flow-bug-start/SKILL.md +212 -0
  81. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +99 -0
  82. package/adapters/hermes/skills/flow-doctor/SKILL.md +254 -0
  83. package/adapters/hermes/skills/flow-feat-build/SKILL.md +350 -0
  84. package/adapters/hermes/skills/flow-feat-design/SKILL.md +399 -0
  85. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +165 -0
  86. package/adapters/hermes/skills/flow-feat-review/SKILL.md +350 -0
  87. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +417 -0
  88. package/adapters/hermes/skills/flow-feat-start/SKILL.md +289 -0
  89. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +216 -0
  90. package/adapters/hermes/skills/flow-init/SKILL.md +153 -0
  91. package/adapters/hermes/skills/flow-news/SKILL.md +57 -0
  92. package/adapters/hermes/skills/flow-next/SKILL.md +55 -0
  93. package/adapters/hermes/skills/flow-work-README/SKILL.md +247 -0
  94. package/adapters/hermes/skills/flow-work-abandon/SKILL.md +103 -0
  95. package/adapters/hermes/skills/flow-work-clean/SKILL.md +228 -0
  96. package/adapters/hermes/skills/flow-work-daily/SKILL.md +114 -0
  97. package/adapters/hermes/skills/flow-work-green/SKILL.md +162 -0
  98. package/adapters/hermes/skills/flow-work-query/SKILL.md +169 -0
  99. package/adapters/hermes/skills/flow-work-respond/SKILL.md +176 -0
  100. package/adapters/hermes/skills/flow-work-resume/SKILL.md +123 -0
  101. package/adapters/hermes/skills/flow-work-status/SKILL.md +127 -0
  102. package/adapters/hermes/skills/flow-work-try/SKILL.md +94 -0
  103. package/adapters/hermes/skills/flow-work-watch/SKILL.md +223 -0
  104. package/adapters/install.sh +99 -0
  105. package/adapters/opencode/CORE.md +521 -0
  106. package/adapters/opencode/PRIMITIVES.md +118 -0
  107. package/adapters/opencode/README.md +113 -0
  108. package/adapters/opencode/commands/flow-bug-fix.md +169 -0
  109. package/adapters/opencode/commands/flow-bug-investigate.md +214 -0
  110. package/adapters/opencode/commands/flow-bug-postmortem.md +96 -0
  111. package/adapters/opencode/commands/flow-bug-review.md +188 -0
  112. package/adapters/opencode/commands/flow-bug-ship.md +185 -0
  113. package/adapters/opencode/commands/flow-bug-start.md +210 -0
  114. package/adapters/opencode/commands/flow-bug-validate.md +97 -0
  115. package/adapters/opencode/commands/flow-doctor.md +252 -0
  116. package/adapters/opencode/commands/flow-feat-build.md +348 -0
  117. package/adapters/opencode/commands/flow-feat-design.md +397 -0
  118. package/adapters/opencode/commands/flow-feat-plan.md +163 -0
  119. package/adapters/opencode/commands/flow-feat-review.md +348 -0
  120. package/adapters/opencode/commands/flow-feat-ship.md +415 -0
  121. package/adapters/opencode/commands/flow-feat-start.md +287 -0
  122. package/adapters/opencode/commands/flow-feat-validate.md +214 -0
  123. package/adapters/opencode/commands/flow-init.md +151 -0
  124. package/adapters/opencode/commands/flow-news.md +55 -0
  125. package/adapters/opencode/commands/flow-next.md +53 -0
  126. package/adapters/opencode/commands/flow-work-README.md +245 -0
  127. package/adapters/opencode/commands/flow-work-abandon.md +101 -0
  128. package/adapters/opencode/commands/flow-work-clean.md +226 -0
  129. package/adapters/opencode/commands/flow-work-daily.md +112 -0
  130. package/adapters/opencode/commands/flow-work-green.md +160 -0
  131. package/adapters/opencode/commands/flow-work-query.md +167 -0
  132. package/adapters/opencode/commands/flow-work-respond.md +174 -0
  133. package/adapters/opencode/commands/flow-work-resume.md +121 -0
  134. package/adapters/opencode/commands/flow-work-status.md +125 -0
  135. package/adapters/opencode/commands/flow-work-try.md +92 -0
  136. package/adapters/opencode/commands/flow-work-watch.md +221 -0
  137. package/adapters/opencode/opencode.json +8 -0
  138. package/bin/cli.mjs +222 -0
  139. package/package.json +43 -0
  140. package/plugins/flow/.claude-plugin/plugin.json +21 -0
  141. package/plugins/flow/CHANGELOG.md +1744 -0
  142. package/plugins/flow/examples/FLOW.template.md +324 -0
@@ -0,0 +1,151 @@
1
+ ---
2
+ description: Assistant that generates FLOW.md and its optional harness overlay (auto-detects what it can, asks the minimum)
3
+ ---
4
+
5
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/init.md — do not edit; change the plugin file and run the script. -->
6
+
7
+ # `/flow-init`
8
+
9
+ > **opencode adapter — how the Claude Code primitives named below map here.**
10
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
11
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` declared in `agents/<name>.md` (`mode: subagent`); the name comes from `agents.<role>` in `FLOW.md`, empty → do it in this context.
12
+ > - Parallel fan-out → several `@name` in one prompt, capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
13
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `opencode run -p "<command>"` with cron.
14
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
15
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
16
+ > - `/model <value>` → opencode's model picker (`/models`).
17
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared in `opencode.json` (see this adapter's `opencode.json` for the domain-memory example).
18
+
19
+ Creates or updates the effective FLOW configuration at the repo root: shared values in `FLOW.md`
20
+ and optional harness-owned values in the active `FLOW.<harness>.md`. The active filename is
21
+ `FLOW.claude.md`, `FLOW.codex.md`, `FLOW.opencode.md`, `FLOW.gemini.md`, or `FLOW.hermes.md`;
22
+ identify it from the
23
+ product executing this command, never from the selected model. Every other `/flow-*` command reads
24
+ the base and then that overlay. The user answers the **minimum**: what the repo can tell is
25
+ auto-detected and only confirmed.
26
+
27
+ Key names and contract: `examples/FLOW.template.md` from the plugin. Do not invent keys that are not there.
28
+
29
+ ## 1. If either configuration file already exists
30
+
31
+ Show `FLOW.md` and the active overlay when each exists, then show their effective merged values.
32
+ Ask: **update** (re-detect and re-ask, preserving what the user keeps) or **cancel**. Never read,
33
+ change, or display another harness's overlay. Never overwrite either file without confirmation.
34
+ Label harness-sensitive values that currently come from the base as **shared across harnesses**;
35
+ that is information, not an error and not evidence that a free-text model name is invalid.
36
+
37
+ An old `FLOW.md` is already valid and stays where it is. Do not move a model, agent, skill, or tool
38
+ to the active overlay merely because it looks harness-specific: model names are free text, and the
39
+ file may intentionally be the default for several harnesses. Only split existing values when the
40
+ user explicitly asks to split or migrate them; show the exact keys and both resulting files before
41
+ editing. This is an optional migration, not part of a normal update.
42
+
43
+ ## 2. Auto-detection (do NOT ask about what you can infer)
44
+
45
+ Run, deduce, show what was found for confirmation or correction:
46
+
47
+ - **Git host and CLI** — from `git remote -v`:
48
+ - `github.com` → `github`; `gitlab.*` → `gitlab`; `bitbucket.org` → `bitbucket`;
49
+ `dev.azure.com`/`visualstudio.com` → `azure`; a known Gitea/Forgejo domain → `gitea`.
50
+ - The term (MR/PR) and the default CLI follow from `host` — the table in the template. Never write a term key; there is none.
51
+ - Unknown domain (self-hosted) → ask which host (GitLab/Gitea/other) and which CLI.
52
+ - Installed CLIs: `command -v gh glab tea az`.
53
+ - **Base branch** — `git symbolic-ref refs/remotes/origin/HEAD` (or `git remote show origin`): `origin/main` or `origin/master` → `git.default_base`.
54
+ - **Quality commands** — propose what the repo has (empty if nothing found):
55
+ - `Makefile` → targets `test`, `lint`, `phpstan`/`stan`, `cs-fixer`/`fmt`, `database`/`migrate`.
56
+ - `package.json` → `scripts` (test, lint, build, typecheck).
57
+ - `composer.json` → scripts; phpunit/phpstan/php-cs-fixer present.
58
+ - `pyproject.toml`/`tox.ini` → pytest/ruff/mypy; `Cargo.toml` → `cargo test/clippy`; `go.mod` → `go test ./...`.
59
+ - `build.gradle(.kts)`/`settings.gradle(.kts)` (Android, Kotlin, Java) → `./gradlew test` (`test_one`: `./gradlew test --tests {FILTER}`), `./gradlew lint` or `detekt`/`ktlintCheck` if the plugin is declared, `./gradlew assembleDebug` as build; `pom.xml` → `mvn test` (`-Dtest={FILTER}`), `mvn verify`.
60
+ - `*.sln`/`*.csproj` (.NET, C#) → `dotnet test` (`test_one`: `dotnet test --filter {FILTER}`), `dotnet format --verify-no-changes` as style, `dotnet build -warnaserror` as static analysis; EF Core migrations (`Migrations/` folder, `dotnet ef`) → propose `quality.db_diff: dotnet ef migrations script` and raise `git.predeploy_gate`.
61
+ - `*.xcodeproj`/`*.xcworkspace`/`Package.swift` (iOS, macOS, Swift) → `xcodebuild test -scheme <scheme> -destination '<simulator>'` or `swift test`, `swiftlint` if `.swiftlint.yml` exists, `swift-format` as style. Ask for the scheme and destination when several exist.
62
+ - `pubspec.yaml` (Flutter, Dart) → `flutter test` (`test_one`: `flutter test {FILTER}`), `flutter analyze`, `dart format --set-exit-if-changed .`.
63
+ - Several stacks in one repo (a backend plus a mobile client) → propose one command per key that chains them (`make test` if a Makefile already does, else `a && b`), and say so.
64
+ - Schema migrations (Doctrine, Alembic, Rails, Prisma…) → propose `quality.db_diff` and raise `git.predeploy_gate`.
65
+ - **Data access** (`data.*`, all optional) — only if the repo talks to a database. Find the client and the local stack (a `docker-compose.yml` service, a `DATABASE_URL`/`DB_*` env var, a `Makefile` target that opens a shell). Propose `data.explain_cmd` and `data.schema_cmd` in the engine's dialect against the **development** database — MySQL over Docker Compose: `docker compose exec -T <db-service> mysql <db> -e "EXPLAIN {QUERY}"` and `… -e "SHOW CREATE TABLE {TABLE}"`; PostgreSQL: `psql -c "EXPLAIN (ANALYZE, BUFFERS) {QUERY}"` / `\d+ {TABLE}`. Leave `sandbox_cmd`/`seed_cmd`/`volumes` empty unless the user has something ready. Nothing detected → leave the section out (the query duel degrades to schema-only and says so).
66
+ - **Knowledge sources** (`knowledge.*`) — look at the MCP tools exposed in this session: `mcp__domain-memory__*` → propose `search: mcp__domain-memory__search_knowledge`, `stage: mcp__domain-memory__stage_finding`, `read_staging: mcp__domain-memory__read_staging`, `save: mcp__domain-memory__save_knowledge`; any other tool whose name says search / query / knowledge / memory / graph (e.g. `mcp__codegraph__*`) → propose it as an additional `search` entry, roles it cannot fill left empty. A `docs/adr` or similar folder with no MCP → propose `search: rg -n -i "{QUERY}" docs/adr`. Nothing found → leave the section out. MCP and harness tool names detected in this session belong in the active overlay; a plain repo command such as the `rg` example belongs in `FLOW.md`.
67
+
68
+ ## 3. Ask five things
69
+
70
+ Everything §2 detected is shown **in one screen** for confirmation or correction — host, base
71
+ branch, quality commands, database client, knowledge tools, whether a schema diff exists. That is a
72
+ review, not a questionnaire. Then, and only then, five questions:
73
+
74
+ 1. **Ticket prefix and reader** (`tracker.prefix`, `tracker.tool`), options **without preselecting
75
+ one** (the git host does not determine the tracker): `acli` (Jira), `gh` (GitHub issues), `glab`
76
+ (GitLab issues), `linear`, `none` (manual).
77
+ - `tracker.view_cmd` follows the choice (overridable): `acli` → `acli jira workitem view {TICKET}`;
78
+ `gh` → `gh issue view {TICKET}`; `glab` → `glab issue view {TICKET}`; `linear`/`none` → empty.
79
+ - `tracker.comments_cmd` likewise (`view_cmd`s print only the description; scope decisions and
80
+ sibling-repo contracts live in the thread): `gh` → `gh issue view {TICKET} --comments`;
81
+ `glab` → `glab issue view {TICKET} --comments`; the rest empty.
82
+ - Proposing `gh`/`glab` → `command -v gh glab`; missing → keep the choice, warn that the step
83
+ degrades to manual paste until it is installed.
84
+ 2. **Base branch** (`git.default_base`) — **only if §2 could not resolve it**. Resolved → it is a row
85
+ in the confirmation screen, not a question.
86
+ 3. **Autonomy** (`autonomy.mode`): `manual` *(Recommended)* — stops at each decision, only recommends
87
+ the next command; `guided` — resolves low-risk decisions and chains phases, asks at the real ones;
88
+ `auto` — also resolves the rest with recorded defaults. Explain the hard gates that stop in every
89
+ mode and the list of what `guided`/`auto` never ask (both in the `~/.claude/flow/CORE.opencode.md` §2), so
90
+ `auto` is genuinely unattended between the brief and `ship`. Editable any time. Empty = `manual`.
91
+ 4. **The quality commands as one block** (`quality.test`, `test_one`, `static_analysis`, `style_fix`,
92
+ `db_update`, `db_diff`) — confirm or edit what §2 found, all in one question, each may stay empty
93
+ (= auto-discover at the moment it is needed). Several suites chain into `test` with `&&`.
94
+ 5. **Git-ignore** `FLOW.md`, `FLOW.*.md`, and `.claude/work/` — see §5.
95
+
96
+ **Two keys are written without being asked**: `agents.fanout_max` (`4`) and `agents.budget_max`
97
+ (`12`), with their default values, because they are the only brake on what a review costs and a key
98
+ absent from the file is a default nobody can find on the day the bill arrives. Say in one line what
99
+ each bounds — one parallel round, one whole command run — and that a repo whose reviews feel
100
+ expensive lowers `budget_max` first.
101
+
102
+ **Everything else stays out of the file.** Agents by role, review depth, table volumes, the tracker
103
+ transitions, `functional_check`: on a fresh repo the honest answer to each is *"skip"* — the agents
104
+ do not exist yet, nobody has seen a review's cost line, and looking up row counts in the middle of a
105
+ wizard is not configuration, it is homework. Each of those is offered by the phase that first needs
106
+ it, at a stop it was making anyway (flow-core §0), which is also the first moment the user has
107
+ anything to base the answer on. Do not ask about them here, and do not ask about `models.*` either
108
+ unless the user brings it up. When the user does configure `models.*`, write it to the active
109
+ overlay, never the base.
110
+
111
+ ## 4. Write the base and, only when needed, the active overlay
112
+
113
+ Write compact files at the repo root — every command reads the base and active overlay in every
114
+ phase, so their size is paid on every step:
115
+
116
+ - `FLOW.md` holds repo facts and shared preferences: tracker, git, autonomy, quality commands, cost
117
+ ceilings, data, conventions, repo commands, and observability.
118
+ - The active overlay holds values owned by the current harness: `models.*`, agent role names,
119
+ `agents.fanout_tool`, `quality.review_skill`, `quality.reviewers`, and MCP or harness-specific
120
+ `knowledge.*` tool names. A manually configured overlay may override any documented key; init
121
+ preserves it, but does not duplicate a common value there.
122
+ - Do not create an empty overlay. Do not touch inactive overlays. Existing values remain in their
123
+ current file unless the user explicitly requested a split.
124
+ - Two-line header in each file: whether it is the shared base or which harness it overlays, and that
125
+ the plugin's `examples/FLOW.template.md` documents every key, merge rule, and default.
126
+ - Sections in the template's order — tracker, git, autonomy, quality, agents, models, data, conventions, notes, knowledge, observability — but **only the sections and keys that have a value**. One line per key: `- key: value`. No template comments.
127
+ - Empty keys are omitted from the base (absent = default). In an overlay, preserve or write an empty
128
+ key only when it intentionally masks a non-empty base value; removing it would change the
129
+ effective config. A section with no set or masking key is omitted. **The two base-file exceptions
130
+ are `agents.fanout_max` and `agents.budget_max`**: write them with their value even when it is the
131
+ default, per §3 — a cost ceiling is only a ceiling if the person paying can find it.
132
+ - No `review` section: the panel is configured by `quality.review_depth`, `quality.review_skill` and `quality.reviewers`.
133
+ - In doubt about a key or its default → read the template, never reproduce it from here.
134
+
135
+ - **A worked example exists for one stack.** When detection says PHP (a `composer.json`, a `symfony.lock`, a `bin/console`), add **one line** to the close: *"an example `FLOW.md` and agent set for Symfony ship with the plugin under `examples/symfony/` — copy what applies."* Never copy anything on your own, and never mention it for another stack: it is one stack's answer, not a default.
136
+
137
+ ## 5. Close
138
+
139
+ - Summarize on screen: what was written to the base, what was written to the active overlay, and
140
+ what was left **empty (= auto-discover)**; mention `models.*` exists and where it is documented
141
+ (§3).
142
+ - **One line on how the rest of the file gets written**: *"the other keys are offered the first time a phase needs one — agents when a panel improvises a role, review depth when a review goes over budget, table volumes when a query duel comes back schema-only."* Then `/flow-doctor` shows which defaults keep being used, so a key worth pinning can be pinned.
143
+ - The base and overlays are **personal config, not team config** (repo facts mixed with one
144
+ developer's flow preferences, tools and agents; **no secrets**) — they should not be committed.
145
+ One `AskUserQuestion`, both parts in the same question:
146
+ - The root files not already git-ignored → **offer to add `/FLOW.md` and `/FLOW.*.md` to
147
+ `.gitignore`**. This edits a tracked file — confirm before writing. A team wanting the repo-fact
148
+ subset can still commit it deliberately. Do not use a recursive pattern: examples under the
149
+ plugin must remain visible.
150
+ - Git-ignore `.claude/work/` too — recommended default: ignore it (artifacts are personal working state; teams that want to share them commit deliberately). `git.worktree` not `off` → offer `.worktrees/` in the same gesture.
151
+ - Suggest `/flow-next` as the next step (it routes to `/flow-feat-start`, `/flow-work-resume` or `/flow-work-status`).
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Show what changed in the flow plugin since the version you last saw
3
+ ---
4
+
5
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/news.md — do not edit; change the plugin file and run the script. -->
6
+
7
+ # `/flow-news $ARGUMENTS`
8
+
9
+ > **opencode adapter — how the Claude Code primitives named below map here.**
10
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
11
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` declared in `agents/<name>.md` (`mode: subagent`); the name comes from `agents.<role>` in `FLOW.md`, empty → do it in this context.
12
+ > - Parallel fan-out → several `@name` in one prompt, capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
13
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `opencode run -p "<command>"` with cron.
14
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
15
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
16
+ > - `/model <value>` → opencode's model picker (`/models`).
17
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared in `opencode.json` (see this adapter's `opencode.json` for the domain-memory example).
18
+
19
+ Show what is new in the `flow` plugin: the bundled changelog entries between the version the user
20
+ last saw and the installed one. Read-only, except for a small "last seen" marker.
21
+
22
+ ## 1. Locate the data
23
+
24
+ - **Installed version**: `~/.claude/flow/.claude-plugin/plugin.json` → `version` (authoritative). Unreadable → the newest shipped `## vX.Y.Z` header in the changelog.
25
+ - **Changelog**: `~/.claude/flow/CHANGELOG.md`. Each shipped version is a section headed `## vX.Y.Z …`; an `## [Unreleased] …` block at the top is **ignored** (not shipped).
26
+ - **Last-seen marker**: `~/.claude/flow/news-last-seen` (one line, e.g. `v0.11.0`). Missing dir/file → first run.
27
+
28
+ `~/.claude/flow/CHANGELOG.md` missing (running outside the packaged plugin) → say so briefly, point to <https://github.com/mashware/flow-workflows/releases>, stop.
29
+
30
+ ## 2. Decide the range from `$ARGUMENTS`
31
+
32
+ Arguments are space-separated. `full` is a display modifier (§3) and combines with any range below; the remaining argument selects the range:
33
+
34
+ - **empty** → every shipped entry strictly newer than the last-seen version, up to and including the installed one. **First run** (no marker) → only the installed version's entry, plus a mention of `/flow-news all` for the full history.
35
+ - **`vX.Y.Z`** → every entry newer than that version.
36
+ - **`N`** (an integer) → the last `N` shipped entries.
37
+ - **`all`** → every entry in the changelog.
38
+
39
+ Compare versions by **semver** (numeric `major.minor.patch`), never string order (`v0.9.0` < `v0.10.0`).
40
+
41
+ ## 3. Show
42
+
43
+ - **Short form (default)**: per version, the `## vX.Y.Z …` header line and its **In short** bullet list only (each entry opens with a bold "In short" paragraph followed by 3–5 bullets). An older entry without an "In short" block → its first paragraph.
44
+ - **`full`** (`/flow-news full`, `/flow-news all full`, `/flow-news 3 full`, …) → the whole entries.
45
+ - Newest-first, lightly reflowed for the terminal — no raw markdown noise.
46
+ - Nothing matches (already current) → *"You're on the latest — `vX.Y.Z`, nothing new since you last checked."*
47
+ - End with a one-line pointer to the full GitHub Releases for the richest notes.
48
+
49
+ ## 4. Update the marker
50
+
51
+ Range **empty** (`/flow-news` or `/flow-news full` — the "catch me up" case) → write the installed version to `~/.claude/flow/news-last-seen` (create the dir if needed). Explicit range (`vX.Y.Z`, `N`, `all`, with or without `full`) → **do not move the marker**.
52
+
53
+ ## Note — the proactive nudge
54
+
55
+ A SessionStart hook (`hooks/notify-update.sh`) prints a one-line nudge the first session after the installed version changes. It uses a **separate** marker (`~/.claude/flow/news-notified`) and never touches `news-last-seen`, so `/flow-news` still shows the full delta. The hook is Claude Code-only; on the opencode/Codex/Gemini/Hermes adapters `/flow-news` is pull-only.
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Entry point — routes to init, resume or status depending on where you are (no base or active FLOW config → init; a work on this branch → resume; otherwise status)
3
+ ---
4
+
5
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/next.md — do not edit; change the plugin file and run the script. -->
6
+
7
+ # `/flow-next`
8
+
9
+ > **opencode adapter — how the Claude Code primitives named below map here.**
10
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
11
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` declared in `agents/<name>.md` (`mode: subagent`); the name comes from `agents.<role>` in `FLOW.md`, empty → do it in this context.
12
+ > - Parallel fan-out → several `@name` in one prompt, capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
13
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `opencode run -p "<command>"` with cron.
14
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
15
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
16
+ > - `/model <value>` → opencode's model picker (`/models`).
17
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared in `opencode.json` (see this adapter's `opencode.json` for the domain-memory example).
18
+
19
+ The one command to type when you do not know which command comes next. Read-only until it
20
+ hands over: it looks at the repo and the work folders, says where you are, and proposes
21
+ **one** next step as an `AskUserQuestion` (the recommended route as the default). It never
22
+ runs a phase on its own and never advances `meta.json`.
23
+
24
+ ## 1. Look
25
+
26
+ 1. Identify the active harness. Does `FLOW.md` or its active `FLOW.<harness>.md` exist at the repo
27
+ root? An inactive harness's overlay does not configure this session.
28
+ 2. `git branch --show-current`, and whether `.claude/work/*/meta.json` has a `branch` equal to it (also check `worktree` entries, and `.claude/work/_archive/` is ignored).
29
+ 3. `.claude/work/` — how many open works, and their `phase` (from `meta.json`; read `00-summary.md` when present, never the full artifacts).
30
+ 3b. `followups[]` across those works **and** `.claude/work/_archive/*/meta.json`: any entry `accepted` with no `work` started (flow-core §7).
31
+ 4. Is the working tree dirty (`git status --porcelain`)?
32
+
33
+ ## 2. Route
34
+
35
+ | Situation | Say | Propose |
36
+ |---|---|---|
37
+ | Neither base nor active overlay | "This repo is not configured for flow on this harness yet." One line on what the FLOW config is (personal config, auto-detected). | `/flow-init` |
38
+ | A work matches the current branch | Its stop header (flow-core §3: ticket · size · phase · MR #n of N) and the next phase for its size. | `/flow-work-resume` |
39
+ | No match, but open works exist | Count, and the two most recently updated with their phase. | `/flow-work-status`, or `/flow-feat-start` / `/flow-bug-start` if the user said what they want to do |
40
+ | No works at all, but an accepted follow-up is waiting | "Nothing in flight — but `<TICKET>` F1 was accepted and never started: `<title>`." | `/flow-feat-start <ticket>` (or `/flow-bug-start`) for that follow-up · `/flow-feat-start` for something else |
41
+ | No works at all | "Nothing in flight." | `/flow-feat-start <TICKET>` (or with no ticket, from the conversation) · `/flow-bug-start <TICKET>` |
42
+
43
+ - The SessionStart hook (`hooks/session-start.sh`) has already printed the first two rows of this table's second case — the header and what the last session was doing — off disk, without reading a ticket or an artifact. Say them again anyway: `next` is where the user asked, and a line they scrolled past is not an answer.
44
+ - An `accepted` follow-up exists **and** other works are open → do not reroute; add one line naming it after the options. It is a standing commitment, not an interruption.
45
+ - Dirty tree and no matching work → mention it in one line ("uncommitted changes on `<branch>`, no work is tracking them") before the options; `start` will warn again.
46
+ - A base or active overlay is present but `/flow-doctor` has never been run in this session and the
47
+ git host CLI is not on `PATH` → add `/flow-doctor` as a secondary option.
48
+ - In `autonomy.mode: guided`/`auto`, the route is still asked: `next` is where a session begins, and the mode governs what happens *inside* a phase, not which work the user wants to pick up.
49
+
50
+ ## 3. Hand over
51
+
52
+ Invoke the confirmed command with the arguments the user chose. Nothing to write, no
53
+ artifact, no `panel.json`: the command it hands to owns the rest.
@@ -0,0 +1,245 @@
1
+ ---
2
+ description: Guide to the /feat and /bug workflow system
3
+ ---
4
+
5
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/work/README.md — do not edit; change the plugin file and run the script. -->
6
+
7
+ # `/flow-feat-*` and `/flow-bug-*` workflow system
8
+
9
+ > **opencode adapter — how the Claude Code primitives named below map here.**
10
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
11
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` declared in `agents/<name>.md` (`mode: subagent`); the name comes from `agents.<role>` in `FLOW.md`, empty → do it in this context.
12
+ > - Parallel fan-out → several `@name` in one prompt, capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
13
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `opencode run -p "<command>"` with cron.
14
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
15
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
16
+ > - `/model <value>` → opencode's model picker (`/models`).
17
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared in `opencode.json` (see this adapter's `opencode.json` for the domain-memory example).
18
+
19
+ This system **orchestrates** the project's existing sub-agents and skills (it does not replace them): it persists context across phases, keeps each step from starting from scratch, and enforces a code-review gate before closing.
20
+
21
+ ## Per-repo configuration: base plus harness overlay
22
+
23
+ - `FLOW.md` at the repo root is the shared base: tracker, branch and MR/PR conventions, quality
24
+ commands, code conventions, and observability profile.
25
+ - The active `FLOW.<harness>.md` is an optional sparse overlay (`claude`, `codex`, `opencode`,
26
+ `gemini`, or `hermes`) for model names, agents, skills, orchestration, knowledge tools, or any other value that
27
+ differs on that harness. Every command reads the base and then the active overlay in step 0;
28
+ existing repos with only `FLOW.md` behave exactly as before.
29
+ - An overlay key replaces the base even when explicitly empty; an absent key inherits it. Lists
30
+ replace whole lists. Overlay `conventions` are added after base conventions. In the rest of this
31
+ document, `FLOW.md` means the effective merged configuration unless a write target is explicit.
32
+ - Template: [`examples/FLOW.template.md`](../../examples/FLOW.template.md).
33
+ - Missing file or empty key → auto-discovery or the default described in each command's section.
34
+
35
+ ## Principles
36
+
37
+ - **Shared rules live in the `flow-core` skill** (`skills/flow-core/SKILL.md`): configuration merge,
38
+ `models`, autonomy and hard gates, never-a-question list, stop header, `panel.json`,
39
+ `00-summary.md`. Every command loads it once per session.
40
+ - **One folder per ticket**: `.claude/work/{TICKET}/` holds `meta.json`, `00-summary.md`, `panel.json` and the numbered markdown artifacts.
41
+ - **Numbered artifacts**: each phase writes a `NN-phase.md` that the next step reads.
42
+ - **`evidence/`**: what `/flow-*-validate` actually observed when it drove the running app — a screenshot, a response body, a log excerpt, one file per criterion, with a **before** where the change alters something already visible. `/flow-*-ship` attaches it to the MR/PR description. `quality.evidence: off` disables both halves.
43
+ - **`meta.json` is the source of truth** for state (current phase, size, branch). Without it, commands refuse to continue.
44
+ - **Size drives the flow**: `/flow-feat-start` and `/flow-bug-start` classify the work as XS/S/M/L and suggest skipping phases for small changes.
45
+ - **Entering the flow is a choice, and sometimes the wrong one.** One sentence, one file, nothing to review (typo, version bump, log level) → **say so and offer the two-line alternative** (what to edit, what to commit) — `/flow-feat-start` §size. A work again once it needs a ticket, a later "why", a schema, a contract or a rollback story.
46
+ - **Branch with explicit base and no upstream pointing to the base** (`/flow-feat-start` §5, `/flow-bug-start` §4): base = `git.default_base` or a confirmed parent (`meta.json.stacked_on`), never `git checkout -b` from "wherever I am"; `AskUserQuestion` when not on the base; `--no-track` always; first push `git push -u origin HEAD`; `/flow-feat-ship` §4.0 / `/flow-bug-ship` §4.0 block if HEAD is the base or the upstream points to it.
47
+ - **Small, focused, loosely coupled MR/PRs**: smallest independently mergeable MR/PRs; coupling only when unavoidable, reason and merge order in `04-mr-plan.md`; an unsplittable huge one → back to `/flow-feat-plan`.
48
+ - **Understand before starting**: design-affecting doubts left after ticket + knowledge search + code → one `AskUserQuestion` with all of them before closing `/flow-feat-start` or `/flow-feat-design` §1.5.
49
+ - **Reuse before creating**: in `/flow-feat-design`, check the affected and neighbouring modules before any new entity, column, repository, service or event; justify intentional duplication in `03-design.md`; never force a poor fit.
50
+ - **Solve the real project problem, not the generic one (fit + YAGNI)**: before any defensive mechanism, **two questions with evidence** — **(a) Does it fit? Can this scenario actually happen given how this project works?** (knowledge search + code, **not** textbook patterns; already prevented → **unnecessary**); **(b) Do we need it now, for what the ticket asks?** (hypothetical → **don't add it**, "idea for a separate ticket"). Bias **remove, not add** — `/flow-feat-design` challenger ("Fit and need") and the defensive mechanisms table of `03-design.md`.
51
+ - **A change is measured against what it replaces, not only against its rivals**: a **modified** query carries the **base row** — the same query on `git merge-base HEAD <git.default_base>`, same sandbox, same seed, same three runs (`/flow-work-query` §4) — and `quality.bench_cmd` benchmarks a touched route, command, consumer or job on both sides (`/flow-*-validate` §3.7). Times are reported `min–max`, and **a difference inside the spread is "no measurable change", never a percentage**. `regressed` blocks like `change` unless the design justifies the trade. The numbers are posted as an MR/PR **comment** (`ship` §4.3), re-posted whenever a later push changes a measured path.
52
+ - **A query is judged on its plan, not on its prose**: cost lives in the **execution plan**, not the diff. `/flow-work-query`: facts, a challenger blinded to the design's rationale, the main agent judges — **no number, no win**, **no dogma in either direction**, **the objector's variant measured next to yours**. **Any size, XS included.** A performance objection is answered with a plan; an unmeasured plan is never reported as measured ("schema only" / "not measured" are legitimate verdicts; a fixture-sized test database is not evidence).
53
+ - **Size is revisable**: a later phase (`design`, `plan`, `investigate`) seeing a clear mismatch **proposes reclassifying to the user** and updates `meta.json.size`.
54
+ - **If the implementation invalidates the design, return to design**: in `/flow-feat-build`, 2+ significant deviations in `05-implementation.md`, or one changing an ADR-light decision → **pause and return to `/flow-feat-design`** (what `/flow-feat-review` and `/flow-feat-validate` read). Same for `/flow-bug-fix` vs `/flow-bug-investigate`.
55
+ - **Challenge the design/investigation before executing**: closing `/flow-feat-design` and `/flow-bug-investigate`, a *challenger* (`general-purpose` sub-agent): **first and dominant** angle **"Fit and need"** (the **excessive**), then fragile assumptions, simplification, production operation; result under "Challenges". Unanswered **high-severity** findings block closure; the user reopens, trims, or accepts and documents.
56
+ - **Business brief before writing code**: `/flow-feat-build` and `/flow-bug-fix`, before the first edit: 3-5 bullets **in business language** — what becomes possible, what is **NOT** included; `AskUserQuestion` before the first commit. Outside the brief → confirm first.
57
+ - **Comment discipline (only what earns its place)**: `/flow-feat-build`, `/flow-bug-fix`, `/flow-work-green`, `/flow-work-respond` — a comment explains only a *why* the code cannot, at the file's density. **Ticket ID, task/step number or "for MR #N" never go into a code comment.**
58
+ - **The MR/PR communicates functionality, not implementation**: title and description (`/flow-feat-ship`, `/flow-bug-ship`) start from the artifact's **Brief**, in behavioural language; technical details in an **optional section at the end**.
59
+ - **Mandatory MR/PR preview before creating**: `/flow-feat-ship` and `/flow-bug-ship` show the full block (title + assignee + squash + description) and confirm with `AskUserQuestion` — **no exceptions**; create / edit / cancel. `git.assignee`, `git.squash`, `git.request_sections`; empty → FLOW.template.md defaults.
60
+ - **Anchoring to design contracts (anti-self-deception)** — four anchors: (1) **`/flow-feat-design` §"External contracts"**: every externally consumed surface as a **literal shape**, "Pattern deviation" marked. (2) **`/flow-feat-build` §2.0bis**: **copy verbatim** into `05-implementation.md` before coding; §4.2: key-by-key textual comparison at build close. (3) **`/flow-feat-review` §5**: a **deliberately blinded** sub-agent compares the literal contracts against the shape-building hunks. (4) **`/flow-feat-ship` §6.3 → the sibling's `/flow-feat-start` §3.6**: contracts published to the tracker ticket, taken by the consuming `start` as **received, not negotiable**; `contract_handoff` in `meta.json.related_repos`. A wrong contract is faithfully confirmed — copy verbatim, never paraphrase.
61
+ - **Green is a count, not an exit code**: a filtered run (`quality.test_one`, `/flow-feat-build` §4) is judged by the number and names of tests executed, never the exit status. Likewise **borrowed code carries its reason** (§2.1) and **evidence before staging** (`/flow-feat-design` §8 — verify against `git.default_base`, never a train branch; check the output actually produced).
62
+ - **Commits follow the autonomy mode** (`/flow-feat-build` §2.2, `/flow-bug-fix` §2.1): changes **always reported before anything is recorded**. `manual`: **no `git commit` on its own**. `guided`: asks **once**. `auto`: WIP commit per step, cut by step (§2.3) — **`autonomy.mode: auto` plus typing the command is the explicit authorization**. WIP commits on the work branch **only**; push and MR/PR creation stay hard gates in every mode.
63
+ - **A named next command is not a handoff**: each `## Close` carries the **autonomy handoff** — `manual` proposes the next command with one `AskUserQuestion`; `guided`/`auto` **chain in the same turn**. Never chained: `ship` (hard gate in every mode) and anything downstream of a red gate.
64
+ - **Every stop opens with where you are** (flow-core §3): stop header, then ≤ ~10 product-altitude lines. Own process → the artifact; subagent notifications never earn a turn.
65
+ - **The stop is also written to disk**: `.claude/work/<work>/panel.json` ([schema below](#paneljson-schema), flow-core §4), **overwritten whole, never patched**, written **before** a long stretch with an honest `updated_at`.
66
+ - **What is never a question is as binding as what always is**: hard gates stop in **every** mode; in `guided`/`auto` flow mechanics, WIP commits, the train's next MR/PR, size confirmation and anything already decided are never asked (flow-core §2). Only new evidence reopens a decision.
67
+ - **A correction is a convention, and a convention is written down**: when the user overrides something a phase proposed and the same correction would apply to an unrelated ticket in this repo, it becomes a `meta.json.conventions_candidates[]` row and a `## Conventions learned` line in the phase artifact, asking nothing (flow-core §8). `review`'s idiom audit reads them in the same work; `ship` offers them to `FLOW.md` once, at Close, in every mode. What is about *this* ticket stays in the artifact and goes no further.
68
+ - **Work you decide not to do is recorded, not narrated**: every "idea for a separate ticket", out-of-scope piece, unmitigated risk, unchecked edge case and prevention action becomes a `meta.json.followups[]` entry (flow-core §7) alongside its artifact section. Written without asking, and only when it clears the bar of §7 (a named subject, a path someone has actually seen, waiting costing more than doing it). Triaged **once** at `ship`'s Close, behind a skeptic: 3 or more candidates go to an agent whose job is to refute that each deserves a ticket, and only the strongest `tracker.followup_ask_max` (empty → **2**) become questions (**Do it** / **Not worth it** / **Later**). The rest are logged. Published in the MR/PR description while still open, and surfaced by `status`/`daily`/`next` — from `_archive/` too — until decided. Creating the tracker issue for an accepted one is outward-facing: **asks in every mode**. Two kinds are not deferred work: a **`decision`** the diff depends on is asked when it surfaces (in every mode) and only a deferred one is recorded; a **`tooling`** gap goes to the debt log (`tracker.debt_log`, empty → `docs/DEBT.md`) with no question at all, not to the tracker.
69
+ - **The agent proves what it can before asking you to**: `/flow-*-validate` drives the running app over every `needs-manual` criterion first (`quality.functional_check`, or whatever `/flow-doctor` detects) and only hands over what it genuinely could not — recording the reason. A criterion is **never** marked proven on reasoning alone; reading the code and concluding it must work is `needs-manual`. What it observed is captured under `evidence/` and attached to the MR/PR.
70
+ - **Code review is mandatory**: `/flow-feat-ship` is not run and `/flow-bug-postmortem` is not closed without passing through `/*:review`.
71
+ - **Existing sub-agents**: commands delegate to the project's agents and skills; work is never duplicated.
72
+ - **The subagents' model is the repo's call, never the plugin's (`models` in FLOW.md)**: `agents` (every subagent a command improvises) · `workers` (the fan-out rounds, falling back to `agents`). Empty = **inherit**. There is no key for what the main agent does itself: **an agent cannot switch its own model** (say it, **continue**); **a named agent keeps its own** (`agents.<role>`) — flow-core §1. `/flow-doctor` prints both resolved; `quality.review_skill` owns the review panel.
73
+ - **Parallel multi-agent fan-out (optional, only where it pays)**: plain subagents. (1) `/flow-feat-design` §1.5.3: one agent per lens (minimum / reuse / reframe, + operations for L or a sensitive surface), cross-critique for L only. (2) `/flow-bug-investigate` §3.A: one agent per root cause, evidence **for and against**. (3) `/flow-feat-review` §6 and `/flow-bug-review` §5: one skeptic per **ambiguous** finding, refute-by-default. (4) `/flow-feat-build` §2.1bis and `/flow-bug-fix` §2.2: **one** skeptic on a premise the change depends on and nothing verifies — at **any size, XS included**, once per MR/PR, a category and not a depth tier, like the query duel. Other phases **do not** fan out. `manual`: offered with `AskUserQuestion`; `guided`/`auto`: runs, noted in the artifact. **The fan-out has two ceilings, and the synthesis is not a subagent**: `agents.fanout_max` (empty → **4**) per round and `agents.budget_max` (empty → **12**) for everything one command run launches, with what either cap drops **said** and the phase each command gives up first declared in it; both count agents, not findings, so grouping is intended and one-agent-per-finding past the cap is a breach; the review tier scales to the **diff under review**, not the size of the feature, and the verification gate also needs a **diff over 150 changed lines**; delegate the **gathering**, keep the **deciding**. **A heavier orchestrator is opt-in, per repo**: `agents.fanout_tool` (e.g. Claude Code's `Workflow`), rounds and ceiling unchanged; empty is the default and the portable path.
74
+ - **Knowledge sources (full cycle)**: the `knowledge` section names a tool per **role** — `search`, `stage`, `read_staging`, `save` — any MCP (domain-memory, codegraph…), CLI or skill; a role that is empty degrades (no lookup / finding stays in the artifact / artifacts are the staging / `KNOWLEDGE.md`); `knowledge.timeout_s` (2 s) or any failure → continue silently. **`knowledge.search`**: `/flow-feat-start`, `/flow-bug-start` (ticket keywords), `/flow-feat-design` (approaches, module + integrations), `/flow-bug-investigate` (component in §1.5, cause in §2). **`knowledge.stage`**: closing `/flow-feat-design` and `/flow-bug-investigate`, offer to stage non-obvious domain decisions (silence by default; per-branch). **`knowledge.read_staging`** then **`knowledge.save`** at `/flow-feat-ship` and `/flow-bug-postmortem`: offer to consolidate the "why" only.
75
+
76
+ ## `meta.json` schema
77
+
78
+ ```json
79
+ {
80
+ "ticket": "{PREFIX}XXXXX",
81
+ "type": "feat" | "bug",
82
+ "title": "Ticket title or short description",
83
+ "branch": "{PREFIX}XXXXX-slug",
84
+ "size": "XS" | "S" | "M" | "L",
85
+ "phase": "context" | "design" | "plan" | "build" | "review" | "validate" | "ship" | "investigate" | "fix" | "postmortem" | "done" | "abandoned",
86
+ // retired in v0.53.0 and still read from older works: "brainstorm" → treat as "context", "diagnose" → as "investigate"
87
+ "phases_done": ["context", ...],
88
+ "reviewed_sha": "40-char sha the last passing review read, or ''",
89
+ "validated_sha": "40-char sha the suite last went green on, or ''",
90
+ "respond_rounds": 0,
91
+ "mrs": [
92
+ {
93
+ "n": 1,
94
+ "title": "…",
95
+ "size": "S",
96
+ "status": "pending" | "in_progress" | "merged" | "closed" | "superseded",
97
+ "phases_done": ["build", "review", "validate"],
98
+ "reviewed_sha": "",
99
+ "validated_sha": "",
100
+ "respond_rounds": 0,
101
+ "wave": 1,
102
+ "depends_on": [],
103
+ "lines_est": 120,
104
+ "files_est": 6,
105
+ "url": "https://...",
106
+ "note": "reason if closed/superseded; empty otherwise"
107
+ }
108
+ ],
109
+ "related_repos": [
110
+ { "repo": "sibling-project", "scope": "what's needed there", "status": "pending" | "in_progress" | "done", "contract_handoff": "none" | "pending" | "published → <location>" }
111
+ ],
112
+ "followups": [
113
+ { "id": "F1",
114
+ "kind": "prevention" | "audit" | "out-of-scope" | "risk" | "edge-case" | "other-bug",
115
+ "title": "one line, what would be done",
116
+ "why": "one line, why it was parked and why it still matters",
117
+ "source": "design" | "plan" | "build" | "validate" | "fix" | "postmortem",
118
+ "status": "proposed" | "accepted" | "in_progress" | "declined" | "done",
119
+ "ticket": null, "work": null, "note": "" }
120
+ ],
121
+ "defaults_used": [
122
+ { "key": "agents.security", "default": "general-purpose", "phase": "review" }
123
+ ],
124
+ "conventions_candidates": [
125
+ { "id": "C1",
126
+ "text": "the rule, one line, in the user's own words",
127
+ "target": "conventions" | "quality.<key>",
128
+ "phase": "build",
129
+ "evidence": "the stop it came from",
130
+ "status": "proposed" | "added" | "declined", "note": "" }
131
+ ],
132
+ "origin": { "work": "{PREFIX}XXXXX", "followup": "F1" },
133
+ "started_at": "2026-05-11T10:00:00Z",
134
+ "updated_at": "2026-05-11T11:30:00Z",
135
+ "notes": "free-form field the user can edit"
136
+ }
137
+ ```
138
+
139
+ - **`reviewed_sha` / `validated_sha`**: which code the review / green run happened to. Written by `review` and `validate` at `## Close`, **only when the phase actually advances**, work-level and in the current `mrs[]` entry. Read by `ship` at pre-flight against `HEAD`: a delta of test files and this work's own folder passes with a note in `06-review.md`; anything else stops and asks in every autonomy mode. Empty is not a mismatch.
140
+ - **`respond_rounds`**: rounds of `/flow-work-respond` on an MR/PR. `/flow-work-respond §1` reads it against `quality.respond_max_rounds` (empty = 3) and refuses the round that would exceed it, handing the open threads back to the user.
141
+ - **`related_repos`**: the **other repos a task touches**. Captured at `/flow-feat-start` / `/flow-bug-start` §cross-repo, refined at `design`/`plan`, reminded at `ship`, shown by `daily`/`resume`/`status`. flow only notes and reminds — never touches the other repo. `[]` for single-repo.
142
+ - **`contract_handoff`**: whether the sibling knows **what shape to build against** (`scope` is prose; distinct from `status`). `none` — consumes no contract declared here. `pending` — consumes one, not handed over yet. `published → <location>` — published where that side reads it (normally the tracker ticket; `/flow-feat-ship` §6.3), picked up by the sibling's `/flow-feat-start` §3.6.
143
+ - **`followups`**: work a phase deliberately did **not** do here — a neighbouring defect found while building, a piece put out of scope while planning, a risk recorded but not mitigated, an edge case left unchecked, a prevention action from a postmortem. Written by the phase that parks it (asks nothing) when it clears the bar of flow-core §7, triaged **once** at `ship`'s Close behind a skeptic and a ceiling on how many may become questions, published in the MR/PR description while still open, and surfaced by `status`/`daily`/`next` — including from `_archive/` — until `declined` or `done`. Shape and rules: flow-core §7. `[]` when the work deferred nothing.
144
+ - **`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.
145
+ - **`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.
146
+ - **`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.
147
+ - Ticket format follows `tracker.prefix`; empty → free-form.
148
+
149
+ **`00-summary.md`** (flow-core §5): **≤ 15 lines, overwritten whole at every `## Close`**, read first by every phase (with `meta.json`) before any full artifact. Contents: what the work is (one line), size and current MR/PR, standing decisions (one line each), contracts declared or received (names and where the literal shape lives), what is pending, what the next phase must open in full. Missing (older work) → read the artifacts, write it at Close.
150
+
151
+ ## `panel.json` schema
152
+
153
+ `meta.json` is the *state machine*; `panel.json` is the *view* a reader outside the chat polls. Optional: a work that never writes it still resolves from `meta.json` alone. Writer rules (order, when, ceiling): flow-core §4.
154
+
155
+ ```json
156
+ {
157
+ "updated_at": "2026-08-06T16:45:00+02:00",
158
+ "phase": "validate",
159
+ "header": true,
160
+ "lines": [
161
+ {"text": "Expose a thread's tracking state and events", "style": "title"},
162
+ "",
163
+ {"ref": "#1", "text": "batch read sources", "mark": "wait", "link": "https://gitlab.com/…/merge_requests/9977"},
164
+ {"ref": "#2", "text": "per-event and per-recipient counters", "mark": "current"},
165
+ {"ref": "#3–#6", "text": "channel map · use case · document detail · route", "mark": "pending"},
166
+ "",
167
+ {"ref": "Now", "text": "unit suite and the test agent over #2", "mark": "info"},
168
+ {"ref": "Next", "text": "ship #2", "mark": "info"},
169
+ {"ref": "Decision", "text": "confirm the MR/PR body before I create it", "mark": "wait"},
170
+ "",
171
+ {"text": "sibling-repo still needs the endpoint contract", "mark": "block"}
172
+ ]
173
+ }
174
+ ```
175
+
176
+ - **`lines`** — one entry per line. Bare string = plain line; object takes `text`, `ref`, `mark`, `link`, `style`, `indent`. Empty string = blank line **and alignment block separator** (`ref` widths per block).
177
+ - **`mark`** — `done` · `current` · `pending` · `wait` (waiting on someone else) · `block` · `info`; the reader draws it. `style` on a marked line overrides its colour — right only when the colour *is* the information.
178
+ - **`ref`** — the column label: `#1`, `#3–#6`, `Now`, `Next`, `Decision`.
179
+ - **`link`** — URL as a **field, never pasted into `text`**; the reader shortens it to the MR/PR number and makes it clickable.
180
+ - **`stale_after_minutes`** — raises the 30-minute staleness threshold for a stretch known to run long.
181
+ - **`style`** — `normal` · `dim` · `title` · `accent` · `ok` · `warn` · `error`; semantic names, the reader owns the palette.
182
+ - **`header`** — `true` (default): the reader draws ticket, type, phase and age, which never belong in `lines`. `false` hands every line to the writer.
183
+ - **`phase`** — the phase running **right now** (`meta.json.phase` advances only at close); the reader prefers it.
184
+ - **`updated_at`** — local ISO-8601 with offset from the real clock, never carried over; lets the reader flag a stale snapshot.
185
+
186
+ **No headings over the train.** A shipped MR/PR is *open, waiting to merge*; `mark` says it per entry — `wait` shipped, `current` being worked, `done` only merged.
187
+
188
+ **Who writes it.** The 18 phase commands (flow-core §4); `/flow-feat-ship` and `/flow-bug-ship` the instant an MR/PR URL exists; `/flow-feat-plan` when the train is populated; `/flow-work-resume` (§5); `/flow-work-watch` every cycle; `/flow-work-abandon` with a terminal state. Read-only `status`, `daily`, `config`, `doctor`, `news` never write it; `/flow-work-clean` archives the folder with the panel inside.
189
+
190
+ ## Shortcuts by size
191
+
192
+ | Size | Features | Bugs |
193
+ |------|---------------------------------------------------------------------------|-----------------------------------------------------------------|
194
+ | XS | start → build → review → ship | start → fix → review → ship |
195
+ | S | start → design (abridged) → build → review → validate → ship | start → investigate (reproduce only) → fix → validate → review → ship |
196
+ | M | start → design (with §1.5 approaches) → **plan** → build → review → validate → ship | full flow |
197
+ | L | full flow (includes **plan**) | full flow |
198
+
199
+ `/flow-feat-plan` is skipped on XS/S (always 1 MR/PR); mandatory on M/L, populating `mrs` in `meta.json`. Each MR/PR's `n` **is its execution order** (topological): `depends_on` only references lower `n`, `wave` groups parallel ones — `/flow-feat-build` always starts from a startable MR/PR and flags the parallel siblings.
200
+
201
+ ## Full `/flow-feat-*` flow
202
+
203
+ `/flow-feat-start {TICKET}` → `/flow-feat-design` → `/flow-feat-plan` → `/flow-feat-build` → `/flow-feat-review` → `/flow-feat-validate` → `/flow-feat-ship`
204
+
205
+ - M/L with several MR/PRs: `build → review → validate → ship` repeats per MR/PR; `meta.json.mrs` tracks the state.
206
+ - **Each MR/PR earns its own `build`/`review`/`validate`**, recorded in its `meta.json.mrs[]` entry's `phases_done` — `/flow-feat-review`, `/flow-feat-validate` and `/flow-feat-ship` gate on *this* MR/PR's progress, not the work-level `phases_done`.
207
+ - **Train** (stacked branches, `meta.json.stacked_on` set): the next MR/PR is built on the previous branch **without waiting for it to merge** — `/flow-feat-ship §6.2` chains into the next `/flow-feat-build` per `autonomy.mode` (`manual` asks, `guided`/`auto` continue). Nothing holds the train for a merge.
208
+
209
+ ## Full `/flow-bug-*` flow
210
+
211
+ `/flow-bug-start {TICKET}` → `/flow-bug-investigate` → `/flow-bug-fix` → `/flow-bug-validate` → `/flow-bug-review` → `/flow-bug-postmortem` → `/flow-bug-ship` (alias)
212
+
213
+ ## After `ship`, before `merge`: the review loop
214
+
215
+ Two signals arrive on an open MR/PR, each with its own cross-cutting loop (feat or bug), repeated once per round until approved:
216
+
217
+ - **Machine — pipeline and conflicts.** `/flow-work-green`: failing jobs **and** the forge's merge verdict → triage → fix at the root → push. **Never green-washes**; never works around a **human** blocker. Usually runs first.
218
+ - **Human — review threads.** `/flow-work-respond`: triage → debate → agreed changes → reply. **Never resolves threads**.
219
+
220
+ ## Cross-cutting commands
221
+
222
+ - `/flow-next` — the entry point: no base or active overlay → init; work on the current branch →
223
+ resume; otherwise status.
224
+ - `/flow-work-daily [question]` — the **work assistant** (daily standup), read-only. **Local** (`.claude/work/` + git) + **forge** (open MRs/PRs, reviews awaiting you, red CI, unmergeable, unresolved threads via `git.cli`) + **tracker** (assigned tickets, priority changes via `tracker.tool`); where they cross, concrete commands (`/flow-feat-start`, `/flow-work-green`, `/flow-work-respond`). No argument → *yesterday · today · blockers*; a question → just that. External sources best-effort, never blocking; the only write is a "last seen" marker, like `/flow-news`.
225
+ - `/flow-work-status` — all works in `.claude/work/`, current phase, divergence with git.
226
+ - `/flow-work-resume` — detects the branch, reads `meta.json`, recaps, suggests the next step. **Re-reads the ticket's comment thread** (§2.5), reports only what is new since `01-context.md`, appends it to the artifact; never amends the design on its own.
227
+ - `/flow-work-try <branch>` / `/flow-work-try --back` — point the main checkout at a branch to test it here, then return; re-syncs per `git.worktree_resync`. Resolves the work behind the branch and, once the environment is up, **prints the manual test plan already written** (the `needs-manual`/`unproven` criteria, or the acceptance criteria when `validate` has not run) and offers to collect Pass/Fail/Blocked into the validation artifact. No work behind the branch → the plain switch, as before.
228
+ - `/flow-work-clean [--dry-run]` — **periodic sweep** of finished work's residue: worktree, local branch, `.claude/work/` folder (intermediate train MR/PRs never set `phase: done`, so the `ship`/`abandon` prompt never fires). Verdict per branch from **the forge** with local fallbacks, including patch-equivalence for **squash merges** (`git branch --merged` misses them); acts only on `merged`/`empty`. `unknown` never a candidate; dirty and unpushed protected; work folders **archived, never deleted**; remote never touched. **`autonomy.mode` does not authorize deletion**: `auto` confirms the list too. `--purge-archive <N>d`: separate opt-in pass over `_archive/`, only folders already committed to git.
229
+ - `/flow-work-respond [mr-iid-or-url]` — the phase **between `ship` and `merge`** for reviewer comments. Triages threads (question / nitpick / change request / design debate / out-of-scope / obsolete), drafts a response per thread **grounded in the recorded design rationale** (`03-design.md` ADR-light + the knowledge search), implements agreed changes with `build`/`fix` mechanics, replies — hard gates on every posting and push; **never resolves a thread**. One invocation per round, logged to `08-feedback.md`; does not advance `meta.json.phase`.
230
+ - `/flow-work-green [mr-iid-or-url]` — the **machine** half: the MR/PR **cannot merge**. Reads via `git.cli` the failing jobs **and** the forge's merge verdict (`detailed_merge_status`/`has_conflicts` · `mergeable`/`mergeStateStatus`/`reviewDecision`) — green ≠ mergeable. Triages every blocker (lint/style, test failure, type/build, flaky/infra, quality-gate, **conflict/behind-base**, **human**), fixes machine ones **at the root** (flow's sub-agents, `quality.*` locally), integrates the base and resolves conflicts on their merits (merge by default — no history rewrite, no force-push), pushes — hard gates on every push, rerun and base integration. **Never green-washes** (no blind reruns, no skipping a check, no `--ours`/`--theirs`); human blockers routed, not bypassed. One invocation per round, logged to `09-ci.md`; does not advance `meta.json.phase`.
231
+ - `/flow-work-query [file|query|objection]` — the **query duel**: settles a data-access query with an execution plan. Fact sheet (filter, order **with direction**, bound, join sides with real types and collations, heavy columns, rows per key, indexes from the schema), a **blinded challenger** over the twelve classic failures, judgement by the main agent (never a subagent), **measures** when the schema cannot settle it (per `data.*`; three runs per variant, plan next to time, plus `keys served`), **one** recommendation with the number. Invoked by `feat:review §3.6`, `bug:review §3.5`, `work:respond §4.G`, `feat:design`'s Access-paths table, `feat:build`, `feat:validate`, `bug:investigate` — and directly. Judges, never patches; creating or seeding a database is a hard gate in every mode, never against production. `data.*` empty → schema alone, and says so.
232
+ - `/flow-doctor` — effective merged FLOW config, with each value's source and
233
+ empty-overlay masks, validated. Read-only.
234
+ - `/flow-doctor` — the environment config assumes: CLIs installed *and* authenticated, agents discoverable, hooks executable, MCP reachable, base branch resolvable. Read-only, quiet on success.
235
+ - `/flow-work-watch {TICKET} [30m]` — autopiloted post-deploy monitoring (FLOW.md `observability`) scoped to the change, against a baseline (preceding window + same weekday of the prior week, ratios over counts); alerts immediately on any regression. Polls via `ScheduleWakeup`; touches neither code nor production.
236
+
237
+ ## Golden rules
238
+
239
+ 1. **Never skip `review`.** If the previous phase is not in `phases_done`, the command refuses.
240
+ 2. **If you edit code outside the flow**, `/flow-work-status` will flag the divergence.
241
+ 3. **Artifacts are hand-editable**. If you rewrite `03-design.md`, the next step will respect it.
242
+ 4. **A query never passes on prose.** If the diff touches a query and no plan was read, the review says "not measured" — it does not say "looks fine".
243
+ 5. **A premise the change depends on is not settled by being small.** A belief about code outside the diff that nothing verifies, and whose being wrong costs data, money or a silent wrong result, gets one skeptic at any size (`build` §2.1bis, `fix` §2.2). Unsettled is recorded unsettled.
244
+ 6. **Size is a route, never a target.** No estimate and no review threshold is ever met by deleting comments, tests or blank lines, compressing readable code, or cutting mid-change (flow-core §9).
245
+ 7. **A knowledge store is optional but recommended** when closing large features or postmortems (`knowledge.search` at least; `save` for a real store, else `KNOWLEDGE.md`).