devflow-kit 3.6.0 → 3.8.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 +438 -1
- package/README.md +15 -11
- package/dist/agents/code.md +9 -15
- package/dist/agents/design.md +1 -1
- package/dist/agents/fix.md +11 -13
- package/dist/agents/git.md +1 -1
- package/dist/agents/harden.md +1 -1
- package/dist/agents/refactor.md +7 -10
- package/dist/agents/review.md +6 -4
- package/dist/agents/skim.md +2 -2
- package/dist/agents/triage.md +2 -2
- package/dist/cli/commands/capture.js +1 -1
- package/dist/cli/commands/curation-move-io.js +102 -0
- package/dist/cli/commands/curation-move-step.js +374 -0
- package/dist/cli/commands/{learning.js → curation.js} +302 -99
- package/dist/cli/commands/gate-level-prompts.js +426 -0
- package/dist/cli/commands/gates.js +299 -0
- package/dist/cli/commands/init-seed.js +16 -5
- package/dist/cli/commands/init.js +263 -54
- package/dist/cli/commands/memory.js +20 -2
- package/dist/cli/commands/prompt-io.js +37 -0
- package/dist/cli/commands/uninstall.js +81 -9
- package/dist/cli.js +4 -2
- package/dist/commands/bug-analysis.md +25 -36
- package/dist/commands/code-review.md +77 -73
- package/dist/commands/debug.md +5 -5
- package/dist/commands/dynamic-build.md +76 -83
- package/dist/commands/dynamic-plan.md +5 -5
- package/dist/commands/dynamic-profile.md +5 -5
- package/dist/commands/dynamic-tickets.md +5 -5
- package/dist/commands/explore.md +6 -6
- package/dist/commands/implement.md +68 -102
- package/dist/commands/plan.md +19 -29
- package/dist/commands/release.md +5 -5
- package/dist/commands/research.md +6 -6
- package/dist/commands/resolve.md +29 -31
- package/dist/commands/self-review.md +5 -13
- package/dist/core/assets.js +20 -20
- package/dist/core/curate-tuning-config.js +5 -6
- package/dist/core/curation-move-notice.js +84 -0
- package/dist/core/curation-move-skip.js +36 -0
- package/dist/core/curation-move.js +35 -0
- package/dist/core/curation-queue-cleanup.js +134 -0
- package/dist/core/curation-store.js +98 -0
- package/dist/core/{learning-variants.js → curation-variants.js} +65 -41
- package/dist/core/echo-value.js +48 -0
- package/dist/core/evidence-policy.js +18 -6
- package/dist/core/feature-switch.js +95 -19
- package/dist/core/fs-atomic.js +1 -1
- package/dist/core/gate-level.js +221 -0
- package/dist/core/git.js +16 -14
- package/dist/core/ledger-root.js +82 -22
- package/dist/core/linked-path.js +4 -4
- package/dist/core/manifest-lock.js +238 -0
- package/dist/core/manifest.js +84 -24
- package/dist/core/migrations.js +1 -13
- package/dist/core/model-discovery.js +7 -1
- package/dist/core/observations.js +2 -2
- package/dist/core/plugins.js +15 -15
- package/dist/core/pool.js +26 -0
- package/dist/core/project-paths.js +103 -34
- package/dist/core/queue-drain.js +2 -2
- package/dist/core/tracked-areas.js +35 -0
- package/dist/core/tracker.js +6 -34
- package/dist/{learning-off → curation-off}/agents/code.md +9 -15
- package/dist/{learning-off → curation-off}/agents/fix.md +11 -13
- package/dist/{learning-off → curation-off}/agents/refactor.md +7 -10
- package/dist/{learning-off → curation-off}/agents/review.md +5 -3
- package/dist/{learning-off → curation-off}/agents/triage.md +1 -1
- package/dist/{learning-off → curation-off}/commands/bug-analysis.md +20 -31
- package/dist/{learning-off → curation-off}/commands/code-review.md +74 -70
- package/dist/{learning-off → curation-off}/commands/debug.md +2 -2
- package/dist/{learning-off → curation-off}/commands/dynamic-build.md +73 -80
- package/dist/{learning-off → curation-off}/commands/explore.md +2 -2
- package/dist/{learning-off → curation-off}/commands/implement.md +65 -99
- package/dist/{learning-off → curation-off}/commands/plan.md +15 -25
- package/dist/{learning-off → curation-off}/commands/resolve.md +26 -28
- package/dist/{learning-off → curation-off}/commands/self-review.md +2 -10
- package/dist/hud/components/{learning-counts.js → curation-counts.js} +36 -17
- package/dist/hud/config.js +1 -1
- package/dist/hud/index.js +6 -6
- package/dist/hud/render.js +3 -3
- package/dist/skills/git/references/pr/validate-branch.md +8 -5
- package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +20 -14
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +20 -20
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +20 -20
- package/dist/targets/claude-code/{learning-install.js → curation-install.js} +99 -67
- package/dist/targets/claude-code/installer.js +15 -15
- package/dist/targets/claude-code/language-stamp.js +5 -5
- package/dist/targets/claude-code/post-install.js +2 -2
- package/dist/targets/claude-code/tracker-servers.js +1 -1
- package/package.json +3 -2
- package/src/assets/agents/_partials/_code.mds +16 -17
- package/src/assets/agents/code.mds +4 -7
- package/src/assets/agents/curate.md +12 -14
- package/src/assets/agents/debug.mds +6 -6
- package/src/assets/agents/design.mds +18 -18
- package/src/assets/agents/fix.mds +6 -5
- package/src/assets/agents/git.mds +1 -1
- package/src/assets/agents/harden.mds +7 -7
- package/src/assets/agents/knowledge.mds +23 -23
- package/src/assets/agents/refactor.mds +2 -2
- package/src/assets/agents/research.mds +15 -15
- package/src/assets/agents/review.mds +45 -43
- package/src/assets/agents/skim.mds +11 -11
- package/src/assets/agents/synthesize.md +2 -2
- package/src/assets/agents/triage.mds +22 -22
- package/src/assets/agents/validate.md +13 -26
- package/src/assets/commands/_partials/_decisions.mds +13 -13
- package/src/assets/commands/_partials/_engine.mds +8 -8
- package/src/assets/commands/_partials/_knowledge.mds +29 -15
- package/src/assets/commands/_partials/_preamble.mds +4 -4
- package/src/assets/commands/_partials/_settings.mds +3 -3
- package/src/assets/commands/_partials/_wave.mds +17 -24
- package/src/assets/commands/bug-analysis.mds +37 -48
- package/src/assets/commands/code-review.mds +90 -86
- package/src/assets/commands/debug.mds +14 -14
- package/src/assets/commands/dynamic-build.mds +78 -78
- package/src/assets/commands/dynamic-plan.mds +22 -22
- package/src/assets/commands/dynamic-profile.mds +2 -2
- package/src/assets/commands/dynamic-tickets.mds +8 -8
- package/src/assets/commands/explore.mds +20 -20
- package/src/assets/commands/implement.mds +92 -118
- package/src/assets/commands/plan.mds +41 -51
- package/src/assets/commands/release.mds +12 -12
- package/src/assets/commands/research.mds +19 -19
- package/src/assets/commands/resolve.mds +56 -50
- package/src/assets/commands/self-review.mds +20 -20
- package/src/assets/mds/git/_ops.mds +3 -1
- package/src/assets/mds/git/_ops_pr.mds +1 -1
- package/src/assets/mds/git/_ops_steps.mds +13 -7
- package/src/assets/mds/git/_pr.mds +7 -4
- 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/rules/quality.md +1 -0
- package/src/assets/scripts/ci-wait.cjs +22 -4
- package/src/assets/scripts/claude-md-audit.cjs +66 -51
- package/src/assets/scripts/hooks/background-memory-update +406 -97
- package/src/assets/scripts/hooks/capture-prompt +12 -12
- package/src/assets/scripts/hooks/capture-question +11 -11
- package/src/assets/scripts/hooks/capture-turn +12 -12
- package/src/assets/scripts/hooks/{learning-lock → curation-lock} +2 -2
- package/src/assets/scripts/hooks/curation-move +293 -0
- package/src/assets/scripts/hooks/ensure-devflow-init +45 -13
- package/src/assets/scripts/hooks/ensure-proxy +4 -4
- package/src/assets/scripts/hooks/ensure-root-gitignore +4 -4
- package/src/assets/scripts/hooks/git-marker +81 -0
- package/src/assets/scripts/hooks/json-helper.cjs +145 -51
- package/src/assets/scripts/hooks/json-parse +19 -4
- package/src/assets/scripts/hooks/lib/curation-move.cjs +1582 -0
- package/src/assets/scripts/hooks/lib/{learning-store.cjs → curation-store.cjs} +242 -118
- package/src/assets/scripts/hooks/lib/decisions-format.cjs +3 -3
- package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +24 -7
- package/src/assets/scripts/hooks/lib/project-paths.cjs +132 -39
- package/src/assets/scripts/hooks/lib/render-decisions.cjs +34 -22
- package/src/assets/scripts/hooks/lib/tracked-areas.cjs +259 -0
- package/src/assets/scripts/hooks/memory-permission +358 -0
- package/src/assets/scripts/hooks/memory-worker +1 -1
- package/src/assets/scripts/hooks/pre-compact-memory +6 -16
- package/src/assets/scripts/hooks/queue-append +228 -103
- package/src/assets/scripts/hooks/resolve-project-root +2 -2
- package/src/assets/scripts/hooks/session-start-context +145 -71
- package/src/assets/scripts/hooks/session-start-memory +27 -46
- package/src/assets/scripts/lib/project-config.cjs +31 -9
- package/src/assets/scripts/resolve-base.cjs +1043 -0
- package/src/assets/scripts/resolve-settings.cjs +238 -46
- package/src/assets/skills/agent-references/SKILL.md +9 -2
- package/src/assets/skills/agent-references/references/commands/code-review-levels.md +19 -0
- package/src/assets/skills/agent-references/references/commands/implement-levels.md +27 -0
- package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +6 -4
- package/src/assets/skills/agent-references/references/commands/plan-levels.md +40 -0
- package/src/assets/skills/agent-references/references/commands/resolve-levels.md +24 -0
- 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 +1 -1
- package/src/assets/skills/docs-framework/SKILL.md +7 -7
- package/src/assets/skills/docs-framework/references/patterns.md +3 -4
- package/src/assets/skills/quality-gates/SKILL.md +1 -1
- package/src/assets/skills/worktree-support/references/roots.md +2 -2
- package/templates/lint-pack/.lint-pack.conf +86 -0
- package/templates/lint-pack/README.md +190 -0
- package/templates/lint-pack/lint-pack.sh +905 -0
- package/dist/core/learning-queue-cleanup.js +0 -27
- package/dist/core/learning-store.js +0 -61
- /package/dist/{learning-off → curation-off}/agents/debug.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/design.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/harden.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/knowledge.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/research.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/skim.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-plan.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-profile.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-tickets.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/release.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/research.md +0 -0
|
@@ -3,7 +3,7 @@ description: Comprehensive branch review using specialized sub-agents for PR rea
|
|
|
3
3
|
---
|
|
4
4
|
# Code Review Command
|
|
5
5
|
|
|
6
|
-
Run a comprehensive code review of the current branch by spawning parallel review agents, then synthesizing results into PR comments.
|
|
6
|
+
Run a comprehensive code review of the current branch by spawning parallel review agents, then synthesizing results into PR comments.
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
@@ -27,13 +27,13 @@ Run a comprehensive code review of the current branch by spawning parallel revie
|
|
|
27
27
|
- **More than one listed:** Invoke the `devflow:worktree-support` skill, then Read its `references/discovery.md` from the skill's base directory for the full 7-step algorithm; the canonical protected branch list stays in the skill. Parse the list, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit
|
|
28
28
|
- **Exactly one listed:** load neither the skill nor the reference — that worktree is the only candidate, and Step 0c's Git agent validates its branch
|
|
29
29
|
2. **If `--path` flag provided:** use only that worktree, skip discovery
|
|
30
|
-
**`--path` validation**:
|
|
31
|
-
3. **If only 1 reviewable worktree
|
|
30
|
+
**`--path` validation**: the path must be a directory in `git worktree list` output; if not, report an error and stop.
|
|
31
|
+
3. **If only 1 reviewable worktree**: proceed as single-worktree flow
|
|
32
32
|
4. **If multiple reviewable worktrees:** report "Found N worktrees with reviewable branches: {list with paths and branches}" and proceed with multi-worktree flow
|
|
33
33
|
|
|
34
|
-
#### Step 0b: Resolve the compliance lens
|
|
34
|
+
#### Step 0b: Resolve the compliance lens and gate level
|
|
35
35
|
|
|
36
|
-
**Produces:** COMPLIANCE_ACTIVE, COMPLIANCE_FRAMEWORKS
|
|
36
|
+
**Produces:** COMPLIANCE_ACTIVE, COMPLIANCE_FRAMEWORKS, GATE_LEVEL
|
|
37
37
|
|
|
38
38
|
**Resolve the settings line** once per worktree root, reusing a line this run already resolved for the same root. `{root}` is the worktree the values are for — the repository root when the run has one worktree:
|
|
39
39
|
|
|
@@ -41,16 +41,16 @@ Run a comprehensive code review of the current branch by spawning parallel revie
|
|
|
41
41
|
node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off>
|
|
44
|
+
Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> CURATION=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on CURATION=on KNOWLEDGE=off GATE_LEVEL=full` instead.
|
|
45
45
|
|
|
46
|
-
The accepted line is the only source of these values
|
|
46
|
+
The accepted line is the only source of these values.
|
|
47
47
|
|
|
48
48
|
**Resolve the compliance lens** for each worktree root, from its settings line — the line resolved above for that root, by the settings block when this run has not yet resolved it (every framework reference is installed on every machine, so no file check decides it).
|
|
49
49
|
|
|
50
50
|
**Set the compliance lens** from that line: `COMPLIANCE_FRAMEWORKS` is the settings line's `COMPLIANCE` with `generic` written `none`: `off`, `none`, or the framework ids the machine and this repository declare.
|
|
51
51
|
|
|
52
52
|
`COMPLIANCE_ACTIVE` is `true` unless `COMPLIANCE_FRAMEWORKS` is `off`.
|
|
53
|
-
Keep each worktree's values for every downstream phase
|
|
53
|
+
Keep each worktree's values for every downstream phase.
|
|
54
54
|
|
|
55
55
|
#### Step 0b-ii: Resolve the evidence policy
|
|
56
56
|
|
|
@@ -97,20 +97,20 @@ PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
|
97
97
|
PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK verbatim, or (none)}
|
|
98
98
|
APPLY_CONVENTIONS: {APPLY_CONVENTIONS}
|
|
99
99
|
Validate branch, commit if needed, push, create PR if needed.
|
|
100
|
-
Return: branch, base_branch, branch-slug, PR#"
|
|
100
|
+
Return: branch, base_branch, base_ref, branch-slug, PR#"
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
In multi-worktree mode, spawn all pre-flight agents **in a single message
|
|
103
|
+
In multi-worktree mode, spawn all pre-flight agents **in a single message**.
|
|
104
104
|
|
|
105
105
|
**If BLOCKED:** In single-worktree mode, stop and report. In multi-worktree mode, report the failure but continue with other worktrees.
|
|
106
106
|
|
|
107
|
-
**Extract from response:** `branch`, `base_branch`, `branch_slug`, `pr_number` per worktree.
|
|
107
|
+
**Extract from response:** `branch`, `base_branch`, `base_ref`, `branch_slug`, `pr_number` per worktree. Stop with cause and fix when the Base line reads (rejected) or `branch_slug` does not match the slug pattern above; name the Git agent's fix, never your own, and for the slug the allowed characters, never its value. In multi-worktree mode this blocks only that worktree.
|
|
108
108
|
|
|
109
109
|
**Fetch PR body** (after extracting `pr_number`):
|
|
110
110
|
```bash
|
|
111
111
|
PR_DESCRIPTION=$(gh pr view {pr_number} --json body --jq '.body' 2>/dev/null || echo "(none)")
|
|
112
112
|
```
|
|
113
|
-
If `pr_number` is absent
|
|
113
|
+
If `pr_number` is absent, set `PR_DESCRIPTION` to `(none)`.
|
|
114
114
|
|
|
115
115
|
#### Step 0d: Incremental Detection & Timestamp Setup
|
|
116
116
|
|
|
@@ -120,15 +120,16 @@ If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
|
|
|
120
120
|
For each worktree:
|
|
121
121
|
|
|
122
122
|
1. Generate timestamp: `YYYY-MM-DD_HHMM`. If directory already exists (same-minute collision), append seconds (`YYYY-MM-DD_HHMMSS`).
|
|
123
|
-
2.
|
|
124
|
-
3. Check if `{worktree}/.devflow/docs/reviews/{branch-slug}/.last-review-head` exists:
|
|
123
|
+
2. Check if `{gd}/devflow/reviews/{branch-slug}/.last-review-head` exists, `{gd}` being what `git -C "{worktree}" rev-parse --absolute-git-dir` prints:
|
|
125
124
|
- **If yes AND `--full` NOT set:**
|
|
126
|
-
-
|
|
127
|
-
- Verify reachable: `git -C {worktree} cat-file -t {sha}`
|
|
125
|
+
- The stored review head is checked as a commit ID: use it only when it is exactly 40 or 64 lowercase hex, else take the full-range path
|
|
126
|
+
- Verify reachable: `git -C "{worktree}" cat-file -t {sha}` must print `commit` (else take the full-range path)
|
|
128
127
|
- Check if SHA == current HEAD → if so, skip review: "No new commits since last review. Use --full for a full re-review."
|
|
129
128
|
- Set `DIFF_RANGE` to `{last-review-sha}...HEAD`
|
|
130
|
-
- **
|
|
131
|
-
-
|
|
129
|
+
- **Full-range path (no marker, or `--full`):**
|
|
130
|
+
- Stop as for a (rejected) Base line unless `base_ref` is 40 or 64 hex.
|
|
131
|
+
- Set `DIFF_RANGE` to `{base_ref}...HEAD`
|
|
132
|
+
3. Create timestamped review directory: `mkdir -p {worktree}/.devflow/docs/reviews/{branch-slug}/{timestamp}/`
|
|
132
133
|
|
|
133
134
|
#### Step 0e-i: Load Prior Resolution and Count Cycles
|
|
134
135
|
|
|
@@ -140,7 +141,7 @@ For each worktree, perform a single pass over timestamped directories:
|
|
|
140
141
|
2. Iterate once: accumulate CYCLE_NUMBER count for each directory containing `resolution-summary.md`; capture the first (most-recent) such directory as PRIOR_DIR.
|
|
141
142
|
3. If CYCLE_NUMBER = 0: set PRIOR_RESOLUTIONS=(none), CYCLE_NUMBER=1, proceed.
|
|
142
143
|
4. Otherwise: set CYCLE_NUMBER = count + 1. Read `{PRIOR_DIR}/resolution-summary.md` as PRIOR_RESOLUTIONS.
|
|
143
|
-
5. If `--full`: still load PRIOR_RESOLUTIONS
|
|
144
|
+
5. If `--full`: still load PRIOR_RESOLUTIONS.
|
|
144
145
|
|
|
145
146
|
#### Step 0e-ii: Convergence Assessment
|
|
146
147
|
|
|
@@ -186,7 +187,7 @@ Note: `auto` is NOT fail-open — under `auto`, the Git agent probes the reposit
|
|
|
186
187
|
### Phase 1: Analyze Changed Files
|
|
187
188
|
|
|
188
189
|
**Produces:** REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
|
|
189
|
-
**Requires:** DIFF_RANGE, REVIEW_DIR, COMPLIANCE_ACTIVE (from Step 0b)
|
|
190
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR, COMPLIANCE_ACTIVE, GATE_LEVEL (from Step 0b)
|
|
190
191
|
|
|
191
192
|
Per worktree, in order. Each `git` command here writes to a file and prints nothing.
|
|
192
193
|
|
|
@@ -199,10 +200,11 @@ List the changed paths into `{REVIEW_DIR}/paths.txt` and print only the line cou
|
|
|
199
200
|
|
|
200
201
|
```bash
|
|
201
202
|
git -C "{WORKTREE_PATH}" diff --name-only --no-renames {DIFF_RANGE} > "{REVIEW_DIR}/paths.txt"
|
|
203
|
+
echo "exit=$?"
|
|
202
204
|
wc -l < "{REVIEW_DIR}/paths.txt"
|
|
203
205
|
```
|
|
204
206
|
|
|
205
|
-
Read `paths.txt` once when the count is about 40 or fewer, and in ranges of about 40 lines (Read with offset and limit) when it is more.
|
|
207
|
+
The `exit=` line is the diff's. A non-zero diff exit stops. Read `paths.txt` once when the count is about 40 or fewer, and in ranges of about 40 lines (Read with offset and limit) when it is more.
|
|
206
208
|
|
|
207
209
|
Set `DIFF_CLASS` by these rules, in order; the first that decides wins:
|
|
208
210
|
|
|
@@ -219,7 +221,7 @@ Each reduced class runs only its focus set, every member reading `diff.patch`:
|
|
|
219
221
|
- `tests-only`: testing, reliability, consistency, security
|
|
220
222
|
- `lockfile-only`: dependencies, security
|
|
221
223
|
|
|
222
|
-
A mixed non-code diff runs the union of the sets of the classes it holds. Language and conditional triggers inside a reduced class are suppressed
|
|
224
|
+
A mixed non-code diff runs the union of the sets of the classes it holds. Language and conditional triggers inside a reduced class are suppressed.
|
|
223
225
|
|
|
224
226
|
#### Step 1.2: Choose the focuses
|
|
225
227
|
|
|
@@ -243,13 +245,27 @@ When `DIFF_CLASS` is `code`, read the file types from the paths in `paths.txt` t
|
|
|
243
245
|
| Docs or significant code | documentation |
|
|
244
246
|
| COMPLIANCE_ACTIVE AND diff touches regulated surface | compliance |
|
|
245
247
|
|
|
246
|
-
If `COMPLIANCE_ACTIVE` AND the diff touches regulated surface (data models, auth flows, logging/observability, payments, IaC, retention):
|
|
248
|
+
If `COMPLIANCE_ACTIVE` AND the diff touches regulated surface (data models, auth flows, logging/observability, payments, IaC, retention): on a `code` diff, add `compliance`.
|
|
247
249
|
|
|
248
250
|
**Language focus stamp.** The eight language focuses — `typescript`, `react`, `accessibility`, `ui-design`, `go`, `java`, `python`, `rust` — ship with optional plugins, and the installer stamps the ones installed on this machine onto this line, rewriting it on every install and on `uninstall --plugin`:
|
|
249
251
|
|
|
250
252
|
Installed language focuses: (none)
|
|
251
253
|
|
|
252
|
-
A language focus is spawned only when its file-type condition above fires AND its name appears in that stamped line. A focus missing from the line is never spawned, even when its trigger fires.
|
|
254
|
+
A language focus is spawned only when its file-type condition above fires AND its name appears in that stamped line. A focus missing from the line is never spawned, even when its trigger fires. On a `code` diff, REVIEW_FOCUS_LIST starts with the eight core focuses. Step 1.2b may narrow them; they are never stamp-gated.
|
|
255
|
+
|
|
256
|
+
#### Step 1.2b: Narrow by gate level
|
|
257
|
+
|
|
258
|
+
**Produces:** REVIEW_FOCUS_LIST, GATE_LEVEL
|
|
259
|
+
**Requires:** REVIEW_FOCUS_LIST, DIFF_CLASS, CHANGED_PATHS, GATE_LEVEL
|
|
260
|
+
|
|
261
|
+
**Gate level.** Narrow REVIEW_FOCUS_LIST, for every class, by this worktree's `GATE_LEVEL`. `full` keeps it and reads nothing.
|
|
262
|
+
|
|
263
|
+
At `standard` or `lean`, once per run, run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash and Read `<that directory>/skills/devflow:agent-references/references/commands/code-review-levels.md` with the Read tool.
|
|
264
|
+
|
|
265
|
+
- Apply each class's row to that class's own set, then take the union of the results. A row only removes focuses.
|
|
266
|
+
- If the Read fails, or a row is missing or malformed, set `GATE_LEVEL` to `full` for every worktree of this run and say `level reference unreadable: full sets applied`.
|
|
267
|
+
- Security runs at every level and in every class.
|
|
268
|
+
- Compliance keeps the trigger above at every level.
|
|
253
269
|
|
|
254
270
|
#### Step 1.3: Write the diff files
|
|
255
271
|
|
|
@@ -262,7 +278,7 @@ Write `diff.patch` once per worktree, by redirect:
|
|
|
262
278
|
git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} > "{REVIEW_DIR}/diff.patch"
|
|
263
279
|
```
|
|
264
280
|
|
|
265
|
-
It holds the whole diff of `DIFF_RANGE`. On a `code` diff, add one patch for each language focus in REVIEW_FOCUS_LIST, by the same command with quoted pathspecs from this table:
|
|
281
|
+
It holds the whole diff of `DIFF_RANGE`. A non-zero exit of any patch write stops. On a `code` diff, add one patch for each language focus in REVIEW_FOCUS_LIST, by the same command with quoted pathspecs from this table:
|
|
266
282
|
|
|
267
283
|
```bash
|
|
268
284
|
git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} -- '<pathspec>' ... > "{REVIEW_DIR}/diff-{focus}.patch"
|
|
@@ -286,7 +302,7 @@ The core, database, dependencies, documentation and compliance focuses, and ever
|
|
|
286
302
|
|
|
287
303
|
### Load DECISIONS_CONTEXT
|
|
288
304
|
|
|
289
|
-
When the settings line says `
|
|
305
|
+
When the settings line says `CURATION=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
|
|
290
306
|
|
|
291
307
|
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`):
|
|
292
308
|
|
|
@@ -300,11 +316,11 @@ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older
|
|
|
300
316
|
2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
|
|
301
317
|
3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
|
|
302
318
|
|
|
303
|
-
This is the rule the
|
|
319
|
+
This is the rule the curation hooks apply, so you read the index the Curate agent writes.
|
|
304
320
|
|
|
305
321
|
**Step 1 — Read the pre-rendered index:**
|
|
306
322
|
|
|
307
|
-
Attempt to read `{ledger}/.devflow/
|
|
323
|
+
Attempt to read `{ledger}/.devflow/curation/index.md`.
|
|
308
324
|
|
|
309
325
|
- If the file exists and contains non-empty content: use that content as `DECISIONS_CONTEXT`.
|
|
310
326
|
- If the file is absent or empty: set `DECISIONS_CONTEXT` to `(none)`.
|
|
@@ -383,9 +399,9 @@ Pass `FEATURE_KNOWLEDGE` to all Review agents alongside `DECISIONS_CONTEXT`.
|
|
|
383
399
|
**Produces:** REVIEW_FOCUS_OUTPUTS
|
|
384
400
|
**Requires:** DIFF_RANGE, REVIEW_DIR, TIMESTAMP, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, PR_DESCRIPTION, PRIOR_RESOLUTIONS, REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
|
|
385
401
|
|
|
386
|
-
Spawn Review agents **in a single message**,
|
|
402
|
+
Spawn Review agents **in a single message**, one per focus in REVIEW_FOCUS_LIST (max 20 per worktree):
|
|
387
403
|
|
|
388
|
-
- `code`: the 8 core reviews on the full `diff.patch
|
|
404
|
+
- `code`: the 8 core reviews on the full `diff.patch` (lean keeps 3), plus the language and conditional focuses Phase 1 added.
|
|
389
405
|
- `docs-only`, `tests-only`, `lockfile-only`: only the reduced set Phase 1 names, each reading `diff.patch`; a mixed non-code diff runs the union. No language or conditional focus is spawned, whatever its trigger.
|
|
390
406
|
|
|
391
407
|
| Focus | Runs | Pattern Skill | DIFF_FILE |
|
|
@@ -411,7 +427,7 @@ Spawn Review agents **in a single message**, for the focus set `DIFF_CLASS` sele
|
|
|
411
427
|
| documentation | conditional | devflow:documentation | diff.patch |
|
|
412
428
|
| compliance | diff-driven | devflow:compliance | diff.patch |
|
|
413
429
|
|
|
414
|
-
Review agent count: `code` runs 8 core
|
|
430
|
+
Review agent count: `code` runs 8 core +1-12 at `full`, up to 2 fewer at `standard`, 3-4 at lean; a reduced class or a mix runs 2-6.
|
|
415
431
|
|
|
416
432
|
**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:
|
|
417
433
|
|
|
@@ -437,16 +453,16 @@ Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE — feature-specifi
|
|
|
437
453
|
IMPORTANT: Write report to {worktree_path}/.devflow/docs/reviews/{branch-slug}/{timestamp}/{focus}.md using Write tool"
|
|
438
454
|
```
|
|
439
455
|
|
|
440
|
-
In multi-worktree mode, process worktrees **sequentially
|
|
456
|
+
In multi-worktree mode, process worktrees **sequentially**: Phases 1-4 for one worktree, then the next.
|
|
441
457
|
|
|
442
458
|
### Phase 3: Synthesis → Review Comment (Sequential)
|
|
443
459
|
|
|
444
460
|
**Produces:** REVIEW_SUMMARY, PR_COMMENT
|
|
445
|
-
**Requires:** REVIEW_FOCUS_OUTPUTS, REVIEW_DIR, PR_INFO
|
|
461
|
+
**Requires:** REVIEW_FOCUS_OUTPUTS, REVIEW_DIR, PR_INFO, GATE_LEVEL, REVIEW_FOCUS_LIST
|
|
446
462
|
|
|
447
463
|
**WAIT** for Phase 2. For each worktree, run steps 3a and 3b in sequence:
|
|
448
464
|
|
|
449
|
-
**Step 3a — Synthesize agent** per worktree
|
|
465
|
+
**Step 3a — Synthesize agent** per worktree:
|
|
450
466
|
```
|
|
451
467
|
Agent(subagent_type="Synthesize", run_in_background=false):
|
|
452
468
|
"Mode: review
|
|
@@ -454,6 +470,8 @@ WORKTREE_PATH: {worktree_path} (omit if cwd)
|
|
|
454
470
|
REVIEW_BASE_DIR: {worktree_path}/.devflow/docs/reviews/{branch-slug}/{timestamp}
|
|
455
471
|
TIMESTAMP: {timestamp}
|
|
456
472
|
CYCLE_NUMBER: {cycle_number}
|
|
473
|
+
GATE_LEVEL: {GATE_LEVEL}
|
|
474
|
+
FOCUSES: {REVIEW_FOCUS_LIST}
|
|
457
475
|
PRIOR_RESOLUTIONS: <prior-resolution-summary>{prior_resolutions}</prior-resolution-summary>
|
|
458
476
|
Include Convergence Status section in review-summary.md.
|
|
459
477
|
Aggregate findings, determine merge recommendation.
|
|
@@ -478,46 +496,37 @@ Posts the consolidated review-summary comment (marker-deduped by the operation o
|
|
|
478
496
|
**Requires:** BRANCH_INFO, REVIEW_DIR
|
|
479
497
|
|
|
480
498
|
Per worktree, after successful completion:
|
|
481
|
-
1.
|
|
499
|
+
1. In one Bash call run `M="$(git -C "{worktree_path}" rev-parse --absolute-git-dir)/devflow/reviews/{branch-slug}" && mkdir -p "$M" && git -C "{worktree_path}" rev-parse HEAD > "$M/.last-review-head"`. A failed or refused write never stops the run and is not retried another way.
|
|
482
500
|
2. Display results from all agents:
|
|
483
501
|
- Merge recommendation (from Synthesize agent)
|
|
484
502
|
- Issue counts by category (🔴 blocking / ⚠️ should-fix / ℹ️ pre-existing)
|
|
485
503
|
- Review comment status: POSTED / POSTED+TRUNCATED (body exceeded 60k after redaction) / SKIPPED (D7 dedup) / DEGRADED (from Git)
|
|
486
504
|
- Publication status: FULL (private repo) | FULL (config override) | STUB (public repository) | OFF (publication disabled by config) | STUB (visibility undeterminable) | STUB (evidence policy) (from Git agent)
|
|
505
|
+
- Any base `TRACEABILITY: DEGRADED` line from Step 0c, as returned
|
|
487
506
|
- Artifact paths
|
|
488
507
|
|
|
489
|
-
In multi-worktree mode, report results per worktree.
|
|
490
|
-
|
|
491
508
|
## Architecture
|
|
492
509
|
|
|
493
510
|
```
|
|
494
|
-
/code-review
|
|
511
|
+
/code-review
|
|
495
512
|
│
|
|
496
|
-
├─ Phase 0: Worktree Discovery & Pre-flight
|
|
497
|
-
│ ├─ Step
|
|
498
|
-
│ ├─ Step 0b: Resolve the compliance lens
|
|
499
|
-
│ ├─ Step 0c: Git agent (ensure-pr-ready) per worktree [parallel]
|
|
500
|
-
│ ├─ Step 0d: Incremental detection + timestamp setup per worktree
|
|
501
|
-
│ ├─ Step 0e-i: Load prior resolution-summary.md
|
|
502
|
-
│ ├─ Step 0e-ii: Convergence assessment (warn if FP ratio > 70%)
|
|
503
|
-
│ └─ Step 0f: Resolve REVIEW_PUBLICATION per worktree (publication gate)
|
|
513
|
+
├─ Phase 0: Worktree Discovery & Pre-flight, Steps 0a-0f (Git agent per worktree, parallel)
|
|
514
|
+
│ ├─ Step 0b: Resolve the compliance lens and gate level
|
|
504
515
|
│
|
|
505
|
-
├─ Per worktree (SEQUENTIAL
|
|
516
|
+
├─ Per worktree (SEQUENTIAL):
|
|
506
517
|
│ │
|
|
507
518
|
│ ├─ Phase 1: Analyze changed files
|
|
508
519
|
│ │ ├─ Classify the diff (paths.txt → DIFF_CLASS)
|
|
509
|
-
│ │ ├─ Choose the focuses
|
|
510
|
-
│ │ └─ Write diff.patch and diff-{focus}.patch
|
|
520
|
+
│ │ ├─ Choose the focuses
|
|
521
|
+
│ │ └─ Write diff.patch and diff-{focus}.patch
|
|
511
522
|
│ │
|
|
512
|
-
│ ├─ Phase 2: Reviews (PARALLEL within worktree)
|
|
513
|
-
│ │ ├─ code:
|
|
514
|
-
│ │ │ consistency, regression, testing, reliability (diff.patch)
|
|
515
|
-
│ │ ├─ code: + language (diff-{focus}.patch) and conditional Review agents
|
|
523
|
+
│ ├─ Phase 2: Reviews (PARALLEL within worktree), one per REVIEW_FOCUS_LIST focus
|
|
524
|
+
│ │ ├─ code: core (diff.patch), language (diff-{focus}.patch), conditional
|
|
516
525
|
│ │ └─ docs-only / tests-only / lockfile-only: the reduced set (diff.patch)
|
|
517
526
|
│ │
|
|
518
527
|
│ ├─ Phase 3: Synthesis → Review Comment (SEQUENTIAL within worktree)
|
|
519
528
|
│ │ ├─ Step 3a: Synthesize agent (mode: review, writes review-summary.md)
|
|
520
|
-
│ │ └─ Step 3b: Git agent (post-review-summary
|
|
529
|
+
│ │ └─ Step 3b: Git agent (post-review-summary)
|
|
521
530
|
│ │
|
|
522
531
|
│ └─ Phase 4: Write .last-review-head + display results
|
|
523
532
|
```
|
|
@@ -526,31 +535,26 @@ In multi-worktree mode, report results per worktree.
|
|
|
526
535
|
|
|
527
536
|
| Case | Handling |
|
|
528
537
|
|------|----------|
|
|
529
|
-
| `--full` in multi-worktree mode | Applies to all worktrees (global modifier) |
|
|
530
|
-
| Review comment already posted | Git agent matches its own marker on the `{cycle, timestamp}` pair → skip silently (D7); a re-review in the same cycle (different timestamp) posts its own comment. The marker's format belongs to the operation
|
|
531
|
-
|
|
|
532
|
-
|
|
|
533
|
-
|
|
|
534
|
-
|
|
|
535
|
-
|
|
|
536
|
-
| A
|
|
537
|
-
|
|
|
538
|
-
| Path listing above about 40 lines | The count is printed; `paths.txt` is read in ranges of about 40 lines |
|
|
538
|
+
| `--full` in multi-worktree mode | Applies to all worktrees (global modifier). It sets the diff range, never the gate level |
|
|
539
|
+
| Review comment already posted | Git agent matches its own marker on the `{cycle, timestamp}` pair → skip silently (D7); a re-review in the same cycle (different timestamp) posts its own comment. The marker's format belongs to the operation |
|
|
540
|
+
| Docs-only diff | Its Step 1.1 set, narrowed by level |
|
|
541
|
+
| Tests-only diff | Its Step 1.1 set, narrowed by level |
|
|
542
|
+
| Lockfile-only diff | Its Step 1.1 set, narrowed by level |
|
|
543
|
+
| Mixed non-code diff | The union of the matching sets |
|
|
544
|
+
| A path matching no class pattern, or an empty path list | `code` (fail-safe) |
|
|
545
|
+
| A file moved across classes | `--no-renames` lists both paths, so a code path makes the diff `code` |
|
|
546
|
+
| Path listing above about 40 lines | Read in ranges (Step 1.1) |
|
|
539
547
|
| Language files changed, plugin not installed | The focus is absent from the stamped line: not spawned |
|
|
540
|
-
| Public repo (`auto` mode) | Git agent probes visibility, posts counts-only STUB comment; full report stays local |
|
|
541
548
|
| `reviewPublication: off` | Git agent skips posting the review comment (OFF) — except that, only when `EVIDENCE_POLICY` is `required`, Step 0f passes `stub` and a counts-only STUB comment posts |
|
|
542
549
|
|
|
543
550
|
## Backwards Compatibility
|
|
544
551
|
|
|
545
|
-
- **
|
|
546
|
-
- **Legacy flat layout**: If `{worktree}/.devflow/docs/reviews/{branch-slug}/` contains flat `*.md` files (no timestamped subdirectories), new runs create timestamped subdirectories. Old flat files remain untouched.
|
|
552
|
+
- **Gate level**: `full` runs the sets named here; the default `standard` and `lean` narrow them. `devflow gates --set full` keeps them.
|
|
547
553
|
|
|
548
554
|
## Principles
|
|
549
555
|
|
|
550
|
-
1. **Orchestration only** - Command spawns agents, doesn't do git/review work itself. The exceptions are the read-only Phase 0 probes (`git worktree list`, `git -C ... branch --show-current`, `git -C ... cat-file -t`), the bounded Phase 1 path listing
|
|
556
|
+
1. **Orchestration only** - Command spawns agents, doesn't do git/review work itself. The exceptions are the read-only Phase 0 probes (`git worktree list`, `git -C ... branch --show-current`, `git -C ... cat-file -t`, `git -C ... rev-parse`), the bounded Phase 1 path listing and the writes (`diff.patch`, `diff-{focus}.patch`, the marker and its `mkdir -p`). These writes print nothing
|
|
551
557
|
2. **Parallel, not background** - Multiple agents in one message, but `run_in_background=false` so phases complete before proceeding
|
|
552
|
-
3. **Git agent for git work** - All git operations go through Git agent, except the exceptions named in Principle 1;
|
|
553
|
-
4. **
|
|
554
|
-
5. **
|
|
555
|
-
6. **Incremental by default** - Only review new changes unless `--full` specified
|
|
556
|
-
7. **Auto-discover worktrees** - One command handles all reviewable branches
|
|
558
|
+
3. **Git agent for git work** - All git operations go through Git agent, except the exceptions named in Principle 1; its writes print nothing
|
|
559
|
+
4. **Honest reporting** - Display agent outputs directly
|
|
560
|
+
5. **Incremental by default** - Only review new changes unless `--full` specified
|
package/dist/commands/debug.md
CHANGED
|
@@ -38,9 +38,9 @@ $ARGUMENTS
|
|
|
38
38
|
node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off>
|
|
41
|
+
Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> CURATION=<on|off> KNOWLEDGE=<on|off> GATE_LEVEL=<full|standard|lean>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on CURATION=on KNOWLEDGE=off GATE_LEVEL=full` instead.
|
|
42
42
|
|
|
43
|
-
The accepted line is the only source of these values
|
|
43
|
+
The accepted line is the only source of these values.
|
|
44
44
|
|
|
45
45
|
From the same line: `COMPLIANCE_FRAMEWORKS` is the settings line's `COMPLIANCE` with `generic` written `none`: `off`, `none`, or the framework ids the machine and this repository declare.
|
|
46
46
|
|
|
@@ -52,7 +52,7 @@ Phase 7 passes `COMPLIANCE_DIRECTIVE` to the Code agent that implements the fix,
|
|
|
52
52
|
|
|
53
53
|
### Load DECISIONS_CONTEXT
|
|
54
54
|
|
|
55
|
-
When the settings line says `
|
|
55
|
+
When the settings line says `CURATION=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
|
|
56
56
|
|
|
57
57
|
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`):
|
|
58
58
|
|
|
@@ -66,11 +66,11 @@ Line 1 is the checkout's toplevel, line 2 the common git directory. A git older
|
|
|
66
66
|
2. **The toplevel** — line 1, or on an older git the line after the echoed flag.
|
|
67
67
|
3. **The start directory itself** — when the command failed or printed no absolute toplevel (outside a git repository).
|
|
68
68
|
|
|
69
|
-
This is the rule the
|
|
69
|
+
This is the rule the curation hooks apply, so you read the index the Curate agent writes.
|
|
70
70
|
|
|
71
71
|
**Step 1 — Read the pre-rendered index:**
|
|
72
72
|
|
|
73
|
-
Attempt to read `{ledger}/.devflow/
|
|
73
|
+
Attempt to read `{ledger}/.devflow/curation/index.md`.
|
|
74
74
|
|
|
75
75
|
- If the file exists and contains non-empty content: use that content as `DECISIONS_CONTEXT`.
|
|
76
76
|
- If the file is absent or empty: set `DECISIONS_CONTEXT` to `(none)`.
|