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.
- package/CHANGELOG.md +178 -1
- package/README.md +10 -6
- package/dist/agents/code.md +7 -11
- package/dist/agents/{diagnose.md → debug.md} +4 -4
- package/dist/agents/{code-fix.md → fix.md} +7 -8
- package/dist/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/agents/{code-edit.md → refactor.md} +8 -9
- package/dist/agents/review.md +2 -0
- package/dist/cli/agents-view/render.js +1 -1
- package/dist/cli/commands/gates.js +276 -0
- package/dist/cli/commands/init-seed.js +9 -1
- package/dist/cli/commands/init.js +34 -11
- package/dist/cli/commands/learning.js +12 -12
- package/dist/cli/commands/legacy-hooks.js +1 -1
- package/dist/cli/commands/memory.js +18 -0
- package/dist/cli/commands/uninstall.js +111 -5
- package/dist/cli.js +2 -0
- package/dist/commands/bug-analysis.md +21 -17
- package/dist/commands/code-review.md +65 -66
- package/dist/commands/debug.md +17 -17
- package/dist/commands/dynamic-build.md +104 -116
- package/dist/commands/dynamic-plan.md +13 -11
- package/dist/commands/dynamic-profile.md +9 -7
- package/dist/commands/dynamic-tickets.md +13 -11
- package/dist/commands/explore.md +15 -15
- package/dist/commands/implement.md +80 -154
- package/dist/commands/plan.md +34 -66
- package/dist/commands/release.md +11 -7
- package/dist/commands/research.md +14 -10
- package/dist/commands/resolve.md +44 -88
- package/dist/commands/self-review.md +44 -44
- package/dist/core/agent-models.js +47 -11
- package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
- package/dist/core/echo-value.js +42 -0
- package/dist/core/evidence-policy.js +17 -5
- package/dist/core/gate-level.js +213 -0
- package/dist/core/learning-queue-cleanup.js +1 -1
- package/dist/core/manifest.js +26 -10
- package/dist/core/migrations.js +63 -44
- package/dist/core/model-discovery.js +7 -1
- package/dist/core/plugins.js +14 -12
- package/dist/core/project-paths.js +3 -3
- package/dist/core/tracker.js +5 -33
- package/dist/hud/codex-usage.js +247 -0
- package/dist/hud/components/codex-quota.js +37 -0
- package/dist/hud/components/usage-quota.js +1 -1
- package/dist/hud/config.js +1 -0
- package/dist/hud/index.js +16 -3
- package/dist/hud/render.js +3 -1
- package/dist/learning-off/agents/code.md +7 -11
- package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
- package/dist/learning-off/agents/{code-fix.md → fix.md} +7 -8
- package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/learning-off/agents/{code-edit.md → refactor.md} +8 -9
- package/dist/learning-off/agents/review.md +2 -0
- package/dist/learning-off/commands/bug-analysis.md +9 -9
- package/dist/learning-off/commands/code-review.md +54 -59
- package/dist/learning-off/commands/debug.md +6 -10
- package/dist/learning-off/commands/dynamic-build.md +98 -112
- package/dist/learning-off/commands/dynamic-plan.md +5 -5
- package/dist/learning-off/commands/dynamic-profile.md +1 -1
- package/dist/learning-off/commands/dynamic-tickets.md +5 -5
- package/dist/learning-off/commands/explore.md +4 -8
- package/dist/learning-off/commands/implement.md +68 -146
- package/dist/learning-off/commands/plan.md +23 -58
- package/dist/learning-off/commands/release.md +4 -2
- package/dist/learning-off/commands/research.md +2 -2
- package/dist/learning-off/commands/resolve.md +33 -81
- package/dist/learning-off/commands/self-review.md +32 -36
- package/dist/skills/git/references/pr/check-merge-readiness.md +2 -0
- package/dist/skills/git/references/pr/update-pr-evidence.md +4 -6
- package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +7 -9
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +7 -15
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +7 -15
- package/dist/targets/claude-code/installer.js +117 -84
- package/dist/targets/claude-code/learning-install.js +15 -3
- package/dist/targets/claude-code/tracker-servers.js +1 -1
- package/package.json +1 -1
- package/src/assets/agents/_partials/_code.mds +7 -8
- package/src/assets/agents/code.mds +4 -7
- package/src/assets/agents/{learning.md → curate.md} +8 -10
- package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
- package/src/assets/agents/evaluate.md +4 -4
- package/src/assets/agents/{code-fix.mds → fix.mds} +5 -5
- package/src/assets/agents/{scrutinize.mds → harden.mds} +6 -6
- package/src/assets/agents/{simplify.md → polish.md} +4 -4
- package/src/assets/agents/{code-edit.mds → refactor.mds} +6 -6
- package/src/assets/agents/review.mds +2 -0
- package/src/assets/agents/synthesize.md +2 -2
- package/src/assets/agents/test.md +2 -2
- package/src/assets/commands/_partials/_compliance.mds +1 -1
- package/src/assets/commands/_partials/_decisions.mds +26 -6
- package/src/assets/commands/_partials/_engine.mds +15 -15
- package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
- package/src/assets/commands/_partials/_knowledge.mds +14 -9
- package/src/assets/commands/_partials/_preamble.mds +4 -2
- package/src/assets/commands/_partials/_roster.mds +4 -4
- package/src/assets/commands/_partials/_settings.mds +2 -2
- package/src/assets/commands/_partials/_wave.mds +10 -17
- package/src/assets/commands/bug-analysis.mds +7 -7
- package/src/assets/commands/code-review.mds +51 -56
- package/src/assets/commands/debug.mds +2 -2
- package/src/assets/commands/dynamic-build.mds +67 -74
- package/src/assets/commands/implement.mds +65 -127
- package/src/assets/commands/plan.mds +21 -61
- package/src/assets/commands/release.mds +5 -1
- package/src/assets/commands/resolve.mds +28 -76
- package/src/assets/commands/self-review.mds +27 -27
- package/src/assets/mds/git/_ops_steps.mds +3 -3
- package/src/assets/mds/git/_pr.mds +6 -6
- package/src/assets/mds/tracker/_common.mds +23 -12
- package/src/assets/mds/tracker/_github.mds +2 -9
- package/src/assets/mds/tracker/_jira.mds +2 -15
- package/src/assets/mds/tracker/_linear.mds +2 -15
- package/src/assets/scripts/ci-wait.cjs +22 -4
- package/src/assets/scripts/claude-md-audit.cjs +66 -51
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
- package/src/assets/scripts/hooks/background-memory-update +404 -95
- package/src/assets/scripts/hooks/capture-prompt +1 -1
- package/src/assets/scripts/hooks/capture-question +1 -1
- package/src/assets/scripts/hooks/capture-turn +1 -1
- package/src/assets/scripts/hooks/json-helper.cjs +13 -2
- package/src/assets/scripts/hooks/json-parse +18 -3
- package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
- package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -4
- package/src/assets/scripts/hooks/memory-permission +358 -0
- package/src/assets/scripts/hooks/preamble +1 -1
- package/src/assets/scripts/hooks/session-start-context +60 -47
- package/src/assets/scripts/hooks/session-start-memory +26 -5
- package/src/assets/scripts/lib/project-config.cjs +19 -4
- package/src/assets/scripts/resolve-settings.cjs +200 -32
- package/src/assets/scripts/verify-evidence.cjs +726 -9
- package/src/assets/skills/agent-references/SKILL.md +14 -6
- package/src/assets/skills/agent-references/references/commands/code-review-levels.md +19 -0
- package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
- package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
- package/src/assets/skills/agent-references/references/commands/plan-levels.md +40 -0
- package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
- package/src/assets/skills/agent-references/references/synthesize/planning.md +9 -22
- package/src/assets/skills/agent-references/references/synthesize/review.md +11 -11
- package/src/assets/skills/apply-decisions/SKILL.md +6 -4
- package/src/assets/skills/docs-framework/SKILL.md +3 -3
- package/src/assets/skills/qa/SKILL.md +1 -1
- package/src/assets/skills/quality-gates/SKILL.md +7 -7
- package/src/assets/skills/quality-gates/references/report-template.md +7 -7
- /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
|
-
|
|
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
|
|
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,
|
package/dist/hud/render.js
CHANGED
|
@@ -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.
|
|
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
|
-
-
|
|
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. **
|
|
140
|
-
2. **
|
|
141
|
-
3. **
|
|
142
|
-
|
|
143
|
-
|
|
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:
|
|
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
|
-
#
|
|
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
|
|
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:
|
|
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
|
-
#
|
|
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. **
|
|
118
|
-
2. **
|
|
119
|
-
3. **
|
|
120
|
-
|
|
121
|
-
|
|
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:
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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 (
|
|
95
|
-
- Consistency: SKIP (
|
|
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:
|
|
3
|
-
description: Autonomous mechanical edit on feature branch.
|
|
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
|
-
#
|
|
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. **
|
|
86
|
-
2. **
|
|
87
|
-
3. **
|
|
88
|
-
|
|
89
|
-
|
|
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).
|
|
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.**
|
|
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
|
|
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="
|
|
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
|
-
│ ├─
|
|
366
|
-
│ ├─
|
|
367
|
-
│ ├─
|
|
368
|
-
│ └─
|
|
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** —
|
|
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
|