devflow-kit 3.9.0 → 3.10.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 (157) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +1 -1
  3. package/dist/agents/code.md +6 -6
  4. package/dist/agents/fix.md +6 -6
  5. package/dist/agents/harden.md +7 -6
  6. package/dist/agents/refactor.md +6 -6
  7. package/dist/cli/commands/ambient.js +10 -2
  8. package/dist/cli/commands/compliance-prompts.js +9 -4
  9. package/dist/cli/commands/compliance.js +171 -24
  10. package/dist/cli/commands/curation.js +12 -7
  11. package/dist/cli/commands/gate-level-prompts.js +39 -25
  12. package/dist/cli/commands/gates.js +5 -7
  13. package/dist/cli/commands/init.js +142 -138
  14. package/dist/cli/commands/install-report.js +34 -0
  15. package/dist/cli/commands/legacy-sweep.js +64 -0
  16. package/dist/cli/commands/proxy.js +6 -1
  17. package/dist/cli/commands/rules.js +29 -12
  18. package/dist/cli/commands/skills.js +42 -9
  19. package/dist/cli/commands/tracker.js +9 -3
  20. package/dist/cli/commands/uninstall.js +277 -51
  21. package/dist/commands/bug-analysis.md +69 -120
  22. package/dist/commands/dynamic-build.md +23 -23
  23. package/dist/commands/implement.md +46 -32
  24. package/dist/commands/release.md +1 -1
  25. package/dist/commands/resolve.md +35 -31
  26. package/dist/commands/self-review.md +8 -7
  27. package/dist/compliance-off/agents/git.md +120 -0
  28. package/dist/compliance-off/agents/triage.md +180 -0
  29. package/dist/compliance-off/commands/bug-analysis.md +398 -0
  30. package/dist/compliance-off/commands/code-review.md +520 -0
  31. package/dist/compliance-off/commands/dynamic-build.md +1251 -0
  32. package/dist/compliance-off/commands/dynamic-tickets.md +676 -0
  33. package/dist/compliance-off/commands/implement.md +736 -0
  34. package/dist/compliance-off/commands/plan.md +671 -0
  35. package/dist/compliance-off/commands/release.md +309 -0
  36. package/dist/compliance-off/commands/resolve.md +742 -0
  37. package/dist/compliance-off/skills/git/references/decision-markers.md +17 -0
  38. package/dist/compliance-off/skills/git/references/learn-conventions.md +80 -0
  39. package/dist/compliance-off/skills/git/references/pr/check-ci-status.md +33 -0
  40. package/dist/compliance-off/skills/git/references/pr/check-merge-readiness.md +49 -0
  41. package/dist/compliance-off/skills/git/references/pr/fetch-review-threads.md +52 -0
  42. package/dist/compliance-off/skills/git/references/pr/validate-branch.md +47 -0
  43. package/dist/compliance-off/skills/git/references/tracker/_contract.md +33 -0
  44. package/dist/compliance-off/skills/git/references/tracker/_mcp.md +153 -0
  45. package/dist/compliance-off/skills/git/references/tracker/github/create-release.md +35 -0
  46. package/dist/compliance-off/skills/git/references/tracker/github/ensure-pr-ready.md +100 -0
  47. package/dist/compliance-off/skills/git/references/tracker/github/ensure-traceable-issue.md +74 -0
  48. package/dist/compliance-off/skills/git/references/tracker/github/fetch-issue.md +69 -0
  49. package/dist/compliance-off/skills/git/references/tracker/github/fetch-issues-batch.md +65 -0
  50. package/dist/compliance-off/skills/git/references/tracker/github/gather-release-evidence.md +48 -0
  51. package/dist/compliance-off/skills/git/references/tracker/github/setup-task.md +77 -0
  52. package/dist/compliance-off/skills/git/references/tracker/jira/create-release.md +35 -0
  53. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-pr-ready.md +100 -0
  54. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-traceable-issue.md +61 -0
  55. package/dist/compliance-off/skills/git/references/tracker/jira/fetch-issue.md +51 -0
  56. package/dist/compliance-off/skills/git/references/tracker/jira/fetch-issues-batch.md +63 -0
  57. package/dist/compliance-off/skills/git/references/tracker/jira/gather-release-evidence.md +47 -0
  58. package/dist/compliance-off/skills/git/references/tracker/jira/setup-task.md +82 -0
  59. package/dist/compliance-off/skills/git/references/tracker/linear/create-release.md +35 -0
  60. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-pr-ready.md +100 -0
  61. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-traceable-issue.md +61 -0
  62. package/dist/compliance-off/skills/git/references/tracker/linear/fetch-issue.md +51 -0
  63. package/dist/compliance-off/skills/git/references/tracker/linear/fetch-issues-batch.md +63 -0
  64. package/dist/compliance-off/skills/git/references/tracker/linear/gather-release-evidence.md +47 -0
  65. package/dist/compliance-off/skills/git/references/tracker/linear/setup-task.md +83 -0
  66. package/dist/compliance-off/skills/git/references/trust-rule.md +7 -0
  67. package/dist/core/agent-models.js +19 -4
  68. package/dist/core/assets.js +126 -17
  69. package/dist/core/compliance-off-files.js +27 -0
  70. package/dist/core/curation-variants.js +460 -112
  71. package/dist/core/flags.js +2 -2
  72. package/dist/core/installed-variants.js +63 -0
  73. package/dist/core/manifest.js +48 -5
  74. package/dist/core/mds-variants.js +700 -3
  75. package/dist/core/orphan-sweep.js +11 -2
  76. package/dist/core/plugins.js +65 -8
  77. package/dist/curation-compliance-off/agents/triage.md +176 -0
  78. package/dist/curation-compliance-off/commands/bug-analysis.md +349 -0
  79. package/dist/curation-compliance-off/commands/code-review.md +481 -0
  80. package/dist/curation-compliance-off/commands/dynamic-build.md +1211 -0
  81. package/dist/curation-compliance-off/commands/dynamic-tickets.md +634 -0
  82. package/dist/curation-compliance-off/commands/implement.md +689 -0
  83. package/dist/curation-compliance-off/commands/plan.md +631 -0
  84. package/dist/curation-compliance-off/commands/release.md +279 -0
  85. package/dist/curation-compliance-off/commands/resolve.md +692 -0
  86. package/dist/curation-off/agents/code.md +6 -6
  87. package/dist/curation-off/agents/fix.md +6 -6
  88. package/dist/curation-off/agents/harden.md +7 -6
  89. package/dist/curation-off/agents/refactor.md +6 -6
  90. package/dist/curation-off/commands/bug-analysis.md +69 -119
  91. package/dist/curation-off/commands/dynamic-build.md +23 -23
  92. package/dist/curation-off/commands/implement.md +46 -32
  93. package/dist/curation-off/commands/release.md +1 -1
  94. package/dist/curation-off/commands/resolve.md +35 -31
  95. package/dist/curation-off/commands/self-review.md +8 -7
  96. package/dist/skills/git/references/pr/resolve-review-threads.md +1 -1
  97. package/dist/targets/claude-code/behavior-install.js +23 -9
  98. package/dist/targets/claude-code/charter-render.js +374 -0
  99. package/dist/targets/claude-code/compliance-install.js +32 -12
  100. package/dist/targets/claude-code/compliance-off-files.js +245 -0
  101. package/dist/targets/claude-code/curation-install.js +570 -100
  102. package/dist/targets/claude-code/installer.js +467 -62
  103. package/dist/targets/claude-code/language-stamp.js +6 -0
  104. package/dist/targets/claude-code/linked-folder.js +182 -0
  105. package/dist/targets/claude-code/reference-converge.js +118 -0
  106. package/dist/targets/claude-code/tracker-install.js +21 -8
  107. package/dist/targets/claude-code/tracker-servers.js +20 -6
  108. package/dist/targets/claude-code/workflow-folder-install.js +231 -0
  109. package/dist/variant-axes.json +109 -0
  110. package/package.json +1 -1
  111. package/src/assets/agents/_partials/_code.mds +6 -6
  112. package/src/assets/agents/evaluate.md +1 -1
  113. package/src/assets/agents/git.mds +32 -0
  114. package/src/assets/agents/harden.mds +7 -6
  115. package/src/assets/agents/test.md +21 -12
  116. package/src/assets/agents/triage.mds +2 -0
  117. package/src/assets/agents/validate.md +10 -10
  118. package/src/assets/commands/_partials/_compliance.mds +5 -3
  119. package/src/assets/commands/_partials/_engine.mds +9 -8
  120. package/src/assets/commands/_partials/_publication.mds +10 -1
  121. package/src/assets/commands/bug-analysis.mds +80 -126
  122. package/src/assets/commands/code-review.mds +43 -0
  123. package/src/assets/commands/dynamic-build.mds +109 -15
  124. package/src/assets/commands/dynamic-tickets.mds +13 -0
  125. package/src/assets/commands/implement.mds +145 -33
  126. package/src/assets/commands/plan.mds +19 -0
  127. package/src/assets/commands/release.mds +50 -1
  128. package/src/assets/commands/resolve.mds +217 -32
  129. package/src/assets/commands/self-review.mds +8 -7
  130. package/src/assets/mds/git/_ops.mds +23 -0
  131. package/src/assets/mds/git/_ops_steps.mds +17 -0
  132. package/src/assets/mds/git/_pr.mds +1 -1
  133. package/src/assets/mds/git/_references.mds +6 -0
  134. package/src/assets/mds/tracker/_common.mds +4 -0
  135. package/src/assets/mds/tracker/_github.mds +42 -0
  136. package/src/assets/mds/tracker/_jira.mds +43 -0
  137. package/src/assets/mds/tracker/_linear.mds +43 -0
  138. package/src/assets/rules/quality.md +2 -0
  139. package/src/assets/scripts/ci-wait.cjs +204 -126
  140. package/src/assets/scripts/hooks/assets/implement-installed +1 -0
  141. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +13 -11
  142. package/src/assets/scripts/hooks/preamble +18 -8
  143. package/src/assets/scripts/hooks/session-start-orchestrator +4 -2
  144. package/src/assets/scripts/pr-evidence.cjs +41 -2
  145. package/src/assets/scripts/verify-evidence.cjs +408 -56
  146. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +3 -3
  147. package/src/assets/skills/agent-references/references/commands/plan-levels.md +1 -1
  148. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +6 -2
  149. package/src/assets/skills/agent-references/references/validate/passed-alone.md +7 -7
  150. package/src/assets/skills/docs-framework/SKILL.md +5 -2
  151. package/src/assets/skills/git/SKILL.md +3 -3
  152. package/src/assets/skills/git/references/github-api.md +2 -139
  153. package/src/assets/skills/git/references/github-posting.md +158 -0
  154. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  155. package/src/assets/skills/review-methodology/references/patterns.md +1 -1
  156. package/src/assets/skills/review-methodology/references/report-template.md +1 -2
  157. package/src/assets/skills/testing/SKILL.md +2 -4
@@ -0,0 +1,309 @@
1
+ ---
2
+ description: Release project using adaptive learned configuration
3
+ ---
4
+
5
+ # Release Command
6
+
7
+ Release the project using adaptive learned configuration. On first run, scans the codebase to detect the release process and stores it in `.release/RELEASE-FLOW.md`. Subsequent releases use the stored config, skipping discovery.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /release v1.2.3 (explicit version)
13
+ /release patch (bump type: patch | minor | major)
14
+ /release --dry-run (simulate release, show plan without executing)
15
+ /release (interactive: ask for version)
16
+ ```
17
+
18
+ ## Input
19
+
20
+ What follows `/release` is bound once, here. Every later step names it `COMMAND_INPUT` and never restates it:
21
+
22
+ <command-input>
23
+ $ARGUMENTS
24
+ </command-input>
25
+
26
+ `COMMAND_INPUT` is one of:
27
+ - Explicit version: `v1.2.3` or `1.2.3`
28
+ - Bump type: `patch`, `minor`, `major`
29
+ - Flag: `--dry-run`
30
+ - Empty: interactive mode (will ask for version)
31
+
32
+ Parse from `COMMAND_INPUT`:
33
+ - `VERSION`: explicit version string if present (strip leading `v`)
34
+ - `BUMP_TYPE`: `patch | minor | major` if bump type provided
35
+ - `DRY_RUN`: true if `--dry-run` present, false otherwise
36
+
37
+ ## Phases
38
+
39
+ ### Phase 1: Load Config
40
+
41
+ **Produces:** RELEASE_CONFIG, CONFIG_STATE (`learned` | `fresh`)
42
+
43
+ **Continuation detection**: Check `.release/.progress.json`. If exists, an interrupted release is in progress. Offer user:
44
+ - **Resume**: continue from last checkpoint (skip phases already completed)
45
+ - **Restart**: clean start (delete `.release/.progress.json` and begin from Phase 1)
46
+
47
+ Read `.release/RELEASE-FLOW.md`:
48
+ - If exists → parse as structured config, set CONFIG_STATE = learned, skip to Phase 4
49
+ - If missing → set CONFIG_STATE = fresh, continue to Phase 2
50
+
51
+ ### Phase 1b: Load Context
52
+
53
+ **Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
54
+
55
+ **Resolve the settings line** once per worktree root, reusing a line this run already resolved for the same root. `{root}` is the worktree the values are for — the repository root in a one-worktree run:
56
+
57
+ ```bash
58
+ node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
59
+ ```
60
+
61
+ Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> CURATION=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=off CURATION=off KNOWLEDGE=off GATE_LEVEL=full` instead.
62
+
63
+ The accepted line is the only source of these values.
64
+
65
+ When the settings line says `CURATION=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
66
+
67
+ The decisions ledger belongs to the repository, not to one checkout: a linked worktree reads the main worktree's copy, a subdirectory session the repository root's. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
68
+
69
+ ```bash
70
+ git -C "{start}" rev-parse --path-format=absolute --show-toplevel --git-common-dir
71
+ ```
72
+
73
+ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first that applies:
74
+
75
+ 1. **The main worktree** — line 2 without its trailing `/.git`, when the output is exactly two lines each beginning with `/`, line 2 ends in `/.git`, and the directory left once it is removed is not your home directory and contains a `.devflow/` directory.
76
+ 2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
77
+ 3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
78
+
79
+ This is the rule the curation hooks apply, so you read the index the Curate agent writes.
80
+
81
+ Read `{ledger}/.devflow/curation/index.md`. If the file is absent or empty, set `DECISIONS_CONTEXT` to `(none)`; otherwise use the file content as `DECISIONS_CONTEXT`.
82
+
83
+ Hand each agent that takes `DECISIONS_CONTEXT` a slice, not the whole index: the index lines whose title, scope or area touch the files and task it works on, verbatim, led by `(slice: N of M entries — full index: <absolute index path>)` and closed by the index footer. When unsure, include the line. Siblings over one diff share ONE slice.
84
+
85
+ ### Load Feature Knowledge
86
+
87
+ Resolve `{worktree}` as the checkout's toplevel, because feature knowledge bases are committed with the branch (D-PROMPT-ROOT): from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`) — run
88
+
89
+ ```bash
90
+ git -C "{start}" rev-parse --show-toplevel
91
+ ```
92
+
93
+ and use its one-line output. If the command fails (outside a git repository), `{worktree}` is the start directory itself. All paths below are relative to `{worktree}`.
94
+
95
+ **Step 1 — Read the index cache:**
96
+
97
+ Attempt to read `{worktree}/.devflow/features/index.md`. Each line follows the format:
98
+
99
+ ```
100
+ - **{slug}** — {areas} — {Use-when description}
101
+ ```
102
+
103
+ If `index.md` exists and contains at least one entry line, use it for relevance matching.
104
+
105
+ **Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
106
+
107
+ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
108
+
109
+ **Step 3 — Pick relevant KBs:**
110
+
111
+ Match the current task area and description against each index line (or frontmatter `description` + `directories` on fallback). Select entries whose documented area overlaps the current task. This is a relevance judgment — prefer specificity over breadth.
112
+
113
+ **Step 4 — Read each selected KB's Rules:**
114
+
115
+ For each selected entry, `{kb}` is `{worktree}/.devflow/features/{slug}/KNOWLEDGE.md`:
116
+
117
+ 1. List its `##` headings with line numbers through Bash: `command grep -n '^## ' "{kb}"`. This only locates sections; the text of a KB comes from the Read view alone.
118
+ 2. Read the `## Rules` range (its line to the next heading) with the Read tool, using `offset` and `limit`, and choose the one to three bullets most relevant to the current task. The choice is yours, made per KB.
119
+ 3. If the KB has no `## Rules` section, choose one to three entries from its `## Anti-Patterns` or `## Gotchas` range the same way, and label them by that section's name instead of an ID.
120
+
121
+ When a KB contradicts the code you observe, **trust the code** — the code is the freshness mechanism; the KB may lag behind. A missing Rules section, a missing heading list and `(none)` are legitimate states, not errors.
122
+
123
+ **Step 5 — Set FEATURE_KNOWLEDGE and FEATURE_KNOWLEDGE_RULES:**
124
+
125
+ Write one block per selected KB. Paste each bullet verbatim from the Read view, never from a shell view. The path is relative to the checkout root; an agent resolves it under `WORKTREE_PATH` when one is provided.
126
+
127
+ ```
128
+ --- Feature knowledge: {slug} ---
129
+ KB: .devflow/features/{slug}/KNOWLEDGE.md
130
+ Rules:
131
+ - **KB-AP-2** {bullet text, verbatim}
132
+ - **KB-INV-1** {bullet text, verbatim}
133
+ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
134
+ ```
135
+
136
+ A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
137
+
138
+ **One git call, then direct reads — no `.cjs` script.**
139
+
140
+ Pass `DECISIONS_CONTEXT` and `FEATURE_KNOWLEDGE` only to agents whose contract declares them; the Validate and Git agents this command spawns do not.
141
+
142
+ ### Phase 1c: Resolve the Evidence Policy
143
+
144
+ **Produces:** EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL
145
+
146
+ **Resolve the evidence policy once per run**, from the repository root, before any step reads the values:
147
+
148
+ ```bash
149
+ node "$HOME/.devflow/scripts/resolve-evidence-policy.cjs" 2>/dev/null; echo "exit=$?"
150
+ ```
151
+
152
+ Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `EVIDENCE_POLICY=<required|standard> SOURCE=<file|worktree|default|invalid|error> REF=<branch|none>[ WARN=<remote-unavailable|invalid-file|raised-by-compliance|pr-changes-policy>[,…]] ISSUE_REQUIRED=<true|false> APPLY_CONVENTIONS=<true|false> REQUIRE_NON_AUTHOR_APPROVAL=<true|false>` — these fields, in this order, nothing else, where `<branch>` is a branch name such as `main`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `EVIDENCE_POLICY=required SOURCE=error REF=none ISSUE_REQUIRED=true APPLY_CONVENTIONS=true REQUIRE_NON_AUTHOR_APPROVAL=true` instead.
153
+
154
+ Set `EVIDENCE_POLICY`, `ISSUE_REQUIRED`, `APPLY_CONVENTIONS` and `REQUIRE_NON_AUTHOR_APPROVAL` from the accepted line. Pass agents only the three mechanism inputs, never `EVIDENCE_POLICY`. Report `Evidence policy: {EVIDENCE_POLICY} (source: {SOURCE})`, plus any `WARN` tokens as advisory, once in the final report.
155
+
156
+ Reuse this result for all subsequent phases: it decides whether a real release gathers its commit list (Phase 4) and passes it to the release notes (step 4).
157
+ When `EVIDENCE_POLICY` is `required`, record `TRACEABILITY: DEGRADED (compliance off on this machine; the repository requires evidence)` once, for the completion report.
158
+
159
+ ### Phase 2: Detect Release Process (First Run Only)
160
+
161
+ **Produces:** RELEASE_SIGNALS
162
+ **Requires:** CONFIG_STATE = fresh
163
+
164
+ Tiered codebase scan to detect the project's release process:
165
+
166
+ **Tier 1** — Read these if they exist: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `Dockerfile`, `.github/workflows/*.yml`, `CHANGELOG.md`
167
+
168
+ **Tier 2** — Broaden: monorepo indicators (`lerna.json`, `pnpm-workspace.yaml`, `turbo.json`), release tool configs (`.releaserc`, `.changeset/`, `release-please-config.json`)
169
+
170
+ **Tier 3** — Git history: `git tag -l` for tag format, `git log --oneline -20` for conventions
171
+
172
+ Skip credential files (`.env*`, `*credentials*`, `*secret*`, `*.key`). Max 20 files total.
173
+
174
+ ### Phase 3: Build Config (First Run Only)
175
+
176
+ **Produces:** RELEASE_CONFIG (written to disk)
177
+ **Requires:** RELEASE_SIGNALS
178
+
179
+ Map RELEASE_SIGNALS to `.release/RELEASE-FLOW.md` with sections: Packages, Pre-release Checks, Changelog, Build & Test, Publish, Post-release.
180
+
181
+ **Conventions naming:** Consult `.devflow/conventions.md` (the naming authority written by the Git `learn-conventions` operation) for version/tag/version-PR title conventions. When the branching model uses version PRs, follow the Version PR Titles convention recorded there; compliance defaults when the file is absent. When the repo uses a main+integration branching model, ship via a version PR per the recorded convention. Re-learn by deleting `.devflow/conventions.md` — the next Git `learn-conventions` call rewrites it.
182
+
183
+ Use AskUserQuestion for any gaps that cannot be inferred.
184
+
185
+ Lazy-init `.release/` directory. Create `.release/.gitignore` with `.progress.json` and `.lock/`.
186
+
187
+ ### Phase 4: Pre-release Checks
188
+
189
+ **Produces:** PRE_RELEASE_RESULT, VERSION, RELEASE_EVIDENCE
190
+ **Requires:** RELEASE_CONFIG, EVIDENCE_POLICY
191
+
192
+ **Version determination** (in order):
193
+ 1. Explicit version from args → use directly
194
+ 2. Bump type from args → compute from current version
195
+ 3. `semver-auto` strategy → analyze commits since the last release tag: the tag that `node "$HOME/.devflow/scripts/release-trace.cjs" last-tag`, run from the repository root, prints as `LAST_TAG <tag>` (`LAST_TAG none` ⇒ the initial commit) — never `git describe`, which can return a local marker tag
196
+ 4. None → use AskUserQuestion
197
+
198
+ Pre-release checks:
199
+ - Clean working directory (`git status --porcelain`)
200
+ - Tag does not already exist
201
+ - Custom checks from RELEASE_CONFIG
202
+
203
+ Spawn `Agent(subagent_type="Validate")` for build + test.
204
+
205
+ **Gather the commit list** — under either policy when `DRY_RUN` is true, otherwise only when `EVIDENCE_POLICY` is `required`: spawn `Agent(subagent_type="Git")` with `gather-release-evidence` operation; pass `WORKTREE_PATH` if provided. Keep `COMMIT_LIST` alone as RELEASE_EVIDENCE. The Git agent applies its own bounds and degrades gracefully per D4.
206
+
207
+ Unless `DRY_RUN` is true, write `.release/.progress.json` checkpoint, with RELEASE_EVIDENCE when it was gathered — a dry run leaves nothing to resume.
208
+
209
+ `--dry-run`: report what would happen and, when the commit list was gathered, that list — never asking — then **halt after this phase**.
210
+
211
+ ### Phase 5: Build Release Plan
212
+
213
+ **Produces:** RELEASE_PLAN
214
+ **Requires:** PRE_RELEASE_RESULT, RELEASE_CONFIG, VERSION, RELEASE_EVIDENCE
215
+
216
+ Build ordered execution plan from RELEASE_CONFIG. For monorepo: respect dependency ordering, present package selection to user.
217
+
218
+ Confirm with user via AskUserQuestion before executing:
219
+ "Ready to release v{VERSION}. Plan: {steps summary}. Proceed?"
220
+
221
+ `--dry-run`: should already be halted from Phase 4.
222
+
223
+ ### Phase 6: Execute Release
224
+
225
+ **Produces:** RELEASE_RESULT
226
+ **Requires:** RELEASE_PLAN, VERSION, EVIDENCE_POLICY, RELEASE_EVIDENCE
227
+
228
+ Sequential execution with progress checkpoints:
229
+ 1. **Version bumps** — write new version to configured files
230
+ 2. **Changelog update** — move Unreleased section to versioned entry (if configured)
231
+
232
+ **Load Companion Skills** (D-RELEASE-GIT-LOAD-LATE) — Load via Skill tool: `devflow:git`, here and not earlier: steps 1–2 only write files and `--dry-run` halts after Phase 4, so neither carries the skill. A resume that skips step 3 loads it before its next main-thread git write. If a skill fails to load, continue without it.
233
+
234
+ 3. **Release commit** — `chore(release): v{VERSION}` (conventional commit)
235
+ 4. **Tag and GitHub Release** — spawn `Agent(subagent_type="Git")` with `create-release` operation (the agent reads `.devflow/conventions.md` for tag format and release title conventions; compliance defaults when absent); only when `EVIDENCE_POLICY` is `required`, also pass `COMMIT_LIST` from RELEASE_EVIDENCE as an input so the agent includes it in the release notes body.
236
+ 5. **Publish** — CI-driven (report) or manual (provide instructions)
237
+ 6. **Post-release steps** — version bump to next dev
238
+
239
+ **Resume:** a checkpoint missing the RELEASE_EVIDENCE its Phase 4 gate called for is gathered again only before step 4; after step 4, report `evidence lost on resume` and continue — never block.
240
+
241
+ Delete `.release/.progress.json` on success.
242
+
243
+ ### Phase 7: Suggest Improvements
244
+
245
+ **Requires:** RELEASE_RESULT
246
+
247
+ Post-release analysis for improvement opportunities. Present as suggested diffs to RELEASE-FLOW.md. Never auto-apply. Fire-and-forget.
248
+
249
+ ## Worktree Support
250
+
251
+ If the orchestrator receives a `WORKTREE_PATH` context, pass it through to all spawned agents. Each agent's "Worktree Support" section handles path resolution.
252
+
253
+ ## Output
254
+
255
+ On completion:
256
+ - Git tag created: `v{VERSION}` (or configured tag format)
257
+ - GitHub Release created with release notes
258
+ - Changelog updated (if configured)
259
+ - Version files bumped
260
+ - `.release/RELEASE-FLOW.md` created (first run only)
261
+
262
+ ## Architecture
263
+
264
+ ```
265
+ /release (orchestrator)
266
+ │
267
+ ├─ Phase 1: Load Config
268
+ │ └─ Read .release/RELEASE-FLOW.md (learned) or proceed to detect (fresh)
269
+ │
270
+ ├─ Phase 1b: Load Context
271
+ │ └─ Load DECISIONS_CONTEXT and FEATURE_KNOWLEDGE for the agents that declare them
272
+ │
273
+ ├─ Phase 2: Detect Release Process (first run only)
274
+ │ └─ Tiered scan: package.json, CI workflows, git history
275
+ │
276
+ ├─ Phase 3: Build Config (first run only)
277
+ │ └─ Write .release/RELEASE-FLOW.md
278
+ │
279
+ ├─ Phase 4: Pre-release Checks
280
+ │ ├─ Validate agent (build + test)
281
+ │ ├─ Git agent: gather the commit list (dry run, or evidence policy required)
282
+ │ └─ Write progress checkpoint
283
+ │
284
+ ├─ Phase 5: Build Release Plan
285
+ │ └─ Confirm with user before executing
286
+ │
287
+ ├─ Phase 6: Execute Release
288
+ │ ├─ Version bumps → Changelog → Commit → Git agent (tag + release) → Publish → Post-release
289
+ │ └─ Progress checkpoints between each step
290
+ │
291
+ └─ Phase 7: Suggest Improvements
292
+ └─ Suggested diffs to RELEASE-FLOW.md (never auto-applied)
293
+ ```
294
+
295
+ ## Principles
296
+
297
+ 1. **Learn once, reuse always** — discovery happens on first run; subsequent releases skip it
298
+ 2. **Config is data, not code** — structured config fields map to pre-defined operations, never raw shell commands
299
+ 3. **Checkpoint-resume** — progress file enables safe resume of interrupted releases
300
+ 4. **User confirms before execution** — release plan is presented for approval before any tags or commits
301
+
302
+ ## Error Handling
303
+
304
+ - Validate agent reports no PASS: halt, report failures, do not proceed
305
+ - User declines release plan: halt gracefully
306
+ - Git agent reports DEGRADED while gathering: warn and continue — never halt the release
307
+ - Git agent fails (tag/release): halt, report error, suggest manual steps
308
+ - Mid-release failure: progress checkpoint enables resume on next run
309
+ - Version file not found: halt, report which file is missing, ask user to update RELEASE-FLOW.md