devflow-kit 3.2.0 → 3.4.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 +34 -0
- package/README.md +1 -1
- package/dist/agents/code.md +330 -0
- package/{src/assets → dist}/agents/design.md +11 -1
- package/{src/assets → dist}/agents/diagnose.md +17 -13
- package/dist/agents/git.md +29 -56
- package/{src/assets → dist}/agents/knowledge.md +8 -5
- package/{src/assets → dist}/agents/research.md +21 -2
- package/{src/assets → dist}/agents/review.md +18 -7
- package/{src/assets → dist}/agents/scrutinize.md +35 -11
- package/dist/agents/skim.md +148 -0
- package/{src/assets → dist}/agents/triage.md +8 -2
- package/dist/cli/commands/init.js +62 -0
- package/dist/cli/commands/learning.js +63 -8
- package/dist/cli/commands/uninstall.js +42 -1
- package/dist/commands/bug-analysis.md +30 -8
- package/dist/commands/code-review.md +142 -61
- package/dist/commands/debug.md +15 -13
- package/dist/commands/dynamic-build.md +176 -130
- package/dist/commands/dynamic-plan.md +31 -19
- package/dist/commands/dynamic-profile.md +27 -13
- package/dist/commands/dynamic-tickets.md +28 -14
- package/dist/commands/explore.md +16 -14
- package/dist/commands/implement.md +163 -158
- package/dist/commands/plan.md +37 -24
- package/dist/commands/release.md +69 -4
- package/dist/commands/research.md +33 -11
- package/dist/commands/resolve.md +61 -47
- package/dist/commands/self-review.md +50 -32
- package/dist/core/agent-models.js +53 -7
- package/dist/core/assets.js +55 -10
- package/dist/core/claude-md-audit.js +190 -0
- package/dist/core/feature-switch.js +20 -1
- package/dist/core/flags.js +28 -0
- package/dist/core/fs-atomic.js +8 -3
- package/dist/core/learning-tuning-config.js +8 -0
- package/dist/core/learning-variants.js +213 -0
- package/dist/core/manifest.js +62 -0
- package/dist/core/mds-variants.js +38 -1
- package/dist/core/plugins.js +78 -11
- package/{src/assets → dist/learning-off}/agents/code.md +77 -28
- package/dist/learning-off/agents/design.md +119 -0
- package/dist/learning-off/agents/diagnose.md +210 -0
- package/dist/learning-off/agents/knowledge.md +90 -0
- package/dist/learning-off/agents/research.md +149 -0
- package/dist/learning-off/agents/review.md +228 -0
- package/dist/learning-off/agents/scrutinize.md +117 -0
- package/{src/assets → dist/learning-off}/agents/skim.md +5 -10
- package/dist/learning-off/agents/triage.md +163 -0
- package/dist/learning-off/commands/bug-analysis.md +420 -0
- package/dist/learning-off/commands/code-review.md +525 -0
- package/dist/learning-off/commands/debug.md +294 -0
- package/dist/learning-off/commands/dynamic-build.md +1255 -0
- package/dist/learning-off/commands/dynamic-plan.md +424 -0
- package/dist/learning-off/commands/dynamic-profile.md +214 -0
- package/dist/learning-off/commands/dynamic-tickets.md +632 -0
- package/dist/learning-off/commands/explore.md +210 -0
- package/dist/learning-off/commands/implement.md +808 -0
- package/dist/learning-off/commands/plan.md +664 -0
- package/dist/learning-off/commands/release.md +310 -0
- package/dist/learning-off/commands/research.md +222 -0
- package/dist/learning-off/commands/resolve.md +837 -0
- package/dist/learning-off/commands/self-review.md +266 -0
- package/dist/skills/git/references/tracker/_contract.md +33 -0
- package/dist/skills/git/references/tracker/github/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/github/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/github/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/github/setup-task.md +12 -0
- package/dist/skills/git/references/tracker/jira/associate-release.md +1 -1
- package/dist/skills/git/references/tracker/jira/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/jira/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/jira/setup-task.md +14 -2
- package/dist/skills/git/references/tracker/linear/associate-release.md +1 -1
- package/dist/skills/git/references/tracker/linear/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/linear/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/linear/setup-task.md +14 -2
- package/dist/targets/claude-code/installer.js +72 -36
- package/dist/targets/claude-code/language-stamp.js +185 -0
- package/dist/targets/claude-code/learning-install.js +489 -0
- package/package.json +1 -1
- package/src/assets/agents/code.mds +339 -0
- package/src/assets/agents/design.mds +149 -0
- package/src/assets/agents/diagnose.mds +225 -0
- package/src/assets/agents/evaluate.md +12 -25
- package/src/assets/agents/git.mds +29 -56
- package/src/assets/agents/knowledge.mds +125 -0
- package/src/assets/agents/learning.md +4 -6
- package/src/assets/agents/research.mds +176 -0
- package/src/assets/agents/review.mds +286 -0
- package/src/assets/agents/scrutinize.mds +132 -0
- package/src/assets/agents/simplify.md +20 -0
- package/src/assets/agents/skim.mds +161 -0
- package/src/assets/agents/synthesize.md +12 -0
- package/src/assets/agents/test.md +2 -2
- package/src/assets/agents/triage.mds +194 -0
- package/src/assets/agents/validate.md +15 -8
- package/src/assets/commands/_partials/_compliance.mds +5 -4
- package/src/assets/commands/_partials/_decisions.mds +31 -0
- package/src/assets/commands/_partials/_engine.mds +29 -24
- package/src/assets/commands/_partials/_knowledge.mds +26 -13
- package/src/assets/commands/_partials/_plan_contract.mds +1 -1
- package/src/assets/commands/_partials/_preamble.mds +33 -9
- package/src/assets/commands/_partials/_publication.mds +5 -4
- package/src/assets/commands/_partials/_settings.mds +13 -5
- package/src/assets/commands/_partials/_wave.mds +16 -6
- package/src/assets/commands/bug-analysis.mds +24 -2
- package/src/assets/commands/code-review.mds +148 -45
- package/src/assets/commands/debug.mds +17 -1
- package/src/assets/commands/dynamic-build.mds +144 -65
- package/src/assets/commands/dynamic-plan.mds +36 -6
- package/src/assets/commands/dynamic-profile.mds +9 -1
- package/src/assets/commands/dynamic-tickets.mds +16 -2
- package/src/assets/commands/explore.mds +27 -1
- package/src/assets/commands/implement.mds +171 -138
- package/src/assets/commands/plan.mds +47 -8
- package/src/assets/commands/{release.md → release.mds} +27 -24
- package/src/assets/commands/research.mds +28 -4
- package/src/assets/commands/resolve.mds +69 -17
- package/src/assets/commands/self-review.mds +43 -13
- package/src/assets/mds/tracker/_common.mds +1 -1
- package/src/assets/mds/tracker/_contract.mds +72 -0
- package/src/assets/mds/tracker/_github.mds +13 -2
- package/src/assets/mds/tracker/_jira.mds +17 -5
- package/src/assets/mds/tracker/_linear.mds +17 -5
- package/src/assets/mds/tracker/_mcp.mds +2 -2
- package/src/assets/mds/tracker/_steps.mds +97 -0
- package/src/assets/rules/context-economy.md +10 -0
- package/src/assets/rules/go.md +1 -0
- package/src/assets/rules/java.md +1 -0
- package/src/assets/rules/python.md +1 -0
- package/src/assets/rules/rust.md +1 -0
- package/src/assets/rules/typescript.md +1 -0
- package/src/assets/scripts/ci-wait.cjs +636 -0
- package/src/assets/scripts/claude-md-audit.cjs +611 -0
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +2 -3
- package/src/assets/scripts/hooks/background-memory-update +290 -9
- package/src/assets/scripts/hooks/json-helper.cjs +13 -5
- package/src/assets/scripts/hooks/json-parse +34 -10
- package/src/assets/scripts/hooks/session-start-context +315 -7
- package/src/assets/scripts/release-trace.cjs +27 -10
- package/src/assets/skills/accessibility/SKILL.md +1 -1
- package/src/assets/skills/apply-decisions/SKILL.md +12 -82
- package/src/assets/skills/apply-feature-knowledge/SKILL.md +9 -43
- package/src/assets/skills/architecture/SKILL.md +1 -1
- package/src/assets/skills/boundary-validation/SKILL.md +1 -1
- package/src/assets/skills/complexity/SKILL.md +1 -1
- package/src/assets/skills/compliance/SKILL.md +1 -1
- package/src/assets/skills/consistency/SKILL.md +1 -1
- package/src/assets/skills/database/SKILL.md +1 -1
- package/src/assets/skills/dependencies/SKILL.md +1 -1
- package/src/assets/skills/dependency-research/SKILL.md +3 -6
- package/src/assets/skills/design-review/SKILL.md +1 -1
- package/src/assets/skills/docs-framework/SKILL.md +1 -1
- package/src/assets/skills/documentation/SKILL.md +1 -1
- package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
- package/src/assets/skills/gap-analysis/SKILL.md +1 -1
- package/src/assets/skills/git/SKILL.md +1 -1
- package/src/assets/skills/go/SKILL.md +1 -1
- package/src/assets/skills/java/SKILL.md +1 -1
- package/src/assets/skills/patterns/SKILL.md +1 -1
- package/src/assets/skills/performance/SKILL.md +1 -1
- package/src/assets/skills/python/SKILL.md +1 -1
- package/src/assets/skills/qa/SKILL.md +1 -3
- package/src/assets/skills/quality-gates/SKILL.md +10 -13
- package/src/assets/skills/quality-gates/references/report-template.md +20 -20
- package/src/assets/skills/react/SKILL.md +1 -1
- package/src/assets/skills/regression/SKILL.md +1 -1
- package/src/assets/skills/reliability/SKILL.md +1 -1
- package/src/assets/skills/research-codebase/SKILL.md +1 -1
- package/src/assets/skills/research-competitor/SKILL.md +1 -1
- package/src/assets/skills/research-external/SKILL.md +1 -1
- package/src/assets/skills/research-technology/SKILL.md +1 -1
- package/src/assets/skills/review-methodology/SKILL.md +1 -1
- package/src/assets/skills/rust/SKILL.md +1 -1
- package/src/assets/skills/security/SKILL.md +1 -1
- package/src/assets/skills/software-design/SKILL.md +1 -1
- package/src/assets/skills/test-driven-development/SKILL.md +9 -29
- package/src/assets/skills/testing/SKILL.md +1 -1
- package/src/assets/skills/typescript/SKILL.md +1 -1
- package/src/assets/skills/ui-design/SKILL.md +1 -1
- package/src/assets/skills/worktree-support/SKILL.md +3 -55
- package/src/assets/skills/worktree-support/references/discovery.md +48 -0
- package/src/assets/skills/worktree-support/references/roots.md +2 -2
|
@@ -7,6 +7,7 @@ output-dir: dist/commands
|
|
|
7
7
|
@import { compliance_gate } from "./_partials/_compliance.mds"
|
|
8
8
|
@import { evidence_policy } from "./_partials/_evidence_policy.mds"
|
|
9
9
|
@import { publication_gate } from "./_partials/_publication.mds"
|
|
10
|
+
@import "./_partials/_settings.mds" as settings
|
|
10
11
|
# Code Review Command
|
|
11
12
|
|
|
12
13
|
Run a comprehensive code review of the current branch by spawning parallel review agents, then synthesizing results into PR comments. Supports incremental reviews, timestamped report directories, and multi-worktree auto-discovery.
|
|
@@ -30,7 +31,7 @@ Run a comprehensive code review of the current branch by spawning parallel revie
|
|
|
30
31
|
|
|
31
32
|
1. **Discover reviewable worktrees** using the `devflow:worktree-support` skill discovery algorithm:
|
|
32
33
|
- Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit
|
|
33
|
-
-
|
|
34
|
+
- 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
|
|
34
35
|
2. **If `--path` flag provided:** use only that worktree, skip discovery
|
|
35
36
|
**`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop.
|
|
36
37
|
3. **If only 1 reviewable worktree** (the common case): proceed as single-worktree flow — zero behavior change
|
|
@@ -40,6 +41,8 @@ Run a comprehensive code review of the current branch by spawning parallel revie
|
|
|
40
41
|
|
|
41
42
|
**Produces:** COMPLIANCE_ACTIVE, COMPLIANCE_FRAMEWORKS
|
|
42
43
|
|
|
44
|
+
{{settings.settings_resolve()}}
|
|
45
|
+
|
|
43
46
|
{{compliance_gate()}}
|
|
44
47
|
Keep each worktree's values for every downstream phase of that worktree.
|
|
45
48
|
|
|
@@ -164,10 +167,48 @@ For each reviewable worktree, call:
|
|
|
164
167
|
|
|
165
168
|
### Phase 1: Analyze Changed Files
|
|
166
169
|
|
|
167
|
-
**Produces:** REVIEW_FOCUS_LIST
|
|
168
|
-
**Requires:** DIFF_RANGE, COMPLIANCE_ACTIVE (from Step 0b)
|
|
170
|
+
**Produces:** REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
|
|
171
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR, COMPLIANCE_ACTIVE (from Step 0b)
|
|
172
|
+
|
|
173
|
+
Per worktree, in order. Each `git` command here writes to a file and prints nothing.
|
|
174
|
+
|
|
175
|
+
#### Step 1.1: Classify the diff
|
|
176
|
+
|
|
177
|
+
**Produces:** DIFF_CLASS, CHANGED_PATHS, REVIEW_FOCUS_LIST (reduced classes)
|
|
178
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR
|
|
179
|
+
|
|
180
|
+
List the changed paths into `{REVIEW_DIR}/paths.txt` and print only the line count (drop `-C "{WORKTREE_PATH}"` when there is no `WORKTREE_PATH`):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
git -C "{WORKTREE_PATH}" diff --name-only --no-renames {DIFF_RANGE} > "{REVIEW_DIR}/paths.txt"
|
|
184
|
+
wc -l < "{REVIEW_DIR}/paths.txt"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
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. `--no-renames` lists a moved file under its old path and its new one, so a move cannot take a file out of its own class.
|
|
188
|
+
|
|
189
|
+
Set `DIFF_CLASS` by these rules, in order; the first that decides wins:
|
|
190
|
+
|
|
191
|
+
1. **Instruction and config paths are `code`.** Any changed path that is `CLAUDE.md`, `AGENTS.md`, under `.claude/` or `src/assets/`, a `*.mds` file, under a plugin's `agents/`, `skills/` or `commands/` directory, `.devflow/project.json`, `.devflow/conventions.md`, or a manifest or build file (`package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `requirements*.txt`, `CMakeLists.txt`). This rule runs first, so a diff made only of such files is `code` and never `docs-only`.
|
|
192
|
+
2. **`docs-only`.** Every changed path matches `*.md`, `*.mdx`, `*.rst`, `*.txt`, `docs/**` or `CHANGELOG*`.
|
|
193
|
+
3. **`tests-only`.** Every changed path matches `tests/**`, `**/__tests__/**`, `*.test.*`, `*.spec.*`, `*_test.go`, `test_*.py` or `*_test.py`.
|
|
194
|
+
4. **`lockfile-only`.** Every changed path is `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`, `Cargo.lock`, `go.sum`, `poetry.lock`, `uv.lock`, `Gemfile.lock` or `composer.lock`.
|
|
195
|
+
5. **Mixed non-code.** Every changed path matches the docs, tests or lockfile patterns, but no single rule above holds (docs with tests, tests with a lockfile): `DIFF_CLASS` names each class involved.
|
|
196
|
+
6. **Fail-safe is `code`.** A changed path that matches no class pattern makes the diff `code`, and so does an empty path list. A manifest change is `code` and never `lockfile-only`.
|
|
197
|
+
|
|
198
|
+
Each reduced class runs only its focus set, every member reading `diff.patch`:
|
|
199
|
+
|
|
200
|
+
- `docs-only`: documentation, consistency, security
|
|
201
|
+
- `tests-only`: testing, reliability, consistency, security
|
|
202
|
+
- `lockfile-only`: dependencies, security
|
|
203
|
+
|
|
204
|
+
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: they add no focus, and Step 1.2 applies to the `code` class only.
|
|
169
205
|
|
|
170
|
-
|
|
206
|
+
#### Step 1.2: Choose the focuses
|
|
207
|
+
|
|
208
|
+
**Produces:** REVIEW_FOCUS_LIST (code class)
|
|
209
|
+
**Requires:** DIFF_CLASS, CHANGED_PATHS, COMPLIANCE_ACTIVE
|
|
210
|
+
|
|
211
|
+
When `DIFF_CLASS` is `code`, read the file types from the paths in `paths.txt` to determine conditional reviews:
|
|
171
212
|
|
|
172
213
|
| Condition | Adds Review |
|
|
173
214
|
|-----------|-------------|
|
|
@@ -186,57 +227,104 @@ Per worktree, detect file types in diff using `DIFF_RANGE` to determine conditio
|
|
|
186
227
|
|
|
187
228
|
If `COMPLIANCE_ACTIVE` AND the diff touches regulated surface (data models, auth flows, logging/observability, payments, IaC, retention): add `compliance` to REVIEW_FOCUS_LIST for this worktree.
|
|
188
229
|
|
|
189
|
-
**Language focus
|
|
230
|
+
**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`:
|
|
231
|
+
|
|
232
|
+
Installed language focuses: (none)
|
|
233
|
+
|
|
234
|
+
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. The eight core focuses are unconditional and are never stamp-gated.
|
|
235
|
+
|
|
236
|
+
#### Step 1.3: Write the diff files
|
|
237
|
+
|
|
238
|
+
**Produces:** DIFF_FILES
|
|
239
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR, REVIEW_FOCUS_LIST
|
|
240
|
+
|
|
241
|
+
Write `diff.patch` once per worktree, by redirect:
|
|
190
242
|
|
|
191
243
|
```bash
|
|
192
|
-
|
|
244
|
+
git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} > "{REVIEW_DIR}/diff.patch"
|
|
193
245
|
```
|
|
194
246
|
|
|
195
|
-
|
|
247
|
+
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:
|
|
196
248
|
|
|
249
|
+
```bash
|
|
250
|
+
git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} -- '<pathspec>' ... > "{REVIEW_DIR}/diff-{focus}.patch"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
| Focus | Pathspecs |
|
|
254
|
+
|-------|-----------|
|
|
255
|
+
| typescript | `'*.ts' '*.tsx'` |
|
|
256
|
+
| react, accessibility | `'*.tsx' '*.jsx'` |
|
|
257
|
+
| ui-design | `'*.tsx' '*.jsx' '*.css' '*.scss'` |
|
|
258
|
+
| go | `'*.go'` |
|
|
259
|
+
| java | `'*.java'` |
|
|
260
|
+
| python | `'*.py'` |
|
|
261
|
+
| rust | `'*.rs'` |
|
|
262
|
+
|
|
263
|
+
The core, database, dependencies, documentation and compliance focuses, and every reduced-class focus, read `diff.patch`. A language focus sees only its own extensions and reaches anything else through `DIFF_RANGE`. Set `DIFF_FILES` to the files written. They live in `REVIEW_DIR`, under the gitignored `.devflow/` tree, with `paths.txt`: never committed, posted or passed to the Git agent.
|
|
264
|
+
|
|
265
|
+
<!-- learning:on -->
|
|
197
266
|
### Phase 1b: Load Decisions Index
|
|
267
|
+
<!-- learning:off -->
|
|
268
|
+
### Phase 1b: Load Context
|
|
269
|
+
<!-- learning:end -->
|
|
198
270
|
|
|
199
|
-
|
|
271
|
+
<!-- learning:on -->
|
|
272
|
+
**Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
|
|
273
|
+
<!-- learning:off -->
|
|
274
|
+
**Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
|
|
275
|
+
<!-- learning:end -->
|
|
200
276
|
|
|
201
277
|
{{decisions_load()}}
|
|
202
|
-
|
|
278
|
+
<!-- learning:on -->
|
|
203
279
|
This produces a compact index of active ADR/PF entries. Pass `DECISIONS_CONTEXT` to all Review agents. Review agents use `devflow:apply-decisions` to Read full entry bodies on demand.
|
|
204
280
|
|
|
281
|
+
<!-- learning:end -->
|
|
205
282
|
{{knowledge_load()}}
|
|
206
283
|
|
|
284
|
+
<!-- learning:on -->
|
|
207
285
|
Pass `FEATURE_KNOWLEDGE` to all Review agents alongside `DECISIONS_CONTEXT`.
|
|
286
|
+
<!-- learning:off -->
|
|
287
|
+
Pass `FEATURE_KNOWLEDGE` to all Review agents.
|
|
288
|
+
<!-- learning:end -->
|
|
208
289
|
|
|
209
290
|
### Phase 2: Run Reviews (Parallel)
|
|
210
291
|
|
|
211
292
|
**Produces:** REVIEW_FOCUS_OUTPUTS
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
|
224
|
-
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
|
|
|
238
|
-
|
|
239
|
-
|
|
293
|
+
<!-- learning:on -->
|
|
294
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR, TIMESTAMP, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, PR_DESCRIPTION, PRIOR_RESOLUTIONS, REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
|
|
295
|
+
<!-- learning:off -->
|
|
296
|
+
**Requires:** DIFF_RANGE, REVIEW_DIR, TIMESTAMP, FEATURE_KNOWLEDGE, PR_DESCRIPTION, PRIOR_RESOLUTIONS, REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
|
|
297
|
+
<!-- learning:end -->
|
|
298
|
+
|
|
299
|
+
Spawn Review agents **in a single message**, for the focus set `DIFF_CLASS` selects (max 20 per worktree):
|
|
300
|
+
|
|
301
|
+
- `code`: the 8 core reviews on the full `diff.patch`, plus the language and conditional focuses Phase 1 added.
|
|
302
|
+
- `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.
|
|
303
|
+
|
|
304
|
+
| Focus | Runs | Pattern Skill | DIFF_FILE |
|
|
305
|
+
|-------|------|---------------|-----------|
|
|
306
|
+
| security | ✓ | devflow:security | diff.patch |
|
|
307
|
+
| architecture | ✓ | devflow:architecture | diff.patch |
|
|
308
|
+
| performance | ✓ | devflow:performance | diff.patch |
|
|
309
|
+
| complexity | ✓ | devflow:complexity | diff.patch |
|
|
310
|
+
| consistency | ✓ | devflow:consistency | diff.patch |
|
|
311
|
+
| regression | ✓ | devflow:regression | diff.patch |
|
|
312
|
+
| testing | ✓ | devflow:testing | diff.patch |
|
|
313
|
+
| reliability | ✓ | devflow:reliability | diff.patch |
|
|
314
|
+
| typescript | stamp-gated | devflow:typescript | diff-typescript.patch |
|
|
315
|
+
| react | stamp-gated | devflow:react | diff-react.patch |
|
|
316
|
+
| accessibility | stamp-gated | devflow:accessibility | diff-accessibility.patch |
|
|
317
|
+
| ui-design | stamp-gated | devflow:ui-design | diff-ui-design.patch |
|
|
318
|
+
| go | stamp-gated | devflow:go | diff-go.patch |
|
|
319
|
+
| java | stamp-gated | devflow:java | diff-java.patch |
|
|
320
|
+
| python | stamp-gated | devflow:python | diff-python.patch |
|
|
321
|
+
| rust | stamp-gated | devflow:rust | diff-rust.patch |
|
|
322
|
+
| database | conditional | devflow:database | diff.patch |
|
|
323
|
+
| dependencies | conditional | devflow:dependencies | diff.patch |
|
|
324
|
+
| documentation | conditional | devflow:documentation | diff.patch |
|
|
325
|
+
| compliance | diff-driven | devflow:compliance | diff.patch |
|
|
326
|
+
|
|
327
|
+
Review agent count: `code` runs 8 core, +1-12 added by Phase 1 (max 20 total per worktree); a reduced class or a mix runs 2-6.
|
|
240
328
|
|
|
241
329
|
Each Review agent invocation (all in one message, **NOT background**):
|
|
242
330
|
```
|
|
@@ -245,14 +333,19 @@ Agent(subagent_type="Review", run_in_background=false):
|
|
|
245
333
|
Follow 6-step process from devflow:review-methodology.
|
|
246
334
|
PR: #{pr_number}, Base: {base_branch}
|
|
247
335
|
WORKTREE_PATH: {worktree_path} (omit if cwd)
|
|
248
|
-
|
|
336
|
+
DIFF_FILE: {diff_file} (absolute: {REVIEW_DIR}/diff.patch, or {REVIEW_DIR}/diff-{focus}.patch for a language focus, per the table)
|
|
337
|
+
DIFF_RANGE: {DIFF_RANGE} (information only)
|
|
338
|
+
<!-- learning:on -->
|
|
249
339
|
DECISIONS_CONTEXT: {decisions_context}
|
|
340
|
+
<!-- learning:end -->
|
|
250
341
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
251
342
|
PR_DESCRIPTION: <pr-description>{pr_description}</pr-description>
|
|
252
343
|
PRIOR_RESOLUTIONS: <prior-resolution-summary>{prior_resolutions}</prior-resolution-summary>
|
|
253
344
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS} (compliance focus only)
|
|
254
345
|
If PRIOR_RESOLUTIONS is not (none), follow Cross-Cycle Awareness in review.md.
|
|
346
|
+
<!-- learning:on -->
|
|
255
347
|
Follow devflow:apply-decisions to scan the index and Read full ADR/PF bodies on demand.
|
|
348
|
+
<!-- learning:end -->
|
|
256
349
|
Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE — feature-specific patterns and anti-patterns inform findings.
|
|
257
350
|
IMPORTANT: Write report to {worktree_path}/.devflow/docs/reviews/{branch-slug}/{timestamp}/{focus}.md using Write tool"
|
|
258
351
|
```
|
|
@@ -325,13 +418,15 @@ In multi-worktree mode, report results per worktree.
|
|
|
325
418
|
├─ Per worktree (SEQUENTIAL — one worktree at a time):
|
|
326
419
|
│ │
|
|
327
420
|
│ ├─ Phase 1: Analyze changed files
|
|
328
|
-
│ │
|
|
421
|
+
│ │ ├─ Classify the diff (paths.txt → DIFF_CLASS)
|
|
422
|
+
│ │ ├─ Choose the focuses (code class: file types + the language stamp)
|
|
423
|
+
│ │ └─ Write diff.patch and diff-{focus}.patch, by redirect
|
|
329
424
|
│ │
|
|
330
425
|
│ ├─ Phase 2: Reviews (PARALLEL within worktree)
|
|
331
|
-
│ │ ├─ Review
|
|
332
|
-
│ │
|
|
333
|
-
│ │ ├─
|
|
334
|
-
│ │ └─
|
|
426
|
+
│ │ ├─ code: Review agents security, architecture, performance, complexity,
|
|
427
|
+
│ │ │ consistency, regression, testing, reliability (diff.patch)
|
|
428
|
+
│ │ ├─ code: + language (diff-{focus}.patch) and conditional Review agents
|
|
429
|
+
│ │ └─ docs-only / tests-only / lockfile-only: the reduced set (diff.patch)
|
|
335
430
|
│ │
|
|
336
431
|
│ ├─ Phase 3: Synthesis → Review Comment (SEQUENTIAL within worktree)
|
|
337
432
|
│ │ ├─ Step 3a: Synthesize agent (mode: review, writes review-summary.md)
|
|
@@ -360,6 +455,14 @@ In multi-worktree mode, report results per worktree.
|
|
|
360
455
|
| `--full` flag | Bypass incremental detection (Step 0d), still load PRIOR_RESOLUTIONS for cross-cycle awareness |
|
|
361
456
|
| Parsing failure on resolution-summary.md | fp_ratio = 0, convergence tracking degraded (see Step 0e-ii) |
|
|
362
457
|
| Concurrent sessions | Advisory only, each session computes independently |
|
|
458
|
+
| Docs-only diff | `docs-only`: documentation, consistency, security on `diff.patch`; no language or conditional focus |
|
|
459
|
+
| Tests-only diff | `tests-only`: testing, reliability, consistency, security on `diff.patch`; no language or conditional focus |
|
|
460
|
+
| Lockfile-only diff | `lockfile-only`: dependencies, security on `diff.patch` |
|
|
461
|
+
| Mixed non-code diff (docs with tests, tests with a lockfile) | The union of the matching sets, on `diff.patch` |
|
|
462
|
+
| A path matching no class pattern, or an empty path list | `code` (fail-safe): the 8 core focuses on the full diff |
|
|
463
|
+
| A file moved across classes | `--no-renames` lists the old and the new path, so a code path makes the diff `code` |
|
|
464
|
+
| Path listing above about 40 lines | The count is printed; `paths.txt` is read in ranges of about 40 lines |
|
|
465
|
+
| Language files changed, plugin not installed | The focus is absent from the stamped line: not spawned |
|
|
363
466
|
| Public repo (`auto` mode) | Git agent probes visibility, posts counts-only STUB comment; full report stays local |
|
|
364
467
|
| `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 |
|
|
365
468
|
|
|
@@ -370,9 +473,9 @@ In multi-worktree mode, report results per worktree.
|
|
|
370
473
|
|
|
371
474
|
## Principles
|
|
372
475
|
|
|
373
|
-
1. **Orchestration only** - Command spawns agents, doesn't do git/review work itself
|
|
476
|
+
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 (a redirect into `paths.txt`, a `wc -l` count and ranged reads) and the redirect-only patch writes (`diff.patch`, `diff-{focus}.patch`). Redirect-only writes print nothing, so no diff content reaches this thread
|
|
374
477
|
2. **Parallel, not background** - Multiple agents in one message, but `run_in_background=false` so phases complete before proceeding
|
|
375
|
-
3. **Git agent for git work** - All git operations go through Git agent
|
|
478
|
+
3. **Git agent for git work** - All git operations go through Git agent, except the exceptions named in Principle 1; redirect-only writes print nothing
|
|
376
479
|
4. **Clear ownership** - Each agent owns its output completely
|
|
377
480
|
5. **Honest reporting** - Display agent outputs directly
|
|
378
481
|
6. **Incremental by default** - Only review new changes unless `--full` specified
|
|
@@ -5,6 +5,7 @@ output-dir: dist/commands
|
|
|
5
5
|
@import { knowledge_writeback } from "./_partials/_knowledge.mds"
|
|
6
6
|
@import { decisions_load } from "./_partials/_decisions.mds"
|
|
7
7
|
@import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
|
|
8
|
+
@import "./_partials/_settings.mds" as settings
|
|
8
9
|
# Debug Command
|
|
9
10
|
|
|
10
11
|
Investigate bugs by spawning parallel agents, each pursuing a different hypothesis. Evidence is aggregated and synthesized to identify the root cause.
|
|
@@ -32,20 +33,31 @@ $ARGUMENTS
|
|
|
32
33
|
|
|
33
34
|
## Phases
|
|
34
35
|
|
|
36
|
+
<!-- learning:on -->
|
|
35
37
|
### Phase 1: Load Decisions Index (Orchestrator-Local)
|
|
38
|
+
<!-- learning:off -->
|
|
39
|
+
### Phase 1: Resolve Settings
|
|
40
|
+
<!-- learning:end -->
|
|
36
41
|
|
|
42
|
+
<!-- learning:on -->
|
|
37
43
|
**Produces:** DECISIONS_CONTEXT
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
<!-- learning:end -->
|
|
46
|
+
{{settings.settings_resolve()}}
|
|
40
47
|
|
|
48
|
+
{{decisions_load()}}
|
|
49
|
+
<!-- learning:on -->
|
|
41
50
|
The orchestrator uses `DECISIONS_CONTEXT` locally when generating hypotheses (Phase 2) — prior pitfalls and decisions can suggest specific root causes to investigate. Follow `devflow:apply-decisions` to Read full entry bodies on demand. **Do NOT pass `DECISIONS_CONTEXT` to Explore investigators** — decisions context stays in the orchestrator; investigators examine code directly.
|
|
42
51
|
|
|
52
|
+
<!-- learning:end -->
|
|
43
53
|
**No up-front feature knowledge load** — debug investigation workers read code directly to avoid confirmation bias. Feature knowledge is only written back at the end if the investigation surfaced durable, cross-cutting knowledge.
|
|
44
54
|
|
|
45
55
|
### Phase 2: Context Gathering
|
|
46
56
|
|
|
47
57
|
**Produces:** HYPOTHESES, BUG_CONTEXT
|
|
58
|
+
<!-- learning:on -->
|
|
48
59
|
**Requires:** DECISIONS_CONTEXT
|
|
60
|
+
<!-- learning:end -->
|
|
49
61
|
|
|
50
62
|
If `COMMAND_INPUT` opens with a candidate issue reference, fetch the issue:
|
|
51
63
|
|
|
@@ -193,7 +205,11 @@ Ask user via AskUserQuestion: "Want me to implement this fix?"
|
|
|
193
205
|
```
|
|
194
206
|
/debug (orchestrator)
|
|
195
207
|
│
|
|
208
|
+
<!-- learning:on -->
|
|
196
209
|
├─ Phase 1: Load Decisions Index (Orchestrator-Local)
|
|
210
|
+
<!-- learning:off -->
|
|
211
|
+
├─ Phase 1: Resolve Settings
|
|
212
|
+
<!-- learning:end -->
|
|
197
213
|
│ └─ No up-front feature knowledge load (avoids confirmation bias in investigators)
|
|
198
214
|
│
|
|
199
215
|
├─ Phase 2: Context gathering
|