devflow-kit 2.5.0 → 3.0.1

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 (158) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +44 -19
  3. package/dist/agents/git.md +13 -15
  4. package/dist/cli/commands/ambient.js +160 -145
  5. package/dist/cli/commands/capture.js +29 -55
  6. package/dist/cli/commands/compliance.js +32 -61
  7. package/dist/cli/commands/context.js +17 -32
  8. package/dist/cli/commands/debug.js +65 -26
  9. package/dist/cli/commands/flags.js +3 -3
  10. package/dist/cli/commands/hud.js +34 -10
  11. package/dist/cli/commands/init-seed.js +40 -4
  12. package/dist/cli/commands/init.js +249 -271
  13. package/dist/cli/commands/install-report.js +10 -15
  14. package/dist/cli/commands/knowledge/index.js +1 -1
  15. package/dist/cli/commands/knowledge/toggle.js +11 -3
  16. package/dist/cli/commands/learning.js +52 -37
  17. package/dist/cli/commands/legacy-hooks.js +11 -14
  18. package/dist/cli/commands/memory.js +67 -78
  19. package/dist/cli/commands/proxy.js +23 -41
  20. package/dist/cli/commands/security.js +5 -13
  21. package/dist/cli/commands/skills.js +21 -3
  22. package/dist/cli/commands/tracker.js +100 -228
  23. package/dist/cli/commands/uninstall.js +343 -138
  24. package/dist/commands/bug-analysis.md +38 -12
  25. package/dist/commands/code-review.md +70 -21
  26. package/dist/commands/debug.md +37 -7
  27. package/dist/commands/dynamic-build.md +66 -17
  28. package/dist/commands/dynamic-plan.md +19 -8
  29. package/dist/commands/dynamic-profile.md +24 -10
  30. package/dist/commands/dynamic-tickets.md +22 -11
  31. package/dist/commands/explore.md +37 -7
  32. package/dist/commands/implement.md +96 -32
  33. package/dist/commands/plan.md +62 -19
  34. package/dist/commands/release.md +2 -2
  35. package/dist/commands/research.md +34 -8
  36. package/dist/commands/resolve.md +65 -17
  37. package/dist/commands/self-review.md +45 -9
  38. package/dist/core/compliance-compose.js +27 -27
  39. package/dist/core/evidence-policy.js +240 -24
  40. package/dist/core/feature-config.js +94 -25
  41. package/dist/core/feature-switch.js +1 -1
  42. package/dist/core/flags.js +30 -2
  43. package/dist/core/fs-atomic.js +27 -0
  44. package/dist/core/hook-log-dirs.js +104 -0
  45. package/dist/core/learning-tuning-config.js +5 -3
  46. package/dist/core/ledger-root.js +102 -0
  47. package/dist/core/manifest.js +6 -4
  48. package/dist/core/mds-variants.js +34 -97
  49. package/dist/core/migrations.js +49 -23
  50. package/dist/core/plugins.js +5 -4
  51. package/dist/core/project-paths.js +0 -17
  52. package/dist/core/same-location.js +25 -0
  53. package/dist/core/tracker.js +226 -139
  54. package/dist/hud/components/config-counts.js +15 -4
  55. package/dist/hud/components/learning-counts.js +14 -0
  56. package/dist/hud/config.js +2 -1
  57. package/dist/hud/cost-history.js +2 -4
  58. package/dist/hud/git.js +52 -7
  59. package/dist/hud/index.js +7 -9
  60. package/dist/skills/git/references/pr/check-merge-readiness.md +1 -1
  61. package/dist/skills/git/references/pr/ensure-pr-ready.md +1 -1
  62. package/dist/skills/git/references/pr/update-pr-evidence.md +1 -1
  63. package/dist/skills/git/references/tracker/_mcp.md +1 -1
  64. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +1 -1
  65. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +1 -1
  66. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +2 -2
  67. package/dist/skills/git/references/tracker/github/manage-debt.md +3 -3
  68. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +1 -1
  69. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +1 -1
  70. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +2 -2
  71. package/dist/skills/git/references/tracker/jira/manage-debt.md +1 -1
  72. package/dist/skills/git/references/tracker/jira/post-wave-report.md +1 -1
  73. package/dist/skills/git/references/tracker/jira/setup-task.md +1 -1
  74. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +1 -1
  75. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +1 -1
  76. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +2 -2
  77. package/dist/skills/git/references/tracker/linear/manage-debt.md +1 -1
  78. package/dist/skills/git/references/tracker/linear/post-wave-report.md +1 -1
  79. package/dist/skills/git/references/tracker/linear/setup-task.md +1 -1
  80. package/dist/targets/claude-code/claude-paths.js +59 -57
  81. package/dist/targets/claude-code/compliance-install.js +49 -65
  82. package/dist/targets/claude-code/hooks.js +108 -3
  83. package/dist/targets/claude-code/installer.js +30 -57
  84. package/dist/targets/claude-code/post-install.js +246 -139
  85. package/dist/targets/claude-code/tracker-install.js +38 -65
  86. package/package.json +5 -4
  87. package/src/assets/agents/code.md +4 -3
  88. package/src/assets/agents/design.md +1 -0
  89. package/src/assets/agents/git.mds +55 -57
  90. package/src/assets/agents/knowledge.md +2 -2
  91. package/src/assets/agents/review.md +3 -1
  92. package/src/assets/agents/tracker.md +37 -30
  93. package/src/assets/commands/_partials/_compliance.mds +19 -1
  94. package/src/assets/commands/_partials/_decisions.mds +15 -3
  95. package/src/assets/commands/_partials/_docs_root.mds +35 -0
  96. package/src/assets/commands/_partials/_engine.mds +2 -2
  97. package/src/assets/commands/_partials/_evidence_policy.mds +3 -3
  98. package/src/assets/commands/_partials/_factory.mds +1 -1
  99. package/src/assets/commands/_partials/_knowledge.mds +27 -9
  100. package/src/assets/commands/_partials/_plan_contract.mds +2 -2
  101. package/src/assets/commands/_partials/_preamble.mds +1 -1
  102. package/src/assets/commands/_partials/_publication.mds +6 -2
  103. package/src/assets/commands/_partials/_settings.mds +28 -0
  104. package/src/assets/commands/_partials/_ticket_template.mds +3 -3
  105. package/src/assets/commands/_partials/_tracker.mds +4 -4
  106. package/src/assets/commands/_partials/_wave.mds +4 -4
  107. package/src/assets/commands/bug-analysis.mds +19 -17
  108. package/src/assets/commands/code-review.mds +39 -33
  109. package/src/assets/commands/debug.mds +4 -5
  110. package/src/assets/commands/dynamic-build.mds +75 -53
  111. package/src/assets/commands/dynamic-plan.mds +20 -15
  112. package/src/assets/commands/dynamic-profile.mds +24 -11
  113. package/src/assets/commands/dynamic-tickets.mds +25 -20
  114. package/src/assets/commands/explore.mds +4 -5
  115. package/src/assets/commands/implement.mds +58 -45
  116. package/src/assets/commands/plan.mds +34 -29
  117. package/src/assets/commands/release.md +2 -2
  118. package/src/assets/commands/research.mds +11 -9
  119. package/src/assets/commands/resolve.mds +41 -39
  120. package/src/assets/commands/self-review.mds +24 -25
  121. package/src/assets/mds/git/_pr.mds +61 -61
  122. package/src/assets/mds/git/_references.mds +19 -19
  123. package/src/assets/mds/tracker/_common.mds +8 -8
  124. package/src/assets/mds/tracker/_github.mds +71 -71
  125. package/src/assets/mds/tracker/_jira.mds +74 -74
  126. package/src/assets/mds/tracker/_linear.mds +75 -75
  127. package/src/assets/mds/tracker/_mcp.mds +23 -17
  128. package/src/assets/scripts/hooks/background-memory-update +35 -19
  129. package/src/assets/scripts/hooks/capture-prompt +18 -12
  130. package/src/assets/scripts/hooks/capture-question +18 -12
  131. package/src/assets/scripts/hooks/capture-turn +27 -17
  132. package/src/assets/scripts/hooks/debug-trace +11 -6
  133. package/src/assets/scripts/hooks/ensure-devflow-init +33 -6
  134. package/src/assets/scripts/hooks/ensure-proxy +9 -8
  135. package/src/assets/scripts/hooks/ensure-root-gitignore +111 -36
  136. package/src/assets/scripts/hooks/git-marker +48 -0
  137. package/src/assets/scripts/hooks/json-helper.cjs +6 -1
  138. package/src/assets/scripts/hooks/lib/project-paths.cjs +0 -19
  139. package/src/assets/scripts/hooks/log-paths +80 -0
  140. package/src/assets/scripts/hooks/memory-worker +17 -15
  141. package/src/assets/scripts/hooks/pre-compact-memory +41 -16
  142. package/src/assets/scripts/hooks/queue-append +104 -30
  143. package/src/assets/scripts/hooks/resolve-project-root +101 -7
  144. package/src/assets/scripts/hooks/session-start-context +289 -122
  145. package/src/assets/scripts/hooks/session-start-memory +35 -16
  146. package/src/assets/scripts/lib/project-config.cjs +633 -0
  147. package/src/assets/scripts/resolve-evidence-policy.cjs +300 -220
  148. package/src/assets/scripts/resolve-settings.cjs +1054 -0
  149. package/src/assets/scripts/verify-evidence.cjs +1 -1
  150. package/src/assets/skills/compliance/SKILL.md +2 -2
  151. package/src/assets/skills/docs-framework/SKILL.md +6 -7
  152. package/src/assets/skills/docs-framework/references/patterns.md +10 -17
  153. package/src/assets/skills/gap-analysis/SKILL.md +2 -2
  154. package/src/assets/skills/git/references/github-api.md +9 -9
  155. package/src/assets/skills/git/references/patterns.md +1 -1
  156. package/src/assets/skills/worktree-support/SKILL.md +1 -1
  157. package/src/assets/skills/worktree-support/references/roots.md +29 -0
  158. package/src/targets/claude-code/templates/managed-settings.json +25 -9
@@ -8,8 +8,8 @@ output-dir: dist/commands
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
-
12
- {authoring_preamble()}
11
+ @import { docs_root } from "./_partials/_docs_root.mds"
12
+ {{authoring_preamble()}}
13
13
 
14
14
  ---
15
15
 
@@ -17,14 +17,14 @@ output-dir: dist/commands
17
17
 
18
18
  This command instructs you to construct and run a Claude Code dynamic Workflow that converts an initiative description or specification document into a fully reviewed, wave-structured ticket slate — reusing devflow's agents via `agentType`.
19
19
 
20
- {agent_roster()}
20
+ {{agent_roster()}}
21
21
 
22
- {agent_caveats()}
22
+ {{agent_caveats()}}
23
23
 
24
24
  ---
25
25
 
26
26
  **Requires:** initiative description or spec document path; tracker access only for filing the issues, which the Git agent resolves
27
- **Produces:** ticket `.md` files at `.devflow/docs/tickets/\{slug\}/\{ts\}/`, `tracking-issue.md`
27
+ **Produces:** ticket `.md` files at `{worktree}/.devflow/docs/tickets/{slug}/{ts}/`, `tracking-issue.md`
28
28
 
29
29
  ---
30
30
 
@@ -34,8 +34,8 @@ Before authoring, verify:
34
34
 
35
35
  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-tickets requires Claude Code's dynamic workflow runtime."
36
36
  2. **`agentType` support:** confirmed available (spike F5, 2026-06-11). If spawned agents return no results, check that devflow is installed (`devflow init` has been run).
37
- 3. **Tracker paths:** filing, when it runs, happens after the workflow and through the Git agent, which resolves the configured tracker and its access itself and reports `TRACEABILITY: DEGRADED (\{reason\})` for an issue it cannot file — that ticket stays a local `.md` file. No tracker CLI is checked here.
38
- 4. **No-remote path:** with no remote, the ticket files are still written to `.devflow/docs/tickets/\{slug\}/\{ts\}/`; whatever the Git agent cannot file without one, it reports as DEGRADED.
37
+ 3. **Tracker paths:** filing, when it runs, happens after the workflow and through the Git agent, which resolves the configured tracker and its access itself and reports `TRACEABILITY: DEGRADED ({reason})` for an issue it cannot file — that ticket stays a local `.md` file. No tracker CLI is checked here.
38
+ 4. **No-remote path:** with no remote, the ticket files are still written to `{worktree}/.devflow/docs/tickets/{slug}/{ts}/`; whatever the Git agent cannot file without one, it reports as DEGRADED.
39
39
 
40
40
  ---
41
41
 
@@ -47,7 +47,11 @@ Before you write the workflow script:
47
47
 
48
48
  **Produces:** EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL
49
49
 
50
- {evidence_policy()}
50
+ {{evidence_policy()}}
51
+
52
+ {{docs_root()}}
53
+
54
+ Pass `{worktree}` to the workflow as its `root` argument.
51
55
 
52
56
  **1. Apply decisions context**
53
57
 
@@ -92,7 +96,8 @@ const constraints = args.constraints || "";
92
96
  const DECISIONS_CONTEXT = args.decisionsContext || ""; // injected before authoring
93
97
  const slug = args.slug || initiative.toLowerCase().replace(/[^a-z0-9]+/g, '-').slice(0, 40);
94
98
  const ts = new Date().toISOString().slice(0,16).replace(/[-:T]/g, (c) => c === 'T' ? '_' : c === ':' ? '' : c);
95
- const OUTDIR = `.devflow/docs/tickets/${slug}/${ts}`;
99
+ const ROOT = args.root; // {worktree} from Pre-authoring setup: the checkout's toplevel, never cwd
100
+ const OUTDIR = `${ROOT}/.devflow/docs/tickets/${slug}/${ts}`;
96
101
 
97
102
  // Phase 1: Draft — one Design agent per ticket, all in parallel
98
103
  const drafts = await phase("draft", () =>
@@ -194,7 +199,7 @@ The six-phase pipeline above never files an issue. Filing happens here, at the c
194
199
  1. **Order and bound.** The tracking issue first, then each ticket file in dependency order: a ticket after every ticket its `**Depends on:**` line names, slate order (the workflow's `ticketPaths`) otherwise. One Git spawn at a time, never in parallel, and at most 50 spawns in all: a file past the cap is reported `not filed (cap 50)`.
195
200
  2. **Spawn**, once per file. A ticket's `REQUIREMENTS` opens with the two lines the wave reads from its issue body, each on its own line:
196
201
  - `**Wave:** N` — the file's wave number when it is digits only, else no Wave line.
197
- - `**Depends on:**` with each entry, a ticket title or file name, replaced by the reference step 3 wrote as that ticket's `**Issue:**` line — comma-separated, or `none`. An entry naming no ticket already filed in this run — unfiled, unknown, or written as a reference — ⇒ `TRACEABILITY: DEGRADED (unresolved dependency "\{entry\}")`, and that ticket is not filed: a dependency is never dropped.
202
+ - `**Depends on:**` with each entry, a ticket title or file name, replaced by the reference step 3 wrote as that ticket's `**Issue:**` line — comma-separated, or `none`. An entry naming no ticket already filed in this run — unfiled, unknown, or written as a reference — ⇒ `TRACEABILITY: DEGRADED (unresolved dependency "{entry}")`, and that ticket is not filed: a dependency is never dropped.
198
203
 
199
204
  Its `## Summary` paragraph follows, less any line opening with either label.
200
205
 
@@ -203,13 +208,13 @@ Agent(subagent_type="Git"):
203
208
  "OPERATION: ensure-traceable-issue
204
209
  TASK_DESCRIPTION: {the ticket's title, or the tracking issue's H1}
205
210
  REQUIREMENTS: {the ticket's **Wave:** and **Depends on:** lines, then its ## Summary paragraph; or the tracking issue's ## Context}
206
- PLAN_ARTIFACT_PATH: {the ticket or tracking-issue file path}
207
- WORKTREE_PATH: {WORKTREE_PATH when provided; omit otherwise}"
211
+ PLAN_ARTIFACT_PATH: {the ticket or tracking-issue file path, relative to {worktree}}
212
+ WORKTREE_PATH: {worktree}"
208
213
  ```
209
214
 
210
- 3. **Capture** `**Issue**: \{ISSUE_REF\}` and `**Status**:` from the spawn's `## Issue Traced` Output.
211
- - `CREATED` or `ENRICHED`, with a reference that matches `^(#[1-9][0-9]\{0,8\}|[A-Z][A-Z0-9_]\{0,9\}-[1-9][0-9]\{0,8\})$` as a whole ⇒ insert `**Issue:** \{ISSUE_REF\}` with the Edit tool: in a ticket file as the line directly after its `**Depends on:**` line, in `tracking-issue.md` as the line directly after its H1. Change nothing else in the file.
212
- - A reference of any other shape ⇒ `TRACEABILITY: DEGRADED (issue reference "\{ref\}" does not match any tracker reference grammar)`, and no line.
215
+ 3. **Capture** `**Issue**: {ISSUE_REF}` and `**Status**:` from the spawn's `## Issue Traced` Output.
216
+ - `CREATED` or `ENRICHED`, with a reference that matches `^(#[1-9][0-9]{0,8}|[A-Z][A-Z0-9_]{0,9}-[1-9][0-9]{0,8})$` as a whole ⇒ insert `**Issue:** {ISSUE_REF}` with the Edit tool: in a ticket file as the line directly after its `**Depends on:**` line, in `tracking-issue.md` as the line directly after its H1. Change nothing else in the file.
217
+ - A reference of any other shape ⇒ `TRACEABILITY: DEGRADED (issue reference "{ref}" does not match any tracker reference grammar)`, and no line.
213
218
  - `DEGRADED (rate limited)` ⇒ stop filing: this file and every file after it are reported `not filed`. Any other DEGRADED ⇒ that file gets no line; report it and go on to the next.
214
219
  4. **Report** each file's `**Issue:**` reference, or `not filed` and why, with every `TRACEABILITY: DEGRADED` line step 2 and the spawns produced.
215
220
 
@@ -221,7 +226,7 @@ WORKTREE_PATH: {WORKTREE_PATH when provided; omit otherwise}"
221
226
 
222
227
  Every ticket artifact must use this shape:
223
228
 
224
- {ticket_body_template()}
229
+ {{ticket_body_template()}}
225
230
 
226
231
  ---
227
232
 
@@ -229,17 +234,17 @@ Every ticket artifact must use this shape:
229
234
 
230
235
  The pipeline above implements this general shape:
231
236
 
232
- {factory_shape()}
237
+ {{factory_shape()}}
233
238
 
234
239
  ---
235
240
 
236
241
  ### Artifact paths
237
242
 
238
- Tickets → `.devflow/docs/tickets/\{slug\}/\{ts\}/\{ticket-slug\}.md`
243
+ Tickets → `{worktree}/.devflow/docs/tickets/{slug}/{ts}/{ticket-slug}.md`
239
244
 
240
- Tracking issue → `.devflow/docs/tickets/\{slug\}/\{ts\}/tracking-issue.md`
245
+ Tracking issue → `{worktree}/.devflow/docs/tickets/{slug}/{ts}/tracking-issue.md`
241
246
 
242
- Honor the `WORKTREE_PATH` prefix when provided: all artifact paths become `\{WORKTREE_PATH\}/.devflow/docs/tickets/...`.
247
+ `{worktree}` is the docs root resolved in Pre-authoring setup (it honours `WORKTREE_PATH` when provided).
243
248
 
244
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.
245
250
 
@@ -4,7 +4,6 @@ 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
-
8
7
  # Explore Command
9
8
 
10
9
  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.
@@ -30,7 +29,7 @@ Explore a codebase area by spawning parallel agents for flow tracing, dependency
30
29
 
31
30
  **Produces:** DECISIONS_CONTEXT
32
31
 
33
- {decisions_load()}
32
+ {{decisions_load()}}
34
33
 
35
34
  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.
36
35
 
@@ -87,12 +86,12 @@ Present findings to user. Use AskUserQuestion to offer focused follow-up explora
87
86
  **Requires:** MERGED_FINDINGS, DECISIONS_CONTEXT
88
87
  **Produces:** FEATURE_KNOWLEDGE_STATUS (created | skipped)
89
88
 
90
- 1. Check if matching feature knowledge already exists by reading `\{worktree\}/.devflow/features/index.md` (or globbing frontmatter if absent). If covered → skip
91
- 2. Use AskUserQuestion: "No feature knowledge exists for \{explored area\}. Create one to capture these patterns?"
89
+ 1. Check if matching feature knowledge already exists by reading `{worktree}/.devflow/features/index.md` (or globbing frontmatter if absent). If covered → skip
90
+ 2. Use AskUserQuestion: "No feature knowledge exists for {explored area}. Create one to capture these patterns?"
92
91
  3. If user declines → set FEATURE_KNOWLEDGE_STATUS = skipped
93
92
  4. If user accepts: proceed with write-back below.
94
93
 
95
- {knowledge_writeback()}
94
+ {{knowledge_writeback()}}
96
95
 
97
96
  Set FEATURE_KNOWLEDGE_STATUS = created (if agent spawned) or skipped.
98
97
 
@@ -4,11 +4,12 @@ output-dir: dist/commands
4
4
  ---
5
5
  @import { knowledge_load, knowledge_writeback } from "./_partials/_knowledge.mds"
6
6
  @import { decisions_load } from "./_partials/_decisions.mds"
7
+ @import { docs_root } from "./_partials/_docs_root.mds"
7
8
  @import { evidence_policy, evidence_exception } from "./_partials/_evidence_policy.mds"
8
9
  @import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
9
10
  @import { test_plan_line } from "./_partials/_plan_contract.mds"
10
11
  @import { publication_gate } from "./_partials/_publication.mds"
11
-
12
+ @import "./_partials/_compliance.mds" as compliance
12
13
  # Implement Command
13
14
 
14
15
  Orchestrate a single task through implementation by spawning specialized agents. The orchestrator only spawns agents and passes context - all work is done by agents.
@@ -30,7 +31,7 @@ Orchestrate a single task through implementation by spawning specialized agents.
30
31
  - Task description: "implement JWT auth"
31
32
  - Empty: use conversation context
32
33
 
33
- {issue_ref_grammar()}
34
+ {{issue_ref_grammar()}}
34
35
 
35
36
  > **Tip**: For best results, run `/plan` first to produce a design artifact, then pass it to `/implement`.
36
37
 
@@ -42,7 +43,7 @@ When the user explicitly asks to re-validate, re-check, or re-run quality gates
42
43
 
43
44
  1. **Branch safety check**: If on a protected branch (main, master, develop, etc.), run Phase 1 to create/switch to a work branch. If already on a work branch, skip Phase 1.
44
45
  2. **Skip Phase 2** — no Code agent needed, user already made changes.
45
- 3. **Detect FILES_CHANGED**: `git diff --name-only \{base_branch\}...HEAD`
46
+ 3. **Detect FILES_CHANGED**: `git diff --name-only {base_branch}...HEAD`
46
47
  4. **Run Phases 3-8** — full quality gate pipeline on detected changes.
47
48
  5. **Proceed to Phase 10** (Create PR), **Phase 10b** (Evidence) and **Phase 11** (Report).
48
49
 
@@ -56,7 +57,9 @@ If the user prompt does NOT match re-validation, proceed with the full pipeline
56
57
 
57
58
  Record the current branch name as `BASE_BRANCH` - this will be the PR target.
58
59
 
59
- {evidence_policy()}
60
+ {{docs_root()}}
61
+
62
+ {{evidence_policy()}}
60
63
 
61
64
  **Plan Document Handling** (when $ARGUMENTS is a path ending in `.md`):
62
65
  1. Read the plan document from the path provided
@@ -118,33 +121,33 @@ visible, a silently discarded request is not.
118
121
  - `BASE_BRANCH`: Branch this feature was created from (for PR target)
119
122
  - `ISSUE_NUMBER`: the provider-canonical issue identifier for this task — the same value the Git agent emits as `ISSUE_ID` (if provided, or created by the Git agent's issue-first step in setup-task)
120
123
 
121
- {issue_capture_contract()}
124
+ {{issue_capture_contract()}}
122
125
 
123
126
  **Ticket link, only when `ISSUE_REQUIRED` is `true`:** when the capture above holds no `ISSUE_PR_LINK` (absent, or `(none)`), ask with AskUserQuestion before any Code spawn — "No tracker issue is linked to this task. Record a self-attested exception, or stop?" — offering exactly these two options:
124
127
  - **Record an exception** — the user gives the reason as free text. Render it with the grammar below, as kind `ticket-link`; when the rendered reason is empty, ask for it once more, and stop as below if it is empty again.
125
- - **Stop** — report `BLOCKED (no ticket link)`, name the branch setup-task created (`TASK_ID`) and `BASE_BRANCH` so it can be reused or removed, and give the remedy: create or link the tracker issue and re-run `/implement` with its reference, or — for a team that does not want ticket links — commit `.devflow/policy.json` as `\{"version":1,"evidencePolicy":"standard"\}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
128
+ - **Stop** — report `BLOCKED (no ticket link)`, name the branch setup-task created (`TASK_ID`) and `BASE_BRANCH` so it can be reused or removed, and give the remedy: create or link the tracker issue and re-run `/implement` with its reference, or — for a team that does not want ticket links — commit `.devflow/project.json` as `{"version":1,"evidence":"standard"}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
126
129
 
127
- {evidence_exception()}
130
+ {{evidence_exception()}}
128
131
 
129
- **Record the exception at once**, before any Code spawn: write the rendered section as the `## Evidence Exceptions` section of `.devflow/docs/handoff-\{branch_slug\}.md`, creating the file if absent, and set `PR_EXCEPTIONS` to that section. The file is its one home until the PR exists: every later write to the file keeps the section byte-identical, every PR-creating Code spawn passes it verbatim as `PR_EXCEPTIONS`, and the file is deleted only once the PR exists — after the PR-creating Phase 2 Code agent under SINGLE_CODE_AGENT and SEQUENTIAL_CODE_AGENTS, after Phase 10 under PARALLEL_CODE_AGENTS. With no exception recorded, `PR_EXCEPTIONS` is `(none)`.
132
+ **Record the exception at once**, before any Code spawn: write the rendered section as the `## Evidence Exceptions` section of `{worktree}/.devflow/docs/handoff-{branch_slug}.md`, creating the file if absent, and set `PR_EXCEPTIONS` to that section. The file is its one home until the PR exists: every later write to the file keeps the section byte-identical, every PR-creating Code spawn passes it verbatim as `PR_EXCEPTIONS`, and the file is deleted only once the PR exists — after the PR-creating Phase 2 Code agent under SINGLE_CODE_AGENT and SEQUENTIAL_CODE_AGENTS, after Phase 10 under PARALLEL_CODE_AGENTS. With no exception recorded, `PR_EXCEPTIONS` is `(none)`.
130
133
 
131
- **Test plan.** Before any Code spawn, give the task a test plan in the evidence file `.devflow/docs/evidence-\{branch_slug\}.md` (`EVIDENCE_FILE`) — unlike the handoff file, it stays after the PR exists. It holds up to three sections, in this order and nothing else: `## Test Plan`; `## Evidence Exceptions`, a byte copy of `PR_EXCEPTIONS` present only while that is not `(none)`; and `## Claims`, always last, so every claim is appended at the end of the file. Create the file if absent; if it exists, replace its `## Test Plan` and `## Evidence Exceptions` sections and keep `## Claims` byte-identical.
134
+ **Test plan.** Before any Code spawn, give the task a test plan in the evidence file `{worktree}/.devflow/docs/evidence-{branch_slug}.md` (`EVIDENCE_FILE`) — unlike the handoff file, it stays after the PR exists. It holds up to three sections, in this order and nothing else: `## Test Plan`; `## Evidence Exceptions`, a byte copy of `PR_EXCEPTIONS` present only while that is not `(none)`; and `## Claims`, always last, so every claim is appended at the end of the file. Create the file if absent; if it exists, replace its `## Test Plan` and `## Evidence Exceptions` sections and keep `## Claims` byte-identical.
132
135
 
133
136
  Write the `## Test Plan` section: when `$ARGUMENTS` is a plan document with a `## Test Plan` section, copy that section's lines verbatim; otherwise write one TP line per acceptance criterion the plan, the issue or the task text states, numbered from `TP-1`. Never invent a criterion, and word every scenario yourself in plain words: the lines reach the PR body, so a scenario holds no `#`, `@` or `/` — no issue reference, mention, closing keyword target or URL — and the files a TP covers go in its `files:` field. Each line follows the TP-line contract:
134
137
 
135
- {test_plan_line()}
138
+ {{test_plan_line()}}
136
139
 
137
140
  Check the section:
138
141
 
139
142
  ```bash
140
- node "${DEVFLOW_DIR:-$HOME/.devflow}/scripts/verify-evidence.cjs" check tp .devflow/docs/evidence-{branch_slug}.md; echo "exit=$?"
143
+ node "$HOME/.devflow/scripts/verify-evidence.cjs" check tp "{worktree}/.devflow/docs/evidence-{branch_slug}.md"; echo "exit=$?"
141
144
  ```
142
145
 
143
146
  `exit=0` passes. On any other result, rewrite the section once — the script names the failing line and its code on stderr — and check again. Still failing, or no line to write, means the test plan is **missing**: drop the `## Test Plan` section from the file.
144
147
 
145
148
  **Missing test plan, only when `EVIDENCE_POLICY` is `required`:** when the check above leaves the test plan missing, ask with AskUserQuestion before any Code spawn — "No test plan could be written for this task. Record a self-attested exception, or stop?" — offering exactly these two options:
146
- - **Record an exception** — the user gives the reason as free text. Render it with the exception grammar above, as kind `test-plan`; when the rendered reason is empty, ask for it once more, and stop as below if it is empty again. Add the rendered line to the `## Evidence Exceptions` section of `.devflow/docs/handoff-\{branch_slug\}.md` — after any `ticket-link` line, creating the section and the file when absent — and set `PR_EXCEPTIONS` to that section, under the same rules as the record above.
147
- - **Stop** — report `BLOCKED (no test plan)`, name `TASK_ID` and `BASE_BRANCH` so the branch can be reused or removed, and give the remedy: state the acceptance criteria in the task, the issue or a `/plan` document (its `## Test Plan` section is copied) and re-run `/implement`, or — for a team that does not want test plans enforced — commit `.devflow/policy.json` as `\{"version":1,"evidencePolicy":"standard"\}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
149
+ - **Record an exception** — the user gives the reason as free text. Render it with the exception grammar above, as kind `test-plan`; when the rendered reason is empty, ask for it once more, and stop as below if it is empty again. Add the rendered line to the `## Evidence Exceptions` section of `{worktree}/.devflow/docs/handoff-{branch_slug}.md` — after any `ticket-link` line, creating the section and the file when absent — and set `PR_EXCEPTIONS` to that section, under the same rules as the record above.
150
+ - **Stop** — report `BLOCKED (no test plan)`, name `TASK_ID` and `BASE_BRANCH` so the branch can be reused or removed, and give the remedy: state the acceptance criteria in the task, the issue or a `/plan` document (its `## Test Plan` section is copied) and re-run `/implement`, or — for a team that does not want test plans enforced — commit `.devflow/project.json` as `{"version":1,"evidence":"standard"}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
148
151
 
149
152
  When `EVIDENCE_POLICY` is `standard`, a missing test plan is never asked about: carry `Test plan: missing` to the Phase 11 report.
150
153
 
@@ -153,19 +156,19 @@ When `EVIDENCE_POLICY` is `standard`, a missing test plan is never asked about:
153
156
  - `PR_TEST_PLAN_BLOCK` — when the test plan is present and this render ends in `exit=0`, its stdout byte for byte without that `exit=` line; `(none)` otherwise:
154
157
 
155
158
  ```bash
156
- node "${DEVFLOW_DIR:-$HOME/.devflow}/scripts/verify-evidence.cjs" render --plan .devflow/docs/evidence-{branch_slug}.md; echo "exit=$?"
159
+ node "$HOME/.devflow/scripts/verify-evidence.cjs" render --plan "{worktree}/.devflow/docs/evidence-{branch_slug}.md"; echo "exit=$?"
157
160
  ```
158
161
 
159
- - `EVIDENCE_FILE` — `.devflow/docs/evidence-\{branch_slug\}.md`, its `## Evidence Exceptions` section now a byte copy of `PR_EXCEPTIONS` (absent when that is `(none)`).
162
+ - `EVIDENCE_FILE` — `{worktree}/.devflow/docs/evidence-{branch_slug}.md`, its `## Evidence Exceptions` section now a byte copy of `PR_EXCEPTIONS` (absent when that is `(none)`).
160
163
 
161
- {publication_gate()}
162
- Phase 10b passes the resolved value to `update-pr-evidence`, which decides what each value means for the evidence comment.
164
+ {{publication_gate()}}
165
+ Phase 10b passes the resolved value to `update-pr-evidence`, which decides what each value means for the evidence comment. From the same line: {{compliance.compliance_frameworks()}} Pass it to every Code spawn.
163
166
 
164
- {decisions_load()}
167
+ {{decisions_load()}}
165
168
 
166
169
  Pass to Code agent (Phase 2) and Scrutinize agent (Phase 5).
167
170
 
168
- {knowledge_load()}
171
+ {{knowledge_load()}}
169
172
 
170
173
  ### Phase 2: Implement
171
174
 
@@ -199,10 +202,11 @@ CREATE_PR: true
199
202
  DOMAIN: {detected domain or 'fullstack'}
200
203
  FEATURE_KNOWLEDGE: {feature_knowledge}
201
204
  DECISIONS_CONTEXT: {decisions_context}
205
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
202
206
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
203
207
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
204
208
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
205
- PR_EXCEPTIONS: {the ## Evidence Exceptions section of .devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
209
+ PR_EXCEPTIONS: {the ## Evidence Exceptions section of {worktree}/.devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
206
210
  PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}"
207
211
  ```
208
212
 
@@ -224,11 +228,12 @@ CREATE_PR: false
224
228
  DOMAIN: {phase 1 domain, e.g., 'backend'}
225
229
  FEATURE_KNOWLEDGE: {feature_knowledge}
226
230
  DECISIONS_CONTEXT: {decisions_context}
231
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
227
232
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
228
233
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
229
234
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
230
235
  HANDOFF_REQUIRED: true
231
- HANDOFF_FILE: .devflow/docs/handoff-{branch_slug}.md"
236
+ HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
232
237
  ```
233
238
 
234
239
  **Phase 2+ Code agents** (after prior phase completes):
@@ -245,16 +250,17 @@ PRIOR_PHASE_SUMMARY: {summary from previous Code agent}
245
250
  FILES_FROM_PRIOR_PHASE: {list of files created}
246
251
  FEATURE_KNOWLEDGE: {feature_knowledge}
247
252
  DECISIONS_CONTEXT: {decisions_context}
253
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
248
254
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
249
255
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
250
256
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
251
- PR_EXCEPTIONS: {the ## Evidence Exceptions section of .devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
257
+ PR_EXCEPTIONS: {the ## Evidence Exceptions section of {worktree}/.devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
252
258
  PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}
253
259
  HANDOFF_REQUIRED: {true if not last phase}
254
- HANDOFF_FILE: .devflow/docs/handoff-{branch_slug}.md"
260
+ HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
255
261
  ```
256
262
 
257
- **Handoff Protocol**: Each sequential Code agent receives the prior Code agent's implementation summary via PRIOR_PHASE_SUMMARY and FILES_FROM_PRIOR_PHASE. The Code agent's built-in branch orientation step handles git log scanning, file reading, and pattern discovery automatically. After each Code agent with HANDOFF_REQUIRED=true completes, write its phase summary to `.devflow/docs/handoff-\{branch_slug\}.md` using the Write tool (survives context compaction), keeping any `## Evidence Exceptions` section byte-identical. Delete `.devflow/docs/handoff-\{branch_slug\}.md` once the PR exists — after the final Code agent, which creates it, completes (cleanup).
263
+ **Handoff Protocol**: Each sequential Code agent receives the prior Code agent's implementation summary via PRIOR_PHASE_SUMMARY and FILES_FROM_PRIOR_PHASE. The Code agent's built-in branch orientation step handles git log scanning, file reading, and pattern discovery automatically. After each Code agent with HANDOFF_REQUIRED=true completes, write its phase summary to `{worktree}/.devflow/docs/handoff-{branch_slug}.md` using the Write tool (survives context compaction), keeping any `## Evidence Exceptions` section byte-identical. Delete `{worktree}/.devflow/docs/handoff-{branch_slug}.md` once the PR exists — after the final Code agent, which creates it, completes (cleanup).
258
264
 
259
265
  ---
260
266
 
@@ -273,6 +279,7 @@ CREATE_PR: false
273
279
  DOMAIN: {subtask 1 domain}
274
280
  FEATURE_KNOWLEDGE: {feature_knowledge}
275
281
  DECISIONS_CONTEXT: {decisions_context}
282
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
276
283
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
277
284
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
278
285
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
@@ -287,6 +294,7 @@ CREATE_PR: false
287
294
  DOMAIN: {subtask 2 domain}
288
295
  FEATURE_KNOWLEDGE: {feature_knowledge}
289
296
  DECISIONS_CONTEXT: {decisions_context}
297
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
290
298
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
291
299
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
292
300
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
@@ -319,14 +327,15 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
319
327
  - Spawn Code agent with fix context:
320
328
  ```
321
329
  Agent(subagent_type="Code"):
322
- "TASK_ID: \{task-id\}
330
+ "TASK_ID: {task-id}
323
331
  TASK_DESCRIPTION: Fix validation failures
324
332
  OPERATION: validation-fix
325
- VALIDATION_FAILURES: \{parsed failures from Validate agent\}
333
+ VALIDATION_FAILURES: {parsed failures from Validate agent}
326
334
  SCOPE: Fix only the listed failures, no other changes
327
335
  CREATE_PR: false
328
- ISSUE_NUMBER: \{ISSUE_ID captured in Phase 1, or (none)\}
329
- ISSUE_PR_LINK: \{ISSUE_PR_LINK captured in Phase 1, or (none)\}"
336
+ ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
337
+ ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
338
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
330
339
  ```
331
340
  - Loop back to Phase 3 (re-validate)
332
341
  4. If `validation_retry_count > 2`: Report failures to user and halt
@@ -421,19 +430,20 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
421
430
  - Spawn Code agent to fix misalignments:
422
431
  ```
423
432
  Agent(subagent_type="Code"):
424
- "TASK_ID: \{task-id\}
433
+ "TASK_ID: {task-id}
425
434
  TASK_DESCRIPTION: Fix alignment issues
426
435
  OPERATION: alignment-fix
427
- MISALIGNMENTS: \{structured misalignments from Evaluate agent\}
436
+ MISALIGNMENTS: {structured misalignments from Evaluate agent}
428
437
  SCOPE: Fix only the listed misalignments, no other changes
429
438
  CREATE_PR: false
430
- ISSUE_NUMBER: \{ISSUE_ID captured in Phase 1, or (none)\}
431
- ISSUE_PR_LINK: \{ISSUE_PR_LINK captured in Phase 1, or (none)\}"
439
+ ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
440
+ ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
441
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
432
442
  ```
433
443
  - Spawn Validate agent to verify fix didn't break tests:
434
444
  ```
435
445
  Agent(subagent_type="Validate", model="haiku"):
436
- "FILES_CHANGED: \{files modified by fix Code agent\}
446
+ "FILES_CHANGED: {files modified by fix Code agent}
437
447
  VALIDATION_SCOPE: changed-only"
438
448
  ```
439
449
  - If Validate agent FAIL: Report to user
@@ -468,19 +478,20 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
468
478
  - Spawn Code agent to fix QA failures:
469
479
  ```
470
480
  Agent(subagent_type="Code"):
471
- "TASK_ID: \{task-id\}
481
+ "TASK_ID: {task-id}
472
482
  TASK_DESCRIPTION: Fix QA test failures
473
483
  OPERATION: qa-fix
474
- QA_FAILURES: \{structured failures from Test agent\}
484
+ QA_FAILURES: {structured failures from Test agent}
475
485
  SCOPE: Fix only the listed failures, no other changes
476
486
  CREATE_PR: false
477
- ISSUE_NUMBER: \{ISSUE_ID captured in Phase 1, or (none)\}
478
- ISSUE_PR_LINK: \{ISSUE_PR_LINK captured in Phase 1, or (none)\}"
487
+ ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
488
+ ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
489
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
479
490
  ```
480
491
  - Spawn Validate agent to verify fix didn't break tests:
481
492
  ```
482
493
  Agent(subagent_type="Validate", model="haiku"):
483
- "FILES_CHANGED: \{files modified by fix Code agent\}
494
+ "FILES_CHANGED: {files modified by fix Code agent}
484
495
  VALIDATION_SCOPE: changed-only"
485
496
  ```
486
497
  - If Validate agent FAIL: Report to user
@@ -500,7 +511,7 @@ Strategy-conditional: run when the PR already exists — **SINGLE_CODE_AGENT** a
500
511
  3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to Phase 10.
501
512
  4. **If PENDING** → poll every 60 seconds (global budget, see step 7). Re-spawn Git agent each poll. If PASSING → proceed. If still PENDING after budget exhausted → report "CI still running — verify manually before merging" and proceed.
502
513
  5. **If INDETERMINATE** → poll as PENDING within the same budget. If still INDETERMINATE after budget exhausted → report "CI status unknown — verify manually before merging" and proceed.
503
- 6. **If FAILING** → report failing checks. Spawn `Agent(subagent_type="Code")` to fix CI failures based on check names and failure context. After fix, push and re-check. Max 2 fix attempts. If still failing → report failures and proceed.
514
+ 6. **If FAILING** → report failing checks. Spawn `Agent(subagent_type="Code")` with `COMPLIANCE_FRAMEWORKS` to fix CI failures based on check names and failure context. After fix, push and re-check. Max 2 fix attempts. If still failing → report failures and proceed.
504
515
  7. **Total budget**: max 10 polls and max 2 fix attempts across all check/fix cycles combined. If budget exhausted, report current status and proceed.
505
516
  <!-- /PATTERN: ci-status-gate -->
506
517
 
@@ -523,8 +534,9 @@ CREATE_PR: true
523
534
  PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
524
535
  ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
525
536
  ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
526
- PR_EXCEPTIONS: {the ## Evidence Exceptions section of .devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
527
- PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}"
537
+ PR_EXCEPTIONS: {the ## Evidence Exceptions section of {worktree}/.devflow/docs/handoff-{branch_slug}.md verbatim, or (none)}
538
+ PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}
539
+ COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
528
540
  ```
529
541
 
530
542
  Its Responsibility 7 composes the body, pastes `ISSUE_PR_LINK`, `PR_EXCEPTIONS` and `PR_TEST_PLAN_BLOCK` through their paste gates and scrubs the body (D11) before `gh pr create`. This command renders no link line and creates no PR itself: the Git agent's Phase-1 rendering is the only one, forwarded verbatim.
@@ -552,10 +564,11 @@ Agent(subagent_type="Git"):
552
564
  PR_NUMBER: {number from PR_URL}
553
565
  EVIDENCE_FILE: .devflow/docs/evidence-{branch_slug}.md
554
566
  REVIEW_PUBLICATION: {REVIEW_PUBLICATION resolved in Phase 1, or auto}
567
+ WORKTREE_PATH: {worktree}
555
568
  Update the PR's test-plan block and post its evidence comment."
556
569
  ```
557
570
 
558
- Omit the `EVIDENCE_FILE` line when that file does not exist. Capture the op's `## PR Evidence` block — its `EVIDENCE` line and its `**Body**:` / `**Comment**:` line — as `EVIDENCE_RESULT`, or its `TRACEABILITY: DEGRADED (\{reason\})` line. It never blocks: whatever it returns, continue to Phase 11.
571
+ Omit the `EVIDENCE_FILE` line when that file does not exist. Capture the op's `## PR Evidence` block — its `EVIDENCE` line and its `**Body**:` / `**Comment**:` line — as `EVIDENCE_RESULT`, or its `TRACEABILITY: DEGRADED ({reason})` line. It never blocks: whatever it returns, continue to Phase 11.
559
572
 
560
573
  ### Phase 11: Report
561
574
 
@@ -563,13 +576,13 @@ Omit the `EVIDENCE_FILE` line when that file does not exist. Capture the op's `#
563
576
 
564
577
  Display completion summary with phase status, PR info, and next steps.
565
578
 
566
- Show the test plan's evidence from Phase 10b: `Test plan: \{VERIFIED-CI + ATTESTED-LOCAL\}/\{total\} verified (VERIFIED-CI \{n\}, ATTESTED-LOCAL \{n\})`, read from the `EVIDENCE` line and never inferred, then its `**Body**:` / `**Comment**:` line verbatim. Without an `EVIDENCE` line, show `Test plan: evidence unavailable`; with no test plan, `Test plan: missing`.
579
+ Show the test plan's evidence from Phase 10b: `Test plan: {VERIFIED-CI + ATTESTED-LOCAL}/{total} verified (VERIFIED-CI {n}, ATTESTED-LOCAL {n})`, read from the `EVIDENCE` line and never inferred, then its `**Body**:` / `**Comment**:` line verbatim. Without an `EVIDENCE` line, show `Test plan: evidence unavailable`; with no test plan, `Test plan: missing`.
567
580
 
568
- If any Git agent output emitted `TRACEABILITY: DEGRADED (\{reason\})` lines during the run, or Phase 10b's push recorded one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
581
+ If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 10b's push recorded one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
569
582
 
570
583
  If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lines in the report.
571
584
 
572
- {knowledge_writeback()}
585
+ {{knowledge_writeback()}}
573
586
 
574
587
  ## Architecture
575
588