devflow-kit 2.4.0 → 3.0.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 (213) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +111 -18
  3. package/dist/agents/git.md +822 -0
  4. package/dist/cli/commands/agents.js +6 -1
  5. package/dist/cli/commands/ambient.js +160 -145
  6. package/dist/cli/commands/attribution-prompts.js +1 -1
  7. package/dist/cli/commands/capture.js +29 -55
  8. package/dist/cli/commands/compliance-prompts.js +1 -1
  9. package/dist/cli/commands/compliance.js +48 -55
  10. package/dist/cli/commands/context.js +17 -32
  11. package/dist/cli/commands/debug.js +65 -26
  12. package/dist/cli/commands/flags.js +3 -3
  13. package/dist/cli/commands/hud.js +34 -10
  14. package/dist/cli/commands/init-seed.js +61 -27
  15. package/dist/cli/commands/init.js +649 -240
  16. package/dist/cli/commands/install-report.js +200 -0
  17. package/dist/cli/commands/knowledge/index.js +2 -2
  18. package/dist/cli/commands/knowledge/toggle.js +35 -37
  19. package/dist/cli/commands/learning.js +79 -57
  20. package/dist/cli/commands/legacy-hooks.js +11 -14
  21. package/dist/cli/commands/memory.js +134 -135
  22. package/dist/cli/commands/prompt-io.js +4 -4
  23. package/dist/cli/commands/proxy.js +23 -41
  24. package/dist/cli/commands/security.js +81 -29
  25. package/dist/cli/commands/skills.js +71 -7
  26. package/dist/cli/commands/tracker-prompts.js +145 -0
  27. package/dist/cli/commands/tracker.js +277 -0
  28. package/dist/cli/commands/uninstall.js +520 -169
  29. package/dist/cli.js +2 -0
  30. package/dist/commands/bug-analysis.md +58 -14
  31. package/dist/commands/code-review.md +110 -32
  32. package/dist/commands/debug.md +55 -11
  33. package/dist/commands/dynamic-build.md +344 -73
  34. package/dist/commands/dynamic-plan.md +77 -27
  35. package/dist/commands/dynamic-profile.md +25 -11
  36. package/dist/commands/dynamic-tickets.md +76 -15
  37. package/dist/commands/explore.md +37 -7
  38. package/dist/commands/implement.md +314 -62
  39. package/dist/commands/plan.md +146 -32
  40. package/dist/commands/release.md +64 -17
  41. package/dist/commands/research.md +34 -8
  42. package/dist/commands/resolve.md +196 -68
  43. package/dist/commands/self-review.md +45 -9
  44. package/dist/core/agent-models.js +55 -12
  45. package/dist/core/assets.js +58 -2
  46. package/dist/core/compliance-compose.js +27 -27
  47. package/dist/core/evidence-policy.js +363 -0
  48. package/dist/core/feature-config.js +200 -65
  49. package/dist/core/feature-switch.js +112 -0
  50. package/dist/core/flags.js +34 -6
  51. package/dist/core/fs-atomic.js +27 -0
  52. package/dist/core/hook-log-dirs.js +104 -0
  53. package/dist/core/learning-tuning-config.js +5 -3
  54. package/dist/core/ledger-root.js +102 -0
  55. package/dist/core/manifest.js +38 -10
  56. package/dist/core/mds-variants.js +798 -0
  57. package/dist/core/migrations.js +49 -23
  58. package/dist/core/model-discovery.js +12 -1
  59. package/dist/core/plugins.js +361 -12
  60. package/dist/core/project-paths.js +1 -18
  61. package/dist/core/proxy-log.js +8 -6
  62. package/dist/core/proxy-state.js +11 -8
  63. package/dist/core/reference-sweep.js +136 -0
  64. package/dist/core/same-location.js +25 -0
  65. package/dist/core/tracker.js +494 -0
  66. package/dist/hud/components/config-counts.js +15 -4
  67. package/dist/hud/components/learning-counts.js +14 -0
  68. package/dist/hud/config.js +2 -1
  69. package/dist/hud/cost-history.js +2 -4
  70. package/dist/hud/git.js +52 -7
  71. package/dist/hud/index.js +7 -9
  72. package/dist/skills/git/references/decision-markers.md +19 -0
  73. package/dist/skills/git/references/learn-conventions.md +56 -0
  74. package/dist/skills/git/references/pr/check-ci-status.md +14 -0
  75. package/dist/skills/git/references/pr/check-merge-readiness.md +28 -0
  76. package/dist/skills/git/references/pr/ensure-pr-ready.md +24 -0
  77. package/dist/skills/git/references/pr/fetch-review-threads.md +22 -0
  78. package/dist/skills/git/references/pr/post-resolution-summary.md +40 -0
  79. package/dist/skills/git/references/pr/post-review-summary.md +42 -0
  80. package/dist/skills/git/references/pr/resolve-review-threads.md +35 -0
  81. package/dist/skills/git/references/pr/update-pr-evidence.md +14 -0
  82. package/dist/skills/git/references/pr/validate-branch.md +18 -0
  83. package/dist/skills/git/references/publication-gate.md +13 -0
  84. package/dist/skills/git/references/tracker/_mcp.md +153 -0
  85. package/dist/skills/git/references/tracker/github/associate-release.md +18 -0
  86. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +40 -0
  87. package/dist/skills/git/references/tracker/github/create-release.md +11 -0
  88. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +16 -0
  89. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +69 -0
  90. package/dist/skills/git/references/tracker/github/fetch-issue.md +32 -0
  91. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +17 -0
  92. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +19 -0
  93. package/dist/skills/git/references/tracker/github/manage-debt.md +101 -0
  94. package/dist/skills/git/references/tracker/github/post-wave-report.md +28 -0
  95. package/dist/skills/git/references/tracker/github/setup-task.md +26 -0
  96. package/dist/skills/git/references/tracker/jira/associate-release.md +18 -0
  97. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +49 -0
  98. package/dist/skills/git/references/tracker/jira/create-release.md +17 -0
  99. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +22 -0
  100. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +53 -0
  101. package/dist/skills/git/references/tracker/jira/fetch-issue.md +14 -0
  102. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +15 -0
  103. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +18 -0
  104. package/dist/skills/git/references/tracker/jira/manage-debt.md +37 -0
  105. package/dist/skills/git/references/tracker/jira/post-wave-report.md +33 -0
  106. package/dist/skills/git/references/tracker/jira/setup-task.md +31 -0
  107. package/dist/skills/git/references/tracker/linear/associate-release.md +18 -0
  108. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +53 -0
  109. package/dist/skills/git/references/tracker/linear/create-release.md +17 -0
  110. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +22 -0
  111. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +53 -0
  112. package/dist/skills/git/references/tracker/linear/fetch-issue.md +14 -0
  113. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +15 -0
  114. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +18 -0
  115. package/dist/skills/git/references/tracker/linear/manage-debt.md +37 -0
  116. package/dist/skills/git/references/tracker/linear/post-wave-report.md +33 -0
  117. package/dist/skills/git/references/tracker/linear/setup-task.md +32 -0
  118. package/dist/skills/git/references/trust-rule.md +7 -0
  119. package/dist/targets/claude-code/claude-paths.js +59 -57
  120. package/dist/targets/claude-code/compliance-install.js +49 -65
  121. package/dist/targets/claude-code/hooks.js +108 -3
  122. package/dist/targets/claude-code/installer.js +1187 -32
  123. package/dist/targets/claude-code/legacy.js +5 -0
  124. package/dist/targets/claude-code/post-install.js +366 -151
  125. package/dist/targets/claude-code/tracker-install.js +134 -0
  126. package/package.json +8 -6
  127. package/src/assets/agents/code.md +45 -6
  128. package/src/assets/agents/design.md +2 -1
  129. package/src/assets/agents/git.mds +825 -0
  130. package/src/assets/agents/knowledge.md +3 -3
  131. package/src/assets/agents/learning.md +11 -0
  132. package/src/assets/agents/review.md +3 -1
  133. package/src/assets/agents/synthesize.md +1 -1
  134. package/src/assets/agents/test.md +16 -5
  135. package/src/assets/agents/tracker.md +474 -0
  136. package/src/assets/agents/validate.md +7 -5
  137. package/src/assets/commands/_partials/_compliance.mds +19 -1
  138. package/src/assets/commands/_partials/_decisions.mds +15 -3
  139. package/src/assets/commands/_partials/_docs_root.mds +35 -0
  140. package/src/assets/commands/_partials/_engine.mds +13 -11
  141. package/src/assets/commands/_partials/_evidence_policy.mds +30 -0
  142. package/src/assets/commands/_partials/_factory.mds +1 -1
  143. package/src/assets/commands/_partials/_knowledge.mds +27 -9
  144. package/src/assets/commands/_partials/_plan_contract.mds +22 -7
  145. package/src/assets/commands/_partials/_preamble.mds +2 -2
  146. package/src/assets/commands/_partials/_publication.mds +8 -2
  147. package/src/assets/commands/_partials/_settings.mds +28 -0
  148. package/src/assets/commands/_partials/_ticket_template.mds +3 -2
  149. package/src/assets/commands/_partials/_tracker.mds +18 -0
  150. package/src/assets/commands/_partials/_wave.mds +16 -10
  151. package/src/assets/commands/bug-analysis.mds +31 -19
  152. package/src/assets/commands/code-review.mds +67 -41
  153. package/src/assets/commands/debug.mds +13 -7
  154. package/src/assets/commands/dynamic-build.mds +274 -66
  155. package/src/assets/commands/dynamic-plan.mds +50 -23
  156. package/src/assets/commands/dynamic-profile.mds +24 -11
  157. package/src/assets/commands/dynamic-tickets.mds +63 -16
  158. package/src/assets/commands/explore.mds +4 -5
  159. package/src/assets/commands/implement.mds +234 -67
  160. package/src/assets/commands/plan.mds +91 -33
  161. package/src/assets/commands/release.md +64 -17
  162. package/src/assets/commands/research.mds +11 -9
  163. package/src/assets/commands/resolve.mds +150 -78
  164. package/src/assets/commands/self-review.mds +24 -25
  165. package/src/assets/mds/git/_pr.mds +331 -0
  166. package/src/assets/mds/git/_references.mds +135 -0
  167. package/src/assets/mds/tracker/_common.mds +156 -0
  168. package/src/assets/mds/tracker/_github.mds +472 -0
  169. package/src/assets/mds/tracker/_jira.mds +407 -0
  170. package/src/assets/mds/tracker/_linear.mds +449 -0
  171. package/src/assets/mds/tracker/_mcp.mds +305 -0
  172. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -8
  173. package/src/assets/scripts/hooks/background-memory-update +40 -19
  174. package/src/assets/scripts/hooks/capture-prompt +18 -8
  175. package/src/assets/scripts/hooks/capture-question +18 -8
  176. package/src/assets/scripts/hooks/capture-turn +27 -13
  177. package/src/assets/scripts/hooks/debug-trace +11 -6
  178. package/src/assets/scripts/hooks/ensure-devflow-init +33 -6
  179. package/src/assets/scripts/hooks/ensure-proxy +9 -8
  180. package/src/assets/scripts/hooks/ensure-root-gitignore +236 -60
  181. package/src/assets/scripts/hooks/git-marker +48 -0
  182. package/src/assets/scripts/hooks/hook-log-init +3 -1
  183. package/src/assets/scripts/hooks/json-helper.cjs +228 -5
  184. package/src/assets/scripts/hooks/lib/project-paths.cjs +1 -20
  185. package/src/assets/scripts/hooks/log-paths +80 -0
  186. package/src/assets/scripts/hooks/memory-worker +22 -13
  187. package/src/assets/scripts/hooks/pre-compact-memory +44 -15
  188. package/src/assets/scripts/hooks/preamble +1 -4
  189. package/src/assets/scripts/hooks/queue-append +146 -28
  190. package/src/assets/scripts/hooks/resolve-project-root +101 -7
  191. package/src/assets/scripts/hooks/session-start-context +534 -20
  192. package/src/assets/scripts/hooks/session-start-memory +38 -15
  193. package/src/assets/scripts/lib/project-config.cjs +633 -0
  194. package/src/assets/scripts/pr-evidence.cjs +1961 -0
  195. package/src/assets/scripts/redact-secrets.cjs +490 -62
  196. package/src/assets/scripts/release-trace.cjs +1143 -0
  197. package/src/assets/scripts/resolve-evidence-policy.cjs +1145 -0
  198. package/src/assets/scripts/resolve-settings.cjs +1054 -0
  199. package/src/assets/scripts/verify-evidence.cjs +1822 -0
  200. package/src/assets/skills/compliance/SKILL.md +4 -2
  201. package/src/assets/skills/docs-framework/SKILL.md +11 -10
  202. package/src/assets/skills/docs-framework/references/patterns.md +10 -17
  203. package/src/assets/skills/gap-analysis/SKILL.md +2 -2
  204. package/src/assets/skills/git/SKILL.md +8 -78
  205. package/src/assets/skills/git/references/github-api.md +179 -141
  206. package/src/assets/skills/git/references/patterns.md +11 -6
  207. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  208. package/src/assets/skills/review-methodology/references/patterns.md +6 -61
  209. package/src/assets/skills/review-methodology/references/violations.md +14 -22
  210. package/src/assets/skills/worktree-support/SKILL.md +1 -1
  211. package/src/assets/skills/worktree-support/references/roots.md +29 -0
  212. package/src/targets/claude-code/templates/managed-settings.json +25 -9
  213. package/src/assets/agents/git.md +0 -938
package/README.md CHANGED
@@ -53,7 +53,7 @@ This is the **orchestrated flow** — you stay in the loop between every step. W
53
53
 
54
54
  **Ambient orchestration.** Your main session becomes the tech lead: a charter injected at session start turns it into a pure orchestrator that delegates work to specialized agents and keeps only judgment mainline. Plan-mode handoffs auto-run `/implement`. Init and forget.
55
55
 
56
- **A staffed agent roster.** 16 specialized agents with explicit model assignments — Opus for analysis, Sonnet for execution, Haiku for I/O. Reassign any agent's model with `devflow agents`, including GPT models through external model routing (`devflow proxy`).
56
+ **A staffed agent roster.** 17 specialized agents with explicit model assignments — Opus for analysis, Sonnet for execution, Haiku for I/O. Reassign any agent's model with `devflow agents`, including GPT models through external model routing (`devflow proxy`).
57
57
 
58
58
  **Up to 20 parallel Review agents.** Security, architecture, performance, complexity, consistency, regression, testing, and more. Each produces findings with severity, confidence scoring, and concrete fixes. Conditional Review agents activate when relevant (TypeScript for `.ts` files, database for schema changes, compliance when regulated surface detected in the diff). Every finding gets validated and resolved automatically.
59
59
 
@@ -65,11 +65,13 @@ This is the **orchestrated flow** — you stay in the loop between every step. W
65
65
 
66
66
  **Always-on rules.** 13 ultra-condensed engineering principles (~10 lines each) load on every prompt — security, quality, and language-specific guidance (TypeScript, React, Go, Python, Java, Rust), plus a compliance rule when compliance is enabled. Rules install from your selected plugins only, so a Go project won't get React rules. Override any rule via `~/.devflow/rules/{name}.md` or `devflow rules shadow <name>`.
67
67
 
68
- **41 skills** (40 universal + 1 feature-owned compliance skill, installed when compliance is enabled). Most are grounded in expert material — backed by peer-reviewed papers, canonical books, and industry standards: security (OWASP, Shostack), architecture (Parnas, Evans, Fowler), performance (Brendan Gregg), testing (Beck, Meszaros), design (Wlaschin, Hickey), compliance (GDPR, HIPAA, PCI DSS, SOC 2, ISO 27001, SOX, NIST SSDF, OWASP ASVS), 200+ sources total.
68
+ **41 skills** (40 plugin-owned + 1 feature-owned compliance skill, installed on every machine). Skills install for the plugins you selected plus whatever those plugins declare they use, so the default plugin set installs 32 of the 40 and a Go project never gets the React skill. Most are grounded in expert material — backed by peer-reviewed papers, canonical books, and industry standards: security (OWASP, Shostack), architecture (Parnas, Evans, Fowler), performance (Brendan Gregg), testing (Beck, Meszaros), design (Wlaschin, Hickey), compliance (GDPR, HIPAA, PCI DSS, SOC 2, ISO 27001, SOX, NIST SSDF, OWASP ASVS), 200+ sources total.
69
69
 
70
- **Skill shadowing.** Override any built-in skill with your own version. Drop a file into `~/.devflow/skills/{name}/` and the installer uses yours instead of the default — same activation, your rules.
70
+ **Skill shadowing.** Override any built-in skill with your own version. Drop a file into `~/.devflow/skills/{name}/` and the installer uses yours instead of the default — same activation, your rules. A shadow for a skill outside your plugin selection stays where it is: not installed, never deleted, and live again the moment you select that plugin.
71
71
 
72
- **Compliance built in.** Six regulatory frameworks — GDPR, HIPAA, PCI DSS, SOC 2, ISO 27001, SOX — composed into a review skill and an always-on rule for exactly the frameworks you select. Compliance reviews activate automatically when a diff touches regulated surface. `devflow compliance --enable`.
72
+ **Compliance built in.** Six regulatory frameworks — GDPR, HIPAA, PCI DSS, SOC 2, ISO 27001, SOX. Every install carries the review skill with all six framework references; `devflow compliance --enable` adds an always-on rule for exactly the frameworks you select. A repository can declare its own frameworks in `.devflow/project.json` (`"compliance":["hipaa"]`), and the compliance review then runs there on any machine — with your machine's frameworks plus the repository's, loading only those references — without ever touching your rule. Compliance reviews activate automatically when a diff touches regulated surface. Enabling it on your machine also makes `required` the floor of your team's [evidence policy](#evidence-policy) on your machine: tracker-linked PRs, checked test plans, traced releases and a non-author approval before a PR reads merge-ready.
73
+
74
+ **Your issue tracker, not just GitHub.** Pick the tracker your team actually uses — GitHub, Jira, or Linear — at `devflow init`, with `devflow init --tracker <id>`, or later with `devflow tracker --set <id>`; that sets your machine's default. A repository can select its own in `.devflow/project.json`, and devflow follows it there automatically — one machine can work on a Jira repository and a GitHub one side by side. Every install carries every provider's mechanics (47 generated reference files, the tool-call contract among them) and the background agent, because pull requests stay on GitHub whatever your tracker and any repository may pick any provider. On a non-GitHub tracker that agent learns your conventions once per provider (project key, issue types, required fields, workflow transitions, how a reference renders) and writes them to `~/.devflow/tracker/{provider}.md`, so traceability speaks your tracker's vocabulary instead of assuming `#123`. Each provider's conventions are learned from the first repository that uses it. Those files are yours: hand-editable, kept across an uninstall, and refused rather than silently trusted if one no longer names its own provider. **GitHub is the default** and needs no configuration: no background run and no conventions file.
73
75
 
74
76
  **Full lifecycle.** Beyond the core flow: `/explore` maps a codebase into knowledge bases, `/research` runs multi-type research with trust-aware synthesis, `/debug` investigates with competing hypotheses in parallel, `/bug-analysis` hunts bugs before review, `/self-review` runs Simplify + Scrutinize quality passes, and `/release` ships with learned configuration.
75
77
 
@@ -95,7 +97,8 @@ When to use which: the orchestrated flow is for a **feature**; graph workflows a
95
97
  you: /dynamic-tickets specs/billing-v2.md
96
98
 
97
99
  Ticket factory spec → 14 dependency-graphed tickets across 4 waves
98
- each ticket adversarially reviewed · tracking issue opened
100
+ each ticket adversarially reviewed
101
+ Git tracking issue + one issue per ticket filed (required evidence policy)
99
102
 
100
103
  you: /dynamic-plan (wave 1)
101
104
 
@@ -107,6 +110,7 @@ you: (answer 2 decisions, walk away) /dynamic-build (wave 1)
107
110
 
108
111
  Wave 1 4 tickets implement → review → verify, dependency-ordered
109
112
  Git wave report posted to the tracking issue
113
+ Git · Test wave PR opened once you say so · its test-plan evidence refreshed
110
114
 
111
115
  you: /dynamic-plan (wave 2) → /dynamic-build (wave 2) → …
112
116
 
@@ -125,24 +129,31 @@ That's it. The interactive wizard offers Recommended defaults or an Advanced flo
125
129
 
126
130
  ## Privacy & Sharing
127
131
 
128
- Everything Devflow generates lives under `.devflow/` — working memory, decisions and pitfalls, feature knowledge bases, and transient locks. That directory is **gitignored wholesale by default**, so this per-developer runtime state stays on your machine and never lands in a commit. Devflow adds the `.devflow/` line to your project's root `.gitignore` automatically on first use.
129
-
130
- Sharing is opt-in. To share **everything** with your team, remove the `.devflow/` line from `.gitignore`. To share only curated knowledge (and keep memory, queues, and locks local), replace the `.devflow/` line with a pattern that ignores everything except the files you want tracked:
132
+ Everything Devflow generates lives under `.devflow/` — working memory, decisions and pitfalls, feature knowledge bases, naming conventions, docs and transient locks. On first use Devflow appends one block to your project's root `.gitignore`. It keeps per-developer runtime state on your machine and shares three things through git: the feature knowledge bases, the learned naming conventions and the team's settings in `.devflow/project.json`, which carry its [evidence policy](#evidence-policy):
131
133
 
132
134
  ```gitignore
133
- # Ignore all Devflow runtime data…
134
- .devflow/**
135
- # …except the team knowledge you want to share
136
- !.devflow/learning/
137
- !.devflow/learning/decisions.md
138
- !.devflow/learning/pitfalls.md
135
+ # Devflow runtime data — local by default (memory, learning, docs, locks).
136
+ # Shared via git: feature knowledge bases under .devflow/features/ (index.md and
137
+ # every {slug}/KNOWLEDGE.md), .devflow/conventions.md (naming authority),
138
+ # .devflow/policy.json (retired; presence only) and .devflow/project.json (team settings).
139
+ # To stop sharing the first two, re-add `.devflow/features/` or
140
+ # `.devflow/conventions.md` to your own .gitignore.
141
+ .devflow/*
139
142
  !.devflow/features/
143
+ .devflow/features/*
140
144
  !.devflow/features/index.md
141
145
  !.devflow/features/*/
146
+ .devflow/features/*/*
142
147
  !.devflow/features/*/KNOWLEDGE.md
148
+ !.devflow/conventions.md
149
+ !.devflow/policy.json
150
+ !.devflow/project.json
151
+ .claudeignore
143
152
  ```
144
153
 
145
- (The directory re-includes — `!.devflow/learning/` — are required: git won't descend into an excluded directory to reach a re-included file.)
154
+ The `!.devflow/policy.json` line keeps a retired policy file shared while teammates on an older devflow still read it (see [Evidence policy](#evidence-policy)). When your block predates a line, the next hook run or `devflow init` inserts the missing line inside the block, where a fresh block holds it — never at the end of the file, so a re-ignore of your own further down still wins. The paired lines — `!.devflow/features/` then `.devflow/features/*` — are required: git never descends into an excluded directory to reach a re-included file. The final `.claudeignore` line is left out when your `.gitignore` already has its own `.claudeignore` or `!.claudeignore` entry.
155
+
156
+ To keep the knowledge bases or conventions local, add `.devflow/features/` or `.devflow/conventions.md` to your own `.gitignore`. A `/.devflow/` line of your own opts the whole project out: Devflow then leaves your `.gitignore` alone.
146
157
 
147
158
  ## Commands
148
159
 
@@ -165,7 +176,86 @@ Sharing is opt-in. To share **everything** with your team, remove the `.devflow/
165
176
 
166
177
  See [docs/commands.md](https://github.com/dean0x/devflow/blob/main/docs/commands.md) for detailed usage.
167
178
 
168
- **PR-comment publication** for `/code-review` and `/resolve` is visibility-gated (counts-only stub on public repos by default) and every posted body is secret-scrubbed before it leaves your machine. Configure via `reviewPublication` in `.devflow/config.json` — details in [docs/commands.md](https://github.com/dean0x/devflow/blob/main/docs/commands.md).
179
+ **PR-comment publication** for `/code-review` and `/resolve` is visibility-gated (counts-only stub on public repos by default) and every posted body is secret-scrubbed before it leaves your machine. Configure via `reviewPublication` (`auto`, `full` or `off`) in your personal `.devflow/config.json`; a team value in [`.devflow/project.json`](#team-settings) is only a ceiling: it can lower yours, never raise it. Under a `required` evidence policy, `off` still posts the counts-only stub, so a record reaches the PR. The [test-plan evidence](#test-plan-evidence) comment is a stub unless `reviewPublication` is `full` — details in [docs/commands.md](https://github.com/dean0x/devflow/blob/main/docs/commands.md).
180
+
181
+ ## Team settings
182
+
183
+ A repository can commit `.devflow/project.json` to settle team-wide choices. Every key is optional, unknown keys are ignored, and devflow never writes the file:
184
+
185
+ ```json
186
+ {"version":1,"evidence":"required","compliance":["hipaa"],
187
+ "tracker":{"provider":"jira","site":"https://acme.atlassian.net","key":"ACME"},
188
+ "reviewPublication":"auto","features":{"learning":false}}
189
+ ```
190
+
191
+ - `evidence` is the [evidence policy](#evidence-policy); `compliance` names the regulatory frameworks the repository answers to, and its presence raises the evidence floor to `required`.
192
+ - `tracker` selects the repository's issue tracker. Your personal `.devflow/config.json` may only narrow it, to `github` or to the same provider.
193
+ - `reviewPublication` is a ceiling only: it can lower your personal value, never raise it. With no personal value you get at most `auto` — a team `off` still lowers it — so a branch that commits `full` cannot switch off the visibility gate for whoever reviews it.
194
+ - `features` can switch memory, learning or knowledge off for this repository, never back on. Your personal `config.json` can do the same for you.
195
+
196
+ **Adopting it.** Commit `project.json` on the default branch. `evidence` is always read from the default branch, so a feature branch cannot lower the bar it is judged by. Every other key — `tracker` with its `site` and `key`, `features` and the `reviewPublication` ceiling — is read from the branch you have checked out, so a branch that edits them sees the change at once. `compliance` is read from both and joined with your machine's frameworks: a branch can add a framework, never remove one, so a pull request that deletes `"compliance":["hipaa"]` is still reviewed under HIPAA. The default branch's copy is read from your clone's tracking branch, as fresh as your last fetch, never over the network, so a framework added on the default branch reaches the lens once your checkout has fetched it.
197
+
198
+ Each key is checked on its own, so one bad value never disables the rest: a bad `evidence` resolves to `required`, a bad `reviewPublication` to `off`, a bad `compliance` list to the generic lens. A `project.json` or `config.json` that exists but is not a JSON object is never read as absent: the settings fail closed (publication off, knowledge write-back off, the tracker reported as invalid). The compliance lens is the exception, because it only adds scrutiny: it keeps every framework a readable layer declares, and an unreadable `project.json` counts as the generic lens. Memory and learning capture fail open instead: the hooks read an unreadable file as narrowing nothing, so capture runs as your machine's switch says.
199
+
200
+ `config.json` is personal, so it must not be committed. A `config.json` that git tracks is ignored as if it were absent — otherwise a branch could commit `"reviewPublication":"full"` for whoever reviews it — and `devflow tracker|memory|learning|knowledge --status` say so, with the fix: `git rm --cached .devflow/config.json`. Commands never read the file themselves — one local resolver folds it with your `config.json` and the machine settings, without touching the network.
201
+
202
+ ## Evidence policy
203
+
204
+ How much evidence a change must carry is a team decision, so it lives in the file the team commits, read from the repository's default branch: the `evidence` key of [`.devflow/project.json`](#team-settings).
205
+
206
+ ```json
207
+ {"version":1,"evidence":"required"}
208
+ ```
209
+
210
+ `evidence` is `required` or `standard`. A malformed or duplicated value, or a `project.json` that is not a JSON object, resolves to `required`.
211
+
212
+ **`.devflow/policy.json` is retired.** devflow never reads it. Where `project.json` has no `evidence` key, a committed `policy.json` holds the repository at `required` whatever it says, with an `invalid-file` warning. To migrate, add its value to `.devflow/project.json` — `{"version":1,"evidencePolicy":"standard"}` becomes `{"version":1,"evidence":"standard"}` — and keep `policy.json` until every teammate runs devflow 3.0 or later. It is harmless on 3.0, which never looks at it once `project.json` has `evidence`, while an older devflow reads only `policy.json`; delete it after that. `devflow compliance --status` prints the same hint while the file is there.
213
+
214
+ | | `standard` | `required` |
215
+ |---|---|---|
216
+ | Tracker issue | optional — `/plan` offers to create one | mandatory — `/plan` creates or enriches one; `/implement` without one records a self-attested exception or stops |
217
+ | Test plan | written and shown on the PR when there is one; a missing plan is only reported | mandatory — `/implement` without one records a self-attested exception or stops, and a wave PR with a merged ticket lacking one is blocked |
218
+ | Naming conventions | not learned, not applied | learned once into `.devflow/conventions.md`, then applied to branch names and PR titles |
219
+ | External review threads | left alone | `/resolve` replies to them and resolves the ones it verifiably fixed |
220
+ | Merge readiness | not checked by `/resolve` | `/resolve` checks it, and READY needs a trusted non-author approval |
221
+ | Releases | no trace gate (`--dry-run` still shows the trace) | `/release` maps every commit since the last release to its issue; untraced commits are attested or the release halts; shipped issues are back-linked and added to the release marker |
222
+ | `reviewPublication: off` | no PR comment | the counts-only stub still posts |
223
+ | `/dynamic-tickets` | files no issues | files the tracking issue and one issue per ticket |
224
+
225
+ **Defaults.** With no committed `evidence` and no `policy.json` the policy is `standard`, unless compliance is enabled on the machine running devflow — at any framework count — which makes it `required` there, or the repository's `project.json` carries a `compliance` key — on the default branch, its tracking copy or the working tree, whatever its value — which makes it `required` everywhere.
226
+
227
+ **The stricter value wins.** The default branch's copy is the authority, so a feature branch that commits a weaker policy is still judged by the default branch's; the difference shows as a `pr-changes-policy` warning. Local sources can raise the policy but never lower it: enabled compliance raises a committed `standard` to `required` on that machine. Every failure — git not answering, an invalid file, a resolver that cannot run — resolves to `required`. Offline, devflow takes the default branch's name from your clone's `origin/HEAD` and reads that branch's local tracking copy instead, so a branch still cannot lower the policy, and flags the result `remote-unavailable`. A clone that never recorded `origin/HEAD` has only the working tree to go on, which then decides; `git remote set-head origin --auto` records it.
228
+
229
+ **Commit it yourself.** The CLI never writes `project.json` or `policy.json`. `devflow compliance --enable` and `--set` print the keys to add to `.devflow/project.json` — merged into the file when it already exists, never replacing it — and `devflow compliance --status` shows the policy resolved for the current repository and where it came from. The `.gitignore` block above keeps `project.json` shareable. Guard it like any other policy file, for example with a CODEOWNERS entry:
230
+
231
+ ```text
232
+ /.devflow/project.json @your-org/maintainers
233
+ ```
234
+
235
+ ## Test-plan evidence
236
+
237
+ A PR carries a test plan: one TP line per acceptance criterion, in one fixed shape.
238
+
239
+ ```text
240
+ - [ ] TP-1 (AC-1) rejects an upload over the size limit — method:ci [files: src/upload/**]
241
+ ```
242
+
243
+ `method` is how the line is verified: `ci` (the CI suite covers it), `local` (a command whose exit code the Test agent reads) or `manual` (agent-driven steps, observed). `files:` lists the globs the line covers, so a later change elsewhere does not make it stale. A scenario is plain words — no `#`, `@`, `/`, `<`, `>`, brackets or backticks — because it lands in the PR body, where a closing keyword or a mention would act.
244
+
245
+ `/plan` writes the lines, and `/implement` checks them before any code is written. The PR body carries them as a test-plan block between `<!-- devflow:test-plan -->` markers. The Test agent records a claim per line — `PASS`, `FAIL` or `SKIP` at a commit — and the evidence scripts, never a prompt, turn each claim into one of six states:
246
+
247
+ | State | Meaning |
248
+ |---|---|
249
+ | `VERIFIED-CI` | a `ci` pass backed by passing CI runs at the verifying commit |
250
+ | `ATTESTED-LOCAL` | a `local` pass with exit code 0, a `manual` pass, or a `ci` pass at a commit that has no CI runs |
251
+ | `UNVERIFIED` | no usable claim: none, a skip, a commit outside the PR, or a line whose text changed |
252
+ | `STALE` | claimed at an older commit, and the change since may touch the line's files |
253
+ | `FAILED` | a fail, a non-zero exit code, or a failing CI run |
254
+ | `INDETERMINATE` | something the verdict needs could not be resolved, such as a CI run still in progress or expired |
255
+
256
+ Only the first two count as verified, and the block ticks exactly those lines. `update-pr-evidence` re-derives every state at the PR's head, updates the block — reduced to one counts line when the lines would push the body past its size limit — and posts an append-only evidence comment keyed to that head. `/implement`, `/resolve` and the wave PR of `/dynamic-build` all refresh it.
257
+
258
+ The evidence comment is a counts-only **STUB** unless `reviewPublication` is `full`. **FULL** adds the scenario table, with links to the CI runs, and the reasons for any self-attested exception, and falls back to the STUB above 55,000 characters. `off` posts no evidence comment, except under a `required` policy, where it becomes the STUB. A self-attested exception — no tracker issue, or no test plan — is recorded in the PR body under `## Evidence Exceptions`, with who attested it and when.
169
259
 
170
260
  ## Language Support
171
261
 
@@ -187,8 +277,11 @@ For deep dives: [Working Memory](https://github.com/dean0x/devflow/blob/main/doc
187
277
  npx devflow-kit init # Install (interactive wizard)
188
278
  npx devflow-kit init --plugin=implement # Install specific plugin
189
279
  npx devflow-kit ambient --enable # Toggle ambient mode (orchestrator)
190
- npx devflow-kit learning --enable # Toggle decision/pitfall tracking
191
- npx devflow-kit compliance --enable # Enable compliance reviews (pick frameworks)
280
+ npx devflow-kit learning --enable # Toggle decision/pitfall tracking (all projects)
281
+ npx devflow-kit compliance --enable # Enable compliance (pick frameworks); prints the keys to add to .devflow/project.json
282
+ npx devflow-kit compliance --status # Show compliance state and this repo's evidence policy
283
+ npx devflow-kit tracker --set jira # Pick the machine's default tracker (github | jira | linear)
284
+ npx devflow-kit tracker --status # Show provider, this repo's effective one, learned conventions, mechanics
192
285
  npx devflow-kit rules --status # Show installed rules
193
286
  npx devflow-kit security --status # Show / manage the security deny list
194
287
  npx devflow-kit safe-delete --enable # Install rm -> trash safe-delete