@bradygaster/squad-cli 0.9.6-insider.3 → 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 (144) 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 +92 -6
  15. package/dist/cli/commands/doctor.js.map +1 -1
  16. package/dist/cli/commands/install-hooks.d.ts.map +1 -1
  17. package/dist/cli/commands/install-hooks.js +50 -5
  18. package/dist/cli/commands/install-hooks.js.map +1 -1
  19. package/dist/cli/commands/loop.d.ts.map +1 -1
  20. package/dist/cli/commands/loop.js +7 -5
  21. package/dist/cli/commands/loop.js.map +1 -1
  22. package/dist/cli/commands/migrate-backend.d.ts +36 -5
  23. package/dist/cli/commands/migrate-backend.d.ts.map +1 -1
  24. package/dist/cli/commands/migrate-backend.js +250 -40
  25. package/dist/cli/commands/migrate-backend.js.map +1 -1
  26. package/dist/cli/commands/notes.d.ts +27 -0
  27. package/dist/cli/commands/notes.d.ts.map +1 -0
  28. package/dist/cli/commands/notes.js +222 -0
  29. package/dist/cli/commands/notes.js.map +1 -0
  30. package/dist/cli/commands/plugin.js +3 -3
  31. package/dist/cli/commands/plugin.js.map +1 -1
  32. package/dist/cli/commands/skill.d.ts +31 -0
  33. package/dist/cli/commands/skill.d.ts.map +1 -0
  34. package/dist/cli/commands/skill.js +498 -0
  35. package/dist/cli/commands/skill.js.map +1 -0
  36. package/dist/cli/commands/start.d.ts.map +1 -1
  37. package/dist/cli/commands/start.js +9 -1
  38. package/dist/cli/commands/start.js.map +1 -1
  39. package/dist/cli/commands/state-mcp.d.ts.map +1 -1
  40. package/dist/cli/commands/state-mcp.js +6 -0
  41. package/dist/cli/commands/state-mcp.js.map +1 -1
  42. package/dist/cli/commands/watch/agent-spawn.d.ts +62 -0
  43. package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -0
  44. package/dist/cli/commands/watch/agent-spawn.js +127 -0
  45. package/dist/cli/commands/watch/agent-spawn.js.map +1 -0
  46. package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -1
  47. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +2 -1
  48. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
  49. package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
  50. package/dist/cli/commands/watch/capabilities/execute.js +2 -1
  51. package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
  52. package/dist/cli/commands/watch/capabilities/index.d.ts.map +1 -1
  53. package/dist/cli/commands/watch/capabilities/index.js +2 -0
  54. package/dist/cli/commands/watch/capabilities/index.js.map +1 -1
  55. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
  56. package/dist/cli/commands/watch/capabilities/monitor-email.js +2 -1
  57. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
  58. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
  59. package/dist/cli/commands/watch/capabilities/monitor-teams.js +2 -1
  60. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
  61. package/dist/cli/commands/watch/capabilities/notes-promote.d.ts +11 -0
  62. package/dist/cli/commands/watch/capabilities/notes-promote.d.ts.map +1 -0
  63. package/dist/cli/commands/watch/capabilities/notes-promote.js +124 -0
  64. package/dist/cli/commands/watch/capabilities/notes-promote.js.map +1 -0
  65. package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -1
  66. package/dist/cli/commands/watch/capabilities/retro.js +2 -1
  67. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
  68. package/dist/cli/commands/watch/capabilities/wave-dispatch.d.ts.map +1 -1
  69. package/dist/cli/commands/watch/capabilities/wave-dispatch.js +2 -1
  70. package/dist/cli/commands/watch/capabilities/wave-dispatch.js.map +1 -1
  71. package/dist/cli/commands/watch/index.d.ts.map +1 -1
  72. package/dist/cli/commands/watch/index.js +7 -6
  73. package/dist/cli/commands/watch/index.js.map +1 -1
  74. package/dist/cli/core/cast.d.ts.map +1 -1
  75. package/dist/cli/core/cast.js +84 -0
  76. package/dist/cli/core/cast.js.map +1 -1
  77. package/dist/cli/core/command-help.d.ts +44 -0
  78. package/dist/cli/core/command-help.d.ts.map +1 -0
  79. package/dist/cli/core/command-help.js +401 -0
  80. package/dist/cli/core/command-help.js.map +1 -0
  81. package/dist/cli/core/copilot-invocation.d.ts +57 -0
  82. package/dist/cli/core/copilot-invocation.d.ts.map +1 -0
  83. package/dist/cli/core/copilot-invocation.js +84 -0
  84. package/dist/cli/core/copilot-invocation.js.map +1 -0
  85. package/dist/cli/core/effective-squad-dir.d.ts +33 -0
  86. package/dist/cli/core/effective-squad-dir.d.ts.map +1 -0
  87. package/dist/cli/core/effective-squad-dir.js +37 -0
  88. package/dist/cli/core/effective-squad-dir.js.map +1 -0
  89. package/dist/cli/core/init.d.ts.map +1 -1
  90. package/dist/cli/core/init.js +117 -0
  91. package/dist/cli/core/init.js.map +1 -1
  92. package/dist/cli/core/mcp-root.d.ts +73 -0
  93. package/dist/cli/core/mcp-root.d.ts.map +1 -0
  94. package/dist/cli/core/mcp-root.js +195 -0
  95. package/dist/cli/core/mcp-root.js.map +1 -0
  96. package/dist/cli/core/mcp-spec.d.ts +48 -0
  97. package/dist/cli/core/mcp-spec.d.ts.map +1 -0
  98. package/dist/cli/core/mcp-spec.js +62 -0
  99. package/dist/cli/core/mcp-spec.js.map +1 -0
  100. package/dist/cli/core/npm-registry.d.ts +25 -0
  101. package/dist/cli/core/npm-registry.d.ts.map +1 -0
  102. package/dist/cli/core/npm-registry.js +65 -0
  103. package/dist/cli/core/npm-registry.js.map +1 -0
  104. package/dist/cli/core/templates.d.ts.map +1 -1
  105. package/dist/cli/core/templates.js +77 -30
  106. package/dist/cli/core/templates.js.map +1 -1
  107. package/dist/cli/core/upgrade.d.ts +28 -0
  108. package/dist/cli/core/upgrade.d.ts.map +1 -1
  109. package/dist/cli/core/upgrade.js +249 -18
  110. package/dist/cli/core/upgrade.js.map +1 -1
  111. package/dist/cli/shell/coordinator.d.ts.map +1 -1
  112. package/dist/cli/shell/coordinator.js +9 -3
  113. package/dist/cli/shell/coordinator.js.map +1 -1
  114. package/dist/cli/shell/index.d.ts.map +1 -1
  115. package/dist/cli/shell/index.js +12 -6
  116. package/dist/cli/shell/index.js.map +1 -1
  117. package/dist/cli/shell/lifecycle.d.ts.map +1 -1
  118. package/dist/cli/shell/lifecycle.js +12 -7
  119. package/dist/cli/shell/lifecycle.js.map +1 -1
  120. package/dist/cli/shell/session-store.d.ts +4 -4
  121. package/dist/cli/shell/session-store.d.ts.map +1 -1
  122. package/dist/cli/shell/session-store.js +11 -11
  123. package/dist/cli/shell/session-store.js.map +1 -1
  124. package/dist/cli-entry.js +125 -46
  125. package/dist/cli-entry.js.map +1 -1
  126. package/package.json +4 -3
  127. package/scripts/patch-esm-imports.mjs +3 -1
  128. package/templates/after-agent-reference.md +2 -2
  129. package/templates/fact-checker-policy.md +104 -0
  130. package/templates/scribe-charter.md +1 -1
  131. package/templates/skills/cross-squad/SKILL.md +66 -6
  132. package/templates/skills/cross-squad-communication/SKILL.md +399 -0
  133. package/templates/skills/fact-checking/SKILL.md +61 -0
  134. package/templates/skills/release-process/SKILL.md +2 -2
  135. package/templates/skills/{squad-commands → squad}/SKILL.md +6 -10
  136. package/templates/skills/squad-help/SKILL.md +97 -0
  137. package/templates/skills/squad-version-check/SKILL.md +9 -0
  138. package/templates/skills/tiered-memory/SKILL.md +31 -44
  139. package/templates/spawn-reference.md +1 -2
  140. package/templates/squad.agent.md.template +141 -18
  141. package/templates/workflow-wiring-appendix-a-code-reviewer.md +131 -0
  142. package/templates/workflow-wiring-appendix-b-documenter.md +140 -0
  143. package/templates/workflow-wiring-guide.md +276 -0
  144. package/templates/workflows/squad-heartbeat.yml +167 -167
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: "squad-help"
3
+ description: "How to actually use Squad — Squad is a custom Copilot agent (invoked via the task tool with agent_type='Squad'), not a skill. This file explains the right invocation paths for setting up a team, listing squad commands, and initializing Squad in a new project."
4
+ allowedTools: []
5
+ confidence: high
6
+ domain: squad-onboarding
7
+ ---
8
+
9
+ # Skill: squad-help
10
+
11
+ > **Quick reference.** If you're reading this because a user said "use squad" or "squad" or "set up a squad", you're in the right place — read on for the correct invocation paths.
12
+
13
+ ---
14
+
15
+ ## Squad is a custom agent, not a skill
16
+
17
+ The Squad framework registers a **custom Copilot CLI agent** at `.github/agents/squad.agent.md`. The agent is named **`Squad`** and its description is *"Your AI team. Describe what you're building, get a team of specialists that live in your repo."*
18
+
19
+ Copilot CLI agents and skills are different things:
20
+
21
+ | Thing | How to invoke | Example |
22
+ |---|---|---|
23
+ | **Skill** | `skill(name)` tool call or natural-language match | `skill(squad-commands)` |
24
+ | **Agent** | `task` tool with `agent_type=<name>` | `task(name="...", agent_type="Squad", prompt="...")` |
25
+ | **Slash command** | Built-in CLI keyword | `/agent`, `/skills`, `/mcp` |
26
+
27
+ Calling `skill(Squad)` will fail with *"Skill not found: Squad"* because Squad is the agent, not a skill. (`/squad` as a slash command also does not exist — only built-in CLI keywords like `/agent`, `/skills`, `/mcp` are slash commands. There's no way to map a skill name to a slash command without a Copilot CLI feature change.)
28
+
29
+ ---
30
+
31
+ ## How to actually use Squad
32
+
33
+ Pick the path that matches the user's intent:
34
+
35
+ ### A) Invoke the Squad coordinator agent (most common)
36
+
37
+ The Squad coordinator orchestrates a team of specialists. It routes work to the right agent, scaffolds a team if none exists, and enforces handoffs.
38
+
39
+ ```text
40
+ task(
41
+ name="<short-task-name>",
42
+ agent_type="Squad",
43
+ prompt="<what you want the team to do>"
44
+ )
45
+ ```
46
+
47
+ Use this when the user says things like:
48
+ - *"Use Squad to build X"*
49
+ - *"Set up an AI team for this project"*
50
+ - *"Have the Squad coordinator design Y"*
51
+ - *"Spawn Squad"* / *"Squad, help me with ..."*
52
+
53
+ ### B) See what Squad commands exist
54
+
55
+ The `squad-commands` skill is a categorized catalog of common Squad operations. The coordinator presents it as an interactive menu.
56
+
57
+ Trigger by natural-language match: `"squad commands"`, `"what can squad do"`, `"show me squad options"`, `"slash commands"`, `"what commands are available"`.
58
+
59
+ Use this when the user says things like:
60
+ - *"What can Squad do?"*
61
+ - *"Show me the squad commands"*
62
+ - *"squad help"*
63
+
64
+ ### C) Initialize Squad in a fresh project
65
+
66
+ `squad init` is a **shell command**, not a tool call. The user runs it in their terminal in a project that has no `.squad/` directory yet.
67
+
68
+ ```bash
69
+ squad init
70
+ ```
71
+
72
+ Do **not** try to invoke this from inside an existing Copilot session — `.squad/` is already initialized if you're reading this file.
73
+
74
+ ---
75
+
76
+ ## What NOT to do
77
+
78
+ - ❌ Do not call `skill(Squad)`, `skill(squad)`, or `skill(squad-coordinator)` — Squad is not a skill.
79
+ - ❌ Do not type `/squad` expecting a slash command — slash commands are CLI keywords, not skill names. Use `/agent` (browse) or invoke the `Squad` agent via the `task` tool.
80
+ - ❌ Do not call `task(agent_type="Squad", …)` for tiny tasks the current agent can handle directly. Squad is for work that needs orchestration; trivial edits do not.
81
+
82
+ ---
83
+
84
+ ## How this skill was discovered
85
+
86
+ This skill ships from the Squad SDK templates and is wired into `MANIFEST_SKILL_NAMES`. It lives at `.copilot/skills/squad-help/SKILL.md` so the Copilot CLI's `/skills` loader picks it up alongside the other bundled Squad skills.
87
+
88
+ If you removed this skill on purpose, the model will fall back to its own reasoning and may make the lookup mistakes described above.
89
+
90
+ ---
91
+
92
+ ## See also
93
+
94
+ - `.github/agents/squad.agent.md` — the actual Squad coordinator agent
95
+ - `.copilot/skills/squad-commands/SKILL.md` — the command catalog
96
+ - `.copilot/skills/squad-conventions/SKILL.md` — conventions for working on the Squad codebase itself
97
+ - `.copilot/skills/squad-version-check/SKILL.md` — version-stamping mechanics
@@ -1,3 +1,12 @@
1
+ ---
2
+ name: "squad-version-check"
3
+ description: "Internals of how @bradygaster/squad-cli stamps its version, how `squad upgrade` works (what it preserves vs overwrites), and how to probe the npm registry for the latest version from a coordinator prompt."
4
+ allowedTools: []
5
+ confidence: medium
6
+ domain: squad-internals
7
+ source: "Discovered by Data; validated in bradygaster/squad#1173 recon (2026-05-26)."
8
+ ---
9
+
1
10
  # SKILL: Squad CLI Internals — Version Stamping & Upgrade Mechanics
2
11
 
3
12
  **Confidence:** medium
@@ -1,33 +1,35 @@
1
1
  ---
2
2
  name: tiered-memory
3
- description: Three-tier agent memory model (hot/cold/wiki) for 20-55% context reduction per spawn
3
+ description: Three-tier agent memory model (hot/cold/wiki) for context reduction per spawn
4
4
  domain: memory-management, performance
5
- confidence: high
6
- source: earned (production measurements in tamirdresher/tamresearch1, 34-74KB baseline payloads)
5
+ confidence: design (runtime not yet implemented)
6
+ source: design proposal
7
7
  ---
8
8
 
9
9
  # Skill: Tiered Agent Memory
10
10
 
11
+ > **Status (v0.10.0):** This skill describes a **design proposal**, not a shipped runtime. Skill files install via `squad init`/`upgrade`, but the underlying tier scaffolding (`.squad/memory/hot/`, `cold/`, `wiki/`), Scribe promotion logic, and spawn-template tier-aware reads are tracked in [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264). Until those land, agents continue to load full `history.md` + `decisions.md` on every spawn.
12
+
11
13
  ## Overview
12
14
 
13
- Squad agents currently load their full context history on every spawn, resulting in 34–74KB payloads per agent (8,800–18,500 tokens). Measurement shows 82–96% of that context is "old noise" information that is no longer relevant to the current task. The Tiered Agent Memory skill introduces a three-tier memory model that eliminates this bloat, achieving 20–55% context reduction per spawn in production.
15
+ Squad agents today load their full context history on every spawn, which grows unboundedly across sessions. The Tiered Agent Memory model proposes a three-tier separation so agents only load the bytes that are actually relevant to the current task, with older context kept available on demand.
14
16
 
15
17
  ---
16
18
 
17
19
  ## Memory Tiers
18
20
 
19
21
  ### 🔥 Hot Tier — Current Session Context
20
- - **Size target:** ~2–4KB
22
+ - **Size target:** keep small (~2–4KB typical)
21
23
  - **Load policy:** Always loaded. Every spawn includes hot memory by default.
22
24
  - **Contents:** Current task description, active decisions made this session, immediate blockers, last 3–5 actions taken, who you are talking to right now.
23
25
  - **Lifetime:** Current session only. Discarded after session ends (Scribe promotes relevant parts to Cold).
24
26
  - **Purpose:** Provide immediate task context without any latency or load decision.
25
27
 
26
28
  ### ❄️ Cold Tier — Summarized Cross-Session History
27
- - **Size target:** ~8–12KB
29
+ - **Size target:** larger summary, not full transcript (~8–12KB typical)
28
30
  - **Load policy:** Load on demand. Include only when the task explicitly needs history.
29
31
  - **Contents:** Summarized past sessions (compressed by Scribe), cross-session decisions, recurring patterns, unresolved issues from prior work.
30
- - **Lifetime:** 30 days rolling window. After 30 days, Scribe promotes to Wiki tier.
32
+ - **Lifetime:** Rolling window (default proposal: 30 days). Eligible entries are then promoted to Wiki.
31
33
  - **Purpose:** Answer "what have we tried before?" and "what was decided?" without replaying full transcripts.
32
34
  - **How to include:** Pass `--include-cold` in spawn template or add `## Cold Memory` section.
33
35
 
@@ -89,49 +91,34 @@ See: .squad/memory/wiki/{topic}.md
89
91
 
90
92
  ---
91
93
 
92
- ## Measurement Data
93
-
94
- Baseline measurements from tamirdresher/tamresearch1 production runs (June 2025):
95
-
96
- | Agent | Total Context | Old Noise % | Hot-Only Size | Savings |
97
- |-------|--------------|-------------|---------------|---------|
98
- | Picard (Lead) | 74KB / 18.5K tokens | 96% | ~3KB | 55% |
99
- | Scribe | 52KB / 13K tokens | 91% | ~4KB | 48% |
100
- | Data | 43KB / 10.7K tokens | 88% | ~3.5KB | 42% |
101
- | Ralph | 38KB / 9.5K tokens | 85% | ~3KB | 38% |
102
- | Worf | 34KB / 8.5K tokens | 82% | ~3KB | 20% |
103
-
104
- **Average savings: 20–55% per spawn** with Hot-only loading. Cold + Wiki on-demand adds ~2–8KB when needed, still well below current baselines.
105
-
106
- ---
107
-
108
- ## Integration with Scribe Agent
94
+ ## Integration with Scribe Agent (design — not yet implemented)
109
95
 
110
- Scribe is the memory coordinator for this system. It automates tier promotion:
96
+ Scribe is the proposed memory coordinator for this system. Once the runtime lands, Scribe will:
111
97
 
112
- 1. **End of session:** Scribe compresses Hot → Cold summary (keeps ~10% of session verbosity)
113
- 2. **After 30 days:** Scribe promotes Cold → Wiki for decisions/facts that aged into stable knowledge
114
- 3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session using `scribe:wiki-write`
98
+ 1. **End of session:** Compress Hot → Cold summary (target: ~10% of session verbosity)
99
+ 2. **Aged cold entries:** Promote Cold → Wiki for decisions/facts that aged into stable knowledge
100
+ 3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session
115
101
 
116
- See Scribe charter: `.squad/agents/scribe/charter.md`
102
+ Until then, see the Scribe charter for current behavior: `.squad/agents/scribe/charter.md`
117
103
 
118
104
  ---
119
105
 
120
- ## Implementation Checklist
106
+ ## Implementation Checklist (tracked in #1264)
121
107
 
122
108
  - [ ] Scribe writes Hot context file at session start (`.squad/memory/hot/{agent}.md`)
123
109
  - [ ] Scribe compresses and writes Cold summary at session end
124
110
  - [ ] Spawn templates default to Hot-only
125
111
  - [ ] Coordinators add `--include-cold` / `--include-wiki` flags as needed
126
112
  - [ ] Wiki entries stored in `.squad/memory/wiki/`
127
- - [ ] Cold entries stored in `.squad/memory/cold/` with 30-day TTL
113
+ - [ ] Cold entries stored in `.squad/memory/cold/` with rolling TTL
128
114
 
129
115
  ---
130
116
 
131
117
  ## References
132
118
 
133
- - Upstream issue: bradygaster/squad#600
134
- - Production data: tamirdresher/tamresearch1 (June 2025)
119
+ - Tracking issue: [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264) — installation gap + runtime status
120
+ - Original design spike: [bradygaster/squad#686](https://github.com/bradygaster/squad/issues/686) — tiered memory implementation plan
121
+ - Related: [bradygaster/squad#600](https://github.com/bradygaster/squad/issues/600) — context payload growth
135
122
 
136
123
  ---
137
124
 
@@ -162,7 +149,7 @@ Use this template when spawning any Squad agent. By default it loads **Hot tier
162
149
 
163
150
  ### 🔥 Hot (always included)
164
151
 
165
- > Paste current session context here (2–4KB max):
152
+ > Paste current session context here (~2–4KB target):
166
153
 
167
154
  ```
168
155
  Current task: {task_description}
@@ -178,12 +165,12 @@ Talking to: {current_interlocutor}
178
165
 
179
166
  > Load on demand. Do not inline unless specifically needed.
180
167
 
181
- Summarized cross-session history is at:
168
+ Summarized cross-session history is at:
182
169
  `.squad/memory/cold/{agent-name}.md`
183
170
 
184
171
  Include when:
185
172
  - Resuming interrupted work
186
- - Debugging a recurring issue
173
+ - Debugging a recurring issue
187
174
  - "What have we tried before?"
188
175
 
189
176
  **To load cold memory, add this section and fetch the file before spawning:**
@@ -218,17 +205,17 @@ Include when:
218
205
  ## Escalation
219
206
 
220
207
  If blocked or uncertain:
221
- - Architecture questions → @picard
222
- - Security concerns → @worf
223
- - Infrastructure/deployment → @belanna
224
- - Memory/history questions → @scribe
208
+ - Architecture questions → @picard
209
+ - Security concerns → @worf
210
+ - Infrastructure/deployment → @belanna
211
+ - Memory/history questions → @scribe
225
212
 
226
213
  ---
227
214
 
228
215
  ## Notes
229
216
 
230
- - Hot tier is always included and should stay under 4KB
231
- - Cold adds ~8–12KB; only include when history is relevant
217
+ - Hot tier is always included; keep it focused
218
+ - Cold adds a summary; only include when history is relevant
232
219
  - Wiki adds variable size; only include specific relevant docs
233
- - See `skills/tiered-memory/SKILL.md` for full tier reference
234
- - See `docs/tiered-memory-guide.md` for wiring instructions
220
+ - Runtime backing is tracked in [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264) — until those changes land, this skill is design-only and agents continue to load full history.md + decisions.md on every spawn
221
+
@@ -81,8 +81,7 @@ prompt: |
81
81
  Read `decisions.md` with `squad_state_read` when state tools are available; otherwise fall back to `.squad/decisions.md`.
82
82
  If .squad/identity/wisdom.md exists, read it before starting work.
83
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).
84
+ Check project skill directories (.squad/skills/, .github/skills/, .copilot/skills/, .claude/skills/, .agents/skills/) for any SKILL.md the coordinator attached to your prompt.
86
85
  Read any relevant SKILL.md files before working.
87
86
 
88
87
  ⚠️ WORK FRESHNESS: When determining what to work on:
@@ -53,13 +53,14 @@ No team exists yet. Propose one — but **DO NOT create any files until the user
53
53
  1. **Identify the user.** Run `git config user.name` to learn who you're working with. Use their name in conversation (e.g., *"Hey {user}, what are you building?"*). Store their name (NOT email) in `team.md` under Project Context. **Never read or store `git config user.email` — email addresses are PII and must not be written to committed files.**
54
54
  2. Ask: *"What are you building? (language, stack, what it does)"*
55
55
  3. **Cast the team.** Before proposing names, run the Casting & Persistent Naming algorithm (see that section):
56
- - Determine team size (typically 4–5 + Scribe).
56
+ - Determine team size: pick **4–5 cast (user-domain) agents**, then add the **4 always-on built-ins** (Scribe + Ralph + Rai + Fact Checker — see their dedicated sections below). So a typical fresh squad has **8–9 total roster entries**, not 4–5.
57
57
  - Determine assignment shape from the user's project description.
58
58
  - Derive resonance signals from the session and repo context.
59
59
  - Select a universe. Allocate character names from that universe.
60
60
  - Scribe is always "Scribe" — exempt from casting.
61
61
  - Ralph is always "Ralph" — exempt from casting.
62
62
  - Rai is always "Rai" — exempt from casting.
63
+ - Fact Checker is always "Fact Checker" — exempt from casting (same pattern as Scribe / Ralph / Rai).
63
64
  4. Propose the team with their cast names. Example (names will vary per cast):
64
65
 
65
66
  ```
@@ -128,7 +129,19 @@ The `union` merge driver keeps all lines from both sides, which is correct for a
128
129
 
129
130
  **On every session start:** Run `git config user.name` to identify the current user, and **resolve the team root** (see Worktree Awareness). Store the team root — all `.squad/` paths must be resolved relative to it. Resolve `CURRENT_DATETIME` once from the `<current_datetime>` value in your system context. Sanity-check that it is a real ISO-like timestamp, not placeholder text, with a plausible year and timezone (`Z` or an offset). If the system value is missing or implausible, run a local date command and use that result instead (`date +"%Y-%m-%dT%H:%M:%S%z"` on macOS/Linux, or `Get-Date -Format o` in PowerShell). Pass the team root and the resolved literal current datetime into every spawn prompt as `TEAM_ROOT` and `CURRENT_DATETIME` respectively. Never pass placeholder text for `CURRENT_DATETIME`. Pass the current user's name into every agent spawn prompt and Scribe log so the team always knows who requested the work. Check `.squad/identity/now.md` if it exists — it tells you what the team was last focused on. Update it if the focus has shifted.
130
131
 
131
- **Resolve state backend:** Read `.squad/config.json` (at the resolved TEAM_ROOT) and check the `stateBackend` field. Valid values: `"worktree"` (default), `"git-notes"`, `"orphan"`, `"two-layer"`. Store as `STATE_BACKEND` and pass it into every spawn prompt. This determines how agents read and write mutable state (history, decisions, logs). Static config (charters, team.md, routing.md) always lives on disk regardless of backend. The `"two-layer"` option combines git-notes (commit-scoped annotations) with orphan branch (permanent state) — see the blog post for the full architecture.
132
+ **Resolve state backend:** Read `.squad/config.json` (at the resolved TEAM_ROOT) and check the `stateBackend` field. Valid values: `"local"` (default), `"orphan"`, `"two-layer"`. Legacy alias: `"worktree"` maps to `"local"`. Deprecated: `"git-notes"` maps to `"two-layer"` with a deprecation warning. Store as `STATE_BACKEND` and pass it into every spawn prompt. This determines how agents read and write mutable state (history, decisions, logs). Static config (charters, team.md, routing.md) always lives on disk regardless of backend. The `"two-layer"` option combines git-notes (commit-scoped annotations) with orphan branch (permanent state) — see the blog post for the full architecture.
133
+
134
+ **State-backend handshake — MANDATORY on every session before any state mutation (bradygaster/squad#1305):**
135
+
136
+ For all backends EXCEPT `"local"` / `"worktree"`, the runtime owns persistence and you MUST NOT touch `.squad/decisions.md`, `.squad/decisions/inbox/`, `.squad/agents/*/history.md`, `.squad/casting/*.json`, `.squad/identity/*.md`, or `.squad/memory/*` paths via `create` / `edit` / `write_file` tools. Those writes either fail at the pre-commit hook or create phantom state the runtime overwrites at next read — a contract violation that produces silent data loss.
137
+
138
+ The `squad_state_*` and `memory.*` tools that own persistence are exposed via the `squad_state` MCP server (declared in `.mcp.json`). Copilot CLI may load MCP tools **lazily** — they are not always advertised in your initial function list at session start. You MUST proactively confirm they are reachable:
139
+
140
+ 1. If `STATE_BACKEND ∈ {"local", "worktree"}`: file ops on `.squad/` are valid; skip the probe.
141
+ 2. Otherwise (backend is `orphan`, `two-layer`, or `git-notes`): probe for `squad_state_health` (or any `squad_state_*` / `memory.*` tool) using whatever tool-discovery mechanism your runtime exposes (e.g. `tool_search_tool_regex` in Copilot CLI). If you can locate the tool, call `squad_state_health` once to confirm it answers; on success, treat the bridge as available for the rest of the session.
142
+ 3. **If the probe fails** (tool not found, or `squad_state_health` errors): **HALT** before any state write. Tell the user verbatim: *"Squad's runtime state bridge is missing for backend `{STATE_BACKEND}`. The `squad_state` MCP server in `.mcp.json` is not reachable in this Copilot session. Restart Copilot CLI so `.mcp.json` is loaded, or change `stateBackend` to `local` in `.squad/config.json`."* — and stop until the user acknowledges. Do not silently fall back to raw file ops.
143
+
144
+ This handshake runs **once per session**, not per spawn. Cache the result.
132
145
 
133
146
  **⚡ Context caching:** After the first message in a session, `team.md`, `routing.md`, and `registry.json` are already in your context. Do NOT re-read them on subsequent messages — you already have the roster, routing rules, and cast names. Only re-read if the user explicitly modifies the team (adds/removes members, changes routing).
134
147
 
@@ -256,28 +269,49 @@ The `name` parameter generates the human-readable agent ID shown in the tasks pa
256
269
 
257
270
  **When you detect a directive:**
258
271
 
259
- 1. Capture the directive with the runtime state tools when available:
260
- - Prefer `squad_state_write` to write `decisions/inbox/copilot-directive-{timestamp}.md` using this format:
272
+ 1. Capture the directive with governed memory tools when available:
273
+ - Prefer `memory.write` with class `decision` to persist the directive through the governed pipeline:
261
274
  ```
262
- ### {timestamp}: User directive
263
- **By:** {user name} (via Copilot)
264
- **What:** {the directive, verbatim or lightly paraphrased}
265
- **Why:** User request — captured for team memory
275
+ memory.write({
276
+ class: "decision",
277
+ key: "copilot-directive-{timestamp}",
278
+ content: "### {timestamp}: User directive\n**By:** {user name} (via Copilot)\n**What:** {the directive, verbatim or lightly paraphrased}\n**Why:** User request — captured for team memory"
279
+ })
266
280
  ```
281
+ - If `memory.write` is not available, fall back to `squad_decide` or `squad_state_write` to `decisions/inbox/copilot-directive-{timestamp}.md`.
267
282
  - Do **not** run `git notes`, checkout `squad-state`, or manually commit mutable `.squad/` state. The runtime owns state persistence.
268
283
  2. Acknowledge briefly: `"📌 Captured. {one-line summary of the directive}."`
269
284
  3. If the message ALSO contains a work request, route that work normally after capturing. If it's directive-only, you're done — no agent spawn needed.
270
285
 
271
286
  ### Memory Governance Tools
272
287
 
273
- When memory tools are available, use them before writing durable memory by hand:
288
+ The `memory.*` tools share the same `squad_state` MCP server as `squad_state_*` (they're aliases in the same registry — see `packages/squad-cli/src/cli/commands/state-mcp.ts`). After the state-backend handshake above confirms the bridge is reachable, prefer governed memory tools for durable writes:
274
289
 
275
290
  - Classify candidate memories with `memory.classify`.
276
291
  - Persist approved durable facts, decisions, and policies with `memory.write`.
277
292
  - Search governed memory with `memory.search` before relying only on raw file search.
278
293
  - Promote, delete, and audit governed entries with `memory.promote`, `memory.delete`, and `memory.audit`.
279
294
 
280
- If memory tools are not available, use runtime state tools for durable Squad state when present. In MCP sessions these are exposed as `squad_state_read`, `squad_state_write`, `squad_state_append`, `squad_state_delete`, `squad_state_list`, and `squad_state_health` aliases. Only fall back to local `.squad/` file writes when `STATE_BACKEND` is `worktree`/`local` and no runtime state tool exists. For `git-notes`, `orphan`, or `two-layer`, do not hand-write mutable state; report that the `squad_state` MCP/runtime state bridge is missing. Never claim provider-backed Copilot Memory, semantic indexing, or remote deletion unless a configured tool or CLI bridge performed the operation. External semantic memory is opt-in; forbidden or transient content must not be persisted.
295
+ If `memory.*` is not present in the bridge (older Squad versions before the bridge landed) but `squad_state_*` is, use `squad_state_*` directly. Both are governed paths.
296
+
297
+ **HARD RULE — Backend contract enforcement:** If `STATE_BACKEND ∈ {"orphan", "two-layer", "git-notes"}` AND the state-backend handshake (above) did NOT confirm reachable tools, you MUST NOT write to ANY of these paths via `create` / `edit` / `write_file`:
298
+
299
+ - `.squad/decisions.md`
300
+ - `.squad/decisions/inbox/**`
301
+ - `.squad/agents/*/history.md`
302
+ - `.squad/casting/*.json`
303
+ - `.squad/identity/*.md`
304
+ - `.squad/memory/**`
305
+ - `.squad/orchestration-log/**`
306
+ - `.squad/log/**`
307
+ - `.squad/rai/audit-trail.md`
308
+ - `.squad/fact-checker/audit-trail.md`
309
+
310
+ These are runtime-managed paths under non-local backends. Hand-writing creates phantom state. The pre-commit hook will catch it and fail the user; even if it didn't, the runtime overwrites the file at next read. Report the missing bridge and halt instead.
311
+
312
+ For `STATE_BACKEND ∈ {"local", "worktree"}`, file writes to `.squad/` are valid because the local backend IS the filesystem.
313
+
314
+ **External memory:** Never claim provider-backed Copilot Memory, semantic indexing, or remote deletion unless a configured tool or CLI bridge performed the operation. External semantic memory is opt-in; forbidden or transient content must not be persisted.
281
315
 
282
316
  ### Routing
283
317
 
@@ -295,17 +329,31 @@ The routing table determines **WHO** handles work. After routing, use Response M
295
329
  | PRD intake ("here's the PRD", "read the PRD at X", pastes spec) | Follow PRD Mode (see that section) |
296
330
  | Human member management ("add {name} as PM", routes to human) | Follow Human Team Members (see that section) |
297
331
  | Ralph commands ("Ralph, go", "keep working", "Ralph, status", "Ralph, idle") | Follow Ralph — Work Monitor (see that section) |
298
- | "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.copilot/skills/squad-commands/SKILL.md`, present categorized menu (see squad-commands skill) |
332
+ | "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.github/skills/squad/SKILL.md`, present categorized menu (see squad skill). Users can also invoke this directly via `/squad`. |
299
333
  | "upgrade squad", "update squad", "what's new in squad", "install the update" | Run upgrade flow per `.squad/templates/session-init-reference.md` |
334
+ | User says "spawn a squad", "another squad", "two squads", "second squad", "fan out to squads", "delegate to a squad", or any phrasing that treats "squad" as a unit to spawn or address | This is the Squad-PRODUCT concept (a peer with its own `.squad/`), NOT generic English "team" or "group". **Before any `task` spawn**, invoke the `skill` tool on `cross-squad` (discovery via registry/upstream) AND `cross-squad-communication` (sync CLI / git-async / GH-issue protocols) to load the full peer-squad workflow. Then delegate via Pattern 0/1/2/3 — NOT by fanning out raw `task` agents inside your own coordinator context. **Default = literal Squad install.** Calling `task` sub-agents "squad-alpha" / "squad-beta" does NOT make them squads — that is the explicit anti-pattern. **If the request is ambiguous** (could be either "two real `.squad/` installs" or "two ad-hoc groups of agents"), you MUST `ask_user` with a 2-choice prompt — `["Real squads — separate .squad/ per squad (heavier, persistent)", "Ad-hoc agents — one-shot task dispatch (lighter, ephemeral)"]` — and never silently pick the cheaper option. If the peer doesn't exist yet, walk the user through `squad init` in a separate directory or `squad registry add` first. |
300
335
  | Rai commands ("Rai, review this", "RAI check", "content safety review") | Follow Rai — RAI Reviewer (see that section) |
301
336
  | General work request | Check routing.md, spawn best match + any anticipatory agents |
302
337
  | Quick factual question | Answer directly (no spawn) |
303
338
  | Ambiguous | Pick the most likely agent; say who you chose |
304
339
  | Multi-agent task (auto) | Check `ceremonies.md` for `when: "before"` ceremonies whose condition matches; run before spawning work |
305
340
 
306
- **Skill-aware routing:** Before spawning, check BOTH skill directories for skills relevant to the task domain:
307
- 1. `.copilot/skills/` — **Copilot-level skills.** Foundational process knowledge (release process, git workflow, reviewer protocol, etc.). These are the coordinator's own playbook — check first.
308
- 2. `.squad/skills/` — **Team-level skills.** Patterns and practices agents discovered during work.
341
+ <!-- Squad scans 5 project skill directories: Copilot CLI's 3 official project paths (.github/skills/, .claude/skills/, .agents/skills/) per https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills — plus Squad's 2 conventions .squad/skills/ (team-earned) and .copilot/skills/ (legacy install path; new installs use .github/skills/ which is Copilot CLI's canonical custom-skills location). Keep this list in sync with the linked docs when Copilot CLI adds new official paths. -->
342
+ **Skill-aware routing:** Before spawning, check ALL project skill directories in precedence order for skills relevant to the task domain:
343
+
344
+ **Hard trigger — keyword-to-skill match (do this FIRST, before any spawn or task call):** If any word in the user's request matches the name of an installed skill (e.g., "squad" → `cross-squad` and/or `cross-squad-communication`, "reflect" → `reflect`, "ceremony" → the matching ceremony skill, "fact-check" → `fact-checking`, "release" → `release-process`), you MUST invoke the `skill` tool to fully load that skill BEFORE designing your approach or selecting agents. The one-line description in the discovery list is for discovery only — it is NOT sufficient to act on. Read the full SKILL.md, then route. This rule applies whether or not the request also matches a routing-table row above; when both apply, load the skill first, then execute the routing-table action. Failure mode this rule closes: a coordinator that sees "squad" in the prompt, treats it as generic English, and fans out raw `task` agents instead of invoking the `cross-squad-communication` peer-delegation protocol.
345
+
346
+ 1. `.squad/skills/` — **Team-earned skills** (highest precedence). Patterns captured by agents during work; a team-written override beats any generic version.
347
+ 2. `.github/skills/` — **Project playbook** (Copilot CLI's canonical custom-skills location). Human-curated process knowledge: release workflows, git conventions, reviewer protocols. Sits alongside `.github/workflows/` and `.github/copilot-instructions.md`. `squad init` and `squad upgrade` install Squad's bundled skills here.
348
+ 3. `.copilot/skills/` — **Legacy install path** (pre-1304). Older squads may have skills here; `squad upgrade` migrates them to `.github/skills/`. Still scanned for any user-added or unmigrated skills.
349
+ 4. `.claude/skills/` — **Claude-ecosystem skills.** Vendor-specific path; less common in multi-tool projects.
350
+ 5. `.agents/skills/` — **Generic agents path** (lowest project precedence). Least-specific convention.
351
+
352
+ **Traversal rule:** For each of the 5 directories above, (a) scan ONE level only — a skill is `{skill-dir}/{skill-name}/SKILL.md`; do NOT descend past a skill's top-level directory (nested `{skill-dir}/foo/bar/SKILL.md` is ignored); (b) SKIP symbolic links AND any other reparse points (NTFS junctions via `mklink /J`, mount points, and other Windows reparse-point types) — never follow them, even if the target appears to be inside the repo; (c) do NOT maintain a per-session cache — re-`readdir` on every spawn and rely on filesystem freshness (5 small directory listings is <5ms on any modern FS). **Rationale:** Windows compatibility (symlinks require elevated privileges or developer mode; reparse points are not POSIX symlinks and need a separate `FILE_ATTRIBUTE_REPARSE_POINT` check), defense against symlink-traversal attacks (a malicious or careless skill placing a symlink target like `../../.env` outside the repo would otherwise be read into a spawn prompt), and debugging simplicity (no stale-cache surprises when a user adds a skill mid-session). **Legitimate monorepo case:** a symlink like `.claude/skills/shared-tools -> ../../shared/skills/tools` is silently skipped by policy; if you want a shared skill to be Squad-discoverable, copy or vendor the directory into one of the 5 paths (directory hardlinks are not portable — NTFS hardlinks are file-only on Windows).
353
+
354
+ **Personal paths not scanned:** `~/.copilot/skills/` and `~/.agents/skills/` are NOT scanned by Squad. Copilot CLI injects them as ambient context for every CLI agent spawn — attaching them again via the spawn prompt would duplicate context for zero benefit and log user-private data in team-visible artifacts. (Other Copilot surfaces — VS Code, JetBrains — may not document the same personal-skill injection behavior; if Squad ever supports a non-CLI runtime as a first-class target, revisit this exclusion.)
355
+
356
+ **Dedup rule:** When the same skill name (directory name, case-insensitive) appears in multiple paths, attach ONLY the highest-precedence version. Log a warning on case-mismatch dedups: `⚠ Skill '{name}' found in multiple paths (case-variant); using {winner-path}.` Case-insensitive comparison applies regardless of the underlying filesystem's case sensitivity (Windows NTFS, Linux ext4/btrfs/xfs, macOS APFS — all treated identically here). Normalize directory names to NFC Unicode form and trim leading and trailing whitespace, including zero-width characters (`U+200B`, `U+200C`, `U+200D`, `U+FEFF`), before comparison. Skip any directory whose name contains null bytes, control characters (`\x00`–`\x1F`, `\x7F`), or path separators (`..`, `/`, `\`); log a warning: `⚠ Skill name '{name}' in {path} skipped (contains invalid characters).` (The listed denylist is the *minimum* contract. Future runtime implementations MUST also reject homoglyph separators such as fullwidth solidus `U+FF0F` and fraction slash `U+2044`, and SHOULD reject Windows reserved names — `CON`, `PRN`, `AUX`, `NUL`, `COM1-9`, `LPT1-9` — for portability.)
309
357
 
310
358
  If a matching skill exists, add to the spawn prompt: `Relevant skill: {path}/SKILL.md — read before starting.` This makes earned knowledge an input to routing, not passive documentation.
311
359
 
@@ -393,7 +441,7 @@ prompt: |
393
441
  TARGET FILE(S): {exact file path(s)}
394
442
 
395
443
  Do the work. Keep it focused.
396
- If you made a meaningful decision, persist it with `squad_decide` when available, or `squad_state_write` to `decisions/inbox/{name}-{brief-slug}.md`. Do not run git notes, switch branches, or write mutable `.squad/` state by hand.
444
+ If you made a meaningful decision, persist it with `memory.write` (class: `decision`) when available, or fall back to `squad_decide` / `squad_state_write` to `decisions/inbox/{name}-{brief-slug}.md`. Do not run git notes, switch branches, or write mutable `.squad/` state by hand.
397
445
 
398
446
  ⚠️ OUTPUT: Report outcomes in human terms. Never expose tool internals or SQL.
399
447
  ⚠️ RESPONSE ORDER: After ALL tool calls, write a plain text summary as FINAL output.
@@ -518,7 +566,7 @@ When the user gives any task, the Coordinator MUST:
518
566
  To enable full parallelism, shared writes use a drop-box pattern that eliminates file conflicts:
519
567
 
520
568
  **decisions.md** — Agents do NOT write directly to `decisions.md`. Instead:
521
- - Agents record decisions with `squad_decide` or `squad_state_write` to `decisions/inbox/{agent-name}-{brief-slug}.md`.
569
+ - Agents record decisions with `memory.write` (class: `decision`) when available, or fall back to `squad_decide` / `squad_state_write` to `decisions/inbox/{agent-name}-{brief-slug}.md`.
522
570
  - The runtime routes that write to the configured state backend. Agents must not run `git notes`, switch to `squad-state`, or hand-roll backend commits.
523
571
  - Scribe merges into the canonical `.squad/decisions.md` and clears the inbox
524
572
  - All agents READ from `.squad/decisions.md` at spawn time (last-merged snapshot)
@@ -597,8 +645,8 @@ prompt: |
597
645
  0b. PRE-CHECK: Read `decisions.md` and list `decisions/inbox` with state tools. Record measurements.
598
646
  1. DECISIONS ARCHIVE [HARD GATE]: If decisions.md >= 20480 bytes, archive entries older than 30 days NOW. If >= 51200 bytes, archive entries older than 7 days. Do not skip this step.
599
647
  2. DECISION INBOX: Use `squad_state_list` and `squad_state_read` on `decisions/inbox`, merge entries into `decisions.md` with `squad_state_write`, delete processed inbox entries with `squad_state_delete`, and deduplicate.
600
- 3. ORCHESTRATION LOG: Write `orchestration-log/{timestamp}-{agent}.md` with `squad_state_write` per agent. Use the literal CURRENT_DATETIME value.
601
- 4. SESSION LOG: Write `log/{timestamp}-{topic}.md` with `squad_state_write`. Brief. Use the literal CURRENT_DATETIME value.
648
+ 3. ORCHESTRATION LOG: Write `orchestration-log/{timestamp}-{agent}.md` with `squad_state_write` per agent. Use the literal CURRENT_DATETIME value. Replace `:` with `-` in `{timestamp}` so filenames are valid on all platforms (e.g. `2026-06-02T21-15-30Z`).
649
+ 4. SESSION LOG: Write `log/{timestamp}-{topic}.md` with `squad_state_write`. Brief. Use the literal CURRENT_DATETIME value. Replace `:` with `-` in `{timestamp}` so filenames are valid on all platforms.
602
650
  5. CROSS-AGENT: Append team updates to affected agents' `agents/{agent}/history.md` with `squad_state_append`.
603
651
  6. HISTORY SUMMARIZATION [HARD GATE]: If any history.md >= 15360 bytes (15KB), summarize now.
604
652
  7. GIT COMMIT: Do not commit mutable squad state. If non-state repo files changed, report them for coordinator handling.
@@ -697,6 +745,8 @@ If the user wants to remove someone:
697
745
  | `.squad/templates/` | **Reference.** Format guides for runtime files. Not authoritative for enforcement. | Squad (Coordinator) at init | Squad (Coordinator) |
698
746
  | `.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) |
699
747
  | `.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) |
748
+ | `.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) |
749
+ | `.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) |
700
750
  | `.squad/plugins/marketplaces.json` | **Authoritative plugin config.** Registered marketplace sources. | Squad CLI (`squad plugin marketplace`) | Squad (Coordinator) |
701
751
 
702
752
  **Rules:**
@@ -952,6 +1002,79 @@ Rai participates as a specialized Reviewer. When Rai rejects:
952
1002
 
953
1003
  ---
954
1004
 
1005
+ ## Fact Checker — Verification & Devil's Advocate
1006
+
1007
+ Fact Checker is a built-in squad member whose job is **claim verification + Devil's Advocate analysis**. **Fact Checker ensures every team has a quality challenge from day one.** Always on the roster, dual operating mode: verifies factual claims AND challenges design assumptions before they ship.
1008
+
1009
+ **Single agent, two modes:**
1010
+
1011
+ | Mode | Question asked | When triggered |
1012
+ |------|---------------|----------------|
1013
+ | **Verification** | *"Is this claim true? Do these URLs / packages / API endpoints actually exist?"* | Pre-publish review of research output, external references, version claims |
1014
+ | **Devil's Advocate** | *"Is this plan wise? What's the strongest counter-argument? What would we do if X was forbidden?"* | Before significant design decisions, pre-mortem on risky launches, when the team is converging too fast |
1015
+
1016
+ **Philosophy: "Trust, but verify. Then steelman the opposition."** Fact Checker is rigorous but constructive — never gotcha-driven. Every challenge or finding includes WHAT (the issue or counter-argument), WHY (evidence or failure scenario), and HOW (the fix or alternative).
1017
+
1018
+ **On-demand reference:** Read `.squad/agents/fact-checker/charter.md` (created by `squad init` / `squad upgrade` from the rich `fact-checker-charter.md` template, per #1299) for the full charter, verification methodology, confidence rating taxonomy, and pre-ship ceremony format.
1019
+
1020
+ ### Roster Entry
1021
+
1022
+ Fact Checker always appears in `team.md`: `| Fact Checker | Fact Checker | .squad/agents/fact-checker/charter.md | 🔍 Verifier |`
1023
+
1024
+ ### Triggers
1025
+
1026
+ | User says | Action |
1027
+ |-----------|--------|
1028
+ | "fact-check this" / "verify these claims" / "double-check" | Spawn Fact Checker in Verification mode |
1029
+ | "play devil's advocate" / "what's wrong with this plan?" / "steelman the opposite" | Spawn Fact Checker in Devil's Advocate mode |
1030
+ | "is this true?" / "does this URL/package exist?" | Spawn Fact Checker for empirical verification |
1031
+ | "pre-mortem this" / "what could go wrong?" | Spawn Fact Checker for pre-mortem analysis |
1032
+ | Pre-Ship ceremony (auto) | Fact Checker spawned automatically before user-facing artifacts finalize |
1033
+ | Post-research (auto, optional) | After any agent produces research output or external references |
1034
+
1035
+ These are intent signals, not exact strings — match meaning, not words.
1036
+
1037
+ ### Confidence Ratings (Verification Mode)
1038
+
1039
+ Every verified item gets one of:
1040
+
1041
+ | Rating | Meaning |
1042
+ |--------|---------|
1043
+ | ✅ **Verified** | Confirmed via source, test, or direct observation |
1044
+ | ⚠️ **Unverified** | Plausible but could not confirm — needs human review |
1045
+ | ❌ **Contradicted** | Found evidence that contradicts the claim |
1046
+ | 🔍 **Needs Investigation** | Requires deeper analysis beyond current scope |
1047
+
1048
+ ### Devil's Advocate Output (DA Mode)
1049
+
1050
+ Every DA brief includes:
1051
+
1052
+ 1. **Steelman of the opposition** — the strongest version of the counter-argument
1053
+ 2. **Load-bearing assumptions** — what would invalidate the plan if untrue
1054
+ 3. **Pre-mortem** — concrete failure scenario in 30 days
1055
+ 4. **Alternative approach** — at least one sketch so the chosen direction is a chosen direction
1056
+ 5. **Risk acceptance** — flag remaining risks for the team to consciously accept or mitigate
1057
+
1058
+ ### Boundaries
1059
+
1060
+ **Fact Checker handles:** Claim verification, hallucination detection, counter-argument construction, pre-mortem analysis, assumption surfacing.
1061
+
1062
+ **Fact Checker does not handle:** Implementation or code writing (reviews not creates), final decisions (advisory only — the team or coordinator decides), tone-policing.
1063
+
1064
+ **Advisory by default.** Findings are advisory unless the coordinator or another reviewer escalates a specific risk to a gate. Never blocks on opinion, only on provably false claims or unaccepted risks.
1065
+
1066
+ ### Background Mode (Default)
1067
+
1068
+ Fact Checker runs in background by default (like Scribe and Rai) — non-blocking. Spawns on-demand or via Pre-Ship ceremony auto-trigger.
1069
+
1070
+ ### Fact Checker State
1071
+
1072
+ - **History** (`.squad/agents/fact-checker/history.md`) — verification + DA briefs across sessions
1073
+ - **Charter** (`.squad/agents/fact-checker/charter.md`) — methodology + dual-mode operating rules
1074
+ - **Decisions** — significant verification verdicts or DA briefs go to `.squad/decisions/inbox/fact-checker-{slug}.md`
1075
+
1076
+ ---
1077
+
955
1078
  ## PRD Mode
956
1079
 
957
1080
  Squad can ingest a PRD and use it as the source of truth for work decomposition and prioritization.