@bradygaster/squad-cli 0.9.6-insider.2 → 0.10.0-insider.1

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.
Files changed (188) hide show
  1. package/CHANGELOG.md +555 -0
  2. package/README.md +5 -5
  3. package/dist/cli/commands/build.js +3 -3
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/copilot-bridge.d.ts.map +1 -1
  6. package/dist/cli/commands/copilot-bridge.js +5 -1
  7. package/dist/cli/commands/copilot-bridge.js.map +1 -1
  8. package/dist/cli/commands/cross-squad.d.ts +15 -2
  9. package/dist/cli/commands/cross-squad.d.ts.map +1 -1
  10. package/dist/cli/commands/cross-squad.js +78 -4
  11. package/dist/cli/commands/cross-squad.js.map +1 -1
  12. package/dist/cli/commands/doctor.d.ts +6 -0
  13. package/dist/cli/commands/doctor.d.ts.map +1 -1
  14. package/dist/cli/commands/doctor.js +120 -5
  15. package/dist/cli/commands/doctor.js.map +1 -1
  16. package/dist/cli/commands/export.d.ts +7 -3
  17. package/dist/cli/commands/export.d.ts.map +1 -1
  18. package/dist/cli/commands/export.js +68 -16
  19. package/dist/cli/commands/export.js.map +1 -1
  20. package/dist/cli/commands/import.d.ts +7 -3
  21. package/dist/cli/commands/import.d.ts.map +1 -1
  22. package/dist/cli/commands/import.js +140 -42
  23. package/dist/cli/commands/import.js.map +1 -1
  24. package/dist/cli/commands/install-hooks.d.ts.map +1 -1
  25. package/dist/cli/commands/install-hooks.js +50 -5
  26. package/dist/cli/commands/install-hooks.js.map +1 -1
  27. package/dist/cli/commands/link.d.ts.map +1 -1
  28. package/dist/cli/commands/link.js +7 -1
  29. package/dist/cli/commands/link.js.map +1 -1
  30. package/dist/cli/commands/loop.d.ts.map +1 -1
  31. package/dist/cli/commands/loop.js +7 -5
  32. package/dist/cli/commands/loop.js.map +1 -1
  33. package/dist/cli/commands/memory.d.ts +2 -0
  34. package/dist/cli/commands/memory.d.ts.map +1 -0
  35. package/dist/cli/commands/memory.js +304 -0
  36. package/dist/cli/commands/memory.js.map +1 -0
  37. package/dist/cli/commands/migrate-backend.d.ts +36 -5
  38. package/dist/cli/commands/migrate-backend.d.ts.map +1 -1
  39. package/dist/cli/commands/migrate-backend.js +250 -40
  40. package/dist/cli/commands/migrate-backend.js.map +1 -1
  41. package/dist/cli/commands/notes.d.ts +27 -0
  42. package/dist/cli/commands/notes.d.ts.map +1 -0
  43. package/dist/cli/commands/notes.js +222 -0
  44. package/dist/cli/commands/notes.js.map +1 -0
  45. package/dist/cli/commands/plugin.d.ts.map +1 -1
  46. package/dist/cli/commands/plugin.js +423 -8
  47. package/dist/cli/commands/plugin.js.map +1 -1
  48. package/dist/cli/commands/skill.d.ts +31 -0
  49. package/dist/cli/commands/skill.d.ts.map +1 -0
  50. package/dist/cli/commands/skill.js +498 -0
  51. package/dist/cli/commands/skill.js.map +1 -0
  52. package/dist/cli/commands/start.d.ts.map +1 -1
  53. package/dist/cli/commands/start.js +9 -1
  54. package/dist/cli/commands/start.js.map +1 -1
  55. package/dist/cli/commands/state-mcp.d.ts +25 -0
  56. package/dist/cli/commands/state-mcp.d.ts.map +1 -0
  57. package/dist/cli/commands/state-mcp.js +174 -0
  58. package/dist/cli/commands/state-mcp.js.map +1 -0
  59. package/dist/cli/commands/watch/agent-spawn.d.ts +62 -0
  60. package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -0
  61. package/dist/cli/commands/watch/agent-spawn.js +127 -0
  62. package/dist/cli/commands/watch/agent-spawn.js.map +1 -0
  63. package/dist/cli/commands/watch/capabilities/board.d.ts.map +1 -1
  64. package/dist/cli/commands/watch/capabilities/board.js +2 -1
  65. package/dist/cli/commands/watch/capabilities/board.js.map +1 -1
  66. package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -1
  67. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +3 -2
  68. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
  69. package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
  70. package/dist/cli/commands/watch/capabilities/execute.js +14 -2
  71. package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
  72. package/dist/cli/commands/watch/capabilities/index.d.ts.map +1 -1
  73. package/dist/cli/commands/watch/capabilities/index.js +2 -0
  74. package/dist/cli/commands/watch/capabilities/index.js.map +1 -1
  75. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts +1 -1
  76. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
  77. package/dist/cli/commands/watch/capabilities/monitor-email.js +21 -4
  78. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
  79. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts +1 -1
  80. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
  81. package/dist/cli/commands/watch/capabilities/monitor-teams.js +21 -5
  82. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
  83. package/dist/cli/commands/watch/capabilities/notes-promote.d.ts +11 -0
  84. package/dist/cli/commands/watch/capabilities/notes-promote.d.ts.map +1 -0
  85. package/dist/cli/commands/watch/capabilities/notes-promote.js +124 -0
  86. package/dist/cli/commands/watch/capabilities/notes-promote.js.map +1 -0
  87. package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -1
  88. package/dist/cli/commands/watch/capabilities/retro.js +3 -2
  89. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
  90. package/dist/cli/commands/watch/capabilities/wave-dispatch.d.ts.map +1 -1
  91. package/dist/cli/commands/watch/capabilities/wave-dispatch.js +2 -1
  92. package/dist/cli/commands/watch/capabilities/wave-dispatch.js.map +1 -1
  93. package/dist/cli/commands/watch/index.d.ts.map +1 -1
  94. package/dist/cli/commands/watch/index.js +16 -12
  95. package/dist/cli/commands/watch/index.js.map +1 -1
  96. package/dist/cli/core/cast.d.ts.map +1 -1
  97. package/dist/cli/core/cast.js +216 -1
  98. package/dist/cli/core/cast.js.map +1 -1
  99. package/dist/cli/core/command-help.d.ts +44 -0
  100. package/dist/cli/core/command-help.d.ts.map +1 -0
  101. package/dist/cli/core/command-help.js +401 -0
  102. package/dist/cli/core/command-help.js.map +1 -0
  103. package/dist/cli/core/copilot-invocation.d.ts +57 -0
  104. package/dist/cli/core/copilot-invocation.d.ts.map +1 -0
  105. package/dist/cli/core/copilot-invocation.js +84 -0
  106. package/dist/cli/core/copilot-invocation.js.map +1 -0
  107. package/dist/cli/core/effective-squad-dir.d.ts +33 -0
  108. package/dist/cli/core/effective-squad-dir.d.ts.map +1 -0
  109. package/dist/cli/core/effective-squad-dir.js +37 -0
  110. package/dist/cli/core/effective-squad-dir.js.map +1 -0
  111. package/dist/cli/core/init.d.ts +2 -0
  112. package/dist/cli/core/init.d.ts.map +1 -1
  113. package/dist/cli/core/init.js +130 -1
  114. package/dist/cli/core/init.js.map +1 -1
  115. package/dist/cli/core/mcp-root.d.ts +73 -0
  116. package/dist/cli/core/mcp-root.d.ts.map +1 -0
  117. package/dist/cli/core/mcp-root.js +195 -0
  118. package/dist/cli/core/mcp-root.js.map +1 -0
  119. package/dist/cli/core/mcp-spec.d.ts +48 -0
  120. package/dist/cli/core/mcp-spec.d.ts.map +1 -0
  121. package/dist/cli/core/mcp-spec.js +62 -0
  122. package/dist/cli/core/mcp-spec.js.map +1 -0
  123. package/dist/cli/core/npm-registry.d.ts +25 -0
  124. package/dist/cli/core/npm-registry.d.ts.map +1 -0
  125. package/dist/cli/core/npm-registry.js +65 -0
  126. package/dist/cli/core/npm-registry.js.map +1 -0
  127. package/dist/cli/core/templates.d.ts.map +1 -1
  128. package/dist/cli/core/templates.js +102 -24
  129. package/dist/cli/core/templates.js.map +1 -1
  130. package/dist/cli/core/upgrade.d.ts +29 -0
  131. package/dist/cli/core/upgrade.d.ts.map +1 -1
  132. package/dist/cli/core/upgrade.js +413 -15
  133. package/dist/cli/core/upgrade.js.map +1 -1
  134. package/dist/cli/index.d.ts +1 -0
  135. package/dist/cli/index.d.ts.map +1 -1
  136. package/dist/cli/index.js +1 -0
  137. package/dist/cli/index.js.map +1 -1
  138. package/dist/cli/shell/components/App.js +1 -1
  139. package/dist/cli/shell/components/App.js.map +1 -1
  140. package/dist/cli/shell/components/MessageStream.js +2 -2
  141. package/dist/cli/shell/components/MessageStream.js.map +1 -1
  142. package/dist/cli/shell/coordinator.d.ts.map +1 -1
  143. package/dist/cli/shell/coordinator.js +11 -5
  144. package/dist/cli/shell/coordinator.js.map +1 -1
  145. package/dist/cli/shell/index.d.ts.map +1 -1
  146. package/dist/cli/shell/index.js +14 -7
  147. package/dist/cli/shell/index.js.map +1 -1
  148. package/dist/cli/shell/lifecycle.d.ts.map +1 -1
  149. package/dist/cli/shell/lifecycle.js +12 -7
  150. package/dist/cli/shell/lifecycle.js.map +1 -1
  151. package/dist/cli/shell/session-store.d.ts +4 -4
  152. package/dist/cli/shell/session-store.d.ts.map +1 -1
  153. package/dist/cli/shell/session-store.js +11 -11
  154. package/dist/cli/shell/session-store.js.map +1 -1
  155. package/dist/cli-entry.js +171 -50
  156. package/dist/cli-entry.js.map +1 -1
  157. package/package.json +9 -4
  158. package/scripts/patch-esm-imports.mjs +3 -1
  159. package/templates/after-agent-reference.md +64 -0
  160. package/templates/ceremony-reference.md +82 -0
  161. package/templates/client-compatibility-reference.md +46 -0
  162. package/templates/copilot-agent.md +96 -0
  163. package/templates/copilot-instructions.md +14 -0
  164. package/templates/fact-checker-policy.md +104 -0
  165. package/templates/model-selection-reference.md +101 -0
  166. package/templates/prd-intake.md +105 -0
  167. package/templates/rai-charter.md +110 -0
  168. package/templates/rai-policy.md +103 -0
  169. package/templates/ralph-reference.md +141 -0
  170. package/templates/routing.md +1 -0
  171. package/templates/scribe-charter.md +18 -151
  172. package/templates/session-init-reference.md +199 -0
  173. package/templates/skills/cross-squad/SKILL.md +66 -6
  174. package/templates/skills/cross-squad-communication/SKILL.md +399 -0
  175. package/templates/skills/e2e-template-testing/SKILL.md +557 -0
  176. package/templates/skills/fact-checking/SKILL.md +61 -0
  177. package/templates/skills/release-process/SKILL.md +2 -2
  178. package/templates/skills/squad/SKILL.md +299 -0
  179. package/templates/skills/squad-help/SKILL.md +97 -0
  180. package/templates/skills/squad-version-check/SKILL.md +169 -0
  181. package/templates/skills/tiered-memory/SKILL.md +31 -44
  182. package/templates/spawn-reference.md +131 -0
  183. package/templates/squad.agent.md.template +306 -618
  184. package/templates/workflow-wiring-appendix-a-code-reviewer.md +131 -0
  185. package/templates/workflow-wiring-appendix-b-documenter.md +140 -0
  186. package/templates/workflow-wiring-guide.md +276 -0
  187. package/templates/workflows/squad-heartbeat.yml +167 -167
  188. package/templates/worktree-reference.md +126 -0
@@ -0,0 +1,199 @@
1
+ # Session Init Reference
2
+
3
+ Procedures the coordinator runs at session start, in order. Each step is
4
+ self-contained, fails silent, and degrades to "show normal greeting."
5
+
6
+ ---
7
+
8
+ ## Step 1: Update Check
9
+
10
+ Check whether a newer Squad version exists for the user's channel. Append to
11
+ the greeting if a newer version is found. Never block the session; every
12
+ failure path ends at "show normal greeting."
13
+
14
+ ### 1.1 Kill Switch
15
+
16
+ If the environment variable `SQUAD_NO_UPDATE_CHECK` is set to `1`, **skip
17
+ Step 1 entirely** and show the normal greeting. This is the same kill switch
18
+ as the upstream CLI banner — one opt-out disables both.
19
+
20
+ ### 1.2 Channel Detection
21
+
22
+ Read the stamped version from the `<!-- version: X -->` HTML comment at the
23
+ top of `squad.agent.md` (or from the `- **Version:** X` identity line as
24
+ fallback). Classify the channel:
25
+
26
+ | Stamped version contains | Channel |
27
+ |--------------------------|-----------|
28
+ | `-insider` | `insider` |
29
+ | `-preview` | `preview` |
30
+ | (neither) | `latest` |
31
+
32
+ Store the stamped version as `currentVersion` and the detected channel.
33
+
34
+ ### 1.3 Hybrid Cache Strategy
35
+
36
+ The strategy differs by channel to avoid redundant network calls for the
37
+ common (`latest`) case.
38
+
39
+ #### For `latest` channel — read upstream OS-specific cache
40
+
41
+ The upstream Squad CLI (`self-update.ts`) already fetches the latest version
42
+ on startup and writes it to an OS-specific path with a 24h TTL. Read that
43
+ cache instead of making a new npm call.
44
+
45
+ **One-liner to read the upstream cache:**
46
+ ```
47
+ node -e "const p=require('path'),o=require('os');const b=process.env.APPDATA||(process.platform==='darwin'?p.join(o.homedir(),'Library','Application Support'):p.join(o.homedir(),'.config'));const f=p.join(b,'squad-cli','update-check.json');try{const d=JSON.parse(require('fs').readFileSync(f,'utf8'));const age=Date.now()-d.checkedAt;if(age<86400000)console.log(JSON.stringify(d));else console.log('STALE')}catch{console.log('MISS')}"
48
+ ```
49
+
50
+ Output semantics:
51
+ - Valid JSON `{"latestVersion":"X.Y.Z","checkedAt":N}` → cache hit; use `latestVersion`
52
+ - `STALE` → cache expired (older than 24h); treat as no data
53
+ - `MISS` → cache missing or corrupt; treat as no data
54
+
55
+ On `STALE` or `MISS`, show the normal greeting (no notice). Do **not** make an
56
+ independent npm call for `latest`-channel users — the upstream CLI will refresh
57
+ the cache on its next run.
58
+
59
+ **OS-specific cache path for reference:**
60
+ - Windows: `%APPDATA%\squad-cli\update-check.json`
61
+ - Linux: `~/.config/squad-cli/update-check.json`
62
+ - macOS: `~/Library/Application Support/squad-cli/update-check.json`
63
+
64
+ #### For `insider` / `preview` channels — own probe with repo-local cache
65
+
66
+ The upstream cache only stores the `latest` dist-tag and is not useful for
67
+ pre-release channels. Use a separate probe.
68
+
69
+ **Step A — Check repo-local cache:**
70
+
71
+ Read `.squad/.cache/version-check.json`. If the file exists, is not older than
72
+ 24h, and `currentVersion` matches `stamped version`, use `channelVersion` from
73
+ it. Skip the npm probe.
74
+
75
+ **Repo-local cache schema:**
76
+ ```json
77
+ {
78
+ "checkedAt": "2026-05-26T14:13:28.492Z",
79
+ "currentVersion": "0.9.6-insider.2",
80
+ "channel": "insider",
81
+ "channelVersion": "0.9.7-insider.1"
82
+ }
83
+ ```
84
+
85
+ **Step B — npm probe (on cache miss / stale / version mismatch):**
86
+
87
+ ```
88
+ npm view @bradygaster/squad-cli dist-tags --json
89
+ ```
90
+
91
+ - Timeout: **5 seconds.** If the command does not respond within 5 seconds,
92
+ abandon and show normal greeting.
93
+ - On success: extract `dist-tags[channel]` (e.g., `dist-tags["insider"]`).
94
+ Write `.squad/.cache/version-check.json` with the schema above.
95
+ Create `.squad/.cache/` if it does not exist.
96
+ - On any error (network failure, registry unreachable, parse error): show
97
+ normal greeting.
98
+
99
+ ### 1.4 Comparison
100
+
101
+ Compare `currentVersion` against the resolved `latestVersionForChannel` using
102
+ semver ordering (pre-release suffixes sort lower than their release counterpart,
103
+ e.g., `0.9.5-insider.1 < 0.9.5`).
104
+
105
+ - `latestVersionForChannel > currentVersion` → update available
106
+ - Equal or older → no notice
107
+
108
+ ### 1.5 Greeting Append
109
+
110
+ When an update is available, append to the normal greeting (on the same line,
111
+ separated by ` · `):
112
+
113
+ ```
114
+ · 🆕 v{latestVersionForChannel} available — say "upgrade squad"
115
+ ```
116
+
117
+ Example complete greeting line:
118
+ ```
119
+ Squad v0.9.4-insider.1 · 🆕 v0.9.7-insider.1 available — say "upgrade squad"
120
+ ```
121
+
122
+ Do not mention the update check, the cache, or the mechanism. Just the notice.
123
+
124
+ ### 1.6 Upgrade Flow
125
+
126
+ **Trigger phrases** (case-insensitive, match anywhere in user message):
127
+ - "upgrade squad"
128
+ - "update squad"
129
+ - "what's new" *(when a version notice has been shown in this session)*
130
+ - "install the update"
131
+ - "yes upgrade"
132
+
133
+ **Flow:**
134
+
135
+ 1. **Confirm** — ask the user to confirm before running the upgrade:
136
+ > "I'll run `squad upgrade` now. This overwrites `squad.agent.md` and
137
+ > casting files but preserves `config.json`, `team.md`, `decisions.md`,
138
+ > and all agent history. Ready?"
139
+ Wait for affirmative response before proceeding.
140
+
141
+ 2. **Run upgrade:**
142
+ ```
143
+ squad upgrade
144
+ ```
145
+ Capture output. On failure (non-zero exit, error output), report the error
146
+ to the user and stop.
147
+
148
+ 3. **What's-new digest** — after successful upgrade, fetch and summarize
149
+ release notes:
150
+
151
+ ```
152
+ gh api repos/bradygaster/squad/releases --jq '[.[] | select(.tag_name | test("^v"))]'
153
+ ```
154
+
155
+ - Extract 3–6 bullet points from releases between `oldVersion` and
156
+ `newVersion`, inclusive.
157
+ - Priority: `feat` entries first, then `fix`, then `docs`.
158
+ - Format:
159
+ ```
160
+ 📋 What's new in v{newVersion}:
161
+ • {feat summary 1}
162
+ • {feat summary 2}
163
+ • {fix summary}
164
+ ```
165
+ - **Fallback chain:**
166
+ - `gh` not authenticated → "See full release notes at:
167
+ https://github.com/bradygaster/squad/releases"
168
+ - No releases found → "No release notes found for this version range."
169
+ - Network failure → link to releases page
170
+
171
+ 4. **Restart prompt** — after showing the digest, prompt the user:
172
+ > "`squad.agent.md` has been updated. For the new coordinator instructions
173
+ > to take effect, please start a new session (close and re-open this chat).
174
+ > Your team state and decisions are unchanged."
175
+
176
+ ### 1.7 Failure Modes
177
+
178
+ Every failure path ends at "show normal greeting." The update check never
179
+ interrupts or delays the session.
180
+
181
+ | Failure | Behavior |
182
+ |---------|----------|
183
+ | `node` not on PATH | `MISS` → normal greeting |
184
+ | Upstream cache missing / corrupt | `MISS` → normal greeting |
185
+ | Upstream cache stale (`latest` channel) | Normal greeting (no npm call) |
186
+ | npm probe timeout (5s) | Normal greeting |
187
+ | npm probe network error | Normal greeting |
188
+ | npm probe parse error | Normal greeting |
189
+ | `.squad/.cache/` write error | Normal greeting (skip cache write) |
190
+ | `gh` not available / unauthenticated | Upgrade flow: link to releases page |
191
+ | `squad upgrade` exits non-zero | Report error, stop flow |
192
+ | Any unexpected exception | Log to `.squad/orchestration-log/`, normal greeting |
193
+
194
+ ---
195
+
196
+ ## (Future steps reserved)
197
+
198
+ - Step 2: \<reserved\> — e.g., dependency drift check
199
+ - Step 3: \<reserved\> — e.g., repo policy / state-backend audit
@@ -1,9 +1,20 @@
1
1
  ---
2
2
  name: "cross-squad"
3
- description: "Coordinating work across multiple Squad instances"
3
+ description: "Coordinating work across multiple Squad instances — discovery, delegation, and disambiguation when the user says 'squad' (the product) vs casual English 'group of agents'."
4
4
  domain: "orchestration"
5
5
  confidence: "medium"
6
6
  source: "manual"
7
+ triggers:
8
+ - "spawn N squads"
9
+ - "spawn a squad"
10
+ - "another squad"
11
+ - "two squads of"
12
+ - "second squad"
13
+ - "fan out to squads"
14
+ - "delegate to a squad"
15
+ - "set up squads for"
16
+ - "create a squad to review"
17
+ - "ask the other squad"
7
18
  tools:
8
19
  - name: "squad-discover"
9
20
  description: "List known squads and their capabilities"
@@ -14,21 +25,60 @@ tools:
14
25
  ---
15
26
 
16
27
  ## Context
28
+
29
+ > **Read this FIRST any time the user says "squad" as a thing to spawn, delegate to, address, or fan out to** — e.g., *"spawn two squads of designers and devs"*, *"ask the other squad"*, *"delegate to a squad"*. In Squad-PRODUCT vocabulary, "squad" is a **peer** (an independent installation with its own `.squad/`, `team.md`, MCP server, and agents) — NOT a generic English synonym for "team" or "group". Do not fan out raw `task` agents inside your own coordinator context when the user means "another squad". Use the discovery and communication patterns below (and the companion `cross-squad-communication` skill for the actual protocols).
30
+
17
31
  When an organization runs multiple Squad instances (e.g., platform-squad, frontend-squad, data-squad), those squads need to discover each other, share context, and hand off work across repository boundaries. This skill teaches agents how to coordinate across squads without creating tight coupling.
18
32
 
33
+ > **Companion skill — for protocol details:** `cross-squad-communication/SKILL.md` covers the four communication patterns (synchronous CLI, read-only knowledge query, git-based async, and GitHub-issue-based delegation) once a peer squad is discovered via the registry below. This skill answers "who?" — the companion answers "how?".
34
+
19
35
  Cross-squad orchestration applies when:
20
36
  - A task requires capabilities owned by another squad
21
37
  - An architectural decision affects multiple squads
22
38
  - A feature spans multiple repositories with different squads
23
39
  - A squad needs to request infrastructure, tooling, or support from another squad
24
40
 
41
+ ## Disambiguation: "squad" vs ad-hoc agents
42
+
43
+ When the user uses the word **"squad" / "squads"** or asks to **"spawn a team"**, the coordinator MUST treat it as a literal reference to a Squad install (a `.squad/` directory with its own roster, casting, and coordinator) — NOT as a casual synonym for "a group of sub-agents".
44
+
45
+ ### Default behaviour (apply unless explicitly told otherwise)
46
+
47
+ | User says | Coordinator does |
48
+ |---|---|
49
+ | *"spawn two squads of X and Y"* / *"set up squads for X, Y, Z"* | Bootstrap N **real** Squad installs — separate folder + `git init` + `squad init` per squad — then use the cross-squad patterns below (`.squad/manifest.json`, `squad registry add`, `squad delegate`) and the protocols in the `cross-squad-communication` skill |
50
+ | *"ask the other squad about X"* / *"delegate to the data squad"* | Discover the peer via `squad registry list` (or by reading a known `.squad/manifest.json`), then use `cross-squad-communication` Pattern 0 / 1 / 2 / 3 — never re-implement the protocol with `task` |
51
+ | *"spawn a few agents to do X"* / *"have some agents review X"* / *"in parallel, get sub-agents to..."* | Ad-hoc `task` fan-out is fine — no `.squad/` bootstrap needed. This is the only path where raw `task` is appropriate when the user mentioned a multi-agent activity |
52
+
53
+ ### Ambiguous? `ask_user`, never silently downgrade
54
+
55
+ If the request **could** be either interpretation AND bootstrapping real squads is non-trivial (more than one or two `squad init` runs), you MUST use the `ask_user` tool with a 2-choice prompt before proceeding:
56
+
57
+ ```
58
+ question: "Should I create separate Squad installs or just dispatch ad-hoc agents?"
59
+ choices:
60
+ - "Real squads — separate .squad/ per squad (heavier, persistent, can be re-engaged later)"
61
+ - "Ad-hoc agents — one-shot `task` dispatch (lighter, ephemeral, no .squad/ created)"
62
+ ```
63
+
64
+ The cost of asking is one `ask_user`. The cost of getting it wrong is the user has to redo the work. **Never silently pick the cheaper option just because it feels disproportionate for the task size — surface the trade-off and let the user pick.**
65
+
66
+ ### Anti-patterns (every one of these is a real failure mode observed in production)
67
+
68
+ - **Calling `task` sub-agents "squad-alpha" / "squad-beta"** and treating them as squads. Naming something a squad doesn't make it one — a squad has its own `.squad/`, `team.md`, MCP server, and coordinator. If those aren't there, it's not a squad.
69
+ - **Matching a prior session's ad-hoc pattern without re-checking current intent.** If you see existing `reviews/squad-alpha/` folders from a previous run, that's a hint, NOT a contract — the user may have meant something different this time. Re-evaluate from scratch.
70
+ - **Silently choosing the cheaper interpretation because "bootstrapping two real squads for a 30-line app feels disproportionate".** That's a judgment call for the USER to make, not the coordinator. Use `ask_user`.
71
+ - **Loading the `cross-squad` skill, reading it, then doing `task` fan-out anyway** because the eager-execution / parallel-fan-out doctrine pulled you back. The disambiguation rule on this page OVERRIDES the generic fan-out doctrine when "squad" was the trigger.
72
+
25
73
  ## Patterns
26
74
 
27
75
  ### Discovery via Manifest
28
- Each squad publishes a `.squad/manifest.json` declaring its name, capabilities, and contact information. Squads discover each other through:
29
- 1. **Well-known paths**: Check `.squad/manifest.json` in known org repos
30
- 2. **Upstream config**: Squads already listed in `.squad/upstream.json` are checked for manifests
31
- 3. **Explicit registry**: A central `squad-registry.json` can list all squads in an org
76
+ Each squad publishes a `.squad/manifest.json` declaring its name, capabilities, and contact information. Squads discover each other through two mechanisms:
77
+
78
+ 1. **`.squad/squad-registry.json`** — **discovery-only.** Peer squads are findable via `squad discover` and addressable via `squad delegate`, but their skills/decisions/wisdom are NOT loaded into your coordinator. Manage with `squad registry add/list/remove`.
79
+ 2. **`.squad/upstream.json`** — **discovery + inheritance.** Squads listed here are also discoverable, AND your coordinator inherits their skills/decisions/wisdom/routing at session start. Manage with `squad upstream add/list/remove/sync`.
80
+
81
+ Both forms read the peer's manifest via the same code path. The `path` field is the **repository root** (e.g. `../friend-repo`), and Squad appends `.squad/manifest.json` internally. Pointing at the `.squad/` directory works too — Squad accepts both forms (`readManifest` strips a trailing `.squad` if present).
32
82
 
33
83
  ```json
34
84
  {
@@ -73,9 +123,19 @@ Track delegated work completion:
73
123
 
74
124
  ## Examples
75
125
 
126
+ ### Registering a peer squad (no inheritance)
127
+ ```bash
128
+ # Friend's repo is checked out at ../friend-platform/
129
+ squad registry add platform-squad ../friend-platform
130
+
131
+ # Verify
132
+ squad registry list
133
+ squad discover
134
+ ```
135
+
76
136
  ### Discovering squads
77
137
  ```bash
78
- # List all squads discoverable from upstreams and known repos
138
+ # List all squads discoverable from registry + upstreams
79
139
  squad discover
80
140
 
81
141
  # Output: