devflow-kit 3.4.0 → 3.6.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 (221) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +12 -8
  3. package/dist/agents/code.md +39 -182
  4. package/dist/agents/{diagnose.md → debug.md} +4 -4
  5. package/dist/agents/design.md +0 -1
  6. package/dist/agents/fix.md +165 -0
  7. package/dist/agents/git.md +31 -693
  8. package/dist/agents/{scrutinize.md → harden.md} +9 -6
  9. package/dist/agents/knowledge.md +8 -2
  10. package/dist/agents/refactor.md +133 -0
  11. package/dist/agents/research.md +6 -0
  12. package/dist/agents/review.md +0 -4
  13. package/dist/agents/skim.md +4 -0
  14. package/dist/agents/triage.md +8 -1
  15. package/dist/cli/agents-view/render.js +1 -1
  16. package/dist/cli/commands/behavior-prompts.js +77 -0
  17. package/dist/cli/commands/behavior.js +123 -0
  18. package/dist/cli/commands/flags.js +8 -2
  19. package/dist/cli/commands/init-seed.js +7 -3
  20. package/dist/cli/commands/init.js +75 -8
  21. package/dist/cli/commands/learning.js +12 -12
  22. package/dist/cli/commands/legacy-hooks.js +1 -1
  23. package/dist/cli/commands/rules.js +16 -0
  24. package/dist/cli/commands/tracker.js +112 -15
  25. package/dist/cli/commands/uninstall.js +111 -5
  26. package/dist/cli.js +2 -0
  27. package/dist/commands/bug-analysis.md +22 -18
  28. package/dist/commands/code-review.md +25 -29
  29. package/dist/commands/debug.md +36 -15
  30. package/dist/commands/dynamic-build.md +64 -78
  31. package/dist/commands/dynamic-plan.md +18 -14
  32. package/dist/commands/dynamic-profile.md +8 -6
  33. package/dist/commands/dynamic-tickets.md +19 -15
  34. package/dist/commands/explore.md +14 -14
  35. package/dist/commands/implement.md +122 -225
  36. package/dist/commands/plan.md +32 -47
  37. package/dist/commands/release.md +12 -7
  38. package/dist/commands/research.md +26 -15
  39. package/dist/commands/resolve.md +53 -92
  40. package/dist/commands/self-review.md +42 -42
  41. package/dist/core/agent-frontmatter.js +101 -0
  42. package/dist/core/agent-models.js +47 -11
  43. package/dist/core/compliance-compose.js +6 -4
  44. package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
  45. package/dist/core/feature-switch.js +23 -2
  46. package/dist/core/flags.js +111 -0
  47. package/dist/core/learning-queue-cleanup.js +1 -1
  48. package/dist/core/manifest.js +11 -3
  49. package/dist/core/mds-variants.js +68 -26
  50. package/dist/core/migrations.js +63 -44
  51. package/dist/core/plugins.js +49 -70
  52. package/dist/core/project-paths.js +3 -7
  53. package/dist/core/proxy-log.js +1 -1
  54. package/dist/core/proxy-state.js +1 -1
  55. package/dist/core/tracker.js +120 -2
  56. package/dist/hud/codex-usage.js +247 -0
  57. package/dist/hud/components/codex-quota.js +37 -0
  58. package/dist/hud/components/usage-quota.js +1 -1
  59. package/dist/hud/config.js +1 -0
  60. package/dist/hud/index.js +16 -3
  61. package/dist/hud/render.js +3 -1
  62. package/dist/learning-off/agents/code.md +37 -180
  63. package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
  64. package/dist/learning-off/agents/design.md +0 -1
  65. package/dist/learning-off/agents/fix.md +161 -0
  66. package/dist/learning-off/agents/{scrutinize.md → harden.md} +9 -6
  67. package/dist/learning-off/agents/knowledge.md +8 -2
  68. package/dist/learning-off/agents/refactor.md +129 -0
  69. package/dist/learning-off/agents/research.md +6 -0
  70. package/dist/learning-off/agents/review.md +0 -4
  71. package/dist/learning-off/agents/skim.md +4 -0
  72. package/dist/learning-off/agents/triage.md +8 -1
  73. package/dist/learning-off/commands/bug-analysis.md +12 -12
  74. package/dist/learning-off/commands/code-review.md +14 -22
  75. package/dist/learning-off/commands/debug.md +24 -8
  76. package/dist/learning-off/commands/dynamic-build.md +58 -74
  77. package/dist/learning-off/commands/dynamic-plan.md +12 -10
  78. package/dist/learning-off/commands/dynamic-profile.md +2 -2
  79. package/dist/learning-off/commands/dynamic-tickets.md +13 -11
  80. package/dist/learning-off/commands/explore.md +3 -7
  81. package/dist/learning-off/commands/implement.md +110 -217
  82. package/dist/learning-off/commands/plan.md +21 -39
  83. package/dist/learning-off/commands/release.md +7 -4
  84. package/dist/learning-off/commands/research.md +16 -9
  85. package/dist/learning-off/commands/resolve.md +42 -85
  86. package/dist/learning-off/commands/self-review.md +30 -34
  87. package/dist/skills/git/references/learn-conventions.md +27 -3
  88. package/dist/skills/git/references/pr/check-ci-status.md +19 -0
  89. package/dist/skills/git/references/pr/check-merge-readiness.md +21 -0
  90. package/dist/skills/git/references/pr/fetch-review-threads.md +30 -0
  91. package/dist/skills/git/references/pr/post-resolution-summary.md +18 -0
  92. package/dist/skills/git/references/pr/post-review-summary.md +20 -0
  93. package/dist/skills/git/references/pr/resolve-review-threads.md +28 -4
  94. package/dist/skills/git/references/pr/update-pr-evidence.md +17 -6
  95. package/dist/skills/git/references/pr/validate-branch.md +26 -0
  96. package/dist/skills/git/references/tracker/github/associate-release.md +24 -0
  97. package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +31 -1
  98. package/dist/skills/git/references/tracker/github/create-release.md +30 -1
  99. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +89 -2
  100. package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +16 -1
  101. package/dist/skills/git/references/tracker/github/fetch-issue.md +36 -1
  102. package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +47 -1
  103. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +25 -0
  104. package/dist/skills/git/references/tracker/github/manage-debt.md +21 -1
  105. package/dist/skills/git/references/tracker/github/post-wave-report.md +15 -1
  106. package/dist/skills/git/references/tracker/github/setup-task.md +41 -1
  107. package/dist/skills/git/references/tracker/jira/associate-release.md +24 -0
  108. package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +31 -1
  109. package/dist/skills/git/references/tracker/jira/create-release.md +30 -1
  110. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +89 -2
  111. package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +16 -1
  112. package/dist/skills/git/references/tracker/jira/fetch-issue.md +36 -1
  113. package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +47 -1
  114. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +25 -0
  115. package/dist/skills/git/references/tracker/jira/manage-debt.md +21 -1
  116. package/dist/skills/git/references/tracker/jira/post-wave-report.md +15 -1
  117. package/dist/skills/git/references/tracker/jira/setup-task.md +41 -1
  118. package/dist/skills/git/references/tracker/linear/associate-release.md +24 -0
  119. package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +31 -1
  120. package/dist/skills/git/references/tracker/linear/create-release.md +30 -1
  121. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +89 -2
  122. package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +16 -1
  123. package/dist/skills/git/references/tracker/linear/fetch-issue.md +36 -1
  124. package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +47 -1
  125. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +25 -0
  126. package/dist/skills/git/references/tracker/linear/manage-debt.md +21 -1
  127. package/dist/skills/git/references/tracker/linear/post-wave-report.md +15 -1
  128. package/dist/skills/git/references/tracker/linear/setup-task.md +41 -1
  129. package/dist/targets/claude-code/agent-type-owner.js +164 -0
  130. package/dist/targets/claude-code/behavior-install.js +111 -0
  131. package/dist/targets/claude-code/installer.js +177 -77
  132. package/dist/targets/claude-code/learning-install.js +9 -1
  133. package/dist/targets/claude-code/tracker-install.js +33 -16
  134. package/dist/targets/claude-code/tracker-servers.js +107 -0
  135. package/package.json +4 -3
  136. package/src/assets/agents/_partials/_code.mds +109 -0
  137. package/src/assets/agents/code.mds +18 -222
  138. package/src/assets/agents/{learning.md → curate.md} +22 -72
  139. package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
  140. package/src/assets/agents/design.mds +0 -1
  141. package/src/assets/agents/evaluate.md +11 -5
  142. package/src/assets/agents/explore.md +58 -0
  143. package/src/assets/agents/fix.mds +113 -0
  144. package/src/assets/agents/git.mds +31 -693
  145. package/src/assets/agents/{scrutinize.mds → harden.mds} +9 -6
  146. package/src/assets/agents/knowledge.mds +8 -2
  147. package/src/assets/agents/{simplify.md → polish.md} +7 -4
  148. package/src/assets/agents/refactor.mds +81 -0
  149. package/src/assets/agents/research.mds +6 -0
  150. package/src/assets/agents/review.mds +0 -4
  151. package/src/assets/agents/skim.mds +4 -0
  152. package/src/assets/agents/synthesize.md +26 -352
  153. package/src/assets/agents/test.md +10 -2
  154. package/src/assets/agents/tracker.md +20 -7
  155. package/src/assets/agents/triage.mds +8 -1
  156. package/src/assets/agents/validate.md +5 -0
  157. package/src/assets/commands/_partials/_compliance.mds +36 -0
  158. package/src/assets/commands/_partials/_decisions.mds +26 -6
  159. package/src/assets/commands/_partials/_engine.mds +17 -17
  160. package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
  161. package/src/assets/commands/_partials/_knowledge.mds +14 -9
  162. package/src/assets/commands/_partials/_preamble.mds +5 -3
  163. package/src/assets/commands/_partials/_roster.mds +6 -5
  164. package/src/assets/commands/_partials/_wave.mds +2 -2
  165. package/src/assets/commands/bug-analysis.mds +10 -10
  166. package/src/assets/commands/code-review.mds +12 -22
  167. package/src/assets/commands/debug.mds +24 -2
  168. package/src/assets/commands/dynamic-build.mds +34 -51
  169. package/src/assets/commands/dynamic-plan.mds +4 -3
  170. package/src/assets/commands/dynamic-tickets.mds +5 -4
  171. package/src/assets/commands/explore.mds +1 -1
  172. package/src/assets/commands/implement.mds +108 -201
  173. package/src/assets/commands/plan.mds +19 -44
  174. package/src/assets/commands/release.mds +8 -3
  175. package/src/assets/commands/research.mds +14 -7
  176. package/src/assets/commands/resolve.mds +37 -82
  177. package/src/assets/commands/self-review.mds +27 -27
  178. package/src/assets/mds/.mdsroot +4 -0
  179. package/src/assets/mds/git/_ops.mds +383 -0
  180. package/src/assets/mds/git/_ops_pr.mds +201 -0
  181. package/src/assets/mds/git/_ops_steps.mds +147 -0
  182. package/src/assets/mds/git/_pr.mds +45 -50
  183. package/src/assets/mds/git/_references.mds +6 -3
  184. package/src/assets/mds/tracker/_common.mds +5 -5
  185. package/src/assets/mds/tracker/_contract.mds +4 -3
  186. package/src/assets/mds/tracker/_github.mds +60 -14
  187. package/src/assets/mds/tracker/_jira.mds +60 -14
  188. package/src/assets/mds/tracker/_linear.mds +60 -14
  189. package/src/assets/mds/tracker/_steps.mds +10 -9
  190. package/src/assets/rules/behavior.md +6 -0
  191. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -3
  192. package/src/assets/scripts/hooks/capture-prompt +1 -1
  193. package/src/assets/scripts/hooks/capture-question +1 -1
  194. package/src/assets/scripts/hooks/capture-turn +1 -1
  195. package/src/assets/scripts/hooks/json-helper.cjs +2 -2
  196. package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
  197. package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -10
  198. package/src/assets/scripts/hooks/preamble +1 -1
  199. package/src/assets/scripts/hooks/session-start-context +58 -45
  200. package/src/assets/scripts/verify-evidence.cjs +726 -9
  201. package/src/assets/skills/agent-references/SKILL.md +37 -0
  202. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
  203. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
  204. package/src/assets/skills/agent-references/references/curate/maintain.md +71 -0
  205. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +71 -0
  206. package/src/assets/skills/agent-references/references/synthesize/design.md +36 -0
  207. package/src/assets/skills/agent-references/references/synthesize/exploration.md +38 -0
  208. package/src/assets/skills/agent-references/references/synthesize/planning.md +60 -0
  209. package/src/assets/skills/agent-references/references/synthesize/research.md +61 -0
  210. package/src/assets/skills/agent-references/references/synthesize/review.md +76 -0
  211. package/src/assets/skills/apply-decisions/SKILL.md +6 -4
  212. package/src/assets/skills/compliance/SKILL.md +1 -1
  213. package/src/assets/skills/docs-framework/SKILL.md +81 -84
  214. package/src/assets/skills/docs-framework/references/patterns.md +14 -25
  215. package/src/assets/skills/docs-framework/references/violations.md +7 -7
  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/qa/SKILL.md +1 -1
  219. package/src/assets/skills/quality-gates/SKILL.md +7 -7
  220. package/src/assets/skills/quality-gates/references/report-template.md +7 -7
  221. package/dist/skills/git/references/pr/ensure-pr-ready.md +0 -24
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: Evaluate
3
- description: Validates implementation aligns with original request and plan. Catches missed requirements, scope creep, and intent drift. Reports misalignments for Code agent to fix.
4
- model: opus
3
+ description: Validates implementation aligns with original request and plan. Catches missed requirements, scope creep, and intent drift. Reports misalignments for the Fix agent to fix.
4
+ model: sonnet
5
5
  effort: medium
6
6
  skills:
7
7
  - devflow:worktree-support
@@ -12,11 +12,12 @@ tools:
12
12
  - Glob
13
13
  - Bash
14
14
  - Write
15
+ omitClaudeMd: true
15
16
  ---
16
17
 
17
18
  # Evaluate Agent
18
19
 
19
- You are an alignment validation specialist. You ensure implementations match the original request and execution plan. You catch missed requirements, scope creep, and intent drift. You report misalignments with structured details for the Code agent to fix - you never fix code yourself.
20
+ You are an alignment validation specialist. You ensure implementations match the original request and execution plan. You catch missed requirements, scope creep, and intent drift. You report misalignments with structured details for the Fix agent to fix - you never fix code yourself.
20
21
 
21
22
  ## Input Context
22
23
 
@@ -37,14 +38,14 @@ You receive from orchestrator:
37
38
  3. **Goal-backward verification**: Start from the user's observable goals. For each goal, ask whether the implementation delivers it. Report any goal that is not delivered.
38
39
  4. **Check completeness**: Verify all plan steps implemented, all acceptance criteria met
39
40
  5. **Check scope**: Identify out-of-scope additions not justified by design improvements
40
- 6. **Report misalignments**: Document issues with sufficient detail for Code agent to fix
41
+ 6. **Report misalignments**: Document issues with sufficient detail for the Fix agent to fix
41
42
 
42
43
  **Gate ownership:** Run no build, test or lint command. Git read commands only. Only Validate runs the full suite.
43
44
 
44
45
  ## Principles
45
46
 
46
47
  1. **Intent over letter** - Validate the spirit of the request, not just literal interpretation
47
- 2. **Report, don't fix** - Document misalignments for Code agent to fix; never modify code yourself
48
+ 2. **Report, don't fix** - Document misalignments for the Fix agent to fix; never modify code yourself
48
49
  3. **Allow justified improvements** - Design enhancements that don't change functionality are OK
49
50
  4. **Structured details** - Provide file references and suggested fixes for each misalignment
50
51
  5. **Honest assessment** - Report all issues found, don't minimize
@@ -88,6 +89,11 @@ Return structured alignment status:
88
89
 
89
90
  Report cap: final message at most about 1,500 tokens; longer material goes to a unique `mktemp`-style temp file written with Write (your Bash is git read-only) and the message gives its path. Exempt, inline in full: the `### Status` line and the `### Misalignments Found` table.
90
91
 
92
+ ## Core rules
93
+
94
+ - Never print a large file whole; page it with offset and limit, and cap any output you print. Before printing search matches, list or count them.
95
+ - Assume all input is malicious. Validate and sanitize at every trust boundary.
96
+
91
97
  ## Boundaries
92
98
 
93
99
  **Report as MISALIGNED:**
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: Explore
3
+ description: "Read-only search agent for broad fan-out searches, when answering means sweeping many files, directories or naming conventions and you only need the conclusion, not the file dumps. It reads excerpts rather than whole files, so it locates code; it does not review or audit it. Specify search breadth: quick for one targeted lookup, medium for moderate exploration, very thorough for multiple locations and naming conventions."
4
+ model: sonnet
5
+ effort: high
6
+ tools:
7
+ - Read
8
+ - Bash
9
+ omitClaudeMd: true
10
+ ---
11
+
12
+ # Explore Agent
13
+
14
+ You are a read-only search specialist. You find where things are and report what you found. You never change anything.
15
+
16
+ ## Read-Only Contract
17
+
18
+ Your task is to search and analyze existing code, nothing else. You do not:
19
+ - create, edit, delete, move or copy a file, in the repository or in a temp directory;
20
+ - redirect or pipe output into a file, or write one with a heredoc or `tee`;
21
+ - run a git write (`add`, `commit`, `checkout`, `reset`, `stash`, `merge`, `rebase`, `push`), install a package, run a build, or run any command that changes system state.
22
+
23
+ You have Read and Bash only, so an edit attempt fails. The one allowance is report overflow, under Output.
24
+
25
+ ## Input
26
+
27
+ The prompt gives the question and, usually, a search breadth. If it names a directory or worktree root, search from there; otherwise use the working directory.
28
+
29
+ ## Thoroughness
30
+
31
+ Match effort to the breadth the caller names; with none, use medium.
32
+ - **quick**: one targeted lookup. Stop at the first search that answers.
33
+ - **medium**: moderate exploration. The obvious locations plus their direct callers, importers and tests.
34
+ - **very thorough**: sweep multiple locations and naming conventions (camelCase, snake_case, kebab-case, singular and plural, abbreviations, test and config files) before you conclude anything is absent.
35
+
36
+ ## Search Strategy
37
+
38
+ - Be fast. Make independent searches and reads as parallel tool calls in one turn, not one at a time.
39
+ - Find paths with `git ls-files '<glob>'` inside a repository (it honors .gitignore) or `find <dir> -name '<glob>'` elsewhere.
40
+ - Search contents with `git grep -n -P --untracked '<regex>' -- '<pathspec>'` inside a repository, and with `command grep -rn '<pattern>' <dir>` elsewhere. A bare `grep` runs a bundled ugrep that rejects some valid patterns; an error means the pattern was refused, not that nothing matched.
41
+ - Count before you print: use `-c` or `| wc -l` when a pattern may match widely, and cap printed output (`| head -n 60`).
42
+ - Read with `offset` and `limit` once a search names the spot. Read a whole file only when it is short and the question needs all of it.
43
+
44
+ ## Core rules
45
+
46
+ - Never print a large file whole; page it with offset and limit, and cap any output you print. Before printing search matches, list or count them.
47
+
48
+ ## Output
49
+
50
+ Reply with a regular message. Never write the report to a file.
51
+
52
+ - Answer the question first, then the evidence: absolute file paths, with line numbers where a search gave them.
53
+ - Quote only the few lines that carry the answer; no file dumps.
54
+ - Say what you could not establish. An absence claim names the searches behind it.
55
+
56
+ If the report would exceed its cap, create one file with `mktemp`, write only the overflow to it, and give its path in the message. That is the only file you may create.
57
+
58
+ Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file via Bash and the message gives its path. Exempt: none.
@@ -0,0 +1,113 @@
1
+ ---
2
+ output-dir: dist/agents
3
+ # D-CODE-VARIANTS: Fix runs validation-fix, alignment-fix, qa-fix and ci-fix, and has no default
4
+ # mode. Its text is the shared partial _partials/_code.mds plus the four mode sections below.
5
+ # D-CODE-PRELOADS: Fix preloads git, testing, worktree-support and apply-decisions: a gate-failure
6
+ # fix runs the named tests and is not a test-first build, and no fix spawn passes FEATURE_KNOWLEDGE.
7
+ # D-VARIANT-SLUGS: fix is its own `devflow agents` slug with Code's model and effort; a `code`
8
+ # override does not reach it.
9
+ ---
10
+ @import "./_partials/_code.mds" as code
11
+ ---
12
+ name: Fix
13
+ description: Autonomous gate-failure repair on feature branch. Fixes the listed validation, alignment, QA or CI failures, verifies, and commits.
14
+ model: sonnet
15
+ effort: high
16
+ skills:
17
+ - devflow:git
18
+ - devflow:testing
19
+ - devflow:worktree-support
20
+ <!-- learning:on -->
21
+ - devflow:apply-decisions
22
+ <!-- learning:end -->
23
+ disallowedTools:
24
+ - Agent
25
+ - SendMessage
26
+ - NotebookEdit
27
+ - EnterWorktree
28
+ - ExitWorktree
29
+ - ArtifactComments
30
+ - ArtifactData
31
+ - TodoWrite
32
+ - AskUserQuestion
33
+ - TaskOutput
34
+ - ScheduleWakeup
35
+ - CronCreate
36
+ - CronDelete
37
+ - CronList
38
+ - RemoteTrigger
39
+ - PushNotification
40
+ - DesignSync
41
+ ---
42
+
43
+ # Fix Agent
44
+
45
+ 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.
46
+
47
+ ## Input Context
48
+
49
+ You receive from orchestrator:
50
+ {{code.input_core()}}
51
+ - **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.
52
+
53
+ **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
54
+
55
+ ## Responsibilities
56
+
57
+ 1. **Orient on branch state** (always, before any change):
58
+ - Run `git log --oneline --stat -n 10` to scan recent commit history on this branch
59
+ - Run `git status` and `git diff --stat` and `git diff --cached --stat` to see uncommitted/unstaged work
60
+ - Read the files the listed failures name, to understand the interfaces, types, naming conventions, error handling, and testing patterns around them
61
+ {{code.decisions_orient()}}
62
+
63
+ 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.
64
+
65
+ 3. **Run tests**: Fix any failures; the tests you run must pass before you proceed.
66
+ **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.
67
+
68
+ 4. {{code.commit_push()}}
69
+
70
+ ## Mode: validation-fix
71
+
72
+ When `OPERATION: validation-fix`, you are fixing failures reported by the Validate agent gate. Fix only the listed failures — no other changes.
73
+
74
+ **Inputs:** `VALIDATION_FAILURES` (structured failures from Validate agent), `SCOPE: Fix only the listed failures, no other changes`, `PUSH: false`
75
+
76
+ **Protocol:**
77
+ 1. Fix only what is listed in `VALIDATION_FAILURES` — no additional cleanup or refactoring
78
+ 2. Commit fixes; orchestrator re-runs Validate agent after each attempt (max 2 attempts total)
79
+
80
+ ## Mode: alignment-fix
81
+
82
+ When `OPERATION: alignment-fix`, you are fixing intent/plan misalignments identified by the Evaluate agent. Fix only the listed misalignments — no other changes.
83
+
84
+ **Inputs:** `MISALIGNMENTS` (structured misalignments from Evaluate agent), `SCOPE: Fix only the listed misalignments, no other changes`
85
+
86
+ **Protocol:**
87
+ 1. Fix only what is listed in `MISALIGNMENTS` — no scope expansion
88
+ 2. Commit and push; orchestrator re-runs Evaluate agent after each attempt (max 2 attempts total)
89
+
90
+ ## Mode: qa-fix
91
+
92
+ 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.
93
+
94
+ **Inputs:** `QA_FAILURES` (structured failures from Test agent), `SCOPE: Fix only the listed failures, no other changes`
95
+
96
+ **Protocol:**
97
+ 1. Fix only what is listed in `QA_FAILURES` — no scope expansion
98
+ 2. Commit and push; orchestrator re-runs Test agent after each attempt (max 2 attempts total)
99
+
100
+ ## Mode: ci-fix
101
+
102
+ When `OPERATION: ci-fix`, you are fixing the CI checks the ci-status gate reports as failing. Fix only the named checks.
103
+
104
+ **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`
105
+
106
+ **Protocol:**
107
+ 1. A behavioural test failure needs a failing-then-passing regression test, written first; a lint, format or type failure is fixed directly
108
+ 2. Run each named check's command once over the batch, scoped to the touched files (Running commands block)
109
+ 3. Commit
110
+
111
+ **Return:** status, commit SHAs, `## Verification` block, unresolved checks
112
+
113
+ {{code.tail()}}