@bradygaster/squad-cli 0.10.0 → 0.11.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +555 -0
  2. package/README.md +6 -6
  3. package/dist/cli/commands/aspire.d.ts +1 -1
  4. package/dist/cli/commands/aspire.js +2 -2
  5. package/dist/cli/commands/aspire.js.map +1 -1
  6. package/dist/cli/commands/build.d.ts.map +1 -1
  7. package/dist/cli/commands/build.js +30 -9
  8. package/dist/cli/commands/build.js.map +1 -1
  9. package/dist/cli/commands/cross-squad.d.ts +15 -2
  10. package/dist/cli/commands/cross-squad.d.ts.map +1 -1
  11. package/dist/cli/commands/cross-squad.js +78 -4
  12. package/dist/cli/commands/cross-squad.js.map +1 -1
  13. package/dist/cli/commands/loop.js +1 -1
  14. package/dist/cli/commands/loop.js.map +1 -1
  15. package/dist/cli/commands/migrate-backend.d.ts.map +1 -1
  16. package/dist/cli/commands/migrate-backend.js +23 -0
  17. package/dist/cli/commands/migrate-backend.js.map +1 -1
  18. package/dist/cli/commands/preset.d.ts +1 -0
  19. package/dist/cli/commands/preset.d.ts.map +1 -1
  20. package/dist/cli/commands/preset.js +60 -3
  21. package/dist/cli/commands/preset.js.map +1 -1
  22. package/dist/cli/commands/skill.d.ts.map +1 -1
  23. package/dist/cli/commands/skill.js +4 -3
  24. package/dist/cli/commands/skill.js.map +1 -1
  25. package/dist/cli/commands/state-mcp.d.ts.map +1 -1
  26. package/dist/cli/commands/state-mcp.js +50 -16
  27. package/dist/cli/commands/state-mcp.js.map +1 -1
  28. package/dist/cli/commands/watch/agent-spawn.d.ts +21 -1
  29. package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -1
  30. package/dist/cli/commands/watch/agent-spawn.js +38 -5
  31. package/dist/cli/commands/watch/agent-spawn.js.map +1 -1
  32. package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -1
  33. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +1 -25
  34. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +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 +2 -25
  37. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
  38. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
  39. package/dist/cli/commands/watch/capabilities/monitor-teams.js +2 -26
  40. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
  41. package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -1
  42. package/dist/cli/commands/watch/capabilities/retro.js +1 -25
  43. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
  44. package/dist/cli/commands/watch/config.d.ts.map +1 -1
  45. package/dist/cli/commands/watch/config.js +5 -0
  46. package/dist/cli/commands/watch/config.js.map +1 -1
  47. package/dist/cli/commands/watch/index.d.ts.map +1 -1
  48. package/dist/cli/commands/watch/index.js +3 -1
  49. package/dist/cli/commands/watch/index.js.map +1 -1
  50. package/dist/cli/core/cast.d.ts.map +1 -1
  51. package/dist/cli/core/cast.js +84 -0
  52. package/dist/cli/core/cast.js.map +1 -1
  53. package/dist/cli/core/command-help.d.ts.map +1 -1
  54. package/dist/cli/core/command-help.js +25 -12
  55. package/dist/cli/core/command-help.js.map +1 -1
  56. package/dist/cli/core/gh-cli.d.ts +6 -1
  57. package/dist/cli/core/gh-cli.d.ts.map +1 -1
  58. package/dist/cli/core/gh-cli.js +8 -3
  59. package/dist/cli/core/gh-cli.js.map +1 -1
  60. package/dist/cli/core/init.d.ts.map +1 -1
  61. package/dist/cli/core/init.js +82 -3
  62. package/dist/cli/core/init.js.map +1 -1
  63. package/dist/cli/core/mcp-root.d.ts +14 -1
  64. package/dist/cli/core/mcp-root.d.ts.map +1 -1
  65. package/dist/cli/core/mcp-root.js +72 -1
  66. package/dist/cli/core/mcp-root.js.map +1 -1
  67. package/dist/cli/core/mcp-spec.d.ts.map +1 -1
  68. package/dist/cli/core/mcp-spec.js +3 -2
  69. package/dist/cli/core/mcp-spec.js.map +1 -1
  70. package/dist/cli/core/templates.d.ts.map +1 -1
  71. package/dist/cli/core/templates.js +72 -12
  72. package/dist/cli/core/templates.js.map +1 -1
  73. package/dist/cli/core/upgrade.d.ts +26 -0
  74. package/dist/cli/core/upgrade.d.ts.map +1 -1
  75. package/dist/cli/core/upgrade.js +236 -11
  76. package/dist/cli/core/upgrade.js.map +1 -1
  77. package/dist/cli/shell/components/InputPrompt.d.ts.map +1 -1
  78. package/dist/cli/shell/components/InputPrompt.js +17 -9
  79. package/dist/cli/shell/components/InputPrompt.js.map +1 -1
  80. package/dist/cli/shell/index.js +1 -1
  81. package/dist/cli/shell/index.js.map +1 -1
  82. package/dist/cli-entry.js +28 -11
  83. package/dist/cli-entry.js.map +1 -1
  84. package/package.json +10 -9
  85. package/templates/casting-reference.md +18 -0
  86. package/templates/fact-checker-policy.md +104 -0
  87. package/templates/skills/cli-wiring/SKILL.md +2 -2
  88. package/templates/skills/coordinator-init-mode/SKILL.md +83 -0
  89. package/templates/skills/coordinator-response-mode/SKILL.md +97 -0
  90. package/templates/skills/coordinator-source-of-truth/SKILL.md +45 -0
  91. package/templates/skills/cross-squad/SKILL.md +66 -6
  92. package/templates/skills/cross-squad-communication/SKILL.md +399 -0
  93. package/templates/skills/init-mode/SKILL.md +4 -4
  94. package/templates/skills/personal-squad/SKILL.md +3 -2
  95. package/templates/skills/release-process/SKILL.md +2 -2
  96. package/templates/skills/{squad-commands → squad}/SKILL.md +8 -12
  97. package/templates/skills/squad-help/SKILL.md +97 -0
  98. package/templates/skills/squad-version-check/SKILL.md +9 -0
  99. package/templates/skills/tiered-memory/SKILL.md +31 -44
  100. package/templates/spawn-reference.md +57 -2
  101. package/templates/squad.agent.md.template +204 -180
  102. package/templates/workflows/squad-heartbeat.yml +2 -5
  103. package/templates/workflows/squad-issue-assign.yml +3 -7
  104. package/templates/workflows/squad-triage.yml +3 -11
  105. package/templates/workflows/sync-squad-labels.yml +2 -7
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: "coordinator-source-of-truth"
3
+ description: "The complete file-by-file source-of-truth hierarchy for Squad: which files are authoritative, which are derived/append-only, who may write each one, who may read each one, and the precedence rules when they conflict. Squad coordinator loads this on demand when it needs to resolve a write conflict, decide where a piece of state belongs, or answer a 'who owns this file' question."
4
+ allowedTools: []
5
+ confidence: high
6
+ domain: squad-internals
7
+ source: "Extracted from squad.agent.md as part of the slimming effort (bradygaster/squad#1308). Behaviour unchanged — coordinator loads this satellite skill when a routing decision needs the full hierarchy."
8
+ ---
9
+
10
+ > **Load this skill when:** the coordinator (or any agent) needs to resolve a "where does this state belong?" or "who is allowed to write this file?" question — e.g., when about to write `.squad/decisions.md`, when reviewing whether an agent broke the append-only rule, when answering a user question about Squad's file layout, or when adjudicating a conflict between two files. The short summary in `squad.agent.md` is for routing; this skill is the full reference.
11
+
12
+ ## State backend note
13
+
14
+ Files below marked as **"Derived / append-only"** are **mutable state** — agents access them with runtime state tools (`squad_state_read`, `squad_state_write`, `squad_state_append`, `squad_state_delete`, `squad_state_list`). The runtime decides whether the configured backend stores them on disk, git-native state, or an external provider. Files marked as **"Authoritative"** are **static config** and always live on disk regardless of backend.
15
+
16
+ ## File hierarchy
17
+
18
+ | File | Status | Who May Write | Who May Read |
19
+ |------|--------|---------------|--------------|
20
+ | `.github/agents/squad.agent.md` | **Authoritative governance.** All roles, handoffs, gates, and enforcement rules. | Repo maintainer (human) | Squad (Coordinator) |
21
+ | `.squad/decisions.md` | **Authoritative decision ledger.** Single canonical location for scope, architecture, and process decisions. | Squad (Coordinator) — append only | All agents |
22
+ | `.squad/team.md` | **Authoritative roster.** Current team composition. | Squad (Coordinator) | All agents |
23
+ | `.squad/routing.md` | **Authoritative routing.** Work assignment rules. | Squad (Coordinator) | Squad (Coordinator) |
24
+ | `.squad/ceremonies.md` | **Authoritative ceremony config.** Definitions, triggers, and participants for team ceremonies. | Squad (Coordinator) | Squad (Coordinator), Facilitator agent (read-only at ceremony time) |
25
+ | `.squad/casting/policy.json` | **Authoritative casting config.** Universe allowlist and capacity. | Squad (Coordinator) | Squad (Coordinator) |
26
+ | `.squad/casting/registry.json` | **Authoritative name registry.** Persistent agent-to-name mappings. | Squad (Coordinator) | Squad (Coordinator) |
27
+ | `.squad/casting/history.json` | **Derived / append-only.** Universe usage history and assignment snapshots. | Squad (Coordinator) — append only | Squad (Coordinator) |
28
+ | `.squad/agents/{name}/charter.md` | **Authoritative agent identity.** Per-agent role and boundaries. | Squad (Coordinator) at creation; agent may not self-modify | Squad (Coordinator) reads to inline at spawn; owning agent receives via prompt |
29
+ | `.squad/agents/{name}/history.md` | **Derived / append-only.** Personal learnings. Never authoritative for enforcement. | Owning agent (append only), Scribe (cross-agent updates, summarization) | Owning agent only |
30
+ | `.squad/agents/{name}/history-archive.md` | **Derived / append-only.** Archived history entries. Preserved for reference. | Scribe | Owning agent (read-only) |
31
+ | `.squad/orchestration-log/` | **Derived / append-only.** Agent routing evidence. Never edited after write. | Scribe | All agents (read-only) |
32
+ | `.squad/log/` | **Derived / append-only.** Session logs. Diagnostic archive. Never edited after write. | Scribe | All agents (read-only) |
33
+ | `.squad/templates/` | **Reference.** Format guides for runtime files. Not authoritative for enforcement. | Squad (Coordinator) at init | Squad (Coordinator) |
34
+ | `.squad/rai/policy.md` | **Authoritative RAI policy.** Check categories, terminology standards, and opt-out rules. | Squad (Coordinator) at init; Rai may propose updates via decisions inbox | Rai, All agents (read-only) |
35
+ | `.squad/rai/audit-trail.md` | **Derived / append-only.** RAI review evidence log. Redacted — never contains raw secrets or harmful content. | Rai (append only) | Rai, Squad (Coordinator) |
36
+ | `.squad/fact-checker/policy.md` | **Authoritative verification + Devil's Advocate policy.** Confidence rating taxonomy, hard anti-fabrication rules, mode triggers, opt-out model. | Squad (Coordinator) at init; Fact Checker may propose updates via decisions inbox | Fact Checker, All agents (read-only) |
37
+ | `.squad/fact-checker/audit-trail.md` | **Derived / append-only.** Verification verdicts + DA brief evidence log. Succinct — verdict + citation, never raw source material. | Fact Checker (append only) | Fact Checker, Squad (Coordinator) |
38
+ | `.squad/plugins/marketplaces.json` | **Authoritative plugin config.** Registered marketplace sources. | Squad CLI (`squad plugin marketplace`) | Squad (Coordinator) |
39
+
40
+ ## Rules
41
+
42
+ 1. **If `squad.agent.md` and any other file conflict, `squad.agent.md` wins.** It is the only file with hard governance authority.
43
+ 2. **Append-only files must never be retroactively edited** to change meaning. They are diagnostic and audit-trail material. Corrections go in a new entry that references the prior one.
44
+ 3. **Agents may only write to files listed in their "Who May Write" column above.** Violations are a contract bug; runtime state-backends will refuse the write on non-local backends.
45
+ 4. **Non-coordinator agents may propose decisions** in their responses, but only Squad (Coordinator) records accepted decisions in `.squad/decisions.md`.
@@ -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:
@@ -0,0 +1,399 @@
1
+ ---
2
+ name: "cross-squad-communication"
3
+ description: "Protocol for sending queries, delegating tasks, and sharing context between independent Squad instances across different repositories"
4
+ domain: "multi-repo coordination"
5
+ confidence: "medium"
6
+ source: "Ported from tamirdresher/squad-skills (plugins/cross-squad-communication). Companion to the registry-aware cross-squad skill — this one teaches the actual communication protocols once a peer is discovered. Pattern 0 (synchronous CLI) is the only end-to-end-validated pattern; Patterns 1, 2, 3 are documented from design but require live validation against your own setup before relying on them in production. See the Validation Status section at the bottom of this skill."
7
+ ---
8
+
9
+ ## Context
10
+
11
+ When multiple repositories each have their own Squad (AI team), they need to exchange information: knowledge queries, PR reviews, task delegation, and dependency analysis. Each squad has its own agents, MCP tools, and issue tracker — there is no shared runtime.
12
+
13
+ > **Companion skill — read first:** `cross-squad/SKILL.md` covers **discovery** of peer squads via `squad registry add/list/remove`. This skill picks up after a peer is known and covers the **communication protocols** themselves — the four numbered patterns below: Pattern 0 (synchronous CLI), Pattern 1 (read-only knowledge query), Pattern 2 (git-based async), and Pattern 3 (GitHub-issue-based delegation). A separate non-numbered appendix (Cross-Repo Dependency Scan) is provided as a related analysis tool, not a communication pattern. The two skills are designed to be used together.
14
+
15
+ **When this skill applies:**
16
+ - A squad agent needs information from another squad-enabled repo
17
+ - A task needs to be delegated to another squad
18
+ - Cross-repo dependency analysis is needed
19
+ - PR review requests span repo boundaries
20
+
21
+ **Key constraint:** Each squad has its own runtime, MCP tools, and issue tracker. Cross-squad communication can be **synchronous** (via CLI session targeting the other repo) or **asynchronous** (file-based or issue-based). The coordinator decides which approach fits.
22
+
23
+ ---
24
+
25
+ ## Patterns
26
+
27
+ ### Decision Tree: Choosing the Right Pattern
28
+
29
+ ```
30
+ Is the target repo cloned locally?
31
+ ├─ NO → Use Pattern 3 (Issue-Based) or Pattern 2 (Git-Based Async)
32
+ └─ YES
33
+ ├─ Is this a quick query / knowledge lookup?
34
+ │ └─ YES → Use Pattern 0 (Synchronous CLI) — fastest
35
+ ├─ Does the work need to persist as artifacts?
36
+ │ └─ YES → Use Pattern 2 (Git-Based Async)
37
+ ├─ Is it a long-running analysis or multi-cycle task?
38
+ │ └─ YES → Use Pattern 2 (Git-Based Async)
39
+ └─ Is the target squad's Ralph running?
40
+ ├─ YES → Pattern 2 or 3 (async processing available)
41
+ └─ NO → Pattern 0 (Synchronous CLI) or Pattern 1 (Read-Only)
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Universal rule: every `copilot` spawn into a peer squad MUST pass `--agent squad`
47
+
48
+ The `copilot` CLI accepts `--agent <name>` to select a custom agent (see `copilot --help`). Squad installs ship `.github/agents/squad.agent.md`, which is loaded **only when `--agent squad` is specified**. Without it the spawned session runs as a generic Copilot CLI session that does NOT load the peer's `team.md`, routing, MCP tools, casting, or coordinator behaviour — so you get an off-the-shelf model answering, not the peer's Squad. **Every command example in this skill that spawns `copilot` into a peer repo includes `--agent squad`; do not strip it.**
49
+
50
+ This rule also applies anywhere else you spawn `copilot` into a Squad-initialised repo (not just cross-squad protocols) — e.g., `squad init`'s post-init tip and any automation that invokes the CLI on a squadified folder. The only case where you may omit `--agent` is when resuming an existing session (`copilot --resume <sessionId>`) — the resumed session preserves its original agent context.
51
+
52
+ ---
53
+
54
+ ### Pattern 0: Synchronous CLI Session (Fastest for Interactive Queries)
55
+
56
+ For quick knowledge queries, decision lookups, or short analyses — spawn a Copilot CLI session with the working directory set to the target squad's repo. This lets you send a prompt and get a response within the same session, using the target repo's full context.
57
+
58
+ This is the same technique used by `ralph-watch.ps1`: write the prompt to a temp file, then invoke the CLI with that file as input. The key insight is that setting the working directory to the target repo gives the CLI session access to that squad's `.squad/` metadata, codebase, and conventions.
59
+
60
+ **Protocol:**
61
+ 1. Write prompt to a temp file (avoids argument-splitting issues, as learned in `ralph-watch.ps1`)
62
+ 2. Read the file into a string and invoke `copilot -p <text>` with `-C <directory>` set to the target repo (`-p` takes prompt text, NOT a file path) AND `--agent squad` so the spawned session uses the peer squad's coordinator (without `--agent` you get a generic Copilot CLI session that doesn't load the peer's `team.md`, MCP tools, or skills)
63
+ 3. Receive response in the same session
64
+
65
+ **Invocation:**
66
+ ```powershell
67
+ # Spawn a Copilot CLI session targeting another squad's repo
68
+ $targetRepo = "C:\repos\platform-squad-repo"
69
+ $promptFile = New-TemporaryFile
70
+ @"
71
+ You are working in a Squad-enabled repository.
72
+ Read .squad/team.md and .squad/decisions.md first.
73
+
74
+ [CROSS-SQUAD REQUEST]
75
+ From: research-squad
76
+ Request Type: knowledge_query
77
+ Query: What is the current architecture of the platform? What services does it expose?
78
+ Response Format: Brief structured summary
79
+ "@ | Out-File $promptFile -Encoding utf8
80
+
81
+ # Option A: copilot with prompt file (read file into string; -p takes text, not a path)
82
+ # --agent squad is REQUIRED: the target is another Squad install, so the spawned
83
+ # session must use that squad's coordinator (not a generic Copilot CLI session).
84
+ copilot -C $targetRepo --agent squad -p (Get-Content $promptFile -Raw) --allow-all-tools
85
+
86
+ # Option B: Start-Process for non-blocking (ralph-watch.ps1 style)
87
+ Start-Process pwsh -ArgumentList "-NoProfile -Command `"copilot -C '$targetRepo' --agent squad -p (Get-Content '$promptFile' -Raw) --allow-all-tools`"" -Wait
88
+
89
+ # Option C: Pipe directly (stdin is the prompt text)
90
+ "What is the platform architecture?" | copilot -C $targetRepo --agent squad --allow-all-tools
91
+ ```
92
+
93
+ **When to use synchronous vs async:**
94
+
95
+ | Scenario | Pattern | Why |
96
+ |----------|---------|-----|
97
+ | Quick knowledge query | Synchronous CLI (Pattern 0) | Fast answer, no overhead |
98
+ | "What did you decide about X?" | Synchronous CLI (Pattern 0) | Read decisions.md via the target squad's context |
99
+ | PR review request | Either (Pattern 0 or 2/3) | Sync for quick feedback, async for thorough review |
100
+ | Task delegation (do work in their repo) | Async (Pattern 2 or 3) | Work needs to persist beyond the session |
101
+ | Long-running analysis | Async (Pattern 2) | May take multiple cycles |
102
+ | Target repo not locally cloned | Async (Pattern 3) | Can't set working directory to a remote repo |
103
+
104
+ **The coordinator decides which pattern to use based on:**
105
+ 1. Is the target repo cloned locally? → If yes, sync CLI is available
106
+ 2. Is this a quick query or a long task? → Quick = sync, long = async
107
+ 3. Does the work need to persist? → If yes, use async (creates artifacts)
108
+ 4. Is the target squad's Ralph running? → Needed for async processing
109
+
110
+ **Requirements:**
111
+ - Target repo must be cloned locally (for `copilot -C <directory>`)
112
+ - Target repo must be Squad-initialised (`.squad/config.json` + `.github/agents/squad.agent.md` present), so `--agent squad` resolves to the peer's coordinator
113
+ - Prompt file avoids argument-splitting bugs (see `ralph-watch.ps1` lines 2166-2184)
114
+
115
+ **Response quality:** ⭐⭐⭐⭐⭐ — the CLI session has full context of the target repo, including code, squad metadata, and MCP tools.
116
+
117
+ ### Liveness Protocol for Pattern 0
118
+
119
+ The synchronous CLI session requires monitoring to avoid false timeouts. With 7+ MCP servers initializing and `.squad/` metadata being read, startup can take 30-60 seconds. A hard timeout kills valid sessions before they complete. Instead, monitor the agency session's activity log directory.
120
+
121
+ **Health Check Approach:**
122
+
123
+ Instead of a fixed wall-clock timeout, monitor the agency session log directory for activity:
124
+
125
+ ```powershell
126
+ # The Copilot CLI creates a session log directory at ~/.copilot/logs/.
127
+ # Older `agency` runtimes wrote to ~/.agency/logs/; fall back to that
128
+ # location if the new path doesn't exist yet on the user's machine.
129
+ # e.g., ~/.copilot/logs/session_20260325_071211_57824
130
+ $copilotLogs = "$env:USERPROFILE\.copilot\logs"
131
+ $agencyLogs = "$env:USERPROFILE\.agency\logs"
132
+ $logRoot = if (Test-Path $copilotLogs) { $copilotLogs } elseif (Test-Path $agencyLogs) { $agencyLogs } else { $null }
133
+ if ($logRoot) {
134
+ $logDir = Get-ChildItem $logRoot -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 1
135
+ }
136
+ $lastSize = 0
137
+ $stallCount = 0
138
+
139
+ while ($proc -and -not $proc.HasExited) {
140
+ Start-Sleep -Seconds 15
141
+ $currentSize = (Get-ChildItem $logDir -Recurse -File | Measure-Object -Property Length -Sum).Sum
142
+
143
+ if ($currentSize -eq $lastSize) {
144
+ $stallCount++
145
+ if ($stallCount -ge 4) { # 60s with no progress
146
+ Write-Warning "Session stalled — no log activity for 60s"
147
+ break
148
+ }
149
+ } else {
150
+ $stallCount = 0
151
+ $lastSize = $currentSize
152
+ }
153
+ }
154
+ ```
155
+
156
+ **Progress Indicators (What Counts as "Alive"):**
157
+
158
+ - New files appearing in the session log directory (e.g., `transcript.log`, `mcp-server-logs/`)
159
+ - Log file size increasing (indicates active processing)
160
+ - New or modified `.squad/` files in the target repo (e.g., `decisions/inbox.md`, `identity/history.md`)
161
+ - Process still running and consuming non-idle CPU time
162
+
163
+ **Stall Detection (When to Intervene):**
164
+
165
+ - **No log activity for 60s** → Issue a warning; session may be slow but not hung
166
+ - **No log activity for 120s** → Likely stuck; consider terminating and checking logs
167
+ - **Process exited with non-zero exit code** → Failed; examine `transcript.log` and `stderr` for errors
168
+ - **MCP server connection timeout** → Session blocked waiting for an MCP server response
169
+
170
+ **Recovery Actions When Stalled:**
171
+
172
+ 1. **Check for user input waiting:** Inspect logs for prompts or dialogs (shouldn't happen with `--autopilot`)
173
+ 2. **Check MCP server health:** Review `mcp-server-logs/` for connection errors or timeouts
174
+ 3. **Retry with `--disable-builtin-mcps` flag:** For lightweight queries that don't require MCP tools
175
+ ```powershell
176
+ # Retry without MCP servers — faster startup, limited capability
177
+ copilot -C $targetRepo --agent squad -p (Get-Content $promptFile -Raw) --disable-builtin-mcps --allow-all-tools
178
+ ```
179
+ 4. **Increase timeout threshold:** If MCP server initialization is consistently slow (>90s), raise threshold before declaring stall
180
+
181
+ ---
182
+
183
+ ### Pattern 1: Read-Only Knowledge Query (No CLI Needed)
184
+
185
+ For questions about another squad's architecture, decisions, or current state — read their `.squad/` metadata directly.
186
+
187
+ **Protocol:**
188
+ 1. Read target repo's `.squad/team.md` → get stack, members, issue source
189
+ 2. Read `.squad/decisions.md` → get architectural decisions
190
+ 3. Read `.squad/routing.md` → understand who handles what
191
+ 4. Read `.squad/identity/now.md` → get current focus
192
+ 5. Scan code structure if needed (csproj files, directory layout)
193
+
194
+ **Requirements:**
195
+ - Target repo must be cloned locally or accessible via git
196
+ - No authentication needed beyond git read access
197
+
198
+ **Example:**
199
+ ```powershell
200
+ # Query another squad's architecture
201
+ $targetRepo = "C:\repos\platform-squad-repo"
202
+ Get-Content "$targetRepo\.squad\team.md"
203
+ Get-Content "$targetRepo\.squad\decisions.md"
204
+ Get-Content "$targetRepo\.squad\identity\now.md"
205
+ ```
206
+
207
+ **Response quality:** ⭐⭐⭐⭐ — excellent for structural/architectural questions.
208
+
209
+ ---
210
+
211
+ ### Pattern 2: Async Task Request (Git-Based)
212
+
213
+ For work that needs the target squad to execute (PR reviews, issue analysis, code changes).
214
+
215
+ **Protocol:**
216
+ 1. Create request file in YOUR repo: `.squad/cross-squad/requests/{timestamp}-{target}-{id}.yaml`
217
+ 2. Commit and push
218
+ 3. Target squad's Ralph detects on next cycle
219
+ 4. Target squad processes and writes response to their `.squad/cross-squad/responses/`
220
+ 5. Your Ralph picks up the response
221
+
222
+ **Request File Format:**
223
+ ```yaml
224
+ id: req-2026-06-13-001
225
+ source_squad: research-squad
226
+ source_repo: your-org/research-squad-repo
227
+ target_squad: platform-squad
228
+ target_repo: your-org/platform-squad-repo
229
+ request_type: knowledge_query | pr_review | task_delegation | dependency_check
230
+ priority: high | normal | low
231
+ created_at: 2026-06-13T10:00:00Z
232
+ query: "What is the current architecture of the platform?"
233
+ routing_hint: "lead" # optional — which agent should handle this
234
+ status: pending
235
+ ```
236
+
237
+ **Response File Format:**
238
+ ```yaml
239
+ id: req-2026-06-13-001
240
+ responding_squad: platform-squad
241
+ responding_agent: lead
242
+ responded_at: 2026-06-13T10:15:00Z
243
+ status: completed | partial | rejected
244
+ response: |
245
+ The platform architecture consists of...
246
+ artifacts: [] # optional file paths
247
+ ```
248
+
249
+ ---
250
+
251
+ ### Pattern 3: Issue-Based Delegation (For GitHub-Hosted Repos)
252
+
253
+ For repos on GitHub, use issues with labels as the message bus.
254
+
255
+ **Protocol:**
256
+ 1. Create issue in target repo with label `squad:cross-squad`
257
+ 2. Include source squad identifier and routing hint in issue body
258
+ 3. Target squad's Ralph picks up and routes to appropriate agent
259
+ 4. Response posted as issue comment
260
+ 5. Issue closed when complete
261
+
262
+ **Example:**
263
+ ```bash
264
+ gh issue create \
265
+ --repo your-org/platform-squad-repo \
266
+ --title "[Cross-Squad] Architecture query from research-squad" \
267
+ --body "Source: research-squad\nQuery: What services does the platform expose?\nRouting: lead" \
268
+ --label "squad:cross-squad"
269
+ ```
270
+
271
+ **Limitation:** Only works for repos on GitHub. Other platforms (Azure DevOps, GitLab, etc.) need different approach.
272
+
273
+ ---
274
+
275
+ ### Appendix: Cross-Repo Dependency Scan (Related Analysis Tool — Not a Communication Pattern)
276
+
277
+ > This section is intentionally listed as an appendix rather than "Pattern 4" — it is a one-off analysis utility for discovering how two repos relate, not a protocol the coordinator picks from the decision tree above. The four numbered communication patterns are 0–3.
278
+
279
+ For discovering how two repos relate to each other.
280
+
281
+ **Protocol:**
282
+ 1. Search both repos for mutual references:
283
+ ```powershell
284
+ Select-String -Path (Get-ChildItem $repoA -Recurse -Include "*.md","*.cs","*.json","*.csproj") `
285
+ -Pattern $repoB_name
286
+ Select-String -Path (Get-ChildItem $repoB -Recurse -Include "*.md","*.cs","*.json","*.csproj") `
287
+ -Pattern $repoA_name
288
+ ```
289
+ 2. Check shared NuGet packages / npm packages
290
+ 3. Check shared ADO project or GitHub org
291
+ 4. Document relationship type: code dependency, operational coupling, shared infra
292
+
293
+ ---
294
+
295
+ ## Discovery Protocol
296
+
297
+ Before sending any cross-squad request, verify the target:
298
+
299
+ ```
300
+ 1. Does .squad/team.md exist? → Squad is installed
301
+ 2. What is the issue_source? → GitHub Issues | ADO | Planner
302
+ 3. What agents are active? → Check member status column
303
+ 4. What is the routing table? → Read routing.md
304
+ 5. What is the current focus? → Read identity/now.md
305
+ 6. Is Ralph running? → Check for recent commits by Ralph
306
+ ```
307
+
308
+ If `.squad/team.md` doesn't exist, the repo is not squad-enabled. Fall back to standard human communication.
309
+
310
+ ---
311
+
312
+ ## Platform Compatibility Matrix
313
+
314
+ | Source Issue Tracker | Target Issue Tracker | Mechanism |
315
+ |---------------------|---------------------|-----------|
316
+ | GitHub Issues | GitHub Issues | Issue-based (Pattern 3) |
317
+ | GitHub Issues | ADO Work Items | Git-based (Pattern 2) |
318
+ | GitHub Issues | Planner | Git-based (Pattern 2) |
319
+ | ADO Work Items | GitHub Issues | Issue-based (Pattern 3) via `gh` CLI |
320
+ | ADO Work Items | ADO Work Items | ADO cross-project work items |
321
+ | Any | Any | Git-based (Pattern 2) — universal fallback |
322
+
323
+ ---
324
+
325
+ ## Examples
326
+
327
+ ### Example 1: research-squad queries platform-squad architecture
328
+
329
+ ```powershell
330
+ # Step 1: Read metadata (Pattern 1)
331
+ $target = "C:\repos\platform-squad-repo"
332
+ $team = Get-Content "$target\.squad\team.md" -Raw
333
+ $decisions = Get-Content "$target\.squad\decisions.md" -Raw
334
+
335
+ # Step 2: Extract answer from metadata
336
+ # team.md reveals tech stack and member roles
337
+ # decisions.md reveals architectural choices
338
+
339
+ # Step 3: If deeper analysis needed, create async request (Pattern 2)
340
+ ```
341
+
342
+ ### Example 2: Request PR review from another squad
343
+
344
+ ```yaml
345
+ # .squad/cross-squad/requests/2026-06-13-platform-squad-pr-review.yaml
346
+ id: pr-review-001
347
+ source_squad: research-squad
348
+ target_squad: platform-squad
349
+ request_type: pr_review
350
+ priority: normal
351
+ query: "Review PR #54 — package version fix. Check for correctness."
352
+ routing_hint: "lead"
353
+ status: pending
354
+ ```
355
+
356
+ ---
357
+
358
+ ## Anti-Patterns
359
+
360
+ ### ⚠️ Know when synchronous CLI is NOT the right choice
361
+ ```powershell
362
+ # WRONG — don't use sync CLI for long-running tasks that need artifacts
363
+ copilot -C $targetRepo --agent squad -p (Get-Content $promptFile -Raw) --allow-all-tools
364
+ # If the task creates files, PRs, or takes multiple cycles → use async (Pattern 2 or 3)
365
+
366
+ # WRONG — don't use sync CLI when the target repo isn't cloned locally
367
+ copilot -C "C:\not\cloned\yet" --agent squad --allow-all-tools
368
+ # If the repo isn't available locally → use issue-based delegation (Pattern 3)
369
+ ```
370
+ Synchronous CLI sessions (Pattern 0) are valid for quick queries and knowledge lookups. Use async patterns for work that needs to persist or where the target repo isn't available locally.
371
+
372
+ ### ❌ Don't assume shared MCP tools
373
+ Each squad has its own MCP server instances. You cannot invoke another squad's ADO tools or GitHub tools from your session.
374
+
375
+ ### ❌ Don't skip the discovery step
376
+ Always read `team.md` first. The target squad may use a different issue tracker, have different agents, or be in a different state than expected.
377
+
378
+ ### ❌ Don't send requests to squads without Ralph
379
+ If the target squad doesn't have Ralph (Work Monitor) running, async requests will never be processed. Check for recent Ralph activity first.
380
+
381
+ ### ❌ Don't mix up repo platforms
382
+ Different repos may use GitHub Issues vs Azure DevOps Work Items vs Jira. Check `team.md` / repository metadata for the right tooling before sending requests.
383
+
384
+ ---
385
+
386
+ ## Validation Status
387
+
388
+ This skill was originally drafted against two prototype squad setups (a GitHub-hosted platform squad with ~10 agents and an Azure DevOps-hosted automation squad with ~4 agents). The protocols are platform-agnostic; the examples in this document use generic names so you can substitute your own repos. Patterns 0 and 1 have been exercised end-to-end in those prototypes; Patterns 2 and 3 are documented from design but have not been end-to-end-validated against a live target repo.
389
+
390
+ | Scenario | Result |
391
+ |----------|--------|
392
+ | Knowledge query (read-only) | ✅ Works via Pattern 1 |
393
+ | Step handler discovery | ✅ Works via file scan |
394
+ | PR review (basic) | ⚠️ Partial — git log only, no API |
395
+ | Backlog enumeration | ⚠️ Partial — depends on issue platform |
396
+ | Dependency analysis | ✅ Works via cross-reference scan |
397
+ | CLI invocation (sync) + Liveness Protocol | ✅ Works — session launches successfully; log monitoring prevents false timeouts |
398
+
399
+ **Confidence: MEDIUM** — Synchronous CLI pattern (Pattern 0) validated end-to-end. Liveness protocol provides operational robustness against slow MCP initialization. Git-based async (Pattern 2) and issue-based (Pattern 3) untested end-to-end. Production readiness requires Ralph integration on both sides.
@@ -42,7 +42,7 @@ No team exists yet. Propose one — but **DO NOT create any files until the user
42
42
 
43
43
  5. Use the `ask_user` tool to confirm the roster. Provide choices so the user sees a selectable menu:
44
44
  - **question:** *"Look right?"*
45
- - **choices:** `["Yes, hire this team", "Add someone", "Change a role"]`
45
+ - **choices:** `["Yes, cast this team", "Add someone", "Change a role"]`
46
46
 
47
47
  **⚠️ STOP. Your response ENDS here. Do NOT proceed to Phase 2. Do NOT create any files or directories. Wait for the user's reply.**
48
48
 
@@ -69,7 +69,7 @@ No team exists yet. Propose one — but **DO NOT create any files until the user
69
69
  ```
70
70
  The `union` merge driver keeps all lines from both sides, which is correct for append-only files. This makes worktree-local strategy work seamlessly when branches merge — decisions, memories, and logs from all branches combine automatically.
71
71
 
72
- 7. Say: *"✅ Team hired. Try: '{FirstCastName}, set up the project structure'"*
72
+ 7. Say: *"✅ Team cast. Try: '{FirstCastName}, set up the project structure'"*
73
73
 
74
74
  8. **Post-setup input sources** (optional — ask after team is created, not during casting):
75
75
  - PRD/spec: *"Do you have a PRD or spec document? (file path, paste it, or skip)"* → If provided, follow PRD Mode flow
@@ -87,9 +87,9 @@ The `union` merge driver keeps all lines from both sides, which is correct for a
87
87
  4. User: *"TypeScript CLI tool with GitHub API integration"*
88
88
  5. Coordinator runs casting algorithm → selects "The Usual Suspects" universe
89
89
  6. Proposes: Keaton (Lead), Verbal (Prompt), Fenster (Backend), Hockney (Tester), Scribe, Ralph
90
- 7. Uses `ask_user` with choices → user selects "Yes, hire this team"
90
+ 7. Uses `ask_user` with choices → user selects "Yes, cast this team"
91
91
  8. Coordinator creates `.squad/` structure, initializes casting state, seeds agents
92
- 9. Says: *"✅ Team hired. Try: 'Keaton, set up the project structure'"*
92
+ 9. Says: *"✅ Team cast. Try: 'Keaton, set up the project structure'"*
93
93
 
94
94
  ## Anti-Patterns
95
95
 
@@ -15,8 +15,9 @@ A personal squad is a user-level collection of AI agents that travel with you ac
15
15
  ## Directory Structure
16
16
 
17
17
  ```
18
- ~/.config/squad/personal-squad/ # Linux/macOS
19
- %APPDATA%/squad/personal-squad/ # Windows
18
+ ~/Library/Application Support/squad/personal-squad/ # macOS
19
+ ~/.config/squad/personal-squad/ # Linux
20
+ %APPDATA%/squad/personal-squad/ # Windows
20
21
  ├── agents/
21
22
  │ ├── {agent-name}/
22
23
  │ │ ├── charter.md
@@ -9,7 +9,7 @@ source: "earned"
9
9
  # Release Process
10
10
 
11
11
  > Earned knowledge from the v0.9.0→v0.9.1 and v0.9.4 incidents. Every agent involved in releases MUST read this before starting release work.
12
- > See also: `.copilot/skills/release-process/SKILL.md` for the Copilot-facing runbook.
12
+ > See also: `.github/skills/release-process/SKILL.md` for the Copilot-facing runbook.
13
13
 
14
14
  ## SCOPE
15
15
 
@@ -213,5 +213,5 @@ See `.github/workflows/squad-ci.yml` → `publish-policy` job for implementation
213
213
  - v0.9.4 fixes: PR #1042 (CHANGELOG), PR #1043 (root package.json), PR #1044 (lockfile integrity)
214
214
  - Retro: `.squad/decisions/inbox/surgeon-v091-retrospective.md`
215
215
  - CI audit: `.squad/decisions/inbox/booster-ci-audit.md`
216
- - Copilot-level skill: `.copilot/skills/release-process/SKILL.md`
216
+ - Copilot-level skill: `.github/skills/release-process/SKILL.md`
217
217
  - Playbook: `PUBLISH-README.md` (repo root)
@@ -1,18 +1,14 @@
1
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"]
2
+ name: squad
3
+ description: >-
4
+ Squad's command catalog and interactive menu. Invoke via /squad (slash command) or natural language ("squad commands", "what can squad do", "show me squad options"). Presents categorized operations (Install & Upgrade, Team Management, Issues & PRs, Plugins & Skills, Model & Cost, Sessions & State) as an interactive picker. Routes to the right squad CLI command or the Squad coordinator agent.
5
+ user-invocable: true
6
+ allowedTools: []
11
7
  ---
12
8
 
13
9
  ## Menu Presentation Rules
14
10
 
15
- When the user triggers this skill ("squad commands", "help", "what can squad do", etc.):
11
+ When the user triggers this skill (via `/squad` slash command, "squad commands", "help", "what can squad do", etc.):
16
12
 
17
13
  1. **Category-level menu first.** Present category names as an `ask_user` choice list:
18
14
  ```
@@ -218,9 +214,9 @@ Proceed? (yes / no)
218
214
  ### List Installed Skills
219
215
 
220
216
  - **intent:** list skills, show skills, what skills are installed, skill catalog
221
- - **summary:** List all skills installed in .squad/skills/ and .copilot/skills/
217
+ - **summary:** List all skills installed in .squad/skills/ and .github/skills/
222
218
  - **action:** coordinator
223
- - **command:** Direct Mode — list .squad/skills/ and .copilot/skills/ directories
219
+ - **command:** Direct Mode — list .squad/skills/ and .github/skills/ directories
224
220
  - **args:** (none)
225
221
  - **confirm:** false
226
222