@bradygaster/squad-sdk 0.9.0 → 0.9.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 (76) hide show
  1. package/README.md +296 -296
  2. package/dist/agents/history-shadow.js +30 -30
  3. package/dist/build/github-dist.js +42 -42
  4. package/dist/config/init.js +173 -173
  5. package/dist/sharing/consult.js +78 -78
  6. package/package.json +1 -1
  7. package/templates/casting/Futurama.json +9 -9
  8. package/templates/casting-history.json +4 -4
  9. package/templates/casting-policy.json +37 -37
  10. package/templates/casting-reference.md +104 -104
  11. package/templates/casting-registry.json +3 -3
  12. package/templates/ceremonies.md +41 -41
  13. package/templates/charter.md +53 -53
  14. package/templates/constraint-tracking.md +38 -38
  15. package/templates/cooperative-rate-limiting.md +229 -229
  16. package/templates/copilot-instructions.md +46 -46
  17. package/templates/history.md +10 -10
  18. package/templates/identity/now.md +9 -9
  19. package/templates/identity/wisdom.md +15 -15
  20. package/templates/issue-lifecycle.md +412 -412
  21. package/templates/keda-scaler.md +164 -164
  22. package/templates/machine-capabilities.md +74 -74
  23. package/templates/mcp-config.md +90 -90
  24. package/templates/multi-agent-format.md +28 -28
  25. package/templates/plugin-marketplace.md +49 -49
  26. package/templates/ralph-circuit-breaker.md +313 -313
  27. package/templates/raw-agent-output.md +37 -37
  28. package/templates/roster.md +60 -60
  29. package/templates/routing.md +39 -39
  30. package/templates/run-output.md +50 -50
  31. package/templates/schedule.json +19 -19
  32. package/templates/scribe-charter.md +119 -119
  33. package/templates/skill.md +24 -24
  34. package/templates/skills/agent-collaboration/SKILL.md +42 -42
  35. package/templates/skills/agent-conduct/SKILL.md +24 -24
  36. package/templates/skills/architectural-proposals/SKILL.md +151 -151
  37. package/templates/skills/ci-validation-gates/SKILL.md +84 -84
  38. package/templates/skills/cli-wiring/SKILL.md +47 -47
  39. package/templates/skills/client-compatibility/SKILL.md +89 -89
  40. package/templates/skills/cross-squad/SKILL.md +114 -114
  41. package/templates/skills/distributed-mesh/SKILL.md +287 -287
  42. package/templates/skills/distributed-mesh/mesh.json.example +30 -30
  43. package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -111
  44. package/templates/skills/distributed-mesh/sync-mesh.sh +104 -104
  45. package/templates/skills/docs-standards/SKILL.md +71 -71
  46. package/templates/skills/economy-mode/SKILL.md +114 -114
  47. package/templates/skills/external-comms/SKILL.md +329 -329
  48. package/templates/skills/gh-auth-isolation/SKILL.md +183 -183
  49. package/templates/skills/git-workflow/SKILL.md +204 -204
  50. package/templates/skills/github-multi-account/SKILL.md +95 -95
  51. package/templates/skills/history-hygiene/SKILL.md +36 -36
  52. package/templates/skills/humanizer/SKILL.md +105 -105
  53. package/templates/skills/init-mode/SKILL.md +102 -102
  54. package/templates/skills/model-selection/SKILL.md +117 -117
  55. package/templates/skills/nap/SKILL.md +24 -24
  56. package/templates/skills/personal-squad/SKILL.md +57 -57
  57. package/templates/skills/project-conventions/SKILL.md +56 -56
  58. package/templates/skills/release-process/SKILL.md +423 -423
  59. package/templates/skills/reskill/SKILL.md +92 -92
  60. package/templates/skills/reviewer-protocol/SKILL.md +79 -79
  61. package/templates/skills/secret-handling/SKILL.md +200 -200
  62. package/templates/skills/session-recovery/SKILL.md +155 -155
  63. package/templates/skills/squad-conventions/SKILL.md +69 -69
  64. package/templates/skills/test-discipline/SKILL.md +37 -37
  65. package/templates/skills/windows-compatibility/SKILL.md +74 -74
  66. package/templates/workflows/squad-ci.yml +24 -24
  67. package/templates/workflows/squad-docs.yml +54 -54
  68. package/templates/workflows/squad-heartbeat.yml +171 -171
  69. package/templates/workflows/squad-insider-release.yml +61 -61
  70. package/templates/workflows/squad-issue-assign.yml +161 -161
  71. package/templates/workflows/squad-label-enforce.yml +181 -181
  72. package/templates/workflows/squad-preview.yml +55 -55
  73. package/templates/workflows/squad-promote.yml +120 -120
  74. package/templates/workflows/squad-release.yml +77 -77
  75. package/templates/workflows/squad-triage.yml +260 -260
  76. package/templates/workflows/sync-squad-labels.yml +169 -169
@@ -1,287 +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
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
@@ -1,30 +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
- }
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
+ }