@bradygaster/squad-sdk 0.8.24 → 0.9.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 (202) hide show
  1. package/dist/adapter/client.d.ts +17 -0
  2. package/dist/adapter/client.d.ts.map +1 -1
  3. package/dist/adapter/client.js +101 -1
  4. package/dist/adapter/client.js.map +1 -1
  5. package/dist/agents/history-shadow.d.ts.map +1 -1
  6. package/dist/agents/history-shadow.js +99 -32
  7. package/dist/agents/history-shadow.js.map +1 -1
  8. package/dist/agents/index.d.ts +1 -0
  9. package/dist/agents/index.d.ts.map +1 -1
  10. package/dist/agents/index.js +2 -0
  11. package/dist/agents/index.js.map +1 -1
  12. package/dist/agents/model-selector.d.ts +2 -0
  13. package/dist/agents/model-selector.d.ts.map +1 -1
  14. package/dist/agents/model-selector.js +41 -35
  15. package/dist/agents/model-selector.js.map +1 -1
  16. package/dist/agents/personal.d.ts +35 -0
  17. package/dist/agents/personal.d.ts.map +1 -0
  18. package/dist/agents/personal.js +67 -0
  19. package/dist/agents/personal.js.map +1 -0
  20. package/dist/builders/index.d.ts +3 -2
  21. package/dist/builders/index.d.ts.map +1 -1
  22. package/dist/builders/index.js +28 -0
  23. package/dist/builders/index.js.map +1 -1
  24. package/dist/builders/types.d.ts +13 -0
  25. package/dist/builders/types.d.ts.map +1 -1
  26. package/dist/config/init.d.ts +8 -0
  27. package/dist/config/init.d.ts.map +1 -1
  28. package/dist/config/init.js +131 -20
  29. package/dist/config/init.js.map +1 -1
  30. package/dist/config/models.d.ts +112 -0
  31. package/dist/config/models.d.ts.map +1 -1
  32. package/dist/config/models.js +329 -18
  33. package/dist/config/models.js.map +1 -1
  34. package/dist/coordinator/index.js +2 -2
  35. package/dist/coordinator/index.js.map +1 -1
  36. package/dist/index.d.ts +8 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +7 -2
  39. package/dist/index.js.map +1 -1
  40. package/dist/platform/azure-devops.d.ts +42 -0
  41. package/dist/platform/azure-devops.d.ts.map +1 -1
  42. package/dist/platform/azure-devops.js +75 -0
  43. package/dist/platform/azure-devops.js.map +1 -1
  44. package/dist/platform/comms-file-log.d.ts.map +1 -1
  45. package/dist/platform/comms-file-log.js +2 -1
  46. package/dist/platform/comms-file-log.js.map +1 -1
  47. package/dist/platform/index.d.ts +2 -1
  48. package/dist/platform/index.d.ts.map +1 -1
  49. package/dist/platform/index.js +1 -0
  50. package/dist/platform/index.js.map +1 -1
  51. package/dist/ralph/capabilities.d.ts +67 -0
  52. package/dist/ralph/capabilities.d.ts.map +1 -0
  53. package/dist/ralph/capabilities.js +111 -0
  54. package/dist/ralph/capabilities.js.map +1 -0
  55. package/dist/ralph/index.d.ts +2 -0
  56. package/dist/ralph/index.d.ts.map +1 -1
  57. package/dist/ralph/index.js +6 -5
  58. package/dist/ralph/index.js.map +1 -1
  59. package/dist/ralph/rate-limiting.d.ts +99 -0
  60. package/dist/ralph/rate-limiting.d.ts.map +1 -0
  61. package/dist/ralph/rate-limiting.js +170 -0
  62. package/dist/ralph/rate-limiting.js.map +1 -0
  63. package/dist/resolution.d.ts +24 -2
  64. package/dist/resolution.d.ts.map +1 -1
  65. package/dist/resolution.js +106 -6
  66. package/dist/resolution.js.map +1 -1
  67. package/dist/roles/catalog-categories.d.ts +146 -0
  68. package/dist/roles/catalog-categories.d.ts.map +1 -0
  69. package/dist/roles/catalog-categories.js +374 -0
  70. package/dist/roles/catalog-categories.js.map +1 -0
  71. package/dist/roles/catalog-engineering.d.ts +212 -0
  72. package/dist/roles/catalog-engineering.d.ts.map +1 -0
  73. package/dist/roles/catalog-engineering.js +549 -0
  74. package/dist/roles/catalog-engineering.js.map +1 -0
  75. package/dist/roles/catalog.d.ts +24 -0
  76. package/dist/roles/catalog.d.ts.map +1 -0
  77. package/dist/roles/catalog.js +28 -0
  78. package/dist/roles/catalog.js.map +1 -0
  79. package/dist/roles/index.d.ts +69 -0
  80. package/dist/roles/index.d.ts.map +1 -0
  81. package/dist/roles/index.js +197 -0
  82. package/dist/roles/index.js.map +1 -0
  83. package/dist/roles/types.d.ts +87 -0
  84. package/dist/roles/types.d.ts.map +1 -0
  85. package/dist/roles/types.js +14 -0
  86. package/dist/roles/types.js.map +1 -0
  87. package/dist/runtime/benchmarks.js +5 -5
  88. package/dist/runtime/benchmarks.js.map +1 -1
  89. package/dist/runtime/constants.d.ts +2 -2
  90. package/dist/runtime/constants.d.ts.map +1 -1
  91. package/dist/runtime/constants.js +5 -3
  92. package/dist/runtime/constants.js.map +1 -1
  93. package/dist/runtime/cross-squad.d.ts +118 -0
  94. package/dist/runtime/cross-squad.d.ts.map +1 -0
  95. package/dist/runtime/cross-squad.js +234 -0
  96. package/dist/runtime/cross-squad.js.map +1 -0
  97. package/dist/runtime/otel-init.d.ts +24 -17
  98. package/dist/runtime/otel-init.d.ts.map +1 -1
  99. package/dist/runtime/otel-init.js +29 -20
  100. package/dist/runtime/otel-init.js.map +1 -1
  101. package/dist/runtime/otel-metrics.d.ts +5 -0
  102. package/dist/runtime/otel-metrics.d.ts.map +1 -1
  103. package/dist/runtime/otel-metrics.js +54 -0
  104. package/dist/runtime/otel-metrics.js.map +1 -1
  105. package/dist/runtime/rework.d.ts +71 -0
  106. package/dist/runtime/rework.d.ts.map +1 -0
  107. package/dist/runtime/rework.js +107 -0
  108. package/dist/runtime/rework.js.map +1 -0
  109. package/dist/runtime/scheduler.d.ts +128 -0
  110. package/dist/runtime/scheduler.d.ts.map +1 -0
  111. package/dist/runtime/scheduler.js +427 -0
  112. package/dist/runtime/scheduler.js.map +1 -0
  113. package/dist/runtime/squad-observer.d.ts.map +1 -1
  114. package/dist/runtime/squad-observer.js +4 -0
  115. package/dist/runtime/squad-observer.js.map +1 -1
  116. package/dist/runtime/streaming.d.ts +2 -0
  117. package/dist/runtime/streaming.d.ts.map +1 -1
  118. package/dist/runtime/streaming.js +6 -0
  119. package/dist/runtime/streaming.js.map +1 -1
  120. package/dist/runtime/telemetry.d.ts +2 -0
  121. package/dist/runtime/telemetry.d.ts.map +1 -1
  122. package/dist/runtime/telemetry.js +6 -0
  123. package/dist/runtime/telemetry.js.map +1 -1
  124. package/dist/sharing/consult.d.ts +2 -2
  125. package/dist/sharing/consult.js +6 -6
  126. package/dist/sharing/consult.js.map +1 -1
  127. package/dist/sharing/export.d.ts.map +1 -1
  128. package/dist/sharing/export.js +17 -4
  129. package/dist/sharing/export.js.map +1 -1
  130. package/dist/skills/handler-types.d.ts +271 -0
  131. package/dist/skills/handler-types.d.ts.map +1 -0
  132. package/dist/skills/handler-types.js +31 -0
  133. package/dist/skills/handler-types.js.map +1 -0
  134. package/dist/skills/index.d.ts +3 -0
  135. package/dist/skills/index.d.ts.map +1 -1
  136. package/dist/skills/index.js +3 -0
  137. package/dist/skills/index.js.map +1 -1
  138. package/dist/skills/skill-script-loader.d.ts +65 -0
  139. package/dist/skills/skill-script-loader.d.ts.map +1 -0
  140. package/dist/skills/skill-script-loader.js +227 -0
  141. package/dist/skills/skill-script-loader.js.map +1 -0
  142. package/dist/skills/skill-source.d.ts.map +1 -1
  143. package/dist/skills/skill-source.js +5 -1
  144. package/dist/skills/skill-source.js.map +1 -1
  145. package/dist/tools/index.d.ts +10 -1
  146. package/dist/tools/index.d.ts.map +1 -1
  147. package/dist/tools/index.js +49 -8
  148. package/dist/tools/index.js.map +1 -1
  149. package/dist/upstream/resolver.d.ts.map +1 -1
  150. package/dist/upstream/resolver.js +14 -5
  151. package/dist/upstream/resolver.js.map +1 -1
  152. package/package.json +34 -3
  153. package/templates/casting/Futurama.json +10 -0
  154. package/templates/casting-policy.json +4 -2
  155. package/templates/casting-reference.md +104 -0
  156. package/templates/cooperative-rate-limiting.md +229 -0
  157. package/templates/issue-lifecycle.md +412 -0
  158. package/templates/keda-scaler.md +164 -0
  159. package/templates/machine-capabilities.md +75 -0
  160. package/templates/mcp-config.md +0 -8
  161. package/templates/orchestration-log.md +27 -27
  162. package/templates/package.json +3 -0
  163. package/templates/ralph-circuit-breaker.md +313 -0
  164. package/templates/ralph-triage.js +543 -0
  165. package/templates/routing.md +5 -20
  166. package/templates/schedule.json +19 -0
  167. package/templates/scribe-charter.md +1 -1
  168. package/templates/skills/agent-collaboration/SKILL.md +42 -0
  169. package/templates/skills/agent-conduct/SKILL.md +24 -0
  170. package/templates/skills/architectural-proposals/SKILL.md +151 -0
  171. package/templates/skills/ci-validation-gates/SKILL.md +84 -0
  172. package/templates/skills/cli-wiring/SKILL.md +47 -0
  173. package/templates/skills/client-compatibility/SKILL.md +89 -0
  174. package/templates/skills/cross-squad/SKILL.md +114 -0
  175. package/templates/skills/distributed-mesh/SKILL.md +287 -0
  176. package/templates/skills/distributed-mesh/mesh.json.example +30 -0
  177. package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -0
  178. package/templates/skills/distributed-mesh/sync-mesh.sh +104 -0
  179. package/templates/skills/docs-standards/SKILL.md +71 -0
  180. package/templates/skills/economy-mode/SKILL.md +114 -0
  181. package/templates/skills/external-comms/SKILL.md +329 -0
  182. package/templates/skills/gh-auth-isolation/SKILL.md +183 -0
  183. package/templates/skills/git-workflow/SKILL.md +204 -0
  184. package/templates/skills/github-multi-account/SKILL.md +95 -0
  185. package/templates/skills/history-hygiene/SKILL.md +36 -0
  186. package/templates/skills/humanizer/SKILL.md +105 -0
  187. package/templates/skills/init-mode/SKILL.md +102 -0
  188. package/templates/skills/model-selection/SKILL.md +117 -0
  189. package/templates/skills/nap/SKILL.md +24 -0
  190. package/templates/skills/personal-squad/SKILL.md +57 -0
  191. package/templates/skills/release-process/SKILL.md +423 -0
  192. package/templates/skills/reskill/SKILL.md +92 -0
  193. package/templates/skills/reviewer-protocol/SKILL.md +79 -0
  194. package/templates/skills/secret-handling/SKILL.md +200 -0
  195. package/templates/skills/session-recovery/SKILL.md +155 -0
  196. package/templates/skills/squad-conventions/SKILL.md +69 -0
  197. package/templates/skills/test-discipline/SKILL.md +37 -0
  198. package/templates/skills/windows-compatibility/SKILL.md +74 -0
  199. package/templates/squad.agent.md +1287 -1146
  200. package/templates/workflows/squad-docs.yml +8 -4
  201. package/templates/workflows/squad-heartbeat.yml +55 -200
  202. package/templates/workflows/squad-insider-release.yml +1 -1
@@ -0,0 +1,287 @@
1
+ ---
2
+ name: "distributed-mesh"
3
+ description: "How to coordinate with squads on different machines using git as transport"
4
+ domain: "distributed-coordination"
5
+ confidence: "high"
6
+ source: "multi-model-consensus (Opus 4.6, Sonnet 4.5, GPT-5.4)"
7
+ ---
8
+
9
+ ## SCOPE
10
+
11
+ **✅ THIS SKILL PRODUCES (exactly these, nothing more):**
12
+
13
+ 1. **`mesh.json`** — Generated from user answers about zones and squads (which squads participate, what zone each is in, paths/URLs for each), using `mesh.json.example` in this skill's directory as the schema template
14
+ 2. **`sync-mesh.sh` and `sync-mesh.ps1`** — Copied from this skill's directory into the project root (these are bundled resources, NOT generated code)
15
+ 3. **Zone 2 state repo initialization** (if applicable) — If the user specified a Zone 2 shared state repo, run `sync-mesh.sh --init` to scaffold the state repo structure
16
+ 4. **A decision entry** in `.squad/decisions/inbox/` documenting the mesh configuration for team awareness
17
+
18
+ **❌ THIS SKILL DOES NOT PRODUCE:**
19
+
20
+ - **No application code** — No validators, libraries, or modules of any kind
21
+ - **No test files** — No test suites, test cases, or test scaffolding
22
+ - **No GENERATING sync scripts** — They are bundled with this skill as pre-built resources. COPY them, don't generate them.
23
+ - **No daemons or services** — No background processes, servers, or persistent runtimes
24
+ - **No modifications to existing squad files** beyond the decision entry (no changes to team.md, routing.md, agent charters, etc.)
25
+
26
+ **Your role:** Configure the mesh topology and install the bundled sync scripts. Nothing more.
27
+
28
+ ## Context
29
+
30
+ When squads are on different machines (developer laptops, CI runners, cloud VMs, partner orgs), the local file-reading convention still works — but remote files need to arrive on your disk first. This skill teaches the pattern for distributed squad communication.
31
+
32
+ **When this applies:**
33
+ - Squads span multiple machines, VMs, or CI runners
34
+ - Squads span organizations or companies
35
+ - An agent needs context from a squad whose files aren't on the local filesystem
36
+
37
+ **When this does NOT apply:**
38
+ - All squads are on the same machine (just read the files directly)
39
+
40
+ ## Patterns
41
+
42
+ ### The Core Principle
43
+
44
+ > "The filesystem is the mesh, and git is how the mesh crosses machine boundaries."
45
+
46
+ The agent interface never changes. Agents always read local files. The distributed layer's only job is to make remote files appear locally before the agent reads them.
47
+
48
+ ### Three Zones of Communication
49
+
50
+ **Zone 1 — Local:** Same filesystem. Read files directly. Zero transport.
51
+
52
+ **Zone 2 — Remote-Trusted:** Different host, same org, shared git auth. Transport: `git pull` from a shared repo. This collapses Zone 2 into Zone 1 — files materialize on disk, agent reads them normally.
53
+
54
+ **Zone 3 — Remote-Opaque:** Different org, no shared auth. Transport: `curl` to fetch published contracts (SUMMARY.md). One-way visibility — you see only what they publish.
55
+
56
+ ### Agent Lifecycle (Distributed)
57
+
58
+ ```
59
+ 1. SYNC: git pull (Zone 2) + curl (Zone 3) — materialize remote state
60
+ 2. READ: cat .mesh/**/state.md — all files are local now
61
+ 3. WORK: do their assigned work (the agent's normal task, NOT mesh-building)
62
+ 4. WRITE: update own billboard, log, drops
63
+ 5. PUBLISH: git add + commit + push — share state with remote peers
64
+ ```
65
+
66
+ Steps 2–4 are identical to local-only. Steps 1 and 5 are the entire distributed extension. **Note:** "WORK" means the agent performs its normal squad duties — it does NOT mean "build mesh infrastructure."
67
+
68
+ ### The mesh.json Config
69
+
70
+ ```json
71
+ {
72
+ "squads": {
73
+ "auth-squad": { "zone": "local", "path": "../auth-squad/.mesh" },
74
+ "ci-squad": {
75
+ "zone": "remote-trusted",
76
+ "source": "git@github.com:our-org/ci-squad.git",
77
+ "ref": "main",
78
+ "sync_to": ".mesh/remotes/ci-squad"
79
+ },
80
+ "partner-fraud": {
81
+ "zone": "remote-opaque",
82
+ "source": "https://partner.dev/squad-contracts/fraud/SUMMARY.md",
83
+ "sync_to": ".mesh/remotes/partner-fraud",
84
+ "auth": "bearer"
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ Three zone types, one file. Local squads need only a path. Remote-trusted need a git URL. Remote-opaque need an HTTP URL.
91
+
92
+ ### Write Partitioning
93
+
94
+ Each squad writes only to its own directory (`boards/{self}.md`, `squads/{self}/*`, `drops/{date}-{self}-*.md`). No two squads write to the same file. Git push/pull never conflicts. If push fails ("branch is behind"), the fix is always `git pull --rebase && git push`.
95
+
96
+ ### Trust Boundaries
97
+
98
+ Trust maps to git permissions:
99
+ - **Same repo access** = full mesh visibility
100
+ - **Read-only access** = can observe, can't write
101
+ - **No access** = invisible (correct behavior)
102
+
103
+ For selective visibility, use separate repos per audience (internal, partner, public). Git permissions ARE the trust negotiation.
104
+
105
+ ### Phased Rollout
106
+
107
+ - **Phase 0:** Convention only — document zones, agree on mesh.json fields, manually run `git pull`/`git push`. Zero new code.
108
+ - **Phase 1:** Sync script (~30 lines bash or PowerShell) when manual sync gets tedious.
109
+ - **Phase 2:** Published contracts + curl fetch when a Zone 3 partner appears.
110
+ - **Phase 3:** Never. No MCP federation, A2A, service discovery, message queues.
111
+
112
+ **Important:** Phases are NOT auto-advanced. These are project-level decisions — you start at Phase 0 (manual sync) and only move forward when the team decides complexity is justified.
113
+
114
+ ### Mesh State Repo
115
+
116
+ The shared mesh state repo is a plain git repository — NOT a Squad project. It holds:
117
+ - One directory per participating squad
118
+ - Each directory contains at minimum a SUMMARY.md with the squad's current state
119
+ - A root README explaining what the repo is and who participates
120
+
121
+ No `.squad/` folder, no agents, no automation. Write partitioning means each squad only pushes to its own directory. The repo is a rendezvous point, not an intelligent system.
122
+
123
+ If you want a squad that *observes* mesh health, that's a separate Squad project that lists the state repo as a Zone 2 remote in its `mesh.json` — it does NOT live inside the state repo.
124
+
125
+ ## Examples
126
+
127
+ ### Developer Laptop + CI Squad (Zone 2)
128
+
129
+ Auth-squad agent wakes up. `git pull` brings ci-squad's latest results. Agent reads: "3 test failures in auth module." Adjusts work. Pushes results when done. **Overhead: one `git pull`, one `git push`.**
130
+
131
+ ### Two Orgs Collaborating (Zone 3)
132
+
133
+ Payment-squad fetches partner's published SUMMARY.md via curl. Reads: "Risk scoring v3 API deprecated April 15. New field `device_fingerprint` required." The consuming agent (in payment-squad's team) reads this information and uses it to inform its work — for example, updating payment integration code to include the new field. Partner can't see payment-squad's internals.
134
+
135
+ ### Same Org, Shared Mesh Repo (Zone 2)
136
+
137
+ Three squads on different machines. One shared git repo holds the mesh. Each squad: `git pull` before work, `git push` after. Write partitioning ensures zero merge conflicts.
138
+
139
+ ## AGENT WORKFLOW (Deterministic Setup)
140
+
141
+ When a user invokes this skill to set up a distributed mesh, follow these steps **exactly, in order:**
142
+
143
+ ### Step 1: ASK the user for mesh topology
144
+
145
+ Ask these questions (adapt phrasing naturally, but get these answers):
146
+
147
+ 1. **Which squads are participating?** (List of squad names)
148
+ 2. **For each squad, which zone is it in?**
149
+ - `local` — same filesystem (just need a path)
150
+ - `remote-trusted` — different machine, same org, shared git access (need git URL + ref)
151
+ - `remote-opaque` — different org, no shared auth (need HTTPS URL to published contract)
152
+ 3. **For each squad, what's the connection info?**
153
+ - Local: relative or absolute path to their `.mesh/` directory
154
+ - Remote-trusted: git URL (SSH or HTTPS), ref (branch/tag), and where to sync it to locally
155
+ - Remote-opaque: HTTPS URL to their SUMMARY.md, where to sync it, and auth type (none/bearer)
156
+ 4. **Where should the shared state live?** (For Zone 2 squads: git repo URL for the mesh state, or confirm each squad syncs independently)
157
+
158
+ ### Step 2: GENERATE `mesh.json`
159
+
160
+ Using the answers from Step 1, create a `mesh.json` file at the project root. Use `mesh.json.example` from THIS skill's directory (`.squad/skills/distributed-mesh/mesh.json.example`) as the schema template.
161
+
162
+ Structure:
163
+
164
+ ```json
165
+ {
166
+ "squads": {
167
+ "<squad-name>": { "zone": "local", "path": "<relative-or-absolute-path>" },
168
+ "<squad-name>": {
169
+ "zone": "remote-trusted",
170
+ "source": "<git-url>",
171
+ "ref": "<branch-or-tag>",
172
+ "sync_to": ".mesh/remotes/<squad-name>"
173
+ },
174
+ "<squad-name>": {
175
+ "zone": "remote-opaque",
176
+ "source": "<https-url-to-summary>",
177
+ "sync_to": ".mesh/remotes/<squad-name>",
178
+ "auth": "<none|bearer>"
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ Write this file to the project root. Do NOT write any other code.
185
+
186
+ ### Step 3: COPY sync scripts
187
+
188
+ Copy the bundled sync scripts from THIS skill's directory into the project root:
189
+
190
+ - **Source:** `.squad/skills/distributed-mesh/sync-mesh.sh`
191
+ - **Destination:** `sync-mesh.sh` (project root)
192
+
193
+ - **Source:** `.squad/skills/distributed-mesh/sync-mesh.ps1`
194
+ - **Destination:** `sync-mesh.ps1` (project root)
195
+
196
+ These are bundled resources. Do NOT generate them — COPY them directly.
197
+
198
+ ### Step 4: RUN `--init` (if Zone 2 state repo exists)
199
+
200
+ If the user specified a Zone 2 shared state repo in Step 1, run the initialization:
201
+
202
+ **On Unix/Linux/macOS:**
203
+ ```bash
204
+ bash sync-mesh.sh --init
205
+ ```
206
+
207
+ **On Windows:**
208
+ ```powershell
209
+ .\sync-mesh.ps1 -Init
210
+ ```
211
+
212
+ This scaffolds the state repo structure (squad directories, placeholder SUMMARY.md files, root README).
213
+
214
+ **Skip this step if:**
215
+ - No Zone 2 squads are configured (local/opaque only)
216
+ - The state repo already exists and is initialized
217
+
218
+ ### Step 5: WRITE a decision entry
219
+
220
+ Create a decision file at `.squad/decisions/inbox/<your-agent-name>-mesh-setup.md` with this content:
221
+
222
+ ```markdown
223
+ ### <YYYY-MM-DD>: Mesh configuration
224
+
225
+ **By:** <your-agent-name> (via distributed-mesh skill)
226
+
227
+ **What:** Configured distributed mesh with <N> squads across zones <list-zones-used>
228
+
229
+ **Squads:**
230
+ - `<squad-name>` — Zone <X> — <brief-connection-info>
231
+ - `<squad-name>` — Zone <X> — <brief-connection-info>
232
+ - ...
233
+
234
+ **State repo:** <git-url-if-zone-2-used, or "N/A (local/opaque only)">
235
+
236
+ **Why:** <user's stated reason for setting up the mesh, or "Enable cross-machine squad coordination">
237
+ ```
238
+
239
+ Write this file. The Scribe will merge it into the main decisions file later.
240
+
241
+ ### Step 6: STOP
242
+
243
+ **You are done.** Do not:
244
+ - Generate sync scripts (they're bundled with this skill — COPY them)
245
+ - Write validator code
246
+ - Write test files
247
+ - Create any other modules, libraries, or application code
248
+ - Modify existing squad files (team.md, routing.md, charters)
249
+ - Auto-advance to Phase 2 or Phase 3
250
+
251
+ Output a simple completion message:
252
+
253
+ ```
254
+ ✅ Mesh configured. Created:
255
+ - mesh.json (<N> squads)
256
+ - sync-mesh.sh and sync-mesh.ps1 (copied from skill bundle)
257
+ - Decision entry: .squad/decisions/inbox/<filename>
258
+
259
+ Run `bash sync-mesh.sh` (or `.\sync-mesh.ps1` on Windows) before agents start to materialize remote state.
260
+ ```
261
+
262
+ ---
263
+
264
+ ## Anti-Patterns
265
+
266
+ **❌ Code generation anti-patterns:**
267
+ - Writing `mesh-config-validator.js` or any validator module
268
+ - Writing test files for mesh configuration
269
+ - Generating sync scripts instead of copying the bundled ones from this skill's directory
270
+ - Creating library modules or utilities
271
+ - Building any code that "runs the mesh" — the mesh is read by agents, not executed
272
+
273
+ **❌ Architectural anti-patterns:**
274
+ - Building a federation protocol — Git push/pull IS federation
275
+ - Running a sync daemon or server — Agents are not persistent. Sync at startup, publish at shutdown
276
+ - Real-time notifications — Agents don't need real-time. They need "recent enough." `git pull` is recent enough
277
+ - Schema validation for markdown — The LLM reads markdown. If the format changes, it adapts
278
+ - Service discovery protocol — mesh.json is a file with 10 entries. Not a "discovery problem"
279
+ - Auth framework — Git SSH keys and HTTPS tokens. Not a framework. Already configured
280
+ - Message queues / event buses — Agents wake, read, work, write, sleep. Nobody's home to receive events
281
+ - Any component requiring a running process — That's the line. Don't cross it
282
+
283
+ **❌ Scope creep anti-patterns:**
284
+ - Auto-advancing phases without user decision
285
+ - Modifying agent charters or routing rules
286
+ - Setting up CI/CD pipelines for mesh sync
287
+ - Creating dashboards or monitoring tools
@@ -0,0 +1,30 @@
1
+ {
2
+ "squads": {
3
+ "auth-squad": {
4
+ "zone": "local",
5
+ "path": "../auth-squad/.mesh"
6
+ },
7
+ "api-squad": {
8
+ "zone": "local",
9
+ "path": "../api-squad/.mesh"
10
+ },
11
+ "ci-squad": {
12
+ "zone": "remote-trusted",
13
+ "source": "git@github.com:our-org/ci-squad.git",
14
+ "ref": "main",
15
+ "sync_to": ".mesh/remotes/ci-squad"
16
+ },
17
+ "data-squad": {
18
+ "zone": "remote-trusted",
19
+ "source": "git@github.com:our-org/data-pipeline.git",
20
+ "ref": "main",
21
+ "sync_to": ".mesh/remotes/data-squad"
22
+ },
23
+ "partner-fraud": {
24
+ "zone": "remote-opaque",
25
+ "source": "https://partner.example.com/squad-contracts/fraud/SUMMARY.md",
26
+ "sync_to": ".mesh/remotes/partner-fraud",
27
+ "auth": "bearer"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,111 @@
1
+ # sync-mesh.ps1 — Materialize remote squad state locally
2
+ #
3
+ # Reads mesh.json, fetches remote squads into local directories.
4
+ # Run before agent reads. No daemon. No service. ~40 lines.
5
+ #
6
+ # Usage: .\sync-mesh.ps1 [path-to-mesh.json]
7
+ # .\sync-mesh.ps1 -Init [path-to-mesh.json]
8
+ # Requires: git
9
+ param(
10
+ [switch]$Init,
11
+ [string]$MeshJson = "mesh.json"
12
+ )
13
+ $ErrorActionPreference = "Stop"
14
+
15
+ # Handle -Init mode
16
+ if ($Init) {
17
+ if (-not (Test-Path $MeshJson)) {
18
+ Write-Host "❌ $MeshJson not found"
19
+ exit 1
20
+ }
21
+
22
+ Write-Host "🚀 Initializing mesh state repository..."
23
+ $config = Get-Content $MeshJson -Raw | ConvertFrom-Json
24
+ $squads = $config.squads.PSObject.Properties.Name
25
+
26
+ # Create squad directories with placeholder SUMMARY.md
27
+ foreach ($squad in $squads) {
28
+ if (-not (Test-Path $squad)) {
29
+ New-Item -ItemType Directory -Path $squad | Out-Null
30
+ Write-Host " ✓ Created $squad/"
31
+ } else {
32
+ Write-Host " • $squad/ exists (skipped)"
33
+ }
34
+
35
+ $summaryPath = "$squad/SUMMARY.md"
36
+ if (-not (Test-Path $summaryPath)) {
37
+ "# $squad`n`n_No state published yet._" | Set-Content $summaryPath
38
+ Write-Host " ✓ Created $summaryPath"
39
+ } else {
40
+ Write-Host " • $summaryPath exists (skipped)"
41
+ }
42
+ }
43
+
44
+ # Generate root README.md
45
+ if (-not (Test-Path "README.md")) {
46
+ $readme = @"
47
+ # Squad Mesh State Repository
48
+
49
+ This repository tracks published state from participating squads.
50
+
51
+ ## Participating Squads
52
+
53
+ "@
54
+ foreach ($squad in $squads) {
55
+ $zone = $config.squads.$squad.zone
56
+ $readme += "- **$squad** (Zone: $zone)`n"
57
+ }
58
+ $readme += @"
59
+
60
+ Each squad directory contains a ``SUMMARY.md`` with their latest published state.
61
+ State is synchronized using ``sync-mesh.sh`` or ``sync-mesh.ps1``.
62
+ "@
63
+ $readme | Set-Content "README.md"
64
+ Write-Host " ✓ Created README.md"
65
+ } else {
66
+ Write-Host " • README.md exists (skipped)"
67
+ }
68
+
69
+ Write-Host ""
70
+ Write-Host "✅ Mesh state repository initialized"
71
+ exit 0
72
+ }
73
+
74
+ $config = Get-Content $MeshJson -Raw | ConvertFrom-Json
75
+
76
+ # Zone 2: Remote-trusted — git clone/pull
77
+ foreach ($entry in $config.squads.PSObject.Properties | Where-Object { $_.Value.zone -eq "remote-trusted" }) {
78
+ $squad = $entry.Name
79
+ $source = $entry.Value.source
80
+ $ref = if ($entry.Value.ref) { $entry.Value.ref } else { "main" }
81
+ $target = $entry.Value.sync_to
82
+
83
+ if (Test-Path "$target/.git") {
84
+ git -C $target pull --rebase --quiet 2>$null
85
+ if ($LASTEXITCODE -ne 0) { Write-Host "⚠ ${squad}: pull failed (using stale)" }
86
+ } else {
87
+ New-Item -ItemType Directory -Force -Path (Split-Path $target -Parent) | Out-Null
88
+ git clone --quiet --depth 1 --branch $ref $source $target 2>$null
89
+ if ($LASTEXITCODE -ne 0) { Write-Host "⚠ ${squad}: clone failed (unavailable)" }
90
+ }
91
+ }
92
+
93
+ # Zone 3: Remote-opaque — fetch published contracts
94
+ foreach ($entry in $config.squads.PSObject.Properties | Where-Object { $_.Value.zone -eq "remote-opaque" }) {
95
+ $squad = $entry.Name
96
+ $source = $entry.Value.source
97
+ $target = $entry.Value.sync_to
98
+ $auth = $entry.Value.auth
99
+
100
+ New-Item -ItemType Directory -Force -Path $target | Out-Null
101
+ $params = @{ Uri = $source; OutFile = "$target/SUMMARY.md"; UseBasicParsing = $true }
102
+ if ($auth -eq "bearer") {
103
+ $tokenVar = ($squad.ToUpper() -replace '-', '_') + "_TOKEN"
104
+ $token = [Environment]::GetEnvironmentVariable($tokenVar)
105
+ if ($token) { $params.Headers = @{ Authorization = "Bearer $token" } }
106
+ }
107
+ try { Invoke-WebRequest @params -ErrorAction Stop }
108
+ catch { "# ${squad} — unavailable ($(Get-Date))" | Set-Content "$target/SUMMARY.md" }
109
+ }
110
+
111
+ Write-Host "✓ Mesh sync complete"
@@ -0,0 +1,104 @@
1
+ #!/bin/bash
2
+ # sync-mesh.sh — Materialize remote squad state locally
3
+ #
4
+ # Reads mesh.json, fetches remote squads into local directories.
5
+ # Run before agent reads. No daemon. No service. ~40 lines.
6
+ #
7
+ # Usage: ./sync-mesh.sh [path-to-mesh.json]
8
+ # ./sync-mesh.sh --init [path-to-mesh.json]
9
+ # Requires: jq (https://github.com/jqlang/jq), git, curl
10
+
11
+ set -euo pipefail
12
+
13
+ # Handle --init mode
14
+ if [ "${1:-}" = "--init" ]; then
15
+ MESH_JSON="${2:-mesh.json}"
16
+
17
+ if [ ! -f "$MESH_JSON" ]; then
18
+ echo "❌ $MESH_JSON not found"
19
+ exit 1
20
+ fi
21
+
22
+ echo "🚀 Initializing mesh state repository..."
23
+ squads=$(jq -r '.squads | keys[]' "$MESH_JSON")
24
+
25
+ # Create squad directories with placeholder SUMMARY.md
26
+ for squad in $squads; do
27
+ if [ ! -d "$squad" ]; then
28
+ mkdir -p "$squad"
29
+ echo " ✓ Created $squad/"
30
+ else
31
+ echo " • $squad/ exists (skipped)"
32
+ fi
33
+
34
+ if [ ! -f "$squad/SUMMARY.md" ]; then
35
+ echo -e "# $squad\n\n_No state published yet._" > "$squad/SUMMARY.md"
36
+ echo " ✓ Created $squad/SUMMARY.md"
37
+ else
38
+ echo " • $squad/SUMMARY.md exists (skipped)"
39
+ fi
40
+ done
41
+
42
+ # Generate root README.md
43
+ if [ ! -f "README.md" ]; then
44
+ {
45
+ echo "# Squad Mesh State Repository"
46
+ echo ""
47
+ echo "This repository tracks published state from participating squads."
48
+ echo ""
49
+ echo "## Participating Squads"
50
+ echo ""
51
+ for squad in $squads; do
52
+ zone=$(jq -r ".squads.\"$squad\".zone" "$MESH_JSON")
53
+ echo "- **$squad** (Zone: $zone)"
54
+ done
55
+ echo ""
56
+ echo "Each squad directory contains a \`SUMMARY.md\` with their latest published state."
57
+ echo "State is synchronized using \`sync-mesh.sh\` or \`sync-mesh.ps1\`."
58
+ } > README.md
59
+ echo " ✓ Created README.md"
60
+ else
61
+ echo " • README.md exists (skipped)"
62
+ fi
63
+
64
+ echo ""
65
+ echo "✅ Mesh state repository initialized"
66
+ exit 0
67
+ fi
68
+
69
+ MESH_JSON="${1:-mesh.json}"
70
+
71
+ # Zone 2: Remote-trusted — git clone/pull
72
+ for squad in $(jq -r '.squads | to_entries[] | select(.value.zone == "remote-trusted") | .key' "$MESH_JSON"); do
73
+ source=$(jq -r ".squads.\"$squad\".source" "$MESH_JSON")
74
+ ref=$(jq -r ".squads.\"$squad\".ref // \"main\"" "$MESH_JSON")
75
+ target=$(jq -r ".squads.\"$squad\".sync_to" "$MESH_JSON")
76
+
77
+ if [ -d "$target/.git" ]; then
78
+ git -C "$target" pull --rebase --quiet 2>/dev/null \
79
+ || echo "⚠ $squad: pull failed (using stale)"
80
+ else
81
+ mkdir -p "$(dirname "$target")"
82
+ git clone --quiet --depth 1 --branch "$ref" "$source" "$target" 2>/dev/null \
83
+ || echo "⚠ $squad: clone failed (unavailable)"
84
+ fi
85
+ done
86
+
87
+ # Zone 3: Remote-opaque — fetch published contracts
88
+ for squad in $(jq -r '.squads | to_entries[] | select(.value.zone == "remote-opaque") | .key' "$MESH_JSON"); do
89
+ source=$(jq -r ".squads.\"$squad\".source" "$MESH_JSON")
90
+ target=$(jq -r ".squads.\"$squad\".sync_to" "$MESH_JSON")
91
+ auth=$(jq -r ".squads.\"$squad\".auth // \"\"" "$MESH_JSON")
92
+
93
+ mkdir -p "$target"
94
+ auth_flag=""
95
+ if [ "$auth" = "bearer" ]; then
96
+ token_var="$(echo "${squad}" | tr '[:lower:]-' '[:upper:]_')_TOKEN"
97
+ [ -n "${!token_var:-}" ] && auth_flag="--header \"Authorization: Bearer ${!token_var}\""
98
+ fi
99
+
100
+ eval curl --silent --fail $auth_flag "$source" -o "$target/SUMMARY.md" 2>/dev/null \
101
+ || echo "# ${squad} — unavailable ($(date))" > "$target/SUMMARY.md"
102
+ done
103
+
104
+ echo "✓ Mesh sync complete"
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: "docs-standards"
3
+ description: "Microsoft Style Guide + Squad-specific documentation patterns"
4
+ domain: "documentation"
5
+ confidence: "high"
6
+ source: "earned (PAO charter, multiple doc PR reviews)"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Squad documentation follows the Microsoft Style Guide with Squad-specific conventions. Consistency across docs builds trust and improves discoverability.
12
+
13
+ ## Patterns
14
+
15
+ ### Microsoft Style Guide Rules
16
+ - **Sentence-case headings:** "Getting started" not "Getting Started"
17
+ - **Active voice:** "Run the command" not "The command should be run"
18
+ - **Second person:** "You can configure..." not "Users can configure..."
19
+ - **Present tense:** "The system routes..." not "The system will route..."
20
+ - **No ampersands in prose:** "and" not "&" (except in code, brand names, or UI elements)
21
+
22
+ ### Squad Formatting Patterns
23
+ - **Scannability first:** Paragraphs for narrative (3-4 sentences max), bullets for scannable lists, tables for structured data
24
+ - **"Try this" prompts at top:** Start feature/scenario pages with practical prompts users can copy
25
+ - **Experimental warnings:** Features in preview get callout at top
26
+ - **Cross-references at bottom:** Related pages linked after main content
27
+
28
+ ### Structure
29
+ - **Title (H1)** → **Warning/callout** → **Try this code** → **Overview** → **HR** → **Content (H2 sections)**
30
+
31
+ ### Test Sync Rule
32
+ - **Always update test assertions:** When adding docs pages to `features/`, `scenarios/`, `guides/`, update corresponding `EXPECTED_*` arrays in `test/docs-build.test.ts` in the same commit
33
+
34
+ ## Examples
35
+
36
+ ✓ **Correct:**
37
+ ```markdown
38
+ # Getting started with Squad
39
+
40
+ > ⚠️ **Experimental:** This feature is in preview.
41
+
42
+ Try this:
43
+ \`\`\`bash
44
+ squad init
45
+ \`\`\`
46
+
47
+ Squad helps you build AI teams...
48
+
49
+ ---
50
+
51
+ ## Install Squad
52
+
53
+ Run the following command...
54
+ ```
55
+
56
+ ✗ **Incorrect:**
57
+ ```markdown
58
+ # Getting Started With Squad // Title case
59
+
60
+ Squad is a tool which will help users... // Third person, future tense
61
+
62
+ You can install Squad with npm & configure it... // Ampersand in prose
63
+ ```
64
+
65
+ ## Anti-Patterns
66
+
67
+ - Title-casing headings because "it looks nicer"
68
+ - Writing in passive voice or third person
69
+ - Long paragraphs of dense text (breaks scannability)
70
+ - Adding doc pages without updating test assertions
71
+ - Using ampersands outside code blocks