@bradygaster/squad-cli 0.9.6-insider.2 → 0.9.6-insider.3

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 (94) hide show
  1. package/dist/cli/commands/doctor.d.ts.map +1 -1
  2. package/dist/cli/commands/doctor.js +29 -0
  3. package/dist/cli/commands/doctor.js.map +1 -1
  4. package/dist/cli/commands/export.d.ts +7 -3
  5. package/dist/cli/commands/export.d.ts.map +1 -1
  6. package/dist/cli/commands/export.js +68 -16
  7. package/dist/cli/commands/export.js.map +1 -1
  8. package/dist/cli/commands/import.d.ts +7 -3
  9. package/dist/cli/commands/import.d.ts.map +1 -1
  10. package/dist/cli/commands/import.js +140 -42
  11. package/dist/cli/commands/import.js.map +1 -1
  12. package/dist/cli/commands/link.d.ts.map +1 -1
  13. package/dist/cli/commands/link.js +7 -1
  14. package/dist/cli/commands/link.js.map +1 -1
  15. package/dist/cli/commands/memory.d.ts +2 -0
  16. package/dist/cli/commands/memory.d.ts.map +1 -0
  17. package/dist/cli/commands/memory.js +304 -0
  18. package/dist/cli/commands/memory.js.map +1 -0
  19. package/dist/cli/commands/plugin.d.ts.map +1 -1
  20. package/dist/cli/commands/plugin.js +420 -5
  21. package/dist/cli/commands/plugin.js.map +1 -1
  22. package/dist/cli/commands/state-mcp.d.ts +25 -0
  23. package/dist/cli/commands/state-mcp.d.ts.map +1 -0
  24. package/dist/cli/commands/state-mcp.js +168 -0
  25. package/dist/cli/commands/state-mcp.js.map +1 -0
  26. package/dist/cli/commands/watch/capabilities/board.d.ts.map +1 -1
  27. package/dist/cli/commands/watch/capabilities/board.js +2 -1
  28. package/dist/cli/commands/watch/capabilities/board.js.map +1 -1
  29. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +1 -1
  30. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
  31. package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
  32. package/dist/cli/commands/watch/capabilities/execute.js +12 -1
  33. package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
  34. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts +1 -1
  35. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
  36. package/dist/cli/commands/watch/capabilities/monitor-email.js +19 -3
  37. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
  38. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts +1 -1
  39. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
  40. package/dist/cli/commands/watch/capabilities/monitor-teams.js +19 -4
  41. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
  42. package/dist/cli/commands/watch/capabilities/retro.js +1 -1
  43. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
  44. package/dist/cli/commands/watch/index.d.ts.map +1 -1
  45. package/dist/cli/commands/watch/index.js +9 -6
  46. package/dist/cli/commands/watch/index.js.map +1 -1
  47. package/dist/cli/core/cast.d.ts.map +1 -1
  48. package/dist/cli/core/cast.js +132 -1
  49. package/dist/cli/core/cast.js.map +1 -1
  50. package/dist/cli/core/init.d.ts +2 -0
  51. package/dist/cli/core/init.d.ts.map +1 -1
  52. package/dist/cli/core/init.js +13 -1
  53. package/dist/cli/core/init.js.map +1 -1
  54. package/dist/cli/core/templates.d.ts.map +1 -1
  55. package/dist/cli/core/templates.js +31 -0
  56. package/dist/cli/core/templates.js.map +1 -1
  57. package/dist/cli/core/upgrade.d.ts +1 -0
  58. package/dist/cli/core/upgrade.d.ts.map +1 -1
  59. package/dist/cli/core/upgrade.js +171 -4
  60. package/dist/cli/core/upgrade.js.map +1 -1
  61. package/dist/cli/index.d.ts +1 -0
  62. package/dist/cli/index.d.ts.map +1 -1
  63. package/dist/cli/index.js +1 -0
  64. package/dist/cli/index.js.map +1 -1
  65. package/dist/cli/shell/components/App.js +1 -1
  66. package/dist/cli/shell/components/App.js.map +1 -1
  67. package/dist/cli/shell/components/MessageStream.js +2 -2
  68. package/dist/cli/shell/components/MessageStream.js.map +1 -1
  69. package/dist/cli/shell/coordinator.js +2 -2
  70. package/dist/cli/shell/index.d.ts.map +1 -1
  71. package/dist/cli/shell/index.js +2 -1
  72. package/dist/cli/shell/index.js.map +1 -1
  73. package/dist/cli-entry.js +51 -9
  74. package/dist/cli-entry.js.map +1 -1
  75. package/package.json +7 -3
  76. package/templates/after-agent-reference.md +64 -0
  77. package/templates/ceremony-reference.md +82 -0
  78. package/templates/client-compatibility-reference.md +46 -0
  79. package/templates/copilot-agent.md +96 -0
  80. package/templates/copilot-instructions.md +14 -0
  81. package/templates/model-selection-reference.md +101 -0
  82. package/templates/prd-intake.md +105 -0
  83. package/templates/rai-charter.md +110 -0
  84. package/templates/rai-policy.md +103 -0
  85. package/templates/ralph-reference.md +141 -0
  86. package/templates/routing.md +1 -0
  87. package/templates/scribe-charter.md +18 -151
  88. package/templates/session-init-reference.md +199 -0
  89. package/templates/skills/e2e-template-testing/SKILL.md +557 -0
  90. package/templates/skills/squad-commands/SKILL.md +303 -0
  91. package/templates/skills/squad-version-check/SKILL.md +160 -0
  92. package/templates/spawn-reference.md +132 -0
  93. package/templates/squad.agent.md.template +187 -622
  94. package/templates/worktree-reference.md +126 -0
@@ -0,0 +1,303 @@
1
+ ---
2
+ name: squad-commands
3
+ description: >
4
+ Categorized catalog of common Squad operations. Coordinator reads this
5
+ file and presents it as an interactive menu when the user asks for
6
+ available commands or help.
7
+ domain: squad-operations
8
+ confidence: high
9
+ source: first-party
10
+ triggers: ["squad commands", "what can squad do", "show me squad options", "slash commands"]
11
+ ---
12
+
13
+ ## Menu Presentation Rules
14
+
15
+ When the user triggers this skill ("squad commands", "help", "what can squad do", etc.):
16
+
17
+ 1. **Category-level menu first.** Present category names as an `ask_user` choice list:
18
+ ```
19
+ 📋 Squad Commands — pick a category:
20
+ 1. Install & Upgrade
21
+ 2. Team Management
22
+ 3. Issues & PRs
23
+ 4. Plugins & Skills
24
+ 5. Model & Cost
25
+ 6. Sessions & State
26
+ ```
27
+ 2. **Drill-down.** After selection, show operation titles in that category as a second `ask_user` list.
28
+ 3. **Direct match skips the menu.** If the user says "how do I upgrade with state backend," match to the specific entry and go straight to argument collection.
29
+ 4. **Compact fallback.** If `ask_user` is unavailable, render as a markdown table instead.
30
+ 5. **Back / Cancel.** Include "← Back to categories" in sub-menus. Include "Cancel" in confirmation prompts. Respect "never mind" / "cancel" at any point.
31
+
32
+ **Argument collection:** For entries with `args`, iterate the list sequentially. Use `ask_user` with choices when `choices` is provided; free-text prompt otherwise. If the user says "just do it" or "defaults are fine," skip remaining args and use their defaults.
33
+
34
+ **Confirmation template:**
35
+ ```
36
+ ⚠️ This will {action-description}.
37
+ {what will change}
38
+ Proceed? (yes / no)
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Install & Upgrade
44
+
45
+ ### Upgrade Squad CLI
46
+
47
+ - **intent:** upgrade squad, update squad, install latest version, get new version
48
+ - **summary:** Upgrade Squad CLI to the latest version for your channel
49
+ - **action:** shell
50
+ - **command:** squad upgrade
51
+ - **args:**
52
+ - `state-backend`: Which state backend? | choices: {worktree, git-notes, orphan, two-layer} | default: (keep current)
53
+ - **confirm:** false
54
+ - **platform_caveats:** Requires terminal. In VS Code, open the integrated terminal and run the command directly.
55
+
56
+ ### Initialize Squad
57
+
58
+ - **intent:** set up squad, initialize squad, create team, start squad in this project
59
+ - **summary:** Scaffold Squad in the current directory (idempotent)
60
+ - **action:** shell
61
+ - **command:** squad init
62
+ - **args:** (none)
63
+ - **confirm:** false
64
+ - **platform_caveats:** Requires terminal. Recommend a standalone terminal for best results.
65
+
66
+ ### Switch State Backend
67
+
68
+ - **intent:** switch state backend, change state storage, use git-notes, use orphan branch
69
+ - **summary:** Change where Squad stores mutable state (config.json)
70
+ - **action:** file-edit
71
+ - **command:** .squad/config.json → stateBackend
72
+ - **args:**
73
+ - `stateBackend`: Which state backend? | choices: {worktree, git-notes, orphan, two-layer} | default: (keep current)
74
+ - **confirm:** true
75
+ - **platform_caveats:** May require migration if switching away from worktree. Show current value and new value before confirming.
76
+
77
+ ---
78
+
79
+ ## Team Management
80
+
81
+ ### Add Team Member
82
+
83
+ - **intent:** add team member, hire agent, add agent, add developer, recruit
84
+ - **summary:** Add a new agent to the team roster
85
+ - **action:** coordinator
86
+ - **command:** Add Team Member flow (Init Mode / Team Mode)
87
+ - **args:**
88
+ - `role`: What role should this agent fill? (e.g., Frontend Dev, Backend Dev, QA Engineer)
89
+ - `name`: Preferred name or casting universe? | default: (auto-cast from active universe)
90
+ - **confirm:** false
91
+
92
+ ### Remove Team Member
93
+
94
+ - **intent:** remove team member, fire agent, delete agent, remove developer
95
+ - **summary:** Remove an agent and delete their charter and history files
96
+ - **action:** coordinator
97
+ - **command:** Remove Team Member flow
98
+ - **args:**
99
+ - `member`: Which team member to remove? (name or role)
100
+ - **confirm:** true
101
+
102
+ ### Reassign Roles
103
+
104
+ - **intent:** reassign role, change role, swap roles, update team member role
105
+ - **summary:** Update a team member's role in team.md and their charter
106
+ - **action:** coordinator
107
+ - **command:** Update team.md roster + charter.md
108
+ - **args:**
109
+ - `member`: Which team member?
110
+ - `newRole`: New role?
111
+ - **confirm:** false
112
+
113
+ ### Show Roster
114
+
115
+ - **intent:** show roster, who is on the team, list team members, show team, capability profile
116
+ - **summary:** Display the current team roster and capability profile
117
+ - **action:** coordinator
118
+ - **command:** Direct Mode — read team.md, answer
119
+ - **args:** (none)
120
+ - **confirm:** false
121
+
122
+ ---
123
+
124
+ ## Issues & PRs
125
+
126
+ ### Connect GitHub Repo
127
+
128
+ - **intent:** connect github, enable issues, set up issues, link repository, github issues mode
129
+ - **summary:** Connect this project to GitHub Issues via gh auth
130
+ - **action:** coordinator
131
+ - **command:** GitHub Issues Mode (connection flow)
132
+ - **args:** (none)
133
+ - **confirm:** false
134
+ - **platform_caveats:** Requires `gh auth login` to have been run in the terminal.
135
+
136
+ ### Triage Issues
137
+
138
+ - **intent:** triage issues, review issues, assign issues, label issues
139
+ - **summary:** Run the Lead triage flow on open GitHub issues
140
+ - **action:** coordinator
141
+ - **command:** GitHub Issues Mode → Lead triage
142
+ - **args:** (none)
143
+ - **confirm:** false
144
+
145
+ ### Activate Ralph
146
+
147
+ - **intent:** activate ralph, start ralph, ralph go, start work monitor, start auto-work
148
+ - **summary:** Activate Ralph — Work Monitor — to pick up and run queued issues
149
+ - **action:** coordinator
150
+ - **command:** Ralph — Work Monitor triggers
151
+ - **args:** (none)
152
+ - **confirm:** false
153
+
154
+ ### Set Ralph Polling Interval
155
+
156
+ - **intent:** set ralph interval, change ralph timing, how often does ralph check, ralph every N minutes
157
+ - **summary:** Tell Ralph how frequently to poll for new work
158
+ - **action:** coordinator
159
+ - **command:** Ralph trigger: "Ralph, check every N minutes"
160
+ - **args:**
161
+ - `interval`: How often should Ralph poll? (in minutes) | default: 10
162
+ - **confirm:** false
163
+
164
+ ### Start Squad Watch
165
+
166
+ - **intent:** start watch, squad watch, monitor issues, watch for issues, auto-triage
167
+ - **summary:** Start squad watch to continuously poll and triage issues
168
+ - **action:** shell
169
+ - **command:** squad watch
170
+ - **args:**
171
+ - `interval`: Poll interval in minutes | default: 10
172
+ - **confirm:** false
173
+ - **platform_caveats:** CLI-only — long-running foreground process. Not viable in VS Code without an integrated terminal. Run: `squad watch --interval {n}` in your terminal.
174
+
175
+ ---
176
+
177
+ ## Plugins & Skills
178
+
179
+ ### Browse Plugin Marketplace
180
+
181
+ - **intent:** browse plugins, explore plugins, what plugins are available, plugin marketplace
182
+ - **summary:** Browse available plugins in the Squad marketplace
183
+ - **action:** shell
184
+ - **command:** squad plugin marketplace browse
185
+ - **args:**
186
+ - `name`: Plugin name to search for | default: (browse all)
187
+ - **confirm:** false
188
+
189
+ ### Add Marketplace Plugin
190
+
191
+ - **intent:** add plugin, install plugin, get plugin from marketplace
192
+ - **summary:** Add a plugin from the marketplace to this Squad
193
+ - **action:** shell
194
+ - **command:** squad plugin marketplace add
195
+ - **args:**
196
+ - `plugin`: Plugin owner/repo (e.g., owner/plugin-name)
197
+ - **confirm:** false
198
+
199
+ ### Remove Marketplace Plugin
200
+
201
+ - **intent:** remove plugin, uninstall plugin, delete plugin
202
+ - **summary:** Remove an installed marketplace plugin
203
+ - **action:** shell
204
+ - **command:** squad plugin marketplace remove
205
+ - **args:**
206
+ - `name`: Plugin name to remove
207
+ - **confirm:** true
208
+
209
+ ### List Marketplace Plugins
210
+
211
+ - **intent:** list plugins, show installed plugins, what plugins do I have
212
+ - **summary:** List all plugins registered in this Squad
213
+ - **action:** shell
214
+ - **command:** squad plugin marketplace list
215
+ - **args:** (none)
216
+ - **confirm:** false
217
+
218
+ ### List Installed Skills
219
+
220
+ - **intent:** list skills, show skills, what skills are installed, skill catalog
221
+ - **summary:** List all skills installed in .squad/skills/ and .copilot/skills/
222
+ - **action:** coordinator
223
+ - **command:** Direct Mode — list .squad/skills/ and .copilot/skills/ directories
224
+ - **args:** (none)
225
+ - **confirm:** false
226
+
227
+ ---
228
+
229
+ ## Model & Cost
230
+
231
+ ### Set Default Model
232
+
233
+ - **intent:** set default model, change model, use gpt-4, use claude, switch model
234
+ - **summary:** Set the default model for all agents in config.json
235
+ - **action:** file-edit
236
+ - **command:** .squad/config.json → defaultModel
237
+ - **args:**
238
+ - `model`: Model name (e.g., gpt-4o, claude-sonnet-4.5, o3)
239
+ - **confirm:** false
240
+
241
+ ### Override Per-Agent Model
242
+
243
+ - **intent:** set model for agent, agent model override, use different model for one agent
244
+ - **summary:** Set a model override for a specific agent in config.json
245
+ - **action:** file-edit
246
+ - **command:** .squad/config.json → agentModelOverrides.{agentName}
247
+ - **args:**
248
+ - `agent`: Agent name (must match name in team.md)
249
+ - `model`: Model name (e.g., gpt-4o, claude-sonnet-4.5)
250
+ - **confirm:** false
251
+
252
+ ### Clear Model Preference
253
+
254
+ - **intent:** clear model, reset model, remove model preference, use default model
255
+ - **summary:** Remove a model override from config.json (reverts to system default)
256
+ - **action:** file-edit
257
+ - **command:** .squad/config.json → remove defaultModel or agentModelOverrides.{agentName}
258
+ - **args:**
259
+ - `scope`: Clear default or a specific agent? | choices: {default model, specific agent} | default: default model
260
+ - `agent`: Agent name (only if scope = specific agent)
261
+ - **confirm:** false
262
+
263
+ ---
264
+
265
+ ## Sessions & State
266
+
267
+ ### Catch-Up Summary
268
+
269
+ - **intent:** catch me up, what happened, status, what did the team do, session summary
270
+ - **summary:** Summarize recent agent activity and key decisions
271
+ - **action:** coordinator
272
+ - **command:** Session catch-up flow (lazy scan)
273
+ - **args:** (none)
274
+ - **confirm:** false
275
+
276
+ ### Show Recent Decisions
277
+
278
+ - **intent:** show decisions, recent decisions, what decisions were made, decision log
279
+ - **summary:** Display recent entries from .squad/decisions.md
280
+ - **action:** coordinator
281
+ - **command:** Direct Mode — read decisions.md, answer
282
+ - **args:** (none)
283
+ - **confirm:** false
284
+
285
+ ### Archive Old Decisions
286
+
287
+ - **intent:** archive decisions, clean up decisions, move old decisions, compact decisions
288
+ - **summary:** Move old decisions from decisions.md to decisions-archive.md
289
+ - **action:** coordinator
290
+ - **command:** Move entries older than threshold from .squad/decisions.md → .squad/decisions-archive.md
291
+ - **args:**
292
+ - `olderThan`: Archive decisions older than how many days? | default: 30
293
+ - **confirm:** true
294
+
295
+ ### Summarize Agent History
296
+
297
+ - **intent:** summarize history, what did agent do, agent history, compress history
298
+ - **summary:** Spawn an agent to summarize and compress a team member's history file
299
+ - **action:** coordinator
300
+ - **command:** Spawn agent with history.md summarization task
301
+ - **args:**
302
+ - `member`: Which team member's history to summarize?
303
+ - **confirm:** false
@@ -0,0 +1,160 @@
1
+ # SKILL: Squad CLI Internals — Version Stamping & Upgrade Mechanics
2
+
3
+ **Confidence:** medium
4
+ **Discovered by:** Data
5
+ **Date:** 2026-05-26
6
+ **Validated in:** Issue #1173 recon (bradygaster/squad)
7
+
8
+ ---
9
+
10
+ ## What This Skill Covers
11
+
12
+ Reusable knowledge about how `@bradygaster/squad-cli` stamps its version into `squad.agent.md`, how `squad upgrade` works, what it preserves vs. overwrites, and how to probe the npm registry for the latest version from a coordinator prompt.
13
+
14
+ ---
15
+
16
+ ## Package & Registry Facts
17
+
18
+ - **Package name:** `@bradygaster/squad-cli`
19
+ - **Registry:** npm (public)
20
+ - **CLI binary:** `squad` (registered via `package.json#bin.squad`)
21
+ - **Node version requirement:** Node ≥22.5.0 (ESM-only codebase)
22
+
23
+ ---
24
+
25
+ ## Version Stamping Mechanism
26
+
27
+ **Source file:** `dist/cli/core/version.js`
28
+
29
+ Three functions:
30
+
31
+ ### `getPackageVersion()`
32
+ Walks up from the compiled JS file to find `package.json`. Returns `pkg.version`. Works from both `dist/cli/core/version.js` and a bundled root `cli.js`. Returns `'0.0.0'` as fallback if not found.
33
+
34
+ ### `stampVersion(filePath, version)`
35
+ Mutates `squad.agent.md` in three places:
36
+ 1. HTML comment: `<!-- version: {version} -->` (must be on the line immediately after frontmatter `---`)
37
+ 2. Identity line: `- **Version:** {version}`
38
+ 3. Greeting instruction: backtick-quoted `` `Squad v{version}` ``
39
+
40
+ **Called by:** both `init` and `upgrade` — after copying the template to the destination.
41
+
42
+ ### `readInstalledVersion(filePath)`
43
+ Reads the stamped version back from `squad.agent.md`:
44
+ 1. First tries HTML comment format: `/<!-- version: ([0-9.]+(?:-[a-z]+(?:\.\d+)?)?) -->/`
45
+ 2. Falls back to old frontmatter format: `/^version:\s*"([^"]+)"/m`
46
+ 3. Returns `'0.0.0'` on any error
47
+
48
+ ---
49
+
50
+ ## `squad upgrade` Behavior
51
+
52
+ **Source file:** `dist/cli/core/upgrade.js`
53
+
54
+ ### What gets overwritten:
55
+ - `squad.agent.md` — full overwrite from template, then `stampVersion()`
56
+ - Files with `overwriteOnUpgrade: true` in `TEMPLATE_MANIFEST`: casting JSON files, template .md files, `copilot-instructions.md` (if @copilot enabled)
57
+ - GitHub Actions workflows — from `templates/workflows/`; non-npm projects get type-aware stubs
58
+ - Runs `runMigrations()` after file copy
59
+
60
+ ### What is PRESERVED:
61
+ - `team.md`, `routing.md`, `decisions.md`, `ceremonies.md` (user-owned)
62
+ - `agents/*/history.md` (individual agent memory)
63
+ - `.squad/config.json` — **never touched**; `stateBackend` survives intact
64
+ - User-added files not in TEMPLATE_MANIFEST
65
+
66
+ ### Self-upgrade path (`selfUpgradeCli()`):
67
+ Detects npm/pnpm/yarn via `npm_execpath` and `npm_config_user_agent`. Runs:
68
+ - npm: `npm install -g @bradygaster/squad-cli@latest`
69
+ - pnpm: `pnpm add -g @bradygaster/squad-cli@latest`
70
+ - yarn: `yarn global add @bradygaster/squad-cli@latest`
71
+ Use `@insider` tag for insider builds.
72
+
73
+ ### `compareSemver(a, b)` utility (in upgrade.js):
74
+ Returns -1/0/1. Handles pre-release: strips pre-release for base comparison, then treats pre-release as less than release (e.g., `0.9.5-insider.1` < `0.9.5`). Can be ported directly if needed in prompt logic.
75
+
76
+ ---
77
+
78
+ ## `.squad/config.json` — What It Holds
79
+
80
+ ```json
81
+ {
82
+ "version": 1,
83
+ "stateBackend": "worktree"
84
+ }
85
+ ```
86
+
87
+ Other optional fields added by the coordinator at runtime:
88
+ - `defaultModel` — global model override for all agent spawns
89
+ - `agentModelOverrides.{agentName}` — per-agent model override
90
+
91
+ The file is read-only from the upgrade path's perspective. Only the coordinator writes to it (for model preferences).
92
+
93
+ ---
94
+
95
+ ## Version-Check Probe (npm Registry)
96
+
97
+ Use this one-liner from inside a coordinator prompt to fetch dist-tags:
98
+
99
+ ```
100
+ npm view @bradygaster/squad-cli dist-tags --json
101
+ ```
102
+
103
+ - Timeout: **5 seconds.** If no response within 5 seconds, abandon and show normal greeting.
104
+ - On success: extract `dist-tags[channel]` (e.g., `dist-tags["insider"]`).
105
+ - On any error (network failure, registry unreachable, parse error): show normal greeting.
106
+
107
+ ---
108
+
109
+ ## Upstream OS-Specific Cache
110
+
111
+ The CLI (`self-update.ts`) writes `latest` version info to an OS-specific path with a 24h TTL.
112
+
113
+ **One-liner to read the upstream cache:**
114
+ ```
115
+ 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')}"
116
+ ```
117
+
118
+ Output semantics:
119
+ - Valid JSON `{"latestVersion":"X.Y.Z","checkedAt":N}` → cache hit; use `latestVersion`
120
+ - `STALE` → cache expired (older than 24h); treat as no data
121
+ - `MISS` → cache missing or corrupt; treat as no data
122
+
123
+ **OS-specific cache path:**
124
+ - Windows: `%APPDATA%\squad-cli\update-check.json`
125
+ - Linux: `~/.config/squad-cli/update-check.json`
126
+ - macOS: `~/Library/Application Support/squad-cli/update-check.json`
127
+
128
+ ---
129
+
130
+ ## Repo-Local Cache Convention: `.squad/.cache/version-check.json`
131
+
132
+ Used by coordinator for `insider`/`preview` channels (the upstream cache only stores `latest`).
133
+
134
+ **Schema:**
135
+ ```json
136
+ {
137
+ "checkedAt": "2026-05-26T14:13:28.492Z",
138
+ "currentVersion": "0.9.6-insider.2",
139
+ "channel": "insider",
140
+ "channelVersion": "0.9.7-insider.1"
141
+ }
142
+ ```
143
+
144
+ **TTL:** 24 hours from `checkedAt`.
145
+ **Gitignore:** `.squad/.cache/` is listed in `.gitignore` — cache files are never committed.
146
+
147
+ ---
148
+
149
+ ## Key File Paths (installed CLI)
150
+
151
+ | Purpose | Path |
152
+ |---|---|
153
+ | Version utilities | `dist/cli/core/version.js` |
154
+ | Upgrade logic | `dist/cli/core/upgrade.js` |
155
+ | Init logic | `dist/cli/core/init.js` |
156
+ | Template manifest | `dist/cli/core/templates.js` |
157
+ | Copilot install helper | `dist/cli/copilot-install.js` |
158
+ | squad.agent.md template | `templates/squad.agent.md.template` |
159
+ | Session init reference | `templates/session-init-reference.md` |
160
+ | All templates | `templates/` |
@@ -0,0 +1,132 @@
1
+ # Spawn Reference
2
+
3
+ ### How to Spawn an Agent
4
+
5
+ **You MUST dispatch every agent spawn** via the platform's tool (`task` on CLI, `runSubagent` on VS Code):
6
+
7
+ - **`agent_type`**: `"general-purpose"` (always — this gives agents full tool access)
8
+ - **`mode`**: `"background"` (default) or `"sync"` — use `"background"` for all parallelizable work; use `"sync"` only when the result is needed before the next step can proceed
9
+ - **`description`**: `"{Name}: {brief task summary}"` (e.g., `"Ripley: Design REST API endpoints"`, `"Dallas: Build login form"`) — this is what appears in the UI, so it MUST carry the agent's name and what they're doing
10
+ - **`prompt`**: The full agent prompt (see below)
11
+
12
+ **⚡ Inline the charter.** Before spawning, read the agent's `charter.md` (resolve from team root: `{team_root}/.squad/agents/{name}/charter.md`) and paste its contents directly into the spawn prompt. This eliminates a tool call from the agent's critical path. The agent still reads its own `history.md` and `decisions.md`.
13
+
14
+ **Background spawn (the default):** Use the template below with `mode: "background"`.
15
+
16
+ **Sync spawn (when required):** Use the template below and omit the `mode` parameter (sync is default).
17
+
18
+ > **VS Code equivalent:** Use `runSubagent` with the prompt content below. Drop `agent_type`, `mode`, `model`, and `description` parameters. Multiple subagents in one turn run concurrently. Sync is the default on VS Code.
19
+
20
+ **Template for any agent** (substitute `{Name}`, `{Role}`, `{name}`, and inline the charter):
21
+
22
+ ```
23
+ agent_type: "general-purpose"
24
+ model: "{resolved_model}"
25
+ mode: "background"
26
+ name: "{name}"
27
+ description: "{emoji} {Name}: {brief task summary}"
28
+ prompt: |
29
+ You are {Name}, the {Role} on this project.
30
+
31
+ YOUR CHARTER:
32
+ {paste contents of .squad/agents/{name}/charter.md here}
33
+
34
+ TEAM ROOT: {team_root}
35
+ CURRENT_DATETIME: <resolved CURRENT_DATETIME literal>
36
+ All `.squad/` paths are relative to this root.
37
+
38
+ Use the literal CURRENT_DATETIME value from your prompt for dated file content:
39
+ `<literal CURRENT_DATETIME value from your prompt>`. Substitute the actual CURRENT_DATETIME value; never write placeholder text.
40
+
41
+ PERSONAL_AGENT: {true|false} # Whether this is a personal agent
42
+ GHOST_PROTOCOL: {true|false} # Whether ghost protocol applies
43
+
44
+ {If PERSONAL_AGENT is true, append Ghost Protocol rules:}
45
+ ## Ghost Protocol
46
+ You are a personal agent operating in a project context. You MUST follow these rules:
47
+ - Read-only project state: Do NOT write to project's .squad/ directory
48
+ - No project ownership: You advise; project agents execute
49
+ - Transparent origin: Tag all logs with [personal:{name}]
50
+ - Consult mode: Provide recommendations, not direct changes
51
+ {end Ghost Protocol block}
52
+
53
+ WORKTREE_PATH: {worktree_path}
54
+ WORKTREE_MODE: {true|false}
55
+
56
+ {% if WORKTREE_MODE %}
57
+ **WORKTREE:** You are working in a dedicated worktree at `{WORKTREE_PATH}`.
58
+ - All file operations should be relative to this path
59
+ - Do NOT switch branches — the worktree IS your branch (`{branch_name}`)
60
+ - Build and test in the worktree, not the main repo
61
+ - Commit and push from the worktree
62
+ {% endif %}
63
+
64
+ STATE_BACKEND: {state_backend}
65
+
66
+ ## State Protocol — Runtime State Tools
67
+ Mutable squad state is owned by the runtime. You MUST use the `state.*` tools
68
+ whenever they are available:
69
+ - `squad_state_read` / `squad_state_list` for decisions, history, logs, and inbox entries
70
+ - `squad_state_write` / `squad_state_append` for durable updates
71
+ - `squad_state_delete` after Scribe merges inbox entries
72
+ - `squad_state_health` when diagnosing backend availability
73
+ - `squad_decide` for team-relevant decisions
74
+
75
+ The runtime routes those calls to the configured backend (`{state_backend}`), including
76
+ git-native backends. Do NOT run backend git commands, switch to a state branch, push
77
+ note refs, or write mutable `.squad/` state files by hand. Static config (charters,
78
+ team.md, routing.md, skills) remains on disk and may be read with normal file tools.
79
+
80
+ Read `agents/{name}/history.md` with `squad_state_read` when state tools are available; otherwise fall back to `.squad/agents/{name}/history.md`.
81
+ Read `decisions.md` with `squad_state_read` when state tools are available; otherwise fall back to `.squad/decisions.md`.
82
+ If .squad/identity/wisdom.md exists, read it before starting work.
83
+ If .squad/identity/now.md exists, read it at spawn time.
84
+ Check .copilot/skills/ for copilot-level skills (process, workflow, protocol).
85
+ Check .squad/skills/ for team-level skills (patterns discovered during work).
86
+ Read any relevant SKILL.md files before working.
87
+
88
+ ⚠️ WORK FRESHNESS: When determining what to work on:
89
+ - If an external tracker is configured (GitHub Issues, GitLab Issues, Azure DevOps),
90
+ ALWAYS query it for current open/active items. The tracker is the authoritative
91
+ source of truth — local plan files and checkboxes are advisory only.
92
+ - If .squad/identity/now.md has a `last_verified` timestamp older than your session
93
+ start, re-verify the current focus against the tracker before acting.
94
+ - NEVER work on items marked closed/done in the tracker, even if local files
95
+ suggest they are incomplete.
96
+
97
+ {only if MCP tools detected — omit entirely if none:}
98
+ MCP TOOLS: {service}: ✅ ({tools}) | ❌. Fall back to CLI when unavailable.
99
+ {end MCP block}
100
+
101
+ **Requested by:** {current user name}
102
+
103
+ INPUT ARTIFACTS: {list exact file paths to review/modify}
104
+
105
+ The user says: "{message}"
106
+
107
+ Do the work. Respond as {Name}.
108
+
109
+ ⚠️ OUTPUT: Report outcomes in human terms. Never expose tool internals or SQL.
110
+ ⚠️ DATES: When writing dates in any file (decisions, history, logs), use ONLY the CURRENT_DATETIME value above. Never infer or guess the date.
111
+
112
+ AFTER work (BEST-EFFORT — do NOT retry on failure):
113
+ ⚠️ POST-WORK BUDGET: Spend at most 20 tool calls on post-work steps below.
114
+ If you are running low on context or have used 60+ tool calls on primary work,
115
+ skip post-work entirely -- Scribe handles it independently.
116
+ 1. APPEND learnings with `squad_state_append` to `agents/{name}/history.md`.
117
+ Include architecture decisions, patterns, user preferences, and key file paths.
118
+ Use `<literal CURRENT_DATETIME value from your prompt>` as the entry timestamp.
119
+ Substitute the actual CURRENT_DATETIME value; do not write placeholder text.
120
+ 2. If you made a team-relevant decision, call `squad_decide`. If that tool is
121
+ unavailable, use `squad_state_write` to `decisions/inbox/{name}-{brief-slug}.md`.
122
+ 3. If state tools are unavailable, skip post-work state persistence and report the
123
+ backend/tool availability problem in your final summary.
124
+ 4. SKILL EXTRACTION is handled by Scribe — do NOT attempt it yourself.
125
+
126
+ ⚠️ STOP ON FAILURE: If ANY post-work step fails (git conflict, file not found,
127
+ permission error), SKIP it and move on. Do NOT retry. Scribe handles cleanup
128
+ independently. Your primary deliverable is already done — post-work is optional.
129
+
130
+ ⚠️ RESPONSE ORDER: After ALL tool calls, write a 2-3 sentence plain text
131
+ summary as your FINAL output. No tool calls after this summary.
132
+ ```