compound-workflow 1.9.2 → 1.9.4
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/package.json +1 -1
- package/src/AGENTS.md +11 -0
- package/src/skills/setup-agents/SKILL.md +117 -46
package/package.json
CHANGED
package/src/AGENTS.md
CHANGED
|
@@ -44,6 +44,17 @@ Onboarding:
|
|
|
44
44
|
|
|
45
45
|
- `/install` — one action: copies agents/skills/commands, writes opencode.json, merges AGENTS.md, creates docs/todo dirs (run `npx compound-workflow install` in the project)
|
|
46
46
|
|
|
47
|
+
## Orchestration Model
|
|
48
|
+
|
|
49
|
+
The main agent stays lean. Context lives where it's needed, not at the top.
|
|
50
|
+
|
|
51
|
+
- **Plan** selects the minimal skill set for the work and names each selection explicitly. Unused skills never load.
|
|
52
|
+
- **Work** allocates tasks to subagents and passes only what each task needs: the problem statement, relevant file refs, success criteria. Not conversation history, not unrelated context.
|
|
53
|
+
- **Subagents** run in isolation, return evidence and results. The main agent orchestrates, records outcomes, and moves to the next task.
|
|
54
|
+
- **Skills load on demand.** Commands pull a skill into context only when a gate or step requires it — not as a precautionary baseline.
|
|
55
|
+
|
|
56
|
+
Context budget rule: if a task can be done with less context, pass less. If a subagent can handle it, delegate.
|
|
57
|
+
|
|
47
58
|
## Non-negotiables (Structure Integrity)
|
|
48
59
|
|
|
49
60
|
- **Commands are the public API.** Keep `/workflow:*` command docs stable; add capability via skills/agents, not new command variants.
|
|
@@ -16,6 +16,30 @@ triggers:
|
|
|
16
16
|
|
|
17
17
|
Create or update a minimal, authoritative `AGENTS.md` for any project.
|
|
18
18
|
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Developer Experience Contract (CRITICAL)
|
|
22
|
+
|
|
23
|
+
This skill is a config generator, not a survey. The developer interaction budget is **one round-trip**: propose a complete config, let the user accept or override.
|
|
24
|
+
|
|
25
|
+
**Hard constraints — violating any of these is a skill failure:**
|
|
26
|
+
|
|
27
|
+
- **At most two prompts per run.** (1) Phase 1b alignment prompt — only if harness skill sets differ. (2) Phase 2 config block — always. No other questions.
|
|
28
|
+
- **No numbered question lists.** Never emit `1. … 2. … 3. …` walls. Never split a single decision across multiple messages.
|
|
29
|
+
- **Never ask about skill inclusion.** Every skill in any discovered skills directory is included in the Skill Index automatically. Do not ask "keep all four guardrails?" or "which skills to include?".
|
|
30
|
+
- **Never ask meta questions.** No "project-specific skills appear elsewhere — flag as a gap?", no "strip extra sections?", no commentary on memory vs. code mismatches. If the template forbids something, silently conform.
|
|
31
|
+
- **Never present "ambiguous — need your call" sections.** Ambiguity is resolved by the deterministic rules below and surfaced in the Phase 2 block for the user to override. Pick a value.
|
|
32
|
+
- **Never re-confirm.** After the user replies to Phase 2, write the file. No second confirmation pass.
|
|
33
|
+
|
|
34
|
+
**Ambiguity resolution (apply without asking):**
|
|
35
|
+
|
|
36
|
+
- **Monorepo with multiple apps:** pick the workspace whose `scripts.dev` / `scripts.test` matches the detected harness target, or the newest one by `package.json` mtime. Record as `[detected]` and let the user override in Phase 2.
|
|
37
|
+
- **Multiple candidate commands (e.g. `npm test` vs `npm run test:web2:run`):** prefer the most specific workspace-scoped command over the root alias.
|
|
38
|
+
- **Memory or prior config suggests a different target than current code:** treat code as source of truth. Surface the detected value; the user can override.
|
|
39
|
+
- **Legacy/deprecated paths visible in code:** ignore for detection. Pick the active target.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
19
43
|
## Mode Detection
|
|
20
44
|
|
|
21
45
|
Before doing anything, check whether `AGENTS.md` exists in the repo root.
|
|
@@ -33,19 +57,16 @@ Announce the mode before proceeding.
|
|
|
33
57
|
|
|
34
58
|
Check which directories exist at the project root. Do not assume any are present — record only what is actually found on disk.
|
|
35
59
|
|
|
36
|
-
Known harness patterns
|
|
60
|
+
Known harness patterns: `.agents`, `.claude`, `.cursor`. Check all three; others may exist.
|
|
37
61
|
|
|
38
|
-
For each found harness,
|
|
39
|
-
- `<harness>/skills/` — if that subdirectory exists
|
|
40
|
-
- `.claude/` has no skills directory (agents only, in `.claude/agents/`)
|
|
62
|
+
For each found harness, check `<harness>/skills/`. Record:
|
|
41
63
|
|
|
42
|
-
|
|
64
|
+
- `$harnesses` — ordered list of harness directories found
|
|
65
|
+
- `$skills_dirs` — map of `<harness>` → `<harness>/skills/` for every harness that has a skills subdirectory
|
|
43
66
|
|
|
44
|
-
If **no harness directories exist**, stop
|
|
67
|
+
If **no harness directories exist**, stop:
|
|
45
68
|
> No harness directories found. Run `npx compound-workflow install` first, then re-run this skill.
|
|
46
69
|
|
|
47
|
-
Use the **first found skills directory** across `$harnesses` as the canonical source for skill discovery in Phase 3. Record this as `$skills_dir`.
|
|
48
|
-
|
|
49
70
|
> **Note:** `harnesses` in AGENTS.md Repo Config may become stale if harness directories are added or removed. Re-run `/setup-agents` to refresh it.
|
|
50
71
|
|
|
51
72
|
### Project stack detection
|
|
@@ -79,53 +100,85 @@ For each value, state whether it was detected or defaulted.
|
|
|
79
100
|
|
|
80
101
|
---
|
|
81
102
|
|
|
103
|
+
## Phase 1b: Discover Skills Across Harnesses
|
|
104
|
+
|
|
105
|
+
For every entry in `$skills_dirs`, list subdirectories and read each `SKILL.md` frontmatter (`name`, `description`).
|
|
106
|
+
|
|
107
|
+
Build `$skill_matrix`: `<skill name>` → `{harnesses where present, source description}`. The **Skill Index** in AGENTS.md is the union of all skill names across all harnesses.
|
|
108
|
+
|
|
109
|
+
**If every harness with a skills directory has the same skill set:** proceed silently to Phase 2. No prompt, no table output.
|
|
110
|
+
|
|
111
|
+
**If harnesses diverge** (a skill is in one harness but missing from another), emit the comparison table and one prompt:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Skill presence across harnesses:
|
|
115
|
+
|
|
116
|
+
| Skill | <harness 1> | <harness 2> | ... |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| <name> | ✓ | ✗ | ... |
|
|
119
|
+
| <name> | ✓ | ✓ | ... |
|
|
120
|
+
|
|
121
|
+
Skills differ across harnesses. Align them? Aligning copies each skill's files into every harness so all locations have the same set.
|
|
122
|
+
|
|
123
|
+
Reply `align` to sync, `skip` to leave them as-is.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**If `align`:** for each skill, pick the harness where it lives as the source and copy its directory into every other harness's skills directory (create the directory if missing). Note what was copied in the final summary.
|
|
127
|
+
|
|
128
|
+
**If `skip`:** proceed with the union as the Skill Index; record in the summary that harnesses remain out of sync.
|
|
129
|
+
|
|
130
|
+
Either way, proceed to Phase 2 after this single prompt.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
82
134
|
## Phase 2: Confirm the Proposed Config
|
|
83
135
|
|
|
84
|
-
|
|
136
|
+
This is the **only** user prompt in the skill. Emit one block and one question. Nothing else.
|
|
137
|
+
|
|
138
|
+
**Forbidden in this phase:**
|
|
85
139
|
|
|
86
|
-
|
|
140
|
+
- Numbered question lists
|
|
141
|
+
- Separate "Ambiguous — need your call" sections
|
|
142
|
+
- Any prompt about skills, guardrails, extra sections, or template compliance
|
|
143
|
+
- Per-field prompting ("confirm this? confirm that?")
|
|
144
|
+
- Commentary about memory, deprecated paths, or detected inconsistencies outside the block itself
|
|
87
145
|
|
|
88
|
-
|
|
146
|
+
**Update mode:** start from the values already in `AGENTS.md`. Only overwrite with a Phase 1 detection when the existing value is empty or clearly stale (references a command that no longer exists). Mark overrides `[updated]` so the user can see what changed.
|
|
147
|
+
|
|
148
|
+
Output exactly this structure — no preamble, no trailing questions:
|
|
89
149
|
|
|
90
150
|
```
|
|
91
|
-
Proposed AGENTS.md config:
|
|
92
|
-
|
|
93
|
-
default_branch: <value> [detected|default|existing]
|
|
94
|
-
project_tracker: <value> [detected|default|existing]
|
|
95
|
-
dev_server_url: <value> [detected|default|existing]
|
|
96
|
-
test_command: <value> [detected|existing]
|
|
97
|
-
test_fast_command: <value> [detected|existing|omit]
|
|
98
|
-
lint_command: <value> [detected|existing|omit]
|
|
99
|
-
typecheck_command: <value> [detected|existing|omit]
|
|
100
|
-
format_command: <value> [detected|existing|omit]
|
|
151
|
+
Proposed AGENTS.md config (update|init mode):
|
|
152
|
+
|
|
153
|
+
default_branch: <value> [detected|default|existing|updated]
|
|
154
|
+
project_tracker: <value> [detected|default|existing|updated]
|
|
155
|
+
dev_server_url: <value> [detected|default|existing|updated]
|
|
156
|
+
test_command: <value> [detected|existing|updated]
|
|
157
|
+
test_fast_command: <value> [detected|existing|updated|omit]
|
|
158
|
+
lint_command: <value> [detected|existing|updated|omit]
|
|
159
|
+
typecheck_command: <value> [detected|existing|updated|omit]
|
|
160
|
+
format_command: <value> [detected|existing|updated|omit]
|
|
101
161
|
worktree_dir: <value> [default|existing]
|
|
102
|
-
worktree_install_command: <value> [detected|existing]
|
|
103
|
-
worktree_copy_files: [<files>] [detected|existing]
|
|
162
|
+
worktree_install_command: <value> [detected|existing|updated]
|
|
163
|
+
worktree_copy_files: [<files>] [detected|existing|updated]
|
|
104
164
|
harnesses: [<dirs>] [detected]
|
|
105
165
|
|
|
106
|
-
|
|
166
|
+
Reply `ok` to accept, or send `<key>: <value>` lines to override. Anything else cancels.
|
|
107
167
|
```
|
|
108
168
|
|
|
109
|
-
|
|
169
|
+
On reply: apply overrides (if any), proceed to Phase 3 and Phase 4. Do not re-confirm.
|
|
110
170
|
|
|
111
171
|
---
|
|
112
172
|
|
|
113
173
|
## Phase 3: Build the Skill Index
|
|
114
174
|
|
|
115
|
-
|
|
175
|
+
Use `$skill_matrix` from Phase 1b. The Skill Index is the union of skill names across all harnesses. For each skill, use the `description` from that skill's `SKILL.md` frontmatter.
|
|
116
176
|
|
|
117
|
-
|
|
177
|
+
Never reference a skill not present on disk. Never invent a description.
|
|
118
178
|
|
|
119
|
-
|
|
179
|
+
**Include every discovered skill automatically. No user prompt.** If the user wants to exclude a skill, they remove it from the skills directories — this skill does not curate.
|
|
120
180
|
|
|
121
|
-
|
|
122
|
-
Skill Index will include all installed skills from <$skills_dir>:
|
|
123
|
-
- <name> — <description from frontmatter>
|
|
124
|
-
- <name> — <description from frontmatter>
|
|
125
|
-
...
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Update mode:** diff against the existing Skill Index and note additions/removals, then write the refreshed list. If the user wants to exclude a skill, they should uninstall or remove it from `$skills_dir` rather than hand-curate the index.
|
|
181
|
+
**Update mode:** diff against the existing Skill Index silently and write the refreshed list. Do not surface the diff as a question.
|
|
129
182
|
|
|
130
183
|
---
|
|
131
184
|
|
|
@@ -176,6 +229,17 @@ Continuous improvement:
|
|
|
176
229
|
- `/metrics` — log + assess a session
|
|
177
230
|
- `/assess` — aggregate metrics and propose improvements
|
|
178
231
|
|
|
232
|
+
## Orchestration Model
|
|
233
|
+
|
|
234
|
+
The main agent stays lean. Context lives where it's needed, not at the top.
|
|
235
|
+
|
|
236
|
+
- **Plan** selects the minimal skill set for the work and names each selection explicitly. Unused skills never load.
|
|
237
|
+
- **Work** allocates tasks to subagents and passes only what each task needs: the problem statement, relevant file refs, success criteria. Not conversation history, not unrelated context.
|
|
238
|
+
- **Subagents** run in isolation, return evidence and results. The main agent orchestrates, records outcomes, and moves to the next task.
|
|
239
|
+
- **Skills load on demand.** Commands pull a skill into context only when a gate or step requires it — not as a precautionary baseline.
|
|
240
|
+
|
|
241
|
+
Context budget rule: if a task can be done with less context, pass less. If a subagent can handle it, delegate.
|
|
242
|
+
|
|
179
243
|
## Non-negotiables (Structure Integrity)
|
|
180
244
|
|
|
181
245
|
- **Commands are the public API.** Keep `/workflow:*` command docs stable; add capability via skills/agents, not new command variants.
|
|
@@ -246,7 +310,7 @@ After writing, verify:
|
|
|
246
310
|
- [ ] Every skill in the Skill Index was discovered from `$skills_dir` — no invented entries
|
|
247
311
|
- [ ] All skill descriptions come from `SKILL.md` frontmatter — none invented by the agent
|
|
248
312
|
- [ ] No hardcoded tool, platform, or directory names
|
|
249
|
-
- [ ] File is under
|
|
313
|
+
- [ ] File is under 160 lines
|
|
250
314
|
|
|
251
315
|
If any check fails, fix before confirming completion.
|
|
252
316
|
|
|
@@ -254,12 +318,19 @@ If any check fails, fix before confirming completion.
|
|
|
254
318
|
|
|
255
319
|
## Rules
|
|
256
320
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
321
|
+
**Developer experience (non-negotiable):**
|
|
322
|
+
|
|
323
|
+
- One user prompt per run — the Phase 2 block. No other questions.
|
|
324
|
+
- No numbered question lists, no "ambiguous — need your call" sections, no skill curation prompts, no meta-observations about the codebase.
|
|
325
|
+
- Resolve ambiguity deterministically using the rules in the Developer Experience Contract. Surface the pick in the block; let the user override.
|
|
326
|
+
|
|
327
|
+
**Content integrity:**
|
|
328
|
+
|
|
329
|
+
- Never add sections beyond what the template defines — keep it minimal. Silently conform; do not ask.
|
|
330
|
+
- Never hardcode skill names — discover everything from the detected skills directory.
|
|
331
|
+
- Never hardcode harness paths — detect what exists on disk first; `harnesses` in AGENTS.md reflects reality, not assumptions.
|
|
332
|
+
- Never invent skill descriptions — always read from the skill's `SKILL.md` frontmatter.
|
|
333
|
+
- Never hardcode tool or platform names.
|
|
334
|
+
- Never duplicate content that lives in command or skill docs.
|
|
335
|
+
- In update mode, preserve values that are still valid; only replace stale or empty ones.
|
|
336
|
+
- When the Phase 4 template changes, update `src/AGENTS.md` to match (it is the populated default instance).
|