devflow-kit 3.14.0 → 3.16.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 (124) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +5 -42
  3. package/dist/agents/code.md +2 -6
  4. package/dist/agents/design.md +1 -1
  5. package/dist/agents/fix.md +1 -2
  6. package/dist/agents/git.md +1 -2
  7. package/dist/agents/harden.md +1 -3
  8. package/dist/agents/refactor.md +1 -2
  9. package/dist/agents/review.md +1 -1
  10. package/dist/agents/triage.md +14 -15
  11. package/dist/cli/commands/compliance-prompts.js +2 -2
  12. package/dist/cli/commands/init.js +5 -6
  13. package/dist/cli/commands/uninstall.js +1 -1
  14. package/dist/commands/bug-analysis.md +1 -1
  15. package/dist/commands/code-review.md +2 -2
  16. package/dist/commands/implement.md +1 -7
  17. package/dist/commands/plan.md +3 -3
  18. package/dist/commands/resolve.md +10 -9
  19. package/dist/compliance-off/agents/triage.md +14 -15
  20. package/dist/compliance-off/commands/bug-analysis.md +1 -1
  21. package/dist/compliance-off/commands/code-review.md +2 -2
  22. package/dist/compliance-off/commands/implement.md +1 -7
  23. package/dist/compliance-off/commands/plan.md +3 -3
  24. package/dist/compliance-off/commands/resolve.md +10 -9
  25. package/dist/compliance-off/skills/git/references/tracker/_contract.md +1 -1
  26. package/dist/compliance-off/skills/git/references/tracker/github/ensure-pr-ready.md +3 -4
  27. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -4
  28. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -4
  29. package/dist/compliance-tdd-off/agents/triage.md +14 -15
  30. package/dist/core/installed-variants.js +1 -1
  31. package/dist/core/mds-variants.js +6 -8
  32. package/dist/core/plugins.js +8 -41
  33. package/dist/core/retired-shipped-names.js +7 -0
  34. package/dist/curation-compliance-off/agents/triage.md +14 -15
  35. package/dist/curation-compliance-off/commands/bug-analysis.md +1 -1
  36. package/dist/curation-compliance-off/commands/code-review.md +2 -2
  37. package/dist/curation-compliance-off/commands/implement.md +1 -7
  38. package/dist/curation-compliance-off/commands/plan.md +3 -3
  39. package/dist/curation-compliance-off/commands/resolve.md +10 -9
  40. package/dist/curation-compliance-tdd-off/agents/triage.md +14 -15
  41. package/dist/curation-off/agents/code.md +2 -6
  42. package/dist/curation-off/agents/design.md +1 -1
  43. package/dist/curation-off/agents/fix.md +1 -2
  44. package/dist/curation-off/agents/harden.md +1 -3
  45. package/dist/curation-off/agents/refactor.md +1 -2
  46. package/dist/curation-off/agents/review.md +1 -1
  47. package/dist/curation-off/agents/triage.md +14 -15
  48. package/dist/curation-off/commands/bug-analysis.md +1 -1
  49. package/dist/curation-off/commands/code-review.md +2 -2
  50. package/dist/curation-off/commands/implement.md +1 -7
  51. package/dist/curation-off/commands/plan.md +3 -3
  52. package/dist/curation-off/commands/resolve.md +10 -9
  53. package/dist/curation-tdd-off/agents/code.md +2 -6
  54. package/dist/curation-tdd-off/agents/triage.md +14 -15
  55. package/dist/skills/git/references/tracker/_contract.md +1 -1
  56. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +3 -3
  57. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -3
  58. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -3
  59. package/dist/targets/claude-code/curation-install.js +28 -3
  60. package/dist/targets/claude-code/language-stamp.js +1 -2
  61. package/dist/{cli/commands → targets/claude-code}/legacy-sweep.js +45 -12
  62. package/dist/tdd-off/agents/code.md +2 -6
  63. package/dist/tdd-off/agents/triage.md +14 -15
  64. package/dist/variant-axes.json +0 -20
  65. package/package.json +2 -3
  66. package/src/assets/agents/_partials/_code.mds +1 -2
  67. package/src/assets/agents/code.mds +1 -4
  68. package/src/assets/agents/design.mds +1 -1
  69. package/src/assets/agents/git.mds +1 -2
  70. package/src/assets/agents/harden.mds +1 -3
  71. package/src/assets/agents/plan.md +6 -6
  72. package/src/assets/agents/review.mds +1 -1
  73. package/src/assets/agents/test.md +1 -2
  74. package/src/assets/agents/tracker.md +1 -5
  75. package/src/assets/agents/triage.mds +14 -15
  76. package/src/assets/agents/validate.md +0 -1
  77. package/src/assets/commands/_partials/_compliance.mds +0 -1
  78. package/src/assets/commands/_partials/_decisions.mds +2 -3
  79. package/src/assets/commands/_partials/_docs_root.mds +1 -1
  80. package/src/assets/commands/_partials/_plan_contract.mds +0 -56
  81. package/src/assets/commands/bug-analysis.mds +1 -1
  82. package/src/assets/commands/code-review.mds +2 -2
  83. package/src/assets/commands/implement.mds +1 -7
  84. package/src/assets/commands/plan.mds +3 -3
  85. package/src/assets/commands/resolve.mds +11 -14
  86. package/src/assets/mds/git/_ops.mds +3 -20
  87. package/src/assets/mds/git/_ops_steps.mds +8 -6
  88. package/src/assets/mds/tracker/_common.mds +3 -14
  89. package/src/assets/mds/tracker/_contract.mds +1 -1
  90. package/src/assets/mds/tracker/_github.mds +0 -32
  91. package/src/assets/mds/tracker/_jira.mds +0 -31
  92. package/src/assets/mds/tracker/_linear.mds +0 -31
  93. package/src/assets/mds/tracker/_steps.mds +0 -6
  94. package/src/assets/scripts/pr-evidence.cjs +3 -268
  95. package/src/assets/scripts/resolve-base.cjs +1 -3
  96. package/src/assets/scripts/verify-evidence.cjs +13 -18
  97. package/src/assets/skills/agent-references/references/synthesize/planning.md +7 -5
  98. package/src/assets/skills/dependency-research/SKILL.md +3 -2
  99. package/src/assets/skills/docs-framework/SKILL.md +5 -19
  100. package/src/assets/skills/docs-framework/references/patterns.md +1 -2
  101. package/dist/commands/dynamic-build.md +0 -1218
  102. package/dist/commands/dynamic-plan.md +0 -447
  103. package/dist/commands/dynamic-profile.md +0 -102
  104. package/dist/commands/dynamic-tickets.md +0 -555
  105. package/dist/compliance-off/commands/dynamic-build.md +0 -1197
  106. package/dist/compliance-off/commands/dynamic-tickets.md +0 -555
  107. package/dist/curation-compliance-off/commands/dynamic-build.md +0 -1161
  108. package/dist/curation-compliance-off/commands/dynamic-tickets.md +0 -515
  109. package/dist/curation-off/commands/dynamic-build.md +0 -1182
  110. package/dist/curation-off/commands/dynamic-plan.md +0 -406
  111. package/dist/curation-off/commands/dynamic-tickets.md +0 -515
  112. package/dist/skills/git/references/tracker/github/post-wave-report.md +0 -44
  113. package/dist/skills/git/references/tracker/jira/post-wave-report.md +0 -49
  114. package/dist/skills/git/references/tracker/linear/post-wave-report.md +0 -49
  115. package/src/assets/commands/_partials/_engine.mds +0 -216
  116. package/src/assets/commands/_partials/_factory.mds +0 -122
  117. package/src/assets/commands/_partials/_preamble.mds +0 -112
  118. package/src/assets/commands/_partials/_roster.mds +0 -31
  119. package/src/assets/commands/_partials/_ticket_template.mds +0 -56
  120. package/src/assets/commands/_partials/_wave.mds +0 -123
  121. package/src/assets/commands/dynamic-build.mds +0 -882
  122. package/src/assets/commands/dynamic-plan.mds +0 -289
  123. package/src/assets/commands/dynamic-profile.mds +0 -103
  124. package/src/assets/commands/dynamic-tickets.mds +0 -281
@@ -1,289 +0,0 @@
1
- ---
2
- description: Parallel wave planning — challenge each ticket plan, write acceptance criteria and test plans, resolve decisions from the preference profile, output DECISIONS-NEEDED.md
3
- argument-hint: "[tickets-dir | issue-list]"
4
- output-dir: dist/commands
5
- ---
6
- @import { authoring_preamble, authoring_decisions } from "./_partials/_preamble.mds"
7
- @import { docs_root } from "./_partials/_docs_root.mds"
8
- @import { agent_roster, agent_caveats } from "./_partials/_roster.mds"
9
- @import { acceptance_criteria_contract } from "./_partials/_plan_contract.mds"
10
- @import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
11
- @import "./_partials/_settings.mds" as settings
12
- {{authoring_preamble()}}
13
-
14
- <!-- curation:on -->
15
- ### Settings line
16
-
17
- {{settings.settings_resolve()}}
18
-
19
- Run this call with the start directory as `{root}` in the same turn as the `resolve-root.cjs` call and the profile read: none needs the output of another.
20
-
21
- <!-- curation:end -->
22
- {{authoring_decisions()}}
23
- ---
24
-
25
- ## dynamic-plan — author and run a parallel planning + plan-challenge workflow
26
-
27
- Author and run a dynamic Workflow that plans and challenges every ticket in parallel, audits the plans against each other, and auto-resolves the decisions the preference profile settles.
28
-
29
- {{agent_roster()}}
30
-
31
- {{agent_caveats()}}
32
-
33
- ---
34
-
35
- **Requires:** ticket files directory or tracker issue list; optional `~/.devflow/preference-profile.md`
36
- **Produces:** per-ticket plan files + `DECISIONS-NEEDED.md` at `{worktree}/.devflow/docs/design/{slug}/{ts}/`
37
-
38
- ---
39
-
40
- ### Preflight checks
41
-
42
- Before authoring, verify:
43
-
44
- 1. **Workflow tool available:** if the `Workflow` tool is not in your available tools, STOP and tell the user: "The Workflow tool is not available in this session. dynamic-plan requires Claude Code's dynamic workflow runtime."
45
- 2. **Tracker paths:** a list of issue references or URLs is read through the Git agent, which resolves the configured tracker and its access itself and reports `TRACEABILITY: DEGRADED ({reason})` when it cannot read an issue — then fall back to reading ticket `.md` files from a local path. No tracker CLI is checked here.
46
- 3. **No-remote path:** if the repo has no remote, read ticket files from the provided local path; the Git agent reports DEGRADED for any issue it cannot reach.
47
-
48
- ---
49
-
50
- ### Pre-authoring setup
51
-
52
- {{docs_root()}}
53
-
54
- 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`.
55
-
56
- <!-- curation:on -->
57
- **1. Apply decisions context**
58
-
59
- 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.
60
-
61
- <!-- curation:end -->
62
- **2. Read the preference profile**
63
-
64
- Run this in the same turn as the `resolve-root.cjs` call:
65
- ```bash
66
- cat ~/.devflow/preference-profile.md 2>/dev/null || echo "(no preference profile)"
67
- ```
68
-
69
- If present, note its contents as `PREFERENCE_PROFILE`. If absent, proceed with a one-line note in the output: "No preference profile found — run `/devflow:dynamic-profile` to generate one."
70
-
71
- **3. Resolve ticket input**
72
-
73
- What follows the command is bound once, here. Every later step names it `COMMAND_INPUT` and never restates it:
74
-
75
- <command-input>
76
- $ARGUMENTS
77
- </command-input>
78
-
79
- Determine the ticket source from `COMMAND_INPUT` (in priority order):
80
- - A directory of ticket `.md` files (from `/devflow:dynamic-tickets` output)
81
- - A list of candidate issue references or issue URLs
82
- - Inline ticket descriptions passed as args
83
-
84
- {{issue_ref_grammar()}}
85
-
86
- Note the tickets and their key constraints; the agents read them in full.
87
-
88
- {{issue_capture_contract()}}
89
-
90
- ---
91
-
92
- ### AskUserQuestion at the command boundary, never inside the workflow
93
-
94
- A workflow cannot pause mid-run. It only writes `DECISIONS-NEEDED.md`; you read the file and ask after the workflow returns.
95
-
96
- After the workflow completes:
97
- 1. **Check each plan's test plan.** For every path in `planPaths`, copy that plan's `## Test Plan` section — the heading and its TP lines, up to the next `## ` heading — byte for byte into a new file in a `mktemp -d` folder with the Write tool, never through an interpolated shell string, and run the check below on it. Batch the plans: one `mktemp -d` call, one turn of parallel Writes, one file per plan, and one Bash call runs every check, each behind an `echo "file=<that file>"` line:
98
-
99
- ```bash
100
- node "$HOME/.devflow/scripts/verify-evidence.cjs" check tp <that file>; echo "exit=$?"
101
- ```
102
-
103
- Check the section, never the whole plan file. `exit=0` passes. Any other result names that plan `test plan malformed (<code>)` in your summary, `<code>` being the code the script printed on stderr; a plan with no `## Test Plan` section copies as an empty file, which the script refuses. Nothing is repaired: `/devflow:dynamic-build` passes no test plan from that plan.
104
- 2. Read the `decisionsNeededPath` the workflow returned, in the same turn as the checks — never the flat `{worktree}/.devflow/docs/design/DECISIONS-NEEDED.md`.
105
- 3. First surface the **Auto-Resolved Decisions** section (decision → resolution → source) for audit, then ask all open **Decisions Needed** in one batched `AskUserQuestion`, never one at a time.
106
- 4. The user's answers feed into their own plan edits or a follow-up `/devflow:dynamic-plan` run.
107
-
108
- ---
109
-
110
- ### Planning + plan-challenge workflow structure
111
-
112
- Author a workflow script shaped like:
113
-
114
- ```js
115
- export const meta = {
116
- name: "devflow-dynamic-plan",
117
- description: "Parallel planning + plan-challenge: per-ticket plans + acceptance criteria + DECISIONS-NEEDED.md",
118
- phases: ["read-tickets", "plan-parallel", "plan-challenge", "cross-plan-critic", "preference-resolve", "write-artifacts"]
119
- };
120
-
121
- // AskUserQuestion happens at the command boundary after this workflow returns — NOT here.
122
-
123
- const ticketSource = args.ticketSource || args[0] || "see task description";
124
- <!-- curation:on -->
125
- const DECISIONS_CONTEXT = args.decisionsContext || ""; // injected before authoring
126
- <!-- curation:end -->
127
- const PREFERENCE_PROFILE = args.preferenceProfile || ""; // injected before authoring
128
- 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)
129
- const slug = args.slug || "wave";
130
- const now = new Date(), two = (n) => String(n).padStart(2, '0');
131
- const ts = `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())}_${two(now.getHours())}${two(now.getMinutes())}`;
132
- const ROOT = args.root; // {worktree} from Pre-authoring setup: the checkout's toplevel, never cwd
133
- const OUTDIR = `${ROOT}/.devflow/docs/design/${slug}/${ts}`;
134
-
135
- // Phase 1: Read all tickets
136
- const tickets = await phase("read-tickets", () =>
137
- agent(`Read all tickets from: ${ticketSource}
138
- For each ticket, extract: title, summary, wave, dependsOn, scope (in/out), acceptance criteria, open questions, and any existing implementation hints.
139
- If the source is a directory, read all .md files. If the source is tracker issues, use the Git agent's fetch-issue or fetch-issues-batch operation.
140
- Return: array of ticket objects with all fields.`, { agentType: "Git" })
141
- );
142
-
143
- // Phase 2: Plan all tickets in parallel — one agent per ticket
144
- const plans = await phase("plan-parallel", () =>
145
- parallel((tickets || []).map(ticket => () =>
146
- agent(`Write an implementation plan for this ticket.
147
- Ticket: ${JSON.stringify(ticket)}
148
- <!-- curation:on -->
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
- <!-- curation:end -->
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.
152
- Write a thorough but tight plan — every section must earn its place for a Code agent who has no other context.
153
- Return: { ticketTitle, planMarkdown, openDecisions (array of genuine unknowns requiring user input) }.`, { agentType: "Architect" })
154
- ))
155
- );
156
-
157
- // Phase 3: Plan-challenge — one adversarial challenger per ticket (parallel)
158
- // Keep the challenge intent below verbatim; never paraphrase it.
159
- const challenged = await phase("plan-challenge", () =>
160
- parallel((plans || []).map((plan, i) => () =>
161
- agent(`Challenge this implementation plan. Verbatim challenge intent:
162
- "Anything we can improve in this plan? Any gaps? Edge cases we did not address, changes or side-effects we did not consider? And make sure we have well-structured acceptance criteria and a test plan for our Evaluate and Test agents. We need to verify functionality, API contracts, performance. If there are any design decisions to be taken, loop me in."
163
-
164
- Plan under review: ${JSON.stringify(plan)}
165
- Ticket: ${JSON.stringify((tickets || [])[i])}
166
-
167
- Produce:
168
- 1. List of improvements / gaps / edge cases / side-effects identified.
169
- 2. Well-structured acceptance criteria (numbered, positive + negative, at least one negative per ticket). See the acceptance criteria contract below.
170
- 3. The test plan for the Test agent as TP lines, numbered from TP-1, at least one per criterion, each in exactly the shape of the test-plan line contract below. Map each scenario onto its line:
171
- - the scenario, in plain words, is the line's scenario text — never a path, a reference, a mention or markup;
172
- - the number of the criterion it covers is its (AC-m);
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;
174
- - the paths it exercises, from the plan's affected files, are its files: globs.
175
- Setup and expected outcome never go in a line: give them per TP in testScenarios.
176
- 4. A list of genuine design decisions that require user input (not settled by the plan or the preference profile).
177
-
178
- Test-plan line contract:
179
- ${TP_CONTRACT}
180
-
181
- Acceptance criteria quality bar (apply strictly):
182
- - Vague criteria ("the feature should work correctly") are not acceptable — reject and rewrite.
183
- - Implementation-coupled criteria ("the function must call X") are not acceptable — test behavior, not implementation.
184
- - Untestable criteria are not acceptable.
185
-
186
- Return: { ticketTitle, improvements (array), acceptanceCriteria (array of numbered strings), testPlan (array of TP-line strings, TP-1 first), testScenarios (array of {tp, setup, outcome}), openDecisions (array) }.`, { agentType: "Evaluate" })
187
- ))
188
- );
189
-
190
- // Phase 4: Cross-plan conflict critic — single Design agent sees all plans
191
- const crossCritic = await phase("cross-plan-critic", () =>
192
- agent(`Cross-plan conflict audit.
193
- All ticket plans + challenged criteria: ${JSON.stringify(challenged)}
194
- <!-- curation:on -->
195
- Decisions context: ${DECISIONS_CONTEXT}
196
- <!-- curation:end -->
197
-
198
- Audit:
199
- 1. API conflicts: two tickets defining the same API differently (different signatures, return types, error codes).
200
- 2. Contradictory invariants: two tickets that cannot both be true simultaneously.
201
- 3. Undeclared dependencies: ticket A's plan implicitly requires something ticket B provides, but no dependency is declared.
202
- 4. Scope overlap: two tickets both claim ownership of the same module or behavior.
203
-
204
- <!-- curation:on -->
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
- <!-- curation:off -->
207
- For each conflict found: state which two tickets are involved, describe the conflict precisely, and propose a resolution.
208
- <!-- curation:end -->
209
-
210
- Return: { conflicts (array of {tickets, conflictDescription, proposedResolution}), planAmendments (array of {ticketTitle, amendment}) }.`, { agentType: "Design" })
211
- );
212
-
213
- // Phase 5: Preference-profile auto-resolution
214
- const resolved = await phase("preference-resolve", () =>
215
- agent(`Apply the preference profile to auto-resolve open design decisions.
216
- Preference profile: ${PREFERENCE_PROFILE || "(none — no profile found)"}
217
- Open decisions from plan-challenge: ${JSON.stringify((challenged || []).flatMap(c => c.openDecisions || []))}
218
- Cross-plan conflicts needing resolution: ${JSON.stringify((crossCritic && crossCritic.conflicts) || [])}
219
-
220
- For each open decision:
221
- - If the preference profile settles it clearly: auto-resolve and note the rationale.
222
- - If not settled: add to the DECISIONS-NEEDED list for the user.
223
-
224
- Return: { autoResolved (array of {decision, resolution, source}), decisionsNeeded (array of {decision, context, options}) }.`, { agentType: "Synthesize" })
225
- );
226
-
227
- // Phase 6: Write artifacts — per-ticket plan files + DECISIONS-NEEDED.md
228
- return phase("write-artifacts", () =>
229
- agent(`Write all planning artifacts.
230
- Plans: ${JSON.stringify(plans)}
231
- Challenged plans (with acceptance criteria + test plans): ${JSON.stringify(challenged)}
232
- Cross-plan amendments: ${JSON.stringify(crossCritic && crossCritic.planAmendments)}
233
- Auto-resolved decisions: ${JSON.stringify(resolved && resolved.autoResolved)}
234
- Decisions needed: ${JSON.stringify(resolved && resolved.decisionsNeeded)}
235
- Output directory: ${OUTDIR}
236
-
237
- 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:
238
- - ## Implementation Plan
239
- - The plan body (incorporate cross-plan amendments)
240
- - ## Acceptance Criteria (numbered, positive + negative)
241
- - ## 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
242
- - ## Test Scenarios — one line per TP, in TP order: TP-n: its setup, then its expected outcome, from testScenarios
243
- <!-- curation:on -->
244
- - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source, naming a recorded decision in words, never by ID)
245
- <!-- curation:off -->
246
- - ## Auto-Resolved Decisions (if any — list each as: decision → resolution → source)
247
- <!-- curation:end -->
248
-
249
- Then write ${OUTDIR}/DECISIONS-NEEDED.md:
250
- <!-- curation:on -->
251
- - ## 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."
252
- <!-- curation:off -->
253
- - ## 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."
254
- <!-- curation:end -->
255
- - ## Decisions Needed
256
- - One section per open decision: what the decision is, why it matters, what options exist.
257
- - Include cross-plan conflicts that were not auto-resolved.
258
- <!-- curation:on -->
259
- - If no decisions needed, write: "No open decisions — all settled by preference profile or existing ADRs."
260
- <!-- curation:off -->
261
- - If no decisions needed, write: "No open decisions — all settled by the preference profile."
262
- <!-- curation:end -->
263
-
264
- Return: { planPaths (array), decisionsNeededPath (string), decisionsNeededCount (number) }.`, { agentType: "Synthesize" })
265
- );
266
- ```
267
-
268
- ---
269
-
270
- Phase 3 must produce the acceptance criteria and test plan shape that `/devflow:dynamic-build`'s Gate 2 consumes:
271
-
272
- {{acceptance_criteria_contract()}}
273
-
274
- ---
275
-
276
- ### Output schema
277
-
278
- The workflow returns:
279
-
280
- ```json
281
- {
282
- "planPaths": ["string — path to each per-ticket plan file; its ## Test Plan holds TP lines only, its ## Test Scenarios their setup and outcome"],
283
- "decisionsNeededPath": "string — path to DECISIONS-NEEDED.md",
284
- "decisionsNeededCount": "number — how many decisions need user input",
285
- "autoResolvedCount": "number — decisions auto-resolved by preference profile"
286
- }
287
- ```
288
-
289
- After the workflow returns: check each plan's test plan, then read `DECISIONS-NEEDED.md` and ask, as the list above says. If no preference profile was found, note in your summary: "no preference profile found — N decisions were surfaced that a profile might have auto-resolved; consider `/devflow:dynamic-profile`."
@@ -1,103 +0,0 @@
1
- ---
2
- description: Decision-preference profile distiller — mine past session transcripts of all projects into ~/.devflow/preference-profile.md
3
- argument-hint: "[--dry-run]"
4
- output-dir: dist/commands
5
- ---
6
- ## dynamic-profile — distill a decision-preference profile from past sessions
7
-
8
- This command spawns one Knowledge agent that reads past session history across all projects on this machine, finds the `AskUserQuestion` moments and the user's chosen answers, and writes a plain-prose preference profile to `~/.devflow/preference-profile.md`. `/devflow:dynamic-plan` reads the profile to pre-resolve design decisions that match established taste, so only new decisions reach the user.
9
-
10
- **This is one plain Agent spawn, not a Workflow.** The agent does the reading and writing directly.
11
-
12
- ---
13
-
14
- **Requires:** read access to `{claude_dir}/projects/*/` session transcripts and `{claude_dir}/rules/`
15
- **Produces:** `~/.devflow/preference-profile.md` — plain-prose decision-preference profile
16
-
17
- ---
18
-
19
- ### Claude Code's directory
20
-
21
- `{claude_dir}` is Claude Code's directory, resolved once, the way the installer resolves it: `CLAUDE_CONFIG_DIR` when that is set to an absolute path, else `$HOME/.claude`. Run
22
-
23
- ```bash
24
- d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"
25
- ```
26
-
27
- and use its one-line output. Pass it to the agent below as `CLAUDE_DIR`.
28
-
29
- ---
30
-
31
- ### Privacy note
32
-
33
- This command mines session transcripts across **all projects** on this machine — `{claude_dir}/projects/*/*.jsonl`, `{claude_dir}/history.jsonl`, and feedback memories. Planning prompts then carry the profile, so one project's decisions may influence planning in another. The user reviews and edits the profile before use. It is never committed to any repo.
34
-
35
- ---
36
-
37
- ### When --dry-run is passed
38
-
39
- Print what the agent would do (a summary of which paths under the resolved `{claude_dir}` it would search, what it would write) and STOP — do not spawn the agent.
40
-
41
- ---
42
-
43
- ### Agent task
44
-
45
- The task for the one Knowledge agent:
46
-
47
- ```
48
- You are distilling a decision-preference profile from past session history.
49
-
50
- CLAUDE_DIR: {claude_dir} — Claude Code's directory, already resolved; every path below is under it.
51
-
52
- BOUNDED READING — MANDATORY: transcripts are gigabytes; never full-read them.
53
- 1. Run: rg -l "AskUserQuestion" "{claude_dir}/projects/" 2>/dev/null | head -50
54
- to find transcript files that contain AskUserQuestion moments.
55
- 2. For each found file, run: rg -A 5 "AskUserQuestion" <file> | head -200
56
- to extract the question + nearby user response context. Sample broadly —
57
- aim for ~150-200 instances spread across projects and time windows.
58
- 3. Read {claude_dir}/history.jsonl if it exists (rg "AskUserQuestion" ... similarly).
59
- 4. Read all files in {claude_dir}/rules/ (small — read fully).
60
- 5. Read all *.md files in {claude_dir}/projects/*/memory/ (small — read fully).
61
-
62
- From this evidence, identify the recurring patterns in how the user answers design
63
- questions. Look for preferences about:
64
- - Error handling style (Result types vs exceptions, etc.)
65
- - Fix-all-issues vs defer-and-tech-debt stance
66
- - Architectural tradeoffs (coupling vs performance, etc.)
67
- - Code review behavior (accept suggestions or push back)
68
- - Testing discipline
69
- - Security stance
70
- - Any other recurrent taste patterns with at least 3 examples
71
-
72
- Write ~/.devflow/preference-profile.md as plain prose:
73
- - ## Overview: 1 paragraph summary of the user's overall decision style
74
- - ## Preferences (one ## section per identified pattern):
75
- - Pattern name
76
- - Observed behavior (plain language, no quotes from transcripts)
77
- - Confidence: high / medium / low (based on number of examples seen)
78
- - Example context: describe a scenario where this preference applies
79
- - ## Uncertain / incomplete: patterns with only 1-2 examples, flagged for user review
80
-
81
- Keep the profile scannable and honest. Do not fabricate preferences with no evidence.
82
- If a section has low confidence, say so. The user will review and edit this file.
83
-
84
- After writing, return: { path: "~/.devflow/preference-profile.md", patternCount: N, lowConfidenceCount: N }.
85
- ```
86
-
87
- Spawn it with the Agent tool: `Agent(subagent_type="Knowledge")`, with the task above as the prompt.
88
-
89
- ---
90
-
91
- ### Output
92
-
93
- After the agent returns, report:
94
-
95
- ```
96
- Profile written to ~/.devflow/preference-profile.md
97
- Patterns found: {patternCount} ({lowConfidenceCount} low-confidence — review these)
98
-
99
- Next steps:
100
- 1. Open ~/.devflow/preference-profile.md and review/edit the profile.
101
- 2. Run /devflow:dynamic-plan — it will read the profile and auto-resolve decisions matching your taste.
102
- 3. Re-run /devflow:dynamic-profile periodically to keep the profile fresh.
103
- ```