@bradygaster/squad-sdk 0.9.6-insider.2 → 0.10.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/dist/adapter/client.d.ts.map +1 -1
- package/dist/adapter/client.js +16 -3
- package/dist/adapter/client.js.map +1 -1
- package/dist/adapter/types.d.ts +6 -1
- package/dist/adapter/types.d.ts.map +1 -1
- package/dist/agents/charter-compiler.d.ts +2 -0
- package/dist/agents/charter-compiler.d.ts.map +1 -1
- package/dist/agents/charter-compiler.js +6 -1
- package/dist/agents/charter-compiler.js.map +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +24 -25
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/lifecycle.d.ts.map +1 -1
- package/dist/agents/lifecycle.js +11 -2
- package/dist/agents/lifecycle.js.map +1 -1
- package/dist/agents/onboarding.d.ts.map +1 -1
- package/dist/agents/onboarding.js +24 -0
- package/dist/agents/onboarding.js.map +1 -1
- package/dist/config/agent-source.d.ts.map +1 -1
- package/dist/config/agent-source.js +60 -33
- package/dist/config/agent-source.js.map +1 -1
- package/dist/config/feature-audit.js +1 -1
- package/dist/config/feature-audit.js.map +1 -1
- package/dist/config/init.d.ts +4 -0
- package/dist/config/init.d.ts.map +1 -1
- package/dist/config/init.js +177 -44
- package/dist/config/init.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/marketplace/index.d.ts +7 -0
- package/dist/marketplace/index.d.ts.map +1 -1
- package/dist/marketplace/index.js +4 -0
- package/dist/marketplace/index.js.map +1 -1
- package/dist/marketplace/plugin-manifest.d.ts +113 -0
- package/dist/marketplace/plugin-manifest.d.ts.map +1 -0
- package/dist/marketplace/plugin-manifest.js +820 -0
- package/dist/marketplace/plugin-manifest.js.map +1 -0
- package/dist/marketplace/plugin-runtime.d.ts +37 -0
- package/dist/marketplace/plugin-runtime.d.ts.map +1 -0
- package/dist/marketplace/plugin-runtime.js +217 -0
- package/dist/marketplace/plugin-runtime.js.map +1 -0
- package/dist/marketplace/plugin-state.d.ts +89 -0
- package/dist/marketplace/plugin-state.d.ts.map +1 -0
- package/dist/marketplace/plugin-state.js +278 -0
- package/dist/marketplace/plugin-state.js.map +1 -0
- package/dist/memory/index.d.ts +262 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +1122 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/multi-squad.d.ts.map +1 -1
- package/dist/multi-squad.js +5 -2
- package/dist/multi-squad.js.map +1 -1
- package/dist/platform/azure-devops.d.ts.map +1 -1
- package/dist/platform/azure-devops.js +17 -3
- package/dist/platform/azure-devops.js.map +1 -1
- package/dist/platform/detect.d.ts.map +1 -1
- package/dist/platform/detect.js +12 -5
- package/dist/platform/detect.js.map +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +26 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/ralph/triage.js +1 -1
- package/dist/ralph/triage.js.map +1 -1
- package/dist/resolution.d.ts +18 -0
- package/dist/resolution.d.ts.map +1 -1
- package/dist/resolution.js +64 -2
- package/dist/resolution.js.map +1 -1
- package/dist/runtime/memory-value-benchmark.d.ts +61 -0
- package/dist/runtime/memory-value-benchmark.d.ts.map +1 -0
- package/dist/runtime/memory-value-benchmark.js +245 -0
- package/dist/runtime/memory-value-benchmark.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +8 -0
- package/dist/runtime/scheduler.d.ts.map +1 -1
- package/dist/runtime/scheduler.js +52 -5
- package/dist/runtime/scheduler.js.map +1 -1
- package/dist/sharing/export.d.ts +1 -0
- package/dist/sharing/export.d.ts.map +1 -1
- package/dist/sharing/export.js +10 -0
- package/dist/sharing/export.js.map +1 -1
- package/dist/sharing/import.d.ts.map +1 -1
- package/dist/sharing/import.js +3 -2
- package/dist/sharing/import.js.map +1 -1
- package/dist/sharing/index.d.ts +1 -0
- package/dist/sharing/index.d.ts.map +1 -1
- package/dist/sharing/index.js +1 -0
- package/dist/sharing/index.js.map +1 -1
- package/dist/sharing/repo-sync.d.ts +80 -0
- package/dist/sharing/repo-sync.d.ts.map +1 -0
- package/dist/sharing/repo-sync.js +138 -0
- package/dist/sharing/repo-sync.js.map +1 -0
- package/dist/state-backend.d.ts +154 -9
- package/dist/state-backend.d.ts.map +1 -1
- package/dist/state-backend.js +729 -184
- package/dist/state-backend.js.map +1 -1
- package/dist/tools/index.d.ts +39 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +395 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/utils/map-with-limit.d.ts +37 -0
- package/dist/utils/map-with-limit.d.ts.map +1 -0
- package/dist/utils/map-with-limit.js +81 -0
- package/dist/utils/map-with-limit.js.map +1 -0
- package/package.json +6 -2
- package/templates/after-agent-reference.md +64 -0
- package/templates/ceremony-reference.md +82 -0
- package/templates/client-compatibility-reference.md +46 -0
- package/templates/copilot-agent.md +96 -0
- package/templates/copilot-instructions.md +14 -0
- package/templates/model-selection-reference.md +101 -0
- package/templates/prd-intake.md +105 -0
- package/templates/rai-charter.md +110 -0
- package/templates/rai-policy.md +103 -0
- package/templates/ralph-reference.md +141 -0
- package/templates/routing.md +1 -0
- package/templates/scribe-charter.md +18 -151
- package/templates/session-init-reference.md +199 -0
- package/templates/skills/e2e-template-testing/SKILL.md +557 -0
- package/templates/skills/fact-checking/SKILL.md +61 -0
- package/templates/spawn-reference.md +131 -0
- package/templates/squad.agent.md.template +200 -625
- package/templates/workflow-wiring-appendix-a-code-reviewer.md +131 -0
- package/templates/workflow-wiring-appendix-b-documenter.md +140 -0
- package/templates/workflow-wiring-guide.md +276 -0
- package/templates/workflows/squad-heartbeat.yml +167 -167
- package/templates/worktree-reference.md +126 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded-concurrency helper for fan-out async work.
|
|
3
|
+
*
|
|
4
|
+
* @module utils/map-with-limit
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Run `fn` against each item with at most `limit` operations in flight.
|
|
8
|
+
*
|
|
9
|
+
* Results are returned in **input order**, regardless of the order in which
|
|
10
|
+
* individual promises settle. This matches the semantics callers usually
|
|
11
|
+
* want when migrating from a sequential `for (const x of xs) { result.push(await fn(x)); }`
|
|
12
|
+
* pattern: ordering is preserved, but throughput is bounded.
|
|
13
|
+
*
|
|
14
|
+
* Errors propagate via the returned Promise. Use `mapWithLimitSettled()`
|
|
15
|
+
* when individual failures should not abort the batch.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // 8 charters fetched 5-at-a-time over HTTP:
|
|
19
|
+
* const manifests = await mapWithLimit(dirs, 5, (dir) => fetchCharter(dir));
|
|
20
|
+
*
|
|
21
|
+
* @param items Inputs to map over.
|
|
22
|
+
* @param limit Maximum concurrent calls (must be ≥ 1).
|
|
23
|
+
* @param fn Async mapper.
|
|
24
|
+
* @returns Array of results in the same order as `items`.
|
|
25
|
+
*/
|
|
26
|
+
export async function mapWithLimit(items, limit, fn) {
|
|
27
|
+
if (limit < 1 || !Number.isFinite(limit)) {
|
|
28
|
+
throw new Error(`mapWithLimit: limit must be a positive integer, got ${limit}`);
|
|
29
|
+
}
|
|
30
|
+
if (items.length === 0)
|
|
31
|
+
return [];
|
|
32
|
+
const results = new Array(items.length);
|
|
33
|
+
let nextIndex = 0;
|
|
34
|
+
const workerCount = Math.min(limit, items.length);
|
|
35
|
+
async function worker() {
|
|
36
|
+
while (true) {
|
|
37
|
+
const idx = nextIndex++;
|
|
38
|
+
if (idx >= items.length)
|
|
39
|
+
return;
|
|
40
|
+
results[idx] = await fn(items[idx], idx);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
44
|
+
return results;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Variant of {@link mapWithLimit} that captures individual failures rather
|
|
48
|
+
* than aborting on the first rejection. Returns an array of
|
|
49
|
+
* `{ status: 'fulfilled', value }` / `{ status: 'rejected', reason }` in
|
|
50
|
+
* input order — identical shape to `Promise.allSettled`.
|
|
51
|
+
*
|
|
52
|
+
* Use this when one bad input (e.g. a corrupt charter.md) should not stop
|
|
53
|
+
* the whole batch.
|
|
54
|
+
*/
|
|
55
|
+
export async function mapWithLimitSettled(items, limit, fn) {
|
|
56
|
+
if (limit < 1 || !Number.isFinite(limit)) {
|
|
57
|
+
throw new Error(`mapWithLimitSettled: limit must be a positive integer, got ${limit}`);
|
|
58
|
+
}
|
|
59
|
+
if (items.length === 0)
|
|
60
|
+
return [];
|
|
61
|
+
const results = new Array(items.length);
|
|
62
|
+
let nextIndex = 0;
|
|
63
|
+
const workerCount = Math.min(limit, items.length);
|
|
64
|
+
async function worker() {
|
|
65
|
+
while (true) {
|
|
66
|
+
const idx = nextIndex++;
|
|
67
|
+
if (idx >= items.length)
|
|
68
|
+
return;
|
|
69
|
+
try {
|
|
70
|
+
const value = await fn(items[idx], idx);
|
|
71
|
+
results[idx] = { status: 'fulfilled', value };
|
|
72
|
+
}
|
|
73
|
+
catch (reason) {
|
|
74
|
+
results[idx] = { status: 'rejected', reason };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
79
|
+
return results;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=map-with-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-with-limit.js","sourceRoot":"","sources":["../../src/utils/map-with-limit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAmB,EACnB,KAAa,EACb,EAA0C;IAE1C,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,uDAAuD,KAAK,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,OAAO,GAAG,IAAI,KAAK,CAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD,KAAK,UAAU,MAAM;QACnB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;YACxB,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM;gBAAE,OAAO;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAE,EAAE,GAAG,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAmB,EACnB,KAAa,EACb,EAA0C;IAE1C,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,8DAA8D,KAAK,EAAE,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,OAAO,GAAG,IAAI,KAAK,CAA0B,KAAK,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD,KAAK,UAAU,MAAM;QACnB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;YACxB,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM;gBAAE,OAAO;YAChC,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAE,EAAE,GAAG,CAAC,CAAC;gBACzC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;YAChD,CAAC;YAAC,OAAO,MAAM,EAAE,CAAC;gBAChB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;YAChD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bradygaster/squad-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Squad SDK — Programmable multi-agent runtime for GitHub Copilot",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -194,6 +194,10 @@
|
|
|
194
194
|
"types": "./dist/storage/index.d.ts",
|
|
195
195
|
"import": "./dist/storage/index.js"
|
|
196
196
|
},
|
|
197
|
+
"./memory": {
|
|
198
|
+
"types": "./dist/memory/index.d.ts",
|
|
199
|
+
"import": "./dist/memory/index.js"
|
|
200
|
+
},
|
|
197
201
|
"./platform": {
|
|
198
202
|
"types": "./dist/platform/index.d.ts",
|
|
199
203
|
"import": "./dist/platform/index.js"
|
|
@@ -232,7 +236,7 @@
|
|
|
232
236
|
"node": ">=22.5.0"
|
|
233
237
|
},
|
|
234
238
|
"dependencies": {
|
|
235
|
-
"@github/copilot-sdk": "^0.
|
|
239
|
+
"@github/copilot-sdk": "^0.3.0",
|
|
236
240
|
"vscode-jsonrpc": "^8.2.1"
|
|
237
241
|
},
|
|
238
242
|
"optionalDependencies": {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# After Agent Reference
|
|
2
|
+
|
|
3
|
+
### After Agent Work
|
|
4
|
+
|
|
5
|
+
<!-- KNOWN PLATFORM BUGS: (1) "Silent Success" — ~7-10% of background spawns complete
|
|
6
|
+
file writes but return no text. Mitigated by RESPONSE ORDER + filesystem checks.
|
|
7
|
+
(2) "Server Error Retry Loop" — context overflow after fan-out. Mitigated by lean
|
|
8
|
+
post-work turn + Scribe delegation + compact result presentation. -->
|
|
9
|
+
|
|
10
|
+
**⚡ Keep the post-work turn LEAN.** Coordinator's job: (1) present compact results, (2) spawn Scribe. That's ALL. No orchestration logs, no decision consolidation, no heavy file I/O.
|
|
11
|
+
|
|
12
|
+
**⚡ Context budget rule:** After collecting results from 3+ agents, use compact format (agent + 1-line outcome). Full details go in orchestration log via Scribe.
|
|
13
|
+
|
|
14
|
+
After each batch of agent work:
|
|
15
|
+
|
|
16
|
+
1. **Collect results** via `read_agent` (wait: true, timeout: 300).
|
|
17
|
+
|
|
18
|
+
2. **Silent success detection** — when `read_agent` returns empty/no response:
|
|
19
|
+
- Check filesystem: history.md modified? New decision inbox files? Output files created?
|
|
20
|
+
- Files found → `"⚠️ {Name} completed (files verified) but response lost."` Treat as DONE.
|
|
21
|
+
- No files → `"❌ {Name} failed — no work product."` Consider re-spawn.
|
|
22
|
+
|
|
23
|
+
3. **Show compact results:** `{emoji} {Name} — {1-line summary of what they did}`
|
|
24
|
+
|
|
25
|
+
4. **Spawn Scribe** (background, never wait). Only if agents ran or inbox has files:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
agent_type: "general-purpose"
|
|
29
|
+
model: "claude-haiku-4.5"
|
|
30
|
+
mode: "background"
|
|
31
|
+
name: "scribe"
|
|
32
|
+
description: "📋 Scribe: Log session & merge decisions"
|
|
33
|
+
prompt: |
|
|
34
|
+
You are the Scribe. Read .squad/agents/scribe/charter.md.
|
|
35
|
+
TEAM ROOT: {team_root}
|
|
36
|
+
CURRENT_DATETIME: <resolved CURRENT_DATETIME literal>
|
|
37
|
+
STATE_BACKEND: {state_backend}
|
|
38
|
+
|
|
39
|
+
SPAWN MANIFEST: {spawn_manifest}
|
|
40
|
+
|
|
41
|
+
Tasks (in order):
|
|
42
|
+
0. PRE-CHECK: Run `squad_state_health` when available. If state tools are unavailable,
|
|
43
|
+
stop without mutating files or git state.
|
|
44
|
+
0b. PRE-CHECK: Read `decisions.md` and list `decisions/inbox` with state tools.
|
|
45
|
+
Record measurements.
|
|
46
|
+
1. DECISIONS ARCHIVE [HARD GATE]: If decisions.md >= 20480 bytes, archive entries older than 30 days NOW. If >= 51200 bytes, archive entries older than 7 days. Do not skip this step.
|
|
47
|
+
2. DECISION INBOX: Use `squad_state_list` and `squad_state_read` on `decisions/inbox`,
|
|
48
|
+
merge entries into `decisions.md` with `squad_state_write`, delete processed inbox
|
|
49
|
+
entries with `squad_state_delete`, and deduplicate.
|
|
50
|
+
3. ORCHESTRATION LOG: Write `orchestration-log/{timestamp}-{agent}.md` with `squad_state_write` per agent. Use ISO 8601 UTC timestamp. Replace `:` with `-` in `{timestamp}` so filenames are valid on all platforms (e.g. `2026-06-02T21-15-30Z`).
|
|
51
|
+
4. SESSION LOG: Write `log/{timestamp}-{topic}.md` with `squad_state_write`. Brief. Use ISO 8601 UTC timestamp. Replace `:` with `-` in `{timestamp}` so filenames are valid on all platforms.
|
|
52
|
+
5. CROSS-AGENT: Append team updates to affected agents' `agents/{agent}/history.md` with `squad_state_append`.
|
|
53
|
+
6. HISTORY SUMMARIZATION [HARD GATE]: If any history.md >= 15360 bytes (15KB), summarize now.
|
|
54
|
+
7. HEALTH REPORT: Log decisions.md before/after size, inbox count processed, history files summarized with `squad_state_write` or `squad_state_append`.
|
|
55
|
+
|
|
56
|
+
Runtime state tools own persistence. Never switch branches, push note refs, reset
|
|
57
|
+
`.squad/`, or commit mutable squad state from this prompt.
|
|
58
|
+
|
|
59
|
+
Never speak to user. ⚠️ End with plain text summary after all tool calls.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. **Immediately assess:** Does anything trigger follow-up work? Launch it NOW.
|
|
63
|
+
|
|
64
|
+
6. **Ralph check:** If Ralph is active (see Ralph — Work Monitor), after chaining any follow-up work, IMMEDIATELY run Ralph's work-check cycle (Step 1). Do NOT stop. Do NOT wait for user input. Ralph keeps the pipeline moving until the board is clear.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Ceremony Reference
|
|
2
|
+
|
|
3
|
+
On-demand reference for ceremony configuration, facilitator spawn, and execution rules.
|
|
4
|
+
|
|
5
|
+
## Config Format
|
|
6
|
+
|
|
7
|
+
Ceremonies are declared in `.squad/ceremonies.md`. Each ceremony is a section with a table of fields:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
## {CeremonyName}
|
|
11
|
+
|
|
12
|
+
| Field | Value |
|
|
13
|
+
|-------|-------|
|
|
14
|
+
| **Trigger** | auto \| manual |
|
|
15
|
+
| **When** | before \| after |
|
|
16
|
+
| **Condition** | {when auto-triggered: natural language condition} |
|
|
17
|
+
| **Facilitator** | lead \| {specific-agent} |
|
|
18
|
+
| **Participants** | all-relevant \| all-involved \| {comma-separated names} |
|
|
19
|
+
| **Time budget** | focused \| extended |
|
|
20
|
+
| **Enabled** | ✅ yes \| ❌ no |
|
|
21
|
+
|
|
22
|
+
**Agenda:**
|
|
23
|
+
1. {Step 1}
|
|
24
|
+
2. {Step 2}
|
|
25
|
+
...
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Field Definitions
|
|
29
|
+
|
|
30
|
+
| Field | Values | Meaning |
|
|
31
|
+
|-------|--------|---------|
|
|
32
|
+
| Trigger | `auto` | Fires automatically when Condition matches |
|
|
33
|
+
| Trigger | `manual` | Only when user says "run {ceremony}" |
|
|
34
|
+
| When | `before` | Runs before work batch spawns |
|
|
35
|
+
| When | `after` | Runs after work batch completes |
|
|
36
|
+
| Condition | free text | Evaluated against current task context |
|
|
37
|
+
| Facilitator | agent name | Who runs the meeting |
|
|
38
|
+
| Participants | selector | Who attends |
|
|
39
|
+
| Time budget | `focused` | Keep it short — key decisions only |
|
|
40
|
+
| Time budget | `extended` | Thorough discussion — all angles |
|
|
41
|
+
| Enabled | boolean | Skip disabled ceremonies entirely |
|
|
42
|
+
|
|
43
|
+
## Facilitator Spawn Template
|
|
44
|
+
|
|
45
|
+
When a ceremony triggers, spawn the facilitator (sync) with this prompt structure:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
You are {FacilitatorName}, facilitating the "{CeremonyName}" ceremony.
|
|
49
|
+
|
|
50
|
+
PARTICIPANTS: {participant list}
|
|
51
|
+
TRIGGER CONDITION: {what triggered this ceremony}
|
|
52
|
+
AGENDA:
|
|
53
|
+
{numbered agenda items from config}
|
|
54
|
+
|
|
55
|
+
RULES:
|
|
56
|
+
- Follow the agenda in order.
|
|
57
|
+
- For each agenda item, spawn relevant participants as sub-tasks to gather their input.
|
|
58
|
+
- Synthesize participant input into clear decisions and action items.
|
|
59
|
+
- Keep to the time budget: {focused|extended}.
|
|
60
|
+
- Output a structured summary at the end.
|
|
61
|
+
|
|
62
|
+
TASK CONTEXT:
|
|
63
|
+
{description of the work that triggered this ceremony}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Execution Rules
|
|
67
|
+
|
|
68
|
+
1. **Before ceremonies** fire AFTER routing decisions but BEFORE agent spawn. The ceremony summary is included in all subsequent work-batch spawn prompts.
|
|
69
|
+
2. **After ceremonies** fire when ALL agents in the batch have completed (success or failure).
|
|
70
|
+
3. **Manual ceremonies** fire only on explicit user request ("run retro", "do a design review").
|
|
71
|
+
4. **Cooldown:** After a ceremony completes, skip auto-trigger checks for the immediately following step. This prevents ceremony loops.
|
|
72
|
+
5. **Participant resolution:**
|
|
73
|
+
- `all-relevant` → agents routed to the current task
|
|
74
|
+
- `all-involved` → agents that participated in the completed batch
|
|
75
|
+
- Named agents → spawn only those specific agents
|
|
76
|
+
6. **Scribe integration:** Spawn Scribe (background) at ceremony start to record decisions and action items.
|
|
77
|
+
7. **Output format:**
|
|
78
|
+
```
|
|
79
|
+
📋 {CeremonyName} completed — facilitated by {Facilitator}.
|
|
80
|
+
Decisions: {count} | Action items: {count}.
|
|
81
|
+
```
|
|
82
|
+
8. **Failure handling:** If the facilitator fails or times out, log a warning and proceed with work. Ceremonies must never block the pipeline indefinitely.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Client Compatibility Reference
|
|
2
|
+
|
|
3
|
+
### Client Compatibility
|
|
4
|
+
|
|
5
|
+
Squad runs on multiple Copilot surfaces. The coordinator MUST detect its platform and adapt spawning behavior accordingly. See `docs/scenarios/client-compatibility.md` for the full compatibility matrix.
|
|
6
|
+
|
|
7
|
+
#### Platform Detection
|
|
8
|
+
|
|
9
|
+
Before spawning agents, determine the platform by checking available tools:
|
|
10
|
+
|
|
11
|
+
1. **CLI mode** — `task` tool is available → full spawning control. Use `task` with `agent_type`, `mode`, `model`, `description`, `prompt` parameters. Collect results via `read_agent`.
|
|
12
|
+
|
|
13
|
+
2. **VS Code mode** — `runSubagent` or `agent` tool is available → conditional behavior. Use `runSubagent` with the task prompt. Drop `agent_type`, `mode`, and `model` parameters. Multiple subagents in one turn run concurrently (equivalent to background mode). Results return automatically — no `read_agent` needed.
|
|
14
|
+
|
|
15
|
+
3. **Fallback mode** — neither `task` nor `runSubagent`/`agent` available → work inline. Do not apologize or explain the limitation. Execute the task directly.
|
|
16
|
+
|
|
17
|
+
If both `task` and `runSubagent` are available, prefer `task` (richer parameter surface).
|
|
18
|
+
|
|
19
|
+
#### VS Code Spawn Adaptations
|
|
20
|
+
|
|
21
|
+
When in VS Code mode, the coordinator changes behavior in these ways:
|
|
22
|
+
|
|
23
|
+
- **Spawning tool:** Use `runSubagent` instead of `task`. The prompt is the only required parameter — pass the full agent prompt (charter, identity, task, hygiene, response order) exactly as you would on CLI.
|
|
24
|
+
- **Parallelism:** Spawn ALL concurrent agents in a SINGLE turn. They run in parallel automatically. This replaces `mode: "background"` + `read_agent` polling.
|
|
25
|
+
- **Model selection:** Accept the session model. Do NOT attempt per-spawn model selection or fallback chains — they only work on CLI. In Phase 1, all subagents use whatever model the user selected in VS Code's model picker.
|
|
26
|
+
- **Scribe:** Cannot fire-and-forget. Batch Scribe as the LAST subagent in any parallel group. Scribe is light work (file ops only), so the blocking is tolerable.
|
|
27
|
+
- **Launch table:** Skip it. Results arrive with the response, not separately. By the time the coordinator speaks, the work is already done.
|
|
28
|
+
- **`read_agent`:** Skip entirely. Results return automatically when subagents complete.
|
|
29
|
+
- **`agent_type`:** Drop it. All VS Code subagents have full tool access by default. Subagents inherit the parent's tools.
|
|
30
|
+
- **`description`:** Drop it. The agent name is already in the prompt.
|
|
31
|
+
- **Prompt content:** Keep ALL prompt structure — charter, identity, task, hygiene, response order blocks are surface-independent.
|
|
32
|
+
|
|
33
|
+
#### Feature Degradation Table
|
|
34
|
+
|
|
35
|
+
| Feature | CLI | VS Code | Degradation |
|
|
36
|
+
|---------|-----|---------|-------------|
|
|
37
|
+
| Parallel fan-out | `mode: "background"` + `read_agent` | Multiple subagents in one turn | None — equivalent concurrency |
|
|
38
|
+
| Model selection | Per-spawn `model` param (4-layer hierarchy) | Session model only (Phase 1) | Accept session model, log intent |
|
|
39
|
+
| Scribe fire-and-forget | Background, never read | Sync, must wait | Batch with last parallel group |
|
|
40
|
+
| Launch table UX | Show table → results later | Skip table → results with response | UX only — results are correct |
|
|
41
|
+
| SQL tool | Available | Not available | Avoid SQL in cross-platform code paths |
|
|
42
|
+
| Response order bug | Critical workaround | Possibly necessary (unverified) | Keep the block — harmless if unnecessary |
|
|
43
|
+
|
|
44
|
+
#### SQL Tool Caveat
|
|
45
|
+
|
|
46
|
+
The `sql` tool is **CLI-only**. It does not exist on VS Code, JetBrains, or GitHub.com. Any coordinator logic or agent workflow that depends on SQL (todo tracking, batch processing, session state) will silently fail on non-CLI surfaces. Cross-platform code paths must not depend on SQL. Use filesystem-based state (`.squad/` files) for anything that must work everywhere.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Copilot Coding Agent Member
|
|
2
|
+
|
|
3
|
+
On-demand reference for adding the GitHub Copilot coding agent (@copilot) to the Squad roster.
|
|
4
|
+
|
|
5
|
+
## Adding @copilot
|
|
6
|
+
|
|
7
|
+
When the user says "add copilot", "add the coding agent", or "use @copilot for issues":
|
|
8
|
+
|
|
9
|
+
1. **Add to team.md roster:**
|
|
10
|
+
```markdown
|
|
11
|
+
| @copilot | Coding Agent | — | 🤖 Coding Agent |
|
|
12
|
+
```
|
|
13
|
+
2. **Add capability profile** (below the roster table):
|
|
14
|
+
```markdown
|
|
15
|
+
<!-- copilot-auto-assign: true -->
|
|
16
|
+
### @copilot — Capability Profile
|
|
17
|
+
|
|
18
|
+
| Capability | Level | Notes |
|
|
19
|
+
|-----------|-------|-------|
|
|
20
|
+
| Bug fixes (well-scoped) | 🟢 | Best for isolated, test-covered fixes |
|
|
21
|
+
| Feature implementation | 🟡 | Works well with clear specs; may need review |
|
|
22
|
+
| Refactoring | 🟡 | Handles mechanical refactors; verify scope |
|
|
23
|
+
| Architecture decisions | 🔴 | Cannot make cross-cutting design choices |
|
|
24
|
+
| Multi-repo coordination | 🔴 | Limited to single-repo context |
|
|
25
|
+
| Test writing | 🟢 | Strong at adding tests for existing code |
|
|
26
|
+
| Documentation | 🟢 | Generates docs from code effectively |
|
|
27
|
+
```
|
|
28
|
+
3. **Add routing entries** to routing.md for appropriate work types.
|
|
29
|
+
4. **Do not create** `charter.md` — @copilot uses `copilot-instructions.md` instead.
|
|
30
|
+
|
|
31
|
+
## Comparison: Spawned Agent vs. @copilot
|
|
32
|
+
|
|
33
|
+
| | Spawned Agent | @copilot |
|
|
34
|
+
|---|--------------|----------|
|
|
35
|
+
| Execution model | Sync sub-task within session | Async — picks up assigned issues |
|
|
36
|
+
| Branch convention | `squad/{issue}-{slug}` | `copilot/{slug}` |
|
|
37
|
+
| Trigger | Coordinator spawns directly | Issue assignment |
|
|
38
|
+
| Charter source | `.squad/agents/{name}/charter.md` | `.github/copilot-instructions.md` |
|
|
39
|
+
| Context window | Inherits full session context | Fresh context per issue |
|
|
40
|
+
| Reviewer gating | ✅ Enforced by coordinator | ✅ Via PR review process |
|
|
41
|
+
| Speed | Immediate (in-session) | Minutes (async queue) |
|
|
42
|
+
|
|
43
|
+
## Roster Format
|
|
44
|
+
|
|
45
|
+
In `team.md`, @copilot always appears as:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
| @copilot | Coding Agent | — | 🤖 Coding Agent |
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- **No casting** — always "@copilot" (literal handle).
|
|
52
|
+
- **No charter file** — configuration lives in `.github/copilot-instructions.md`.
|
|
53
|
+
- **No history file** — work is tracked via PRs and issue comments.
|
|
54
|
+
|
|
55
|
+
## Auto-Assign Behavior
|
|
56
|
+
|
|
57
|
+
Controlled by the HTML comment in team.md:
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
<!-- copilot-auto-assign: true -->
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
| Setting | Behavior |
|
|
64
|
+
|---------|----------|
|
|
65
|
+
| `true` | Lead assigns routed issues to @copilot automatically via `gh issue edit --add-assignee @copilot` |
|
|
66
|
+
| `false` | Lead presents recommendation; user confirms before assignment |
|
|
67
|
+
|
|
68
|
+
## Lead Triage Integration
|
|
69
|
+
|
|
70
|
+
During triage, Lead evaluates each issue against @copilot's capability profile:
|
|
71
|
+
|
|
72
|
+
1. **🟢 Match** — Auto-assign (if enabled) or recommend assignment.
|
|
73
|
+
2. **🟡 Match** — Assign with note: "⚠️ May need review — @copilot is 🟡 for this type of work."
|
|
74
|
+
3. **🔴 Match** — Skip @copilot; route to appropriate spawned agent or human.
|
|
75
|
+
|
|
76
|
+
## Routing Details
|
|
77
|
+
|
|
78
|
+
Add to `routing.md`:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
| bug fixes (isolated, test-covered) | @copilot 🤖 | Single-file fixes, test additions |
|
|
82
|
+
| documentation updates | @copilot 🤖 | README, API docs, inline comments |
|
|
83
|
+
| test coverage gaps | @copilot 🤖 | Adding missing test cases |
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Work that routes to @copilot:
|
|
87
|
+
- Creates/assigns the GitHub issue (if not already)
|
|
88
|
+
- Does NOT spawn a sub-agent — @copilot works asynchronously
|
|
89
|
+
- Coordinator reports: "🤖 Assigned #{number} to @copilot — will open a PR when ready."
|
|
90
|
+
- Non-dependent work continues immediately — @copilot routing does not serialize the team.
|
|
91
|
+
|
|
92
|
+
## Monitoring @copilot Work
|
|
93
|
+
|
|
94
|
+
On each watch cycle (or when user asks "status"):
|
|
95
|
+
- Check for open PRs from `copilot/*` branches.
|
|
96
|
+
- Report: "🤖 @copilot: {N} PRs open ({list}). {M} issues assigned, pending."
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
You are working on a project that uses **Squad**, an AI team framework. When picking up issues autonomously, follow these guidelines.
|
|
4
4
|
|
|
5
|
+
## Coordinator Canary Check
|
|
6
|
+
|
|
7
|
+
**IMPORTANT — run this check on EVERY session start, before doing any work:**
|
|
8
|
+
|
|
9
|
+
Look for the exact token `SQUAD_COORDINATOR_CANARY_a8f3` in your `agent_instructions`. This token is placed at the end of `squad.agent.md`. If it is missing, the coordinator file is missing or truncated.
|
|
10
|
+
|
|
11
|
+
**When the token is missing, you MUST:**
|
|
12
|
+
1. **STOP** — do not proceed with standard Squad behavior.
|
|
13
|
+
2. **WARN the user** with this exact message:
|
|
14
|
+
```
|
|
15
|
+
⚠️ Squad coordinator (squad.agent.md) appears to be missing or truncated. The canary token was not found. Do NOT proceed with standard Squad behavior — Squad's safety rails are not loaded. Please restart your session.
|
|
16
|
+
```
|
|
17
|
+
3. Do not continue with normal Squad routing, spawning, PR, or branch-protection behavior after emitting the warning.
|
|
18
|
+
|
|
5
19
|
## Team Context
|
|
6
20
|
|
|
7
21
|
Before starting work on any issue:
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Model Selection Reference
|
|
2
|
+
|
|
3
|
+
### Per-Agent Model Selection
|
|
4
|
+
|
|
5
|
+
Before spawning an agent, determine which model to use. Check these layers in order — first match wins:
|
|
6
|
+
|
|
7
|
+
**Layer 0 — Persistent Config (`.squad/config.json`):** On session start, read `.squad/config.json`. If `agentModelOverrides.{agentName}` exists, use that model for this specific agent. Otherwise, if `defaultModel` exists, use it for ALL agents. This layer survives across sessions — the user set it once and it sticks.
|
|
8
|
+
|
|
9
|
+
- **When user says "always use X" / "use X for everything" / "default to X":** Write `defaultModel` to `.squad/config.json`. Acknowledge: `✅ Model preference saved: {model} — all future sessions will use this until changed.`
|
|
10
|
+
- **When user says "use X for {agent}":** Write to `agentModelOverrides.{agent}` in `.squad/config.json`. Acknowledge: `✅ {Agent} will always use {model} — saved to config.`
|
|
11
|
+
- **When user says "switch back to automatic" / "clear model preference":** Remove `defaultModel` (and optionally `agentModelOverrides`) from `.squad/config.json`. Acknowledge: `✅ Model preference cleared — returning to automatic selection.`
|
|
12
|
+
|
|
13
|
+
**Layer 1 — Session Directive:** Did the user specify a model for this session? ("use opus for this session", "save costs"). If yes, use that model. Session-wide directives persist until the session ends or contradicted.
|
|
14
|
+
|
|
15
|
+
**Layer 2 — Charter Preference:** Does the agent's charter have a `## Model` section with `Preferred` set to a specific model (not `auto`)? If yes, use that model.
|
|
16
|
+
|
|
17
|
+
**Layer 3 — Task-Aware Auto-Selection:** Use the governing principle: **cost first, unless code is being written.** Match the agent's task to determine output type, then select accordingly:
|
|
18
|
+
|
|
19
|
+
| Task Output | Model | Tier | Rule |
|
|
20
|
+
|-------------|-------|------|------|
|
|
21
|
+
| Writing code (implementation, refactoring, test code, bug fixes) | `claude-sonnet-4.6` | Standard | Quality and accuracy matter for code. Use standard tier. |
|
|
22
|
+
| Writing prompts or agent designs (structured text that functions like code) | `claude-sonnet-4.6` | Standard | Prompts are executable — treat like code. |
|
|
23
|
+
| NOT writing code (docs, planning, triage, logs, changelogs, mechanical ops) | `claude-haiku-4.5` | Fast | Cost first. Haiku handles non-code tasks. |
|
|
24
|
+
| Visual/design work requiring image analysis | `claude-opus-4.5` | Premium | Vision capability required. Overrides cost rule. |
|
|
25
|
+
|
|
26
|
+
**Role-to-model mapping** (applying cost-first principle):
|
|
27
|
+
|
|
28
|
+
| Role | Default Model | Why | Override When |
|
|
29
|
+
|------|--------------|-----|---------------|
|
|
30
|
+
| Core Dev / Backend / Frontend | `claude-sonnet-4.6` | Writes code — quality first | Heavy code gen → `gpt-5.3-codex` |
|
|
31
|
+
| Tester / QA | `claude-sonnet-4.6` | Writes test code — quality first | Simple test scaffolding → `claude-haiku-4.5` |
|
|
32
|
+
| Lead / Architect | auto (per-task) | Mixed: code review needs quality, planning needs cost | Architecture proposals → premium; triage/planning → haiku |
|
|
33
|
+
| Prompt Engineer | auto (per-task) | Mixed: prompt design is like code, research is not | Prompt architecture → sonnet; research/analysis → haiku |
|
|
34
|
+
| Copilot SDK Expert | `claude-sonnet-4.6` | Technical analysis that often touches code | Pure research → `claude-haiku-4.5` |
|
|
35
|
+
| Designer / Visual | `claude-opus-4.5` | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
|
|
36
|
+
| DevRel / Writer | `claude-haiku-4.5` | Docs and writing — not code | — |
|
|
37
|
+
| Scribe / Logger | `claude-haiku-4.5` | Mechanical file ops — cheapest possible | — (never bump Scribe) |
|
|
38
|
+
| Git / Release | `claude-haiku-4.5` | Mechanical ops — changelogs, tags, version bumps | — (never bump mechanical ops) |
|
|
39
|
+
|
|
40
|
+
**Task complexity adjustments** (apply at most ONE — no cascading):
|
|
41
|
+
- **Bump UP to premium:** architecture proposals, reviewer gates, security audits, multi-agent coordination (output feeds 3+ agents)
|
|
42
|
+
- **Bump DOWN to fast/cheap:** typo fixes, renames, boilerplate, scaffolding, changelogs, version bumps
|
|
43
|
+
- **Switch to code specialist (`gpt-5.3-codex`):** large multi-file refactors, complex implementation from spec, heavy code generation (500+ lines)
|
|
44
|
+
- **Switch to analytical diversity (`gemini-3-pro-preview`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection
|
|
45
|
+
|
|
46
|
+
**Layer 4 — Default:** If nothing else matched, use `claude-haiku-4.5`. Cost wins when in doubt, unless code is being produced.
|
|
47
|
+
|
|
48
|
+
**Fallback chains — when a model is unavailable:**
|
|
49
|
+
|
|
50
|
+
If a spawn fails because the selected model is unavailable (plan restriction, org policy, rate limit, deprecation, or any other reason), silently retry with the next model in the chain. Do NOT tell the user about fallback attempts. Maximum 3 retries before jumping to the nuclear fallback.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Premium: claude-opus-4.6 → claude-opus-4.5 → claude-sonnet-4.6 → claude-sonnet-4.5 → (omit model param)
|
|
54
|
+
Standard: claude-sonnet-4.6 → claude-sonnet-4.5 → gpt-5.4 → gpt-5.3-codex → claude-sonnet-4 → (omit model param)
|
|
55
|
+
Fast: claude-haiku-4.5 → gpt-5.4-mini → gpt-5.1-codex-mini → gpt-4.1 → (omit model param)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`(omit model param)` = call the `task` tool WITHOUT the `model` parameter. The platform uses its built-in default. This is the nuclear fallback — it always works.
|
|
59
|
+
|
|
60
|
+
**Fallback rules:**
|
|
61
|
+
- If the user specified a provider ("use Claude"), fall back within that provider only before hitting nuclear
|
|
62
|
+
- Never fall back UP in tier — a fast/cheap task should not land on a premium model
|
|
63
|
+
- Log fallbacks to the orchestration log for debugging, but never surface to the user unless asked
|
|
64
|
+
|
|
65
|
+
**Passing the model to spawns:**
|
|
66
|
+
|
|
67
|
+
Pass the resolved model as the `model` parameter on every `task` tool call:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
agent_type: "general-purpose"
|
|
71
|
+
model: "{resolved_model}"
|
|
72
|
+
mode: "background"
|
|
73
|
+
name: "{name}"
|
|
74
|
+
description: "{emoji} {Name}: {brief task summary}"
|
|
75
|
+
prompt: |
|
|
76
|
+
...
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Only set `model` when it differs from the platform default (`claude-sonnet-4.6`). If the resolved model IS `claude-sonnet-4.6`, you MAY omit the `model` parameter — the platform uses it as default.
|
|
80
|
+
|
|
81
|
+
If you've exhausted the fallback chain and reached nuclear fallback, omit the `model` parameter entirely.
|
|
82
|
+
|
|
83
|
+
**Spawn output format — show the model choice:**
|
|
84
|
+
|
|
85
|
+
When spawning, include the model in your acknowledgment:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
🔧 Fenster (claude-sonnet-4.6) — refactoring auth module
|
|
89
|
+
🎨 Redfoot (claude-opus-4.5 · vision) — designing color system
|
|
90
|
+
📋 Scribe (claude-haiku-4.5 · fast) — logging session
|
|
91
|
+
⚡ Keaton (claude-opus-4.6 · bumped for architecture) — reviewing proposal
|
|
92
|
+
📝 McManus (claude-haiku-4.5 · fast) — updating docs
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Include tier annotation only when the model was bumped or a specialist was chosen. Default-tier spawns just show the model name.
|
|
96
|
+
|
|
97
|
+
**Valid models (current platform catalog):**
|
|
98
|
+
|
|
99
|
+
Premium: `claude-opus-4.6`, `claude-opus-4.6-1m` (Internal only), `claude-opus-4.5`
|
|
100
|
+
Standard: `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-4`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.2-codex`, `gpt-5.2`, `gpt-5.1-codex-max`, `gpt-5.1-codex`, `gpt-5.1`, `gemini-3-pro-preview`
|
|
101
|
+
Fast/Cheap: `claude-haiku-4.5`, `gpt-5.4-mini`, `gpt-5.1-codex-mini`, `gpt-5-mini`, `gpt-4.1`
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# PRD Intake
|
|
2
|
+
|
|
3
|
+
On-demand reference for ingesting a PRD, decomposing it into work items, and managing updates.
|
|
4
|
+
|
|
5
|
+
## Triggers
|
|
6
|
+
|
|
7
|
+
| User says | Action |
|
|
8
|
+
|-----------|--------|
|
|
9
|
+
| "here's the PRD" / "work from this spec" | Expect file path or pasted content |
|
|
10
|
+
| "read the PRD at {path}" | Read the file at that path |
|
|
11
|
+
| "the PRD changed" / "updated the spec" | Re-read and diff against previous decomposition |
|
|
12
|
+
| (pastes requirements text) | Treat as inline PRD |
|
|
13
|
+
|
|
14
|
+
## Intake Flow
|
|
15
|
+
|
|
16
|
+
1. **Detect source:** File path, pasted text, or URL. Store a reference in `.squad/team.md` under `## PRD Source`.
|
|
17
|
+
2. **Store PRD reference:**
|
|
18
|
+
```markdown
|
|
19
|
+
## PRD Source
|
|
20
|
+
|
|
21
|
+
**Path:** {path-or-inline}
|
|
22
|
+
**Ingested:** {ISO date}
|
|
23
|
+
**Hash:** {sha256 of content, for change detection}
|
|
24
|
+
```
|
|
25
|
+
3. **Spawn Lead (sync, premium bump)** with decomposition prompt (see below).
|
|
26
|
+
4. **Present work items** to user for approval in table format.
|
|
27
|
+
5. **On approval:** Route items to agents respecting dependency order.
|
|
28
|
+
|
|
29
|
+
## Lead Decomposition Spawn Template
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
You are the Lead, decomposing a PRD into actionable work items.
|
|
33
|
+
|
|
34
|
+
PRD CONTENT:
|
|
35
|
+
{full PRD text}
|
|
36
|
+
|
|
37
|
+
TEAM ROSTER:
|
|
38
|
+
{roster from team.md}
|
|
39
|
+
|
|
40
|
+
TASK: Break this PRD into discrete, implementable work items. For each item provide:
|
|
41
|
+
- Title (imperative mood, concise)
|
|
42
|
+
- Description (acceptance criteria, technical notes)
|
|
43
|
+
- Estimated complexity: S / M / L
|
|
44
|
+
- Dependencies (list other item titles this blocks on)
|
|
45
|
+
- Suggested assignee (agent name from roster, based on expertise match)
|
|
46
|
+
|
|
47
|
+
OUTPUT FORMAT:
|
|
48
|
+
Return a markdown table:
|
|
49
|
+
|
|
50
|
+
| # | Title | Complexity | Dependencies | Assignee | Status |
|
|
51
|
+
|---|-------|-----------|--------------|----------|--------|
|
|
52
|
+
| 1 | {title} | {S/M/L} | — | {agent} | pending |
|
|
53
|
+
|
|
54
|
+
RULES:
|
|
55
|
+
- Items must be independently implementable (no item requires partial completion of another).
|
|
56
|
+
- Maximum 1 day of work per item (split larger items).
|
|
57
|
+
- Respect team expertise — don't assign frontend work to a backend specialist.
|
|
58
|
+
- Order by dependency graph (items with no deps first).
|
|
59
|
+
- Flag any ambiguities or missing information as "⚠️ Needs clarification: {question}".
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Work Item Presentation Format
|
|
63
|
+
|
|
64
|
+
Present to user as:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
📋 PRD decomposed into {N} work items:
|
|
68
|
+
|
|
69
|
+
| # | Title | Size | Depends on | Assignee |
|
|
70
|
+
|---|-------|------|-----------|----------|
|
|
71
|
+
| 1 | ... | S | — | {Agent} |
|
|
72
|
+
| 2 | ... | M | #1 | {Agent} |
|
|
73
|
+
|
|
74
|
+
Ready to proceed? I'll route items respecting the dependency order.
|
|
75
|
+
⚠️ Clarifications needed: {list any flagged items}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Mid-Project Updates
|
|
79
|
+
|
|
80
|
+
When the user says the PRD changed:
|
|
81
|
+
|
|
82
|
+
1. Re-read the PRD content.
|
|
83
|
+
2. Compute diff against stored hash.
|
|
84
|
+
3. Spawn Lead (sync) with a delta-decomposition prompt:
|
|
85
|
+
- Show only NEW or CHANGED sections.
|
|
86
|
+
- Ask Lead to identify: new items, modified items, obsoleted items.
|
|
87
|
+
4. Present changes to user:
|
|
88
|
+
```
|
|
89
|
+
📋 PRD update detected:
|
|
90
|
+
- New items: {count}
|
|
91
|
+
- Modified: {count}
|
|
92
|
+
- Obsoleted: {count} (will be cancelled if approved)
|
|
93
|
+
|
|
94
|
+
{table of changes}
|
|
95
|
+
|
|
96
|
+
Approve these updates?
|
|
97
|
+
```
|
|
98
|
+
5. On approval: Cancel obsoleted work (if not yet started), update items, re-route.
|
|
99
|
+
|
|
100
|
+
## State Tracking
|
|
101
|
+
|
|
102
|
+
Active PRD state lives in team.md:
|
|
103
|
+
- `## PRD Source` section (path, date, hash)
|
|
104
|
+
- Work items tracked as issues (GitHub) or in `.squad/backlog.md` (offline mode)
|
|
105
|
+
- Completion percentage displayed in status checks
|