devflow-kit 3.3.0 → 3.5.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 (220) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +8 -4
  3. package/dist/agents/code-edit.md +133 -0
  4. package/dist/agents/code-fix.md +165 -0
  5. package/dist/agents/code.md +187 -0
  6. package/{src/assets → dist}/agents/design.md +1 -2
  7. package/{src/assets → dist}/agents/diagnose.md +1 -2
  8. package/dist/agents/git.md +33 -722
  9. package/{src/assets → dist}/agents/knowledge.md +12 -5
  10. package/{src/assets → dist}/agents/research.md +8 -2
  11. package/{src/assets → dist}/agents/review.md +8 -11
  12. package/{src/assets → dist}/agents/scrutinize.md +4 -1
  13. package/dist/agents/skim.md +152 -0
  14. package/{src/assets → dist}/agents/triage.md +9 -2
  15. package/dist/cli/commands/behavior-prompts.js +77 -0
  16. package/dist/cli/commands/behavior.js +123 -0
  17. package/dist/cli/commands/flags.js +8 -2
  18. package/dist/cli/commands/init-seed.js +7 -3
  19. package/dist/cli/commands/init.js +134 -5
  20. package/dist/cli/commands/learning.js +38 -3
  21. package/dist/cli/commands/rules.js +16 -0
  22. package/dist/cli/commands/tracker.js +112 -15
  23. package/dist/cli/commands/uninstall.js +42 -1
  24. package/dist/cli.js +2 -0
  25. package/dist/commands/bug-analysis.md +35 -13
  26. package/dist/commands/code-review.md +155 -69
  27. package/dist/commands/debug.md +39 -16
  28. package/dist/commands/dynamic-build.md +61 -72
  29. package/dist/commands/dynamic-plan.md +39 -25
  30. package/dist/commands/dynamic-profile.md +28 -14
  31. package/dist/commands/dynamic-tickets.md +38 -22
  32. package/dist/commands/explore.md +18 -16
  33. package/dist/commands/implement.md +121 -150
  34. package/dist/commands/plan.md +51 -31
  35. package/dist/commands/release.md +72 -6
  36. package/dist/commands/research.md +49 -20
  37. package/dist/commands/resolve.md +54 -46
  38. package/dist/commands/self-review.md +38 -25
  39. package/dist/core/agent-frontmatter.js +101 -0
  40. package/dist/core/agent-models.js +43 -0
  41. package/dist/core/assets.js +55 -10
  42. package/dist/core/claude-md-audit.js +190 -0
  43. package/dist/core/compliance-compose.js +6 -4
  44. package/dist/core/feature-switch.js +41 -1
  45. package/dist/core/flags.js +139 -0
  46. package/dist/core/fs-atomic.js +8 -3
  47. package/dist/core/learning-variants.js +213 -0
  48. package/dist/core/manifest.js +73 -3
  49. package/dist/core/mds-variants.js +98 -19
  50. package/dist/core/plugins.js +111 -72
  51. package/dist/core/project-paths.js +0 -4
  52. package/dist/core/proxy-log.js +1 -1
  53. package/dist/core/proxy-state.js +1 -1
  54. package/dist/core/tracker.js +120 -2
  55. package/dist/learning-off/agents/code-edit.md +129 -0
  56. package/dist/learning-off/agents/code-fix.md +161 -0
  57. package/dist/learning-off/agents/code.md +183 -0
  58. package/dist/learning-off/agents/design.md +118 -0
  59. package/dist/learning-off/agents/diagnose.md +210 -0
  60. package/dist/learning-off/agents/knowledge.md +96 -0
  61. package/dist/learning-off/agents/research.md +155 -0
  62. package/dist/learning-off/agents/review.md +224 -0
  63. package/dist/learning-off/agents/scrutinize.md +120 -0
  64. package/{src/assets → dist/learning-off}/agents/skim.md +5 -8
  65. package/dist/learning-off/agents/triage.md +170 -0
  66. package/dist/learning-off/commands/bug-analysis.md +420 -0
  67. package/dist/learning-off/commands/code-review.md +530 -0
  68. package/dist/learning-off/commands/debug.md +314 -0
  69. package/dist/learning-off/commands/dynamic-build.md +1245 -0
  70. package/dist/learning-off/commands/dynamic-plan.md +426 -0
  71. package/dist/learning-off/commands/dynamic-profile.md +214 -0
  72. package/dist/learning-off/commands/dynamic-tickets.md +634 -0
  73. package/dist/learning-off/commands/explore.md +210 -0
  74. package/dist/learning-off/commands/implement.md +774 -0
  75. package/dist/learning-off/commands/plan.md +671 -0
  76. package/dist/learning-off/commands/release.md +311 -0
  77. package/dist/learning-off/commands/research.md +229 -0
  78. package/dist/learning-off/commands/resolve.md +842 -0
  79. package/dist/learning-off/commands/self-review.md +266 -0
  80. package/dist/skills/git/references/learn-conventions.md +27 -3
  81. package/dist/skills/git/references/pr/check-ci-status.md +19 -0
  82. package/dist/skills/git/references/pr/check-merge-readiness.md +19 -0
  83. package/dist/skills/git/references/pr/fetch-review-threads.md +30 -0
  84. package/dist/skills/git/references/pr/post-resolution-summary.md +18 -0
  85. package/dist/skills/git/references/pr/post-review-summary.md +20 -0
  86. package/dist/skills/git/references/pr/resolve-review-threads.md +28 -4
  87. package/dist/skills/git/references/pr/update-pr-evidence.md +13 -0
  88. package/dist/skills/git/references/pr/validate-branch.md +26 -0
  89. package/dist/skills/git/references/tracker/_contract.md +33 -0
  90. package/dist/skills/git/references/tracker/github/associate-release.md +24 -0
  91. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +31 -1
  92. package/dist/skills/git/references/tracker/github/create-release.md +30 -1
  93. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +89 -2
  94. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +16 -1
  95. package/dist/skills/git/references/tracker/github/fetch-issue.md +38 -1
  96. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +49 -1
  97. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +29 -0
  98. package/dist/skills/git/references/tracker/github/manage-debt.md +21 -1
  99. package/dist/skills/git/references/tracker/github/post-wave-report.md +17 -1
  100. package/dist/skills/git/references/tracker/github/setup-task.md +53 -1
  101. package/dist/skills/git/references/tracker/jira/associate-release.md +25 -1
  102. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +31 -1
  103. package/dist/skills/git/references/tracker/jira/create-release.md +30 -1
  104. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +89 -2
  105. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +16 -1
  106. package/dist/skills/git/references/tracker/jira/fetch-issue.md +38 -1
  107. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +49 -1
  108. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +29 -0
  109. package/dist/skills/git/references/tracker/jira/manage-debt.md +21 -1
  110. package/dist/skills/git/references/tracker/jira/post-wave-report.md +17 -1
  111. package/dist/skills/git/references/tracker/jira/setup-task.md +55 -3
  112. package/dist/skills/git/references/tracker/linear/associate-release.md +25 -1
  113. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +31 -1
  114. package/dist/skills/git/references/tracker/linear/create-release.md +30 -1
  115. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +89 -2
  116. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +16 -1
  117. package/dist/skills/git/references/tracker/linear/fetch-issue.md +38 -1
  118. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +49 -1
  119. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +29 -0
  120. package/dist/skills/git/references/tracker/linear/manage-debt.md +21 -1
  121. package/dist/skills/git/references/tracker/linear/post-wave-report.md +17 -1
  122. package/dist/skills/git/references/tracker/linear/setup-task.md +55 -3
  123. package/dist/targets/claude-code/agent-type-owner.js +164 -0
  124. package/dist/targets/claude-code/behavior-install.js +111 -0
  125. package/dist/targets/claude-code/installer.js +140 -37
  126. package/dist/targets/claude-code/language-stamp.js +185 -0
  127. package/dist/targets/claude-code/learning-install.js +497 -0
  128. package/dist/targets/claude-code/tracker-install.js +33 -16
  129. package/dist/targets/claude-code/tracker-servers.js +107 -0
  130. package/package.json +4 -3
  131. package/src/assets/agents/_partials/_code.mds +109 -0
  132. package/src/assets/agents/code-edit.mds +81 -0
  133. package/src/assets/agents/code-fix.mds +113 -0
  134. package/src/assets/agents/code.mds +135 -0
  135. package/src/assets/agents/design.mds +148 -0
  136. package/src/assets/agents/diagnose.mds +225 -0
  137. package/src/assets/agents/evaluate.md +8 -4
  138. package/src/assets/agents/explore.md +58 -0
  139. package/src/assets/agents/git.mds +33 -722
  140. package/src/assets/agents/knowledge.mds +131 -0
  141. package/src/assets/agents/learning.md +19 -69
  142. package/src/assets/agents/research.mds +182 -0
  143. package/src/assets/agents/review.mds +282 -0
  144. package/src/assets/agents/scrutinize.mds +135 -0
  145. package/src/assets/agents/simplify.md +3 -0
  146. package/src/assets/agents/skim.mds +165 -0
  147. package/src/assets/agents/synthesize.md +26 -352
  148. package/src/assets/agents/test.md +8 -0
  149. package/src/assets/agents/tracker.md +20 -7
  150. package/src/assets/agents/triage.mds +201 -0
  151. package/src/assets/agents/validate.md +13 -6
  152. package/src/assets/commands/_partials/_compliance.mds +41 -4
  153. package/src/assets/commands/_partials/_decisions.mds +33 -2
  154. package/src/assets/commands/_partials/_engine.mds +14 -6
  155. package/src/assets/commands/_partials/_knowledge.mds +25 -12
  156. package/src/assets/commands/_partials/_preamble.mds +34 -10
  157. package/src/assets/commands/_partials/_publication.mds +5 -4
  158. package/src/assets/commands/_partials/_roster.mds +4 -3
  159. package/src/assets/commands/_partials/_settings.mds +13 -5
  160. package/src/assets/commands/_partials/_wave.mds +9 -1
  161. package/src/assets/commands/bug-analysis.mds +27 -5
  162. package/src/assets/commands/code-review.mds +158 -52
  163. package/src/assets/commands/debug.mds +41 -3
  164. package/src/assets/commands/dynamic-build.mds +47 -27
  165. package/src/assets/commands/dynamic-plan.mds +40 -9
  166. package/src/assets/commands/dynamic-profile.mds +9 -1
  167. package/src/assets/commands/dynamic-tickets.mds +21 -6
  168. package/src/assets/commands/explore.mds +28 -2
  169. package/src/assets/commands/implement.mds +126 -129
  170. package/src/assets/commands/plan.mds +58 -14
  171. package/src/assets/commands/{release.md → release.mds} +30 -26
  172. package/src/assets/commands/research.mds +42 -11
  173. package/src/assets/commands/resolve.mds +59 -15
  174. package/src/assets/commands/self-review.mds +30 -5
  175. package/src/assets/mds/.mdsroot +4 -0
  176. package/src/assets/mds/git/_ops.mds +383 -0
  177. package/src/assets/mds/git/_ops_pr.mds +201 -0
  178. package/src/assets/mds/git/_ops_steps.mds +147 -0
  179. package/src/assets/mds/git/_pr.mds +39 -44
  180. package/src/assets/mds/git/_references.mds +6 -3
  181. package/src/assets/mds/tracker/_common.mds +5 -5
  182. package/src/assets/mds/tracker/_contract.mds +73 -0
  183. package/src/assets/mds/tracker/_github.mds +73 -16
  184. package/src/assets/mds/tracker/_jira.mds +77 -19
  185. package/src/assets/mds/tracker/_linear.mds +77 -19
  186. package/src/assets/mds/tracker/_mcp.mds +2 -2
  187. package/src/assets/mds/tracker/_steps.mds +98 -0
  188. package/src/assets/rules/behavior.md +6 -0
  189. package/src/assets/rules/context-economy.md +10 -0
  190. package/src/assets/rules/go.md +1 -0
  191. package/src/assets/rules/java.md +1 -0
  192. package/src/assets/rules/python.md +1 -0
  193. package/src/assets/rules/rust.md +1 -0
  194. package/src/assets/rules/typescript.md +1 -0
  195. package/src/assets/scripts/claude-md-audit.cjs +611 -0
  196. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +3 -3
  197. package/src/assets/scripts/hooks/json-helper.cjs +13 -5
  198. package/src/assets/scripts/hooks/json-parse +34 -10
  199. package/src/assets/scripts/hooks/lib/project-paths.cjs +0 -6
  200. package/src/assets/scripts/hooks/session-start-context +315 -7
  201. package/src/assets/skills/agent-references/SKILL.md +33 -0
  202. package/src/assets/skills/agent-references/references/learning/maintain.md +71 -0
  203. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +71 -0
  204. package/src/assets/skills/agent-references/references/synthesize/design.md +36 -0
  205. package/src/assets/skills/agent-references/references/synthesize/exploration.md +38 -0
  206. package/src/assets/skills/agent-references/references/synthesize/planning.md +60 -0
  207. package/src/assets/skills/agent-references/references/synthesize/research.md +61 -0
  208. package/src/assets/skills/agent-references/references/synthesize/review.md +76 -0
  209. package/src/assets/skills/apply-decisions/SKILL.md +1 -1
  210. package/src/assets/skills/apply-feature-knowledge/SKILL.md +5 -5
  211. package/src/assets/skills/compliance/SKILL.md +1 -1
  212. package/src/assets/skills/docs-framework/SKILL.md +80 -83
  213. package/src/assets/skills/docs-framework/references/patterns.md +14 -25
  214. package/src/assets/skills/docs-framework/references/violations.md +7 -7
  215. package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
  216. package/src/assets/skills/gap-analysis/SKILL.md +0 -16
  217. package/src/assets/skills/gap-analysis/references/compliance.md +19 -0
  218. package/src/assets/skills/quality-gates/SKILL.md +1 -1
  219. package/dist/skills/git/references/pr/ensure-pr-ready.md +0 -24
  220. package/src/assets/agents/code.md +0 -330
@@ -3,7 +3,7 @@ description: Dependency-aware build engine — implement, review, and verify a s
3
3
  argument-hint: "[ticket | issue-url | plan-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 { evidence_policy } from "./_partials/_evidence_policy.mds"
8
8
  @import { docs_root } from "./_partials/_docs_root.mds"
9
9
  @import { agent_roster, agent_caveats } from "./_partials/_roster.mds"
@@ -13,8 +13,14 @@ output-dir: dist/commands
13
13
  @import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
14
14
  @import "./_partials/_publication.mds" as pub
15
15
  @import "./_partials/_compliance.mds" as compliance
16
+ @import "./_partials/_settings.mds" as settings
16
17
  {{authoring_preamble()}}
17
18
 
19
+ ### Settings line
20
+
21
+ {{settings.settings_resolve()}}
22
+
23
+ {{authoring_decisions()}}
18
24
  ---
19
25
 
20
26
  ## dynamic-build — author and run a build workflow
@@ -61,7 +67,7 @@ Author the resolved `ISSUE_REQUIRED` and `APPLY_CONVENTIONS` into the workflow s
61
67
 
62
68
  {{compliance.compliance_lens()}}
63
69
 
64
- Pass it as `complianceFrameworks` when invoking the workflow; the engine hands it to every Code agent.
70
+ Pass it as `complianceFrameworks` when invoking the workflow; the engine builds `COMPLIANCE_DIRECTIVE` from it and hands that to every Code and Code-fix agent.
65
71
 
66
72
  **0c. Resolve the docs root**
67
73
 
@@ -69,10 +75,12 @@ Pass it as `complianceFrameworks` when invoking the workflow; the engine hands i
69
75
 
70
76
  `{integration worktree root}` is the toplevel of the checkout the integration branch is checked out in: `{worktree}` unless the wave runs in a linked worktree.
71
77
 
78
+ <!-- learning:on -->
72
79
  **1. Apply decisions context**
73
80
 
74
- 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 Code agent and Evaluate agent prompts.
81
+ 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 Code agent prompts.
75
82
 
83
+ <!-- learning:end -->
76
84
  **2. Read budget**
77
85
 
78
86
  Note the `budget` value from the Workflow tool context (or default to "medium" if not provided). This governs Review agent roster size and verification vote count.
@@ -129,7 +137,7 @@ If a number is found, record it as the command-level `ISSUE_NUMBER`:
129
137
  - **SINGLE mode:** it is the ticket's own reference. Pass it as `issueNumber: <number>` when invoking the workflow; the engine hands it to setup-task as `ISSUE_INPUT`. If none is found, pass nothing.
130
138
  - **WAVE mode:** it is the tracking issue. Only steps 2 and 3 after the workflow use it: step 2 for the wave report, step 3 for the wave block's tracking line. It never reaches a ticket: each ticket's engine gets that ticket's own reference as `issueInput`.
131
139
 
132
- Never pass `ISSUE_PR_LINK` into the workflow. The engine binds each ticket's `ISSUE_NUMBER` and `ISSUE_PR_LINK` from that ticket's own setup-task Output (`### Handoff Values`), never from the token it passed in, and hands both to that ticket's Code agents. No `- **PR link line**:` captured ⇒ `ISSUE_PR_LINK` is `"(none)"` and the Code agent emits the `## Related Issues` heading with no reference.
140
+ Never pass `ISSUE_PR_LINK` into the workflow. The engine binds each ticket's `ISSUE_NUMBER` and `ISSUE_PR_LINK` from that ticket's own setup-task Output (`### Handoff Values`), never from the token it passed in, and returns that ticket's `issuePrLink` for the wave PR's related line. No `- **PR link line**:` captured ⇒ `ISSUE_PR_LINK` is `"(none)"` and the ticket's related line carries no closing reference.
133
141
 
134
142
  ---
135
143
 
@@ -150,11 +158,14 @@ const TICKET = args.ticket || args[0] || "see task description";
150
158
  const PLAN = args.plan || null;
151
159
  const CRITERIA = args.criteria || null;
152
160
  const TEST_PLAN = args.testPlan || null; // the plan's checked TP lines, one string (Pre-authoring step 4)
161
+ <!-- learning:on -->
153
162
  const DECISIONS_CONTEXT = args.decisionsContext || ""; // injected before authoring
163
+ <!-- learning:end -->
154
164
  const ISSUE_INPUT = args.issueInput || args.issueNumber || "(none)"; // this ticket's OWN raw reference (Pre-authoring step 5; a wave passes issueInput) — setup-task's input, never a Code agent's
155
165
  const ISSUE_REQUIRED = String(args.issueRequired) === "false" ? "false" : "true"; // Pre-authoring step 0; only an explicit false turns it off — absent or unrecognised fails closed, like the resolver
156
166
  const APPLY_CONVENTIONS = String(args.applyConventions) === "false" ? "false" : "true";
157
167
  const COMPLIANCE_FRAMEWORKS = /^(?:off|none|[a-z][a-z0-9-]{0,15}(?:,[a-z][a-z0-9-]{0,15}){0,7})$/.test(String(args.complianceFrameworks)) ? String(args.complianceFrameworks) : "off"; // Pre-authoring step 0b; any other shape is no lens
168
+ const COMPLIANCE_DIRECTIVE = COMPLIANCE_FRAMEWORKS === "off" ? "" : `When the task touches regulated surface (data models, auth flows, logging/observability, payments, IaC, retention), invoke Skill(skill="devflow:compliance") and load references/{id}.md only for the ids in ${COMPLIANCE_FRAMEWORKS} (none: generic controls only); never fabricate guidance for a framework you were not given.`; // D-COMPLIANCE-INJECT: empty when the lens is off, so a Code or Code-fix spawn then carries nothing about compliance; otherwise the one line _compliance.mds renders as compliance_directive(), with the validated ids in place of <ids>
158
169
 
159
170
  // Phase 1: Git setup — declare the operation; the agent owns the process, the branch name included
160
171
  const setup = await phase("setup", () =>
@@ -171,7 +182,7 @@ Return: {"branch": "<the - **Branch name**: value under your ### Branch, or (non
171
182
  // An Issue ID is a bare number or a KEY-number, per the provider; any other value — "none", blank, prose — is no capture, so the stop fails closed.
172
183
  const ISSUE_ID_SHAPE = /^(?:[1-9][0-9]{0,8}|[A-Z][A-Z0-9_]{0,9}-[1-9][0-9]{0,8})$/;
173
184
  const ISSUE_NUMBER = ISSUE_ID_SHAPE.test(String(setup?.issueId ?? "")) ? setup.issueId : "(none)"; // the captured Issue ID; "(none)" ⇒ none was captured
174
- const ISSUE_PR_LINK = setup?.prLinkLine || "(none)"; // "(none)" ⇒ Code emits the heading with no reference
185
+ const ISSUE_PR_LINK = setup?.prLinkLine || "(none)"; // "(none)" ⇒ the wave PR carries no closing reference for this ticket
175
186
  // The branch setup-task created, as it reported it: every later phase and the merge use it. The engine never names one.
176
187
  const BRANCH = typeof setup?.branch === "string" && setup.branch.trim() !== "" && setup.branch.trim() !== "(none)" ? setup.branch : "(none)";
177
188
 
@@ -194,12 +205,12 @@ ${TICKET}
194
205
 
195
206
  ${PLAN ? `Implementation plan:\n${PLAN}` : "No plan provided — use best judgment."}
196
207
 
208
+ <!-- learning:on -->
197
209
  Relevant architectural decisions (apply devflow:apply-decisions algorithm):
198
210
  ${DECISIONS_CONTEXT}
199
211
 
200
- ISSUE_NUMBER: ${ISSUE_NUMBER}
201
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
202
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
212
+ <!-- learning:end -->
213
+ ${COMPLIANCE_DIRECTIVE}
203
214
 
204
215
  When you build or run tests to verify your work, follow your Running commands block.
205
216
 
@@ -233,10 +244,11 @@ Return: {"verdict": "PASS" | "FAIL", "details": "..."}`, { agentType: "Validate"
233
244
  await agent(`OPERATION: validation-fix
234
245
  Fix the validation failures on branch ${BRANCH}:
235
246
  ${failureDetails}
236
- ISSUE_NUMBER: ${ISSUE_NUMBER}
237
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
238
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
239
- Commit fixes with conventional-commit message.`, { agentType: "Code" });
247
+ <!-- learning:on -->
248
+ DECISIONS_CONTEXT: ${DECISIONS_CONTEXT}
249
+ <!-- learning:end -->
250
+ ${COMPLIANCE_DIRECTIVE}
251
+ Commit fixes with conventional-commit message.`, { agentType: "Code-fix" });
240
252
  const recheck = await agent(`Re-run build, typecheck, lint, tests on branch ${BRANCH} after fix attempt ${attempt} (follow your Running commands block).
241
253
  Return: {"verdict": "PASS" | "FAIL", "details": "..."}`, { agentType: "Validate" });
242
254
  if (recheck?.verdict === "PASS") break;
@@ -275,10 +287,11 @@ Return: {"verdict": "PASS" | "FAIL", "rationale": "..."} — FAIL if either answ
275
287
  await agent(`OPERATION: alignment-fix
276
288
  Fix the alignment issues identified by the Evaluate agent on branch ${BRANCH}:
277
289
  ${evaluation?.rationale || "see the Evaluate agent's report"}
278
- ISSUE_NUMBER: ${ISSUE_NUMBER}
279
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
280
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
281
- Self-verify your fix compiles, following your Running commands block. Commit fixes.`, { agentType: "Code" });
290
+ <!-- learning:on -->
291
+ DECISIONS_CONTEXT: ${DECISIONS_CONTEXT}
292
+ <!-- learning:end -->
293
+ ${COMPLIANCE_DIRECTIVE}
294
+ Self-verify your fix compiles, following your Running commands block. Commit fixes.`, { agentType: "Code-fix" });
282
295
  evalVerdict = "FAIL-FIXED"; // issues found, fixes applied, not re-evaluated by design
283
296
  }
284
297
  }
@@ -296,10 +309,11 @@ Cover: functionality, API contracts, performance, and cover every TEST_PLAN scen
296
309
  await agent(`OPERATION: qa-fix
297
310
  Fix the failing acceptance test scenarios on branch ${BRANCH}:
298
311
  ${testResult.failures}
299
- ISSUE_NUMBER: ${ISSUE_NUMBER}
300
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
301
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
302
- Self-verify your fix compiles and the scenarios pass, following your Running commands block. Commit fixes.`, { agentType: "Code" });
312
+ <!-- learning:on -->
313
+ DECISIONS_CONTEXT: ${DECISIONS_CONTEXT}
314
+ <!-- learning:end -->
315
+ ${COMPLIANCE_DIRECTIVE}
316
+ Self-verify your fix compiles and the scenarios pass, following your Running commands block. Commit fixes.`, { agentType: "Code-fix" });
303
317
  testVerdict = "FAIL-FIXED"; // issues found, fixes applied, not re-evaluated by design
304
318
  }
305
319
  }
@@ -415,9 +429,10 @@ ISSUES:
415
429
  ${chunk.map((f, n) => `${n + 1}. ${f.file ? `${f.file}${f.line ? `:${f.line}` : ""} — ` : ""}${f.description} (${f.severity})`).join("\n")}
416
430
  SCOPE: ${chunk.map((f, n) => `${n + 1}=${CAREFUL_SEVERITIES.has(String(f.severity).toLowerCase()) ? "Careful" : "Standard"}`).join(", ")}
417
431
  PUSH: false
418
- ISSUE_NUMBER: ${ISSUE_NUMBER}
419
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
420
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
432
+ <!-- learning:on -->
433
+ DECISIONS_CONTEXT: ${DECISIONS_CONTEXT}
434
+ <!-- learning:end -->
435
+ ${COMPLIANCE_DIRECTIVE}
421
436
  Fix all findings in this batch. Self-verify your fix compiles, following your Running commands block. Commit with conventional-commit message.
422
437
  Return: {"status": "fixed"|"blocked", "commitShas": ["<sha>"], "unresolved": ["<description of any finding that could not be fixed>"]}`, { agentType: "Code" });
423
438
  chunkResults.push({ chunk, result: r });
@@ -475,10 +490,11 @@ Return: {"verdict": "PASS" | "FAIL", "details": "..."}`, { agentType: "Validate"
475
490
  await agent(`OPERATION: validation-fix
476
491
  Fix the final validation failures on branch ${BRANCH}:
477
492
  ${failureDetails}
478
- ISSUE_NUMBER: ${ISSUE_NUMBER}
479
- ISSUE_PR_LINK: ${ISSUE_PR_LINK}
480
- COMPLIANCE_FRAMEWORKS: ${COMPLIANCE_FRAMEWORKS}
481
- Self-verify your fix compiles. Commit fixes with conventional-commit message.`, { agentType: "Code" });
493
+ <!-- learning:on -->
494
+ DECISIONS_CONTEXT: ${DECISIONS_CONTEXT}
495
+ <!-- learning:end -->
496
+ ${COMPLIANCE_DIRECTIVE}
497
+ Self-verify your fix compiles. Commit fixes with conventional-commit message.`, { agentType: "Code-fix" });
482
498
  const recheck = await agent(`Re-run build, typecheck, lint, tests on branch ${BRANCH} (final gate, after fix attempt ${attempt}; follow your Running commands block).
483
499
  Return: {"verdict": "PASS" | "FAIL", "details": "..."}`, { agentType: "Validate" });
484
500
  if (recheck?.verdict === "PASS") break;
@@ -604,7 +620,11 @@ Return: {"ready": [...ticket-ids], "blocked": [{"ticket": "id", "namedBlocker":
604
620
  try {
605
621
  // ticketId is the ISSUE_REF the pre-fetch heading printed — this ticket's OWN reference: the engine's `ticket` (its TICKET)
606
622
  // and its setup-task ISSUE_INPUT; the engine returns the branch that setup-task created, merged below; plans[ticketId] is its own plan, criteria and checked testPlan (Pre-authoring step 4)
623
+ <!-- learning:on -->
607
624
  const engineResult = await runSingleTicketEngine({ ticket: ticketId, baseBranch: INTEGRATION_BRANCH, ...(plans[ticketId] || {}), decisionsContext: DECISIONS_CONTEXT, issueRequired: ISSUE_REQUIRED, applyConventions: APPLY_CONVENTIONS, complianceFrameworks: COMPLIANCE_FRAMEWORKS, issueInput: ticketId });
625
+ <!-- learning:off -->
626
+ const engineResult = await runSingleTicketEngine({ ticket: ticketId, baseBranch: INTEGRATION_BRANCH, ...(plans[ticketId] || {}), issueRequired: ISSUE_REQUIRED, applyConventions: APPLY_CONVENTIONS, complianceFrameworks: COMPLIANCE_FRAMEWORKS, issueInput: ticketId });
627
+ <!-- learning:end -->
608
628
  // Check both verdict (engine_output_schema) and overallVerdict (SINGLE skeleton alias).
609
629
  // PASS and UNVERIFIED merge; PARTIAL, FAIL, ESCALATED (the ticket-link and branch stops included) or no verdict quarantine.
610
630
  if (["PASS", "UNVERIFIED"].includes(engineResult.verdict || engineResult.overallVerdict)) {
@@ -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
@@ -42,12 +50,14 @@ Before authoring, verify:
42
50
 
43
51
  {{docs_root()}}
44
52
 
45
- Pass `{worktree}` to the workflow as its `root` argument.
53
+ Pass `{worktree}` to the workflow as its `root` argument, and its `slug` argument: the `{slug}` of the ticket directory (`tickets/{slug}/{ts}/`) when that is the ticket source, otherwise `wave`.
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,11 +122,14 @@ 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";
119
- const ts = new Date().toISOString().slice(0,16).replace(/[-:T]/g, (c) => c === 'T' ? '_' : c === ':' ? '' : c);
131
+ const now = new Date(), two = (n) => String(n).padStart(2, '0');
132
+ const ts = `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())}_${two(now.getHours())}${two(now.getMinutes())}`;
120
133
  const ROOT = args.root; // {worktree} from Pre-authoring setup: the checkout's toplevel, never cwd
121
134
  const OUTDIR = `${ROOT}/.devflow/docs/design/${slug}/${ts}`;
122
135
 
@@ -133,7 +146,9 @@ const plans = await phase("plan-parallel", () =>
133
146
  parallel((tickets || []).map(ticket => () =>
134
147
  agent(`Write an implementation plan for this ticket.
135
148
  Ticket: ${JSON.stringify(ticket)}
149
+ <!-- learning:on -->
136
150
  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}
151
+ <!-- learning:end -->
137
152
  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
153
  Write a thorough but tight plan — every section must earn its place for a Code agent who has no other context.
139
154
  Return: { ticketTitle, planMarkdown, openDecisions (array of genuine unknowns requiring user input) }.`, { agentType: "Design" })
@@ -149,7 +164,6 @@ const challenged = await phase("plan-challenge", () =>
149
164
 
150
165
  Plan under review: ${JSON.stringify(plan)}
151
166
  Ticket: ${JSON.stringify((tickets || [])[i])}
152
- Decisions context: ${DECISIONS_CONTEXT}
153
167
 
154
168
  Produce:
155
169
  1. List of improvements / gaps / edge cases / side-effects identified.
@@ -160,7 +174,7 @@ Produce:
160
174
  - 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
175
  - the paths it exercises, from the plan's affected files, are its files: globs.
162
176
  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).
177
+ 4. A list of genuine design decisions that require user input (not settled by the plan or the preference profile).
164
178
 
165
179
  Test-plan line contract:
166
180
  ${TP_CONTRACT}
@@ -178,7 +192,9 @@ Return: { ticketTitle, improvements (array), acceptanceCriteria (array of number
178
192
  const crossCritic = await phase("cross-plan-critic", () =>
179
193
  agent(`Cross-plan conflict audit.
180
194
  All ticket plans + challenged criteria: ${JSON.stringify(challenged)}
195
+ <!-- learning:on -->
181
196
  Decisions context: ${DECISIONS_CONTEXT}
197
+ <!-- learning:end -->
182
198
 
183
199
  Audit:
184
200
  1. API conflicts: two tickets defining the same API differently (different signatures, return types, error codes).
@@ -186,7 +202,11 @@ Audit:
186
202
  3. Undeclared dependencies: ticket A's plan implicitly requires something ticket B provides, but no dependency is declared.
187
203
  4. Scope overlap: two tickets both claim ownership of the same module or behavior.
188
204
 
205
+ <!-- learning:on -->
189
206
  For each conflict found: state which two tickets are involved, describe the conflict precisely, and propose a resolution aligned with the decisions ledger.
207
+ <!-- learning:off -->
208
+ For each conflict found: state which two tickets are involved, describe the conflict precisely, and propose a resolution.
209
+ <!-- learning:end -->
190
210
 
191
211
  Return: { conflicts (array of {tickets, conflictDescription, proposedResolution}), planAmendments (array of {ticketTitle, amendment}) }.`, { agentType: "Design" })
192
212
  );
@@ -199,10 +219,9 @@ const resolved = await phase("preference-resolve", () =>
199
219
  Preference profile: ${PREFERENCE_PROFILE || "(none — no profile found)"}
200
220
  Open decisions from plan-challenge: ${JSON.stringify((challenged || []).flatMap(c => c.openDecisions || []))}
201
221
  Cross-plan conflicts needing resolution: ${JSON.stringify((crossCritic && crossCritic.conflicts) || [])}
202
- Decisions context (ADRs/PFs already settled): ${DECISIONS_CONTEXT}
203
222
 
204
223
  For each open decision:
205
- - If the preference profile or an existing ADR/PF settles it clearly: auto-resolve and note the rationale.
224
+ - If the preference profile settles it clearly: auto-resolve and note the rationale.
206
225
  - If not settled: add to the DECISIONS-NEEDED list for the user.
207
226
 
208
227
  Return: { autoResolved (array of {decision, resolution, source}), decisionsNeeded (array of {decision, context, options}) }.`, { agentType: "Synthesize" })
@@ -218,20 +237,32 @@ Auto-resolved decisions: ${JSON.stringify(resolved && resolved.autoResolved)}
218
237
  Decisions needed: ${JSON.stringify(resolved && resolved.decisionsNeeded)}
219
238
  Output directory: ${OUTDIR}
220
239
 
221
- For each ticket, write ${OUTDIR}/{ticket-slug}-plan.md containing:
240
+ For each ticket, write ${OUTDIR}/{ticket-slug}-plan.md, {ticket-slug} being the ticket's file name without .md when it came from a ticket directory, otherwise the ticket title run through title.toLowerCase().replace(/[^a-z0-9]+/g, '-') with nothing trimmed, containing:
222
241
  - ## Implementation Plan
223
242
  - The plan body (incorporate cross-plan amendments)
224
243
  - ## Acceptance Criteria (numbered, positive + negative)
225
244
  - ## 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
245
  - ## Test Scenarios — one line per TP, in TP order: TP-n: its setup, then its expected outcome, from testScenarios
246
+ <!-- learning:on -->
227
247
  - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source, naming a recorded decision in words, never by ID)
248
+ <!-- learning:off -->
249
+ - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source)
250
+ <!-- learning:end -->
228
251
 
229
252
  Then write ${OUTDIR}/DECISIONS-NEEDED.md:
253
+ <!-- learning:on -->
230
254
  - ## 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."
255
+ <!-- learning:off -->
256
+ - ## 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."
257
+ <!-- learning:end -->
231
258
  - ## Decisions Needed
232
259
  - One section per open decision: what the decision is, why it matters, what options exist.
233
260
  - Include cross-plan conflicts that were not auto-resolved.
261
+ <!-- learning:on -->
234
262
  - If no decisions needed, write: "No open decisions — all settled by preference profile or existing ADRs."
263
+ <!-- learning:off -->
264
+ - If no decisions needed, write: "No open decisions — all settled by the preference profile."
265
+ <!-- learning:end -->
235
266
 
236
267
  Return: { planPaths (array), decisionsNeededPath (string), decisionsNeededCount (number) }.`, { agentType: "Synthesize" })
237
268
  );
@@ -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,9 +103,12 @@ 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
97
- const slug = args.slug || initiative.toLowerCase().replace(/[^a-z0-9]+/g, '-').slice(0, 40);
98
- const ts = new Date().toISOString().slice(0,16).replace(/[-:T]/g, (c) => c === 'T' ? '_' : c === ':' ? '' : c);
108
+ <!-- learning:end -->
109
+ const slug = args.slug || initiative.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+/, '').slice(0, 50).replace(/-+$/, '') || 'untitled';
110
+ const now = new Date(), two = (n) => String(n).padStart(2, '0');
111
+ const ts = `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())}_${two(now.getHours())}${two(now.getMinutes())}`;
99
112
  const ROOT = args.root; // {worktree} from Pre-authoring setup: the checkout's toplevel, never cwd
100
113
  const OUTDIR = `${ROOT}/.devflow/docs/tickets/${slug}/${ts}`;
101
114
 
@@ -105,7 +118,9 @@ const drafts = await phase("draft", () =>
105
118
  agent(`Draft ticket for initiative: "${initiative}"
106
119
  Ticket: ${JSON.stringify(c)}
107
120
  Constraints: ${constraints}
121
+ <!-- learning:on -->
108
122
  Decisions context (apply devflow:apply-decisions; the ticket is filed to the tracker, so state each decision in words, never by ID): ${DECISIONS_CONTEXT}
123
+ <!-- learning:end -->
109
124
  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
125
  Return a JSON object with: title (string), summary (string), wave (number), dependsOn (array), bodyMarkdown (string), openQuestions (array).`, { agentType: "Design" })
111
126
  ))
@@ -166,7 +181,7 @@ Write the amended ticket file to ${OUTDIR}/${a.title.toLowerCase().replace(/[^a-
166
181
  return phase("tracking-issue", () =>
167
182
  agent(`Write ticket files and a tracking-issue document for initiative: "${initiative}"
168
183
 
169
- For each ticket in the revised set, write a file to ${OUTDIR}/{slug}.md using the ticket_body_template structure:
184
+ For each ticket in the revised set, write a file to ${OUTDIR}/{ticket-slug}.md using the ticket_body_template structure. {ticket-slug} is the ticket title run through title.toLowerCase().replace(/[^a-z0-9]+/g, '-') with nothing trimmed, the same rule the amend phase applied, so a ticket keeps the file name its amendment wrote:
170
185
  - Wave: N header
171
186
  - Depends on: list or "none"
172
187
  - Summary, Scope (In/Out + anti-features), Invariants, numbered Acceptance Criteria (at least one negative), Open Questions
@@ -246,7 +261,7 @@ Tracking issue → `{worktree}/.devflow/docs/tickets/{slug}/{ts}/tracking-issue.
246
261
 
247
262
  `{worktree}` is the docs root resolved in Pre-authoring setup (it honours `WORKTREE_PATH` when provided).
248
263
 
249
- Timestamps follow the devflow `YYYY-MM-DD_HHMM` convention (date and time separated by an underscore, e.g. `2026-06-12_1148`). The `ts` variable in the workflow script generates this format.
264
+ Timestamps follow the devflow `YYYY-MM-DD_HHMM` convention in local time (date and time separated by an underscore, e.g. `2026-06-12_1148`). The `ts` variable in the workflow script generates this format.
250
265
 
251
266
  ---
252
267
 
@@ -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
@@ -71,7 +85,7 @@ Ask each explorer for a final report of at most about 1,500 tokens: findings wit
71
85
  **Produces:** MERGED_FINDINGS
72
86
  **Requires:** EXPLORE_OUTPUT
73
87
 
74
- Spawn `Agent(subagent_type="Synthesize")` in `exploration` mode with combined findings:
88
+ Spawn `Agent(subagent_type="Synthesize")` with the prompt line `Mode: exploration` first, then the combined findings:
75
89
 
76
90
  - Merge overlapping discoveries from parallel explorers
77
91
  - Resolve any contradictions between explorer findings
@@ -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