devflow-kit 3.5.0 → 3.7.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 (146) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/README.md +10 -6
  3. package/dist/agents/code.md +7 -11
  4. package/dist/agents/{diagnose.md → debug.md} +4 -4
  5. package/dist/agents/{code-fix.md → fix.md} +7 -8
  6. package/dist/agents/{scrutinize.md → harden.md} +6 -6
  7. package/dist/agents/{code-edit.md → refactor.md} +8 -9
  8. package/dist/agents/review.md +2 -0
  9. package/dist/cli/agents-view/render.js +1 -1
  10. package/dist/cli/commands/gates.js +276 -0
  11. package/dist/cli/commands/init-seed.js +9 -1
  12. package/dist/cli/commands/init.js +34 -11
  13. package/dist/cli/commands/learning.js +12 -12
  14. package/dist/cli/commands/legacy-hooks.js +1 -1
  15. package/dist/cli/commands/memory.js +18 -0
  16. package/dist/cli/commands/uninstall.js +111 -5
  17. package/dist/cli.js +2 -0
  18. package/dist/commands/bug-analysis.md +21 -17
  19. package/dist/commands/code-review.md +65 -66
  20. package/dist/commands/debug.md +17 -17
  21. package/dist/commands/dynamic-build.md +104 -116
  22. package/dist/commands/dynamic-plan.md +13 -11
  23. package/dist/commands/dynamic-profile.md +9 -7
  24. package/dist/commands/dynamic-tickets.md +13 -11
  25. package/dist/commands/explore.md +15 -15
  26. package/dist/commands/implement.md +80 -154
  27. package/dist/commands/plan.md +34 -66
  28. package/dist/commands/release.md +11 -7
  29. package/dist/commands/research.md +14 -10
  30. package/dist/commands/resolve.md +44 -88
  31. package/dist/commands/self-review.md +44 -44
  32. package/dist/core/agent-models.js +47 -11
  33. package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
  34. package/dist/core/echo-value.js +42 -0
  35. package/dist/core/evidence-policy.js +17 -5
  36. package/dist/core/gate-level.js +213 -0
  37. package/dist/core/learning-queue-cleanup.js +1 -1
  38. package/dist/core/manifest.js +26 -10
  39. package/dist/core/migrations.js +63 -44
  40. package/dist/core/model-discovery.js +7 -1
  41. package/dist/core/plugins.js +14 -12
  42. package/dist/core/project-paths.js +3 -3
  43. package/dist/core/tracker.js +5 -33
  44. package/dist/hud/codex-usage.js +247 -0
  45. package/dist/hud/components/codex-quota.js +37 -0
  46. package/dist/hud/components/usage-quota.js +1 -1
  47. package/dist/hud/config.js +1 -0
  48. package/dist/hud/index.js +16 -3
  49. package/dist/hud/render.js +3 -1
  50. package/dist/learning-off/agents/code.md +7 -11
  51. package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
  52. package/dist/learning-off/agents/{code-fix.md → fix.md} +7 -8
  53. package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
  54. package/dist/learning-off/agents/{code-edit.md → refactor.md} +8 -9
  55. package/dist/learning-off/agents/review.md +2 -0
  56. package/dist/learning-off/commands/bug-analysis.md +9 -9
  57. package/dist/learning-off/commands/code-review.md +54 -59
  58. package/dist/learning-off/commands/debug.md +6 -10
  59. package/dist/learning-off/commands/dynamic-build.md +98 -112
  60. package/dist/learning-off/commands/dynamic-plan.md +5 -5
  61. package/dist/learning-off/commands/dynamic-profile.md +1 -1
  62. package/dist/learning-off/commands/dynamic-tickets.md +5 -5
  63. package/dist/learning-off/commands/explore.md +4 -8
  64. package/dist/learning-off/commands/implement.md +68 -146
  65. package/dist/learning-off/commands/plan.md +23 -58
  66. package/dist/learning-off/commands/release.md +4 -2
  67. package/dist/learning-off/commands/research.md +2 -2
  68. package/dist/learning-off/commands/resolve.md +33 -81
  69. package/dist/learning-off/commands/self-review.md +32 -36
  70. package/dist/skills/git/references/pr/check-merge-readiness.md +2 -0
  71. package/dist/skills/git/references/pr/update-pr-evidence.md +4 -6
  72. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +7 -9
  73. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +7 -15
  74. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +7 -15
  75. package/dist/targets/claude-code/installer.js +117 -84
  76. package/dist/targets/claude-code/learning-install.js +15 -3
  77. package/dist/targets/claude-code/tracker-servers.js +1 -1
  78. package/package.json +1 -1
  79. package/src/assets/agents/_partials/_code.mds +7 -8
  80. package/src/assets/agents/code.mds +4 -7
  81. package/src/assets/agents/{learning.md → curate.md} +8 -10
  82. package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
  83. package/src/assets/agents/evaluate.md +4 -4
  84. package/src/assets/agents/{code-fix.mds → fix.mds} +5 -5
  85. package/src/assets/agents/{scrutinize.mds → harden.mds} +6 -6
  86. package/src/assets/agents/{simplify.md → polish.md} +4 -4
  87. package/src/assets/agents/{code-edit.mds → refactor.mds} +6 -6
  88. package/src/assets/agents/review.mds +2 -0
  89. package/src/assets/agents/synthesize.md +2 -2
  90. package/src/assets/agents/test.md +2 -2
  91. package/src/assets/commands/_partials/_compliance.mds +1 -1
  92. package/src/assets/commands/_partials/_decisions.mds +26 -6
  93. package/src/assets/commands/_partials/_engine.mds +15 -15
  94. package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
  95. package/src/assets/commands/_partials/_knowledge.mds +14 -9
  96. package/src/assets/commands/_partials/_preamble.mds +4 -2
  97. package/src/assets/commands/_partials/_roster.mds +4 -4
  98. package/src/assets/commands/_partials/_settings.mds +2 -2
  99. package/src/assets/commands/_partials/_wave.mds +10 -17
  100. package/src/assets/commands/bug-analysis.mds +7 -7
  101. package/src/assets/commands/code-review.mds +51 -56
  102. package/src/assets/commands/debug.mds +2 -2
  103. package/src/assets/commands/dynamic-build.mds +67 -74
  104. package/src/assets/commands/implement.mds +65 -127
  105. package/src/assets/commands/plan.mds +21 -61
  106. package/src/assets/commands/release.mds +5 -1
  107. package/src/assets/commands/resolve.mds +28 -76
  108. package/src/assets/commands/self-review.mds +27 -27
  109. package/src/assets/mds/git/_ops_steps.mds +3 -3
  110. package/src/assets/mds/git/_pr.mds +6 -6
  111. package/src/assets/mds/tracker/_common.mds +23 -12
  112. package/src/assets/mds/tracker/_github.mds +2 -9
  113. package/src/assets/mds/tracker/_jira.mds +2 -15
  114. package/src/assets/mds/tracker/_linear.mds +2 -15
  115. package/src/assets/scripts/ci-wait.cjs +22 -4
  116. package/src/assets/scripts/claude-md-audit.cjs +66 -51
  117. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
  118. package/src/assets/scripts/hooks/background-memory-update +404 -95
  119. package/src/assets/scripts/hooks/capture-prompt +1 -1
  120. package/src/assets/scripts/hooks/capture-question +1 -1
  121. package/src/assets/scripts/hooks/capture-turn +1 -1
  122. package/src/assets/scripts/hooks/json-helper.cjs +13 -2
  123. package/src/assets/scripts/hooks/json-parse +18 -3
  124. package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
  125. package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -4
  126. package/src/assets/scripts/hooks/memory-permission +358 -0
  127. package/src/assets/scripts/hooks/preamble +1 -1
  128. package/src/assets/scripts/hooks/session-start-context +60 -47
  129. package/src/assets/scripts/hooks/session-start-memory +26 -5
  130. package/src/assets/scripts/lib/project-config.cjs +19 -4
  131. package/src/assets/scripts/resolve-settings.cjs +200 -32
  132. package/src/assets/scripts/verify-evidence.cjs +726 -9
  133. package/src/assets/skills/agent-references/SKILL.md +14 -6
  134. package/src/assets/skills/agent-references/references/commands/code-review-levels.md +19 -0
  135. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
  136. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
  137. package/src/assets/skills/agent-references/references/commands/plan-levels.md +40 -0
  138. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
  139. package/src/assets/skills/agent-references/references/synthesize/planning.md +9 -22
  140. package/src/assets/skills/agent-references/references/synthesize/review.md +11 -11
  141. package/src/assets/skills/apply-decisions/SKILL.md +6 -4
  142. package/src/assets/skills/docs-framework/SKILL.md +3 -3
  143. package/src/assets/skills/qa/SKILL.md +1 -1
  144. package/src/assets/skills/quality-gates/SKILL.md +7 -7
  145. package/src/assets/skills/quality-gates/references/report-template.md +7 -7
  146. /package/src/assets/skills/agent-references/references/{learning → curate}/maintain.md +0 -0
@@ -5,8 +5,6 @@ description: Unified design planning - combines requirements discovery, gap anal
5
5
 
6
6
  Orchestrate design planning from requirements discovery through gap analysis to implementation design. Produces a machine-readable design artifact consumed by `/implement`.
7
7
 
8
- The orchestrator only spawns agents and gates — all analytical work is done by agents.
9
-
10
8
  ## Usage
11
9
 
12
10
  ```
@@ -38,8 +36,6 @@ Note: a bare digit run is a reference **only** under `github`, and that adjudica
38
36
 
39
37
  ## Clarification Gates
40
38
 
41
- **MANDATORY**: Three gates that must complete before proceeding.
42
-
43
39
  | Gate | Phase | Purpose |
44
40
  |------|-------|---------|
45
41
  | Gate 0 | Phase 1 | Requirements discovery before exploration |
@@ -109,7 +105,7 @@ If the user says "skip" or "just proceed" — skip remaining questions, present
109
105
 
110
106
  #### Phase 2: Orient + Load Decisions
111
107
 
112
- **Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
108
+ **Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, GATE_LEVEL
113
109
  **Requires:** CONFIRMED_SCOPE
114
110
 
115
111
  **Resolve the settings line** once per worktree root, reusing a line this run already resolved for the same root. `{root}` is the worktree the values are for — the repository root when the run has one worktree:
@@ -118,9 +114,9 @@ If the user says "skip" or "just proceed" — skip remaining questions, present
118
114
  node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
119
115
  ```
120
116
 
121
- Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off` instead.
117
+ Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off GATE_LEVEL=full` instead.
122
118
 
123
- The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
119
+ The accepted line is the only source of these values.
124
120
 
125
121
  Spawn Skim agent for codebase context:
126
122
 
@@ -148,19 +144,19 @@ and using its one-line output. If the command fails (outside a git repository),
148
144
 
149
145
  When the settings line says `LEARNING=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
150
146
 
151
- The decisions ledger belongs to the repository, not to one checkout: in a linked worktree it lives in the main worktree, and a session started in a subdirectory reads the copy at the repository root. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
147
+ The decisions ledger belongs to the repository, not to one checkout: a linked worktree reads the main worktree's copy, a subdirectory session the repository root's. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
152
148
 
153
149
  ```bash
154
150
  git -C "{start}" rev-parse --path-format=absolute --show-toplevel --git-common-dir
155
151
  ```
156
152
 
157
- Line 1 is the checkout's toplevel, line 2 the repository's common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first of these that applies:
153
+ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first that applies:
158
154
 
159
155
  1. **The main worktree** — line 2 without its trailing `/.git`, when the output is exactly two lines each beginning with `/`, line 2 ends in `/.git`, and the directory left once it is removed is not your home directory and contains a `.devflow/` directory.
160
156
  2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
161
157
  3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
162
158
 
163
- This is the rule the learning hooks apply (D-LEDGER-MAIN-WORKTREE, D-PROMPT-ROOT), so you read the index the Learning agent writes.
159
+ This is the rule the learning hooks apply, so you read the index the Curate agent writes.
164
160
 
165
161
  **Step 1 — Read the pre-rendered index:**
166
162
 
@@ -169,13 +165,17 @@ Attempt to read `{ledger}/.devflow/learning/index.md`.
169
165
  - If the file exists and contains non-empty content: use that content as `DECISIONS_CONTEXT`.
170
166
  - If the file is absent or empty: set `DECISIONS_CONTEXT` to `(none)`.
171
167
 
172
- The index is one direct file read, written at render time by `render-decisions.cjs` alongside `decisions.md`/`pitfalls.md` — no `.cjs` script runs here, and the index's own footer names the files that hold each entry's full body.
168
+ The index is one direct file read, written at render time by `render-decisions.cjs` — no `.cjs` script runs here.
169
+
170
+ **Step 2 — Slice the index, then hand it on:**
173
171
 
174
- **Step 2 — Agents apply the decisions:**
172
+ When `DECISIONS_CONTEXT` is not `(none)`, hand it only to the agents whose contract declares it.
175
173
 
176
- When `DECISIONS_CONTEXT` is not `(none)`, hand it only to the agents whose contract declares it. They follow `devflow:apply-decisions`: scan the index, identify plausibly-relevant entries, Read full entry bodies on demand, and cite verbatim IDs in their reasoning. A host that uses the index in its own thread says so in its own step.
174
+ Hand each agent that takes `DECISIONS_CONTEXT` a slice, not the whole index: the index lines whose title, scope or area touch the files and task it works on, verbatim, led by `(slice: N of M entries — full index: <absolute index path>)` and closed by the index footer. When unsure, include the line. Siblings over one diff share ONE slice.
177
175
 
178
- This produces a compact index of active ADR/PF entries. Pass the Skim agent context to all subsequent agents. Pass `DECISIONS_CONTEXT` to the Design agents of the gap-analysis phase — prior decisions constrain design, known pitfalls inform gap analysis. Design agents use `devflow:apply-decisions` to Read full entry bodies on demand.
176
+ Those agents follow `devflow:apply-decisions`. A host that uses the index in its own thread says so in its own step.
177
+
178
+ This produces a compact index of active ADR/PF entries. Pass the Skim agent context to all subsequent agents. Pass `DECISIONS_CONTEXT` to the Design agents of the gap-analysis phase as one shared slice — prior decisions constrain design, known pitfalls inform gap analysis. Design agents use `devflow:apply-decisions` to Read full entry bodies on demand.
179
179
 
180
180
  ### Load Feature Knowledge
181
181
 
@@ -199,7 +199,7 @@ If `index.md` exists and contains at least one entry line, use it for relevance
199
199
 
200
200
  **Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
201
201
 
202
- Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters). The frontmatter fields `name`, `description`, and `directories` are the authoritative relevance surface — `index.md` is only a cache.
202
+ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
203
203
 
204
204
  **Step 3 — Pick relevant KBs:**
205
205
 
@@ -230,14 +230,20 @@ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
230
230
 
231
231
  A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
232
232
 
233
- **One git call, then direct reads — no `.cjs` script.** After resolving `{worktree}`, this step is 1 index read (or N frontmatter reads on fallback), plus one heading listing and one Rules read per selected KB, bounded by KB count.
233
+ **One git call, then direct reads — no `.cjs` script.**
234
234
 
235
235
  Pass `FEATURE_KNOWLEDGE` to Explore and Design agents. Pass `DECISIONS_CONTEXT` to Design agents only.
236
236
 
237
+ **Gate level.** At `standard` or `lean`, once per run, run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash and Read `<that directory>/skills/devflow:agent-references/references/commands/plan-levels.md` with the Read tool, and apply it to Phases 3-14.
238
+
239
+ - No row or rule overrides the next two lines.
240
+ - If the Read fails, or a row is missing or malformed, set `GATE_LEVEL` to `full` and say `level reference unreadable: full applied`.
241
+ - Security runs as its own Design spawn, and the design review runs, at every level and on every Revise pass.
242
+
237
243
  #### Phase 3: Explore Requirements (Parallel)
238
244
 
239
245
  **Produces:** EXPLORE_OUTPUTS
240
- **Requires:** SKIM_CONTEXT
246
+ **Requires:** SKIM_CONTEXT, GATE_LEVEL
241
247
 
242
248
  Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each with Skim agent context and `FEATURE_KNOWLEDGE: {feature_knowledge}` (from Phase 2). Include the instruction: "The FEATURE_KNOWLEDGE is a baseline — VALIDATE, EXTEND, and CORRECT it. For anything it already covers, cite its KB IDs (`{slug} KB-AP-n`) instead of restating the text. Focus on areas the feature knowledge doesn't cover and changes since it was last updated." Ask each agent for a final report of at most about 1,500 tokens: findings with file:line references, not file dumps.
243
249
 
@@ -253,8 +259,6 @@ Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each wi
253
259
  **Produces:** EXPLORATION_SYNTHESIS
254
260
  **Requires:** EXPLORE_OUTPUTS
255
261
 
256
- **WAIT** for Phase 3 to complete.
257
-
258
262
  ```
259
263
  Agent(subagent_type="Synthesize"):
260
264
  "Synthesize EXPLORATION outputs for: {feature/issues}
@@ -315,7 +319,7 @@ Focus: {completeness|architecture|security|performance|compliance|consistency|de
315
319
  DECISIONS_CONTEXT: {decisions_context}
316
320
  FEATURE_KNOWLEDGE: {feature_knowledge}
317
321
  {COMPLIANCE_FOCUS_DIRECTIVE} (compliance focus only)
318
- Resolve `${CLAUDE_CONFIG_DIR:-$HOME/.claude}` in Bash, then Read `<that directory>/skills/devflow:gap-analysis/references/compliance.md` with the Read tool and apply it as your focus patterns. (compliance focus only)
322
+ Run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash, then Read `<that directory>/skills/devflow:gap-analysis/references/compliance.md` with the Read tool and apply it as your focus patterns. (compliance focus only)
319
323
  Artifacts:
320
324
  Feature/Issues: {feature description or issue bodies}
321
325
  Exploration synthesis: {Phase 4 output}
@@ -329,8 +333,6 @@ Cite evidence from provided artifacts."
329
333
  **Produces:** GAP_SYNTHESIS
330
334
  **Requires:** GAP_OUTPUTS
331
335
 
332
- **WAIT** for Phase 5 to complete.
333
-
334
336
  ```
335
337
  Agent(subagent_type="Synthesize"):
336
338
  "Synthesize GAP ANALYSIS outputs for: {feature/issues}
@@ -391,8 +393,6 @@ Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each wi
391
393
  **Produces:** IMPL_EXPLORATION_SYNTHESIS
392
394
  **Requires:** IMPL_EXPLORE_OUTPUTS
393
395
 
394
- **WAIT** for Phase 8 to complete.
395
-
396
396
  ```
397
397
  Agent(subagent_type="Synthesize"):
398
398
  "Synthesize IMPLEMENTATION EXPLORATION outputs for: {feature/issues}
@@ -406,7 +406,7 @@ Combine into: patterns to follow, integration points, reusable code, edge cases"
406
406
  **Produces:** PLAN_OUTPUTS
407
407
  **Requires:** IMPL_EXPLORATION_SYNTHESIS, GAP_SYNTHESIS
408
408
 
409
- Spawn 3 Plan agents **in a single message**, each with implementation exploration synthesis. Ask each agent for a final report of at most about 1,500 tokens: the plan itself, not a restatement of the exploration.
409
+ Spawn 3 `Agent(subagent_type="Plan")` agents **in a single message**, each with implementation exploration synthesis. Ask each agent for a final report of at most about 1,500 tokens: the plan itself, not a restatement of the exploration.
410
410
 
411
411
  | Focus | Output |
412
412
  |-------|--------|
@@ -421,8 +421,6 @@ Implementation steps planner: include explicit gap mitigations (from Phase 6) in
421
421
  **Produces:** PLANNING_SYNTHESIS
422
422
  **Requires:** PLAN_OUTPUTS
423
423
 
424
- **WAIT** for Phase 10 to complete.
425
-
426
424
  ```
427
425
  Agent(subagent_type="Synthesize"):
428
426
  "Synthesize PLANNING outputs for: {feature/issues}
@@ -485,8 +483,9 @@ Use AskUserQuestion to present:
485
483
 
486
484
  User can:
487
485
  - **Accept** — proceed to output phases
488
- - **Revise** — re-run phases 10-12 with new constraints (loop back, no limit on revisions)
486
+ - **Revise** — when fewer than 2 revisions have run, re-run phases 10-12 with new constraints. Budget: at most 2 revisions, counted over the whole run
489
487
  - **Cancel** — stop gracefully, no artifact written
488
+ - **Restart /plan with these constraints** — offered in place of Revise once 2 revisions have run: stop gracefully, write no artifact, and print the constraints given so far for a fresh `/plan` run
490
489
 
491
490
  **MANDATORY**: Do not write design artifact until Gate 2 is confirmed.
492
491
 
@@ -622,6 +621,7 @@ Display completion summary:
622
621
  - Issue URL (if created or enriched) — and any `TRACEABILITY: DEGRADED ({reason})` lines from the Git agent
623
622
  - Gap analysis summary (N blocking, M should-address)
624
623
  - Design review summary (N anti-patterns found, M mitigated in plan)
624
+ - Gate level: {GATE_LEVEL}, with any level note
625
625
  - Suggested next step: `/implement {artifact-path}` or `/implement #{issue-number}`
626
626
 
627
627
  ---
@@ -633,76 +633,44 @@ Display completion summary:
633
633
  │
634
634
  ├─ Block 1: Requirements Discovery
635
635
  │ ├─ Phase 1: GATE 0 - Requirements Discovery ⛔ MANDATORY
636
+ │ │ ├─ Git agent (fetch-issue / fetch-issues-batch) - issue mode only
636
637
  │ │ └─ AskUserQuestion: Validate interpretation
637
638
  │ ├─ Phase 2: Orient + Load Decisions
638
- │ │ ├─ Skim agent (codebase context)
639
- │ │ └─ Read index.md → DECISIONS_CONTEXT
640
639
  │ ├─ Phase 3: Explore Requirements (PARALLEL)
641
- │ │ ├─ Explore: User perspective
642
- │ │ ├─ Explore: Similar features
643
- │ │ ├─ Explore: Constraints
644
- │ │ └─ Explore: Failure modes
645
640
  │ └─ Phase 4: Synthesize Exploration
646
- │ └─ Synthesize agent (mode: exploration)
647
641
  │
648
642
  ├─ Block 2: Gap Analysis
649
643
  │ ├─ Phase 5: Gap Analysis (PARALLEL)
650
- │ │ ├─ Design agent: completeness
651
- │ │ ├─ Design agent: architecture
652
- │ │ ├─ Design agent: security
653
- │ │ ├─ Design agent: performance
654
- │ │ ├─ Design agent: compliance (only when COMPLIANCE_ACTIVE)
655
- │ │ ├─ Design agent: consistency (multi-issue only)
656
- │ │ └─ Design agent: dependencies (multi-issue only)
657
644
  │ └─ Phase 6: Synthesize Gap Analysis
658
- │ └─ Synthesize agent (mode: design)
659
645
  │
660
646
  ├─ Block 3: Scope Approval
661
647
  │ └─ Phase 7: GATE 1 - Validate Scope + Gaps ⛔ MANDATORY
662
- │ └─ AskUserQuestion: Confirm scope and gap resolutions
663
648
  │
664
649
  ├─ Block 4: Implementation Design
665
650
  │ ├─ Phase 8: Explore Implementation (PARALLEL)
666
- │ │ ├─ Explore: Architecture
667
- │ │ ├─ Explore: Integration
668
- │ │ ├─ Explore: Reusable code
669
- │ │ └─ Explore: Edge cases
670
651
  │ ├─ Phase 9: Synthesize Implementation Exploration
671
- │ │ └─ Synthesize agent (mode: exploration)
672
652
  │ ├─ Phase 10: Plan Implementation (PARALLEL)
673
- │ │ ├─ Plan: Implementation steps
674
- │ │ ├─ Plan: Testing strategy
675
- │ │ └─ Plan: Execution strategy
676
653
  │ └─ Phase 11: Synthesize Planning
677
- │ └─ Synthesize agent (mode: planning)
678
654
  │
679
655
  ├─ Block 5: Design Review + Approval
680
656
  │ ├─ Phase 12: Design Review
681
- │ │ └─ Design agent (mode: design-review)
682
657
  │ └─ Phase 13: GATE 2 - Confirm Plan + Design Review ⛔ MANDATORY
683
- │ └─ AskUserQuestion: Final plan approval
658
+ │ └─ Revise ≤ 2 → back to Phase 10; after 2: Accept / Cancel / Restart /plan
684
659
  │
685
660
  ├─ Block 6: Output
686
661
  │ └─ Phase 14: Output
687
- │ ├─ Store design artifact ({worktree}/.devflow/docs/design/)
688
- │ ├─ Create tracker issue (optional)
689
- │ └─ Report summary + next step
662
+ │ └─ Git agent (ensure-traceable-issue) - create or enrich tracker issue (optional)
690
663
  │
691
664
  ```
692
665
 
693
666
  ## Principles
694
667
 
695
- 1. **Orchestration only** — Command spawns agents, never does agent work itself
696
- 2. **Three mandatory gates** — Gate 0 (understand), Gate 1 (scope+gaps), Gate 2 (plan+review); none may be skipped
697
- 3. **Parallel execution** — Explore phases and gap analysis run in parallel; synthesis phases wait
698
- 4. **Evidence-based gaps** — Every gap cites specific text; no speculation
699
- 5. **Scope ruthlessly** — Small, focused plans ship faster; gate 1 enforces scope discipline
700
- 6. **Strict delegation** — Never synthesize, analyze, or plan in main session; always spawn agents
701
- 7. **Design artifacts are machine-readable** — `/implement` can consume the YAML frontmatter directly
668
+ 1. **Scope ruthlessly** — Small, focused plans ship faster; gate 1 enforces scope discipline
669
+ 2. **Strict delegation** — Never synthesize, analyze, or plan in main session; always spawn agents
702
670
 
703
671
  ## Error Handling
704
672
 
705
673
  - If any agent fails, report the phase, agent type, and error
706
- - If user selects "Revise" at Gate 2, loop back to Phase 10 with user's constraints
674
+ - If user selects "Revise" at Gate 2 and fewer than 2 revisions have run, loop back to Phase 10 with user's constraints; after the second revision Gate 2 offers Accept, Cancel or "Restart /plan with these constraints" only
707
675
  - If user selects "Cancel" at any gate, stop gracefully without writing artifact
708
676
  - If `{worktree}/.devflow/docs/design/` does not exist, create it in Phase 14
@@ -58,28 +58,30 @@ Read `.release/RELEASE-FLOW.md`:
58
58
  node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
59
59
  ```
60
60
 
61
- Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off` instead.
61
+ Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off GATE_LEVEL=full` instead.
62
62
 
63
- The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
63
+ The accepted line is the only source of these values.
64
64
 
65
65
  When the settings line says `LEARNING=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
66
66
 
67
- The decisions ledger belongs to the repository, not to one checkout: in a linked worktree it lives in the main worktree, and a session started in a subdirectory reads the copy at the repository root. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
67
+ The decisions ledger belongs to the repository, not to one checkout: a linked worktree reads the main worktree's copy, a subdirectory session the repository root's. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
68
68
 
69
69
  ```bash
70
70
  git -C "{start}" rev-parse --path-format=absolute --show-toplevel --git-common-dir
71
71
  ```
72
72
 
73
- Line 1 is the checkout's toplevel, line 2 the repository's common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first of these that applies:
73
+ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first that applies:
74
74
 
75
75
  1. **The main worktree** — line 2 without its trailing `/.git`, when the output is exactly two lines each beginning with `/`, line 2 ends in `/.git`, and the directory left once it is removed is not your home directory and contains a `.devflow/` directory.
76
76
  2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
77
77
  3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
78
78
 
79
- This is the rule the learning hooks apply (D-LEDGER-MAIN-WORKTREE, D-PROMPT-ROOT), so you read the index the Learning agent writes.
79
+ This is the rule the learning hooks apply, so you read the index the Curate agent writes.
80
80
 
81
81
  Read `{ledger}/.devflow/learning/index.md`. If the file is absent or empty, set `DECISIONS_CONTEXT` to `(none)`; otherwise use the file content as `DECISIONS_CONTEXT`.
82
82
 
83
+ Hand each agent that takes `DECISIONS_CONTEXT` a slice, not the whole index: the index lines whose title, scope or area touch the files and task it works on, verbatim, led by `(slice: N of M entries — full index: <absolute index path>)` and closed by the index footer. When unsure, include the line. Siblings over one diff share ONE slice.
84
+
83
85
  ### Load Feature Knowledge
84
86
 
85
87
  Resolve `{worktree}` as the checkout's toplevel, because feature knowledge bases are committed with the branch (D-PROMPT-ROOT): from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`) — run
@@ -102,7 +104,7 @@ If `index.md` exists and contains at least one entry line, use it for relevance
102
104
 
103
105
  **Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
104
106
 
105
- Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters). The frontmatter fields `name`, `description`, and `directories` are the authoritative relevance surface — `index.md` is only a cache.
107
+ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
106
108
 
107
109
  **Step 3 — Pick relevant KBs:**
108
110
 
@@ -133,7 +135,7 @@ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
133
135
 
134
136
  A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
135
137
 
136
- **One git call, then direct reads — no `.cjs` script.** After resolving `{worktree}`, this step is 1 index read (or N frontmatter reads on fallback), plus one heading listing and one Rules read per selected KB, bounded by KB count.
138
+ **One git call, then direct reads — no `.cjs` script.**
137
139
 
138
140
  Pass `DECISIONS_CONTEXT` and `FEATURE_KNOWLEDGE` only to agents whose contract declares them; the Validate and Git agents this command spawns do not.
139
141
 
@@ -229,10 +231,12 @@ Arm 1 or 2 ⇒ ask once, via AskUserQuestion: "{u} untraced commits{, coverage u
229
231
  ## Traceability exceptions
230
232
  - `untraced` <sha12> (<author>) self-attested by @<login> at <utc>: <reason>
231
233
  - `coverage` <bound-hit|trace-unavailable|gather-indeterminate|untraced-beyond-list> self-attested by @<login> at <utc>: <reason>
234
+
232
235
  Exempt (not attested): release <n> · revert <n> · bot <n> — <sha12>, …
233
236
  ```
234
237
 
235
238
  - One `untraced` line per listed untraced commit (≤100), its `<sha12>` and `<author>` copied from that `### TRACE_MAP` line. One `coverage` line per arm-1 cause — `bound-hit` for `bound:hit`, `gather-indeterminate` for status `INDETERMINATE` or none of the five, `trace-unavailable` for any other — plus `untraced-beyond-list` when an `…and <n> more` line closes the untraced list. The `Exempt` line counts each exempt kind (its listed lines plus its `…and <n> more`) and names every listed exempt SHA.
239
+ - A blank line separates the last bullet from the `Exempt` line, so Markdown renders that line as its own paragraph and not inside the bullet. Compose the block with that blank line every time.
236
240
  - `@<login>` is `@` followed by the output of `gh api user --jq .login` when that output matches `^[A-Za-z0-9][A-Za-z0-9-]{0,38}$`. On any other output, or a failed call, it is `(login unavailable)` instead, with no `@`.
237
241
  - `<utc>` is the output of `date -u +%Y-%m-%dT%H:%M:%SZ`.
238
242
  - `<reason>` is the user's own words, made inert: replace every character outside printable ASCII (newlines and tabs included) with a space, remove every `<`, `>`, `` ` ``, `[`, `]`, `\`, `/`, `#`, `@`, `&` and `$`, collapse runs of spaces, trim, keep the first 200 characters, and trim again. A reason that is empty after this is no reason.
@@ -47,27 +47,27 @@ and using its one-line output. If the command fails (outside a git repository),
47
47
  node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
48
48
  ```
49
49
 
50
- Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off` instead.
50
+ Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off GATE_LEVEL=full` instead.
51
51
 
52
- The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
52
+ The accepted line is the only source of these values.
53
53
 
54
54
  ### Load DECISIONS_CONTEXT
55
55
 
56
56
  When the settings line says `LEARNING=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
57
57
 
58
- The decisions ledger belongs to the repository, not to one checkout: in a linked worktree it lives in the main worktree, and a session started in a subdirectory reads the copy at the repository root. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
58
+ The decisions ledger belongs to the repository, not to one checkout: a linked worktree reads the main worktree's copy, a subdirectory session the repository root's. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
59
59
 
60
60
  ```bash
61
61
  git -C "{start}" rev-parse --path-format=absolute --show-toplevel --git-common-dir
62
62
  ```
63
63
 
64
- Line 1 is the checkout's toplevel, line 2 the repository's common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first of these that applies:
64
+ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first that applies:
65
65
 
66
66
  1. **The main worktree** — line 2 without its trailing `/.git`, when the output is exactly two lines each beginning with `/`, line 2 ends in `/.git`, and the directory left once it is removed is not your home directory and contains a `.devflow/` directory.
67
67
  2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
68
68
  3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
69
69
 
70
- This is the rule the learning hooks apply (D-LEDGER-MAIN-WORKTREE, D-PROMPT-ROOT), so you read the index the Learning agent writes.
70
+ This is the rule the learning hooks apply, so you read the index the Curate agent writes.
71
71
 
72
72
  **Step 1 — Read the pre-rendered index:**
73
73
 
@@ -76,11 +76,15 @@ Attempt to read `{ledger}/.devflow/learning/index.md`.
76
76
  - If the file exists and contains non-empty content: use that content as `DECISIONS_CONTEXT`.
77
77
  - If the file is absent or empty: set `DECISIONS_CONTEXT` to `(none)`.
78
78
 
79
- The index is one direct file read, written at render time by `render-decisions.cjs` alongside `decisions.md`/`pitfalls.md` — no `.cjs` script runs here, and the index's own footer names the files that hold each entry's full body.
79
+ The index is one direct file read, written at render time by `render-decisions.cjs` — no `.cjs` script runs here.
80
80
 
81
- **Step 2 — Agents apply the decisions:**
81
+ **Step 2 — Slice the index, then hand it on:**
82
82
 
83
- When `DECISIONS_CONTEXT` is not `(none)`, hand it only to the agents whose contract declares it. They follow `devflow:apply-decisions`: scan the index, identify plausibly-relevant entries, Read full entry bodies on demand, and cite verbatim IDs in their reasoning. A host that uses the index in its own thread says so in its own step.
83
+ When `DECISIONS_CONTEXT` is not `(none)`, hand it only to the agents whose contract declares it.
84
+
85
+ Hand each agent that takes `DECISIONS_CONTEXT` a slice, not the whole index: the index lines whose title, scope or area touch the files and task it works on, verbatim, led by `(slice: N of M entries — full index: <absolute index path>)` and closed by the index footer. When unsure, include the line. Siblings over one diff share ONE slice.
86
+
87
+ Those agents follow `devflow:apply-decisions`. A host that uses the index in its own thread says so in its own step.
84
88
 
85
89
  Use `DECISIONS_CONTEXT` locally when framing research — prior decisions and pitfalls suggest areas to investigate. Follow `devflow:apply-decisions` to Read full entry bodies on demand. Pass `DECISIONS_CONTEXT` to each Research agent in Phase 4 so their findings can account for relevant decisions.
86
90
 
@@ -106,7 +110,7 @@ If `index.md` exists and contains at least one entry line, use it for relevance
106
110
 
107
111
  **Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
108
112
 
109
- Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters). The frontmatter fields `name`, `description`, and `directories` are the authoritative relevance surface — `index.md` is only a cache.
113
+ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
110
114
 
111
115
  **Step 3 — Pick relevant KBs:**
112
116
 
@@ -137,7 +141,7 @@ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
137
141
 
138
142
  A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
139
143
 
140
- **One git call, then direct reads — no `.cjs` script.** After resolving `{worktree}`, this step is 1 index read (or N frontmatter reads on fallback), plus one heading listing and one Rules read per selected KB, bounded by KB count.
144
+ **One git call, then direct reads — no `.cjs` script.**
141
145
 
142
146
  Use `FEATURE_KNOWLEDGE` **locally** for research framing. Pass to each Research agent in Phase 4.
143
147