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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alberto Vioque
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,320 @@
1
+ # flow-workflows
2
+
3
+ Guided `feat` / `bug` workflows for terminal coding agents: a ticket reaches an open MR/PR through explicit, reviewable phases, not one big prompt.
4
+ For developers running Claude Code (or opencode, Gemini CLI, Codex CLI, Hermes Agent) on real repos with tickets, reviewers and a deploy.
5
+ You get named phases, an artifact on disk after each one, hard gates the agent never crosses alone, and an autonomy dial from "ask me everything" to "run it and record what you decided".
6
+
7
+ ## Quickstart
8
+
9
+ **Claude Code**
10
+
11
+ ```
12
+ /plugin marketplace add mashware/flow-workflows
13
+ /plugin install flow@flow-plugins
14
+ /flow:init # writes FLOW.md for this repo — auto-detects, asks the minimum
15
+ /flow:next # routes you to init, resume or status, depending on where you are
16
+ ```
17
+
18
+ **Codex CLI** — same plugin, and its skills are invoked with `$flow:`
19
+
20
+ ```bash
21
+ codex plugin marketplace add https://github.com/mashware/flow-workflows.git
22
+ codex plugin add flow@flow-plugins
23
+ # then, in a new session: $flow:init · $flow:next
24
+ ```
25
+
26
+ **opencode, Gemini CLI, Hermes Agent** — one command, nothing to clone
27
+
28
+ ```bash
29
+ npx flow-workflows install opencode # or: gemini | hermes | codex
30
+ npx flow-workflows check # is a newer version out?
31
+ ```
32
+
33
+ Re-run the same line to update: it sweeps the previous version before copying. → [Other harnesses](#other-harnesses)
34
+
35
+ No ticket? `/flow:feat:start` with no arguments drafts the work from the conversation you just had.
36
+
37
+ ## The first minute
38
+
39
+ One XS work, start to ship. Four commands; each one stops with the same header and waits for you.
40
+
41
+ ```
42
+ $ /flow:feat:start PROJ-412
43
+ PROJ-412 · XS · phase start
44
+ Now: ticket read, sized XS, branch PROJ-412-digest-unsubscribe created
45
+ I need: confirm the brief — an unsubscribe link in the digest footer, no template rework
46
+
47
+ $ /flow:feat:build
48
+ PROJ-412 · XS · phase build
49
+ Now: footer partial and the opt-out check, 2 files, suite green
50
+ I need: nothing, review is next
51
+
52
+ $ /flow:feat:review
53
+ PROJ-412 · XS · phase review
54
+ Now: 3 reviewers, one finding — the link skipped the locale fallback — fixed · spent 3/12
55
+ I need: nothing, XS skips validate; ship is next
56
+
57
+ $ /flow:feat:ship
58
+ PROJ-412 · XS · phase ship
59
+ Now: MR preview ready — 2 files, +34 −4, description and test notes below
60
+ I need: confirm the preview and I push
61
+ ```
62
+
63
+ `design`, `plan` and `validate` never ran: XS prunes them. What is on disk afterwards is the work
64
+ itself, readable and editable without the agent:
65
+
66
+ ```
67
+ .claude/work/PROJ-412-digest-unsubscribe/
68
+ ├── 00-summary.md # the ≤15-line handoff every phase reads first
69
+ ├── meta.json # phase, size, branch, the MR it opened
70
+ ├── panel.json # live state, for a pane outside the chat
71
+ ├── 01-context.md # ticket, size, the questions asked at the brief
72
+ ├── 05-implementation.md # what was built, and where it left the plan
73
+ └── 06-review.md # every finding, and what was done about it
74
+ ```
75
+
76
+ **Not everything is a work.** A typo, a version bump, a log level: edit it and commit — a folder, a
77
+ branch and a review panel cost more than that change is worth. `/flow:feat:start` makes that call
78
+ itself and offers you the two-line alternative. → [PHILOSOPHY §When not to use it](docs/PHILOSOPHY.md#when-not-to-use-it)
79
+
80
+ ## The two chains
81
+
82
+ ```
83
+ feat start → design → plan → build → review → validate → ship
84
+ (§1.5 (M/L) └─── repeats per MR/PR of a train ───┘
85
+ approaches
86
+ on M/L)
87
+
88
+ bug start → investigate → fix → validate → review → postmortem → ship
89
+ (§1.5 reproduce, (M/L)
90
+ then the cause)
91
+
92
+ after ship, before merge: green ⟲ pipeline red / conflicts / behind base
93
+ respond ⟲ reviewer threads: triage, debate, change, reply
94
+
95
+ size prunes: XS start → build → review → ship S + design (abridged) + validate
96
+ M/L full chain; plan splits the work into stacked MR/PRs
97
+ ```
98
+
99
+ ## Three ideas you will not find in the other workflow plugins
100
+
101
+ - **An autonomy dial that does not decay.** `auto` is only worth having if it never drifts back into
102
+ asking, so the list of what `guided`/`auto` must **never** ask about is written down and enforced,
103
+ next to the hard gates that stop in every mode. → [Autonomy](#autonomy)
104
+ - **A cost ceiling per command, and the cost printed in the output.** Two ceilings that count agents
105
+ rather than findings — one per parallel round, one for everything a command run launches — each
106
+ command declaring which phase it gives up first, and `review` reporting `spent/budget` and what
107
+ the ceiling skipped. → [Token budget](#token-budget)
108
+ - **Work you decide not to do does not evaporate.** Every out-of-scope piece, unmitigated risk and
109
+ unchecked edge case becomes a record in `meta.json`, triaged once at `ship` with one question
110
+ each, and named in the MR/PR description if it is still open. → [How it works](#how-it-works)
111
+
112
+ ## Autonomy
113
+
114
+ `autonomy.mode` in `FLOW.md`, changeable at any time:
115
+
116
+ | Mode | Decisions | Next phase |
117
+ |---|---|---|
118
+ | `manual` *(default)* | Stops at every one | Proposed as a one-click confirmation, never run unconfirmed |
119
+ | `guided` | Resolves low-risk ones and records them; asks at the real ones | Chains automatically |
120
+ | `auto` | Also resolves the rest, with recorded defaults | Chains without pausing |
121
+
122
+ Hard gates — the flow stops and asks in **every** mode:
123
+
124
+ 1. Any push or MR/PR creation (all of `ship`).
125
+ 2. Creating a branch when the base is ambiguous.
126
+ 3. A DB schema change or migration.
127
+ 4. Shipping a review with high-severity findings.
128
+ 5. The business brief before touching code — what you get afterwards, and what is *not* included.
129
+
130
+ Symmetrically, `guided`/`auto` never ask about the flow's own machinery (panels, reviewer counts, WIP commits, the next MR/PR of a train). → [CONFIGURATION §autonomy](docs/CONFIGURATION.md#autonomy)
131
+
132
+ ## Commands you will use every day
133
+
134
+ | Command | What it does |
135
+ |---|---|
136
+ | `/flow:next` | Entry point — routes to init, resume or status depending on where you are |
137
+ | `/flow:feat:start` | Read the tracker, classify size, create the branch and initial artifact |
138
+ | `/flow:feat:build` | Implement following the approved design, keeping a log |
139
+ | `/flow:feat:review` | Mandatory multi-agent code review before shipping |
140
+ | `/flow:feat:ship` | Commit, push, open the MR/PR, offer to save domain knowledge |
141
+ | `/flow:bug:start` | Start the incident flow (tracker, size, branch, initial artifact) |
142
+ | `/flow:bug:fix` | Implement the minimal fix and keep a log |
143
+ | `/flow:work:status` | All open work items and their next step |
144
+ | `/flow:work:resume` | Resume the work tied to the current branch |
145
+ | `/flow:work:green` | Mergeable loop — the MR/PR cannot merge: triage, fix at the root, push. Never green-washes |
146
+ | `/flow:work:respond` | Review loop — triage the threads, debate, implement what you agreed, reply. Never resolves threads |
147
+
148
+ ## Everything else
149
+
150
+ | Command | What it does |
151
+ |---|---|
152
+ | `/flow:feat:design` | Options and angles first (M/L), then architecture, DB, APIs and risks — before touching code |
153
+ | `/flow:feat:plan` | Split the work into small, independently mergeable MR/PRs |
154
+ | `/flow:feat:validate` | Tests, edge cases and integrity — drives the app itself before asking you to |
155
+ | `/flow:bug:investigate` | Reproduce the failure, then find the root cause and not the symptom |
156
+ | `/flow:bug:validate` | Regression test that fails before, passes after |
157
+ | `/flow:bug:review` | Multi-agent code review of the fix |
158
+ | `/flow:bug:postmortem` | Lessons learned, areas to monitor (M/L incidents) |
159
+ | `/flow:bug:ship` | Commit, push, MR/PR for the fix (carries the postmortem summary) |
160
+ | `/flow:init` | Wizard that generates this repo's `FLOW.md` |
161
+ | `/flow:doctor` | What `FLOW.md` resolves to — set vs empty and its fallback — then whether the environment honours it: CLIs installed *and authenticated*, agents, hooks, MCP |
162
+ | `/flow:work:query` | Query duel — fact sheet, blinded challenger, verdict by execution plan against the base version |
163
+ | `/flow:work:watch` | Post-deploy watcher — monitors observability, flags regressions |
164
+ | `/flow:work:daily` | Standup across local + forge + tracker; ask a question or get the briefing |
165
+ | `/flow:work:try` | Point the main checkout at a branch to test it, and print the manual test plan once it is up (then `--back`) |
166
+ | `/flow:work:clean` | Sweep merged worktrees, dead branches, unarchived folders. Never deletes on a guess |
167
+ | `/flow:work:abandon` | Close a work item without shipping |
168
+ | `/flow:news` | What changed in the plugin since the version you last saw |
169
+
170
+ ## What a work looks like on disk
171
+
172
+ One folder per work under `.claude/work/`, named `<TICKET>-<slug>` (or `<slug>` when ticket-less):
173
+
174
+ ```
175
+ .claude/work/PROJ-123-billing-retry-window/
176
+ ├── 00-summary.md # ≤15-line handoff, read first by every phase
177
+ ├── meta.json # source of truth: phase, size, branch, MR/PRs, related repos
178
+ ├── panel.json # live state for an external reader (below)
179
+ ├── 01-context.md # ticket, size, branch, first questions
180
+ ├── 03-design.md # approaches considered + architecture + ADR-light + external contracts
181
+ ├── 04-mr-plan.md # the MR/PR split, order and dependencies
182
+ ├── 05-implementation.md # running log, deviations from the design
183
+ ├── 06-review.md # findings and what was done about them
184
+ ├── 07-validation.md # tests, edge cases, integrity
185
+ ├── 08-feedback.md # respond: one entry per review round
186
+ ├── 09-ci.md # green: one entry per round of merge blockers
187
+ └── evidence/ # what validate observed in the running app; ship attaches it to the MR/PR
188
+ ```
189
+
190
+ A bug writes `03-investigation.md` (reproduction, then root cause), `04-fix.md`, `05-validation.md`, `06-review.md` and, on M/L, `99-postmortem.md`. `abandon` writes `99-abandoned.md` and moves the folder to `_archive/`.
191
+
192
+ Artifacts are **hand-editable**: rewrite `03-design.md` and the next phase respects it. `meta.json` is the state; without it, commands refuse to continue rather than guess.
193
+
194
+ ## Configuration: base plus harness overlay
195
+
196
+ `FLOW.md` at the repo root is the shared base. `FLOW.claude.md`, `FLOW.codex.md`,
197
+ `FLOW.opencode.md`, `FLOW.gemini.md`, or `FLOW.hermes.md` can sparsely override values for the product executing the
198
+ command. Existing repos with only `FLOW.md` behave exactly as before; anything effectively empty
199
+ is auto-detected or asked for.
200
+
201
+ | Section | What it configures |
202
+ |---|---|
203
+ | `tracker` | Ticket prefix, CLI, view and comment-thread commands, state transitions |
204
+ | `git` | Host (which decides the term and the CLI), base branch, branch pattern, MR/PR sections, squash, worktrees, pre-deploy gate |
205
+ | `autonomy` | `manual` · `guided` · `auto` (hard gates always ask) |
206
+ | `quality` | Test / lint / analysis / DB commands, `review_depth`, review panel, `respond_max_rounds`, `functional_check`, `evidence` |
207
+ | `agents` | Role → specialist agent map, cost ceilings (`fanout_max` per round, `budget_max` per command), fan-out orchestrator (`fanout_tool`) |
208
+ | `models` | Model for the subagents — `agents` (improvised ones) · `workers` (fan-out rounds) |
209
+ | `data` | How to read a query's execution plan and the real size of the hot tables |
210
+ | `conventions` | Rules the code must respect |
211
+ | `notes` | Extra mandatory instructions per command |
212
+ | `knowledge` | Knowledge sources by role — `search`, `stage`, `read_staging`, `save` — any MCP ([`domain-memory`](https://github.com/mashware/domain-memory), `codegraph`…), CLI or skill |
213
+ | `observability` | The profile `/flow:work:watch` monitors after a deploy |
214
+
215
+ `/flow:init` writes a compact base and creates the active overlay only when it has a
216
+ harness-specific value. It offers to git-ignore `/FLOW.md`, `/FLOW.*.md`, and `.claude/work/`.
217
+ Both files are personal config, not team config
218
+ ([why](docs/PHILOSOPHY.md#personal-config-not-team-config)). Resolution and examples:
219
+ [CONFIGURATION](docs/CONFIGURATION.md#harness-overlays).
220
+
221
+ ## How it works
222
+
223
+ Two mechanisms that are easy to miss in the command list and are most of what makes the flow
224
+ usable on real work.
225
+
226
+ **Work you decide not to do does not evaporate.** Every "idea for a separate ticket", out-of-scope piece, unmitigated risk, unchecked edge case and postmortem prevention action becomes a record in `meta.json`, not just a line in an artifact that gets archived unread. The phases that park them ask nothing. `ship` triages the whole set **once**, at the end, with one question per item: *do it* (which opens the tracker issue and offers to start it), *not worth it*, or *later*. Whatever is still open when the MR/PR is created is named in its description, so a reviewer can see what was consciously left out. `status`, `daily` and `next` keep surfacing the undecided ones — including from `_archive/`, because a finished work is exactly when its deferrals become invisible. Two things are deliberately **not** deferred work: a **product decision** the current diff depends on is asked the moment it surfaces, in every mode, because parking it makes the diff guess; and a gap in the repo's own **tooling** goes to a versioned debt log (`tracker.debt_log`) with *log it*, not to the tracker.
227
+
228
+ **`panel.json`** makes the work readable from outside the chat: every stop is written there too, so a pane or dashboard can show the MR/PR train with links, what runs now, what comes next, whether it waits on you, and any blocker. Each line says *what it is* (`mark`: `done` `current` `pending` `wait` `block` `info`); the reader owns symbols and colours. Overwritten whole, and written *before* a long stretch with an honest `updated_at`, so a step that died halfway never shows as finished. It carries the phase *running*, not the one `meta.json` records. Schema: [work/README](plugins/flow/commands/work/README.md#paneljson-schema).
229
+
230
+ ## Token budget
231
+
232
+ - The shared rules live in the `flow-core` skill, loaded once per session; a command file carries only its phase.
233
+ - Every phase reads `meta.json` and `00-summary.md` first and opens a full artifact only on demand.
234
+ - `quality.review_depth: light` runs only the base code-review — no panel, reinforcements or skeptics.
235
+ - The review tier scales to the **diff under review**, not the size of the feature: a 40-line MR/PR in an L-sized work is reviewed as the 40 lines it is.
236
+ - Two ceilings, both counting agents rather than findings: `agents.fanout_max` per parallel round (default 4) and `agents.budget_max` for everything one command run launches (default 12). Each command declares which phase it gives up first, and what a ceiling drops is reported.
237
+ - The review output prints its cost as `spent/budget`: subagents launched, tier, effort, and every phase the ceiling skipped.
238
+ - Which is why nothing here ever asks you to `/compact`: the phase boundary already is the compaction point, and it is selective, on disk and reversible. → [PHILOSOPHY](docs/PHILOSOPHY.md#nothing-here-asks-you-to-compact)
239
+
240
+ ## Other harnesses
241
+
242
+ The same commands, in each harness's own shape. Only the invocation syntax differs:
243
+
244
+ | Harness | Install | Invoked as |
245
+ |---|---|---|
246
+ | **Codex CLI** | `codex plugin add flow@flow-plugins` (see [Quickstart](#quickstart)) | `$flow:feat-start` |
247
+ | **Codex CLI**, one repo only | `npx flow-workflows install codex project` → `.agents/skills/` | `$flow-feat-start` |
248
+ | **opencode** | `npx flow-workflows install opencode` | `/flow-feat-start` |
249
+ | **Gemini CLI** | `npx flow-workflows install gemini` | `/flow:feat:start` |
250
+ | **Hermes Agent** | `npx flow-workflows install hermes` | `/flow-feat-start` |
251
+
252
+ Updating is the same command again — it removes the previous version's files first, so a command
253
+ dropped upstream does not linger. `npx flow-workflows check` compares what your harnesses run
254
+ against the newest release. From a clone, `adapters/install.sh <harness> [project]` does the same
255
+ thing without Node; the preflight installs both ways and fails if the results differ by one byte.
256
+
257
+ The mirrors are **generated** from the plugin commands by `script/adapter-build.py` and checked mechanically on every preflight (format, prefix, cited paths, install location).
258
+ They have **not** been executed end to end in those harnesses — validate as you use them. → [adapters/README](adapters/README.md)
259
+
260
+ ## Documentation
261
+
262
+ | | |
263
+ |---|---|
264
+ | [CONCEPTS](docs/CONCEPTS.md) | Glossary — every term, with where it is specified |
265
+ | [PHILOSOPHY](docs/PHILOSOPHY.md) | Why it is built this way (short) |
266
+ | [DESIGN](docs/DESIGN.md) | The rationale behind every rule |
267
+ | [CONFIGURATION](docs/CONFIGURATION.md) | Complete `FLOW.md` reference |
268
+ | [WORKFLOWS](docs/WORKFLOWS.md) | `green`, `respond`, `query`, `watch`, `daily`, `clean`, cross-repo tasks |
269
+ | [work/README](plugins/flow/commands/work/README.md) | Internal guide: principles, schemas, size shortcuts, golden rules |
270
+ | [CHANGELOG](plugins/flow/CHANGELOG.md) | What changed, version by version |
271
+ | [adapters/README](adapters/README.md) | Installing on opencode / Gemini CLI / Codex CLI / Hermes Agent |
272
+ | [RELEASING](RELEASING.md) | Release procedure and what the preflight enforces |
273
+ | [CONTRIBUTING](CONTRIBUTING.md) | What a good contribution looks like, and what we will not take |
274
+
275
+ ## Structure
276
+
277
+ ```
278
+ flow-workflows/
279
+ ├── .claude-plugin/marketplace.json # catalog (Claude Code)
280
+ ├── .github/ preflight CI · issue forms · PR template
281
+ ├── plugins/flow/
282
+ │ ├── commands/ feat/ bug/ work/ + next, init, doctor, news
283
+ │ ├── skills/flow-core/ # shared rules, loaded once per session
284
+ │ ├── hooks/ push guard · update notice · where-you-left-off notice
285
+ │ └── examples/ FLOW.template.md · symfony/ (a worked example, never loaded)
286
+ ├── docs/ CONCEPTS · PHILOSOPHY · DESIGN · CONFIGURATION · WORKFLOWS
287
+ ├── script/check.py # release preflight
288
+ ├── script/adapter-build.py # generates the adapter mirrors
289
+ ├── script/adapter-smoke.py # are the mirrors usable?
290
+ ├── script/tests/ # hook tests
291
+ ├── RELEASING.md · CONTRIBUTING.md
292
+ └── adapters/ install.sh · opencode/ · gemini/ · codex/ · hermes/
293
+ ```
294
+
295
+ ## Before tagging a release
296
+
297
+ ```bash
298
+ python3 script/check.py # preflight: manifest, JSON/TOML, hooks, frontmatter, mirrors (static)
299
+ python3 script/adapter-smoke.py # also runs install.sh against a throwaway HOME
300
+ bash script/tests/push-guard.sh # the push guard's cases
301
+ bash script/tests/notify-update.sh # the update-notice hook's cases
302
+ bash script/tests/session-start.sh # the where-you-left-off hook's cases
303
+ ```
304
+
305
+ CI runs the same five on every PR. The preflight refuses what has shipped broken before: an empty tracked file, unparsable JSON or TOML, a manifest version out of step with `CHANGELOG.md`, a hook without its executable bit, a stale or unusable mirror. → [RELEASING](RELEASING.md)
306
+
307
+ ## What it does not ship (on purpose)
308
+
309
+ No agents and no review skill — those are stack-specific; you name yours in the effective FLOW
310
+ configuration, normally the active harness overlay. One worked set ships as an *example* and is
311
+ never loaded: [`examples/symfony/`](plugins/flow/examples/symfony/) is a filled-in `FLOW.md` plus
312
+ four reviewers for a Symfony + Doctrine repo, to copy and edit. Three generic hooks ship: a guard
313
+ against pushing to `master`/`main`, an update notice at session start, and a session-start line
314
+ saying which work this branch belongs to and where it stands. Optional dependencies (a knowledge
315
+ source such as `domain-memory` or `codegraph`, your git host CLI, a tracker CLI) improve specific
316
+ steps; without them those steps degrade and the rest works.
317
+
318
+ ## License
319
+
320
+ MIT.
@@ -0,0 +1,128 @@
1
+ # adapters — `flow` workflows for other harnesses
2
+
3
+ The `flow` plugin (in `../plugins/flow`) is for **Claude Code**. These adapters bring the same
4
+ `feat`/`bug`/`work` workflows to other terminal agents. They are **build output, not source**:
5
+ [`../script/adapter-build.py`](../script/adapter-build.py) reads every plugin command and the shared
6
+ rules in `../plugins/flow/skills/flow-core/SKILL.md`, and writes every file under
7
+ `opencode/commands/`, `codex/skills/`, `gemini/commands/flow/`, `hermes/skills/` plus one
8
+ `<harness>/CORE.md` each —
9
+ and `../plugins/flow/codex-skills/`, the same Codex skills packaged inside the plugin so
10
+ `codex plugin add` installs them (see `codex/README.md`).
11
+ The **logic and prose are the plugin's, verbatim** — only the wrapper changes.
12
+
13
+ | Harness | Commands | Subagents | MCP | Autopilot watch |
14
+ |---|---|---|---|---|
15
+ | **opencode** | `commands/*.md` (`/flow-feat-start`) | `agents/*.md` `mode:subagent`, `@name` | `opencode.json` | cron + `opencode run -p` |
16
+ | **Gemini CLI** | `commands/**/*.toml` (`/flow:feat:start`) | `.gemini/agents/*.md`, `@name` | `settings.json` `mcpServers` | cron + `gemini -p` |
17
+ | **Codex CLI** | `skills/*/SKILL.md` (`$flow-feat-start`) | `[agents.*]` in `config.toml` | `[mcp_servers.*]` | cron + `codex exec` |
18
+ | **Codex CLI, packaged** | `plugins/flow/codex-skills/` (`$flow:feat-start`) | same | same | same |
19
+ | **Hermes Agent** | `skills/*/SKILL.md` (`/flow-feat-start`) | `delegate_task`, built from the prompt | `config.yaml` `mcp_servers` | **native** `/cron add` |
20
+
21
+ ## What the generator changes per harness
22
+
23
+ Only the mechanics, and only these:
24
+
25
+ - **The wrapper** — opencode a `description:` frontmatter, Codex and Hermes a skill folder whose
26
+ `SKILL.md` carries `name:` + `description:` (the agentskills.io layout, which both read), Gemini a
27
+ TOML `description` + `prompt` string (backslashes and triple quotes escaped).
28
+ - **The prefix** — every `/flow…` invocation rewritten to the harness's own: `/flow-feat-build` for
29
+ opencode, `$flow-feat-build` for Codex (skills are invoked with `$`), `$flow:feat-build` for the
30
+ Codex plugin package (Codex namespaces a plugin's skills), `/flow:feat:build` for Gemini. Hermes
31
+ invokes its skills with a slash, so it shares opencode's `/flow-feat-build`: the file is shaped
32
+ like Codex's, the prefix is opencode's.
33
+ - **`$ARGUMENTS`** → `{{args}}` for Gemini.
34
+ - **The CORE pointer** — the plugin's `flow:flow-core` skill and `${CLAUDE_PLUGIN_ROOT}` become
35
+ `~/.claude/flow/CORE.<tool>.md`, the file `install.sh` places there. In the Codex package they stay
36
+ a skill (`$flow:flow-core`) and a relative root (`../..`), because there both actually exist.
37
+ - **A legend** right after the title, mapping the Claude Code primitives the prose names
38
+ (`AskUserQuestion`, subagents and fan-out, `ScheduleWakeup`, `TaskCreate`, `Skill …`, `/model`,
39
+ `knowledge.*` roles) to what that harness has. The legend is the `LEGEND` dict in the script;
40
+ each adapter's `PRIMITIVES.md` is its long form.
41
+
42
+ Every generated file opens with a banner saying so. Editing one by hand is wasted work — the next
43
+ build undoes it.
44
+
45
+ ## Adding or changing a command
46
+
47
+ 1. Edit the command in `../plugins/flow/commands/` (or the shared rules in
48
+ `../plugins/flow/skills/flow-core/SKILL.md`).
49
+ 2. From the repo root: `python3 script/adapter-build.py` — rewrites every mirror, deletes orphans.
50
+ 3. Commit the plugin file **and** the regenerated mirrors together.
51
+
52
+ The preflight (`script/check.py`) runs `adapter-build.py --check` and fails on any mirror that is
53
+ missing, stale or orphaned; CI runs the same on every push.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ npx flow-workflows install opencode # or: gemini | codex | hermes
59
+ npx flow-workflows install opencode project # project-scoped variant (where applicable)
60
+ npx flow-workflows check # installed vs newest release
61
+
62
+ ./install.sh opencode # the same, from a clone, without Node
63
+ ./install.sh opencode project
64
+ ```
65
+
66
+ Two installers, one behaviour: [`../bin/cli.mjs`](../bin/cli.mjs) is what `npx` runs and
67
+ `install.sh` is what a clone runs. They are separate implementations, so `adapter-smoke.py`
68
+ installs every harness **both ways against throwaway `HOME`s and fails if the two trees differ** —
69
+ the only thing that keeps them from drifting apart. `package.json` is generated by
70
+ `adapter-build.py` from the plugin manifest, so the published version can never lag the plugin's.
71
+
72
+ Either installer sweeps its own previous `flow-*` files and copies the **commands** where the
73
+ harness reads them, then puts under `~/.claude/flow/` what the plugin would read from
74
+ `${CLAUDE_PLUGIN_ROOT}`: **`CORE.<tool>.md`** (the shared rules every command reads once per
75
+ session), the **`CHANGELOG.md`** `/flow-news` · `/flow:news` shows, the **`plugin.json`** it
76
+ takes the installed version from, this harness's **config fragment**, and **`FLOW.template.md`**.
77
+ The last two land there rather than being cited in place because `npx` deletes the package
78
+ directory as soon as the command ends — a path into it would be dead by the time you opened it.
79
+ Merging the fragment into your `opencode.json` / `settings.json` / `config.toml` / `config.yaml`
80
+ is yours to do: neither installer touches your configs.
81
+
82
+ After that: place a shared **`FLOW.md`** at the root of your repo (template at
83
+ `../plugins/flow/examples/FLOW.template.md`). Add a sparse `FLOW.opencode.md`, `FLOW.gemini.md`,
84
+ `FLOW.codex.md`, or `FLOW.hermes.md` when that harness needs different model, agent, skill,
85
+ orchestration, or MCP names.
86
+ The active overlay wins key by key; an explicitly empty value masks the base. A base-only setup is
87
+ unchanged.
88
+
89
+ ## What ports and what doesn't (honest)
90
+
91
+ - **Ports unchanged**: phases (start→ship, diagnose→postmortem), rules, gates, effective FLOW
92
+ configuration (base plus active overlay), MCP
93
+ (`knowledge.*` roles, e.g. `domain-memory`), Pre-deploy + blocking thread, and **subagents** (review/investigate) —
94
+ all four harnesses have them; only the declaration format changes, and Hermes has no declaration
95
+ at all: `delegate_task` builds each child from the prompt it is given.
96
+ - **Translated by the legend** (long form in each adapter's `PRIMITIVES.md`):
97
+ - **`AskUserQuestion`**: none of them have a structured menu UI → a plain-text question with
98
+ numbered options.
99
+ - **`models` per subagent**: none of them takes a model at the call site — three declare it in the
100
+ subagent's own definition, Hermes in `delegation.model`, one value for every child of a round →
101
+ a `models` key is honoured by invoking a subagent declared with that model, or by setting that key.
102
+ No harness lets a session switch its own model, so for the steps the conductor performs itself
103
+ the configured value is reported at the phase handoff and the flow continues — same as on Claude Code.
104
+ - **Autopilot for `/flow:work:watch`**: no in-session re-wakeup → **OS cron + headless execution**.
105
+ One cycle per run; state lives in `monitor.md`, which each cycle re-reads. It works, but the
106
+ trigger is external, not the session itself. **Hermes is the exception**: its own scheduler
107
+ (`/cron add "every 30m" "…"`) repeats the cycle, so nothing outside the agent is involved — each
108
+ firing is still a fresh session with no history, which is what `monitor.md` is for.
109
+
110
+ ## What is checked, and what is still on you
111
+
112
+ Every preflight runs [`../script/adapter-smoke.py`](../script/adapter-smoke.py) over the generated files:
113
+
114
+ - each mirror **parses in the shape its harness reads** — opencode a `description:` frontmatter,
115
+ Codex and Hermes a `SKILL.md` whose `name:` matches its folder, Gemini a TOML `description` + `prompt`
116
+ - every `/flow…` invocation in the body uses **this harness's prefix** — the one mistake that hands
117
+ you a command your harness does not have
118
+ - every command and repo path it cites **exists**
119
+ - `install.sh` is executed against a **throwaway `HOME`** and the files are checked to land where that
120
+ harness looks for them, in the expected number, changelog included
121
+
122
+ ⚠️ **What none of that proves**: that the harness *runs* a workflow the way Claude Code does. These
123
+ have never been executed inside opencode, Gemini CLI, Codex or Hermes end to end. Validate as you use them,
124
+ and adjust paths if your version differs — especially Codex, whose discovery layout has already
125
+ changed once between versions (see `codex/README.md`).
126
+
127
+ > Single source of truth: `../plugins/flow/commands/` and `../plugins/flow/skills/flow-core/`.
128
+ > Change there, run `python3 script/adapter-build.py`, commit both.
@@ -0,0 +1,82 @@
1
+ # AGENTS.md — repo guide for Codex
2
+
3
+ Codex reads this file as a project guide. It points to the key resources for understanding the conventions and workflows.
4
+
5
+ ## Workflow guide
6
+
7
+ Read `FLOW.md` at the repo root before doing anything. It contains:
8
+
9
+ - **tracker**: how to read tickets (tool, command, prefix).
10
+ - **git**: branch conventions, MR/PR, squash, assignee, base branch.
11
+ - **quality**: style commands, static analysis, tests, DB schema update.
12
+ - **conventions**: code skills or coding standards that apply to this project.
13
+ - **agents**: subagent role map (architecture, persistence, api, testing, security, performance, queues, frontend, frontend_test).
14
+ - **review**: the project's code review skill.
15
+ - **domain_memory**: if enabled, use the `domain-memory` MCP at the steps indicated.
16
+ - **observability**: service profile, queries, and thresholds for post-deployment monitoring.
17
+
18
+ If `FLOW.md` doesn't exist, each workflow command auto-discovers values or uses default behavior.
19
+
20
+ ## Available workflows
21
+
22
+ Workflows are installed as Codex **skills** and invoked with the `$` prefix. Codex does not
23
+ read Claude Code's `commands/` — a skill is what it discovers, in `~/.codex/skills/` (global)
24
+ or `.agents/skills/` (this repo).
25
+
26
+ | Skill | Description |
27
+ |---|---|
28
+ | `$flow-feat-start [TICKET]` | Start a new feature (read the tracker, classify size, create branch and initial artifact) |
29
+ | `$flow-feat-design` | Design the technical solution (architecture, DB, APIs, risks) before touching code |
30
+ | `$flow-feat-plan` | Split the work into small, independently mergeable MRs/PRs before implementing |
31
+ | `$flow-feat-build` | Implement the feature following the approved design and keep a running log |
32
+ | `$flow-feat-review` | Mandatory multi-agent code review before shipping |
33
+ | `$flow-feat-validate` | Validate tests, edge cases, and integrity before shipping |
34
+ | `$flow-feat-ship` | Commit, push, MR/PR, and offer to save domain knowledge |
35
+ | `$flow-bug-start [TICKET]` | Start the bug flow (tracker, knowledge, size, branch, initial artifact) |
36
+ | `$flow-bug-investigate` | Find the root cause of the bug (not just the symptom) |
37
+ | `$flow-bug-fix` | Implement the minimal fix and keep a log |
38
+ | `$flow-bug-validate` | Regression test and verification that the bug does not return |
39
+ | `$flow-bug-review` | Multi-agent code review of the fix before submitting |
40
+ | `$flow-bug-postmortem` | Lessons learned, areas to watch, and offer to save to the knowledge store |
41
+ | `$flow-bug-ship` | Commit, push, MR/PR the fix |
42
+ | `$flow-next` | Entry point — routes to init, resume or status depending on where you are (no FLOW.md → init; a work on this branch → resume; otherwise status) |
43
+ | `$flow-init` | Assistant that generates the FLOW.md for this repo (auto-detects what it can, asks the minimum) |
44
+ | `$flow-doctor` | What this repo's FLOW.md actually says, and whether the environment it assumes exists — CLIs, auth, agents, hooks, MCP, repo state |
45
+ | `$flow-news [vX.Y.Z \| N \| all] [full]` | Show what changed in the flow plugin since the version you last saw |
46
+ | `$flow-work-daily [question]` | Your work assistant — a Scrum-style daily standup across all your work (local + forge + tracker) |
47
+ | `$flow-work-status` | Summary of all open works in .claude/work/ |
48
+ | `$flow-work-resume` | Resume the work associated with the current branch and suggest the next step |
49
+ | `$flow-work-respond [mr-iid-or-url]` | Respond to review threads on an open MR/PR — triage, debate, implement the agreed changes, reply (never resolve) |
50
+ | `$flow-work-green [mr-iid-or-url]` | Get an open MR/PR that cannot merge back to mergeable — red pipeline, conflicts or any other blocker: triage, fix at the root, push (never green-wash) |
51
+ | `$flow-work-query [file | pasted query | reviewer objection]` | Put a data-access query on trial — schema, indexes, execution plan and measured numbers decide it, never prose |
52
+ | `$flow-work-try <branch> \| --back` | Point the main checkout at a branch to test it (then return), re-syncing per FLOW.md |
53
+ | `$flow-work-clean [--dry-run]` | Sweep what finished work left behind — merged worktrees, dead branches, unarchived work folders |
54
+ | `$flow-work-watch [TICKET]` | Monitor the observability platform after a deploy and alert on errors or performance regressions (autopiloted) |
55
+ | `$flow-work-abandon` | Close a work without shipping (discarded feature, non-issue, etc.) |
56
+ | `$flow-work-README` | Guide to the /feat and /bug workflow system |
57
+
58
+ ## Artifact structure
59
+
60
+ Each work item lives in `.claude/work/{TICKET}/`:
61
+
62
+ ```
63
+ meta.json — work state (phase, size, branch)
64
+ 01-context.md — ticket context
65
+ 02-brainstorm.md — options considered (feat)
66
+ 02-diagnose.md — failure diagnosis (bug)
67
+ 03-design.md — technical design
68
+ 03-investigation.md — root cause investigation (bug)
69
+ 04-mr-plan.md — delivery plan (M/L)
70
+ 04-fix.md — fix (bug)
71
+ 05-implementation.md — implementation log
72
+ 05-validation.md — fix validation (bug)
73
+ 06-review.md — code review results
74
+ 07-validation.md — feature validation
75
+ 99-postmortem.md — postmortem (bug M/L)
76
+ 99-abandoned.md — reason for abandonment
77
+ monitor.md — post-deployment monitoring state
78
+ ```
79
+
80
+ ## Subagent configuration
81
+
82
+ The subagents used by the workflows are configured in `~/.codex/config.toml` under `[agents.<name>]`. The agent names are defined by the user in the `agents` map of `FLOW.md`. See `config.snippet.toml` in this directory for the format and commented examples.