devflow-kit 3.2.0 → 3.3.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 (89) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/cli/commands/learning.js +25 -5
  4. package/dist/commands/code-review.md +1 -1
  5. package/dist/commands/debug.md +1 -1
  6. package/dist/commands/dynamic-build.md +141 -94
  7. package/dist/commands/dynamic-plan.md +1 -1
  8. package/dist/commands/explore.md +1 -1
  9. package/dist/commands/implement.md +133 -133
  10. package/dist/commands/resolve.md +27 -16
  11. package/dist/commands/self-review.md +16 -11
  12. package/dist/core/agent-models.js +10 -7
  13. package/dist/core/learning-tuning-config.js +8 -0
  14. package/dist/core/plugins.js +7 -2
  15. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +1 -1
  16. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +1 -1
  17. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +1 -1
  18. package/package.json +1 -1
  19. package/src/assets/agents/code.md +71 -18
  20. package/src/assets/agents/design.md +10 -0
  21. package/src/assets/agents/diagnose.md +16 -11
  22. package/src/assets/agents/evaluate.md +14 -25
  23. package/src/assets/agents/knowledge.md +5 -3
  24. package/src/assets/agents/learning.md +4 -6
  25. package/src/assets/agents/research.md +19 -0
  26. package/src/assets/agents/review.md +10 -0
  27. package/src/assets/agents/scrutinize.md +34 -10
  28. package/src/assets/agents/simplify.md +20 -0
  29. package/src/assets/agents/skim.md +4 -2
  30. package/src/assets/agents/synthesize.md +12 -0
  31. package/src/assets/agents/test.md +2 -2
  32. package/src/assets/agents/triage.md +7 -1
  33. package/src/assets/agents/validate.md +7 -2
  34. package/src/assets/commands/_partials/_engine.mds +21 -24
  35. package/src/assets/commands/_partials/_knowledge.mds +1 -1
  36. package/src/assets/commands/_partials/_plan_contract.mds +1 -1
  37. package/src/assets/commands/_partials/_wave.mds +8 -6
  38. package/src/assets/commands/code-review.mds +1 -1
  39. package/src/assets/commands/dynamic-build.mds +111 -63
  40. package/src/assets/commands/implement.mds +132 -132
  41. package/src/assets/commands/resolve.mds +26 -15
  42. package/src/assets/commands/self-review.mds +15 -10
  43. package/src/assets/mds/tracker/_common.mds +1 -1
  44. package/src/assets/scripts/ci-wait.cjs +636 -0
  45. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +1 -1
  46. package/src/assets/scripts/hooks/background-memory-update +290 -9
  47. package/src/assets/scripts/release-trace.cjs +27 -10
  48. package/src/assets/skills/accessibility/SKILL.md +1 -1
  49. package/src/assets/skills/apply-decisions/SKILL.md +12 -82
  50. package/src/assets/skills/apply-feature-knowledge/SKILL.md +8 -42
  51. package/src/assets/skills/architecture/SKILL.md +1 -1
  52. package/src/assets/skills/boundary-validation/SKILL.md +1 -1
  53. package/src/assets/skills/complexity/SKILL.md +1 -1
  54. package/src/assets/skills/compliance/SKILL.md +1 -1
  55. package/src/assets/skills/consistency/SKILL.md +1 -1
  56. package/src/assets/skills/database/SKILL.md +1 -1
  57. package/src/assets/skills/dependencies/SKILL.md +1 -1
  58. package/src/assets/skills/dependency-research/SKILL.md +3 -6
  59. package/src/assets/skills/design-review/SKILL.md +1 -1
  60. package/src/assets/skills/docs-framework/SKILL.md +1 -1
  61. package/src/assets/skills/documentation/SKILL.md +1 -1
  62. package/src/assets/skills/gap-analysis/SKILL.md +1 -1
  63. package/src/assets/skills/git/SKILL.md +1 -1
  64. package/src/assets/skills/go/SKILL.md +1 -1
  65. package/src/assets/skills/java/SKILL.md +1 -1
  66. package/src/assets/skills/patterns/SKILL.md +1 -1
  67. package/src/assets/skills/performance/SKILL.md +1 -1
  68. package/src/assets/skills/python/SKILL.md +1 -1
  69. package/src/assets/skills/qa/SKILL.md +1 -3
  70. package/src/assets/skills/quality-gates/SKILL.md +9 -12
  71. package/src/assets/skills/quality-gates/references/report-template.md +20 -20
  72. package/src/assets/skills/react/SKILL.md +1 -1
  73. package/src/assets/skills/regression/SKILL.md +1 -1
  74. package/src/assets/skills/reliability/SKILL.md +1 -1
  75. package/src/assets/skills/research-codebase/SKILL.md +1 -1
  76. package/src/assets/skills/research-competitor/SKILL.md +1 -1
  77. package/src/assets/skills/research-external/SKILL.md +1 -1
  78. package/src/assets/skills/research-technology/SKILL.md +1 -1
  79. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  80. package/src/assets/skills/rust/SKILL.md +1 -1
  81. package/src/assets/skills/security/SKILL.md +1 -1
  82. package/src/assets/skills/software-design/SKILL.md +1 -1
  83. package/src/assets/skills/test-driven-development/SKILL.md +9 -29
  84. package/src/assets/skills/testing/SKILL.md +1 -1
  85. package/src/assets/skills/typescript/SKILL.md +1 -1
  86. package/src/assets/skills/ui-design/SKILL.md +1 -1
  87. package/src/assets/skills/worktree-support/SKILL.md +3 -55
  88. package/src/assets/skills/worktree-support/references/discovery.md +48 -0
  89. package/src/assets/skills/worktree-support/references/roots.md +2 -2
@@ -14,7 +14,7 @@ Run Simplify agent and Scrutinize agent sequentially on changed files for post-i
14
14
 
15
15
  ### Phase 0: Context Gathering
16
16
 
17
- **Produces:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE
17
+ **Produces:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, HEAD_BEFORE
18
18
 
19
19
  Detect changed files and build context:
20
20
 
@@ -22,6 +22,7 @@ Detect changed files and build context:
22
22
  2. Else run `git diff --name-only HEAD` + `git diff --name-only --cached` to get staged + unstaged
23
23
  3. If no changes found, report "No changes to review" and exit
24
24
  4. Build TASK_DESCRIPTION from recent commit messages or branch name
25
+ 5. Record `HEAD_BEFORE` (`git rev-parse HEAD`) now, before Simplify runs — Phase 3 compares against it
25
26
  ### Load DECISIONS_CONTEXT
26
27
 
27
28
  The decisions ledger belongs to the repository, not to one checkout: in a linked worktree it lives in the main worktree, and a session started in a subdirectory reads the copy at the repository root. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
@@ -100,7 +101,7 @@ If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set `FE
100
101
 
101
102
  Pass `FEATURE_KNOWLEDGE` to Scrutinize agent.
102
103
 
103
- **Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), DECISIONS_CONTEXT (string, optional), FEATURE_KNOWLEDGE (string, optional)
104
+ **Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), DECISIONS_CONTEXT (string, optional), FEATURE_KNOWLEDGE (string, optional), HEAD_BEFORE (40-hex SHA)
104
105
 
105
106
  ### Phase 1: Simplify agent (Code Refinement)
106
107
 
@@ -112,13 +113,14 @@ Spawn Simplify agent to refine code for clarity and consistency:
112
113
  Agent(subagent_type="Simplify", run_in_background=false):
113
114
  "TASK_DESCRIPTION: {task_description}
114
115
  FILES_CHANGED: {files_changed}
115
- Simplify and refine the code for clarity and consistency while preserving functionality."
116
+ Simplify and refine the code for clarity and consistency while preserving functionality.
117
+ Commit any improvements with a conventional-commit message."
116
118
 
117
119
  **Wait for completion.** Simplify agent commits changes directly.
118
120
 
119
121
  ### Phase 2: Scrutinize agent (9-Pillar Quality Gate)
120
122
 
121
- **Produces:** SCRUTINIZE_STATUS, SCRUTINIZE_CHANGES
123
+ **Produces:** SCRUTINIZE_STATUS
122
124
  **Requires:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT
123
125
 
124
126
  Spawn Scrutinize agent for quality evaluation and fixing:
@@ -132,17 +134,19 @@ Evaluate against 9-pillar framework. Fix P0/P1 issues. Return structured report.
132
134
  Follow devflow:apply-decisions to scan DECISIONS_CONTEXT and Read full ADR/PF bodies on demand. Skip if (none).
133
135
  Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE. Skip if (none)."
134
136
 
135
- **Wait for completion.** Extract: STATUS (PASS|FIXED|BLOCKED), changes_made (bool)
137
+ **Wait for completion.** Extract: STATUS (PASS|FIXED|BLOCKED) from the `### Status` line
136
138
 
137
139
  ### Phase 3: Conditional Validation
138
140
 
139
141
  **Produces:** VALIDATION_RESULT
140
- **Requires:** SCRUTINIZE_CHANGES
142
+ **Requires:** HEAD_BEFORE, SCRUTINIZE_STATUS
141
143
 
142
- If Scrutinize agent made changes (STATUS == FIXED):
144
+ If STATUS is BLOCKED, skip this phase: the report (Phase 4) names the blocker.
145
+
146
+ Run this phase only if HEAD moved — `git rev-parse HEAD` differs from `HEAD_BEFORE`, meaning Simplify or Scrutinize committed (Simplify alone counts, whatever Scrutinize's STATUS is). Otherwise skip it. Its scope is changed-only over what the two agents changed:
143
147
 
144
148
  Agent(subagent_type="Validate", run_in_background=false):
145
- "FILES_CHANGED: {scrutinize_modified_files}
149
+ "FILES_CHANGED: {output of `git diff --name-only HEAD_BEFORE..HEAD`}
146
150
  VALIDATION_SCOPE: changed-only
147
151
  Run build, typecheck, lint, test on modified files"
148
152
 
@@ -208,7 +212,7 @@ If the settings line says `KNOWLEDGE=off`, skip write-back entirely. The machine
208
212
  **Step 2 — Evaluate whether write-back is warranted:**
209
213
 
210
214
  Only proceed if **at least one** of these is true:
211
- - This workflow changed files in a directory that is documented by an existing feature knowledge base (a documented area changed).
215
+ - This workflow changed files in a directory that is documented by an existing feature knowledge base (a documented area changed). Knowledge bases are written through at that point, never on a background schedule.
212
216
  - This workflow surfaced durable, cross-cutting knowledge about a codebase area that would help future agents working in the same area — patterns, anti-patterns, integration points, gotchas not visible from a single file read.
213
217
 
214
218
  **Never spawn unconditionally.** If neither condition is met, skip write-back silently.
@@ -252,6 +256,7 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
252
256
  │
253
257
  ├─ Phase 0: Context gathering
254
258
  │ ├─ Git diff for changed files
259
+ │ ├─ Record HEAD_BEFORE
255
260
  │ └─ Read index.md → DECISIONS_CONTEXT
256
261
  │
257
262
  ├─ Phase 1: Simplify agent
@@ -261,7 +266,7 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
261
266
  │ └─ 9-pillar quality gate (may fix and commit)
262
267
  │
263
268
  ├─ Phase 3: Validate agent (conditional)
264
- │ └─ If Scrutinize agent made changes, verify tests pass
269
+ │ └─ If HEAD moved since HEAD_BEFORE (Simplify or Scrutinize committed), changed-only Validate over HEAD_BEFORE..HEAD
265
270
  │
266
271
  └─ Phase 4: Report
267
272
  └─ Display summary with pillar status
@@ -280,6 +285,6 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
280
285
 
281
286
  1. **Orchestration only** - Command spawns agents, doesn't do the work
282
287
  2. **Sequential execution** - Simplify agent must complete before Scrutinize agent
283
- 3. **Validation gate** - If Scrutinize agent changes code, must pass validation
288
+ 3. **Validation gate** - If Simplify agent or Scrutinize agent committed, the changes must pass validation
284
289
  4. **Honest reporting** - Display actual agent outputs
285
290
  5. **Fail fast** - Stop on BLOCKED or validation failure
@@ -83,13 +83,16 @@ export const EFFORT_INHERIT = 'inherit';
83
83
  * count are unaffected.
84
84
  *
85
85
  * Shipped value of `memory`: `claude-sonnet-5-5` at `high` effort. User decision
86
- * 2026-10-08: memory quality is worth more than the cost saving of Haiku, which
87
- * replaces the plan's Haiku default. The worker does not read `agents.memory`
88
- * yet. Until it does, background-memory-update names this model as a literal in
89
- * its `claude -p --model` argument, and tests/agent-models-worker.test.ts holds
90
- * that literal equal to this row so the two cannot drift apart. Wiring the
91
- * worker to this map, and `--effort` behind a CLI version probe, is a separate
92
- * change.
86
+ * 2026-10-08: memory quality is worth more than the cost saving of Haiku.
87
+ *
88
+ * D-MEMORY-WORKER-LEAN: background-memory-update reads `agents.memory` from
89
+ * `~/.devflow/agent-models.json` at run time, validating `model` and `effort`
90
+ * field by field against the domain below, and passes `--effort` when the CLI
91
+ * version probe puts it at or above the lean-argv floor. A field it cannot use
92
+ * falls back to this row. The hook spells that fallback out for bash
93
+ * (`MEMORY_MODEL_DEFAULT`, `MEMORY_EFFORT_DEFAULT`, the alias and effort lists and
94
+ * the model-name rules), and tests/agent-models-worker.test.ts holds every one
95
+ * equal to this row and to the domain, so the two cannot drift apart.
93
96
  */
94
97
  export const WORKER_AGENTS = {
95
98
  memory: { model: 'claude-sonnet-5-5', effort: 'high' },
@@ -6,6 +6,14 @@ const VALID_MODELS = new Set(['opus', 'sonnet', 'haiku']);
6
6
  function isValidModel(value) {
7
7
  return typeof value === 'string' && VALID_MODELS.has(value);
8
8
  }
9
+ /**
10
+ * D-LEARNING-SHIPPED-ROW: the default model is the model the Learning agent ships
11
+ * with, the `model:` line of src/assets/agents/learning.md. With no layer
12
+ * configuring a model, the spawn directive names none and that line decides, so a
13
+ * different default here would describe a run that never happens.
14
+ * tests/decisions/config.test.ts holds this value equal to the Learning row of the
15
+ * agent-config table, which a change of the shipped tier edits with the frontmatter.
16
+ */
9
17
  const DEFAULTS = {
10
18
  model: 'opus',
11
19
  debug: false,
@@ -244,7 +244,10 @@ export const DEVFLOW_PLUGINS = [
244
244
  commands: ['/release'],
245
245
  agents: ['git', 'validate'],
246
246
  skills: ['git', 'worktree-support'],
247
- requires: ['testing'],
247
+ // D-PRELOAD-TRIM: nothing in this plugin's corpus reads `testing` (Validate
248
+ // preloads only `worktree-support`), so the closure guard's reverse arm holds
249
+ // this list empty.
250
+ requires: [],
248
251
  rules: [],
249
252
  },
250
253
  {
@@ -253,7 +256,9 @@ export const DEVFLOW_PLUGINS = [
253
256
  commands: ['/self-review'],
254
257
  agents: ['simplify', 'scrutinize', 'validate', 'knowledge'],
255
258
  skills: ['quality-gates', 'software-design', 'worktree-support', 'feature-knowledge', 'apply-feature-knowledge'],
256
- requires: ['apply-decisions', 'testing'],
259
+ // D-PRELOAD-TRIM: no agent, command or skill in this plugin's corpus names
260
+ // `testing` (Validate preloads only `worktree-support`), so it is not required here.
261
+ requires: ['apply-decisions'],
257
262
  rules: [],
258
263
  },
259
264
  {
@@ -7,7 +7,7 @@ Load when the resolved tracker provider is `github` and the operation is `gather
7
7
  ### Process
8
8
 
9
9
  1a. **Last release tag.** Step 1's `git describe` can return a non-release marker tag. From `WORKTREE_PATH` (else cwd), run `node "$HOME/.devflow/scripts/release-trace.cjs" last-tag`: `LAST_TAG <tag>` ⇒ that tag is `{last_tag}`; `LAST_TAG none` ⇒ step 1's initial-commit rule; anything else ⇒ keep step 1's tag and report status `INDETERMINATE (last release tag unresolved)`.
10
- 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?|refs):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
10
+ 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
11
11
  3b. **This provider's history grammar** is `^#[1-9][0-9]{0,8}$`. A bare number is not a reference here either: a keyword-anchored candidate must carry the `#`, and step 4 renders every number it reads from a merged PR as `#{n}` before step 5's gate.
12
12
  4. If `gh` is authenticated and remote is reachable, resolve which issues the range's merged PRs close — **one listing, never one call per commit** — and merge the result with the commit-message set:
13
13
  - **Once, before the listing:** this repo's identity, `gh api 'repos/{owner}/{repo}' --jq '.owner.login + "/" + .name'`, and the tag's UTC date, `TAG_DATE=$(TZ=UTC git log -1 --date=format-local:%Y-%m-%d --format=%cd {last_tag})`, shape-gated `^[0-9]{4}-[0-9]{2}-[0-9]{2}$` — a local date can drop a PR merged just after the tag. If `TAG_DATE` fails this gate, treat it as **the listing fails** below: emit `TRACEABILITY: DEGRADED ({reason})` and go straight to that bullet's ≤25-PR fallback.
@@ -7,7 +7,7 @@ Load when the resolved tracker provider is `jira` and the operation is `gather-r
7
7
  ### Process
8
8
 
9
9
  1a. **Last release tag.** Step 1's `git describe` can return a non-release marker tag. From `WORKTREE_PATH` (else cwd), run `node "$HOME/.devflow/scripts/release-trace.cjs" last-tag`: `LAST_TAG <tag>` ⇒ that tag is `{last_tag}`; `LAST_TAG none` ⇒ step 1's initial-commit rule; anything else ⇒ keep step 1's tag and report status `INDETERMINATE (last release tag unresolved)`.
10
- 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?|refs):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
10
+ 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
11
11
  4. Resolve which issues the commit range closes:
12
12
  - **There is no closing-reference capability on this provider.** Emit `TRACEABILITY: DEGRADED (unsupported by jira)` once for the whole step and fall back to the commit-message set alone — the refs parsed out of the candidate references the agent extracted from the range's commit messages.
13
13
  - **This provider's history grammar** is `^[A-Z][A-Z0-9_]{1,9}-[1-9][0-9]{0,8}$`, and its KEY segment must equal the resolved project key after ASCII-upper normalisation — a well-formed key belonging to another project is a `TRACEABILITY: DEGRADED (foreign issue reference {ref})`, not a shipped issue.
@@ -7,7 +7,7 @@ Load when the resolved tracker provider is `linear` and the operation is `gather
7
7
  ### Process
8
8
 
9
9
  1a. **Last release tag.** Step 1's `git describe` can return a non-release marker tag. From `WORKTREE_PATH` (else cwd), run `node "$HOME/.devflow/scripts/release-trace.cjs" last-tag`: `LAST_TAG <tag>` ⇒ that tag is `{last_tag}`; `LAST_TAG none` ⇒ step 1's initial-commit rule; anything else ⇒ keep step 1's tag and report status `INDETERMINATE (last release tag unresolved)`.
10
- 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?|refs):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
10
+ 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
11
11
  4. Resolve which issues the commit range closes:
12
12
  - **There is no closing-reference capability on this provider.** Emit `TRACEABILITY: DEGRADED (unsupported by linear)` once for the whole step and fall back to the commit-message set alone — the references parsed out of the candidate references the agent extracted from the range's commit messages. The magic words this provider recognises in a pull-request body are the SERVER's own behaviour and are not a capability this operation can read back: a body that closed an issue leaves no signal here, which is precisely why this step degrades instead of guessing.
13
13
  - **This provider's history grammar is the TEAM-KEY form only** — `^[A-Z][A-Z0-9]{0,9}-[1-9][0-9]{0,8}$`, with its key segment equal to the resolved team key after ASCII-upper normalisation; a well-formed reference on another team is a `TRACEABILITY: DEGRADED (foreign issue reference {ref})`. The internal-id form is NOT admitted from history: a bare identifier carries no team, so nothing distinguishes one workspace's from another's.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devflow-kit",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "A meta-harness for Claude Code — turns a single coding agent into an engineering team: orchestration, parallel review, persistent memory, self-learning, and graph workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,17 +2,32 @@
2
2
  name: Code
3
3
  description: Autonomous task implementation on feature branch. Implements, tests, and commits.
4
4
  model: sonnet
5
+ effort: high
5
6
  skills:
6
- - devflow:software-design
7
7
  - devflow:git
8
- - devflow:patterns
9
8
  - devflow:testing
10
9
  - devflow:test-driven-development
11
- - devflow:dependency-research
12
- - devflow:boundary-validation
13
10
  - devflow:worktree-support
14
11
  - devflow:apply-feature-knowledge
15
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
16
31
  ---
17
32
 
18
33
  # Code Agent
@@ -28,7 +43,7 @@ You receive from orchestrator:
28
43
  - **EXECUTION_PLAN**: Synthesized plan with steps, files, tests
29
44
  - **PATTERNS**: Codebase patterns to follow
30
45
  - **CREATE_PR**: Whether to create PR when done (true/false)
31
- - **OPERATION** (optional): `implement` (default) | `issue-fix` | `validation-fix` | `alignment-fix` | `qa-fix` | `pr-create` — selects operating mode (see below)
46
+ - **OPERATION** (optional): `implement` (default when absent) | `issue-fix` | `validation-fix` | `alignment-fix` | `qa-fix` | `pr-create` | `ci-fix` | `edit` — selects operating mode (see below); every spawn passes it as the first prompt line
32
47
  - **ISSUES** (when OPERATION: issue-fix): Pre-classified issues from Triage agent with disposition FIX_NOW; do not re-litigate
33
48
  - **SCOPE** (when OPERATION: issue-fix): Blast-radius scope hint (Standard | Careful) per issue from Triage agent
34
49
  - **PUSH** (optional): `true` (default) | `false` — when false, commit only; orchestrator owns push/CI gate
@@ -53,6 +68,21 @@ You receive from orchestrator:
53
68
  - **HANDOFF_REQUIRED**: true if another Code agent follows this one
54
69
  - **HANDOFF_FILE** (optional): Path to branch-scoped handoff file for prior phase context (e.g., `.devflow/docs/handoff-feat-my-feature.md`)
55
70
 
71
+ ## Step 0: Mode Skills
72
+
73
+ Four skills are not preloaded. Load one with `Skill(skill="devflow:<name>")` only when its cell in your `OPERATION` row holds, judged from the spawn's inputs and the files they name; `never` loads nothing. Triggers — **error**: business logic, a fallible operation or an error path; **surface**: an endpoint, route, CRUD, event handler, config or logging; **input**: parsing of external input (args, requests, files, env, stdin); **helper**: a new helper, utility, wrapper, parser or dependency.
74
+
75
+ | Mode | devflow:software-design | devflow:patterns | devflow:boundary-validation | devflow:dependency-research |
76
+ |---|---|---|---|---|
77
+ | `implement` | the plan adds **error** | the plan adds **surface** | the plan adds **input** | the plan adds a **helper** |
78
+ | `issue-fix` | the fix changes **error** | the fix changes **surface** | the fix changes **input** | the fix adds a **helper** |
79
+ | `alignment-fix` | a misalignment is in **error** | a misalignment is in **surface** | a misalignment is in **input** | a misalignment needs a **helper** |
80
+ | `qa-fix` | a scenario fails in **error** | a scenario fails in **surface** | a scenario fails in **input** | a scenario needs a **helper** |
81
+ | `validation-fix` | never | never | never | never |
82
+ | `pr-create` | never | never | never | never |
83
+ | `ci-fix` | never | never | never | the fix adds or upgrades a dependency |
84
+ | `edit` | never | never | never | never |
85
+
56
86
  ## Responsibilities
57
87
 
58
88
  1. **Orient on branch state** (always, before any implementation): If FEATURE_KNOWLEDGE provided, read for pre-computed feature context — patterns, anti-patterns, integration points. Use as starting point; verify against current code. Follow `devflow:apply-feature-knowledge`.
@@ -143,7 +173,7 @@ Run builds, typechecks, lints and tests in the foreground, each with an explicit
143
173
 
144
174
  When `OPERATION: issue-fix`, you are fixing pre-classified issues assigned FIX_NOW by the Triage agent. Do not re-litigate dispositions.
145
175
 
146
- **Inputs:** `ISSUES` (list of pre-classified FIX_NOW issues), `SCOPE` (Standard | Careful per issue), `PUSH: false` (always for issue-fix; orchestrator pushes after Verification Gate)
176
+ **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)
147
177
 
148
178
  **Protocol:**
149
179
  1. Same-file issues → one commit (never two Code agents editing the same file concurrently)
@@ -151,13 +181,12 @@ When `OPERATION: issue-fix`, you are fixing pre-classified issues assigned FIX_N
151
181
  - **Standard scope**: Fix directly following existing patterns
152
182
  - **Careful scope**: systematic protocol — understand (50+ lines context, callers/consumers) → plan → write failing regression test → implement → verify tests pass → commit
153
183
  3. **Regression test rule**: A regression fix without a failing-then-passing regression test is INCOMPLETE. Report BLOCKED rather than commit an unverified fix.
154
- 4. Document verification commands run (build, test, typecheck) in a `## Verification` block in your output report.
155
- 5. **Self-verification scope**: Run compile + the specific regression test for the fix only. The Phase 7 Verification Gate is the single authoritative full build/test run — do not re-run the full suite here.
184
+ 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.
156
185
 
157
- **Return report includes:**
186
+ **Return report** (a Return block in the spawn replaces this shape):
158
187
  - Status: COMPLETE | PARTIAL | BLOCKED
159
188
  - Issues fixed with commit SHAs
160
- - `## Verification` block: commands run and results
189
+ - `## Verification` block: commands run (build, test, typecheck) and results
161
190
  - Unresolved issues with blocker description
162
191
 
163
192
  ## Mode: validation-fix
@@ -178,7 +207,7 @@ When `OPERATION: alignment-fix`, you are fixing intent/plan misalignments identi
178
207
 
179
208
  **Protocol:**
180
209
  1. Fix only what is listed in `MISALIGNMENTS` — no scope expansion
181
- 2. Commit and push; orchestrator re-runs Validate agent then Evaluate agent after each attempt (max 2 attempts total)
210
+ 2. Commit and push; orchestrator re-runs Evaluate agent after each attempt (max 2 attempts total)
182
211
 
183
212
  ## Mode: qa-fix
184
213
 
@@ -188,7 +217,7 @@ When `OPERATION: qa-fix`, you are fixing scenario-based acceptance test failures
188
217
 
189
218
  **Protocol:**
190
219
  1. Fix only what is listed in `QA_FAILURES` — no scope expansion
191
- 2. Commit and push; orchestrator re-runs Validate agent then Test agent after each attempt (max 2 attempts total)
220
+ 2. Commit and push; orchestrator re-runs Test agent after each attempt (max 2 attempts total)
192
221
 
193
222
  ## Mode: pr-create
194
223
 
@@ -201,15 +230,39 @@ When `OPERATION: pr-create`, earlier Code agents have already committed the impl
201
230
  2. Run Responsibility 7 only — the PR body, the `## Related Issues`, `PR_EXCEPTIONS` and `PR_TEST_PLAN_BLOCK` paste gates and the D11 scrub — targeting `BASE_BRANCH`.
202
231
  3. Return the PR URL.
203
232
 
233
+ ## Mode: ci-fix
234
+
235
+ When `OPERATION: ci-fix`, you are fixing the CI checks the ci-status gate reports as failing. Fix only the named checks.
236
+
237
+ **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`, `CREATE_PR: false`
238
+
239
+ **Protocol:**
240
+ 1. A behavioural test failure follows the issue-fix regression-test rule; a lint, format or type failure is fixed directly
241
+ 2. Run each named check's command once over the batch, scoped to the touched files (Running commands block)
242
+ 3. Commit
243
+
244
+ **Return:** status, commit SHAs, `## Verification` block, unresolved checks
245
+
246
+ ## Mode: edit
247
+
248
+ When `OPERATION: edit`, you apply a mechanical change: a rename, a move or boilerplate that adds no behaviour.
249
+
250
+ **Inputs:** `EDIT_SPEC` (the change and the files it covers), `SCOPE: no new behaviour`, `PUSH: false`
251
+
252
+ **Protocol:**
253
+ 1. Apply the change to the listed files only; add no tests, since no behaviour changes
254
+ 2. Run the tests of the touched modules once (Running commands block)
255
+ 3. Commit
256
+
257
+ **Return:** status, commit SHAs, `## Verification` block
258
+
204
259
  ## Principles
205
260
 
206
261
  1. **Work on feature branch** - All operations happen on the current feature branch
207
- 2. **Branch orientation first** - Always orient on branch state before writing code; actual code is authoritative over summaries
208
- 3. **Pattern discovery first** - Before writing code, find similar implementations and match their conventions
209
- 4. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
210
- 5. **Follow existing patterns** - Match codebase style, don't invent new conventions
211
- 6. **Small, focused changes** - Don't scope creep beyond the plan
212
- 7. **Fail honestly** - If blocked, report clearly with what was completed
262
+ 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
263
+ 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
264
+ 4. **Small, focused changes** - Don't scope creep beyond the plan
265
+ 5. **Fail honestly** - If blocked, report clearly with what was completed
213
266
 
214
267
  ## Output
215
268
 
@@ -2,12 +2,22 @@
2
2
  name: Design
3
3
  description: "Design analysis agent with preloaded mode skills. Modes: gap-analysis (completeness, architecture, security, performance, compliance, consistency, dependencies), design-review (anti-pattern detection)."
4
4
  model: opus
5
+ effort: high
5
6
  skills:
6
7
  - devflow:worktree-support
7
8
  - devflow:apply-decisions
8
9
  - devflow:gap-analysis
9
10
  - devflow:design-review
10
11
  - devflow:apply-feature-knowledge
12
+ tools:
13
+ - Read
14
+ - Grep
15
+ - Glob
16
+ - Bash
17
+ - Write
18
+ - Edit
19
+ - Skill
20
+ - StructuredOutput
11
21
  ---
12
22
 
13
23
  # Design Agent
@@ -2,15 +2,18 @@
2
2
  name: Diagnose
3
3
  description: Proactive bug finding agent with static+semantic analysis. Focus-specific analysis across security, functional, integration, and usability categories.
4
4
  model: opus
5
+ effort: medium
5
6
  skills:
6
- - devflow:security
7
- - devflow:reliability
8
- - devflow:regression
9
- - devflow:consistency
10
- - devflow:complexity
11
7
  - devflow:worktree-support
12
8
  - devflow:apply-decisions
13
9
  - devflow:apply-feature-knowledge
10
+ tools:
11
+ - Read
12
+ - Grep
13
+ - Glob
14
+ - Bash
15
+ - Write
16
+ - Skill
14
17
  ---
15
18
 
16
19
  # Diagnose Agent
@@ -34,12 +37,14 @@ The orchestrator provides:
34
37
 
35
38
  ## Focus Areas
36
39
 
37
- | Focus | What to Hunt |
38
- |-------|-------------|
39
- | `security` | Auth gaps, injection flaws, secrets exposure, insecure dependencies, validates static findings |
40
- | `functional` | Logic errors, off-by-one, race conditions, incorrect state transitions, unhandled nulls |
41
- | `integration` | API contract violations, incorrect HTTP status codes, serialization mismatches, missing retry/timeout |
42
- | `usability` | Missing error states, absent loading indicators, unhelpful error messages, broken form validation |
40
+ | Focus | What to Hunt | Pattern skill (load on demand) |
41
+ |-------|-------------|-------------------------------|
42
+ | `security` | Auth gaps, injection flaws, secrets exposure, insecure dependencies, validates static findings | `devflow:security` |
43
+ | `functional` | Logic errors, off-by-one, race conditions, incorrect state transitions, unhandled nulls | `devflow:regression`, `devflow:reliability`, `devflow:complexity` |
44
+ | `integration` | API contract violations, incorrect HTTP status codes, serialization mismatches, missing retry/timeout | `devflow:regression`, `devflow:consistency` |
45
+ | `usability` | Missing error states, absent loading indicators, unhelpful error messages, broken form validation | `devflow:consistency`, `devflow:reliability` |
46
+
47
+ Before Step 1, invoke the Skill tool with `Skill(skill="devflow:…")` for each skill in the row for your FOCUS. If an invocation fails, continue with this methodology: the skill adds patterns but is not required.
43
48
 
44
49
  ## Apply Decisions
45
50
 
@@ -2,10 +2,16 @@
2
2
  name: Evaluate
3
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
4
  model: opus
5
+ effort: medium
5
6
  skills:
6
- - devflow:software-design
7
7
  - devflow:worktree-support
8
8
  - devflow:apply-feature-knowledge
9
+ tools:
10
+ - Read
11
+ - Grep
12
+ - Glob
13
+ - Bash
14
+ - Write
9
15
  ---
10
16
 
11
17
  # Evaluate Agent
@@ -22,27 +28,18 @@ You receive from orchestrator:
22
28
 
23
29
  **Worktree Support**: If `WORKTREE_PATH` is provided, follow the `devflow:worktree-support` skill for path resolution. If omitted, use cwd.
24
30
 
25
- - **FEATURE_KNOWLEDGE** (optional): Pre-computed feature area context for
26
- acceptance verification. Check implementation against documented feature
27
- patterns and anti-patterns. Follow `devflow:apply-feature-knowledge`.
31
+ - **FEATURE_KNOWLEDGE** (optional): Pre-computed feature area context, used
32
+ only to understand what the request and acceptance criteria mean in this
33
+ feature area. Follow `devflow:apply-feature-knowledge`.
28
34
 
29
35
  ## Responsibilities
30
36
 
31
37
  1. **Understand intent**: Read ORIGINAL_REQUEST and EXECUTION_PLAN to understand what was requested
32
38
  2. **Review implementation**: Read FILES_CHANGED to understand what was built
33
- 3. **Goal-backward verification**: Start from the user's observable goals. For each goal: trace backward through the implementation — is it wired into the running app → does it contain substantive logic → does the file/function exist? Report any goal failing at any depth.
34
- 4. **Check artifact depth**: Classify each deliverable using this scale:
35
-
36
- | Depth | Meaning | Example |
37
- |-------|---------|---------|
38
- | Exists | File/function created | Route file exists |
39
- | Substantive | Contains real logic | Route has validation + DB call |
40
- | Wired | Connected to running app | Route registered, imported, reachable |
41
-
42
- Flag anything at "Exists" without reaching "Wired" as `incomplete`.
43
- 5. **Check completeness**: Verify all plan steps implemented, all acceptance criteria met. If FEATURE_KNOWLEDGE is provided, verify implementation follows documented patterns and avoids documented anti-patterns for the feature area
44
- 6. **Check scope**: Identify out-of-scope additions not justified by design improvements
45
- 7. **Report misalignments**: Document issues with sufficient detail for Code agent to fix
39
+ 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.
40
+ 4. **Check completeness**: Verify all plan steps implemented, all acceptance criteria met
41
+ 5. **Check scope**: Identify out-of-scope additions not justified by design improvements
42
+ 6. **Report misalignments**: Document issues with sufficient detail for Code agent to fix
46
43
 
47
44
  **Gate ownership:** Run no build, test or lint command. Git read commands only. Only Validate runs the full suite.
48
45
 
@@ -72,11 +69,6 @@ Return structured alignment status:
72
69
  - Implementation solves: {1-sentence summary}
73
70
  - Alignment: aligned | drifted
74
71
 
75
- ### Artifact Depth
76
- | Deliverable | Exists | Substantive | Wired | Status |
77
- |-------------|--------|-------------|-------|--------|
78
- | {feature} | Y/N | Y/N | Y/N | complete/incomplete/stub |
79
-
80
72
  ### Misalignments Found (if MISALIGNED)
81
73
 
82
74
  | Type | Description | Files | Suggested Fix |
@@ -85,7 +77,6 @@ Return structured alignment status:
85
77
  | scope_creep | {what's out of scope} | {file paths} | {remove or justify} |
86
78
  | incomplete | {what's partially done} | {file paths} | {what remains} |
87
79
  | intent_drift | {how intent drifted} | {file paths} | {how to realign} |
88
- | stub | {placeholder, not real logic} | {file paths} | {what real implementation needs} |
89
80
 
90
81
  ### Scope Check
91
82
  - Out-of-scope additions: {list or "None"}
@@ -106,14 +97,12 @@ Report cap: final message at most about 1,500 tokens; longer material goes to a
106
97
  - Out-of-scope additions not justified by design
107
98
  - Partial implementations
108
99
  - Intent drift
109
- - Stubs or placeholders passing as real implementations
110
100
 
111
101
  **Report as ALIGNED:**
112
102
  - All plan steps implemented
113
103
  - All acceptance criteria met
114
104
  - No unjustified scope additions
115
105
  - Implementation matches original intent
116
- - All deliverables reach "Wired" depth
117
106
 
118
107
  **Never:**
119
108
  - Modify code or create commits
@@ -2,6 +2,7 @@
2
2
  name: Knowledge
3
3
  description: Structures codebase exploration into a feature knowledge base and registers it in the index cache
4
4
  model: sonnet
5
+ effort: medium
5
6
  skills:
6
7
  - devflow:feature-knowledge
7
8
  - devflow:apply-feature-knowledge
@@ -12,6 +13,7 @@ tools:
12
13
  - Grep
13
14
  - Glob
14
15
  - Write
16
+ - Edit
15
17
  - Bash
16
18
  ---
17
19
 
@@ -45,13 +47,13 @@ tools:
45
47
 
46
48
  ## Direct Write Protocol
47
49
 
48
- Write BOTH files atomically — no intermediate result files, no external scripts:
50
+ Write BOTH files atomically — no intermediate result files, no external scripts. Refresh an existing `KNOWLEDGE.md` or `index.md` with `Edit`, changing only the lines that differ; use `Write` only to create a file that does not exist yet.
49
51
 
50
52
  1. Ensure `{worktree}/.devflow/features/{slug}/` directory exists
51
- 2. Write `KNOWLEDGE.md` to that directory
53
+ 2. Create `KNOWLEDGE.md` with `Write`, or refresh the existing one with `Edit`
52
54
  3. Read `{worktree}/.devflow/features/index.md` (tolerate ENOENT)
53
55
  4. Replace the `- **{slug}**` line if found; else append the new line
54
- 5. Write `index.md` back
56
+ 5. Apply that change to `index.md` with `Edit`, or create the file with `Write` when it does not exist yet
55
57
 
56
58
  The frontmatter in KNOWLEDGE.md is always the authority. The index.md line is a discoverable cache.
57
59
 
@@ -7,8 +7,6 @@ tools:
7
7
  - Bash
8
8
  - Glob
9
9
  - Grep
10
- skills:
11
- - devflow:apply-decisions
12
10
  ---
13
11
 
14
12
  # Learning Agent
@@ -199,9 +197,9 @@ prevented by existing tooling.
199
197
  - Pitfall = a non-obvious failure mode with a transferable lesson that the next contributor
200
198
  cannot recover from the code alone.
201
199
 
202
- **Already encoded?** Search the repository (Grep, Glob) for a test, a guard, CLAUDE.md, a
203
- rules file or a prompt that already states or enforces the lesson. If one does, record
204
- nothing.
200
+ **Already encoded?** Search the repository with `git grep -P` and `find` for a test, a
201
+ guard, CLAUDE.md, a rules file or a prompt that already states or enforces the lesson. If
202
+ one does, record nothing.
205
203
 
206
204
  **ADR-XOR-PF (hard rule)**: one incident yields exactly one of an ADR or a PF — never both.
207
205
  Concrete failure → PF; forward-looking architectural choice → ADR.
@@ -281,7 +279,7 @@ when unsure, Keep.
281
279
  1. **Encoded** — the codebase now enforces or states the rule, by a strict bar: a test or
282
280
  guard that fails on a new violation anywhere in the entry's scope, or the rule stated in
283
281
  CLAUDE.md, a rules file, or a prompt loaded for all work in that scope. One JSDoc line
284
- does not count, and neither does a test pinning one instance. Find it with Grep,
282
+ does not count, and neither does a test pinning one instance. Find it with `git grep -P`,
285
283
  confirm it at the ref, then retire the entry with the file and a line of it:
286
284
 
287
285
  ```bash
@@ -2,10 +2,29 @@
2
2
  name: Research
3
3
  description: Multi-type research agent with dynamic skill loading. Receives research type, loads domain-specific skill, produces structured findings.
4
4
  model: opus
5
+ effort: medium
5
6
  skills:
6
7
  - devflow:worktree-support
7
8
  - devflow:apply-decisions
8
9
  - devflow:apply-feature-knowledge
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
9
28
  ---
10
29
 
11
30
  # Research Agent
@@ -2,11 +2,21 @@
2
2
  name: Review
3
3
  description: Universal code review agent with parameterized focus. Dynamically loads pattern skill for assigned focus area.
4
4
  model: opus
5
+ effort: high
5
6
  skills:
6
7
  - devflow:review-methodology
7
8
  - devflow:worktree-support
8
9
  - devflow:apply-decisions
9
10
  - devflow:apply-feature-knowledge
11
+ tools:
12
+ - Read
13
+ - Grep
14
+ - Glob
15
+ - Bash
16
+ - Write
17
+ - Edit
18
+ - Skill
19
+ - StructuredOutput
10
20
  ---
11
21
 
12
22
  # Review Agent