devflow-kit 3.5.0 → 3.7.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 (146) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/README.md +10 -6
  3. package/dist/agents/code.md +7 -11
  4. package/dist/agents/{diagnose.md → debug.md} +4 -4
  5. package/dist/agents/{code-fix.md → fix.md} +7 -8
  6. package/dist/agents/{scrutinize.md → harden.md} +6 -6
  7. package/dist/agents/{code-edit.md → refactor.md} +8 -9
  8. package/dist/agents/review.md +2 -0
  9. package/dist/cli/agents-view/render.js +1 -1
  10. package/dist/cli/commands/gates.js +276 -0
  11. package/dist/cli/commands/init-seed.js +9 -1
  12. package/dist/cli/commands/init.js +34 -11
  13. package/dist/cli/commands/learning.js +12 -12
  14. package/dist/cli/commands/legacy-hooks.js +1 -1
  15. package/dist/cli/commands/memory.js +18 -0
  16. package/dist/cli/commands/uninstall.js +111 -5
  17. package/dist/cli.js +2 -0
  18. package/dist/commands/bug-analysis.md +21 -17
  19. package/dist/commands/code-review.md +65 -66
  20. package/dist/commands/debug.md +17 -17
  21. package/dist/commands/dynamic-build.md +104 -116
  22. package/dist/commands/dynamic-plan.md +13 -11
  23. package/dist/commands/dynamic-profile.md +9 -7
  24. package/dist/commands/dynamic-tickets.md +13 -11
  25. package/dist/commands/explore.md +15 -15
  26. package/dist/commands/implement.md +80 -154
  27. package/dist/commands/plan.md +34 -66
  28. package/dist/commands/release.md +11 -7
  29. package/dist/commands/research.md +14 -10
  30. package/dist/commands/resolve.md +44 -88
  31. package/dist/commands/self-review.md +44 -44
  32. package/dist/core/agent-models.js +47 -11
  33. package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
  34. package/dist/core/echo-value.js +42 -0
  35. package/dist/core/evidence-policy.js +17 -5
  36. package/dist/core/gate-level.js +213 -0
  37. package/dist/core/learning-queue-cleanup.js +1 -1
  38. package/dist/core/manifest.js +26 -10
  39. package/dist/core/migrations.js +63 -44
  40. package/dist/core/model-discovery.js +7 -1
  41. package/dist/core/plugins.js +14 -12
  42. package/dist/core/project-paths.js +3 -3
  43. package/dist/core/tracker.js +5 -33
  44. package/dist/hud/codex-usage.js +247 -0
  45. package/dist/hud/components/codex-quota.js +37 -0
  46. package/dist/hud/components/usage-quota.js +1 -1
  47. package/dist/hud/config.js +1 -0
  48. package/dist/hud/index.js +16 -3
  49. package/dist/hud/render.js +3 -1
  50. package/dist/learning-off/agents/code.md +7 -11
  51. package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
  52. package/dist/learning-off/agents/{code-fix.md → fix.md} +7 -8
  53. package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
  54. package/dist/learning-off/agents/{code-edit.md → refactor.md} +8 -9
  55. package/dist/learning-off/agents/review.md +2 -0
  56. package/dist/learning-off/commands/bug-analysis.md +9 -9
  57. package/dist/learning-off/commands/code-review.md +54 -59
  58. package/dist/learning-off/commands/debug.md +6 -10
  59. package/dist/learning-off/commands/dynamic-build.md +98 -112
  60. package/dist/learning-off/commands/dynamic-plan.md +5 -5
  61. package/dist/learning-off/commands/dynamic-profile.md +1 -1
  62. package/dist/learning-off/commands/dynamic-tickets.md +5 -5
  63. package/dist/learning-off/commands/explore.md +4 -8
  64. package/dist/learning-off/commands/implement.md +68 -146
  65. package/dist/learning-off/commands/plan.md +23 -58
  66. package/dist/learning-off/commands/release.md +4 -2
  67. package/dist/learning-off/commands/research.md +2 -2
  68. package/dist/learning-off/commands/resolve.md +33 -81
  69. package/dist/learning-off/commands/self-review.md +32 -36
  70. package/dist/skills/git/references/pr/check-merge-readiness.md +2 -0
  71. package/dist/skills/git/references/pr/update-pr-evidence.md +4 -6
  72. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +7 -9
  73. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +7 -15
  74. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +7 -15
  75. package/dist/targets/claude-code/installer.js +117 -84
  76. package/dist/targets/claude-code/learning-install.js +15 -3
  77. package/dist/targets/claude-code/tracker-servers.js +1 -1
  78. package/package.json +1 -1
  79. package/src/assets/agents/_partials/_code.mds +7 -8
  80. package/src/assets/agents/code.mds +4 -7
  81. package/src/assets/agents/{learning.md → curate.md} +8 -10
  82. package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
  83. package/src/assets/agents/evaluate.md +4 -4
  84. package/src/assets/agents/{code-fix.mds → fix.mds} +5 -5
  85. package/src/assets/agents/{scrutinize.mds → harden.mds} +6 -6
  86. package/src/assets/agents/{simplify.md → polish.md} +4 -4
  87. package/src/assets/agents/{code-edit.mds → refactor.mds} +6 -6
  88. package/src/assets/agents/review.mds +2 -0
  89. package/src/assets/agents/synthesize.md +2 -2
  90. package/src/assets/agents/test.md +2 -2
  91. package/src/assets/commands/_partials/_compliance.mds +1 -1
  92. package/src/assets/commands/_partials/_decisions.mds +26 -6
  93. package/src/assets/commands/_partials/_engine.mds +15 -15
  94. package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
  95. package/src/assets/commands/_partials/_knowledge.mds +14 -9
  96. package/src/assets/commands/_partials/_preamble.mds +4 -2
  97. package/src/assets/commands/_partials/_roster.mds +4 -4
  98. package/src/assets/commands/_partials/_settings.mds +2 -2
  99. package/src/assets/commands/_partials/_wave.mds +10 -17
  100. package/src/assets/commands/bug-analysis.mds +7 -7
  101. package/src/assets/commands/code-review.mds +51 -56
  102. package/src/assets/commands/debug.mds +2 -2
  103. package/src/assets/commands/dynamic-build.mds +67 -74
  104. package/src/assets/commands/implement.mds +65 -127
  105. package/src/assets/commands/plan.mds +21 -61
  106. package/src/assets/commands/release.mds +5 -1
  107. package/src/assets/commands/resolve.mds +28 -76
  108. package/src/assets/commands/self-review.mds +27 -27
  109. package/src/assets/mds/git/_ops_steps.mds +3 -3
  110. package/src/assets/mds/git/_pr.mds +6 -6
  111. package/src/assets/mds/tracker/_common.mds +23 -12
  112. package/src/assets/mds/tracker/_github.mds +2 -9
  113. package/src/assets/mds/tracker/_jira.mds +2 -15
  114. package/src/assets/mds/tracker/_linear.mds +2 -15
  115. package/src/assets/scripts/ci-wait.cjs +22 -4
  116. package/src/assets/scripts/claude-md-audit.cjs +66 -51
  117. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
  118. package/src/assets/scripts/hooks/background-memory-update +404 -95
  119. package/src/assets/scripts/hooks/capture-prompt +1 -1
  120. package/src/assets/scripts/hooks/capture-question +1 -1
  121. package/src/assets/scripts/hooks/capture-turn +1 -1
  122. package/src/assets/scripts/hooks/json-helper.cjs +13 -2
  123. package/src/assets/scripts/hooks/json-parse +18 -3
  124. package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
  125. package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -4
  126. package/src/assets/scripts/hooks/memory-permission +358 -0
  127. package/src/assets/scripts/hooks/preamble +1 -1
  128. package/src/assets/scripts/hooks/session-start-context +60 -47
  129. package/src/assets/scripts/hooks/session-start-memory +26 -5
  130. package/src/assets/scripts/lib/project-config.cjs +19 -4
  131. package/src/assets/scripts/resolve-settings.cjs +200 -32
  132. package/src/assets/scripts/verify-evidence.cjs +726 -9
  133. package/src/assets/skills/agent-references/SKILL.md +14 -6
  134. package/src/assets/skills/agent-references/references/commands/code-review-levels.md +19 -0
  135. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
  136. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
  137. package/src/assets/skills/agent-references/references/commands/plan-levels.md +40 -0
  138. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
  139. package/src/assets/skills/agent-references/references/synthesize/planning.md +9 -22
  140. package/src/assets/skills/agent-references/references/synthesize/review.md +11 -11
  141. package/src/assets/skills/apply-decisions/SKILL.md +6 -4
  142. package/src/assets/skills/docs-framework/SKILL.md +3 -3
  143. package/src/assets/skills/qa/SKILL.md +1 -1
  144. package/src/assets/skills/quality-gates/SKILL.md +7 -7
  145. package/src/assets/skills/quality-gates/references/report-template.md +7 -7
  146. /package/src/assets/skills/agent-references/references/{learning → curate}/maintain.md +0 -0
package/dist/hud/index.js CHANGED
@@ -4,6 +4,7 @@ import { homedir } from 'node:os';
4
4
  import { readStdin } from './stdin.js';
5
5
  import { loadConfig, resolveComponents } from './config.js';
6
6
  import { gatherGitStatus } from './git.js';
7
+ import { codexSessionsDir, gatherCodexUsage } from './codex-usage.js';
7
8
  import { parseTranscript } from './transcript.js';
8
9
  import { persistSessionCost, aggregateCosts } from './cost-history.js';
9
10
  import { gatherConfigCounts } from './components/config-counts.js';
@@ -36,7 +37,10 @@ function extractUsageFromStdin(stdin) {
36
37
  };
37
38
  }
38
39
  async function main() {
39
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('timeout')), OVERALL_TIMEOUT));
40
+ let timer;
41
+ const timeoutPromise = new Promise((_, reject) => {
42
+ timer = setTimeout(() => reject(new Error('timeout')), OVERALL_TIMEOUT);
43
+ });
40
44
  try {
41
45
  const result = await Promise.race([run(), timeoutPromise]);
42
46
  process.stdout.write(result);
@@ -44,6 +48,11 @@ async function main() {
44
48
  catch {
45
49
  // Timeout or error — output nothing (graceful degradation)
46
50
  }
51
+ finally {
52
+ // A live timer would keep node running for the rest of the budget after the
53
+ // line is printed, delaying every status-line render by about 2 s.
54
+ clearTimeout(timer);
55
+ }
47
56
  }
48
57
  async function run() {
49
58
  const stdin = await readStdin();
@@ -56,7 +65,8 @@ async function run() {
56
65
  const components = new Set(resolved);
57
66
  const cwd = stdin.cwd || process.cwd();
58
67
  // D-ONE-HOME: always $HOME/.devflow — no environment variable relocates it.
59
- const devflowDir = path.join(process.env.HOME || homedir(), '.devflow');
68
+ const home = process.env.HOME || homedir();
69
+ const devflowDir = path.join(home, '.devflow');
60
70
  // Determine what data to gather based on enabled components
61
71
  const needsGit = components.has('gitBranch') ||
62
72
  components.has('gitAheadBehind') ||
@@ -67,15 +77,17 @@ async function run() {
67
77
  components.has('configCounts');
68
78
  const needsConfigCounts = components.has('configCounts');
69
79
  const needsLearningCounts = components.has('learningCounts');
80
+ const needsCodexUsage = components.has('codexQuota');
70
81
  const needsSessionCost = components.has('sessionCost');
71
82
  // Parallel data gathering — only fetch what's needed. The learning counts
72
83
  // ride here because resolving the ledger root is one git call.
73
- const [git, transcript, learningCountsData] = await Promise.all([
84
+ const [git, transcript, learningCountsData, codexUsage] = await Promise.all([
74
85
  needsGit ? gatherGitStatus(cwd) : Promise.resolve(null),
75
86
  needsTranscript && stdin.transcript_path
76
87
  ? parseTranscript(stdin.transcript_path)
77
88
  : Promise.resolve(null),
78
89
  needsLearningCounts ? gatherLedgerLearningCounts(cwd) : Promise.resolve(null),
90
+ needsCodexUsage ? gatherCodexUsage(devflowDir, codexSessionsDir(home)) : Promise.resolve(null),
79
91
  ]);
80
92
  // Extract usage quota from stdin rate_limits (replaces OAuth fetch)
81
93
  const usage = components.has('usageQuota') ? extractUsageFromStdin(stdin) : null;
@@ -108,6 +120,7 @@ async function run() {
108
120
  git,
109
121
  transcript,
110
122
  usage,
123
+ codexUsage,
111
124
  configCounts: configCountsData,
112
125
  learningCounts: learningCountsData,
113
126
  costHistory,
@@ -8,6 +8,7 @@ import contextUsage from './components/context-usage.js';
8
8
  import versionBadge from './components/version-badge.js';
9
9
  import sessionDuration from './components/session-duration.js';
10
10
  import usageQuota from './components/usage-quota.js';
11
+ import codexQuota from './components/codex-quota.js';
11
12
  import todoProgress from './components/todo-progress.js';
12
13
  import configCounts from './components/config-counts.js';
13
14
  import learningCounts from './components/learning-counts.js';
@@ -24,6 +25,7 @@ const COMPONENT_MAP = {
24
25
  versionBadge,
25
26
  sessionDuration,
26
27
  usageQuota,
28
+ codexQuota,
27
29
  todoProgress,
28
30
  configCounts,
29
31
  learningCounts,
@@ -37,7 +39,7 @@ const COMPONENT_MAP = {
37
39
  */
38
40
  const LINE_GROUPS = [
39
41
  ['directory', 'gitBranch', 'gitAheadBehind', 'releaseInfo', 'worktreeCount', 'diffStats'],
40
- ['contextUsage', 'usageQuota', 'todoProgress'],
42
+ ['contextUsage', 'usageQuota', 'codexQuota', 'todoProgress'],
41
43
  ['model', 'configCounts', 'sessionCost'],
42
44
  ['learningCounts'],
43
45
  ['versionBadge'],
@@ -63,7 +63,7 @@ You receive from orchestrator:
63
63
  - Cross-reference changed files against EXECUTION_PLAN to identify what's relevant to your task
64
64
  - Read those relevant files to understand interfaces, types, naming conventions, error handling, and testing patterns established by prior work
65
65
  - If PRIOR_PHASE_SUMMARY is provided, use it to validate your understanding — actual code is authoritative, summaries are supplementary
66
- - 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.
66
+ - 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.
67
67
 
68
68
  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.
69
69
 
@@ -89,7 +89,6 @@ When `OPERATION: issue-fix`, you are fixing pre-classified issues assigned FIX_N
89
89
  - **Standard scope**: Fix directly following existing patterns
90
90
  - **Careful scope**: systematic protocol — understand (50+ lines context, callers/consumers) → plan → write failing regression test → implement → verify tests pass → commit
91
91
  3. **Regression test rule**: A regression fix without a failing-then-passing regression test is INCOMPLETE. Report BLOCKED rather than commit an unverified fix.
92
- 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.
93
92
 
94
93
  **Return report** (a Return block in the spawn replaces this shape):
95
94
  - Status: COMPLETE | PARTIAL | BLOCKED
@@ -116,9 +115,7 @@ When `OPERATION: issue-fix`, you are fixing pre-classified issues assigned FIX_N
116
115
  - {Decision with rationale}
117
116
 
118
117
  ### Integration Points for Next Phase
119
- - {Interfaces to implement against}
120
- - {Functions to call}
121
- - {Types to import}
118
+ - `path:line` of each interface, function or type the next phase builds on
122
119
  ```
123
120
 
124
121
  ## Running commands
@@ -136,11 +133,11 @@ Run builds, typechecks, lints and tests in the foreground, each with an explicit
136
133
 
137
134
  ## Principles
138
135
 
139
- 1. **Work on feature branch** - All operations happen on the current feature branch
140
- 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
141
- 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
142
- 4. **Small, focused changes** - Don't scope creep beyond the plan
143
- 5. **Fail honestly** - If blocked, report clearly with what was completed
136
+ 1. **Read once** - Never re-read an unchanged file. For a file over 400 lines, or a second look, `grep -n` first, then Read only that range (`offset`, `limit`)
137
+ 2. **Small, focused changes** - Don't scope creep beyond the plan
138
+ 3. **Fail honestly** - If blocked, report clearly with what was completed
139
+
140
+ - 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.
144
141
 
145
142
  ## Output
146
143
 
@@ -180,4 +177,3 @@ Report cap: final message at most about 1,500 tokens; longer material goes to a
180
177
  - Switch branches during implementation
181
178
  - Push to branches other than your feature branch
182
179
  - Merge PRs (orchestrator handles this)
183
- - Trust handoff summaries without reading actual code
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: Diagnose
3
- description: Proactive bug finding agent with static+semantic analysis. Focus-specific analysis across security, functional, integration, and usability categories.
2
+ name: Debug
3
+ description: Proactive bug finding agent with static+semantic analysis. Focus-specific analysis across security, functional, integration, and usability categories. The /bug-analysis command spawns it. It is not the /debug command.
4
4
  model: opus
5
5
  effort: medium
6
6
  skills:
@@ -15,7 +15,7 @@ tools:
15
15
  - Skill
16
16
  ---
17
17
 
18
- # Diagnose Agent
18
+ # Debug Agent
19
19
 
20
20
  You are a proactive bug finding agent. Your focus area is specified in the prompt. You hunt for real bugs — not style issues — using a 5-step methodology that combines static analysis findings with semantic code understanding.
21
21
 
@@ -111,7 +111,7 @@ Assign to each verified finding:
111
111
 
112
112
  **Category mapping** (for `/resolve` compatibility — severity-based approximation):
113
113
 
114
- > **Trade-off**: The Review agent uses location-based categories (lines you added / lines you touched / unchanged lines). The Diagnose agent focuses on diff-changed code and lacks per-line location context, so it approximates using severity as a proxy. This means a LOW-severity bug in newly-added code is placed in Pre-existing — not because it predates the change, but to signal lower urgency. The resolve pipeline should treat Pre-existing findings from the Diagnose agent as low-urgency, not as assertions about code origin.
114
+ > **Trade-off**: The Review agent uses location-based categories (lines you added / lines you touched / unchanged lines). The Debug agent focuses on diff-changed code and lacks per-line location context, so it approximates using severity as a proxy. This means a LOW-severity bug in newly-added code is placed in Pre-existing — not because it predates the change, but to signal lower urgency. The resolve pipeline should treat Pre-existing findings from the Debug agent as low-urgency, not as assertions about code origin.
115
115
 
116
116
  - CRITICAL / HIGH severity → `## Issues in Your Changes (BLOCKING)` — must fix before merge
117
117
  - MEDIUM severity → `## Issues in Code You Touched (Should Fix)` — fix while here
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: Code-fix
2
+ name: Fix
3
3
  description: Autonomous gate-failure repair on feature branch. Fixes the listed validation, alignment, QA or CI failures, verifies, and commits.
4
4
  model: sonnet
5
5
  effort: high
@@ -27,7 +27,7 @@ disallowedTools:
27
27
  - DesignSync
28
28
  ---
29
29
 
30
- # Code-fix Agent
30
+ # Fix Agent
31
31
 
32
32
  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.
33
33
 
@@ -114,11 +114,11 @@ Run builds, typechecks, lints and tests in the foreground, each with an explicit
114
114
 
115
115
  ## Principles
116
116
 
117
- 1. **Work on feature branch** - All operations happen on the current feature branch
118
- 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
119
- 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
120
- 4. **Small, focused changes** - Don't scope creep beyond the plan
121
- 5. **Fail honestly** - If blocked, report clearly with what was completed
117
+ 1. **Read once** - Never re-read an unchanged file. For a file over 400 lines, or a second look, `grep -n` first, then Read only that range (`offset`, `limit`)
118
+ 2. **Small, focused changes** - Don't scope creep beyond the plan
119
+ 3. **Fail honestly** - If blocked, report clearly with what was completed
120
+
121
+ - 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.
122
122
 
123
123
  ## Output
124
124
 
@@ -158,4 +158,3 @@ Report cap: final message at most about 1,500 tokens; longer material goes to a
158
158
  - Switch branches during implementation
159
159
  - Push to branches other than your feature branch
160
160
  - Merge PRs (orchestrator handles this)
161
- - Trust handoff summaries without reading actual code
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: Scrutinize
2
+ name: Harden
3
3
  description: Self-review agent that evaluates and fixes implementation issues using 9-pillar framework. Runs in fresh context after Code agent completes.
4
4
  model: opus
5
5
  effort: medium
@@ -30,9 +30,9 @@ disallowedTools:
30
30
  - mcp__*
31
31
  ---
32
32
 
33
- # Scrutinize Agent
33
+ # Harden Agent
34
34
 
35
- You are a meticulous self-review specialist. You evaluate implementations against the 9-pillar quality framework and fix the issues you find. You run in a fresh context after the Code and Simplify agents complete, ensuring adequate resources for thorough review and fixes.
35
+ You are a meticulous self-review specialist. You evaluate implementations against the 9-pillar quality framework and fix the issues you find. You run in a fresh context after the Code and Polish agents complete, ensuring adequate resources for thorough review and fixes.
36
36
 
37
37
  ## Input Context
38
38
 
@@ -53,7 +53,7 @@ You receive from orchestrator:
53
53
 
54
54
  4. **Evaluate P1 pillars** (Complexity, Error Handling, Tests): These SHOULD pass. Fix all issues found.
55
55
 
56
- 5. **Evaluate P2** (Documentation): Fix if straightforward. Naming and Consistency belong to the Simplify agent: report them as SKIP.
56
+ 5. **Evaluate P2** (Documentation): Fix if straightforward. Naming and Consistency belong to the Polish agent: report them as SKIP.
57
57
 
58
58
  6. **Commit fixes**: If any changes were made, create a commit with message "fix: address self-review issues".
59
59
 
@@ -91,8 +91,8 @@ Return structured completion status:
91
91
  - Tests: PASS | FIXED (description)
92
92
 
93
93
  ### P2 Pillars
94
- - Naming: SKIP (Simplify agent)
95
- - Consistency: SKIP (Simplify agent)
94
+ - Naming: SKIP (Polish agent)
95
+ - Consistency: SKIP (Polish agent)
96
96
  - Documentation: PASS | FIXED (description)
97
97
 
98
98
  ### Files Modified
@@ -1,6 +1,6 @@
1
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.
2
+ name: Refactor
3
+ description: Autonomous mechanical edit on feature branch. Makes a given rename, move or boilerplate change and commits. For judgment-based cleanup use Polish.
4
4
  model: sonnet
5
5
  effort: high
6
6
  skills:
@@ -26,7 +26,7 @@ disallowedTools:
26
26
  - DesignSync
27
27
  ---
28
28
 
29
- # Code-edit Agent
29
+ # Refactor Agent
30
30
 
31
31
  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.
32
32
 
@@ -82,11 +82,11 @@ Run builds, typechecks, lints and tests in the foreground, each with an explicit
82
82
 
83
83
  ## Principles
84
84
 
85
- 1. **Work on feature branch** - All operations happen on the current feature branch
86
- 2. **Orient, then match patterns** - Before writing code, orient on branch state and find similar implementations; match their conventions, don't invent new ones
87
- 3. **Be decisive** - Make confident implementation choices. Don't present alternatives or ask permission for tactical decisions
88
- 4. **Small, focused changes** - Don't scope creep beyond the plan
89
- 5. **Fail honestly** - If blocked, report clearly with what was completed
85
+ 1. **Read once** - Never re-read an unchanged file. For a file over 400 lines, or a second look, `grep -n` first, then Read only that range (`offset`, `limit`)
86
+ 2. **Small, focused changes** - Don't scope creep beyond the plan
87
+ 3. **Fail honestly** - If blocked, report clearly with what was completed
88
+
89
+ - 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.
90
90
 
91
91
  ## Output
92
92
 
@@ -126,4 +126,3 @@ Report cap: final message at most about 1,500 tokens; longer material goes to a
126
126
  - Switch branches during implementation
127
127
  - Push to branches other than your feature branch
128
128
  - Merge PRs (orchestrator handles this)
129
- - Trust handoff summaries without reading actual code
@@ -222,3 +222,5 @@ use the same prefix so values are not double-masked.
222
222
  | java | If .java files changed |
223
223
  | python | If .py files changed |
224
224
  | rust | If .rs files changed |
225
+
226
+ The gate level (`GATE_LEVEL`, `/code-review` Step 1.2b) removes focuses from this table at `standard` and `lean`.
@@ -203,7 +203,7 @@ If `index.md` exists and contains at least one entry line, use it for relevance
203
203
 
204
204
  **Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
205
205
 
206
- Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters). The frontmatter fields `name`, `description`, and `directories` are the authoritative relevance surface — `index.md` is only a cache.
206
+ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
207
207
 
208
208
  **Step 3 — Pick relevant KBs:**
209
209
 
@@ -234,7 +234,7 @@ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
234
234
 
235
235
  A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
236
236
 
237
- **One git call, then direct reads — no `.cjs` script.** After resolving `{worktree}`, this step is 1 index read (or N frontmatter reads on fallback), plus one heading listing and one Rules read per selected KB, bounded by KB count.
237
+ **One git call, then direct reads — no `.cjs` script.**
238
238
 
239
239
  #### Plan Artifact
240
240
 
@@ -263,11 +263,11 @@ Determine which focus analyzers to run using `CHANGED_FILES` (already computed i
263
263
  **Produces:** ANALYZER_OUTPUTS
264
264
  **Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, FEATURE_KNOWLEDGE
265
265
 
266
- Spawn ALL active Diagnose agents **in a single message** (parallel, NOT background):
266
+ Spawn ALL active Debug agents **in a single message** (parallel, NOT background):
267
267
 
268
268
  For each active focus, spawn:
269
269
  ```
270
- Agent(subagent_type="Diagnose", run_in_background=false):
270
+ Agent(subagent_type="Debug", run_in_background=false):
271
271
  "Analyze focusing on {focus}.
272
272
  FOCUS: {focus}
273
273
  DIFF_COMMAND: git diff {DIFF_RANGE}
@@ -362,10 +362,10 @@ Run `/resolve` to process and fix these findings.
362
362
  │ └─ Detect active focuses (security + functional always; integration + usability conditional)
363
363
  │
364
364
  ├─ Phase 5: Bug Analysis (PARALLEL)
365
- │ ├─ Diagnose agent: security (+ STATIC_FINDINGS)
366
- │ ├─ Diagnose agent: functional
367
- │ ├─ Diagnose agent: integration (conditional)
368
- │ └─ Diagnose agent: usability (conditional)
365
+ │ ├─ Debug agent: security (+ STATIC_FINDINGS)
366
+ │ ├─ Debug agent: functional
367
+ │ ├─ Debug agent: integration (conditional)
368
+ │ └─ Debug agent: usability (conditional)
369
369
  │
370
370
  ├─ Phase 6: Synthesis
371
371
  │ └─ Synthesize agent (mode: bug-analysis)
@@ -402,7 +402,7 @@ Run `/resolve` after `/bug-analysis` to fix identified bugs. `/resolve` automati
402
402
  2. **Parallel, not background** — Analyzers spawn in one message with `run_in_background=false`
403
403
  3. **Static + semantic** — Two complementary tracks, each validates the other
404
404
  4. **Incremental by default** — Only analyze new changes unless `--full` specified
405
- 5. **Verify before reporting** — Diagnose agents self-verify every finding
405
+ 5. **Verify before reporting** — Debug agents self-verify every finding
406
406
  6. **Honest reporting** — Display risk level and counts directly from synthesis
407
407
 
408
408
  ## Phase Completion Checklist