devflow-kit 3.3.0 → 3.4.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 (138) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/agents/code.md +330 -0
  3. package/{src/assets → dist}/agents/design.md +1 -1
  4. package/{src/assets → dist}/agents/diagnose.md +1 -2
  5. package/dist/agents/git.md +29 -56
  6. package/{src/assets → dist}/agents/knowledge.md +4 -3
  7. package/{src/assets → dist}/agents/research.md +2 -2
  8. package/{src/assets → dist}/agents/review.md +8 -7
  9. package/{src/assets → dist}/agents/scrutinize.md +1 -1
  10. package/dist/agents/skim.md +148 -0
  11. package/{src/assets → dist}/agents/triage.md +1 -1
  12. package/dist/cli/commands/init.js +62 -0
  13. package/dist/cli/commands/learning.js +38 -3
  14. package/dist/cli/commands/uninstall.js +42 -1
  15. package/dist/commands/bug-analysis.md +30 -8
  16. package/dist/commands/code-review.md +141 -60
  17. package/dist/commands/debug.md +14 -12
  18. package/dist/commands/dynamic-build.md +37 -38
  19. package/dist/commands/dynamic-plan.md +30 -18
  20. package/dist/commands/dynamic-profile.md +27 -13
  21. package/dist/commands/dynamic-tickets.md +28 -14
  22. package/dist/commands/explore.md +15 -13
  23. package/dist/commands/implement.md +33 -28
  24. package/dist/commands/plan.md +37 -24
  25. package/dist/commands/release.md +69 -4
  26. package/dist/commands/research.md +33 -11
  27. package/dist/commands/resolve.md +35 -32
  28. package/dist/commands/self-review.md +36 -23
  29. package/dist/core/agent-models.js +43 -0
  30. package/dist/core/assets.js +55 -10
  31. package/dist/core/claude-md-audit.js +190 -0
  32. package/dist/core/feature-switch.js +20 -1
  33. package/dist/core/flags.js +28 -0
  34. package/dist/core/fs-atomic.js +8 -3
  35. package/dist/core/learning-variants.js +213 -0
  36. package/dist/core/manifest.js +62 -0
  37. package/dist/core/mds-variants.js +38 -1
  38. package/dist/core/plugins.js +71 -9
  39. package/{src/assets → dist/learning-off}/agents/code.md +6 -10
  40. package/dist/learning-off/agents/design.md +119 -0
  41. package/dist/learning-off/agents/diagnose.md +210 -0
  42. package/dist/learning-off/agents/knowledge.md +90 -0
  43. package/dist/learning-off/agents/research.md +149 -0
  44. package/dist/learning-off/agents/review.md +228 -0
  45. package/dist/learning-off/agents/scrutinize.md +117 -0
  46. package/{src/assets → dist/learning-off}/agents/skim.md +1 -8
  47. package/dist/learning-off/agents/triage.md +163 -0
  48. package/dist/learning-off/commands/bug-analysis.md +420 -0
  49. package/dist/learning-off/commands/code-review.md +525 -0
  50. package/dist/learning-off/commands/debug.md +294 -0
  51. package/dist/learning-off/commands/dynamic-build.md +1255 -0
  52. package/dist/learning-off/commands/dynamic-plan.md +424 -0
  53. package/dist/learning-off/commands/dynamic-profile.md +214 -0
  54. package/dist/learning-off/commands/dynamic-tickets.md +632 -0
  55. package/dist/learning-off/commands/explore.md +210 -0
  56. package/dist/learning-off/commands/implement.md +808 -0
  57. package/dist/learning-off/commands/plan.md +664 -0
  58. package/dist/learning-off/commands/release.md +310 -0
  59. package/dist/learning-off/commands/research.md +222 -0
  60. package/dist/learning-off/commands/resolve.md +837 -0
  61. package/dist/learning-off/commands/self-review.md +266 -0
  62. package/dist/skills/git/references/tracker/_contract.md +33 -0
  63. package/dist/skills/git/references/tracker/github/fetch-issue.md +2 -0
  64. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +2 -0
  65. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +4 -0
  66. package/dist/skills/git/references/tracker/github/post-wave-report.md +2 -0
  67. package/dist/skills/git/references/tracker/github/setup-task.md +12 -0
  68. package/dist/skills/git/references/tracker/jira/associate-release.md +1 -1
  69. package/dist/skills/git/references/tracker/jira/fetch-issue.md +2 -0
  70. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +2 -0
  71. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +4 -0
  72. package/dist/skills/git/references/tracker/jira/post-wave-report.md +2 -0
  73. package/dist/skills/git/references/tracker/jira/setup-task.md +14 -2
  74. package/dist/skills/git/references/tracker/linear/associate-release.md +1 -1
  75. package/dist/skills/git/references/tracker/linear/fetch-issue.md +2 -0
  76. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +2 -0
  77. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +4 -0
  78. package/dist/skills/git/references/tracker/linear/post-wave-report.md +2 -0
  79. package/dist/skills/git/references/tracker/linear/setup-task.md +14 -2
  80. package/dist/targets/claude-code/installer.js +72 -36
  81. package/dist/targets/claude-code/language-stamp.js +185 -0
  82. package/dist/targets/claude-code/learning-install.js +489 -0
  83. package/package.json +1 -1
  84. package/src/assets/agents/code.mds +339 -0
  85. package/src/assets/agents/design.mds +149 -0
  86. package/src/assets/agents/diagnose.mds +225 -0
  87. package/src/assets/agents/evaluate.md +1 -3
  88. package/src/assets/agents/git.mds +29 -56
  89. package/src/assets/agents/knowledge.mds +125 -0
  90. package/src/assets/agents/research.mds +176 -0
  91. package/src/assets/agents/review.mds +286 -0
  92. package/src/assets/agents/scrutinize.mds +132 -0
  93. package/src/assets/agents/skim.mds +161 -0
  94. package/src/assets/agents/triage.mds +194 -0
  95. package/src/assets/agents/validate.md +8 -6
  96. package/src/assets/commands/_partials/_compliance.mds +5 -4
  97. package/src/assets/commands/_partials/_decisions.mds +31 -0
  98. package/src/assets/commands/_partials/_engine.mds +9 -1
  99. package/src/assets/commands/_partials/_knowledge.mds +25 -12
  100. package/src/assets/commands/_partials/_preamble.mds +33 -9
  101. package/src/assets/commands/_partials/_publication.mds +5 -4
  102. package/src/assets/commands/_partials/_settings.mds +13 -5
  103. package/src/assets/commands/_partials/_wave.mds +8 -0
  104. package/src/assets/commands/bug-analysis.mds +24 -2
  105. package/src/assets/commands/code-review.mds +147 -44
  106. package/src/assets/commands/debug.mds +17 -1
  107. package/src/assets/commands/dynamic-build.mds +33 -2
  108. package/src/assets/commands/dynamic-plan.mds +36 -6
  109. package/src/assets/commands/dynamic-profile.mds +9 -1
  110. package/src/assets/commands/dynamic-tickets.mds +16 -2
  111. package/src/assets/commands/explore.mds +27 -1
  112. package/src/assets/commands/implement.mds +41 -8
  113. package/src/assets/commands/plan.mds +47 -8
  114. package/src/assets/commands/{release.md → release.mds} +27 -24
  115. package/src/assets/commands/research.mds +28 -4
  116. package/src/assets/commands/resolve.mds +43 -2
  117. package/src/assets/commands/self-review.mds +30 -5
  118. package/src/assets/mds/tracker/_contract.mds +72 -0
  119. package/src/assets/mds/tracker/_github.mds +13 -2
  120. package/src/assets/mds/tracker/_jira.mds +17 -5
  121. package/src/assets/mds/tracker/_linear.mds +17 -5
  122. package/src/assets/mds/tracker/_mcp.mds +2 -2
  123. package/src/assets/mds/tracker/_steps.mds +97 -0
  124. package/src/assets/rules/context-economy.md +10 -0
  125. package/src/assets/rules/go.md +1 -0
  126. package/src/assets/rules/java.md +1 -0
  127. package/src/assets/rules/python.md +1 -0
  128. package/src/assets/rules/rust.md +1 -0
  129. package/src/assets/rules/typescript.md +1 -0
  130. package/src/assets/scripts/claude-md-audit.cjs +611 -0
  131. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +1 -2
  132. package/src/assets/scripts/hooks/json-helper.cjs +13 -5
  133. package/src/assets/scripts/hooks/json-parse +34 -10
  134. package/src/assets/scripts/hooks/session-start-context +315 -7
  135. package/src/assets/skills/apply-decisions/SKILL.md +1 -1
  136. package/src/assets/skills/apply-feature-knowledge/SKILL.md +5 -5
  137. package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
  138. package/src/assets/skills/quality-gates/SKILL.md +1 -1
@@ -3,13 +3,21 @@ description: Parallel wave planning — plan-challenge every ticket, produce acc
3
3
  argument-hint: "[tickets-dir | issue-list]"
4
4
  output-dir: dist/commands
5
5
  ---
6
- @import { authoring_preamble } from "./_partials/_preamble.mds"
6
+ @import { authoring_preamble, authoring_decisions } from "./_partials/_preamble.mds"
7
7
  @import { docs_root } from "./_partials/_docs_root.mds"
8
8
  @import { agent_roster, agent_caveats } from "./_partials/_roster.mds"
9
9
  @import { acceptance_criteria_contract } from "./_partials/_plan_contract.mds"
10
10
  @import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
11
+ @import "./_partials/_settings.mds" as settings
11
12
  {{authoring_preamble()}}
12
13
 
14
+ <!-- learning:on -->
15
+ ### Settings line
16
+
17
+ {{settings.settings_resolve()}}
18
+
19
+ <!-- learning:end -->
20
+ {{authoring_decisions()}}
13
21
  ---
14
22
 
15
23
  ## dynamic-plan — author and run a parallel planning + plan-challenge workflow
@@ -44,10 +52,12 @@ Before authoring, verify:
44
52
 
45
53
  Pass `{worktree}` to the workflow as its `root` argument.
46
54
 
55
+ <!-- learning:on -->
47
56
  **1. Apply decisions context**
48
57
 
49
- Apply the `devflow:apply-decisions` algorithm to the DECISIONS_CONTEXT loaded per the preamble above: scan the index, Read relevant entries, note verbatim ADR/PF IDs to inject into Design agent and Evaluate agent prompts.
58
+ Apply the `devflow:apply-decisions` algorithm to the DECISIONS_CONTEXT loaded by the decisions step above: scan the index, Read relevant entries, note verbatim ADR/PF IDs to inject into Design agent prompts.
50
59
 
60
+ <!-- learning:end -->
51
61
  **2. Read the preference profile**
52
62
 
53
63
  Check whether `~/.devflow/preference-profile.md` exists:
@@ -112,7 +122,9 @@ export const meta = {
112
122
  // AskUserQuestion happens at the command boundary after this workflow returns — NOT here.
113
123
 
114
124
  const ticketSource = args.ticketSource || args[0] || "see task description";
125
+ <!-- learning:on -->
115
126
  const DECISIONS_CONTEXT = args.decisionsContext || ""; // injected before authoring
127
+ <!-- learning:end -->
116
128
  const PREFERENCE_PROFILE = args.preferenceProfile || ""; // injected before authoring
117
129
  const TP_CONTRACT = args.tpContract || ""; // the "Test-plan line (TP)" contract below — its paragraph and four bullets — passed verbatim as tpContract when invoking the workflow, never pasted into this script (it holds backticks)
118
130
  const slug = args.slug || "wave";
@@ -133,7 +145,9 @@ const plans = await phase("plan-parallel", () =>
133
145
  parallel((tickets || []).map(ticket => () =>
134
146
  agent(`Write an implementation plan for this ticket.
135
147
  Ticket: ${JSON.stringify(ticket)}
148
+ <!-- learning:on -->
136
149
  Decisions context (apply devflow:apply-decisions; a plan file can be posted to the tracker, so state each decision in words, never by ID): ${DECISIONS_CONTEXT}
150
+ <!-- learning:end -->
137
151
  The plan must cover: approach overview, affected files and modules, key design decisions, implementation sequence (what to build first), risks and mitigations, and any open questions you cannot resolve from the ticket alone.
138
152
  Write a thorough but tight plan — every section must earn its place for a Code agent who has no other context.
139
153
  Return: { ticketTitle, planMarkdown, openDecisions (array of genuine unknowns requiring user input) }.`, { agentType: "Design" })
@@ -149,7 +163,6 @@ const challenged = await phase("plan-challenge", () =>
149
163
 
150
164
  Plan under review: ${JSON.stringify(plan)}
151
165
  Ticket: ${JSON.stringify((tickets || [])[i])}
152
- Decisions context: ${DECISIONS_CONTEXT}
153
166
 
154
167
  Produce:
155
168
  1. List of improvements / gaps / edge cases / side-effects identified.
@@ -160,7 +173,7 @@ Produce:
160
173
  - its verification method is its method: a test committed to the suite is ci; a command run and read (a load test, a script) is local; a step performed and observed is manual;
161
174
  - the paths it exercises, from the plan's affected files, are its files: globs.
162
175
  Setup and expected outcome never go in a line: give them per TP in testScenarios.
163
- 4. A list of genuine design decisions that require user input (not settled by the plan, the preference profile, or existing ADRs).
176
+ 4. A list of genuine design decisions that require user input (not settled by the plan or the preference profile).
164
177
 
165
178
  Test-plan line contract:
166
179
  ${TP_CONTRACT}
@@ -178,7 +191,9 @@ Return: { ticketTitle, improvements (array), acceptanceCriteria (array of number
178
191
  const crossCritic = await phase("cross-plan-critic", () =>
179
192
  agent(`Cross-plan conflict audit.
180
193
  All ticket plans + challenged criteria: ${JSON.stringify(challenged)}
194
+ <!-- learning:on -->
181
195
  Decisions context: ${DECISIONS_CONTEXT}
196
+ <!-- learning:end -->
182
197
 
183
198
  Audit:
184
199
  1. API conflicts: two tickets defining the same API differently (different signatures, return types, error codes).
@@ -186,7 +201,11 @@ Audit:
186
201
  3. Undeclared dependencies: ticket A's plan implicitly requires something ticket B provides, but no dependency is declared.
187
202
  4. Scope overlap: two tickets both claim ownership of the same module or behavior.
188
203
 
204
+ <!-- learning:on -->
189
205
  For each conflict found: state which two tickets are involved, describe the conflict precisely, and propose a resolution aligned with the decisions ledger.
206
+ <!-- learning:off -->
207
+ For each conflict found: state which two tickets are involved, describe the conflict precisely, and propose a resolution.
208
+ <!-- learning:end -->
190
209
 
191
210
  Return: { conflicts (array of {tickets, conflictDescription, proposedResolution}), planAmendments (array of {ticketTitle, amendment}) }.`, { agentType: "Design" })
192
211
  );
@@ -199,10 +218,9 @@ const resolved = await phase("preference-resolve", () =>
199
218
  Preference profile: ${PREFERENCE_PROFILE || "(none — no profile found)"}
200
219
  Open decisions from plan-challenge: ${JSON.stringify((challenged || []).flatMap(c => c.openDecisions || []))}
201
220
  Cross-plan conflicts needing resolution: ${JSON.stringify((crossCritic && crossCritic.conflicts) || [])}
202
- Decisions context (ADRs/PFs already settled): ${DECISIONS_CONTEXT}
203
221
 
204
222
  For each open decision:
205
- - If the preference profile or an existing ADR/PF settles it clearly: auto-resolve and note the rationale.
223
+ - If the preference profile settles it clearly: auto-resolve and note the rationale.
206
224
  - If not settled: add to the DECISIONS-NEEDED list for the user.
207
225
 
208
226
  Return: { autoResolved (array of {decision, resolution, source}), decisionsNeeded (array of {decision, context, options}) }.`, { agentType: "Synthesize" })
@@ -224,14 +242,26 @@ For each ticket, write ${OUTDIR}/{ticket-slug}-plan.md containing:
224
242
  - ## Acceptance Criteria (numbered, positive + negative)
225
243
  - ## Test Plan — the challenger's testPlan lines, verbatim, one per line, and nothing else: no prose, no blank line between them, no setup or outcome
226
244
  - ## Test Scenarios — one line per TP, in TP order: TP-n: its setup, then its expected outcome, from testScenarios
245
+ <!-- learning:on -->
227
246
  - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source, naming a recorded decision in words, never by ID)
247
+ <!-- learning:off -->
248
+ - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source)
249
+ <!-- learning:end -->
228
250
 
229
251
  Then write ${OUTDIR}/DECISIONS-NEEDED.md:
252
+ <!-- learning:on -->
230
253
  - ## Auto-Resolved Decisions — list each silently-resolved decision as: decision → resolution → source (preference profile / ADR-NNN), so auto-resolution is auditable and reversible. If none, write "None."
254
+ <!-- learning:off -->
255
+ - ## Auto-Resolved Decisions — list each silently-resolved decision as: decision → resolution → source (preference profile), so auto-resolution is auditable and reversible. If none, write "None."
256
+ <!-- learning:end -->
231
257
  - ## Decisions Needed
232
258
  - One section per open decision: what the decision is, why it matters, what options exist.
233
259
  - Include cross-plan conflicts that were not auto-resolved.
260
+ <!-- learning:on -->
234
261
  - If no decisions needed, write: "No open decisions — all settled by preference profile or existing ADRs."
262
+ <!-- learning:off -->
263
+ - If no decisions needed, write: "No open decisions — all settled by the preference profile."
264
+ <!-- learning:end -->
235
265
 
236
266
  Return: { planPaths (array), decisionsNeededPath (string), decisionsNeededCount (number) }.`, { agentType: "Synthesize" })
237
267
  );
@@ -3,9 +3,17 @@ description: Decision-preference profile distiller — mine past session transcr
3
3
  argument-hint: "[--dry-run]"
4
4
  output-dir: dist/commands
5
5
  ---
6
- @import { authoring_preamble } from "./_partials/_preamble.mds"
6
+ @import { authoring_preamble, authoring_decisions } from "./_partials/_preamble.mds"
7
+ @import "./_partials/_settings.mds" as settings
7
8
  {{authoring_preamble()}}
8
9
 
10
+ <!-- learning:on -->
11
+ ### Settings line
12
+
13
+ {{settings.settings_resolve()}}
14
+
15
+ <!-- learning:end -->
16
+ {{authoring_decisions()}}
9
17
  ---
10
18
 
11
19
  ## dynamic-profile — distill a decision-preference profile from past sessions
@@ -3,14 +3,22 @@ description: Generalized ticket-factory — turn an initiative or spec into a re
3
3
  argument-hint: "[initiative | spec-doc]"
4
4
  output-dir: dist/commands
5
5
  ---
6
- @import { authoring_preamble } from "./_partials/_preamble.mds"
6
+ @import { authoring_preamble, authoring_decisions } from "./_partials/_preamble.mds"
7
7
  @import { agent_roster, agent_caveats } from "./_partials/_roster.mds"
8
8
  @import { ticket_body_template } from "./_partials/_ticket_template.mds"
9
9
  @import { factory_shape } from "./_partials/_factory.mds"
10
10
  @import { evidence_policy } from "./_partials/_evidence_policy.mds"
11
11
  @import { docs_root } from "./_partials/_docs_root.mds"
12
+ @import "./_partials/_settings.mds" as settings
12
13
  {{authoring_preamble()}}
13
14
 
15
+ <!-- learning:on -->
16
+ ### Settings line
17
+
18
+ {{settings.settings_resolve()}}
19
+
20
+ <!-- learning:end -->
21
+ {{authoring_decisions()}}
14
22
  ---
15
23
 
16
24
  ## dynamic-tickets — author and run a ticket-factory workflow
@@ -53,10 +61,12 @@ Before you write the workflow script:
53
61
 
54
62
  Pass `{worktree}` to the workflow as its `root` argument.
55
63
 
64
+ <!-- learning:on -->
56
65
  **1. Apply decisions context**
57
66
 
58
- Apply the `devflow:apply-decisions` algorithm to the DECISIONS_CONTEXT loaded per the preamble above: scan the index, Read relevant entries, note the verbatim ADR/PF IDs you will inject into Design agent and Review agent prompts.
67
+ Apply the `devflow:apply-decisions` algorithm to the DECISIONS_CONTEXT loaded by the decisions step above: scan the index, Read relevant entries, note the verbatim ADR/PF IDs you will inject into Design agent prompts.
59
68
 
69
+ <!-- learning:end -->
60
70
  **2. Read and distill the initiative**
61
71
 
62
72
  Read or note the user's input:
@@ -93,7 +103,9 @@ export const meta = {
93
103
  const candidates = args.candidates || []; // [{title, summary, wave, dependsOn}]
94
104
  const initiative = args.initiative || args[0] || "see task description";
95
105
  const constraints = args.constraints || "";
106
+ <!-- learning:on -->
96
107
  const DECISIONS_CONTEXT = args.decisionsContext || ""; // injected before authoring
108
+ <!-- learning:end -->
97
109
  const slug = args.slug || initiative.toLowerCase().replace(/[^a-z0-9]+/g, '-').slice(0, 40);
98
110
  const ts = new Date().toISOString().slice(0,16).replace(/[-:T]/g, (c) => c === 'T' ? '_' : c === ':' ? '' : c);
99
111
  const ROOT = args.root; // {worktree} from Pre-authoring setup: the checkout's toplevel, never cwd
@@ -105,7 +117,9 @@ const drafts = await phase("draft", () =>
105
117
  agent(`Draft ticket for initiative: "${initiative}"
106
118
  Ticket: ${JSON.stringify(c)}
107
119
  Constraints: ${constraints}
120
+ <!-- learning:on -->
108
121
  Decisions context (apply devflow:apply-decisions; the ticket is filed to the tracker, so state each decision in words, never by ID): ${DECISIONS_CONTEXT}
122
+ <!-- learning:end -->
109
123
  Write the ticket body following the ticket_body_template structure (Wave/Depends-on header, Summary, Scope with In/Out + anti-features, Invariants, numbered Acceptance Criteria with at least one negative criterion, Open Questions).
110
124
  Return a JSON object with: title (string), summary (string), wave (number), dependsOn (array), bodyMarkdown (string), openQuestions (array).`, { agentType: "Design" })
111
125
  ))
@@ -4,6 +4,7 @@ output-dir: dist/commands
4
4
  ---
5
5
  @import { knowledge_writeback } from "./_partials/_knowledge.mds"
6
6
  @import { decisions_load } from "./_partials/_decisions.mds"
7
+ @import "./_partials/_settings.mds" as settings
7
8
  # Explore Command
8
9
 
9
10
  Explore a codebase area by spawning parallel agents for flow tracing, dependency mapping, and pattern analysis. Findings are synthesized into structured output with file:line references, with optional feature knowledge created as a byproduct.
@@ -31,21 +32,34 @@ $ARGUMENTS
31
32
 
32
33
  ## Phases
33
34
 
35
+ <!-- learning:on -->
34
36
  ### Phase 1: Load Decisions (Orchestrator-Local)
37
+ <!-- learning:off -->
38
+ ### Phase 1: Resolve Settings
39
+ <!-- learning:end -->
35
40
 
41
+ <!-- learning:on -->
36
42
  **Produces:** DECISIONS_CONTEXT
37
43
 
38
- {{decisions_load()}}
44
+ <!-- learning:end -->
45
+ {{settings.settings_resolve()}}
39
46
 
47
+ {{decisions_load()}}
48
+ <!-- learning:on -->
40
49
  The orchestrator uses `DECISIONS_CONTEXT` locally when framing exploration — prior decisions and pitfalls suggest specific areas to investigate. Follow `devflow:apply-decisions` to Read full entry bodies on demand. **Do NOT pass `DECISIONS_CONTEXT` to Explore sub-agents** — decisions context stays in the orchestrator, not in the investigation workers.
41
50
 
51
+ <!-- learning:end -->
42
52
  **No up-front feature knowledge load** — explore investigation workers read code directly to avoid confirmation bias. Feature knowledge is only created as a write-back at the end, after exploration is complete.
43
53
 
44
54
  ### Phase 2: Orient
45
55
 
46
56
  **Produces:** ORIENT_OUTPUT
47
57
 
58
+ <!-- learning:on -->
59
+ Spawn `Agent(subagent_type="Skim")` with `LEARNING` from the settings line, to get codebase overview relevant to the exploration question:
60
+ <!-- learning:off -->
48
61
  Spawn `Agent(subagent_type="Skim")` to get codebase overview relevant to the exploration question:
62
+ <!-- learning:end -->
49
63
 
50
64
  - File structure and module boundaries in the target area
51
65
  - Entry points and key abstractions
@@ -91,7 +105,11 @@ Present findings to user. Use AskUserQuestion to offer focused follow-up explora
91
105
 
92
106
  ### Phase 6: Suggest Feature Knowledge Creation (Conditional)
93
107
 
108
+ <!-- learning:on -->
94
109
  **Requires:** MERGED_FINDINGS, DECISIONS_CONTEXT
110
+ <!-- learning:off -->
111
+ **Requires:** MERGED_FINDINGS
112
+ <!-- learning:end -->
95
113
  **Produces:** FEATURE_KNOWLEDGE_STATUS (created | skipped)
96
114
 
97
115
  1. Check if matching feature knowledge already exists by reading `{worktree}/.devflow/features/index.md` (or globbing frontmatter if absent). If covered → skip
@@ -125,7 +143,11 @@ Structured exploration findings with concrete code references:
125
143
  ```
126
144
  /explore (orchestrator)
127
145
  │
146
+ <!-- learning:on -->
128
147
  ├─ Phase 1: Load Decisions (Orchestrator-Local)
148
+ <!-- learning:off -->
149
+ ├─ Phase 1: Resolve Settings
150
+ <!-- learning:end -->
129
151
  │
130
152
  ├─ Phase 2: Orient
131
153
  │ └─ Skim agent (codebase overview)
@@ -146,7 +168,11 @@ Structured exploration findings with concrete code references:
146
168
 
147
169
  1. **Structure over browsing** - Every claim must cite file:line references
148
170
  2. **Parallel execution** - All explorers run simultaneously for speed
171
+ <!-- learning:on -->
149
172
  3. **Knowledge-informed** - Prior decisions guide where to look; NO pre-loaded feature knowledge in sub-agents (avoids confirmation bias)
173
+ <!-- learning:off -->
174
+ 3. **Knowledge-informed** - NO pre-loaded feature knowledge in sub-agents (avoids confirmation bias)
175
+ <!-- learning:end -->
150
176
  4. **User-driven depth** - Present findings, then offer drill-down into specific areas
151
177
 
152
178
  ## Error Handling
@@ -10,6 +10,7 @@ output-dir: dist/commands
10
10
  @import { test_plan_line } from "./_partials/_plan_contract.mds"
11
11
  @import { publication_gate } from "./_partials/_publication.mds"
12
12
  @import "./_partials/_compliance.mds" as compliance
13
+ @import "./_partials/_settings.mds" as settings
13
14
  # Implement Command
14
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.
@@ -57,7 +58,11 @@ If the user prompt does NOT match re-validation, proceed with the full pipeline
57
58
 
58
59
  ### Phase 1: Setup
59
60
 
60
- **Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
61
+ <!-- learning:on -->
62
+ **Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
63
+ <!-- learning:off -->
64
+ **Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
65
+ <!-- learning:end -->
61
66
 
62
67
  Record the current branch name as `BASE_BRANCH` - this will be the PR target.
63
68
 
@@ -167,13 +172,16 @@ node "$HOME/.devflow/scripts/verify-evidence.cjs" render --plan "{worktree}/.dev
167
172
 
168
173
  - `EVIDENCE_FILE` — `{worktree}/.devflow/docs/evidence-{branch_slug}.md`, its `## Evidence Exceptions` section now a byte copy of `PR_EXCEPTIONS` (absent when that is `(none)`).
169
174
 
175
+ {{settings.settings_resolve()}}
176
+
170
177
  {{publication_gate()}}
171
178
  Phase 10b passes the resolved value to `update-pr-evidence`, which decides what each value means for the evidence comment. From the same line: {{compliance.compliance_frameworks()}} Pass it to every Code spawn.
172
179
 
173
180
  {{decisions_load()}}
181
+ <!-- learning:on -->
182
+ Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and Scrutinize agent (Phase 4).
174
183
 
175
- Pass to Code agent (Phase 2) and Scrutinize agent (Phase 4).
176
-
184
+ <!-- learning:end -->
177
185
  {{knowledge_load()}}
178
186
 
179
187
  ### Phase 2: Implement
@@ -208,7 +216,9 @@ PATTERNS: {patterns from plan document or empty}
208
216
  CREATE_PR: true
209
217
  DOMAIN: {detected domain or 'fullstack'}
210
218
  FEATURE_KNOWLEDGE: {feature_knowledge}
219
+ <!-- learning:on -->
211
220
  DECISIONS_CONTEXT: {decisions_context}
221
+ <!-- learning:end -->
212
222
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
213
223
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
214
224
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
@@ -221,7 +231,7 @@ PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}"
221
231
 
222
232
  **SEQUENTIAL_CODE_AGENTS** (for HIGH/CRITICAL context risk):
223
233
 
224
- Spawn Code agents one at a time, passing handoff summaries between phases:
234
+ 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:
225
235
 
226
236
  **Phase 1 Code agent:**
227
237
  ```
@@ -235,7 +245,9 @@ PATTERNS: {patterns from plan document or empty}
235
245
  CREATE_PR: false
236
246
  DOMAIN: {phase 1 domain, e.g., 'backend'}
237
247
  FEATURE_KNOWLEDGE: {feature_knowledge}
248
+ <!-- learning:on -->
238
249
  DECISIONS_CONTEXT: {decisions_context}
250
+ <!-- learning:end -->
239
251
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
240
252
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
241
253
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
@@ -258,7 +270,9 @@ DOMAIN: {phase N domain, e.g., 'frontend'}
258
270
  PRIOR_PHASE_SUMMARY: {summary from previous Code agent}
259
271
  FILES_FROM_PRIOR_PHASE: {list of files created}
260
272
  FEATURE_KNOWLEDGE: {feature_knowledge}
273
+ <!-- learning:on -->
261
274
  DECISIONS_CONTEXT: {decisions_context}
275
+ <!-- learning:end -->
262
276
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
263
277
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
264
278
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
@@ -269,7 +283,7 @@ HANDOFF_REQUIRED: {true if not last phase}
269
283
  HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
270
284
  ```
271
285
 
272
- **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. After each Code agent with HANDOFF_REQUIRED=true completes, write its phase summary to `{worktree}/.devflow/docs/handoff-{branch_slug}.md` using the Write tool (survives context compaction), keeping any `## Evidence Exceptions` section byte-identical. Delete `{worktree}/.devflow/docs/handoff-{branch_slug}.md` once the PR exists — after the final Code agent, which creates it, completes (cleanup).
286
+ **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 the final Code agent, which creates it, completes (cleanup).
273
287
 
274
288
  ---
275
289
 
@@ -288,7 +302,9 @@ PATTERNS: {patterns}
288
302
  CREATE_PR: false
289
303
  DOMAIN: {subtask 1 domain}
290
304
  FEATURE_KNOWLEDGE: {feature_knowledge}
305
+ <!-- learning:on -->
291
306
  DECISIONS_CONTEXT: {decisions_context}
307
+ <!-- learning:end -->
292
308
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
293
309
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
294
310
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
@@ -304,7 +320,9 @@ PATTERNS: {patterns}
304
320
  CREATE_PR: false
305
321
  DOMAIN: {subtask 2 domain}
306
322
  FEATURE_KNOWLEDGE: {feature_knowledge}
323
+ <!-- learning:on -->
307
324
  DECISIONS_CONTEXT: {decisions_context}
325
+ <!-- learning:end -->
308
326
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
309
327
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
310
328
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
@@ -344,8 +362,10 @@ After Simplify agent completes, spawn Scrutinize agent as the quality gate:
344
362
  Agent(subagent_type="Scrutinize"):
345
363
  "TASK_DESCRIPTION: {task description}
346
364
  FILES_CHANGED: {list of files from Code agent output}
365
+ <!-- learning:on -->
347
366
  DECISIONS_CONTEXT: {decisions_context}
348
- FEATURE_KNOWLEDGE: {feature_knowledge}
367
+ <!-- learning:end -->
368
+ FEATURE_KNOWLEDGE: {feature_knowledge_rules}
349
369
  Evaluate 9 pillars, fix P0/P1 issues, report status"
350
370
  ```
351
371
 
@@ -356,7 +376,7 @@ Scrutinize agent reports `### Status: PASS | FIXED | BLOCKED`. **If BLOCKED:** r
356
376
  **Produces:** ALIGNMENT_RESULT
357
377
  **Requires:** FILES_CHANGED, EXECUTION_PLAN
358
378
 
359
- After Scrutinize agent passes, spawn Evaluate agent to validate alignment. Evaluate agent receives `FEATURE_KNOWLEDGE` as acceptance context only; pattern and anti-pattern judgments belong to Scrutinize agent:
379
+ After Scrutinize 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 Scrutinize agent:
360
380
 
361
381
  ```
362
382
  Agent(subagent_type="Evaluate"):
@@ -364,7 +384,7 @@ Agent(subagent_type="Evaluate"):
364
384
  EXECUTION_PLAN: {execution plan from Phase 1}
365
385
  FILES_CHANGED: {list of files from Code agent output}
366
386
  ACCEPTANCE_CRITERIA: {extracted criteria if available}
367
- FEATURE_KNOWLEDGE: {feature_knowledge}
387
+ FEATURE_KNOWLEDGE: {feature_knowledge_rules}
368
388
  Validate alignment with request and plan. Report ALIGNED or MISALIGNED with details."
369
389
  ```
370
390
 
@@ -383,6 +403,9 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
383
403
  MISALIGNMENTS: {structured misalignments from Evaluate agent}
384
404
  SCOPE: Fix only the listed misalignments, no other changes
385
405
  CREATE_PR: false
406
+ <!-- learning:on -->
407
+ DECISIONS_CONTEXT: {decisions_context}
408
+ <!-- learning:end -->
386
409
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
387
410
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
388
411
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
@@ -417,6 +440,9 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
417
440
  VALIDATION_FAILURES: {parsed failures from Validate agent}
418
441
  SCOPE: Fix only the listed failures, no other changes
419
442
  CREATE_PR: false
443
+ <!-- learning:on -->
444
+ DECISIONS_CONTEXT: {decisions_context}
445
+ <!-- learning:end -->
420
446
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
421
447
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
422
448
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
@@ -471,6 +497,9 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
471
497
  QA_FAILURES: {structured failures from Test agent}
472
498
  SCOPE: Fix only the listed failures, no other changes
473
499
  CREATE_PR: false
500
+ <!-- learning:on -->
501
+ DECISIONS_CONTEXT: {decisions_context}
502
+ <!-- learning:end -->
474
503
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
475
504
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
476
505
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
@@ -517,7 +546,11 @@ git push origin HEAD; echo "exit=$?"
517
546
  3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to Phase 10.
518
547
  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
548
  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.
549
+ <!-- learning:on -->
550
+ 6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Code")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_FRAMEWORKS`, `CI_FAILURES`, `DECISIONS_CONTEXT` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Code 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.
551
+ <!-- learning:off -->
520
552
  6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Code")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_FRAMEWORKS`, `CI_FAILURES` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Code 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.
553
+ <!-- learning:end -->
521
554
  7. **Budget**: at most 3 waits and 2 fixes in all. When one is spent, report the current status and proceed.
522
555
  <!-- /PATTERN: ci-status-gate -->
523
556
 
@@ -9,6 +9,7 @@ output-dir: dist/commands
9
9
  @import { evidence_policy } from "./_partials/_evidence_policy.mds"
10
10
  @import { test_plan_line } from "./_partials/_plan_contract.mds"
11
11
  @import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
12
+ @import "./_partials/_settings.mds" as settings
12
13
  # Plan Command
13
14
 
14
15
  Orchestrate design planning from requirements discovery through gap analysis to implementation design. Produces a machine-readable design artifact consumed by `/implement`.
@@ -107,16 +108,29 @@ If the user says "skip" or "just proceed" — skip remaining questions, present
107
108
 
108
109
  **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.
109
110
 
111
+ <!-- learning:on -->
110
112
  #### Phase 2: Orient + Load Decisions
111
-
112
- **Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE
113
+ <!-- learning:off -->
114
+ #### Phase 2: Orient
115
+ <!-- learning:end -->
116
+
117
+ <!-- learning:on -->
118
+ **Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
119
+ <!-- learning:off -->
120
+ **Produces:** SKIM_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
121
+ <!-- learning:end -->
113
122
  **Requires:** CONFIRMED_SCOPE
114
123
 
124
+ {{settings.settings_resolve()}}
125
+
115
126
  Spawn Skim agent for codebase context:
116
127
 
117
128
  ```
118
129
  Agent(subagent_type="Skim"):
119
130
  "Orient in codebase for design planning: {feature/issues}
131
+ <!-- learning:on -->
132
+ LEARNING: {LEARNING from the settings line}
133
+ <!-- learning:end -->
120
134
  Run rskim on source directories (NOT repo root) to identify:
121
135
  - Existing patterns and conventions in the affected area
122
136
  - File structure and module boundaries
@@ -128,19 +142,24 @@ Return codebase context for requirements analysis."
128
142
  {{docs_root()}}
129
143
 
130
144
  {{decisions_load()}}
145
+ <!-- learning:on -->
146
+ 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.
131
147
 
132
- This produces a compact index of active ADR/PF entries. Pass Skim agent context and `DECISIONS_CONTEXT` to all subsequent agents — prior decisions constrain design, known pitfalls inform gap analysis. Agents use `devflow:apply-decisions` to Read full entry bodies on demand.
133
-
148
+ <!-- learning:end -->
134
149
  {{knowledge_load()}}
135
150
 
136
- Pass `FEATURE_KNOWLEDGE` alongside `DECISIONS_CONTEXT` to Explore and Design agents.
151
+ <!-- learning:on -->
152
+ Pass `FEATURE_KNOWLEDGE` to Explore and Design agents. Pass `DECISIONS_CONTEXT` to Design agents only.
153
+ <!-- learning:off -->
154
+ Pass `FEATURE_KNOWLEDGE` to Explore and Design agents.
155
+ <!-- learning:end -->
137
156
 
138
157
  #### Phase 3: Explore Requirements (Parallel)
139
158
 
140
159
  **Produces:** EXPLORE_OUTPUTS
141
- **Requires:** SKIM_CONTEXT, DECISIONS_CONTEXT
160
+ **Requires:** SKIM_CONTEXT
142
161
 
143
- Spawn 4 Explore agents **in a single message**, each with Skim agent context, `DECISIONS_CONTEXT` (from Phase 2), and `FEATURE_KNOWLEDGE` (from Phase 2). Include instructions: "follow `devflow:apply-decisions` for DECISIONS_CONTEXT" and "The FEATURE_KNOWLEDGE is a baseline — VALIDATE, EXTEND, and CORRECT it, don't repeat it. 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.
162
+ Spawn 4 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.
144
163
 
145
164
  | Focus | Thoroughness | Find |
146
165
  |-------|-------------|------|
@@ -171,7 +190,11 @@ Combine into: user needs, similar features, constraints, failure modes"
171
190
  #### Phase 5: Gap Analysis (Parallel)
172
191
 
173
192
  **Produces:** GAP_OUTPUTS, COMPLIANCE_ACTIVE, COMPLIANCE_FRAMEWORKS
193
+ <!-- learning:on -->
174
194
  **Requires:** EXPLORATION_SYNTHESIS, SKIM_CONTEXT, DECISIONS_CONTEXT
195
+ <!-- learning:off -->
196
+ **Requires:** EXPLORATION_SYNTHESIS, SKIM_CONTEXT
197
+ <!-- learning:end -->
175
198
 
176
199
  {{compliance_gate()}}
177
200
 
@@ -197,7 +220,9 @@ Each Design agent receives:
197
220
  - Focus: (their assigned focus from table)
198
221
  - Exploration synthesis from Phase 4
199
222
  - Skim agent context from Phase 2
223
+ <!-- learning:on -->
200
224
  - `DECISIONS_CONTEXT` (index from Phase 2)
225
+ <!-- learning:end -->
201
226
  - `COMPLIANCE_FRAMEWORKS` (compliance focus only)
202
227
  - Multi-issue: all issue bodies
203
228
 
@@ -205,14 +230,20 @@ Each Design agent receives:
205
230
  Agent(subagent_type="Design"):
206
231
  "Mode: gap-analysis
207
232
  Focus: {completeness|architecture|security|performance|compliance|consistency|dependencies}
233
+ <!-- learning:on -->
208
234
  DECISIONS_CONTEXT: {decisions_context}
235
+ <!-- learning:end -->
209
236
  FEATURE_KNOWLEDGE: {feature_knowledge}
210
237
  COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS} (compliance focus only)
211
238
  Artifacts:
212
239
  Feature/Issues: {feature description or issue bodies}
213
240
  Exploration synthesis: {Phase 4 output}
214
241
  Codebase context: {Phase 2 output}
242
+ <!-- learning:on -->
215
243
  Analyze only your assigned focus area. Follow devflow:apply-decisions for DECISIONS_CONTEXT.
244
+ <!-- learning:off -->
245
+ Analyze only your assigned focus area.
246
+ <!-- learning:end -->
216
247
  Cite evidence from provided artifacts."
217
248
  ```
218
249
 
@@ -296,7 +327,7 @@ Combine into: patterns to follow, integration points, reusable code, edge cases"
296
327
  #### Phase 10: Plan Implementation (Parallel)
297
328
 
298
329
  **Produces:** PLAN_OUTPUTS
299
- **Requires:** IMPL_EXPLORATION_SYNTHESIS, GAP_SYNTHESIS, DECISIONS_CONTEXT
330
+ **Requires:** IMPL_EXPLORATION_SYNTHESIS, GAP_SYNTHESIS
300
331
 
301
332
  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.
302
333
 
@@ -511,9 +542,17 @@ Display completion summary:
511
542
  ├─ Block 1: Requirements Discovery
512
543
  │ ├─ Phase 1: GATE 0 - Requirements Discovery ⛔ MANDATORY
513
544
  │ │ └─ AskUserQuestion: Validate interpretation
545
+ <!-- learning:on -->
514
546
  │ ├─ Phase 2: Orient + Load Decisions
547
+ <!-- learning:off -->
548
+ │ ├─ Phase 2: Orient
549
+ <!-- learning:end -->
550
+ <!-- learning:on -->
515
551
  │ │ ├─ Skim agent (codebase context)
516
552
  │ │ └─ Read index.md → DECISIONS_CONTEXT
553
+ <!-- learning:off -->
554
+ │ │ └─ Skim agent (codebase context)
555
+ <!-- learning:end -->
517
556
  │ ├─ Phase 3: Explore Requirements (PARALLEL)
518
557
  │ │ ├─ Explore: User perspective
519
558
  │ │ ├─ Explore: Similar features