devflow-kit 3.3.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 +18 -0
- package/dist/agents/code.md +330 -0
- package/{src/assets → dist}/agents/design.md +1 -1
- package/{src/assets → dist}/agents/diagnose.md +1 -2
- package/dist/agents/git.md +29 -56
- package/{src/assets → dist}/agents/knowledge.md +4 -3
- package/{src/assets → dist}/agents/research.md +2 -2
- package/{src/assets → dist}/agents/review.md +8 -7
- package/{src/assets → dist}/agents/scrutinize.md +1 -1
- package/dist/agents/skim.md +148 -0
- package/{src/assets → dist}/agents/triage.md +1 -1
- package/dist/cli/commands/init.js +62 -0
- package/dist/cli/commands/learning.js +38 -3
- package/dist/cli/commands/uninstall.js +42 -1
- package/dist/commands/bug-analysis.md +30 -8
- package/dist/commands/code-review.md +141 -60
- package/dist/commands/debug.md +14 -12
- package/dist/commands/dynamic-build.md +37 -38
- package/dist/commands/dynamic-plan.md +30 -18
- package/dist/commands/dynamic-profile.md +27 -13
- package/dist/commands/dynamic-tickets.md +28 -14
- package/dist/commands/explore.md +15 -13
- package/dist/commands/implement.md +33 -28
- 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 +35 -32
- package/dist/commands/self-review.md +36 -23
- package/dist/core/agent-models.js +43 -0
- 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-variants.js +213 -0
- package/dist/core/manifest.js +62 -0
- package/dist/core/mds-variants.js +38 -1
- package/dist/core/plugins.js +71 -9
- package/{src/assets → dist/learning-off}/agents/code.md +6 -10
- 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 +1 -8
- 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 +4 -0
- 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 +4 -0
- 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 +4 -0
- 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 +1 -3
- package/src/assets/agents/git.mds +29 -56
- package/src/assets/agents/knowledge.mds +125 -0
- 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/skim.mds +161 -0
- package/src/assets/agents/triage.mds +194 -0
- package/src/assets/agents/validate.md +8 -6
- 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 +9 -1
- package/src/assets/commands/_partials/_knowledge.mds +25 -12
- 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 +8 -0
- package/src/assets/commands/bug-analysis.mds +24 -2
- package/src/assets/commands/code-review.mds +147 -44
- package/src/assets/commands/debug.mds +17 -1
- package/src/assets/commands/dynamic-build.mds +33 -2
- 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 +41 -8
- 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 +43 -2
- package/src/assets/commands/self-review.mds +30 -5
- 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/claude-md-audit.cjs +611 -0
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +1 -2
- 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/skills/apply-decisions/SKILL.md +1 -1
- package/src/assets/skills/apply-feature-knowledge/SKILL.md +5 -5
- package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
- package/src/assets/skills/quality-gates/SKILL.md +1 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Explore codebase with structured analysis and optional feature knowledge creation
|
|
3
|
+
---
|
|
4
|
+
# Explore Command
|
|
5
|
+
|
|
6
|
+
Explore a codebase area by spawning parallel agents for flow tracing, dependency mapping, and pattern analysis. Findings are synthesized into structured output with file:line references, with optional feature knowledge created as a byproduct.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
/explore "how does the auth system work"
|
|
12
|
+
/explore "trace the request lifecycle from API to database"
|
|
13
|
+
/explore "what patterns does the payments module use"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Input
|
|
17
|
+
|
|
18
|
+
What follows `/explore` is bound once, here. Every later step names it `COMMAND_INPUT` and never restates it:
|
|
19
|
+
|
|
20
|
+
<command-input>
|
|
21
|
+
$ARGUMENTS
|
|
22
|
+
</command-input>
|
|
23
|
+
|
|
24
|
+
`COMMAND_INPUT` is one of:
|
|
25
|
+
- Area description: "how does the auth system work"
|
|
26
|
+
- Flow question: "trace the request lifecycle"
|
|
27
|
+
- Empty: use conversation context
|
|
28
|
+
|
|
29
|
+
## Phases
|
|
30
|
+
|
|
31
|
+
### Phase 1: Resolve Settings
|
|
32
|
+
|
|
33
|
+
**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:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
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> LEARNING=<on|off> KNOWLEDGE=<on|off>` — 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 LEARNING=on KNOWLEDGE=off` instead.
|
|
40
|
+
|
|
41
|
+
The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
|
|
42
|
+
|
|
43
|
+
**No up-front feature knowledge load** — explore investigation workers read code directly to avoid confirmation bias. Feature knowledge is only created as a write-back at the end, after exploration is complete.
|
|
44
|
+
|
|
45
|
+
### Phase 2: Orient
|
|
46
|
+
|
|
47
|
+
**Produces:** ORIENT_OUTPUT
|
|
48
|
+
|
|
49
|
+
Spawn `Agent(subagent_type="Skim")` to get codebase overview relevant to the exploration question:
|
|
50
|
+
|
|
51
|
+
- File structure and module boundaries in the target area
|
|
52
|
+
- Entry points and key abstractions
|
|
53
|
+
- Related patterns and conventions
|
|
54
|
+
|
|
55
|
+
### Phase 3: Explore
|
|
56
|
+
|
|
57
|
+
**Produces:** EXPLORE_OUTPUT
|
|
58
|
+
**Requires:** ORIENT_OUTPUT
|
|
59
|
+
|
|
60
|
+
Based on Skim agent findings, spawn 2-3 `Agent(subagent_type="Explore")` agents **in a single message** (parallel execution):
|
|
61
|
+
|
|
62
|
+
- **Flow explorer**: Trace the primary call chain end-to-end — entry point through to side effects
|
|
63
|
+
- **Dependency explorer**: Map imports, shared types, module boundaries, and integration points
|
|
64
|
+
- **Pattern explorer**: Identify recurring patterns, conventions, and architectural decisions in the area
|
|
65
|
+
|
|
66
|
+
Adjust explorer focus based on the specific exploration question.
|
|
67
|
+
|
|
68
|
+
Ask each explorer for a final report of at most about 1,500 tokens: findings with file:line references, not file dumps.
|
|
69
|
+
|
|
70
|
+
### Phase 4: Synthesize
|
|
71
|
+
|
|
72
|
+
**Produces:** MERGED_FINDINGS
|
|
73
|
+
**Requires:** EXPLORE_OUTPUT
|
|
74
|
+
|
|
75
|
+
Spawn `Agent(subagent_type="Synthesize")` in `exploration` mode with combined findings:
|
|
76
|
+
|
|
77
|
+
- Merge overlapping discoveries from parallel explorers
|
|
78
|
+
- Resolve any contradictions between explorer findings
|
|
79
|
+
- Organize into the Output format below
|
|
80
|
+
|
|
81
|
+
### Phase 5: Present
|
|
82
|
+
|
|
83
|
+
**Requires:** MERGED_FINDINGS
|
|
84
|
+
|
|
85
|
+
Main session reviews synthesis for:
|
|
86
|
+
|
|
87
|
+
- **Gaps**: Areas the explorers missed or couldn't reach
|
|
88
|
+
- **Surprises**: Unexpected patterns, hidden dependencies, non-obvious design choices
|
|
89
|
+
- **Depth**: Areas where the user might want to drill deeper
|
|
90
|
+
|
|
91
|
+
Present findings to user. Use AskUserQuestion to offer focused follow-up exploration.
|
|
92
|
+
|
|
93
|
+
### Phase 6: Suggest Feature Knowledge Creation (Conditional)
|
|
94
|
+
|
|
95
|
+
**Requires:** MERGED_FINDINGS
|
|
96
|
+
**Produces:** FEATURE_KNOWLEDGE_STATUS (created | skipped)
|
|
97
|
+
|
|
98
|
+
1. Check if matching feature knowledge already exists by reading `{worktree}/.devflow/features/index.md` (or globbing frontmatter if absent). If covered → skip
|
|
99
|
+
2. Use AskUserQuestion: "No feature knowledge exists for {explored area}. Create one to capture these patterns?"
|
|
100
|
+
3. If user declines → set FEATURE_KNOWLEDGE_STATUS = skipped
|
|
101
|
+
4. If user accepts: proceed with write-back below.
|
|
102
|
+
|
|
103
|
+
### Feature Knowledge Write-Back (Conditional)
|
|
104
|
+
|
|
105
|
+
Resolve `{worktree}` as the checkout's toplevel, because feature knowledge bases are committed with the branch (D-PROMPT-ROOT): from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`) — run
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git -C "{start}" rev-parse --show-toplevel
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
and use its one-line output. If the command fails (outside a git repository), `{worktree}` is the start directory itself. All paths below are relative to `{worktree}`.
|
|
112
|
+
|
|
113
|
+
**Step 1 — Check the opt-out gate, with `{root}` = `{worktree}`:** take the settings line resolved above for that root, resolving it with the settings block when this run has not yet.
|
|
114
|
+
|
|
115
|
+
If the settings line says `KNOWLEDGE=off`, skip write-back entirely. The machine switch (`devflow knowledge --disable`), the repository and the personal settings can each turn knowledge off, and none can turn it back on (D-FEATURES-NARROW-ONLY). The fail-closed line says `KNOWLEDGE=off` too, so an unresolvable line skips write-back.
|
|
116
|
+
|
|
117
|
+
**Step 2 — Evaluate whether write-back is warranted:**
|
|
118
|
+
|
|
119
|
+
Only proceed if **at least one** of these is true:
|
|
120
|
+
- This workflow changed files in a directory that is documented by an existing feature knowledge base (a documented area changed). Knowledge bases are written through at that point, never on a background schedule.
|
|
121
|
+
- This workflow surfaced durable, cross-cutting knowledge about a codebase area that would help future agents working in the same area — patterns, anti-patterns, integration points, gotchas not visible from a single file read.
|
|
122
|
+
|
|
123
|
+
**Never spawn unconditionally.** If neither condition is met, skip write-back silently.
|
|
124
|
+
|
|
125
|
+
**Step 3 — Spawn the Knowledge agent:**
|
|
126
|
+
|
|
127
|
+
Spawn `Agent(subagent_type="Knowledge")` with the following context:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
"WORKTREE_PATH: {worktree root}
|
|
131
|
+
FEATURE_SLUG: {slug derived from primary changed directory, kebab-case}
|
|
132
|
+
FEATURE_NAME: {human-readable name}
|
|
133
|
+
DIRECTORIES: {list of primary directories touched by this workflow}
|
|
134
|
+
FILES_CHANGED: {list of files changed}
|
|
135
|
+
|
|
136
|
+
Write the knowledge base to:
|
|
137
|
+
{worktree}/.devflow/features/{slug}/KNOWLEDGE.md
|
|
138
|
+
|
|
139
|
+
Then update the index cache by performing a read-modify-write on:
|
|
140
|
+
{worktree}/.devflow/features/index.md
|
|
141
|
+
|
|
142
|
+
Index line format: `- **{slug}** — {areas} — {Use-when description}` — at most 300 characters, the description at most 220; reword a longer one, never cut it.
|
|
143
|
+
|
|
144
|
+
If the line for this slug already exists in index.md, replace it. If it does not exist, append it. If index.md does not exist, create it with just this line.
|
|
145
|
+
|
|
146
|
+
The frontmatter in KNOWLEDGE.md is the source of truth — index.md is only a cache. Write the two files directly — no intermediate result JSON files, no external scripts.
|
|
147
|
+
|
|
148
|
+
After writing, commit the two files to the current worktree branch yourself by running git via your Bash tool (do not use a script). Stage ONLY .devflow/features/index.md and .devflow/features/{slug}/KNOWLEDGE.md, then commit just those paths with a docs(knowledge): message. Do NOT push, do NOT force, do NOT stage anything else. Follow your Commit Protocol — it is non-blocking, so if any git step fails, report KB_COMMIT and finish normally."
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Step 4 — Surface an uncommitted knowledge base:**
|
|
152
|
+
|
|
153
|
+
When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files were written but deliberately not committed — a commit on a detached HEAD becomes unreachable once HEAD moves. Tell the user in the workflow's final report, in one line, that the knowledge base was written but not committed, and name the uncommitted paths the agent listed, so they can commit them on a branch before the worktree is removed. Never commit them yourself.
|
|
154
|
+
|
|
155
|
+
**Failure handling**: Non-blocking. If the Knowledge agent fails, log the failure and continue — the workflow outcome is not affected by write-back success.
|
|
156
|
+
|
|
157
|
+
Set FEATURE_KNOWLEDGE_STATUS = created (if agent spawned) or skipped.
|
|
158
|
+
|
|
159
|
+
**Failure handling**: Non-blocking. If Knowledge agent fails, log and continue.
|
|
160
|
+
|
|
161
|
+
## Worktree Support
|
|
162
|
+
|
|
163
|
+
If the orchestrator receives a `WORKTREE_PATH` context (e.g., from multi-worktree workflows), pass it through to all spawned agents. Each agent's "Worktree Support" section handles path resolution.
|
|
164
|
+
|
|
165
|
+
## Output
|
|
166
|
+
|
|
167
|
+
Structured exploration findings with concrete code references:
|
|
168
|
+
|
|
169
|
+
- Scope (what was explored and boundaries)
|
|
170
|
+
- Architecture Map (modules, layers, key abstractions with file:line)
|
|
171
|
+
- Flow Trace (call chain from entry to exit with file:line at each step)
|
|
172
|
+
- Integration Points (module boundaries, shared types, external dependencies)
|
|
173
|
+
- Patterns (recurring conventions, design decisions observed)
|
|
174
|
+
- Key Insights (non-obvious findings, surprises, potential concerns)
|
|
175
|
+
|
|
176
|
+
## Architecture
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
/explore (orchestrator)
|
|
180
|
+
│
|
|
181
|
+
├─ Phase 1: Resolve Settings
|
|
182
|
+
│
|
|
183
|
+
├─ Phase 2: Orient
|
|
184
|
+
│ └─ Skim agent (codebase overview)
|
|
185
|
+
│
|
|
186
|
+
├─ Phase 3: Parallel exploration
|
|
187
|
+
│ └─ 2-3 Explore agents (flow, dependency, pattern) in single message
|
|
188
|
+
│
|
|
189
|
+
├─ Phase 4: Synthesize
|
|
190
|
+
│ └─ Synthesize agent aggregates findings in exploration mode
|
|
191
|
+
│
|
|
192
|
+
├─ Phase 5: Present findings with drill-down offer
|
|
193
|
+
│
|
|
194
|
+
└─ Phase 6: Suggest feature knowledge creation (conditional)
|
|
195
|
+
└─ Knowledge agent write-back (if user accepts and no existing feature knowledge)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Principles
|
|
199
|
+
|
|
200
|
+
1. **Structure over browsing** - Every claim must cite file:line references
|
|
201
|
+
2. **Parallel execution** - All explorers run simultaneously for speed
|
|
202
|
+
3. **Knowledge-informed** - NO pre-loaded feature knowledge in sub-agents (avoids confirmation bias)
|
|
203
|
+
4. **User-driven depth** - Present findings, then offer drill-down into specific areas
|
|
204
|
+
|
|
205
|
+
## Error Handling
|
|
206
|
+
|
|
207
|
+
- If Skim agent returns no relevant files: report "No files found matching exploration scope"
|
|
208
|
+
- If all explorers error: report partial findings from any that succeeded, note gaps
|
|
209
|
+
- If an explorer errors: continue with remaining results, note the gap
|
|
210
|
+
- If feature knowledge creation fails: log failure, report exploration results normally
|