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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-driven-development
|
|
3
|
-
description: This skill should be used when implementing
|
|
3
|
+
description: This skill should be used when implementing features or fixing bugs. Enforces RED-GREEN-REFACTOR.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
activation:
|
|
@@ -62,12 +62,11 @@ Don't optimize. Don't refactor. Don't clean up. Just pass the test.
|
|
|
62
62
|
|
|
63
63
|
### Step 3: REFACTOR — Improve Without Changing Behavior
|
|
64
64
|
|
|
65
|
-
Now clean up
|
|
65
|
+
Now clean up: extract helpers, rename, simplify, apply DRY. Tests stay green throughout.
|
|
66
66
|
|
|
67
67
|
```
|
|
68
68
|
Run the affected tests after every refactoring step.
|
|
69
69
|
If a test breaks during refactor, undo immediately — you changed behavior.
|
|
70
|
-
Apply DRY, extract patterns, improve readability.
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
**Checkpoint:** All affected tests still pass. Code is clean. Repeat from Step 1 for next behavior.
|
|
@@ -98,11 +97,10 @@ These are the excuses developers use to skip TDD. Recognize and reject them.
|
|
|
98
97
|
| "I'll write tests after" | Need to see the shape first | Tests ARE the shape — they define the interface before implementation exists | Write the test first |
|
|
99
98
|
| "Too simple to test" | It's just a getter/setter | Getters break, defaults change, edge cases hide in "simple" code | Write it — takes 30 seconds |
|
|
100
99
|
| "I'll refactor later" | Just get it working now | "Later" never comes; technical debt compounds silently | Refactor now in Step 3 |
|
|
101
|
-
| "Test is too hard to write"
|
|
102
|
-
| "Need to see the whole picture" | Can't test what I haven't designed yet | TDD IS design; each test reveals the next piece of the interface | Let the
|
|
100
|
+
| "Test is too hard to write" or "the test setup is too complex" | Mocking is painful | Hard-to-test code = bad design, and complex setup = too much coupling; the test is telling you the interface is wrong | Simplify the interface first |
|
|
101
|
+
| "Need to see the whole picture" or "the architecture first" | Can't test what I haven't designed or structured yet | TDD IS design; each test reveals the next piece of the interface, and tests DEFINE the architecture | Let the tests drive the design and structure |
|
|
103
102
|
| "Tests slow me down" | Faster to just write the code | Faster until the first regression; TDD is faster for anything > 50 lines | Trust the cycle |
|
|
104
103
|
| "Framework is hard to set up" | Setup is complex | One-time cost vs recurring regression cost; untested code compounds debt | Set up the framework first — that IS the work |
|
|
105
|
-
| "Need the architecture first" | Can't test without structure | Tests DEFINE the architecture; they reveal what interfaces are needed | Let tests drive the structure |
|
|
106
104
|
| "This is infrastructure, not logic" | Plumbing doesn't need tests | Infrastructure carries data; broken plumbing floods everything downstream | Test the contract, not the internals |
|
|
107
105
|
| "Deadline is tight, no time for tests" | Ship now, test later | Untested code ships bugs; fixing bugs under deadline is slower than TDD | TDD is faster under pressure, not slower |
|
|
108
106
|
|
|
@@ -110,13 +108,11 @@ See `references/rationalization-prevention.md` for extended examples with code.
|
|
|
110
108
|
|
|
111
109
|
### Red Flags — STOP Immediately
|
|
112
110
|
|
|
113
|
-
The
|
|
111
|
+
The table above catches excuses *before starting*. These catch you *mid-work*: thoughts that signal you are about to skip a step.
|
|
114
112
|
|
|
115
113
|
| Thought | Correction |
|
|
116
114
|
|---------|------------|
|
|
117
115
|
| "Let me write the implementation first, tests after" | Delete the code. Write the test. Watch it fail. Then rewrite. |
|
|
118
|
-
| "I need to see the shape before I can test" | The test IS the shape. It defines the interface before implementation. |
|
|
119
|
-
| "The test setup is too complex for this" | Complex setup = too much coupling. Simplify the design first. |
|
|
120
116
|
| "I'll just spike this and add tests later" | Unless the user said "spike" — you're rationalizing, not prototyping. |
|
|
121
117
|
| "Let me get it working, then lock it with tests" | Those tests verify your implementation, not the requirement. Backwards. |
|
|
122
118
|
| "I know this works, I've written it before" | Past code passed past tests. This code needs its own failing test. |
|
|
@@ -124,20 +120,11 @@ The rationalization table above catches excuses you make *before starting*. Thes
|
|
|
124
120
|
|
|
125
121
|
### Test-First vs Code-First
|
|
126
122
|
|
|
127
|
-
**Code-first** (wrong):
|
|
128
|
-
1. Write `parseConfig()` — split lines, filter comments, build map
|
|
129
|
-
2. Write test: `parseConfig("key=val")` passes
|
|
130
|
-
3. Ship. Undiscovered: empty input, malformed lines, multi-value keys, whitespace
|
|
131
|
-
> Test mirrors implementation. Edge cases stay hidden until production.
|
|
123
|
+
**Code-first** (wrong): write `parseConfig()`, then a test that mirrors it (`parseConfig("key=val")` passes). Empty input, malformed lines, multi-value keys and whitespace stay hidden until production.
|
|
132
124
|
|
|
133
|
-
**Test-first** (correct):
|
|
134
|
-
1. Test: "ignores comment lines" — `parseConfig("# comment\nkey=val")` → `{key: val}`
|
|
135
|
-
2. Test: "handles empty input" — `parseConfig("")` → empty result
|
|
136
|
-
3. Test: "rejects malformed lines" — `parseConfig("no-equals")` → error
|
|
137
|
-
4. Implement `parseConfig()` to satisfy all three
|
|
138
|
-
> Tests define the contract. Implementation forced to handle edges from the start.
|
|
125
|
+
**Test-first** (correct): "ignores comment lines", then "handles empty input", then "rejects malformed lines", each failing first and each driving the next slice of `parseConfig()`, so it handles the edges from the start.
|
|
139
126
|
|
|
140
|
-
|
|
127
|
+
Code-first tests verify what you *happened to build*. Test-first tests specify what *should exist*.
|
|
141
128
|
|
|
142
129
|
### When Stuck
|
|
143
130
|
|
|
@@ -153,14 +140,7 @@ The difference: code-first tests verify what you *happened to build*. Test-first
|
|
|
153
140
|
|
|
154
141
|
## Process Enforcement
|
|
155
142
|
|
|
156
|
-
When implementing any feature under ambient IMPLEMENT
|
|
157
|
-
|
|
158
|
-
1. **Identify the first behavior** — What is the simplest thing this feature must do?
|
|
159
|
-
2. **Write the test** — Describe that behavior as a failing test
|
|
160
|
-
3. **Run the test** — Confirm it fails (RED)
|
|
161
|
-
4. **Write minimum code** — Just enough to pass (GREEN)
|
|
162
|
-
5. **Refactor** — Clean up while tests stay green (REFACTOR)
|
|
163
|
-
6. **Repeat** — Next behavior, next test, next cycle
|
|
143
|
+
When implementing any feature under ambient IMPLEMENT, start from the simplest thing it must do, take that one behavior through RED, GREEN and REFACTOR, then repeat for the next behavior.
|
|
164
144
|
|
|
165
145
|
### File Organization
|
|
166
146
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: testing
|
|
3
|
-
description: This skill should be used when the user asks to "write tests", "fix failing tests", "improve test coverage"
|
|
3
|
+
description: This skill should be used when the user asks to "write tests", "fix failing tests", "improve test coverage" or "debug a flaky test", or reviews test quality.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob, AskUserQuestion
|
|
6
6
|
activation:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typescript
|
|
3
|
-
description: This skill should be used when the user works with TypeScript files (.ts/.tsx), asks about "generics", "type guards", "utility types", "
|
|
3
|
+
description: This skill should be used when the user works with TypeScript files (.ts/.tsx), asks about "generics", "type guards", "utility types", "discriminated unions", or discusses type safety.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
activation:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ui-design
|
|
3
|
-
description: This skill should be used when the user asks to "design a component", "pick colors", "improve typography", "fix spacing",
|
|
3
|
+
description: This skill should be used when the user asks to "design a component", "pick colors", "improve typography", "fix spacing", or discusses visual design and CSS.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
activation:
|
|
@@ -7,8 +7,6 @@ allowed-tools: Bash, Read
|
|
|
7
7
|
|
|
8
8
|
# Worktree Support
|
|
9
9
|
|
|
10
|
-
Canonical patterns for worktree-aware agents and multi-worktree discovery in commands.
|
|
11
|
-
|
|
12
10
|
## Iron Law
|
|
13
11
|
|
|
14
12
|
> **WORKTREE_PATH IS A PREFIX, NOT A FLAG**
|
|
@@ -16,8 +14,6 @@ Canonical patterns for worktree-aware agents and multi-worktree discovery in com
|
|
|
16
14
|
> When WORKTREE_PATH is provided, it changes how you resolve ALL paths — git commands,
|
|
17
15
|
> file reads, .devflow/docs/ paths. It's not a toggle; it's a coordinate system shift.
|
|
18
16
|
|
|
19
|
-
---
|
|
20
|
-
|
|
21
17
|
## Agent Path Resolution
|
|
22
18
|
|
|
23
19
|
When `WORKTREE_PATH` is provided to an agent:
|
|
@@ -31,46 +27,6 @@ When `WORKTREE_PATH` is provided to an agent:
|
|
|
31
27
|
|
|
32
28
|
If `WORKTREE_PATH` is omitted, behavior is unchanged (use cwd). This is the common case.
|
|
33
29
|
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Worktree Discovery Algorithm (Commands)
|
|
37
|
-
|
|
38
|
-
For commands that auto-discover worktrees (`/code-review`, `/resolve`):
|
|
39
|
-
|
|
40
|
-
### Step 1: List Worktrees
|
|
41
|
-
|
|
42
|
-
Run `git worktree list --porcelain`
|
|
43
|
-
|
|
44
|
-
### Step 2: Parse Each Entry
|
|
45
|
-
|
|
46
|
-
Extract: `worktree {path}`, `HEAD {sha}`, `branch refs/heads/{name}`
|
|
47
|
-
|
|
48
|
-
### Step 3: Filter
|
|
49
|
-
|
|
50
|
-
Exclude:
|
|
51
|
-
- **Bare worktrees** (no branch)
|
|
52
|
-
- **Detached HEAD** (no named branch; roots and detached HEAD: `references/roots.md`)
|
|
53
|
-
- **Protected branches**: `main`, `master`, `develop`, `integration`, `trunk`, `release/*`, `staging`, `production`
|
|
54
|
-
- **Mid-rebase or mid-merge**: check `git -C {path} status` for "rebase in progress" or "merging"
|
|
55
|
-
|
|
56
|
-
### Step 4: Check for Work
|
|
57
|
-
|
|
58
|
-
Each worktree must have commits ahead of base branch. Skip those that are clean/up-to-date.
|
|
59
|
-
|
|
60
|
-
### Step 5: Deduplicate
|
|
61
|
-
|
|
62
|
-
If two worktrees are on the same branch, use only the first worktree's path.
|
|
63
|
-
|
|
64
|
-
### Step 6: Sort
|
|
65
|
-
|
|
66
|
-
Sort by last commit date (most recent first).
|
|
67
|
-
|
|
68
|
-
### Step 7: Return
|
|
69
|
-
|
|
70
|
-
Return list of reviewable worktrees with path, branch, HEAD SHA.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
30
|
## Protected Branches (Canonical List)
|
|
75
31
|
|
|
76
32
|
`main`, `master`, `develop`, `integration`, `trunk`, `release/*`, `staging`, `production`
|
|
@@ -78,15 +34,7 @@ Return list of reviewable worktrees with path, branch, HEAD SHA.
|
|
|
78
34
|
All components (agents, commands, skills) must use this exact list when checking for protected branches.
|
|
79
35
|
The HUD mirrors this list in `TRUNK_BRANCHES`/`TRUNK_BRANCH_PREFIXES`/`isTrunkBranch()` in `src/core/git.ts` — update both together.
|
|
80
36
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## Multi-Worktree Mode
|
|
37
|
+
## Extended References
|
|
84
38
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| 0 reviewable worktrees | Error: no reviewable branches found |
|
|
88
|
-
| 1 worktree (common case) | Single-worktree flow, zero behavior change |
|
|
89
|
-
| 2+ worktrees | Report count, process worktrees **sequentially** (one at a time) |
|
|
90
|
-
| 5+ worktrees | Report count and proceed — user manages their worktree count |
|
|
91
|
-
| `--path` flag provided | Use only that worktree, skip discovery |
|
|
92
|
-
| Same branch in 2 worktrees | Deduplicate — review once using first worktree's path |
|
|
39
|
+
- `references/discovery.md` — the 7-step discovery algorithm and multi-worktree mode
|
|
40
|
+
- `references/roots.md` — project data roots and detached HEAD
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Worktree Discovery
|
|
2
|
+
|
|
3
|
+
How commands that auto-discover worktrees (`/code-review`, `/resolve`) find them, and how the count found sets the flow. The protected-branch list lives only in the skill's `## Protected Branches (Canonical List)`; this file points to it and copies none of it.
|
|
4
|
+
|
|
5
|
+
## Algorithm
|
|
6
|
+
|
|
7
|
+
### Step 1: List Worktrees
|
|
8
|
+
|
|
9
|
+
Run `git worktree list --porcelain`
|
|
10
|
+
|
|
11
|
+
### Step 2: Parse Each Entry
|
|
12
|
+
|
|
13
|
+
Extract: `worktree {path}`, `HEAD {sha}`, `branch refs/heads/{name}`
|
|
14
|
+
|
|
15
|
+
### Step 3: Filter
|
|
16
|
+
|
|
17
|
+
Exclude:
|
|
18
|
+
- **Bare worktrees** (no branch)
|
|
19
|
+
- **Detached HEAD** (no named branch; roots and detached HEAD: `roots.md`)
|
|
20
|
+
- **Protected branches**: every branch in the skill's `## Protected Branches (Canonical List)`
|
|
21
|
+
- **Mid-rebase or mid-merge**: check `git -C {path} status` for "rebase in progress" or "merging"
|
|
22
|
+
|
|
23
|
+
### Step 4: Check for Work
|
|
24
|
+
|
|
25
|
+
Each worktree must have commits ahead of base branch. Skip those that are clean/up-to-date.
|
|
26
|
+
|
|
27
|
+
### Step 5: Deduplicate
|
|
28
|
+
|
|
29
|
+
If two worktrees are on the same branch, use only the first worktree's path.
|
|
30
|
+
|
|
31
|
+
### Step 6: Sort
|
|
32
|
+
|
|
33
|
+
Sort by last commit date (most recent first).
|
|
34
|
+
|
|
35
|
+
### Step 7: Return
|
|
36
|
+
|
|
37
|
+
Return list of reviewable worktrees with path, branch, HEAD SHA.
|
|
38
|
+
|
|
39
|
+
## Multi-Worktree Mode
|
|
40
|
+
|
|
41
|
+
| Condition | Behavior |
|
|
42
|
+
|-----------|----------|
|
|
43
|
+
| 0 reviewable worktrees | Error: no reviewable branches found |
|
|
44
|
+
| 1 worktree (common case) | Single-worktree flow, zero behavior change |
|
|
45
|
+
| 2+ worktrees | Report count, process worktrees **sequentially** (one at a time) |
|
|
46
|
+
| 5+ worktrees | Report count and proceed — user manages their worktree count |
|
|
47
|
+
| `--path` flag provided | Use only that worktree, skip discovery |
|
|
48
|
+
| Same branch in 2 worktrees | Deduplicate — review once using first worktree's path |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project Roots and Detached HEAD
|
|
2
2
|
|
|
3
|
-
Where devflow keeps per-project data across checkouts, and what it does on a detached HEAD. Companion to the worktree discovery algorithm in `
|
|
3
|
+
Where devflow keeps per-project data across checkouts, and what it does on a detached HEAD. Companion to the worktree discovery algorithm in `discovery.md`.
|
|
4
4
|
|
|
5
5
|
## Which Root Holds What
|
|
6
6
|
|
|
@@ -24,6 +24,6 @@ A detached HEAD is a commit checked out without a branch (`git checkout <sha>`,
|
|
|
24
24
|
| Surface | Behaviour |
|
|
25
25
|
|---------|-----------|
|
|
26
26
|
| Knowledge commit | Skipped: a commit there becomes unreachable once HEAD moves. The Knowledge agent reports `KB_COMMIT: skipped (detached HEAD) — uncommitted: <paths>`, and the calling workflow names those paths to the user |
|
|
27
|
-
| Worktree discovery | Excluded from auto-review (discovery Step 3 in `
|
|
27
|
+
| Worktree discovery | Excluded from auto-review (discovery Step 3 in `discovery.md`): there is no branch to review, compare or push |
|
|
28
28
|
| Memory bootstrap | The first compaction bootstraps `WORKING-MEMORY.md` stamped `branch: (detached)`, keyed on the HEAD commit; an unborn branch has no commit and still skips |
|
|
29
29
|
| Memory header | Renders `detached @ <short-sha>` instead of `on unknown` |
|