devflow-kit 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/README.md +12 -8
- package/dist/agents/code.md +39 -182
- package/dist/agents/{diagnose.md → debug.md} +4 -4
- package/dist/agents/design.md +0 -1
- package/dist/agents/fix.md +165 -0
- package/dist/agents/git.md +31 -693
- package/dist/agents/{scrutinize.md → harden.md} +9 -6
- package/dist/agents/knowledge.md +8 -2
- package/dist/agents/refactor.md +133 -0
- package/dist/agents/research.md +6 -0
- package/dist/agents/review.md +0 -4
- package/dist/agents/skim.md +4 -0
- package/dist/agents/triage.md +8 -1
- package/dist/cli/agents-view/render.js +1 -1
- package/dist/cli/commands/behavior-prompts.js +77 -0
- package/dist/cli/commands/behavior.js +123 -0
- package/dist/cli/commands/flags.js +8 -2
- package/dist/cli/commands/init-seed.js +7 -3
- package/dist/cli/commands/init.js +75 -8
- package/dist/cli/commands/learning.js +12 -12
- package/dist/cli/commands/legacy-hooks.js +1 -1
- package/dist/cli/commands/rules.js +16 -0
- package/dist/cli/commands/tracker.js +112 -15
- package/dist/cli/commands/uninstall.js +111 -5
- package/dist/cli.js +2 -0
- package/dist/commands/bug-analysis.md +22 -18
- package/dist/commands/code-review.md +25 -29
- package/dist/commands/debug.md +36 -15
- package/dist/commands/dynamic-build.md +64 -78
- package/dist/commands/dynamic-plan.md +18 -14
- package/dist/commands/dynamic-profile.md +8 -6
- package/dist/commands/dynamic-tickets.md +19 -15
- package/dist/commands/explore.md +14 -14
- package/dist/commands/implement.md +122 -225
- package/dist/commands/plan.md +32 -47
- package/dist/commands/release.md +12 -7
- package/dist/commands/research.md +26 -15
- package/dist/commands/resolve.md +53 -92
- package/dist/commands/self-review.md +42 -42
- package/dist/core/agent-frontmatter.js +101 -0
- package/dist/core/agent-models.js +47 -11
- package/dist/core/compliance-compose.js +6 -4
- package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
- package/dist/core/feature-switch.js +23 -2
- package/dist/core/flags.js +111 -0
- package/dist/core/learning-queue-cleanup.js +1 -1
- package/dist/core/manifest.js +11 -3
- package/dist/core/mds-variants.js +68 -26
- package/dist/core/migrations.js +63 -44
- package/dist/core/plugins.js +49 -70
- package/dist/core/project-paths.js +3 -7
- package/dist/core/proxy-log.js +1 -1
- package/dist/core/proxy-state.js +1 -1
- package/dist/core/tracker.js +120 -2
- 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 +37 -180
- package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
- package/dist/learning-off/agents/design.md +0 -1
- package/dist/learning-off/agents/fix.md +161 -0
- package/dist/learning-off/agents/{scrutinize.md → harden.md} +9 -6
- package/dist/learning-off/agents/knowledge.md +8 -2
- package/dist/learning-off/agents/refactor.md +129 -0
- package/dist/learning-off/agents/research.md +6 -0
- package/dist/learning-off/agents/review.md +0 -4
- package/dist/learning-off/agents/skim.md +4 -0
- package/dist/learning-off/agents/triage.md +8 -1
- package/dist/learning-off/commands/bug-analysis.md +12 -12
- package/dist/learning-off/commands/code-review.md +14 -22
- package/dist/learning-off/commands/debug.md +24 -8
- package/dist/learning-off/commands/dynamic-build.md +58 -74
- package/dist/learning-off/commands/dynamic-plan.md +12 -10
- package/dist/learning-off/commands/dynamic-profile.md +2 -2
- package/dist/learning-off/commands/dynamic-tickets.md +13 -11
- package/dist/learning-off/commands/explore.md +3 -7
- package/dist/learning-off/commands/implement.md +110 -217
- package/dist/learning-off/commands/plan.md +21 -39
- package/dist/learning-off/commands/release.md +7 -4
- package/dist/learning-off/commands/research.md +16 -9
- package/dist/learning-off/commands/resolve.md +42 -85
- package/dist/learning-off/commands/self-review.md +30 -34
- package/dist/skills/git/references/learn-conventions.md +27 -3
- package/dist/skills/git/references/pr/check-ci-status.md +19 -0
- package/dist/skills/git/references/pr/check-merge-readiness.md +21 -0
- package/dist/skills/git/references/pr/fetch-review-threads.md +30 -0
- package/dist/skills/git/references/pr/post-resolution-summary.md +18 -0
- package/dist/skills/git/references/pr/post-review-summary.md +20 -0
- package/dist/skills/git/references/pr/resolve-review-threads.md +28 -4
- package/dist/skills/git/references/pr/update-pr-evidence.md +17 -6
- package/dist/skills/git/references/pr/validate-branch.md +26 -0
- package/dist/skills/git/references/tracker/github/associate-release.md +24 -0
- package/dist/skills/git/references/tracker/github/backlink-shipped-issues.md +31 -1
- package/dist/skills/git/references/tracker/github/create-release.md +30 -1
- package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +89 -2
- package/dist/skills/git/references/tracker/github/ensure-traceable-issue.md +16 -1
- package/dist/skills/git/references/tracker/github/fetch-issue.md +36 -1
- package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +47 -1
- package/dist/skills/git/references/tracker/github/gather-release-evidence.md +25 -0
- package/dist/skills/git/references/tracker/github/manage-debt.md +21 -1
- package/dist/skills/git/references/tracker/github/post-wave-report.md +15 -1
- package/dist/skills/git/references/tracker/github/setup-task.md +41 -1
- package/dist/skills/git/references/tracker/jira/associate-release.md +24 -0
- package/dist/skills/git/references/tracker/jira/backlink-shipped-issues.md +31 -1
- package/dist/skills/git/references/tracker/jira/create-release.md +30 -1
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +89 -2
- package/dist/skills/git/references/tracker/jira/ensure-traceable-issue.md +16 -1
- package/dist/skills/git/references/tracker/jira/fetch-issue.md +36 -1
- package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +47 -1
- package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +25 -0
- package/dist/skills/git/references/tracker/jira/manage-debt.md +21 -1
- package/dist/skills/git/references/tracker/jira/post-wave-report.md +15 -1
- package/dist/skills/git/references/tracker/jira/setup-task.md +41 -1
- package/dist/skills/git/references/tracker/linear/associate-release.md +24 -0
- package/dist/skills/git/references/tracker/linear/backlink-shipped-issues.md +31 -1
- package/dist/skills/git/references/tracker/linear/create-release.md +30 -1
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +89 -2
- package/dist/skills/git/references/tracker/linear/ensure-traceable-issue.md +16 -1
- package/dist/skills/git/references/tracker/linear/fetch-issue.md +36 -1
- package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +47 -1
- package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +25 -0
- package/dist/skills/git/references/tracker/linear/manage-debt.md +21 -1
- package/dist/skills/git/references/tracker/linear/post-wave-report.md +15 -1
- package/dist/skills/git/references/tracker/linear/setup-task.md +41 -1
- package/dist/targets/claude-code/agent-type-owner.js +164 -0
- package/dist/targets/claude-code/behavior-install.js +111 -0
- package/dist/targets/claude-code/installer.js +177 -77
- package/dist/targets/claude-code/learning-install.js +9 -1
- package/dist/targets/claude-code/tracker-install.js +33 -16
- package/dist/targets/claude-code/tracker-servers.js +107 -0
- package/package.json +4 -3
- package/src/assets/agents/_partials/_code.mds +109 -0
- package/src/assets/agents/code.mds +18 -222
- package/src/assets/agents/{learning.md → curate.md} +22 -72
- package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
- package/src/assets/agents/design.mds +0 -1
- package/src/assets/agents/evaluate.md +11 -5
- package/src/assets/agents/explore.md +58 -0
- package/src/assets/agents/fix.mds +113 -0
- package/src/assets/agents/git.mds +31 -693
- package/src/assets/agents/{scrutinize.mds → harden.mds} +9 -6
- package/src/assets/agents/knowledge.mds +8 -2
- package/src/assets/agents/{simplify.md → polish.md} +7 -4
- package/src/assets/agents/refactor.mds +81 -0
- package/src/assets/agents/research.mds +6 -0
- package/src/assets/agents/review.mds +0 -4
- package/src/assets/agents/skim.mds +4 -0
- package/src/assets/agents/synthesize.md +26 -352
- package/src/assets/agents/test.md +10 -2
- package/src/assets/agents/tracker.md +20 -7
- package/src/assets/agents/triage.mds +8 -1
- package/src/assets/agents/validate.md +5 -0
- package/src/assets/commands/_partials/_compliance.mds +36 -0
- package/src/assets/commands/_partials/_decisions.mds +26 -6
- package/src/assets/commands/_partials/_engine.mds +17 -17
- 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 +5 -3
- package/src/assets/commands/_partials/_roster.mds +6 -5
- package/src/assets/commands/_partials/_wave.mds +2 -2
- package/src/assets/commands/bug-analysis.mds +10 -10
- package/src/assets/commands/code-review.mds +12 -22
- package/src/assets/commands/debug.mds +24 -2
- package/src/assets/commands/dynamic-build.mds +34 -51
- package/src/assets/commands/dynamic-plan.mds +4 -3
- package/src/assets/commands/dynamic-tickets.mds +5 -4
- package/src/assets/commands/explore.mds +1 -1
- package/src/assets/commands/implement.mds +108 -201
- package/src/assets/commands/plan.mds +19 -44
- package/src/assets/commands/release.mds +8 -3
- package/src/assets/commands/research.mds +14 -7
- package/src/assets/commands/resolve.mds +37 -82
- package/src/assets/commands/self-review.mds +27 -27
- package/src/assets/mds/.mdsroot +4 -0
- package/src/assets/mds/git/_ops.mds +383 -0
- package/src/assets/mds/git/_ops_pr.mds +201 -0
- package/src/assets/mds/git/_ops_steps.mds +147 -0
- package/src/assets/mds/git/_pr.mds +45 -50
- package/src/assets/mds/git/_references.mds +6 -3
- package/src/assets/mds/tracker/_common.mds +5 -5
- package/src/assets/mds/tracker/_contract.mds +4 -3
- package/src/assets/mds/tracker/_github.mds +60 -14
- package/src/assets/mds/tracker/_jira.mds +60 -14
- package/src/assets/mds/tracker/_linear.mds +60 -14
- package/src/assets/mds/tracker/_steps.mds +10 -9
- package/src/assets/rules/behavior.md +6 -0
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +5 -3
- 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 +2 -2
- package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
- package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -10
- package/src/assets/scripts/hooks/preamble +1 -1
- package/src/assets/scripts/hooks/session-start-context +58 -45
- package/src/assets/scripts/verify-evidence.cjs +726 -9
- package/src/assets/skills/agent-references/SKILL.md +37 -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/curate/maintain.md +71 -0
- package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +71 -0
- package/src/assets/skills/agent-references/references/synthesize/design.md +36 -0
- package/src/assets/skills/agent-references/references/synthesize/exploration.md +38 -0
- package/src/assets/skills/agent-references/references/synthesize/planning.md +60 -0
- package/src/assets/skills/agent-references/references/synthesize/research.md +61 -0
- package/src/assets/skills/agent-references/references/synthesize/review.md +76 -0
- package/src/assets/skills/apply-decisions/SKILL.md +6 -4
- package/src/assets/skills/compliance/SKILL.md +1 -1
- package/src/assets/skills/docs-framework/SKILL.md +81 -84
- package/src/assets/skills/docs-framework/references/patterns.md +14 -25
- package/src/assets/skills/docs-framework/references/violations.md +7 -7
- package/src/assets/skills/gap-analysis/SKILL.md +0 -16
- package/src/assets/skills/gap-analysis/references/compliance.md +19 -0
- 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/dist/skills/git/references/pr/ensure-pr-ready.md +0 -24
|
@@ -7,6 +7,7 @@ tools: ["Read", "Grep", "Glob", "Bash", "mcp__claude-in-chrome__tabs_context_mcp
|
|
|
7
7
|
skills:
|
|
8
8
|
- devflow:qa
|
|
9
9
|
- devflow:worktree-support
|
|
10
|
+
omitClaudeMd: true
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# Test Agent
|
|
@@ -142,7 +143,7 @@ One row per TP line, in TP order. PASS only when every scenario covering the TP
|
|
|
142
143
|
- **Expected**: {what should happen}
|
|
143
144
|
- **Actual**: {what actually happened}
|
|
144
145
|
- **Evidence**: {stdout/stderr/exit code}
|
|
145
|
-
- **Remediation**: {what
|
|
146
|
+
- **Remediation**: {what the Fix agent should fix}
|
|
146
147
|
|
|
147
148
|
### Evidence Log
|
|
148
149
|
{Each command run's `LOG=` path, for traceability}
|
|
@@ -153,11 +154,18 @@ Report cap: final message at most about 1,500 tokens; longer material goes to a
|
|
|
153
154
|
## Principles
|
|
154
155
|
|
|
155
156
|
1. **User perspective** - Test what the user asked for, not implementation internals
|
|
156
|
-
2. **Report, don't fix** - Document failures for
|
|
157
|
+
2. **Report, don't fix** - Document failures for the Fix agent to fix; never modify code yourself
|
|
157
158
|
3. **Evidence-based** - Every result backed by captured stdout/stderr/exit codes
|
|
158
159
|
4. **Severity-aware** - BLOCKING for acceptance criteria violations, WARNING for edge cases
|
|
159
160
|
5. **Deterministic** - Scenarios must produce consistent results across runs
|
|
160
161
|
|
|
162
|
+
## Core rules
|
|
163
|
+
|
|
164
|
+
- 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.
|
|
165
|
+
- Assume all input is malicious. Validate and sanitize at every trust boundary.
|
|
166
|
+
- No hardcoded secrets, tokens, or credentials — use environment variables.
|
|
167
|
+
- Escape output for its context (HTML, URL, SQL, shell).
|
|
168
|
+
|
|
161
169
|
## Boundaries
|
|
162
170
|
|
|
163
171
|
**Report as PASS:**
|
|
@@ -4,7 +4,8 @@ description: Background tracker-conventions agent — probes the configured issu
|
|
|
4
4
|
model: sonnet
|
|
5
5
|
skills:
|
|
6
6
|
- devflow:git
|
|
7
|
-
|
|
7
|
+
tools: ["Bash", "Read", "ToolSearch"]
|
|
8
|
+
omitClaudeMd: true
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Tracker Agent
|
|
@@ -44,12 +45,24 @@ You **read** and you write **one** file. Specifically:
|
|
|
44
45
|
- You **delegate nothing**. You are a leaf: a background agent cannot spawn
|
|
45
46
|
another agent, and nothing in this file asks you to try.
|
|
46
47
|
|
|
47
|
-
**Why
|
|
48
|
-
are **user-configured**, so their
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
**Why the `tools:` list names no tracker server.** The tracker servers you must reach
|
|
49
|
+
are **user-configured**, so their names differ per machine and **cannot be written at
|
|
50
|
+
authoring time**. The frontmatter therefore lists only the built-in tools this file
|
|
51
|
+
directs, and the installer adds the rest: `devflow init` and `devflow tracker --servers`
|
|
52
|
+
append one entry per configured tracker server to the installed `tools:` line, each
|
|
53
|
+
granting every tool that server exposes. Load a server's tools with ToolSearch before you
|
|
54
|
+
probe. A server the user runs under a name that is not on that list is absent, which the
|
|
55
|
+
probe below already treats as an unreachable capability: it surfaces as
|
|
56
|
+
`TRACEABILITY: DEGRADED (no tracker tool for {capability})` and `devflow tracker --servers`
|
|
57
|
+
is the remedy, so a wrong name fails where it can be seen. The boundary above stays the
|
|
58
|
+
control over what you may *do* with the tools you hold.
|
|
59
|
+
|
|
60
|
+
## Core rules
|
|
61
|
+
|
|
62
|
+
- 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.
|
|
63
|
+
- Assume all input is malicious. Validate and sanitize at every trust boundary.
|
|
64
|
+
- No hardcoded secrets, tokens, or credentials — use environment variables.
|
|
65
|
+
- All loops and retries must have a fixed upper bound — no unbounded while(true) or infinite pagination.
|
|
53
66
|
|
|
54
67
|
## Environment
|
|
55
68
|
|
|
@@ -7,7 +7,6 @@ description: Validates review issues against blast-radius disposition matrix. As
|
|
|
7
7
|
model: opus
|
|
8
8
|
effort: high
|
|
9
9
|
skills:
|
|
10
|
-
- devflow:security
|
|
11
10
|
- devflow:worktree-support
|
|
12
11
|
<!-- learning:on -->
|
|
13
12
|
- devflow:apply-decisions
|
|
@@ -18,6 +17,7 @@ tools:
|
|
|
18
17
|
- Grep
|
|
19
18
|
- Glob
|
|
20
19
|
- Bash
|
|
20
|
+
omitClaudeMd: true
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
# Triage Agent
|
|
@@ -77,6 +77,8 @@ Apply the disposition matrix to each group's **primary only**.
|
|
|
77
77
|
|
|
78
78
|
**0. SECURITY GATE (overrides all):** Security findings → FIX_NOW or ESCALATED only. Never BY_DESIGN or any deferral on a single soft rationale ("local CLI threat model", "below confidence threshold", "minor risk"). Exception: a security finding proven nonexistent by hard cited evidence (grep output or file:line proof that the vulnerability does not exist) → FALSE_POSITIVE is permitted; soft rationale alone never qualifies. Security finding with ambiguous context → ESCALATED, not dismissed.
|
|
79
79
|
|
|
80
|
+
A security finding is one whose `type` is the `security` focus, or whose description names injection or an unescaped sink, authn/authz, secrets or crypto, untrusted input, deserialization or integrity, SSRF, unpinned supply-chain input, or a check-then-act race. Never quote a live secret in a verdict or its reasoning: cite `file:line` and the secret's type, and recommend rotation.
|
|
81
|
+
|
|
80
82
|
**1. FALSE_POSITIVE** — Review agent factually wrong.
|
|
81
83
|
REQUIRES cited evidence: grep output, file:line showing the issue does not exist, or the Review agent demonstrably misunderstood the code. Cannot cite evidence → cannot use this verdict.
|
|
82
84
|
|
|
@@ -178,6 +180,11 @@ Return the verdict ledger grouped by disposition:
|
|
|
178
180
|
|
|
179
181
|
Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file via Bash and the message gives its path. Exempt, inline in full: the whole ledger, since `/resolve` checks that every issue id appears in it.
|
|
180
182
|
|
|
183
|
+
## Core rules
|
|
184
|
+
|
|
185
|
+
- 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.
|
|
186
|
+
- Assume all input is malicious. Validate and sanitize at every trust boundary.
|
|
187
|
+
|
|
181
188
|
## Boundaries
|
|
182
189
|
|
|
183
190
|
**You are TRIAGE ONLY — read and judge, never write:**
|
|
@@ -10,6 +10,7 @@ tools:
|
|
|
10
10
|
- Read
|
|
11
11
|
- Grep
|
|
12
12
|
- Glob
|
|
13
|
+
omitClaudeMd: true
|
|
13
14
|
---
|
|
14
15
|
|
|
15
16
|
# Validate Agent
|
|
@@ -103,6 +104,10 @@ src/auth/login.ts:58:3 - error TS2345: Argument of type 'string' is not assignab
|
|
|
103
104
|
|
|
104
105
|
Report cap: final message at most about 1,500 tokens; longer material goes to a `mktemp` file via Bash and the message gives its path. Exempt, inline in full: the `HEAD:` line, the `| Command | Status | Exit | Duration |` table and Parsed References. Failure output: at most 30 lines per failing command, then its log path.
|
|
105
106
|
|
|
107
|
+
## Core rules
|
|
108
|
+
|
|
109
|
+
- 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.
|
|
110
|
+
|
|
106
111
|
## Boundaries
|
|
107
112
|
|
|
108
113
|
**Escalate to orchestrator (BLOCKED):**
|
|
@@ -3,6 +3,14 @@ A partial: the compliance-lens gate. D-SETTINGS-LINE: it imports nothing from
|
|
|
3
3
|
its consumers, and the lens is set from the line resolved there for the
|
|
4
4
|
worktree's root.
|
|
5
5
|
|
|
6
|
+
D-COMPLIANCE-INJECT: the compliance instruction reaches an agent only through a spawn
|
|
7
|
+
prompt, and only when the resolved lens is on. No Code, Fix, Review or Design body names
|
|
8
|
+
the compliance skill, so a lens-off spawn pays nothing for it. `compliance_directive()` is the
|
|
9
|
+
one home of the directive text; `compliance_inject()` is how a pass-through host sets it.
|
|
10
|
+
An install-time variant keyed on the machine switch would be wrong: the lens is the union of
|
|
11
|
+
the machine, the default branch and the worktree (D-LENS-UNION), so a repository can turn it
|
|
12
|
+
on when the machine switch is off.
|
|
13
|
+
|
|
6
14
|
@define compliance_frameworks():
|
|
7
15
|
`COMPLIANCE_FRAMEWORKS` is the settings line's `COMPLIANCE` with `generic` written `none`: `off`, `none`, or the framework ids the machine and this repository declare.
|
|
8
16
|
@end
|
|
@@ -19,6 +27,34 @@ worktree's root.
|
|
|
19
27
|
`COMPLIANCE_ACTIVE` is `true` unless `COMPLIANCE_FRAMEWORKS` is `off`.
|
|
20
28
|
@end
|
|
21
29
|
|
|
30
|
+
@define compliance_load(ids):
|
|
31
|
+
invoke Skill(skill="devflow:compliance") and load references/{id}.md only for the ids in {{ids}} (none: generic controls only); never fabricate guidance for a framework you were not given.
|
|
32
|
+
@end
|
|
33
|
+
|
|
34
|
+
@define compliance_directive(ids):
|
|
35
|
+
When the task touches regulated surface (data models, auth flows, logging/observability, payments, IaC, retention), {{compliance_load(ids)}}
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
@define compliance_focus_directive(ids):
|
|
39
|
+
For this compliance focus, {{compliance_load(ids)}}
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
@define compliance_inject():
|
|
43
|
+
**Set the compliance directive** from `COMPLIANCE_FRAMEWORKS`. `COMPLIANCE_DIRECTIVE` is empty when `COMPLIANCE_FRAMEWORKS` is `off`: a spawn line that holds only `{COMPLIANCE_DIRECTIVE}` is then left out, so a lens-off spawn carries nothing about compliance. Otherwise `COMPLIANCE_DIRECTIVE` is this one line, with `<ids>` replaced by the value of `COMPLIANCE_FRAMEWORKS`:
|
|
44
|
+
|
|
45
|
+
> {{compliance_directive("<ids>")}}
|
|
46
|
+
@end
|
|
47
|
+
|
|
48
|
+
@define compliance_focus_inject():
|
|
49
|
+
**Set the compliance focus directive** from `COMPLIANCE_FRAMEWORKS`. `COMPLIANCE_FOCUS_DIRECTIVE` is this one line, with `<ids>` replaced by the value of `COMPLIANCE_FRAMEWORKS`; only the compliance focus's spawn carries it:
|
|
50
|
+
|
|
51
|
+
> {{compliance_focus_directive("<ids>")}}
|
|
52
|
+
@end
|
|
53
|
+
|
|
22
54
|
@export compliance_frameworks
|
|
23
55
|
@export compliance_lens
|
|
24
56
|
@export compliance_gate
|
|
57
|
+
@export compliance_directive
|
|
58
|
+
@export compliance_focus_directive
|
|
59
|
+
@export compliance_inject
|
|
60
|
+
@export compliance_focus_inject
|
|
@@ -19,24 +19,39 @@ learning-on build. `decisions_gate()` and `decisions_locate()` are leaves, reach
|
|
|
19
19
|
inside an arm (`decisions_load()`, `authoring_decisions()`, or a host's own on arm), and carry
|
|
20
20
|
no arm of their own: an arm cannot nest.
|
|
21
21
|
|
|
22
|
+
D-DECISIONS-SLICE: the index is handed on as a slice, never whole. The orchestrating main model
|
|
23
|
+
copies the index lines that touch an agent's work, verbatim, behind a
|
|
24
|
+
`(slice: N of M entries — full index: <path>)` marker and ahead of the footer, so an agent reads what
|
|
25
|
+
bears on its task and `devflow:apply-decisions` sends it to the full index only when its work leaves
|
|
26
|
+
that scope. Siblings over one diff share ONE slice, so their prompts stay identical. No script cuts
|
|
27
|
+
it: the index stays a pre-rendered file read, never built on demand, and matching a line to a task is
|
|
28
|
+
judgment, which stays with the model. When unsure, include the line: a slice that misses costs one
|
|
29
|
+
full-index read, a slice that over-includes costs only its bytes. `decisions_slice()` is a leaf like
|
|
30
|
+
the gate and the locator, reached only from inside a learning-on arm, so a learning-off build carries
|
|
31
|
+
none of the rule (D-LEARNING-VARIANTS).
|
|
32
|
+
|
|
22
33
|
@define decisions_gate():
|
|
23
34
|
When the settings line says `LEARNING=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
|
|
24
35
|
@end
|
|
25
36
|
|
|
26
37
|
@define decisions_locate():
|
|
27
|
-
The decisions ledger belongs to the repository, not to one checkout:
|
|
38
|
+
The decisions ledger belongs to the repository, not to one checkout: a linked worktree reads the main worktree's copy, a subdirectory session the repository root's. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
|
|
28
39
|
|
|
29
40
|
```bash
|
|
30
41
|
git -C "{start}" rev-parse --path-format=absolute --show-toplevel --git-common-dir
|
|
31
42
|
```
|
|
32
43
|
|
|
33
|
-
Line 1 is the checkout's toplevel, line 2 the
|
|
44
|
+
Line 1 is the checkout's toplevel, line 2 the common git directory. A git older than 2.31 echoes `--path-format=absolute` back as a line of its own first. `{ledger}` is the first that applies:
|
|
34
45
|
|
|
35
46
|
1. **The main worktree** — line 2 without its trailing `/.git`, when the output is exactly two lines each beginning with `/`, line 2 ends in `/.git`, and the directory left once it is removed is not your home directory and contains a `.devflow/` directory.
|
|
36
47
|
2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
|
|
37
48
|
3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
|
|
38
49
|
|
|
39
|
-
This is the rule the learning hooks apply
|
|
50
|
+
This is the rule the learning hooks apply, so you read the index the Curate agent writes.
|
|
51
|
+
@end
|
|
52
|
+
|
|
53
|
+
@define decisions_slice():
|
|
54
|
+
Hand each agent that takes `DECISIONS_CONTEXT` a slice, not the whole index: the index lines whose title, scope or area touch the files and task it works on, verbatim, led by `(slice: N of M entries — full index: <absolute index path>)` and closed by the index footer. When unsure, include the line. Siblings over one diff share ONE slice.
|
|
40
55
|
@end
|
|
41
56
|
|
|
42
57
|
@define decisions_load():
|
|
@@ -54,15 +69,20 @@ Attempt to read `{ledger}/.devflow/learning/index.md`.
|
|
|
54
69
|
- If the file exists and contains non-empty content: use that content as `DECISIONS_CONTEXT`.
|
|
55
70
|
- If the file is absent or empty: set `DECISIONS_CONTEXT` to `(none)`.
|
|
56
71
|
|
|
57
|
-
The index is one direct file read, written at render time by `render-decisions.cjs`
|
|
72
|
+
The index is one direct file read, written at render time by `render-decisions.cjs` — no `.cjs` script runs here.
|
|
73
|
+
|
|
74
|
+
**Step 2 — Slice the index, then hand it on:**
|
|
75
|
+
|
|
76
|
+
When `DECISIONS_CONTEXT` is not `(none)`, hand it only to the agents whose contract declares it.
|
|
58
77
|
|
|
59
|
-
|
|
78
|
+
{{decisions_slice()}}
|
|
60
79
|
|
|
61
|
-
|
|
80
|
+
Those agents follow `devflow:apply-decisions`. A host that uses the index in its own thread says so in its own step.
|
|
62
81
|
|
|
63
82
|
<!-- learning:end -->
|
|
64
83
|
@end
|
|
65
84
|
|
|
66
85
|
@export decisions_gate
|
|
67
86
|
@export decisions_locate
|
|
87
|
+
@export decisions_slice
|
|
68
88
|
@export decisions_load
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
ORDER IS LOAD-BEARING. Run exactly in this sequence:
|
|
5
5
|
|
|
6
|
-
1. **
|
|
7
|
-
2. **
|
|
8
|
-
- BLOCKED (a P0 issue cannot be fixed in scope), or a missing or unrecognised status, which counts as BLOCKED → stop the pass and escalate as `
|
|
9
|
-
3. **Validate agent** — build / typecheck / lint / test; returns `{"verdict": "PASS" | "FAIL", "details": "..."}`. It runs LAST and UNCONDITIONALLY: one full run over the HEAD that
|
|
6
|
+
1. **Polish agent** — reduce complexity, remove duplication
|
|
7
|
+
2. **Harden agent** — 9-pillar self-review (deep structural analysis); returns `{"status": "PASS" | "FIXED" | "BLOCKED"}`
|
|
8
|
+
- BLOCKED (a P0 issue cannot be fixed in scope), or a missing or unrecognised status, which counts as BLOCKED → stop the pass and escalate as `harden-blocked`; Validate does not run on code Harden could not accept
|
|
9
|
+
3. **Validate agent** — build / typecheck / lint / test; returns `{"verdict": "PASS" | "FAIL", "details": "..."}`. It runs LAST and UNCONDITIONALLY: one full run over the HEAD that Polish and Harden left, so it covers their commits whether or not Harden changed code
|
|
10
10
|
- Build/test commands follow `build_execution_doctrine()`: the Validate agent's Running commands block, foreground under an explicit Bash timeout.
|
|
11
|
-
- FAIL →
|
|
11
|
+
- FAIL → Fix agent fix (max 2 retries), each followed by a Validate agent re-run
|
|
12
12
|
- If still FAIL after 2 retries → escalate as `validation-exhausted` (do not loop endlessly)
|
|
13
13
|
|
|
14
14
|
**Gate 1 contains NO Evaluate agent and NO Test agent.** Those are Gate 2 only.
|
|
@@ -16,8 +16,8 @@ ORDER IS LOAD-BEARING. Run exactly in this sequence:
|
|
|
16
16
|
Depth scales to change size + budget: a trivial one-line fix warrants a lighter pass; a multi-file refactor warrants the full depth.
|
|
17
17
|
|
|
18
18
|
**Cadence — Gate 1 runs at exactly TWO points per ticket:**
|
|
19
|
-
1. **Gate 1 #1** — immediately after the initial Code agent implementation (inside `implement_bundle()`). An escalated result — Validate exhausted, or
|
|
20
|
-
2. **Gate 1 #2** — the FINAL gate, after ALL Gate-2 fixes AND the entire review pass have completed.
|
|
19
|
+
1. **Gate 1 #1** — immediately after the initial Code agent implementation (inside `implement_bundle()`). An escalated result — Validate exhausted, or Harden BLOCKED — returns early: the ticket's engine returns `ESCALATED` with one escalation, and Gate 2 and the review pass never run on a broken or unfinished build.
|
|
20
|
+
2. **Gate 1 #2** — the FINAL gate, after ALL Gate-2 fixes AND the entire review pass have completed. Harden BLOCKED here is `ESCALATED` as well.
|
|
21
21
|
|
|
22
22
|
It does NOT run inside the review pass, nor after each individual Gate-2 / review / QA fix. At those points the fixing Code agent self-verifies its OWN build compiles (see `review_pass()` and the Code agent's Running commands block). The final Gate 1 #2 is the invariant that all written code passes before merge.
|
|
23
23
|
@end
|
|
@@ -31,11 +31,11 @@ Gate 2 inputs are produced by `/devflow:dynamic-plan`'s plan-challenge step —
|
|
|
31
31
|
|
|
32
32
|
**Evaluate agent** (only if a plan exists):
|
|
33
33
|
- Run `evaluator_panel()` — see that block for the one spawn and the two lenses it names
|
|
34
|
-
- If the Evaluate agent returns FAIL (either lens failed): fix-and-continue — the demanded fixes are applied by a
|
|
34
|
+
- If the Evaluate agent returns FAIL (either lens failed): fix-and-continue — the demanded fixes are applied by a Fix agent that self-verifies its own build (batched per the review-pass batching doctrine if numerous). The recorded verdict becomes `FAIL-FIXED` (issues found, fixes applied, not re-evaluated by design); Gate 2 then proceeds. In SINGLE mode the run reports it as `UNVERIFIED`, never PASS.
|
|
35
35
|
|
|
36
36
|
**Test agent** (only if acceptance criteria or a test plan exist):
|
|
37
37
|
- Scenario-based acceptance tests covering functionality, API contracts, performance
|
|
38
|
-
- FAIL → fix-and-continue — a
|
|
38
|
+
- FAIL → fix-and-continue — a Fix agent applies the demanded fixes and self-verifies its own build. The recorded verdict becomes `FAIL-FIXED`; Gate 2 then proceeds. In SINGLE mode the run reports it as `UNVERIFIED`, never PASS.
|
|
39
39
|
|
|
40
40
|
**When Gate 2 inputs are absent:**
|
|
41
41
|
- No plan → skip the Evaluate agent silently (note in output: "Gate 2 Evaluate agent skipped — no plan available")
|
|
@@ -61,18 +61,18 @@ The standard implementation unit for one ticket. Run in order:
|
|
|
61
61
|
|
|
62
62
|
```
|
|
63
63
|
<!-- learning:on -->
|
|
64
|
-
Code(agentType:"Code", prompt: "OPERATION: implement" first line, then full task + plan + DECISIONS_CONTEXT +
|
|
64
|
+
Code(agentType:"Code", prompt: "OPERATION: implement" first line, then full task + plan + DECISIONS_CONTEXT + COMPLIANCE_DIRECTIVE + handoff if sequential)
|
|
65
65
|
<!-- learning:off -->
|
|
66
|
-
Code(agentType:"Code", prompt: "OPERATION: implement" first line, then full task + plan +
|
|
66
|
+
Code(agentType:"Code", prompt: "OPERATION: implement" first line, then full task + plan + COMPLIANCE_DIRECTIVE + handoff if sequential)
|
|
67
67
|
<!-- learning:end -->
|
|
68
68
|
→ gate1_postcode()
|
|
69
69
|
→ gate2_acceptance() ← Gate 2 runs HERE — before the review pass, not after
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
<!-- learning:on -->
|
|
73
|
-
Every Code agent prompt opens with `OPERATION: <mode>` as its first line
|
|
73
|
+
Every Code-family agent prompt opens with `OPERATION: <mode>` as its first line: `implement` and `issue-fix` go to `agentType:"Code"`, `validation-fix`, `alignment-fix` and `qa-fix` go to `agentType:"Fix"`. It must include: task description, implementation plan (if one exists), relevant DECISIONS_CONTEXT (the index you loaded before authoring), the compliance directive (`COMPLIANCE_DIRECTIVE` — every Code prompt carries it when it is not empty, fix prompts included), and any PRIOR_PHASE_SUMMARY / HANDOFF_FILE for sequential multi-phase tickets.
|
|
74
74
|
<!-- learning:off -->
|
|
75
|
-
Every Code agent prompt opens with `OPERATION: <mode>` as its first line
|
|
75
|
+
Every Code-family agent prompt opens with `OPERATION: <mode>` as its first line: `implement` and `issue-fix` go to `agentType:"Code"`, `validation-fix`, `alignment-fix` and `qa-fix` go to `agentType:"Fix"`. It must include: task description, implementation plan (if one exists), the compliance directive (`COMPLIANCE_DIRECTIVE` — every Code prompt carries it when it is not empty, fix prompts included), and any PRIOR_PHASE_SUMMARY / HANDOFF_FILE for sequential multi-phase tickets.
|
|
76
76
|
<!-- learning:end -->
|
|
77
77
|
|
|
78
78
|
Gate 2 runs at implementation acceptance — this matches devflow's deliberate placement: "evaluation is part of implementation acceptance, not post-review" (§6.1).
|
|
@@ -120,7 +120,7 @@ Majority-survives: a finding needs >50% of verification lenses to confirm it. St
|
|
|
120
120
|
|
|
121
121
|
If no surviving findings: return early (no fixes needed). Any coverageGaps are carried in the return — they block a PASS verdict downstream, not the early exit.
|
|
122
122
|
|
|
123
|
-
If survivors remain: batch the confirmed findings for fixing: group findings by file — one file per set of sub-batches, chunked at max 5 findings per sub-batch; never mix two files in one batch. A finding with no `file` field is its own singleton batch. Sub-batches for the SAME file run sequentially (never two Code agents editing the same file concurrently — same-file edits in `parallel()` cause index contention and lost fixes); sub-batches for DISTINCT files run via `parallel()` in staggered chunks of ~5, same pacing bar as the Review spawn path (different code areas — safe per concurrency doctrine). Each Code agent's prompt pins a return contract: `{"status": "fixed"|"blocked", "commitShas": [...], "unresolved": [...]}` — a chunk is FIXED only when `result.status === "fixed"` AND `commitShas` is non-empty AND `result.unresolved` is empty; never decide disposition from status alone. A non-empty `unresolved` list means the agent named work it could not complete — carry the whole chunk into `survivingFindings` rather than guessing which findings the strings map to. `survivingFindings` = findings NOT addressed: fix Code agent dead/failed/blocked/deferred OR committed but left work named in `unresolved`. The fixing Code agent **self-verifies its own fix builds** (build/typecheck per the Code agent's Running commands block, once over its whole batch). Do **NOT** run Gate 1 or Gate 2 inside the pass (no Validate agent, no
|
|
123
|
+
If survivors remain: batch the confirmed findings for fixing: group findings by file — one file per set of sub-batches, chunked at max 5 findings per sub-batch; never mix two files in one batch. A finding with no `file` field is its own singleton batch. Sub-batches for the SAME file run sequentially (never two Code agents editing the same file concurrently — same-file edits in `parallel()` cause index contention and lost fixes); sub-batches for DISTINCT files run via `parallel()` in staggered chunks of ~5, same pacing bar as the Review spawn path (different code areas — safe per concurrency doctrine). Each Code agent's prompt pins a return contract: `{"status": "fixed"|"blocked", "commitShas": [...], "unresolved": [...]}` — a chunk is FIXED only when `result.status === "fixed"` AND `commitShas` is non-empty AND `result.unresolved` is empty; never decide disposition from status alone. A non-empty `unresolved` list means the agent named work it could not complete — carry the whole chunk into `survivingFindings` rather than guessing which findings the strings map to. `survivingFindings` = findings NOT addressed: fix Code agent dead/failed/blocked/deferred OR committed but left work named in `unresolved`. The fixing Code agent **self-verifies its own fix builds** (build/typecheck per the Code agent's Running commands block, once over its whole batch). Do **NOT** run Gate 1 or Gate 2 inside the pass (no Validate agent, no Polish agent, no Harden agent, no Evaluate agent, no Test agent). The engine runs ONE final Gate 1 after the pass exits — see the `gate1_postcode()` cadence (Gate 1 #2).
|
|
124
124
|
@end
|
|
125
125
|
|
|
126
126
|
@define concurrency_doctrine():
|
|
@@ -199,7 +199,7 @@ Each ticket engine run returns a structured result. The Synthesize agent or the
|
|
|
199
199
|
},
|
|
200
200
|
"escalations": [
|
|
201
201
|
{
|
|
202
|
-
"type": "merge-conflict | gate2-fail | validation-exhausted |
|
|
202
|
+
"type": "merge-conflict | gate2-fail | validation-exhausted | harden-blocked | ambiguous-resolution | review-coverage-incomplete | dependency-blocked | engine-crash | ticket-link-missing | branch-missing",
|
|
203
203
|
"description": "string"
|
|
204
204
|
}
|
|
205
205
|
],
|
|
@@ -215,9 +215,9 @@ Each ticket engine run returns a structured result. The Synthesize agent or the
|
|
|
215
215
|
@define engine_invariants():
|
|
216
216
|
### Engine invariants (non-negotiable)
|
|
217
217
|
|
|
218
|
-
1. **Code is written ONLY by Code
|
|
218
|
+
1. **Code is written ONLY by the Code family (Code, Fix).** No other agent type writes code — not Review agent, not Evaluate agent.
|
|
219
219
|
2. **Findings are verified before any fix is written.** The adversarial verification step is not optional; unverified findings are not passed to the Code agent.
|
|
220
|
-
3. **All written code passes Gate 1.** No code merge, commit, or handoff before
|
|
220
|
+
3. **All written code passes Gate 1.** No code merge, commit, or handoff before Polish agent + Harden agent + Validate agent (in that order — Validate last, so its one run covers the commits of the two before it).
|
|
221
221
|
4. **Gate 2 runs once, at implementation acceptance.** It does not re-run after review-fixes.
|
|
222
222
|
5. **NEVER auto-merge to main or master.** All merges target the integration branch. The user merges to main themselves.
|
|
223
223
|
6. **No unauthorized tracker or remote side-effects.** Sub-agents NEVER create issues/PRs on the tracker, comment on them, or push beyond the ticket-authorized branch unless the ticket, plan, or user explicitly authorizes that exact action. This applies to whatever tracker is resolved, not to one vendor. Proposed follow-ups go in the run report.
|
|
@@ -10,21 +10,4 @@ Accept the output only when it is exactly two lines: `exit=0` last and, before i
|
|
|
10
10
|
Set `EVIDENCE_POLICY`, `ISSUE_REQUIRED`, `APPLY_CONVENTIONS` and `REQUIRE_NON_AUTHOR_APPROVAL` from the accepted line. Pass agents only the three mechanism inputs, never `EVIDENCE_POLICY`. Report `Evidence policy: {EVIDENCE_POLICY} (source: {SOURCE})`, plus any `WARN` tokens as advisory, once in the final report.
|
|
11
11
|
@end
|
|
12
12
|
|
|
13
|
-
@define evidence_exception():
|
|
14
|
-
**Render each evidence exception** as one line under a `## Evidence Exceptions` heading, in exactly this shape:
|
|
15
|
-
|
|
16
|
-
```markdown
|
|
17
|
-
## Evidence Exceptions
|
|
18
|
-
- `<kind>` self-attested by @<login> at <utc>: <reason>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- `<kind>` is one of `ticket-link` or `test-plan` — a closed set; no other kind is ever rendered, and the section holds each kind at most once.
|
|
22
|
-
- `@<login>` is `@` followed by the output of `gh api user --jq .login` when that output matches `^[A-Za-z0-9][A-Za-z0-9-]{0,38}$`. On any other output, or a failed call, it is `(login unavailable)` instead, with no `@`.
|
|
23
|
-
- `<utc>` is the output of `date -u +%Y-%m-%dT%H:%M:%SZ`.
|
|
24
|
-
- `<reason>` is the user's own words, made inert: replace every character outside printable ASCII (newlines and tabs included) with a space, remove every `<`, `>`, `` ` ``, `[`, `]`, `\`, `/`, `#`, `@`, `&` and `$`, collapse runs of spaces, trim, keep the first 200 characters, and trim again. A reason that is empty after this is no reason.
|
|
25
|
-
|
|
26
|
-
Note: the section reaches a public PR body. The Code agent re-checks every line against this shape before it pastes, and the body's D11 scrub is the reason's secret scrub — rendering filters no secrets. A rendered reason carries no HTML or comment markers, link or image syntax, @-mentions, `#N` or full-URL references (no `/` survives), entities or shell-expansion characters; plain emphasis and `www.` or `GH-N` autolinks can remain — the requester authors the reason.
|
|
27
|
-
@end
|
|
28
|
-
|
|
29
13
|
@export evidence_policy
|
|
30
|
-
@export evidence_exception
|
|
@@ -3,6 +3,15 @@ imports nothing from `_settings.mds`. Write-back Step 1 takes `KNOWLEDGE` from t
|
|
|
3
3
|
settings line the host's settings block resolved above, and keeps the
|
|
4
4
|
`KNOWLEDGE=off` skip inside its own step.
|
|
5
5
|
|
|
6
|
+
D-CMD-CONDENSE (#456): a cut here lands in every host, so each one names the line
|
|
7
|
+
that keeps its text in the same context. Load's closing summary restated Steps 1-4,
|
|
8
|
+
which each name their read, and Step 2's closing sentence restated Step 3's fallback
|
|
9
|
+
fields. The Knowledge spawn names what only the caller knows (root, slug, directories,
|
|
10
|
+
files, the two paths, the index line format and its caps); how the agent writes the
|
|
11
|
+
index, writes the two files directly and commits them is held by its own body
|
|
12
|
+
(knowledge.mds steps 6-8, Direct Write Protocol, Commit Protocol), so the spawn no
|
|
13
|
+
longer restates it.
|
|
14
|
+
|
|
6
15
|
@define knowledge_load():
|
|
7
16
|
### Load Feature Knowledge
|
|
8
17
|
|
|
@@ -26,7 +35,7 @@ If `index.md` exists and contains at least one entry line, use it for relevance
|
|
|
26
35
|
|
|
27
36
|
**Step 2 — Fallback: glob frontmatter (if `index.md` is absent or empty):**
|
|
28
37
|
|
|
29
|
-
Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
|
|
38
|
+
Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read only its YAML frontmatter block (between the opening and closing `---` delimiters).
|
|
30
39
|
|
|
31
40
|
**Step 3 — Pick relevant KBs:**
|
|
32
41
|
|
|
@@ -57,7 +66,7 @@ Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
|
|
|
57
66
|
|
|
58
67
|
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)`.
|
|
59
68
|
|
|
60
|
-
**One git call, then direct reads — no `.cjs` script.**
|
|
69
|
+
**One git call, then direct reads — no `.cjs` script.**
|
|
61
70
|
@end
|
|
62
71
|
|
|
63
72
|
@export knowledge_load
|
|
@@ -96,22 +105,18 @@ FEATURE_NAME: {human-readable name}
|
|
|
96
105
|
DIRECTORIES: {list of primary directories touched by this workflow}
|
|
97
106
|
FILES_CHANGED: {list of files changed}
|
|
98
107
|
<!-- learning:on -->
|
|
99
|
-
DECISIONS_CONTEXT: {
|
|
108
|
+
DECISIONS_CONTEXT: {the slice for these directories, else (none)}
|
|
100
109
|
<!-- learning:end -->
|
|
101
110
|
|
|
102
111
|
Write the knowledge base to:
|
|
103
112
|
{worktree}/.devflow/features/{slug}/KNOWLEDGE.md
|
|
104
113
|
|
|
105
|
-
Then update the index cache
|
|
114
|
+
Then update the index cache:
|
|
106
115
|
{worktree}/.devflow/features/index.md
|
|
107
116
|
|
|
108
117
|
Index line format: `- **{slug}** — {areas} — {Use-when description}` — at most 300 characters, the description at most 220; reword a longer one, never cut it.
|
|
109
118
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
The frontmatter in KNOWLEDGE.md is the source of truth — index.md is only a cache. Write the two files directly — no intermediate result JSON files, no external scripts.
|
|
113
|
-
|
|
114
|
-
After writing, commit the two files to the current worktree branch yourself by running git via your Bash tool (do not use a script). Stage ONLY .devflow/features/index.md and .devflow/features/{slug}/KNOWLEDGE.md, then commit just those paths with a docs(knowledge): message. Do NOT push, do NOT force, do NOT stage anything else. Follow your Commit Protocol — it is non-blocking, so if any git step fails, report KB_COMMIT and finish normally."
|
|
119
|
+
Then commit the two files as your Commit Protocol directs."
|
|
115
120
|
```
|
|
116
121
|
|
|
117
122
|
**Step 4 — Surface an uncommitted knowledge base:**
|
|
@@ -56,7 +56,7 @@ Spawn devflow agents with:
|
|
|
56
56
|
agent("your prompt here", { agentType: "Code" })
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Valid `agentType` values: Code, Validate,
|
|
59
|
+
Valid `agentType` values: Code, Fix, Validate, Polish, Harden, Evaluate, Test, Review, Git, Synthesize, Knowledge, Design.
|
|
60
60
|
|
|
61
61
|
**OMIT `opts.model` whenever `agentType` is set.** The agent frontmatter carries its own model tier (Code→sonnet, Validate→haiku, Review→opus, etc.) and that tier is honored automatically. Passing `opts.model` overrides it — always a mistake.
|
|
62
62
|
|
|
@@ -80,7 +80,7 @@ The `budget` global governs depth. Scale Review agent roster and verification vo
|
|
|
80
80
|
|
|
81
81
|
### Handoff convention for sequential Code agents within a ticket
|
|
82
82
|
|
|
83
|
-
When a ticket requires multiple sequential Code agent phases, each Code agent appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{toplevel}/.devflow/docs/handoff-{branch_slug}.md` (branch-scoped to prevent concurrent session clobber), `{toplevel}` being `git rev-parse --show-toplevel` in the checkout the ticket's branch is in — never a subdirectory. It never rewrites an earlier section. The next Code agent reads, via HANDOFF_FILE input, only the section of the phase immediately before its own, not the whole file. PRIOR_PHASE_SUMMARY is the compact in-context form; the handoff file is the durable form that survives context compaction. Code is authoritative, summaries are supplementary.
|
|
83
|
+
When a ticket requires multiple sequential Code agent phases, each Code agent appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{toplevel}/.devflow/docs/handoff-{branch_slug}.md` (branch-scoped to prevent concurrent session clobber), `{branch_slug}` being the ticket's branch name with every `/` replaced by `-`, and `{toplevel}` being `git rev-parse --show-toplevel` in the checkout the ticket's branch is in — never a subdirectory. It never rewrites an earlier section. The next Code agent reads, via HANDOFF_FILE input, only the section of the phase immediately before its own, not the whole file. PRIOR_PHASE_SUMMARY is the compact in-context form; the handoff file is the durable form that survives context compaction. Code is authoritative, summaries are supplementary.
|
|
84
84
|
|
|
85
85
|
### IRON RULE (LLM-vs-plumbing)
|
|
86
86
|
|
|
@@ -101,7 +101,9 @@ When a ticket requires multiple sequential Code agent phases, each Code agent ap
|
|
|
101
101
|
|
|
102
102
|
Before you author the workflow script, read `{ledger}/.devflow/learning/index.md`. If the file is absent or empty, set `DECISIONS_CONTEXT` to `(none)`; otherwise use the file content as `DECISIONS_CONTEXT`.
|
|
103
103
|
|
|
104
|
-
The script body cannot perform this read — you (the main model) do it before authoring. Then inject the relevant DECISIONS_CONTEXT into the prompts of the Code, Design, Knowledge, Review and
|
|
104
|
+
The script body cannot perform this read — you (the main model) do it before authoring. Then inject the relevant DECISIONS_CONTEXT into the prompts of the Code, Fix, Design, Knowledge, Review and Harden agents, which follow `devflow:apply-decisions`. Those are the agent types above whose contract declares it; every other agent type gets no decisions context.
|
|
105
|
+
|
|
106
|
+
{{decisions.decisions_slice()}} The script carries one `DECISIONS_CONTEXT` for every agent, so cut it once, over the whole run.
|
|
105
107
|
|
|
106
108
|
<!-- learning:end -->
|
|
107
109
|
@end
|
|
@@ -5,11 +5,12 @@ The following agentType values are valid. Model tiers are shown for reference
|
|
|
5
5
|
|
|
6
6
|
| agentType | Model tier | Role |
|
|
7
7
|
|-----------|-----------|------|
|
|
8
|
-
| Code | sonnet |
|
|
8
|
+
| Code | sonnet | Implements the plan and fixes review findings — the Code family is the ONLY one that writes code |
|
|
9
|
+
| Fix | sonnet | Fixes the listed validation, alignment and QA failures — part of the Code family |
|
|
9
10
|
| Validate | haiku | Build / typecheck / lint / test — fast correctness gate |
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
| Evaluate |
|
|
11
|
+
| Polish | sonnet | Reduces complexity, removes duplication, improves readability |
|
|
12
|
+
| Harden | opus | 9-pillar self-review — deep structural analysis |
|
|
13
|
+
| Evaluate | sonnet | Plan-fidelity / alignment — "was the plan implemented correctly?" |
|
|
13
14
|
| Test | sonnet | Scenario-based acceptance tests against acceptance criteria |
|
|
14
15
|
| Review | opus | Focus-parameterized code review — spawn ONE agent() per focus area |
|
|
15
16
|
| Git | haiku | Git operations — branches, commits, merges, worktree management |
|
|
@@ -21,7 +22,7 @@ The following agentType values are valid. Model tiers are shown for reference
|
|
|
21
22
|
@define agent_caveats():
|
|
22
23
|
### Agent caveats
|
|
23
24
|
|
|
24
|
-
- **
|
|
25
|
+
- **The Code family writes every fix** — Code for review findings, Fix for gate failures; no other agent type writes code. Finding-verification uses adversarial Review agent-style passes (§6.3 of design doc). Risk-assessment and tech-debt routing live in the post-code pipeline + escalation doctrine.
|
|
25
26
|
- **Always omit `opts.model` with `agentType`.** Each agent honors its own frontmatter model tier; overriding it defeats the per-agent specialization.
|
|
26
27
|
- **Review agents are focus-parameterized.** Each focus is a SEPARATE `agent()` call with `agentType: "Review"` and the focus baked into the prompt. Do NOT batch multiple focuses into one Review agent call — that defeats parallel specialization.
|
|
27
28
|
- **Do not depend on agents enumerating their own skills.** Skills are loaded (spike F5 confirmed) but self-reporting is imperfect. Write agent prompts that give the agent full context directly.
|
|
@@ -86,9 +86,9 @@ Two parallel sibling tickets can produce real git conflicts. The resolution is *
|
|
|
86
86
|
|
|
87
87
|
1. Git agent detects the conflict and reports the conflicting files + sections
|
|
88
88
|
<!-- learning:on -->
|
|
89
|
-
2. Spawn a Code agent whose prompt opens with `OPERATION: implement` and carries `
|
|
89
|
+
2. Spawn a Code agent whose prompt opens with `OPERATION: implement` and carries `COMPLIANCE_DIRECTIVE` (when it is not empty) and `DECISIONS_CONTEXT`, with FULL intent context:
|
|
90
90
|
<!-- learning:off -->
|
|
91
|
-
2. Spawn a Code agent whose prompt opens with `OPERATION: implement` and carries `
|
|
91
|
+
2. Spawn a Code agent whose prompt opens with `OPERATION: implement` and carries `COMPLIANCE_DIRECTIVE` (when it is not empty), with FULL intent context:
|
|
92
92
|
<!-- learning:end -->
|
|
93
93
|
- Both ticket descriptions and plans
|
|
94
94
|
- The conflicting diff sections (both sides)
|
|
@@ -30,7 +30,7 @@ Run a proactive bug analysis on the current branch by combining static analysis
|
|
|
30
30
|
{{docs_root()}}
|
|
31
31
|
|
|
32
32
|
Render the test-plan block from `/implement`'s evidence file, and from nothing else:
|
|
33
|
-
1. `branch_slug` is `git branch --show-current` with every `/` replaced by `-`.
|
|
33
|
+
1. `branch_slug` is `git -C "{worktree}" branch --show-current` with every `/` replaced by `-`.
|
|
34
34
|
2. Only when `branch_slug` matches `^[A-Za-z0-9._-]{1,200}$` and the file exists, run (the path double-quoted):
|
|
35
35
|
|
|
36
36
|
```bash
|
|
@@ -188,8 +188,8 @@ If no tool produced findings: set `STATIC_FINDINGS` to `(none)`.
|
|
|
188
188
|
|
|
189
189
|
#### Plan Artifact
|
|
190
190
|
|
|
191
|
-
1. List `{worktree}/.devflow/docs/design/*.md`
|
|
192
|
-
2. Read the most recent file
|
|
191
|
+
1. List the design plans: `{worktree}/.devflow/docs/design/*.md` (a `/plan` artifact) and `{worktree}/.devflow/docs/design/*/*/*-plan.md` (a `/dynamic-plan` per-ticket plan). Sort by timestamp, newest first, and scan the 10 most recent. A `/plan` artifact's timestamp is the `YYYY-MM-DD_HHMM` before its `.md`; a per-ticket plan's is the name of its parent directory. Never sort by file name, which starts with an issue ID or a ticket slug. A per-ticket plan counts only when its `{ticket-slug}` (its file name without `-plan.md`) appears in the worktree's branch name
|
|
192
|
+
2. Read the most recent file that carries an `## Acceptance Criteria` section
|
|
193
193
|
3. Extract `## Acceptance Criteria` section → parse into table: `| ID | Criterion | Type | Testable Condition |`
|
|
194
194
|
4. Set `PLAN_CONTEXT` to plan summary; `ACCEPTANCE_RULES` to the table
|
|
195
195
|
5. If no plan files exist or section not found: `PLAN_CONTEXT=(none)`, `ACCEPTANCE_RULES=(none)`
|
|
@@ -217,11 +217,11 @@ Determine which focus analyzers to run using `CHANGED_FILES` (already computed i
|
|
|
217
217
|
**Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, FEATURE_KNOWLEDGE
|
|
218
218
|
<!-- learning:end -->
|
|
219
219
|
|
|
220
|
-
Spawn ALL active
|
|
220
|
+
Spawn ALL active Debug agents **in a single message** (parallel, NOT background):
|
|
221
221
|
|
|
222
222
|
For each active focus, spawn:
|
|
223
223
|
```
|
|
224
|
-
Agent(subagent_type="
|
|
224
|
+
Agent(subagent_type="Debug", run_in_background=false):
|
|
225
225
|
"Analyze focusing on {focus}.
|
|
226
226
|
FOCUS: {focus}
|
|
227
227
|
DIFF_COMMAND: git diff {DIFF_RANGE}
|
|
@@ -325,10 +325,10 @@ Run `/resolve` to process and fix these findings.
|
|
|
325
325
|
│ └─ Detect active focuses (security + functional always; integration + usability conditional)
|
|
326
326
|
│
|
|
327
327
|
├─ Phase 5: Bug Analysis (PARALLEL)
|
|
328
|
-
│ ├─
|
|
329
|
-
│ ├─
|
|
330
|
-
│ ├─
|
|
331
|
-
│ └─
|
|
328
|
+
│ ├─ Debug agent: security (+ STATIC_FINDINGS)
|
|
329
|
+
│ ├─ Debug agent: functional
|
|
330
|
+
│ ├─ Debug agent: integration (conditional)
|
|
331
|
+
│ └─ Debug agent: usability (conditional)
|
|
332
332
|
│
|
|
333
333
|
├─ Phase 6: Synthesis
|
|
334
334
|
│ └─ Synthesize agent (mode: bug-analysis)
|
|
@@ -365,7 +365,7 @@ Run `/resolve` after `/bug-analysis` to fix identified bugs. `/resolve` automati
|
|
|
365
365
|
2. **Parallel, not background** — Analyzers spawn in one message with `run_in_background=false`
|
|
366
366
|
3. **Static + semantic** — Two complementary tracks, each validates the other
|
|
367
367
|
4. **Incremental by default** — Only analyze new changes unless `--full` specified
|
|
368
|
-
5. **Verify before reporting** —
|
|
368
|
+
5. **Verify before reporting** — Debug agents self-verify every finding
|
|
369
369
|
6. **Honest reporting** — Display risk level and counts directly from synthesis
|
|
370
370
|
|
|
371
371
|
## Phase Completion Checklist
|