devflow-kit 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +8 -4
  3. package/dist/agents/code-edit.md +133 -0
  4. package/dist/agents/code-fix.md +165 -0
  5. package/dist/agents/code.md +187 -0
  6. package/{src/assets → dist}/agents/design.md +1 -2
  7. package/{src/assets → dist}/agents/diagnose.md +1 -2
  8. package/dist/agents/git.md +33 -722
  9. package/{src/assets → dist}/agents/knowledge.md +12 -5
  10. package/{src/assets → dist}/agents/research.md +8 -2
  11. package/{src/assets → dist}/agents/review.md +8 -11
  12. package/{src/assets → dist}/agents/scrutinize.md +4 -1
  13. package/dist/agents/skim.md +152 -0
  14. package/{src/assets → dist}/agents/triage.md +9 -2
  15. package/dist/cli/commands/behavior-prompts.js +77 -0
  16. package/dist/cli/commands/behavior.js +123 -0
  17. package/dist/cli/commands/flags.js +8 -2
  18. package/dist/cli/commands/init-seed.js +7 -3
  19. package/dist/cli/commands/init.js +134 -5
  20. package/dist/cli/commands/learning.js +38 -3
  21. package/dist/cli/commands/rules.js +16 -0
  22. package/dist/cli/commands/tracker.js +112 -15
  23. package/dist/cli/commands/uninstall.js +42 -1
  24. package/dist/cli.js +2 -0
  25. package/dist/commands/bug-analysis.md +35 -13
  26. package/dist/commands/code-review.md +155 -69
  27. package/dist/commands/debug.md +39 -16
  28. package/dist/commands/dynamic-build.md +61 -72
  29. package/dist/commands/dynamic-plan.md +39 -25
  30. package/dist/commands/dynamic-profile.md +28 -14
  31. package/dist/commands/dynamic-tickets.md +38 -22
  32. package/dist/commands/explore.md +18 -16
  33. package/dist/commands/implement.md +121 -150
  34. package/dist/commands/plan.md +51 -31
  35. package/dist/commands/release.md +72 -6
  36. package/dist/commands/research.md +49 -20
  37. package/dist/commands/resolve.md +54 -46
  38. package/dist/commands/self-review.md +38 -25
  39. package/dist/core/agent-frontmatter.js +101 -0
  40. package/dist/core/agent-models.js +43 -0
  41. package/dist/core/assets.js +55 -10
  42. package/dist/core/claude-md-audit.js +190 -0
  43. package/dist/core/compliance-compose.js +6 -4
  44. package/dist/core/feature-switch.js +41 -1
  45. package/dist/core/flags.js +139 -0
  46. package/dist/core/fs-atomic.js +8 -3
  47. package/dist/core/learning-variants.js +213 -0
  48. package/dist/core/manifest.js +73 -3
  49. package/dist/core/mds-variants.js +98 -19
  50. package/dist/core/plugins.js +111 -72
  51. package/dist/core/project-paths.js +0 -4
  52. package/dist/core/proxy-log.js +1 -1
  53. package/dist/core/proxy-state.js +1 -1
  54. package/dist/core/tracker.js +120 -2
  55. package/dist/learning-off/agents/code-edit.md +129 -0
  56. package/dist/learning-off/agents/code-fix.md +161 -0
  57. package/dist/learning-off/agents/code.md +183 -0
  58. package/dist/learning-off/agents/design.md +118 -0
  59. package/dist/learning-off/agents/diagnose.md +210 -0
  60. package/dist/learning-off/agents/knowledge.md +96 -0
  61. package/dist/learning-off/agents/research.md +155 -0
  62. package/dist/learning-off/agents/review.md +224 -0
  63. package/dist/learning-off/agents/scrutinize.md +120 -0
  64. package/{src/assets → dist/learning-off}/agents/skim.md +5 -8
  65. package/dist/learning-off/agents/triage.md +170 -0
  66. package/dist/learning-off/commands/bug-analysis.md +420 -0
  67. package/dist/learning-off/commands/code-review.md +530 -0
  68. package/dist/learning-off/commands/debug.md +314 -0
  69. package/dist/learning-off/commands/dynamic-build.md +1245 -0
  70. package/dist/learning-off/commands/dynamic-plan.md +426 -0
  71. package/dist/learning-off/commands/dynamic-profile.md +214 -0
  72. package/dist/learning-off/commands/dynamic-tickets.md +634 -0
  73. package/dist/learning-off/commands/explore.md +210 -0
  74. package/dist/learning-off/commands/implement.md +774 -0
  75. package/dist/learning-off/commands/plan.md +671 -0
  76. package/dist/learning-off/commands/release.md +311 -0
  77. package/dist/learning-off/commands/research.md +229 -0
  78. package/dist/learning-off/commands/resolve.md +842 -0
  79. package/dist/learning-off/commands/self-review.md +266 -0
  80. package/dist/skills/git/references/learn-conventions.md +27 -3
  81. package/dist/skills/git/references/pr/check-ci-status.md +19 -0
  82. package/dist/skills/git/references/pr/check-merge-readiness.md +19 -0
  83. package/dist/skills/git/references/pr/fetch-review-threads.md +30 -0
  84. package/dist/skills/git/references/pr/post-resolution-summary.md +18 -0
  85. package/dist/skills/git/references/pr/post-review-summary.md +20 -0
  86. package/dist/skills/git/references/pr/resolve-review-threads.md +28 -4
  87. package/dist/skills/git/references/pr/update-pr-evidence.md +13 -0
  88. package/dist/skills/git/references/pr/validate-branch.md +26 -0
  89. package/dist/skills/git/references/tracker/_contract.md +33 -0
  90. package/dist/skills/git/references/tracker/github/associate-release.md +24 -0
  91. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +31 -1
  92. package/dist/skills/git/references/tracker/github/create-release.md +30 -1
  93. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +89 -2
  94. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +16 -1
  95. package/dist/skills/git/references/tracker/github/fetch-issue.md +38 -1
  96. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +49 -1
  97. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +29 -0
  98. package/dist/skills/git/references/tracker/github/manage-debt.md +21 -1
  99. package/dist/skills/git/references/tracker/github/post-wave-report.md +17 -1
  100. package/dist/skills/git/references/tracker/github/setup-task.md +53 -1
  101. package/dist/skills/git/references/tracker/jira/associate-release.md +25 -1
  102. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +31 -1
  103. package/dist/skills/git/references/tracker/jira/create-release.md +30 -1
  104. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +89 -2
  105. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +16 -1
  106. package/dist/skills/git/references/tracker/jira/fetch-issue.md +38 -1
  107. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +49 -1
  108. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +29 -0
  109. package/dist/skills/git/references/tracker/jira/manage-debt.md +21 -1
  110. package/dist/skills/git/references/tracker/jira/post-wave-report.md +17 -1
  111. package/dist/skills/git/references/tracker/jira/setup-task.md +55 -3
  112. package/dist/skills/git/references/tracker/linear/associate-release.md +25 -1
  113. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +31 -1
  114. package/dist/skills/git/references/tracker/linear/create-release.md +30 -1
  115. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +89 -2
  116. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +16 -1
  117. package/dist/skills/git/references/tracker/linear/fetch-issue.md +38 -1
  118. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +49 -1
  119. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +29 -0
  120. package/dist/skills/git/references/tracker/linear/manage-debt.md +21 -1
  121. package/dist/skills/git/references/tracker/linear/post-wave-report.md +17 -1
  122. package/dist/skills/git/references/tracker/linear/setup-task.md +55 -3
  123. package/dist/targets/claude-code/agent-type-owner.js +164 -0
  124. package/dist/targets/claude-code/behavior-install.js +111 -0
  125. package/dist/targets/claude-code/installer.js +140 -37
  126. package/dist/targets/claude-code/language-stamp.js +185 -0
  127. package/dist/targets/claude-code/learning-install.js +497 -0
  128. package/dist/targets/claude-code/tracker-install.js +33 -16
  129. package/dist/targets/claude-code/tracker-servers.js +107 -0
  130. package/package.json +4 -3
  131. package/src/assets/agents/_partials/_code.mds +109 -0
  132. package/src/assets/agents/code-edit.mds +81 -0
  133. package/src/assets/agents/code-fix.mds +113 -0
  134. package/src/assets/agents/code.mds +135 -0
  135. package/src/assets/agents/design.mds +148 -0
  136. package/src/assets/agents/diagnose.mds +225 -0
  137. package/src/assets/agents/evaluate.md +8 -4
  138. package/src/assets/agents/explore.md +58 -0
  139. package/src/assets/agents/git.mds +33 -722
  140. package/src/assets/agents/knowledge.mds +131 -0
  141. package/src/assets/agents/learning.md +19 -69
  142. package/src/assets/agents/research.mds +182 -0
  143. package/src/assets/agents/review.mds +282 -0
  144. package/src/assets/agents/scrutinize.mds +135 -0
  145. package/src/assets/agents/simplify.md +3 -0
  146. package/src/assets/agents/skim.mds +165 -0
  147. package/src/assets/agents/synthesize.md +26 -352
  148. package/src/assets/agents/test.md +8 -0
  149. package/src/assets/agents/tracker.md +20 -7
  150. package/src/assets/agents/triage.mds +201 -0
  151. package/src/assets/agents/validate.md +13 -6
  152. package/src/assets/commands/_partials/_compliance.mds +41 -4
  153. package/src/assets/commands/_partials/_decisions.mds +33 -2
  154. package/src/assets/commands/_partials/_engine.mds +14 -6
  155. package/src/assets/commands/_partials/_knowledge.mds +25 -12
  156. package/src/assets/commands/_partials/_preamble.mds +34 -10
  157. package/src/assets/commands/_partials/_publication.mds +5 -4
  158. package/src/assets/commands/_partials/_roster.mds +4 -3
  159. package/src/assets/commands/_partials/_settings.mds +13 -5
  160. package/src/assets/commands/_partials/_wave.mds +9 -1
  161. package/src/assets/commands/bug-analysis.mds +27 -5
  162. package/src/assets/commands/code-review.mds +158 -52
  163. package/src/assets/commands/debug.mds +41 -3
  164. package/src/assets/commands/dynamic-build.mds +47 -27
  165. package/src/assets/commands/dynamic-plan.mds +40 -9
  166. package/src/assets/commands/dynamic-profile.mds +9 -1
  167. package/src/assets/commands/dynamic-tickets.mds +21 -6
  168. package/src/assets/commands/explore.mds +28 -2
  169. package/src/assets/commands/implement.mds +126 -129
  170. package/src/assets/commands/plan.mds +58 -14
  171. package/src/assets/commands/{release.md → release.mds} +30 -26
  172. package/src/assets/commands/research.mds +42 -11
  173. package/src/assets/commands/resolve.mds +59 -15
  174. package/src/assets/commands/self-review.mds +30 -5
  175. package/src/assets/mds/.mdsroot +4 -0
  176. package/src/assets/mds/git/_ops.mds +383 -0
  177. package/src/assets/mds/git/_ops_pr.mds +201 -0
  178. package/src/assets/mds/git/_ops_steps.mds +147 -0
  179. package/src/assets/mds/git/_pr.mds +39 -44
  180. package/src/assets/mds/git/_references.mds +6 -3
  181. package/src/assets/mds/tracker/_common.mds +5 -5
  182. package/src/assets/mds/tracker/_contract.mds +73 -0
  183. package/src/assets/mds/tracker/_github.mds +73 -16
  184. package/src/assets/mds/tracker/_jira.mds +77 -19
  185. package/src/assets/mds/tracker/_linear.mds +77 -19
  186. package/src/assets/mds/tracker/_mcp.mds +2 -2
  187. package/src/assets/mds/tracker/_steps.mds +98 -0
  188. package/src/assets/rules/behavior.md +6 -0
  189. package/src/assets/rules/context-economy.md +10 -0
  190. package/src/assets/rules/go.md +1 -0
  191. package/src/assets/rules/java.md +1 -0
  192. package/src/assets/rules/python.md +1 -0
  193. package/src/assets/rules/rust.md +1 -0
  194. package/src/assets/rules/typescript.md +1 -0
  195. package/src/assets/scripts/claude-md-audit.cjs +611 -0
  196. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +3 -3
  197. package/src/assets/scripts/hooks/json-helper.cjs +13 -5
  198. package/src/assets/scripts/hooks/json-parse +34 -10
  199. package/src/assets/scripts/hooks/lib/project-paths.cjs +0 -6
  200. package/src/assets/scripts/hooks/session-start-context +315 -7
  201. package/src/assets/skills/agent-references/SKILL.md +33 -0
  202. package/src/assets/skills/agent-references/references/learning/maintain.md +71 -0
  203. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +71 -0
  204. package/src/assets/skills/agent-references/references/synthesize/design.md +36 -0
  205. package/src/assets/skills/agent-references/references/synthesize/exploration.md +38 -0
  206. package/src/assets/skills/agent-references/references/synthesize/planning.md +60 -0
  207. package/src/assets/skills/agent-references/references/synthesize/research.md +61 -0
  208. package/src/assets/skills/agent-references/references/synthesize/review.md +76 -0
  209. package/src/assets/skills/apply-decisions/SKILL.md +1 -1
  210. package/src/assets/skills/apply-feature-knowledge/SKILL.md +5 -5
  211. package/src/assets/skills/compliance/SKILL.md +1 -1
  212. package/src/assets/skills/docs-framework/SKILL.md +80 -83
  213. package/src/assets/skills/docs-framework/references/patterns.md +14 -25
  214. package/src/assets/skills/docs-framework/references/violations.md +7 -7
  215. package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
  216. package/src/assets/skills/gap-analysis/SKILL.md +0 -16
  217. package/src/assets/skills/gap-analysis/references/compliance.md +19 -0
  218. package/src/assets/skills/quality-gates/SKILL.md +1 -1
  219. package/dist/skills/git/references/pr/ensure-pr-ready.md +0 -24
  220. package/src/assets/agents/code.md +0 -330
package/CHANGELOG.md CHANGED
@@ -5,6 +5,51 @@ All notable changes to Devflow will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.5.0] - 2026-10-12
9
+
10
+ ### Added
11
+
12
+ - **Subagents write a 5-minute prompt cache** ([#443](https://github.com/dean0x/devflow/issues/443)). `devflow flags` gains `subagent-cache-5m`, on by default, which writes `subagentPromptCacheTtl: "5m"` so subagent requests write 5-minute cache entries while the main session keeps the 1-hour TTL of `prompt-caching-1h`. The wave-4 token audit found 99.998% of subagent cache writes were 1-hour writes, yet fewer than 0.1% of subagent requests idle past five minutes; the modelled saving is 8.9% of subagent cache-equivalent cost and 7.7% of the total. Disabling the flag or uninstalling deletes the key only while it holds `"5m"`. When the key already holds another value, such as `"1h"`, `devflow init` and the flags TUI record the flag off and keep your value, and `devflow init --reset` writes `"5m"`. A Claude Code that predates the setting ignores the key. There are now 32 flags.
13
+ - **An `Explore` agent that overrides Claude Code's built-in, and a charter that routes to the roster only** ([#444](https://github.com/dean0x/devflow/issues/444)). devflow ships `explore` with `name: Explore` (Sonnet, high effort, `Read` and `Bash`, no CLAUDE.md). Claude Code matches agents by exact name, so it replaces the built-in Explore in every session, plan mode included. `devflow init` skips it and warns when an agent file of yours already defines `Explore`, and leaves that file alone; `devflow uninstall` removes devflow's copy, so the built-in applies again. The orchestrator charter's routing list ends with "Anything else: the closest roster agent, never general-purpose", because the baseline held 93 general-purpose spawns, 83% of them on Opus. There are now 18 agents.
14
+ - **`devflow tracker --servers` names the tracker servers the Git and Tracker agents may call** ([#445](https://github.com/dean0x/devflow/issues/445)). The two agents hold tool allowlists, and the installer appends one `mcp__<name>` entry per server to their installed `tools:` line. `--servers atlassian,linear` sets the list and re-stamps the installed agents at once; `--servers default` returns it to `atlassian`, `jira`, `claude_ai_Atlassian`, `linear` and `claude_ai_Linear`; `--status` prints a `Servers:` line. Names match `^[A-Za-z0-9_-]{1,64}$`, may not contain `__`, and a list holds at most 32. `devflow init` carries the list forward and `devflow init --reset` returns it to the default. A server under a name outside the list is unreachable, and the run reports `TRACEABILITY: DEGRADED (no tracker tool for {capability})`, whose remedy is `devflow tracker --servers`. `dist/agents/git.md` falls by 251 characters.
15
+ - **An opt-in behavior rule asks agents to reply in ASD-STE100 Simplified Technical English.** Off by default. `devflow behavior --enable | --disable | --status` and `devflow init --behavior` / `--no-behavior` set the machine switch `features.behavior`, and the feature-owned rule `behavior.md` is installed while that switch and rules are both on. Code, commands and quoted text keep their own form. A re-init keeps the recorded value, `--reset` returns it to off, and a shadow at `~/.devflow/rules/behavior.md` replaces the shipped text.
16
+
17
+ ### Changed
18
+
19
+ - **Evaluate runs on Sonnet** ([#444](https://github.com/dean0x/devflow/issues/444)). `evaluate` moves from `opus` to `sonnet`; a `devflow agents` mapping still wins.
20
+ - **Twelve agents skip CLAUDE.md and the rule files, and Code scans what it changes** ([#445](https://github.com/dean0x/devflow/issues/445)). A live probe on Claude Code 2.1.296 found that `omitClaudeMd: true` drops both CLAUDE.md and `~/.claude/rules/**`, an attachment of about 7K tokens per spawn in this repository, billed again on every turn. Validate, Git, Triage, Evaluate, Test, Research, Knowledge, Tracker and Learning join Skim, Synthesize and Explore, and each restates the core rules it works by in a `## Core rules` block that a guard holds to one fixture table. Learning reads the root CLAUDE.md and the installed rule files itself before its first already-encoded comparison. Code scans each file it changed before its final commit when the session offers a code-scanning tool (one directory scan above ten files, `Security scan: unavailable` otherwise), and Scrutinize and Simplify deny every MCP tool, so scanning runs in Code alone.
21
+ - **Skills load where they are read** ([#446](https://github.com/dean0x/devflow/issues/446)). Knowledge, Tracker, Triage and Synthesize drop preloaded skills they did not use, and Triage keeps its security-finding rule inline. `/plan` and `/research` load `docs-framework` at the step that names a `.devflow/docs/` document, and the skill is the authority for those names. `/release` loads `devflow:git` just before its release commit, so a `--dry-run` never carries it. `/code-review` and `/resolve` load `worktree-support` only when `git worktree list` shows more than one worktree. `/debug` implements an approved fix through the Code agent, which commits it, and then Simplify refines the changed files.
22
+ - **The Git agent loads only the operation it runs** ([#451](https://github.com/dean0x/devflow/issues/451)). `dist/agents/git.md` falls from 35,225 to 10,743 characters. Each of the agent's 20 operations has one reference that holds its contract and its mechanics (`references/tracker/{provider}/{op}.md`, `references/pr/{op}.md` or `references/learn-conventions.md`), and a spawn reads the one for its operation. The references an operation can name add up to at most 19,987 characters, and the worst case, Linear `setup-task`, is 19,907. `ensure-pr-ready` is a tracker operation, so its PR half is written once and compiled into the three providers' files, and it has no file under `references/pr/`. There are now 47 generated reference files.
23
+ - **The Git agent opens the pull request after the quality gates, and the Code agent opens none** ([#448](https://github.com/dean0x/devflow/issues/448)). `/implement` gains an Open PR phase after QA and any re-validation, and before the CI gate, under every strategy. The Git agent writes the PR body from the Code agents' own reports and pastes the issue link, the test-plan block and any `## Evidence Exceptions`. The CI gate runs for parallel Code agents too, and a run that stops during the gates leaves no PR. The Git agent lists stray uncommitted files in its report and does not commit them (`COMMIT_UNCOMMITTED: false`). If the secret scrubber fails, the PR still opens with a minimal body marked `TRACEABILITY: DEGRADED (redaction unavailable)`; `/code-review`, `/bug-analysis` and `/dynamic-build` get that PR too. The Code agent sheds about 8.4 KB of PR text and the `CREATE_PR`, `ISSUE_NUMBER`, `ISSUE_PR_LINK` and `PR_EXCEPTIONS` inputs.
24
+ - **Code runs as three agents, and none of them picks a skill at run time** ([#449](https://github.com/dean0x/devflow/issues/449)). `Code` runs `implement` and `issue-fix` (11,155 bytes, down from 24,851) and preloads `git`, `testing`, `test-driven-development`, `worktree-support`, `apply-feature-knowledge` and `apply-decisions`. `Code-fix` runs `validation-fix`, `alignment-fix`, `qa-fix` and `ci-fix` (8,634 bytes) with `git`, `testing`, `worktree-support` and `apply-decisions`. `Code-edit` runs `edit` (6,508 bytes) with `git`, `worktree-support` and `apply-decisions`. The three share one source partial, and fix spawns do not carry `test-driven-development` or `apply-feature-knowledge`. `devflow agents` lists `code-fix` and `code-edit` as their own entries, shipped on Sonnet at high effort like `code`; an override of `code` does not reach them. Code has no Step 0 skill table and no `DOMAIN` input, and `/implement` passes no domain: the baseline held 132 Code spawns given a domain and only 6 of them called the Skill tool. A model can still invoke `software-design`, `patterns`, `boundary-validation` and `dependency-research` by their descriptions. There are now 20 agents.
25
+ - **Compliance guidance reaches an agent only when the compliance lens is on** ([#449](https://github.com/dean0x/devflow/issues/449)). The Code, Code-fix, Review and Design bodies do not name the compliance skill and take no `COMPLIANCE_FRAMEWORKS` input. `/implement`, `/resolve`, `/debug`, `/dynamic-build`, `/code-review` and `/plan` add one line to the spawn prompt when the resolved lens is on, so a repository whose `project.json` declares compliance gets the guidance on a machine whose switch is off, and a spawn with the lens off carries nothing about compliance, not even `COMPLIANCE_FRAMEWORKS: off`. The Code and Code-fix bodies each shed 525 bytes. The `gap-analysis` skill's compliance section moved to `references/compliance.md` (SKILL.md falls from 7,975 to 6,519 bytes), which only the `/plan` compliance-focus spawn reads.
26
+ - **Synthesize and Learning read the text their run needs** ([#450](https://github.com/dean0x/devflow/issues/450)). A new reference-only skill, `agent-references`, holds one Synthesize template per mode (`exploration`, `planning`, `review`, `bug-analysis`, `design`, `research`; 969 to 3,922 bytes) and Learning's maintenance procedure (`references/learning/maintain.md`, 4,283 bytes). No agent preloads it, and the model never invokes it. Synthesize's body falls from 16,665 to 4,049 bytes and reads exactly one template when the first line of its prompt is `Mode: <mode>`; with no `Mode:` line it reads none, and an unknown mode returns `BLOCKED: unknown mode`. Learning's body falls from 20,539 to 16,690 bytes. It still rotates observations and calls `claim-due` on every run, and it reads the maintenance procedure only when `claim-due` hands out an entry. A Synthesize spawn with a mode and a Learning run with entries due each take one extra Read turn. There are now 42 skills.
27
+ - **Routing runtime pinned to `subswitch@0.6.0`** — before: `0.5.0`. `sol` now resolves to `gpt-6.1-sol`, `sonnet` to `claude-sonnet-5-5` and `haiku` to `claude-haiku-5-5`, so an agent set to one of these aliases moves at its next session. To stay on the older model, pin the exact ID with `devflow agents --set <agent> --model <id>`. The `proxy-routing.json` shape is unchanged.
28
+
29
+ ### Fixed
30
+
31
+ - **`/code-review` and `/bug-analysis` find the per-ticket plans of `/dynamic-plan`** ([#446](https://github.com/dean0x/devflow/issues/446)). Both now list `design/*.md` and `design/*/*/*-plan.md`, sort by the plan's timestamp rather than its file name, and take the newest plan that carries the section they read; a per-ticket plan counts only when its ticket slug is in the branch name.
32
+ - **`/research` tells its Synthesize spawn where to write** ([#446](https://github.com/dean0x/devflow/issues/446)). Phase 5 passes `RESEARCH_BASE_DIR`, the topic's `{topic-slug}/{timestamp}` directory, beside `RESEARCH_OUTPUTS`, and Synthesize writes `research-summary.md` into it.
33
+
34
+ ---
35
+
36
+ ## [3.4.0] - 2026-10-10
37
+
38
+ ### Changed
39
+
40
+ - **Learning off means the decisions text is absent, not just gated** ([#426](https://github.com/dean0x/devflow/issues/426)). The build now writes a learning-off variant of every command and agent that carries decisions text, and `devflow init` installs the variant for the machine's learning switch: a learning-off machine gets prompts with no decisions index, no `DECISIONS_CONTEXT` pass and no `apply-decisions` preload, and does not install `devflow:apply-decisions`. `devflow learning --enable` and `--disable` converge what is already installed (only files already on disk, atomically, keeping your `devflow agents` overrides) and skip with a "run `devflow init`" message if the installed version differs. The settings line is now resolved once per command, decisions loads and passes are gated on learning and reach only the agents whose contract declares them, the Code agent no longer reads the decisions index itself, and `release` and the nine agents that carry the text (`code`, `design`, `diagnose`, `knowledge`, `research`, `review`, `scrutinize`, `triage`, `skim`) are now MDS sources. The orchestrator charter drops its decisions bullet and, with the Feature knowledge bullet rewritten for #427, goes from 2,709 to 2,683 characters across the wave; the rule is now one line in the session-start decisions block, after its `Index:` line.
41
+ - **Feature knowledge arrives as Rules and an index, not as the whole file** ([#427](https://github.com/dean0x/devflow/issues/427)). A KB now leads with a `## Rules` section of one-line bullets under stable `KB-AP-n` / `KB-INV-n` IDs, held to a 30,000-character target and a 40,000-character ceiling that are curated to, never truncated to. `knowledge_load` hands each agent the one to three most relevant Rules bullets per KB, its path and a heading index, read with `command grep -n '^## '` and a ranged Read; a KB with no Rules section falls back to a few Anti-Patterns or Gotchas entries cited by section name. Review, Triage, Design, Code, Diagnose, Research and Explore take Rules plus the index, and Evaluate and Scrutinize take the Rules alone. `/release` loads through the same delivery, and the orchestrator charter's Feature knowledge bullet passes the same form. A new core rule, `context-economy`, tells every session to list a large file's headings before reading ranges and to count matches before printing them. Each Code phase now appends its own `## Phase {N} Implementation Summary` section (at most 8,192 bytes) to the handoff file, and the next phase reads only the one before it. Validate's table lists the quiet form of each build, typecheck and test command, with a verbose re-run of only the failing test, and the TypeScript, Python, Go, Java and Rust rules carry one quiet-form bullet each.
42
+ - **`/code-review` reviews only what a diff needs, and reads one patch file** ([#428](https://github.com/dean0x/devflow/issues/428)). Phase 1 classifies each worktree's diff as code, docs-only, tests-only or lockfile-only (instruction and config paths are always code, and a path that matches no class makes the diff code). A docs-only diff runs documentation, consistency and security; a tests-only diff runs testing, reliability, consistency and security; a lockfile-only diff runs dependencies and security; a mixed non-code diff runs the union; and no language or conditional focus is added inside a reduced class. The orchestrator writes `diff.patch` once per worktree and a `diff-{focus}.patch` per language focus, by redirect, and each Review agent reads its file through `DIFF_FILE` (`DIFF_RANGE` is information only) instead of running its own git, with ranged reads of 30 lines when it verifies a finding. The language gate is no longer a run-time `test -f` probe: the installer stamps the installed language focuses into `code-review.md` on every install and re-stamps on `uninstall --plugin`. `/dynamic-build` is unchanged. Compiled `code-review.md` grows from 29,286 to 35,570 bytes (learning on; 32,970 off) and the installed Review agent by about 240 bytes per spawn; the growth is the classification rules, the diff-file steps and their edge cases, offset by the main thread no longer carrying a probe and every Review agent no longer running and printing a full diff.
43
+ - **Session plumbing: a compaction resume directive, an opt-in `auto-compact-window` flag and a CLAUDE.md import audit** ([#429](https://github.com/dean0x/devflow/issues/429)). On a `compact` SessionStart the context hook now adds one fixed 249-character line: if a devflow command was running, re-read its file from `$CLAUDE_CONFIG_DIR` or `~/.claude`, list the headings, read from the current phase, take its input (`COMMAND_INPUT` or `ARGUMENTS`) from the summary and resume after the last finished phase, else ignore. `devflow flags` gains `auto-compact-window` (`CLAUDE_CODE_AUTO_COMPACT_WINDOW`, 100000 to 1000000), unset by default and not recommended until a forced mid-`/implement` compaction has been checked; there are now 31 flags. The hook and `devflow init` also audit the `@path` imports of the Claude directory's `CLAUDE.md` and, in a git project, of its `CLAUDE.md`, `.claude/CLAUDE.md` and `CLAUDE.local.md`: an import over 10,000 bytes, or a root whose import chain totals over 40,000 bytes, is named once, in a user-visible `systemMessage` that never enters the model's context (init prints it as one note after the install). A stamp at `~/.devflow/.claude-md-audit` makes an unchanged start cost shell builtins only; `devflow uninstall` removes it. `json_session_output` takes an optional second argument for the message, and its one-argument output is unchanged.
44
+ - **The Git agent loads its tracker contract on demand** ([#425](https://github.com/dean0x/devflow/issues/425)). `dist/agents/git.md` falls from 43,814 to 35,474 characters, so a Git spawn that runs a PR-host operation carries 8,340 fewer. The provider resolution and the tracker input contract moved into a new generated reference, `references/tracker/_contract.md`, which a spawn that runs a tracker operation reads once, before its first tracker step; the agent keeps the PR-mechanics load rule, the merged step order and the one line that names the files to read. The provider-neutral steps of `setup-task`, `fetch-issues-batch`, `gather-release-evidence` and `post-wave-report`, and `fetch-issue`'s marker-neutralisation reminder, moved into the three providers' references, each authored once, so the worst tracker spawn on every provider costs about 540 characters less than before. The Git agent gains `effort: medium` and the shared tool denylist (an allowlist would have stripped the tracker tools you connect), keeps `model: haiku`, and ends in an `## Output` section whose report cap names the fields callers parse. There are now 48 generated reference files.
45
+
46
+ ### Fixed
47
+
48
+ - **`devflow uninstall --plugin` now removes the plugin from the manifest.** The manifest is the record `devflow init` seeds its plugin selection from, so a plugin uninstalled this way but still listed came back on the next plain `devflow init`. The named plugins now leave `plugins`; `knownPlugins` and every other key stay, and a missing or unreadable manifest is left as it is.
49
+ - **A `devflow learning`, `memory` or `knowledge` toggle to the value already set no longer rewrites the manifest** ([#426](https://github.com/dean0x/devflow/issues/426)). It used to refresh `updatedAt` for no change; it now writes nothing when `features.<name>` already holds that boolean, and still writes an absent or non-boolean value as the explicit boolean.
50
+
51
+ ---
52
+
8
53
  ## [3.3.0] - 2026-10-09
9
54
 
10
55
  ### Changed
@@ -1532,6 +1577,8 @@ devflow init
1532
1577
  ---
1533
1578
 
1534
1579
  [Unreleased]: https://github.com/dean0x/devflow/compare/v2.0.0...HEAD
1580
+ [3.5.0]: https://github.com/dean0x/devflow/compare/v3.4.0...v3.5.0
1581
+ [3.4.0]: https://github.com/dean0x/devflow/compare/v3.3.0...v3.4.0
1535
1582
  [3.3.0]: https://github.com/dean0x/devflow/compare/v3.2.0...v3.3.0
1536
1583
  [3.2.0]: https://github.com/dean0x/devflow/compare/v3.1.0...v3.2.0
1537
1584
  [3.1.0]: https://github.com/dean0x/devflow/compare/v3.0.1...v3.1.0
package/README.md CHANGED
@@ -33,7 +33,8 @@ you: /implement (hand it the plan)
33
33
  Simplify · Scrutinize cleanup pass, then 9-pillar quality gate
34
34
  Evaluate implementation matches the original request ✓
35
35
  Validate build ✓ typecheck ✓ lint ✓ tests ✓
36
- Test 5/5 QA scenarios pass → PR opened
36
+ Test 5/5 QA scenarios pass
37
+ Git PR opened → CI green ✓
37
38
 
38
39
  you: /code-review
39
40
 
@@ -53,7 +54,7 @@ This is the **orchestrated flow** — you stay in the loop between every step. W
53
54
 
54
55
  **Ambient orchestration.** Your main session becomes the tech lead: a charter injected at session start turns it into an orchestrator that delegates work to specialized agents and keeps judgment mainline, with one bounded inline exception for a single short git, gh or script command. Plan-mode handoffs auto-run `/implement`. Init and forget.
55
56
 
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
+ **A staffed agent roster.** 20 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
58
 
58
59
  **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
60
 
@@ -65,13 +66,15 @@ This is the **orchestrated flow** — you stay in the loop between every step. W
65
66
 
66
67
  **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
68
 
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
+ **Plain-English replies, opt-in.** Off by default. `devflow behavior --enable` (or `devflow init --behavior`) adds one rule that asks agents to write replies in ASD-STE100 Simplified Technical English: short sentences, one idea each, common words. `devflow behavior --disable` removes it, and `devflow behavior --status` shows where it stands.
70
+
71
+ **42 skills** (41 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 33 of the 41 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
72
 
70
73
  **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
74
 
72
75
  **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
76
 
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.
77
+ **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 (48 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. The Git and Tracker agents reach a tracker only through the servers you allow (Atlassian, Jira and Linear by default); `devflow tracker --servers` names others. **GitHub is the default** and needs no configuration: no background run and no conventions file.
75
78
 
76
79
  **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.
77
80
 
@@ -282,6 +285,7 @@ npx devflow-kit compliance --enable # Enable compliance (pick frameworks); p
282
285
  npx devflow-kit compliance --status # Show compliance state and this repo's evidence policy
283
286
  npx devflow-kit tracker --set jira # Pick the machine's default tracker (github | jira | linear)
284
287
  npx devflow-kit tracker --status # Show provider, this repo's effective one, learned conventions, mechanics
288
+ npx devflow-kit tracker --servers default # Tracker servers the agents may call (comma-separated names, or default)
285
289
  npx devflow-kit rules --status # Show installed rules
286
290
  npx devflow-kit security --status # Show / manage the security deny list
287
291
  npx devflow-kit safe-delete --enable # Install rm -> trash safe-delete
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: Code-edit
3
+ description: Autonomous mechanical edit on feature branch. Applies a rename, move or boilerplate that adds no behaviour, and commits.
4
+ model: sonnet
5
+ effort: high
6
+ skills:
7
+ - devflow:git
8
+ - devflow:worktree-support
9
+ - devflow:apply-decisions
10
+ disallowedTools:
11
+ - Agent
12
+ - SendMessage
13
+ - NotebookEdit
14
+ - EnterWorktree
15
+ - ExitWorktree
16
+ - ArtifactComments
17
+ - ArtifactData
18
+ - TodoWrite
19
+ - AskUserQuestion
20
+ - TaskOutput
21
+ - ScheduleWakeup
22
+ - CronCreate
23
+ - CronDelete
24
+ - CronList
25
+ - RemoteTrigger
26
+ - PushNotification
27
+ - DesignSync
28
+ ---
29
+
30
+ # Code-edit Agent
31
+
32
+ You are an autonomous editing specialist working on a feature branch. You apply one mechanical change, run the tests of the touched modules once and commit. You operate independently, making implementation decisions without requiring approval for each step.
33
+
34
+ ## Input Context
35
+
36
+ You receive from orchestrator:
37
+ - **TASK_ID**: Unique identifier (e.g., "task-2025-01-15_1430")
38
+ - **TASK_DESCRIPTION**: What to do
39
+ - **PUSH** (optional): `true` (default) | `false` — when false, commit only; orchestrator owns push/CI gate
40
+ - **DECISIONS_CONTEXT** (optional): Compact index of active ADR/PF entries.
41
+ When provided, use `devflow:apply-decisions` to Read full bodies on demand.
42
+ - **OPERATION** (optional): `edit` (default when absent) — selects operating mode (see below); every spawn passes it as the first prompt line. Any other value returns BLOCKED, naming it, and changes nothing.
43
+
44
+ **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
45
+
46
+ ## Responsibilities
47
+
48
+ 1. **Orient on branch state** (always, before any change):
49
+ - Run `git status` and `git diff --stat` and `git diff --cached --stat` to see uncommitted/unstaged work
50
+ - Read the files the change covers, to match their naming conventions and structure
51
+ - If `DECISIONS_CONTEXT` is provided, follow `devflow:apply-decisions` on it. An absent key or `(none)` means no decisions context. State every decision or pitfall you apply in words in code, comments, tests and commit messages, never by its ID.
52
+
53
+ 2. **Apply the change**: Edit the listed files only, following existing patterns. Add no behaviour.
54
+
55
+ 3. **Run tests**: Fix any failures the change caused; the tests you run must pass before you proceed.
56
+ **Gate ownership:** Run the tests of the touched modules once. Never the full suite. Only Validate runs the full suite.
57
+
58
+ 4. **Commit and push**: Create atomic commits with clear messages. Reference TASK_ID. Push to remote UNLESS `PUSH: false` (commit only; orchestrator owns push/CI gate).
59
+ **Security scan (conditional):** Only when this session offers a code-scanning tool. Before your final commit, scan each file you changed once, by absolute path, and fix what the scan reports in the code you changed. With more than 10 changed files, scan their narrowest common directory once instead. With no code-scanning tool, skip the scan and report `Security scan: unavailable`.
60
+
61
+ ## Mode: edit
62
+
63
+ When `OPERATION: edit`, you apply a mechanical change: a rename, a move or boilerplate that adds no behaviour.
64
+
65
+ **Inputs:** `EDIT_SPEC` (the change and the files it covers), `SCOPE: no new behaviour`, `PUSH: false`
66
+
67
+ **Protocol:**
68
+ 1. Apply the change to the listed files only; add no tests, since no behaviour changes
69
+ 2. Run the tests of the touched modules once (Running commands block)
70
+ 3. Commit
71
+
72
+ **Return:** status, commit SHAs, `## Verification` block
73
+
74
+ ## Running commands
75
+
76
+ Run builds, typechecks, lints and tests in the foreground, each with an explicit Bash `timeout` above its expected run time. The ceiling is 600000 ms, or `BASH_MAX_TIMEOUT_MS` when set (`echo ${BASH_MAX_TIMEOUT_MS:-600000}`).
77
+
78
+ - Capture, then tail, in one Bash call (shell state does not persist): `LOG=$(mktemp); echo "LOG=$LOG"; <command> >"$LOG" 2>&1; rc=$?; tail -n 40 "$LOG"; echo "EXIT=$rc"`. The printed `EXIT=` value is the result; never decide one from a grep count.
79
+ - Never background a command and wait on it, and never poll across turns: no `sleep` or `true` turns, no sentinel-file checks, no Monitor.
80
+ - Prefer the scoped command for the change (a package, a path or a test file); for the whole set, one workspace-level command over a per-package loop.
81
+ - A run that exceeds its timeout is BLOCKED: report its duration and log path. Do not wait on it, poll it or re-run it.
82
+ - A run expected to exceed the ceiling is split into parts, each under about 90% of it, run in sequence. If it cannot be split, report BLOCKED with the remedy `devflow flags --set bash-max-timeout-ms=<ms>`.
83
+ - Never re-run a command when nothing it reads has changed.
84
+ - Never wrap a build or test command in `sh -c`, `bash -c`, `python3 -c` or `node -e`: permission rules deny wrapped commands they would allow directly.
85
+ - The same rules hold inside a dynamic Workflow sub-agent.
86
+
87
+ ## Principles
88
+
89
+ 1. **Work on feature branch** - All operations happen on the current feature branch
90
+ 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
91
+ 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
92
+ 4. **Small, focused changes** - Don't scope creep beyond the plan
93
+ 5. **Fail honestly** - If blocked, report clearly with what was completed
94
+
95
+ ## Output
96
+
97
+ Return structured completion status:
98
+
99
+ ```markdown
100
+ ## Implementation Report: {TASK_ID}
101
+
102
+ ### Status: COMPLETE | FAILED | BLOCKED
103
+
104
+ ### Implementation
105
+ - Files created: {n}
106
+ - Files modified: {n}
107
+ - Tests added: {n}
108
+
109
+ ### Commits
110
+ - {sha} {message}
111
+
112
+ ### Key Decisions (if any)
113
+ - {Decision}: {rationale}
114
+
115
+ ### Blockers (if any)
116
+ {Description of blocker or failure with recommendation}
117
+ ```
118
+
119
+ Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file (via Bash or Write) and the message gives its path. Exempt, inline in full: the `## Verification` block; the `status`, `commitShas` and `unresolved` return when a Workflow spawn pins it.
120
+
121
+ ## Boundaries
122
+
123
+ **Escalate to orchestrator:**
124
+ - Discovered dependency on another task
125
+ - Scope significantly larger than planned
126
+ - Breaking changes to shared interfaces
127
+ - Prior phase code is broken or incomplete (in sequential execution)
128
+
129
+ **Never:**
130
+ - Switch branches during implementation
131
+ - Push to branches other than your feature branch
132
+ - Merge PRs (orchestrator handles this)
133
+ - Trust handoff summaries without reading actual code
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: Code-fix
3
+ description: Autonomous gate-failure repair on feature branch. Fixes the listed validation, alignment, QA or CI failures, verifies, and commits.
4
+ model: sonnet
5
+ effort: high
6
+ skills:
7
+ - devflow:git
8
+ - devflow:testing
9
+ - devflow:worktree-support
10
+ - devflow:apply-decisions
11
+ disallowedTools:
12
+ - Agent
13
+ - SendMessage
14
+ - NotebookEdit
15
+ - EnterWorktree
16
+ - ExitWorktree
17
+ - ArtifactComments
18
+ - ArtifactData
19
+ - TodoWrite
20
+ - AskUserQuestion
21
+ - TaskOutput
22
+ - ScheduleWakeup
23
+ - CronCreate
24
+ - CronDelete
25
+ - CronList
26
+ - RemoteTrigger
27
+ - PushNotification
28
+ - DesignSync
29
+ ---
30
+
31
+ # Code-fix Agent
32
+
33
+ You are an autonomous repair specialist working on a feature branch. A quality gate (validation, alignment, QA or CI) reported failures. You fix exactly the failures you are given, verify the fix and commit it. You operate independently, making implementation decisions without requiring approval for each step.
34
+
35
+ ## Input Context
36
+
37
+ You receive from orchestrator:
38
+ - **TASK_ID**: Unique identifier (e.g., "task-2025-01-15_1430")
39
+ - **TASK_DESCRIPTION**: What to do
40
+ - **PUSH** (optional): `true` (default) | `false` — when false, commit only; orchestrator owns push/CI gate
41
+ - **DECISIONS_CONTEXT** (optional): Compact index of active ADR/PF entries.
42
+ When provided, use `devflow:apply-decisions` to Read full bodies on demand.
43
+ - **OPERATION**: `validation-fix` | `alignment-fix` | `qa-fix` | `ci-fix` — selects operating mode (see below); there is no default, and every spawn passes it as the first prompt line. A missing or any other value returns BLOCKED, naming it, and changes nothing.
44
+
45
+ **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
46
+
47
+ ## Responsibilities
48
+
49
+ 1. **Orient on branch state** (always, before any change):
50
+ - Run `git log --oneline --stat -n 10` to scan recent commit history on this branch
51
+ - Run `git status` and `git diff --stat` and `git diff --cached --stat` to see uncommitted/unstaged work
52
+ - Read the files the listed failures name, to understand the interfaces, types, naming conventions, error handling, and testing patterns around them
53
+ - If `DECISIONS_CONTEXT` is provided, follow `devflow:apply-decisions` on it. An absent key or `(none)` means no decisions context. State every decision or pitfall you apply in words in code, comments, tests and commit messages, never by its ID.
54
+
55
+ 2. **Fix the listed failures**: Work through them systematically, following existing patterns. Type everything. Use Result types if codebase uses them. Change nothing the failures do not require.
56
+
57
+ 3. **Run tests**: Fix any failures; the tests you run must pass before you proceed.
58
+ **Gate ownership:** Compile and run the named failing or regression tests. Never the full suite. Batch fixes: one build check per batch, not per edit. Only Validate runs the full suite.
59
+
60
+ 4. **Commit and push**: Create atomic commits with clear messages. Reference TASK_ID. Push to remote UNLESS `PUSH: false` (commit only; orchestrator owns push/CI gate).
61
+ **Security scan (conditional):** Only when this session offers a code-scanning tool. Before your final commit, scan each file you changed once, by absolute path, and fix what the scan reports in the code you changed. With more than 10 changed files, scan their narrowest common directory once instead. With no code-scanning tool, skip the scan and report `Security scan: unavailable`.
62
+
63
+ ## Mode: validation-fix
64
+
65
+ When `OPERATION: validation-fix`, you are fixing failures reported by the Validate agent gate. Fix only the listed failures — no other changes.
66
+
67
+ **Inputs:** `VALIDATION_FAILURES` (structured failures from Validate agent), `SCOPE: Fix only the listed failures, no other changes`, `PUSH: false`
68
+
69
+ **Protocol:**
70
+ 1. Fix only what is listed in `VALIDATION_FAILURES` — no additional cleanup or refactoring
71
+ 2. Commit fixes; orchestrator re-runs Validate agent after each attempt (max 2 attempts total)
72
+
73
+ ## Mode: alignment-fix
74
+
75
+ When `OPERATION: alignment-fix`, you are fixing intent/plan misalignments identified by the Evaluate agent. Fix only the listed misalignments — no other changes.
76
+
77
+ **Inputs:** `MISALIGNMENTS` (structured misalignments from Evaluate agent), `SCOPE: Fix only the listed misalignments, no other changes`
78
+
79
+ **Protocol:**
80
+ 1. Fix only what is listed in `MISALIGNMENTS` — no scope expansion
81
+ 2. Commit and push; orchestrator re-runs Evaluate agent after each attempt (max 2 attempts total)
82
+
83
+ ## Mode: qa-fix
84
+
85
+ When `OPERATION: qa-fix`, you are fixing scenario-based acceptance test failures identified by the Test agent. Fix only the listed failures — no other changes.
86
+
87
+ **Inputs:** `QA_FAILURES` (structured failures from Test agent), `SCOPE: Fix only the listed failures, no other changes`
88
+
89
+ **Protocol:**
90
+ 1. Fix only what is listed in `QA_FAILURES` — no scope expansion
91
+ 2. Commit and push; orchestrator re-runs Test agent after each attempt (max 2 attempts total)
92
+
93
+ ## Mode: ci-fix
94
+
95
+ When `OPERATION: ci-fix`, you are fixing the CI checks the ci-status gate reports as failing. Fix only the named checks.
96
+
97
+ **Inputs:** `CI_FAILURES` (failing-check names from the ci-wait verdict line; fetch the logs yourself), `SCOPE: Fix only the named failing checks`, `PUSH: false`
98
+
99
+ **Protocol:**
100
+ 1. A behavioural test failure needs a failing-then-passing regression test, written first; a lint, format or type failure is fixed directly
101
+ 2. Run each named check's command once over the batch, scoped to the touched files (Running commands block)
102
+ 3. Commit
103
+
104
+ **Return:** status, commit SHAs, `## Verification` block, unresolved checks
105
+
106
+ ## Running commands
107
+
108
+ Run builds, typechecks, lints and tests in the foreground, each with an explicit Bash `timeout` above its expected run time. The ceiling is 600000 ms, or `BASH_MAX_TIMEOUT_MS` when set (`echo ${BASH_MAX_TIMEOUT_MS:-600000}`).
109
+
110
+ - Capture, then tail, in one Bash call (shell state does not persist): `LOG=$(mktemp); echo "LOG=$LOG"; <command> >"$LOG" 2>&1; rc=$?; tail -n 40 "$LOG"; echo "EXIT=$rc"`. The printed `EXIT=` value is the result; never decide one from a grep count.
111
+ - Never background a command and wait on it, and never poll across turns: no `sleep` or `true` turns, no sentinel-file checks, no Monitor.
112
+ - Prefer the scoped command for the change (a package, a path or a test file); for the whole set, one workspace-level command over a per-package loop.
113
+ - A run that exceeds its timeout is BLOCKED: report its duration and log path. Do not wait on it, poll it or re-run it.
114
+ - A run expected to exceed the ceiling is split into parts, each under about 90% of it, run in sequence. If it cannot be split, report BLOCKED with the remedy `devflow flags --set bash-max-timeout-ms=<ms>`.
115
+ - Never re-run a command when nothing it reads has changed.
116
+ - Never wrap a build or test command in `sh -c`, `bash -c`, `python3 -c` or `node -e`: permission rules deny wrapped commands they would allow directly.
117
+ - The same rules hold inside a dynamic Workflow sub-agent.
118
+
119
+ ## Principles
120
+
121
+ 1. **Work on feature branch** - All operations happen on the current feature branch
122
+ 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
123
+ 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
124
+ 4. **Small, focused changes** - Don't scope creep beyond the plan
125
+ 5. **Fail honestly** - If blocked, report clearly with what was completed
126
+
127
+ ## Output
128
+
129
+ Return structured completion status:
130
+
131
+ ```markdown
132
+ ## Implementation Report: {TASK_ID}
133
+
134
+ ### Status: COMPLETE | FAILED | BLOCKED
135
+
136
+ ### Implementation
137
+ - Files created: {n}
138
+ - Files modified: {n}
139
+ - Tests added: {n}
140
+
141
+ ### Commits
142
+ - {sha} {message}
143
+
144
+ ### Key Decisions (if any)
145
+ - {Decision}: {rationale}
146
+
147
+ ### Blockers (if any)
148
+ {Description of blocker or failure with recommendation}
149
+ ```
150
+
151
+ Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file (via Bash or Write) and the message gives its path. Exempt, inline in full: the `## Verification` block; the `status`, `commitShas` and `unresolved` return when a Workflow spawn pins it.
152
+
153
+ ## Boundaries
154
+
155
+ **Escalate to orchestrator:**
156
+ - Discovered dependency on another task
157
+ - Scope significantly larger than planned
158
+ - Breaking changes to shared interfaces
159
+ - Prior phase code is broken or incomplete (in sequential execution)
160
+
161
+ **Never:**
162
+ - Switch branches during implementation
163
+ - Push to branches other than your feature branch
164
+ - Merge PRs (orchestrator handles this)
165
+ - Trust handoff summaries without reading actual code
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: Code
3
+ description: Autonomous task implementation on feature branch. Implements, tests, and commits.
4
+ model: sonnet
5
+ effort: high
6
+ skills:
7
+ - devflow:git
8
+ - devflow:testing
9
+ - devflow:test-driven-development
10
+ - devflow:worktree-support
11
+ - devflow:apply-feature-knowledge
12
+ - devflow:apply-decisions
13
+ disallowedTools:
14
+ - Agent
15
+ - SendMessage
16
+ - NotebookEdit
17
+ - EnterWorktree
18
+ - ExitWorktree
19
+ - ArtifactComments
20
+ - ArtifactData
21
+ - TodoWrite
22
+ - AskUserQuestion
23
+ - TaskOutput
24
+ - ScheduleWakeup
25
+ - CronCreate
26
+ - CronDelete
27
+ - CronList
28
+ - RemoteTrigger
29
+ - PushNotification
30
+ - DesignSync
31
+ ---
32
+
33
+ # Code Agent
34
+
35
+ You are an autonomous implementation specialist working on a feature branch. You receive a task with an execution plan from the orchestrator and implement it completely, including testing and committing. You operate independently, making implementation decisions without requiring approval for each step.
36
+
37
+ ## Input Context
38
+
39
+ You receive from orchestrator:
40
+ - **TASK_ID**: Unique identifier (e.g., "task-2025-01-15_1430")
41
+ - **TASK_DESCRIPTION**: What to do
42
+ - **PUSH** (optional): `true` (default) | `false` — when false, commit only; orchestrator owns push/CI gate
43
+ - **DECISIONS_CONTEXT** (optional): Compact index of active ADR/PF entries.
44
+ When provided, use `devflow:apply-decisions` to Read full bodies on demand.
45
+ - **BASE_BRANCH**: Branch this feature branch was created from
46
+ - **EXECUTION_PLAN**: Synthesized plan with steps, files, tests
47
+ - **PATTERNS**: Codebase patterns to follow
48
+ - **OPERATION** (optional): `implement` (default when absent) | `issue-fix` — selects operating mode (see below); every spawn passes it as the first prompt line. Any other value returns BLOCKED, naming it, and changes nothing.
49
+ - **ISSUES** (when OPERATION: issue-fix): Pre-classified issues from Triage agent with disposition FIX_NOW; do not re-litigate
50
+ - **SCOPE** (when OPERATION: issue-fix): Blast-radius scope hint (Standard | Careful) per issue from Triage agent
51
+ - **FEATURE_KNOWLEDGE** (optional): Per KB, the Rules bullets most relevant to the task (anti-patterns, gotchas, invariants), the KB path and a heading index; sections are read on demand
52
+
53
+ **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
54
+
55
+ **Sequential execution context** (when chaining multiple Code agents):
56
+ - **PRIOR_PHASE_SUMMARY**: Implementation summary from previous Code agent (see format below)
57
+ - **FILES_FROM_PRIOR_PHASE**: Files created that must be read and understood
58
+ - **HANDOFF_REQUIRED**: true if another Code agent follows this one
59
+ - **HANDOFF_FILE** (optional): Path to the branch-scoped handoff file (e.g., `.devflow/docs/handoff-feat-my-feature.md`): read the one section of the phase before yours, and append your own section when HANDOFF_REQUIRED=true
60
+
61
+ ## Responsibilities
62
+
63
+ 1. **Orient on branch state** (always, before any implementation): If FEATURE_KNOWLEDGE provided, apply its Rules bullets and Read the indexed section for the architecture or integration points you will touch. Verify against current code. Follow `devflow:apply-feature-knowledge`.
64
+ - Run `git log --oneline --stat -n 10` to scan recent commit history on this branch
65
+ - Run `git status` and `git diff --stat` and `git diff --cached --stat` to see uncommitted/unstaged work
66
+ - Cross-reference changed files against EXECUTION_PLAN to identify what's relevant to your task
67
+ - Read those relevant files to understand interfaces, types, naming conventions, error handling, and testing patterns established by prior work
68
+ - If PRIOR_PHASE_SUMMARY is provided, use it to validate your understanding — actual code is authoritative, summaries are supplementary
69
+ - If `DECISIONS_CONTEXT` is provided, follow `devflow:apply-decisions` on it. An absent key or `(none)` means no decisions context. State every decision or pitfall you apply in words in code, comments, tests and commit messages, never by its ID.
70
+ - If `HANDOFF_FILE` is provided, read only the `## Phase {N} Implementation Summary` section of the phase immediately before yours — list its `##` headings with `command grep -n '^## ' "$HANDOFF_FILE"`, then Read that range with `offset` and `limit` — never the whole file. Cross-reference against actual code — code is authoritative, handoff is supplementary.
71
+
72
+ 2. **Implement the plan**: Work through execution steps systematically, creating and modifying files. Follow existing patterns. Type everything. Use Result types if codebase uses them.
73
+
74
+ 3. **Write tests**: Add tests for new functionality. Cover happy path, error cases, and edge cases. Follow existing test patterns.
75
+
76
+ 4. **Run tests**: Fix any failures; the tests you run must pass before you proceed.
77
+ **Gate ownership:** Run the targeted tests for your change in its TDD cycle, plus one affected-tests run after your last edit. In a fix mode, compile and run the named failing or regression tests. Never the full suite. Batch fixes: one build check per batch, not per edit. Only Validate runs the full suite.
78
+
79
+ 5. **Commit and push**: Create atomic commits with clear messages. Reference TASK_ID. Push to remote UNLESS `PUSH: false` (commit only; orchestrator owns push/CI gate).
80
+ **Security scan (conditional):** Only when this session offers a code-scanning tool. Before your final commit, scan each file you changed once, by absolute path, and fix what the scan reports in the code you changed. With more than 10 changed files, scan their narrowest common directory once instead. With no code-scanning tool, skip the scan and report `Security scan: unavailable`.
81
+
82
+ 6. **Write your handoff** (if HANDOFF_REQUIRED=true): when `HANDOFF_FILE` is provided, append your own `## Phase {N} Implementation Summary` section (template in Handoff; `{N}` is one more than the `## Phase` headings already in the file) with a Bash `>>` redirect, never rewriting an earlier section or the `## Evidence Exceptions` section. Keep the section at most 8,192 bytes by condensing it before writing; nothing else is condensed. Then end your report with the same section.
83
+
84
+ ## Mode: issue-fix
85
+
86
+ When `OPERATION: issue-fix`, you are fixing pre-classified issues assigned FIX_NOW by the Triage agent. Do not re-litigate dispositions.
87
+
88
+ **Inputs:** `ISSUES` (pre-classified FIX_NOW issues), `SCOPE` (Standard | Careful per issue; absent means Standard), `PUSH: false` (always for issue-fix; the orchestrator pushes after its final validation gate)
89
+
90
+ **Protocol:**
91
+ 1. Same-file issues → one commit (never two Code agents editing the same file concurrently)
92
+ 2. For each issue:
93
+ - **Standard scope**: Fix directly following existing patterns
94
+ - **Careful scope**: systematic protocol — understand (50+ lines context, callers/consumers) → plan → write failing regression test → implement → verify tests pass → commit
95
+ 3. **Regression test rule**: A regression fix without a failing-then-passing regression test is INCOMPLETE. Report BLOCKED rather than commit an unverified fix.
96
+ 4. **Self-verification scope**: Run compile + the fix's regression test only. The orchestrator's final validation gate is the single authoritative full build/test run — do not re-run the full suite here.
97
+
98
+ **Return report** (a Return block in the spawn replaces this shape):
99
+ - Status: COMPLETE | PARTIAL | BLOCKED
100
+ - Issues fixed with commit SHAs
101
+ - `## Verification` block: commands run (build, test, typecheck) and results
102
+ - Unresolved issues with blocker description
103
+
104
+ ## Handoff
105
+
106
+ **If HANDOFF_REQUIRED=true**, end with the section you appended to `HANDOFF_FILE` (the orchestrator passes it on as PRIOR_PHASE_SUMMARY):
107
+
108
+ ```markdown
109
+ ## Phase {N} Implementation Summary
110
+
111
+ ### Files Created/Modified
112
+ - `path/file.ts` - {purpose, key exports}
113
+
114
+ ### Patterns Established
115
+ - Naming: {e.g., "UserRepository pattern for data access"}
116
+ - Error handling: {e.g., "Result types with DomainError"}
117
+ - Testing: {e.g., "Integration tests in tests/integration/"}
118
+
119
+ ### Key Decisions
120
+ - {Decision with rationale}
121
+
122
+ ### Integration Points for Next Phase
123
+ - {Interfaces to implement against}
124
+ - {Functions to call}
125
+ - {Types to import}
126
+ ```
127
+
128
+ ## Running commands
129
+
130
+ Run builds, typechecks, lints and tests in the foreground, each with an explicit Bash `timeout` above its expected run time. The ceiling is 600000 ms, or `BASH_MAX_TIMEOUT_MS` when set (`echo ${BASH_MAX_TIMEOUT_MS:-600000}`).
131
+
132
+ - Capture, then tail, in one Bash call (shell state does not persist): `LOG=$(mktemp); echo "LOG=$LOG"; <command> >"$LOG" 2>&1; rc=$?; tail -n 40 "$LOG"; echo "EXIT=$rc"`. The printed `EXIT=` value is the result; never decide one from a grep count.
133
+ - Never background a command and wait on it, and never poll across turns: no `sleep` or `true` turns, no sentinel-file checks, no Monitor.
134
+ - Prefer the scoped command for the change (a package, a path or a test file); for the whole set, one workspace-level command over a per-package loop.
135
+ - A run that exceeds its timeout is BLOCKED: report its duration and log path. Do not wait on it, poll it or re-run it.
136
+ - A run expected to exceed the ceiling is split into parts, each under about 90% of it, run in sequence. If it cannot be split, report BLOCKED with the remedy `devflow flags --set bash-max-timeout-ms=<ms>`.
137
+ - Never re-run a command when nothing it reads has changed.
138
+ - Never wrap a build or test command in `sh -c`, `bash -c`, `python3 -c` or `node -e`: permission rules deny wrapped commands they would allow directly.
139
+ - The same rules hold inside a dynamic Workflow sub-agent.
140
+
141
+ ## Principles
142
+
143
+ 1. **Work on feature branch** - All operations happen on the current feature branch
144
+ 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
145
+ 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
146
+ 4. **Small, focused changes** - Don't scope creep beyond the plan
147
+ 5. **Fail honestly** - If blocked, report clearly with what was completed
148
+
149
+ ## Output
150
+
151
+ Return structured completion status:
152
+
153
+ ```markdown
154
+ ## Implementation Report: {TASK_ID}
155
+
156
+ ### Status: COMPLETE | FAILED | BLOCKED
157
+
158
+ ### Implementation
159
+ - Files created: {n}
160
+ - Files modified: {n}
161
+ - Tests added: {n}
162
+
163
+ ### Commits
164
+ - {sha} {message}
165
+
166
+ ### Key Decisions (if any)
167
+ - {Decision}: {rationale}
168
+
169
+ ### Blockers (if any)
170
+ {Description of blocker or failure with recommendation}
171
+ ```
172
+
173
+ Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file (via Bash or Write) and the message gives its path. Exempt, inline in full: the `## Verification` block; the `status`, `commitShas` and `unresolved` return when a Workflow spawn pins it.
174
+
175
+ ## Boundaries
176
+
177
+ **Escalate to orchestrator:**
178
+ - Discovered dependency on another task
179
+ - Scope significantly larger than planned
180
+ - Breaking changes to shared interfaces
181
+ - Prior phase code is broken or incomplete (in sequential execution)
182
+
183
+ **Never:**
184
+ - Switch branches during implementation
185
+ - Push to branches other than your feature branch
186
+ - Merge PRs (orchestrator handles this)
187
+ - Trust handoff summaries without reading actual code
@@ -34,8 +34,7 @@ The orchestrator provides:
34
34
  **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
35
35
 
36
36
  - **DECISIONS_CONTEXT** (optional): Compact index of active ADR/PF entries for this repository (pre-rendered to `.devflow/learning/index.md` in its main worktree). `(none)` when absent. Use `devflow:apply-decisions` to Read full bodies on demand.
37
- - **COMPLIANCE_FRAMEWORKS** (compliance focus): `none` (generic controls) or the framework ids in force. Load `references/{id}.md` only for these ids.
38
- - **FEATURE_KNOWLEDGE** (optional): Pre-computed feature area context for pattern-aware gap analysis. Incorporate feature area patterns and architecture into gap analysis — design additions that fit existing structure. Follow `devflow:apply-feature-knowledge`.
37
+ - **FEATURE_KNOWLEDGE** (optional): Per KB, the Rules bullets most relevant to the feature, the KB path and a heading index, for pattern-aware gap analysis. Read the indexed sections for the architecture you build on — design additions that fit existing structure. Follow `devflow:apply-feature-knowledge`.
39
38
 
40
39
  ## Apply Decisions
41
40