devflow-kit 3.7.0 → 3.8.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 (184) hide show
  1. package/CHANGELOG.md +359 -1
  2. package/README.md +11 -11
  3. package/dist/agents/code.md +2 -4
  4. package/dist/agents/design.md +1 -1
  5. package/dist/agents/fix.md +6 -7
  6. package/dist/agents/git.md +1 -1
  7. package/dist/agents/harden.md +1 -1
  8. package/dist/agents/refactor.md +2 -4
  9. package/dist/agents/review.md +4 -4
  10. package/dist/agents/skim.md +2 -2
  11. package/dist/agents/triage.md +2 -2
  12. package/dist/cli/commands/capture.js +1 -1
  13. package/dist/cli/commands/curation-move-io.js +102 -0
  14. package/dist/cli/commands/curation-move-step.js +374 -0
  15. package/dist/cli/commands/{learning.js → curation.js} +302 -99
  16. package/dist/cli/commands/gate-level-prompts.js +426 -0
  17. package/dist/cli/commands/gates.js +34 -11
  18. package/dist/cli/commands/init-seed.js +11 -8
  19. package/dist/cli/commands/init.js +240 -54
  20. package/dist/cli/commands/memory.js +2 -2
  21. package/dist/cli/commands/prompt-io.js +37 -0
  22. package/dist/cli/commands/uninstall.js +81 -9
  23. package/dist/cli.js +2 -2
  24. package/dist/commands/bug-analysis.md +24 -35
  25. package/dist/commands/code-review.md +32 -36
  26. package/dist/commands/debug.md +4 -4
  27. package/dist/commands/dynamic-build.md +25 -24
  28. package/dist/commands/dynamic-plan.md +4 -4
  29. package/dist/commands/dynamic-profile.md +4 -4
  30. package/dist/commands/dynamic-tickets.md +4 -4
  31. package/dist/commands/explore.md +5 -5
  32. package/dist/commands/implement.md +52 -81
  33. package/dist/commands/plan.md +5 -5
  34. package/dist/commands/release.md +4 -4
  35. package/dist/commands/research.md +5 -5
  36. package/dist/commands/resolve.md +28 -30
  37. package/dist/commands/self-review.md +4 -12
  38. package/dist/core/assets.js +20 -20
  39. package/dist/core/curate-tuning-config.js +5 -6
  40. package/dist/core/curation-move-notice.js +84 -0
  41. package/dist/core/curation-move-skip.js +36 -0
  42. package/dist/core/curation-move.js +35 -0
  43. package/dist/core/curation-queue-cleanup.js +134 -0
  44. package/dist/core/curation-store.js +98 -0
  45. package/dist/core/{learning-variants.js → curation-variants.js} +65 -41
  46. package/dist/core/echo-value.js +11 -5
  47. package/dist/core/evidence-policy.js +1 -1
  48. package/dist/core/feature-switch.js +95 -19
  49. package/dist/core/fs-atomic.js +1 -1
  50. package/dist/core/gate-level.js +10 -2
  51. package/dist/core/git.js +16 -14
  52. package/dist/core/ledger-root.js +82 -22
  53. package/dist/core/linked-path.js +4 -4
  54. package/dist/core/manifest-lock.js +238 -0
  55. package/dist/core/manifest.js +58 -14
  56. package/dist/core/migrations.js +1 -13
  57. package/dist/core/observations.js +2 -2
  58. package/dist/core/plugins.js +15 -15
  59. package/dist/core/pool.js +26 -0
  60. package/dist/core/project-paths.js +103 -34
  61. package/dist/core/queue-drain.js +2 -2
  62. package/dist/core/tracked-areas.js +35 -0
  63. package/dist/core/tracker.js +1 -1
  64. package/dist/{learning-off → curation-off}/agents/code.md +2 -4
  65. package/dist/{learning-off → curation-off}/agents/fix.md +6 -7
  66. package/dist/{learning-off → curation-off}/agents/refactor.md +2 -4
  67. package/dist/{learning-off → curation-off}/agents/review.md +3 -3
  68. package/dist/{learning-off → curation-off}/agents/triage.md +1 -1
  69. package/dist/{learning-off → curation-off}/commands/bug-analysis.md +20 -31
  70. package/dist/{learning-off → curation-off}/commands/code-review.md +29 -33
  71. package/dist/{learning-off → curation-off}/commands/debug.md +1 -1
  72. package/dist/{learning-off → curation-off}/commands/dynamic-build.md +22 -21
  73. package/dist/{learning-off → curation-off}/commands/explore.md +1 -1
  74. package/dist/{learning-off → curation-off}/commands/implement.md +49 -78
  75. package/dist/{learning-off → curation-off}/commands/plan.md +1 -1
  76. package/dist/{learning-off → curation-off}/commands/resolve.md +25 -27
  77. package/dist/{learning-off → curation-off}/commands/self-review.md +1 -9
  78. package/dist/hud/components/{learning-counts.js → curation-counts.js} +36 -17
  79. package/dist/hud/config.js +1 -1
  80. package/dist/hud/index.js +6 -6
  81. package/dist/hud/render.js +3 -3
  82. package/dist/skills/git/references/pr/validate-branch.md +8 -5
  83. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +13 -5
  84. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +13 -5
  85. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +13 -5
  86. package/dist/targets/claude-code/{learning-install.js → curation-install.js} +85 -65
  87. package/dist/targets/claude-code/installer.js +15 -15
  88. package/dist/targets/claude-code/language-stamp.js +5 -5
  89. package/dist/targets/claude-code/post-install.js +2 -2
  90. package/dist/targets/claude-code/tracker-servers.js +1 -1
  91. package/package.json +3 -2
  92. package/src/assets/agents/_partials/_code.mds +11 -11
  93. package/src/assets/agents/code.mds +2 -2
  94. package/src/assets/agents/curate.md +8 -8
  95. package/src/assets/agents/debug.mds +6 -6
  96. package/src/assets/agents/design.mds +18 -18
  97. package/src/assets/agents/fix.mds +6 -5
  98. package/src/assets/agents/git.mds +1 -1
  99. package/src/assets/agents/harden.mds +7 -7
  100. package/src/assets/agents/knowledge.mds +23 -23
  101. package/src/assets/agents/refactor.mds +2 -2
  102. package/src/assets/agents/research.mds +15 -15
  103. package/src/assets/agents/review.mds +43 -43
  104. package/src/assets/agents/skim.mds +11 -11
  105. package/src/assets/agents/triage.mds +22 -22
  106. package/src/assets/agents/validate.md +13 -26
  107. package/src/assets/commands/_partials/_decisions.mds +13 -13
  108. package/src/assets/commands/_partials/_engine.mds +8 -8
  109. package/src/assets/commands/_partials/_knowledge.mds +29 -15
  110. package/src/assets/commands/_partials/_preamble.mds +4 -4
  111. package/src/assets/commands/_partials/_settings.mds +2 -2
  112. package/src/assets/commands/_partials/_wave.mds +7 -7
  113. package/src/assets/commands/bug-analysis.mds +37 -48
  114. package/src/assets/commands/code-review.mds +46 -50
  115. package/src/assets/commands/debug.mds +14 -14
  116. package/src/assets/commands/dynamic-build.mds +38 -37
  117. package/src/assets/commands/dynamic-plan.mds +22 -22
  118. package/src/assets/commands/dynamic-profile.mds +2 -2
  119. package/src/assets/commands/dynamic-tickets.mds +8 -8
  120. package/src/assets/commands/explore.mds +20 -20
  121. package/src/assets/commands/implement.mds +77 -98
  122. package/src/assets/commands/plan.mds +27 -27
  123. package/src/assets/commands/release.mds +12 -12
  124. package/src/assets/commands/research.mds +19 -19
  125. package/src/assets/commands/resolve.mds +56 -50
  126. package/src/assets/commands/self-review.mds +20 -20
  127. package/src/assets/mds/git/_ops.mds +3 -1
  128. package/src/assets/mds/git/_ops_pr.mds +1 -1
  129. package/src/assets/mds/git/_ops_steps.mds +10 -4
  130. package/src/assets/mds/git/_pr.mds +7 -4
  131. package/src/assets/rules/quality.md +1 -0
  132. package/src/assets/scripts/hooks/background-memory-update +2 -2
  133. package/src/assets/scripts/hooks/capture-prompt +12 -12
  134. package/src/assets/scripts/hooks/capture-question +11 -11
  135. package/src/assets/scripts/hooks/capture-turn +12 -12
  136. package/src/assets/scripts/hooks/{learning-lock → curation-lock} +2 -2
  137. package/src/assets/scripts/hooks/curation-move +293 -0
  138. package/src/assets/scripts/hooks/ensure-devflow-init +45 -13
  139. package/src/assets/scripts/hooks/ensure-proxy +4 -4
  140. package/src/assets/scripts/hooks/ensure-root-gitignore +4 -4
  141. package/src/assets/scripts/hooks/git-marker +81 -0
  142. package/src/assets/scripts/hooks/json-helper.cjs +134 -51
  143. package/src/assets/scripts/hooks/json-parse +1 -1
  144. package/src/assets/scripts/hooks/lib/curation-move.cjs +1582 -0
  145. package/src/assets/scripts/hooks/lib/{learning-store.cjs → curation-store.cjs} +242 -118
  146. package/src/assets/scripts/hooks/lib/decisions-format.cjs +3 -3
  147. package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +24 -7
  148. package/src/assets/scripts/hooks/lib/project-paths.cjs +132 -39
  149. package/src/assets/scripts/hooks/lib/render-decisions.cjs +34 -22
  150. package/src/assets/scripts/hooks/lib/tracked-areas.cjs +259 -0
  151. package/src/assets/scripts/hooks/memory-worker +1 -1
  152. package/src/assets/scripts/hooks/pre-compact-memory +6 -16
  153. package/src/assets/scripts/hooks/queue-append +228 -103
  154. package/src/assets/scripts/hooks/resolve-project-root +2 -2
  155. package/src/assets/scripts/hooks/session-start-context +143 -69
  156. package/src/assets/scripts/hooks/session-start-memory +3 -43
  157. package/src/assets/scripts/lib/project-config.cjs +12 -5
  158. package/src/assets/scripts/resolve-base.cjs +1043 -0
  159. package/src/assets/scripts/resolve-settings.cjs +42 -18
  160. package/src/assets/skills/agent-references/SKILL.md +5 -2
  161. package/src/assets/skills/agent-references/references/commands/implement-levels.md +27 -0
  162. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +6 -4
  163. package/src/assets/skills/agent-references/references/commands/resolve-levels.md +24 -0
  164. package/src/assets/skills/apply-decisions/SKILL.md +1 -1
  165. package/src/assets/skills/docs-framework/SKILL.md +7 -7
  166. package/src/assets/skills/docs-framework/references/patterns.md +3 -4
  167. package/src/assets/skills/quality-gates/SKILL.md +1 -1
  168. package/src/assets/skills/worktree-support/references/roots.md +2 -2
  169. package/templates/lint-pack/.lint-pack.conf +86 -0
  170. package/templates/lint-pack/README.md +190 -0
  171. package/templates/lint-pack/lint-pack.sh +905 -0
  172. package/dist/core/learning-queue-cleanup.js +0 -27
  173. package/dist/core/learning-store.js +0 -61
  174. /package/dist/{learning-off → curation-off}/agents/debug.md +0 -0
  175. /package/dist/{learning-off → curation-off}/agents/design.md +0 -0
  176. /package/dist/{learning-off → curation-off}/agents/harden.md +0 -0
  177. /package/dist/{learning-off → curation-off}/agents/knowledge.md +0 -0
  178. /package/dist/{learning-off → curation-off}/agents/research.md +0 -0
  179. /package/dist/{learning-off → curation-off}/agents/skim.md +0 -0
  180. /package/dist/{learning-off → curation-off}/commands/dynamic-plan.md +0 -0
  181. /package/dist/{learning-off → curation-off}/commands/dynamic-profile.md +0 -0
  182. /package/dist/{learning-off → curation-off}/commands/dynamic-tickets.md +0 -0
  183. /package/dist/{learning-off → curation-off}/commands/release.md +0 -0
  184. /package/dist/{learning-off → curation-off}/commands/research.md +0 -0
@@ -2,7 +2,7 @@
2
2
  description: Execute a single task through implementation, quality gates, and PR creation - accepts plan documents, issues, or task descriptions
3
3
  output-dir: dist/commands
4
4
  ---
5
- @import { knowledge_load, knowledge_writeback } from "./_partials/_knowledge.mds"
5
+ @import { knowledge_load, knowledge_writeback_after_load } from "./_partials/_knowledge.mds"
6
6
  @import { decisions_load } from "./_partials/_decisions.mds"
7
7
  @import { docs_root } from "./_partials/_docs_root.mds"
8
8
  @import { evidence_policy } from "./_partials/_evidence_policy.mds"
@@ -13,7 +13,7 @@ output-dir: dist/commands
13
13
  @import "./_partials/_settings.mds" as settings
14
14
  # Implement Command
15
15
 
16
- Orchestrate a single task through implementation by spawning specialized agents. The orchestrator only spawns agents and passes context - all work is done by agents.
16
+ Orchestrate a single task through implementation by spawning specialized agents.
17
17
 
18
18
  ## Usage
19
19
 
@@ -40,8 +40,6 @@ $ARGUMENTS
40
40
 
41
41
  {{issue_ref_grammar()}}
42
42
 
43
- > **Tip**: For best results, run `/plan` first to produce a design artifact, then pass it to `/implement`.
44
-
45
43
  ## Phases
46
44
 
47
45
  ### Re-validation Continuation Path
@@ -50,13 +48,13 @@ When the user explicitly asks to re-validate, re-check, or re-run quality gates
50
48
 
51
49
  ### Phase 1: Setup
52
50
 
53
- <!-- learning:on -->
54
- **Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, ISSUE_PR_LINK, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
55
- <!-- learning:off -->
56
- **Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, ISSUE_PR_LINK, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
57
- <!-- learning:end -->
51
+ <!-- curation:on -->
52
+ **Produces:** TASK_ID, BASE_BRANCH, BASE_REF, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, ISSUE_PR_LINK, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION, GATE_LEVEL
53
+ <!-- curation:off -->
54
+ **Produces:** TASK_ID, BASE_BRANCH, BASE_REF, EXECUTION_PLAN, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, ISSUE_PR_LINK, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION, GATE_LEVEL
55
+ <!-- curation:end -->
58
56
 
59
- Record the current branch name as `BASE_BRANCH`. Stop the run unless it matches `^[A-Za-z0-9._/+@,#-]{1,200}$`, telling the user it allows only ASCII letters, digits and `._/+@,#-`, at most 200.
57
+ Record the current branch name as `BASE_BRANCH`. Stop the run unless it matches `^(?![-#]|origin\/|(?:@|(?:FETCH_|ORIG_|MERGE_)?HEAD)$)(?!.*\.\.)[A-Za-z0-9._\/+@,#-]{1,200}$` (judge the match by reading; never pass the value to a command), telling the user it allows only ASCII letters, digits and `._/+@,#-`, at most 200; no leading `-` or `#`, no `origin/` prefix, no `..`, not `@` or a HEAD name.
60
58
 
61
59
  {{docs_root()}}
62
60
 
@@ -75,7 +73,7 @@ If `PR_DESCRIPTION_GUIDANCE` was not set above (non-plan paths: issue input or t
75
73
 
76
74
  **Empty input.** When `COMMAND_INPUT` is empty — a plan handoff arrives this way, with the plan already in the conversation — there is no argument to name the branch from, and the Git agent sees none of this conversation. Write the description yourself: one line, taken from the plan's title or, with no plan, from the conversation. Send it as the setup-task `TASK_DESCRIPTION` below.
77
75
 
78
- Spawn Git agent to set up task environment. The Git agent derives the branch name automatically from the issue or task description:
76
+ Spawn Git agent to set up the task:
79
77
 
80
78
  ```
81
79
  Agent(subagent_type="Git"):
@@ -90,33 +88,14 @@ Derive branch name from issue or description, create feature branch, and fetch i
90
88
  Return the branch setup summary."
91
89
  ```
92
90
 
93
- The issue token is forwarded **unclassified**, and the routing is decided by
94
- SHAPE alone — how many tokens `COMMAND_INPUT` has, and whether it ends in `.md`.
95
-
96
- `setup-task` is the one step that has resolved a provider, and therefore the only
97
- one that knows what an issue reference looks like on this machine: `#123`,
98
- `PROJ-12` and `ENG-12` are three providers' spellings of the same thing. A
99
- `starts with #` test here would be a github test wearing a neutral name — it
100
- reclassifies every other provider's reference as a task description, so the
101
- branch is derived from prose and no issue is ever fetched, with nothing reporting
102
- a problem. Token COUNT is the gate that stays provider-neutral: every one of
103
- those spellings is a single token, and no free-text task description is.
91
+ The issue token is forwarded **unclassified**; routing is by SHAPE alone (the token count of `COMMAND_INPUT` and a `.md` ending). Only `setup-task` has resolved a provider, so a `starts with #` test would be a github test that reclassifies `PROJ-12` and `ENG-12` as task descriptions: the branch comes from prose, no issue is fetched and nothing reports it. Token COUNT is provider-neutral: every issue spelling is one token and no free-text description is.
104
92
 
105
- The two tests this command does make are its own under every provider:
106
-
107
- - **Extension.** A path ending in `.md` is a plan document, never an issue
108
- reference — it goes to `PLAN_ARTIFACT_PATH` and neither of the other two keys.
109
- `ISSUE_INPUT` then carries the plan's frontmatter `issue` instead, never the
110
- path (Plan Document Handling step 4).
111
- - **Token count.** A single token is an issue reference. Two or more is prose:
112
- forwarding only its FIRST token would send `/implement fix the login bug` to
113
- the Git agent as `ISSUE_INPUT: fix` with no description at all, and
114
- `setup-task` fetches whatever it is handed — so the command would derive a
115
- branch from a failed lookup and drop the request on the floor.
93
+ - **Extension.** A path ending in `.md` is a plan document, never an issue reference: it goes to `PLAN_ARTIFACT_PATH` only, and `ISSUE_INPUT` carries the plan's frontmatter `issue`, never the path (Plan Document Handling step 4).
94
+ - **Token count.** One token is an issue reference; two or more is prose. Forwarding the FIRST token alone would send `/implement fix the login bug` as `ISSUE_INPUT: fix` with no description, so the request is dropped.
116
95
 
117
96
  **Capture from Git agent output** (used throughout flow):
118
97
  - `TASK_ID`: The branch name created by Git agent (use as TASK_ID for rest of flow)
119
- - `BASE_BRANCH`: Branch this feature was created from (for PR target)
98
+ - `BASE_BRANCH`: Branch this feature was created from (for PR target); stop unless it passes the setup check
120
99
  - `ISSUE_NUMBER`: the provider-canonical issue identifier for this task — the same value the Git agent emits as `ISSUE_ID` (if provided, or created by the Git agent's issue-first step in setup-task)
121
100
  - `branch_slug`: `TASK_ID` with every `/` replaced by `-`. It names `handoff-{branch_slug}.md` and `evidence-{branch_slug}.md` only when it matches `^[A-Za-z0-9._-]{1,200}$`; any other branch name stops the run here, telling the user it cannot name those files.
122
101
 
@@ -162,18 +141,20 @@ Phase 11 passes the resolved value to the evidence script (`publish`), which dec
162
141
  Pass `COMPLIANCE_DIRECTIVE` to every Code and Fix spawn, on a line of its own.
163
142
 
164
143
  {{decisions_load()}}
165
- <!-- learning:on -->
144
+ <!-- curation:on -->
166
145
  Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and Harden agent (Phase 4).
167
146
 
168
- <!-- learning:end -->
147
+ <!-- curation:end -->
169
148
  {{knowledge_load()}}
170
149
 
150
+ **Fresh base.** Before Phase 2, write `BASE_BRANCH` with the Write tool to the file that `F="$(mktemp)" && echo "F=$F"` prints, after one Read of it. If the Write tool fails, treat the value as missing; never write it with a shell command. Then run `F="{name file}"; trap 'rm -- "$F"' EXIT; cd "{worktree}" && node "$HOME/.devflow/scripts/resolve-base.cjs" local --name-stdin < "$F"; echo "exit=$?"`. Output other than one `BASE_REF=` line (40 or 64 hex, or `none`) with `exit=0` counts as `NOTE=stop`, `REASON=resolver-unavailable`. Record `BASE_REF`. By `NOTE`: `none` continues; `info` prints one plain line; `degraded` records `TRACEABILITY: DEGRADED (base {REASON}; fix: {fix})`; `stop` (`BASE_REF=none`) stops the run, naming REASON and its fix. Fix by REASON: no-merge-base `git fetch --unshallow`; no-ref or timeout `git fetch origin <base>` (`<base>` stays as written); resolver-unavailable `re-run; if it repeats, run devflow init`; invalid-name the allowed set, never the name; any other REASON none, and `; fix: {fix}` is left out.
151
+
171
152
  ### Phase 2: Implement
172
153
 
173
154
  **Produces:** CODE_AGENT_OUTPUT, FILES_CHANGED
174
155
  **Requires:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN
175
156
 
176
- Based on Setup context (plan document, issue body, or conversation context), use the three-strategy framework:
157
+ Setup context is the plan document, issue body or conversation.
177
158
 
178
159
  **Strategy Selection**:
179
160
  - If plan document provided: use `execution-strategy` from frontmatter (if absent, use the table below)
@@ -187,7 +168,7 @@ Based on Setup context (plan document, issue body, or conversation context), use
187
168
 
188
169
  ---
189
170
 
190
- **SINGLE_CODE_AGENT** (default):
171
+ **SINGLE_CODE_AGENT**:
191
172
 
192
173
  ```
193
174
  Agent(subagent_type="Code"):
@@ -198,15 +179,15 @@ BASE_BRANCH: {base branch}
198
179
  EXECUTION_PLAN: {full plan from setup context}
199
180
  PATTERNS: {patterns from plan document or empty}
200
181
  FEATURE_KNOWLEDGE: {feature_knowledge}
201
- <!-- learning:on -->
182
+ <!-- curation:on -->
202
183
  DECISIONS_CONTEXT: {decisions_context}
203
- <!-- learning:end -->
184
+ <!-- curation:end -->
204
185
  {COMPLIANCE_DIRECTIVE}"
205
186
  ```
206
187
 
207
188
  ---
208
189
 
209
- **SEQUENTIAL_CODE_AGENTS** (>= 10 files or >= 7 steps):
190
+ **SEQUENTIAL_CODE_AGENTS**:
210
191
 
211
192
  Spawn Code agents one at a time. Each appends its own phase section to the handoff file, and the next reads only the section before it:
212
193
 
@@ -220,9 +201,9 @@ BASE_BRANCH: {base branch}
220
201
  EXECUTION_PLAN: {phase 1 steps}
221
202
  PATTERNS: {patterns from plan document or empty}
222
203
  FEATURE_KNOWLEDGE: {feature_knowledge}
223
- <!-- learning:on -->
204
+ <!-- curation:on -->
224
205
  DECISIONS_CONTEXT: {decisions_context}
225
- <!-- learning:end -->
206
+ <!-- curation:end -->
226
207
  {COMPLIANCE_DIRECTIVE}
227
208
  HANDOFF_REQUIRED: true
228
209
  HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
@@ -240,19 +221,19 @@ PATTERNS: {patterns from plan document or empty}
240
221
  PRIOR_PHASE_SUMMARY: {summary from previous Code agent}
241
222
  FILES_FROM_PRIOR_PHASE: {list of files created}
242
223
  FEATURE_KNOWLEDGE: {feature_knowledge}
243
- <!-- learning:on -->
224
+ <!-- curation:on -->
244
225
  DECISIONS_CONTEXT: {decisions_context}
245
- <!-- learning:end -->
226
+ <!-- curation:end -->
246
227
  {COMPLIANCE_DIRECTIVE}
247
228
  HANDOFF_REQUIRED: {true if not last phase}
248
229
  HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
249
230
  ```
250
231
 
251
- **Handoff Protocol**: Each sequential Code agent receives the prior Code agent's implementation summary via PRIOR_PHASE_SUMMARY and FILES_FROM_PRIOR_PHASE. The Code agent's built-in branch orientation step handles git log scanning, file reading, and pattern discovery automatically. Each Code agent with HANDOFF_REQUIRED=true appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{worktree}/.devflow/docs/handoff-{branch_slug}.md` (survives context compaction), never rewriting an earlier section and keeping any `## Evidence Exceptions` section byte-identical; the next Code agent reads only the section of the phase immediately before its own through HANDOFF_FILE. The orchestrator writes no phase section. Delete `{worktree}/.devflow/docs/handoff-{branch_slug}.md` once the PR exists — after Phase 9 (cleanup).
232
+ **Handoff Protocol**: Each Code agent with HANDOFF_REQUIRED=true appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{worktree}/.devflow/docs/handoff-{branch_slug}.md`, never rewriting an earlier section and keeping any `## Evidence Exceptions` section byte-identical; the next Code agent reads only the section of the phase immediately before its own through HANDOFF_FILE. The orchestrator writes no phase section. Delete `{worktree}/.devflow/docs/handoff-{branch_slug}.md` once the PR exists — after Phase 9 (cleanup).
252
233
 
253
234
  ---
254
235
 
255
- **PARALLEL_CODE_AGENTS** (rare - truly independent artifacts):
236
+ **PARALLEL_CODE_AGENTS**:
256
237
 
257
238
  Spawn multiple Code agents **in a single message**, each with independent subtask:
258
239
 
@@ -265,9 +246,9 @@ BASE_BRANCH: {base branch}
265
246
  EXECUTION_PLAN: {subtask 1 steps}
266
247
  PATTERNS: {patterns}
267
248
  FEATURE_KNOWLEDGE: {feature_knowledge}
268
- <!-- learning:on -->
249
+ <!-- curation:on -->
269
250
  DECISIONS_CONTEXT: {decisions_context}
270
- <!-- learning:end -->
251
+ <!-- curation:end -->
271
252
  {COMPLIANCE_DIRECTIVE}"
272
253
 
273
254
  Agent(subagent_type="Code"): # Code agent 2 (same message)
@@ -278,24 +259,26 @@ BASE_BRANCH: {base branch}
278
259
  EXECUTION_PLAN: {subtask 2 steps}
279
260
  PATTERNS: {patterns}
280
261
  FEATURE_KNOWLEDGE: {feature_knowledge}
281
- <!-- learning:on -->
262
+ <!-- curation:on -->
282
263
  DECISIONS_CONTEXT: {decisions_context}
283
- <!-- learning:end -->
264
+ <!-- curation:end -->
284
265
  {COMPLIANCE_DIRECTIVE}"
285
266
  ```
286
267
 
287
- **Independence criteria** (all must be true for PARALLEL_CODE_AGENTS):
288
- - No shared contracts or interfaces
289
- - No integration points between subtasks
290
- - Different files/modules with no imports between them
291
- - Each subtask is self-contained
268
+ **Independence criteria** (all must be true for PARALLEL_CODE_AGENTS): no shared contracts, interfaces or integration points between subtasks; different files/modules with no imports between them.
292
269
 
293
270
  ### Phase 3: Polish
294
271
 
295
272
  **Produces:** POLISH_OUTPUT
296
- **Requires:** BASE_BRANCH
273
+ **Requires:** BASE_REF, GATE_LEVEL
297
274
 
298
- After the Code agent completes, spawn Polish agent to polish the code. The Phase 6 Validate covers its commits. `{branch_diff}` is the output of `git diff --name-only --diff-filter=d {BASE_BRANCH}...HEAD`, run again at each spawn.
275
+ **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/implement-levels.md` with the Read tool, and apply each row to the phase it names.
276
+
277
+ - No row or rule overrides the next two lines.
278
+ - If the Read fails, or the file has no `## Phases` heading with the `| Phase | standard | lean |` header, or a row breaks its grammar, apply no row, keep `GATE_LEVEL` and say `level reference unreadable: no level rows applied`.
279
+ - Validate, the CI gate, the evidence claims and the compliance directive run at every level. An enabled compliance lens keeps Harden.
280
+
281
+ After the Code agent completes, spawn Polish agent to polish the code. The Phase 6 Validate covers its commits. `{branch_diff}` is the output of `git diff --name-only --diff-filter=d {BASE_REF}...HEAD`, run again at each spawn; a non-zero exit stops, and an empty list counts only on exit 0.
299
282
 
300
283
  ```
301
284
  Agent(subagent_type="Polish"):
@@ -309,17 +292,17 @@ Commit any improvements with a conventional-commit message."
309
292
  ### Phase 4: Self-Review
310
293
 
311
294
  **Produces:** HARDEN_OUTPUT
312
- **Requires:** BASE_BRANCH
295
+ **Requires:** BASE_REF
313
296
 
314
- After Polish agent completes, spawn Harden agent as the quality gate:
297
+ After Phase 3, spawn Harden agent as the quality gate:
315
298
 
316
299
  ```
317
300
  Agent(subagent_type="Harden"):
318
301
  "TASK_DESCRIPTION: {task description}
319
302
  FILES_CHANGED: {branch_diff}
320
- <!-- learning:on -->
303
+ <!-- curation:on -->
321
304
  DECISIONS_CONTEXT: {decisions_context}
322
- <!-- learning:end -->
305
+ <!-- curation:end -->
323
306
  FEATURE_KNOWLEDGE: {feature_knowledge_rules}
324
307
  Evaluate 9 pillars, fix P0/P1 issues, report status"
325
308
  ```
@@ -329,7 +312,7 @@ Harden agent reports `### Status: PASS | FIXED | BLOCKED`. **If BLOCKED:** repor
329
312
  ### Phase 5: Alignment Check
330
313
 
331
314
  **Produces:** ALIGNMENT_RESULT
332
- **Requires:** BASE_BRANCH, EXECUTION_PLAN
315
+ **Requires:** BASE_REF, EXECUTION_PLAN
333
316
 
334
317
  After Harden agent passes, spawn Evaluate agent to validate alignment. Evaluate agent receives `FEATURE_KNOWLEDGE_RULES` as acceptance context only; pattern and anti-pattern judgments belong to Harden agent:
335
318
 
@@ -357,9 +340,9 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
357
340
  TASK_DESCRIPTION: Fix alignment issues
358
341
  MISALIGNMENTS: {structured misalignments from Evaluate agent}
359
342
  SCOPE: Fix only the listed misalignments, no other changes
360
- <!-- learning:on -->
343
+ <!-- curation:on -->
361
344
  DECISIONS_CONTEXT: {decisions_context}
362
- <!-- learning:end -->
345
+ <!-- curation:end -->
363
346
  {COMPLIANCE_DIRECTIVE}"
364
347
  ```
365
348
  - Loop back to Phase 5 (re-check alignment). The fix is not validated here: the Phase 6 run covers it.
@@ -368,13 +351,15 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
368
351
  ### Phase 6: Validate
369
352
 
370
353
  **Produces:** VALIDATION_RESULT, VALIDATED_HEAD
371
- **Requires:** BASE_BRANCH
354
+ **Requires:** BASE_REF, GATE_LEVEL
372
355
 
373
356
  Validate takes the one full-suite slot, after every commit it must cover: Code, Polish, Harden and the alignment fixes. After Evaluate agent passes, spawn Validate agent. `FILES_CHANGED` is the branch diff:
374
357
 
375
358
  ```
376
359
  Agent(subagent_type="Validate"):
377
- "FILES_CHANGED: {branch_diff}
360
+ "GATE_LEVEL: {GATE_LEVEL}
361
+ BASE_SHA: {BASE_REF}
362
+ FILES_CHANGED: {branch_diff}
378
363
  VALIDATION_SCOPE: full
379
364
  Run build, typecheck, lint, test. Report pass/fail with failure details."
380
365
  ```
@@ -391,9 +376,9 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
391
376
  TASK_DESCRIPTION: Fix validation failures
392
377
  VALIDATION_FAILURES: {parsed failures from Validate agent}
393
378
  SCOPE: Fix only the listed failures, no other changes
394
- <!-- learning:on -->
379
+ <!-- curation:on -->
395
380
  DECISIONS_CONTEXT: {decisions_context}
396
- <!-- learning:end -->
381
+ <!-- curation:end -->
397
382
  {COMPLIANCE_DIRECTIVE}"
398
383
  ```
399
384
  - Loop back to Phase 6 (re-validate at the new HEAD, full scope)
@@ -415,7 +400,7 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
415
400
  ### Phase 7: QA Testing
416
401
 
417
402
  **Produces:** QA_RESULT
418
- **Requires:** BASE_BRANCH, EXECUTION_PLAN, TEST_PLAN, VALIDATED_HEAD
403
+ **Requires:** BASE_REF, EXECUTION_PLAN, TEST_PLAN, VALIDATED_HEAD
419
404
 
420
405
  After Phase 6 passes, spawn Test agent for scenario-based acceptance testing:
421
406
 
@@ -445,9 +430,9 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
445
430
  TASK_DESCRIPTION: Fix QA test failures
446
431
  QA_FAILURES: {structured failures from Test agent}
447
432
  SCOPE: Fix only the listed failures, no other changes
448
- <!-- learning:on -->
433
+ <!-- curation:on -->
449
434
  DECISIONS_CONTEXT: {decisions_context}
450
- <!-- learning:end -->
435
+ <!-- curation:end -->
451
436
  {COMPLIANCE_DIRECTIVE}"
452
437
  ```
453
438
  - Loop back to Phase 7 (re-run Test agent). The fix is not validated here: Phase 8 covers it.
@@ -474,21 +459,22 @@ Verify the qa-fix commits did not break anything."
474
459
  ### Phase 9: Open PR
475
460
 
476
461
  **Produces:** PR_NUMBER
477
- **Requires:** BASE_BRANCH, TASK_ID, ISSUE_NUMBER, ISSUE_PR_LINK, PR_EXCEPTIONS, PR_TEST_PLAN_BLOCK, PR_DESCRIPTION_GUIDANCE, APPLY_CONVENTIONS, CODE_AGENT_OUTPUT
462
+ **Requires:** BASE_BRANCH, BASE_REF, TASK_ID, ISSUE_NUMBER, ISSUE_PR_LINK, PR_EXCEPTIONS, PR_TEST_PLAN_BLOCK, PR_DESCRIPTION_GUIDANCE, APPLY_CONVENTIONS, CODE_AGENT_OUTPUT
478
463
 
479
- Run once, after the gates, under every strategy. This phase sits outside the strategy branches, so no run reaches the end with commits and no PR. No Code agent opens a PR: the Git agent does, and it pastes `ISSUE_PR_LINK`, `PR_EXCEPTIONS` and `PR_TEST_PLAN_BLOCK` through their paste gates and scrubs the body (D11) before `gh pr create`. This command renders no link line and creates no PR itself: the Git agent's Phase-1 rendering is the only one, forwarded verbatim.
464
+ Run once, after the gates, under every strategy. No Code agent opens a PR: the Git agent does, and it pastes `ISSUE_PR_LINK`, `PR_EXCEPTIONS` and `PR_TEST_PLAN_BLOCK` through their paste gates and scrubs the body (D11) before `gh pr create`. This command renders no link line and creates no PR itself: the Git agent's Phase-1 rendering is the only one, forwarded verbatim.
480
465
 
481
466
  ```
482
467
  Agent(subagent_type="Git"):
483
468
  "OPERATION: ensure-pr-ready
484
469
  WORKTREE_PATH: {worktree}
485
470
  BASE_BRANCH: {base branch}
471
+ BASE_REF: {BASE_REF}
486
472
  TASK_ID: {task-id}
487
473
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
488
474
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
489
475
  PR_EXCEPTIONS: {the ## Evidence Exceptions section of {worktree}/.devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
490
476
  PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK verbatim, or (none)}
491
- PR_DESCRIPTION_GUIDANCE: {pr_description_guidance from Phase 1 unless it is (none), then the Code agents' reports from CODE_AGENT_OUTPUT in spawn order — Implementation, Commits and Key Decisions, and a sequential agent's ## Phase {N} Implementation Summary}
477
+ PR_DESCRIPTION_GUIDANCE: {pr_description_guidance from Phase 1 unless it is (none), then the Code agents' reports from CODE_AGENT_OUTPUT in spawn order — Implementation, Commits and Key Decisions, and a sequential agent's ## Phase {N} Implementation Summary, then Validate's `Lint pack:` line if UNVERIFIED, for Testing}
492
478
  APPLY_CONVENTIONS: {APPLY_CONVENTIONS}
493
479
  COMMIT_UNCOMMITTED: false
494
480
  Open the pull request for this branch and return the pre-flight summary."
@@ -517,11 +503,11 @@ git push origin HEAD; echo "exit=$?"
517
503
  3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to Phase 11.
518
504
  4. **If PENDING** and fewer than 3 waits have run → wait again (step 1). After the third wait → report "CI still running — verify manually before merging" and proceed.
519
505
  5. **If INDETERMINATE** and fewer than 3 waits have run → wait again (step 1). After the third wait → report "CI status unknown — verify manually before merging" and proceed.
520
- <!-- learning:on -->
506
+ <!-- curation:on -->
521
507
  6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Fix")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_DIRECTIVE` (when it is not empty), `CI_FAILURES`, `DECISIONS_CONTEXT` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Fix agent fetches the full names and reads the logs itself and this command reads none. After a fix, push with the command above and, if a wait remains, wait again (step 1); a failed push records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and stops waiting. After the second fix still FAILING → report the failing checks and proceed.
522
- <!-- learning:off -->
508
+ <!-- curation:off -->
523
509
  6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Fix")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_DIRECTIVE` (when it is not empty), `CI_FAILURES` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Fix agent fetches the full names and reads the logs itself and this command reads none. After a fix, push with the command above and, if a wait remains, wait again (step 1); a failed push records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and stops waiting. After the second fix still FAILING → report the failing checks and proceed.
524
- <!-- learning:end -->
510
+ <!-- curation:end -->
525
511
  7. **Budget**: at most 3 waits and 2 fixes in all. When one is spent, report the current status and proceed.
526
512
  <!-- /PATTERN: ci-status-gate -->
527
513
 
@@ -530,7 +516,7 @@ git push origin HEAD; echo "exit=$?"
530
516
  **Produces:** EVIDENCE_RESULT
531
517
  **Requires:** PR_NUMBER, EVIDENCE_FILE, REVIEW_PUBLICATION
532
518
 
533
- Run once, after Phase 10, under every strategy: the PR exists by now, opened in Phase 9. The re-validation path has no CI gate and runs this phase straight after Phase 9. Skip it only when Phase 9 stopped the run. A `ci` TP reads `INDETERMINATE` only when the CI gate could not tell or did not run.
519
+ Run once, after Phase 10, under every strategy. Skip it only when Phase 9 stopped the run. A `ci` TP reads `INDETERMINATE` only when the CI gate could not tell or did not run.
534
520
 
535
521
  **Push first.** Every claim is keyed to the HEAD an agent reported, and a Harden or Fix agent may have committed without pushing; a claim whose SHA is not in the PR reads `UNVERIFIED`. So push the branch once before the script — never force, and no retry:
536
522
 
@@ -550,30 +536,27 @@ Drop the `--evidence` pair when that file does not exist or its path does not ma
550
536
 
551
537
  ### Phase 12: Report
552
538
 
553
- **Requires:** VALIDATION_RESULT, ALIGNMENT_RESULT, QA_RESULT, PR_NUMBER, EVIDENCE_RESULT
539
+ **Requires:** VALIDATION_RESULT, ALIGNMENT_RESULT, QA_RESULT, PR_NUMBER, EVIDENCE_RESULT, GATE_LEVEL
554
540
 
555
- Display completion summary with phase status, PR info, and next steps.
541
+ Display completion summary with phase status, `Gate level: {GATE_LEVEL}` with any level note, Validate's `Lint pack:` line if any, PR info, and next steps.
556
542
 
557
543
  Show the test plan's evidence from Phase 11: `Test plan: {VERIFIED-CI + ATTESTED-LOCAL}/{total} verified (VERIFIED-CI {n}, ATTESTED-LOCAL {n})`, read from the `EVIDENCE` line and never inferred, then its `**Body**:` / `**Comment**:` line verbatim. Without an `EVIDENCE` line, show `Test plan: evidence unavailable`; with no test plan, `Test plan: missing`.
558
544
 
559
- If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 10's push, Phase 11's push or Phase 11's script output carried one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
545
+ If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or the fresh base step, Phase 10's push, Phase 11's push or Phase 11's script output carried one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
560
546
 
561
547
  If Phase 9 listed uncommitted files, show them as a `### Uncommitted files` subsection: the user commits them or discards them.
562
548
 
563
549
  If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lines in the report.
564
550
 
565
- {{knowledge_writeback()}}
551
+ {{knowledge_writeback_after_load()}}
566
552
 
567
553
  ## Architecture
568
554
 
569
555
  ```
570
- /implement (orchestrator - spawns agents only)
571
- │
572
- ├─ Re-validation Path (when user says "re-validate"/"re-check"/"re-run gates")
573
- │ └─ Branch safety → skip Phase 2 → record BASE_BRANCH → Phases 3-8 → Phase 9, 11, 12
556
+ /implement
574
557
  │
575
558
  ├─ Phase 1: Setup
576
- ├─ Phase 2: Implement (3-strategy framework)
559
+ ├─ Phase 2: Implement
577
560
  ├─ Phase 3: Polish
578
561
  ├─ Phase 4: Self-Review
579
562
  ├─ Phase 5: Alignment Check
@@ -582,7 +565,7 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
582
565
  ├─ Phase 8: Re-Validate (only if a qa-fix committed)
583
566
  ├─ Phase 9: Open PR (every strategy, outside the strategy branches)
584
567
  ├─ Phase 10: CI Status Gate (every strategy)
585
- ├─ Phase 11: Evidence (every strategy, once the PR exists)
568
+ ├─ Phase 11: Evidence (every strategy)
586
569
  ├─ Phase 12: Report
587
570
  │
588
571
  └─ Feature Knowledge Write-Back (Conditional)
@@ -590,15 +573,11 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
590
573
 
591
574
  ## Principles
592
575
 
593
- 1. **Orchestration only** - Command spawns agents, never does work itself; the inline calls are the bounded plumbing the charter allows: the Phase 10 and Phase 11 pushes, the Phase 10 ci-wait call, the Phase 11 evidence publish call and the evidence script checks
594
- 2. **Agent ownership** - Each agent owns its output completely
595
- 3. **Honest reporting** - Display agent outputs directly
596
- 4. **Strict delegation** - Never perform agent work in main session. "Spawn X" means call Agent tool with X, not do X's work yourself
597
- 5. **Validate agent owns validation** - Never run `npm test`, `npm run build`, or similar in main session; always delegate to Validate agent
598
- 6. **Fix agent owns fixes** - Never implement fixes in main session; spawn Fix agent for validation failures and alignment fixes
599
- 7. **Loop limits** - Max 2 validation retries, max 2 alignment fix iterations, max 2 QA retries before escalating to user; the CI gate allows at most 3 waits and 2 fixes
600
- 8. **CI awareness** - CI status is checked before merge under every strategy, once Phase 9 has opened the PR; test-plan evidence (Phase 11) is recorded under every strategy once the PR exists
576
+ 1. **Orchestration only** - Command spawns agents, never does work itself (no tests, builds or fixes); "Spawn X" means call the Agent tool; the inline calls are the bounded plumbing the charter allows: the fresh base step's resolver calls (Phase 1, re-validation), the Phase 10 and 11 pushes, the Phase 10 ci-wait call, the Phase 11 evidence publish call and the evidence script checks
577
+ 2. **Honest reporting** - Display agent outputs directly
578
+ 3. **Loop limits** - Max 2 validation retries, max 2 alignment fix iterations, max 2 QA retries before escalating to user; the CI gate allows at most 3 waits and 2 fixes
579
+ 4. **CI awareness** - CI status is checked before merge; test-plan evidence (Phase 11) is recorded under every strategy
601
580
 
602
581
  ## Error Handling
603
582
 
604
- If any agent fails, report the phase, agent type, and error. Offer options: retry phase, investigate systematically, or escalate to user.
583
+ If any agent fails, report the phase, agent type and error. Offer: retry the phase, investigate, or escalate to user.
@@ -104,17 +104,17 @@ If the user says "skip" or "just proceed" — skip remaining questions, present
104
104
 
105
105
  **MANDATORY**: Do not spawn any agents until Gate 0 is confirmed — the Step 0 issue fetch (if applicable) is the sole exception; it precedes and informs Gate 0 and must complete before Gate 0 begins.
106
106
 
107
- <!-- learning:on -->
107
+ <!-- curation:on -->
108
108
  #### Phase 2: Orient + Load Decisions
109
- <!-- learning:off -->
109
+ <!-- curation:off -->
110
110
  #### Phase 2: Orient
111
- <!-- learning:end -->
111
+ <!-- curation:end -->
112
112
 
113
- <!-- learning:on -->
113
+ <!-- curation:on -->
114
114
  **Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, GATE_LEVEL
115
- <!-- learning:off -->
115
+ <!-- curation:off -->
116
116
  **Produces:** SKIM_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, GATE_LEVEL
117
- <!-- learning:end -->
117
+ <!-- curation:end -->
118
118
  **Requires:** CONFIRMED_SCOPE
119
119
 
120
120
  {{settings.settings_resolve()}}
@@ -124,9 +124,9 @@ Spawn Skim agent for codebase context:
124
124
  ```
125
125
  Agent(subagent_type="Skim"):
126
126
  "Orient in codebase for design planning: {feature/issues}
127
- <!-- learning:on -->
128
- LEARNING: {LEARNING from the settings line}
129
- <!-- learning:end -->
127
+ <!-- curation:on -->
128
+ CURATION: {CURATION from the settings line}
129
+ <!-- curation:end -->
130
130
  Run rskim on source directories (NOT repo root) to identify:
131
131
  - Existing patterns and conventions in the affected area
132
132
  - File structure and module boundaries
@@ -138,17 +138,17 @@ Return codebase context for requirements analysis."
138
138
  {{docs_root()}}
139
139
 
140
140
  {{decisions_load()}}
141
- <!-- learning:on -->
141
+ <!-- curation:on -->
142
142
  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.
143
143
 
144
- <!-- learning:end -->
144
+ <!-- curation:end -->
145
145
  {{knowledge_load()}}
146
146
 
147
- <!-- learning:on -->
147
+ <!-- curation:on -->
148
148
  Pass `FEATURE_KNOWLEDGE` to Explore and Design agents. Pass `DECISIONS_CONTEXT` to Design agents only.
149
- <!-- learning:off -->
149
+ <!-- curation:off -->
150
150
  Pass `FEATURE_KNOWLEDGE` to Explore and Design agents.
151
- <!-- learning:end -->
151
+ <!-- curation:end -->
152
152
 
153
153
  **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.
154
154
 
@@ -190,11 +190,11 @@ Combine into: user needs, similar features, constraints, failure modes"
190
190
  #### Phase 5: Gap Analysis (Parallel)
191
191
 
192
192
  **Produces:** GAP_OUTPUTS, COMPLIANCE_ACTIVE, COMPLIANCE_FRAMEWORKS
193
- <!-- learning:on -->
193
+ <!-- curation:on -->
194
194
  **Requires:** EXPLORATION_SYNTHESIS, SKIM_CONTEXT, DECISIONS_CONTEXT
195
- <!-- learning:off -->
195
+ <!-- curation:off -->
196
196
  **Requires:** EXPLORATION_SYNTHESIS, SKIM_CONTEXT
197
- <!-- learning:end -->
197
+ <!-- curation:end -->
198
198
 
199
199
  {{compliance_gate()}}
200
200
 
@@ -220,9 +220,9 @@ Each Design agent receives:
220
220
  - Focus: (their assigned focus from table)
221
221
  - Exploration synthesis from Phase 4
222
222
  - Skim agent context from Phase 2
223
- <!-- learning:on -->
223
+ <!-- curation:on -->
224
224
  - `DECISIONS_CONTEXT` (index from Phase 2)
225
- <!-- learning:end -->
225
+ <!-- curation:end -->
226
226
  - `COMPLIANCE_FOCUS_DIRECTIVE` (compliance focus only)
227
227
  - Multi-issue: all issue bodies
228
228
 
@@ -232,9 +232,9 @@ Each Design agent receives:
232
232
  Agent(subagent_type="Design"):
233
233
  "Mode: gap-analysis
234
234
  Focus: {completeness|architecture|security|performance|compliance|consistency|dependencies}
235
- <!-- learning:on -->
235
+ <!-- curation:on -->
236
236
  DECISIONS_CONTEXT: {decisions_context}
237
- <!-- learning:end -->
237
+ <!-- curation:end -->
238
238
  FEATURE_KNOWLEDGE: {feature_knowledge}
239
239
  {COMPLIANCE_FOCUS_DIRECTIVE} (compliance focus only)
240
240
  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)
@@ -242,11 +242,11 @@ Artifacts:
242
242
  Feature/Issues: {feature description or issue bodies}
243
243
  Exploration synthesis: {Phase 4 output}
244
244
  Codebase context: {Phase 2 output}
245
- <!-- learning:on -->
245
+ <!-- curation:on -->
246
246
  Analyze only your assigned focus area. Follow devflow:apply-decisions for DECISIONS_CONTEXT.
247
- <!-- learning:off -->
247
+ <!-- curation:off -->
248
248
  Analyze only your assigned focus area.
249
- <!-- learning:end -->
249
+ <!-- curation:end -->
250
250
  Cite evidence from provided artifacts."
251
251
  ```
252
252
 
@@ -544,11 +544,11 @@ Display completion summary:
544
544
  │ ├─ Phase 1: GATE 0 - Requirements Discovery ⛔ MANDATORY
545
545
  │ │ ├─ Git agent (fetch-issue / fetch-issues-batch) - issue mode only
546
546
  │ │ └─ AskUserQuestion: Validate interpretation
547
- <!-- learning:on -->
547
+ <!-- curation:on -->
548
548
  │ ├─ Phase 2: Orient + Load Decisions
549
- <!-- learning:off -->
549
+ <!-- curation:off -->
550
550
  │ ├─ Phase 2: Orient
551
- <!-- learning:end -->
551
+ <!-- curation:end -->
552
552
  │ ├─ Phase 3: Explore Requirements (PARALLEL)
553
553
  │ └─ Phase 4: Synthesize Exploration
554
554
  │
@@ -55,31 +55,31 @@ Read `.release/RELEASE-FLOW.md`:
55
55
 
56
56
  ### Phase 1b: Load Context
57
57
 
58
- <!-- learning:on -->
58
+ <!-- curation:on -->
59
59
  **Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
60
- <!-- learning:off -->
60
+ <!-- curation:off -->
61
61
  **Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
62
- <!-- learning:end -->
62
+ <!-- curation:end -->
63
63
 
64
- <!-- learning:on -->
64
+ <!-- curation:on -->
65
65
  {{settings.settings_resolve()}}
66
66
 
67
67
  {{decisions_gate()}}
68
68
 
69
69
  {{decisions_locate()}}
70
70
 
71
- 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`.
71
+ Read `{ledger}/.devflow/curation/index.md`. If the file is absent or empty, set `DECISIONS_CONTEXT` to `(none)`; otherwise use the file content as `DECISIONS_CONTEXT`.
72
72
 
73
73
  {{decisions_slice()}}
74
74
 
75
- <!-- learning:end -->
75
+ <!-- curation:end -->
76
76
  {{knowledge_load()}}
77
77
 
78
- <!-- learning:on -->
78
+ <!-- curation:on -->
79
79
  Pass `DECISIONS_CONTEXT` and `FEATURE_KNOWLEDGE` only to agents whose contract declares them; the Validate and Git agents this command spawns do not.
80
- <!-- learning:off -->
80
+ <!-- curation:off -->
81
81
  Pass `FEATURE_KNOWLEDGE` only to agents whose contract declares it; the Validate and Git agents this command spawns do not.
82
- <!-- learning:end -->
82
+ <!-- curation:end -->
83
83
 
84
84
  ### Phase 1c: Resolve the Evidence Policy
85
85
 
@@ -234,11 +234,11 @@ On completion:
234
234
  │ └─ Read .release/RELEASE-FLOW.md (learned) or proceed to detect (fresh)
235
235
  │
236
236
  ├─ Phase 1b: Load Context
237
- <!-- learning:on -->
237
+ <!-- curation:on -->
238
238
  │ └─ Load DECISIONS_CONTEXT and FEATURE_KNOWLEDGE for the agents that declare them
239
- <!-- learning:off -->
239
+ <!-- curation:off -->
240
240
  │ └─ Load FEATURE_KNOWLEDGE for the agents that declare it
241
- <!-- learning:end -->
241
+ <!-- curation:end -->
242
242
  │
243
243
  ├─ Phase 2: Detect Release Process (first run only)
244
244
  │ └─ Tiered scan: package.json, CI workflows, git history