@bradygaster/squad-sdk 0.8.25 → 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,204 @@
1
+ ---
2
+ name: "git-workflow"
3
+ description: "Squad branching model: dev-first workflow with insiders preview channel"
4
+ domain: "version-control"
5
+ confidence: "high"
6
+ source: "team-decision"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Squad uses a three-branch model. **All feature work starts from `dev`, not `main`.**
12
+
13
+ | Branch | Purpose | Publishes |
14
+ |--------|---------|-----------|
15
+ | `main` | Released, tagged, in-npm code only | `npm publish` on tag |
16
+ | `dev` | Integration branch — all feature work lands here | `npm publish --tag preview` on merge |
17
+ | `insiders` | Early-access channel — synced from dev | `npm publish --tag insiders` on sync |
18
+
19
+ ## Branch Naming Convention
20
+
21
+ Issue branches MUST use: `squad/{issue-number}-{kebab-case-slug}`
22
+
23
+ Examples:
24
+ - `squad/195-fix-version-stamp-bug`
25
+ - `squad/42-add-profile-api`
26
+
27
+ ## Workflow for Issue Work
28
+
29
+ 1. **Branch from dev:**
30
+ ```bash
31
+ git checkout dev
32
+ git pull origin dev
33
+ git checkout -b squad/{issue-number}-{slug}
34
+ ```
35
+
36
+ 2. **Mark issue in-progress:**
37
+ ```bash
38
+ gh issue edit {number} --add-label "status:in-progress"
39
+ ```
40
+
41
+ 3. **Create draft PR targeting dev:**
42
+ ```bash
43
+ gh pr create --base dev --title "{description}" --body "Closes #{issue-number}" --draft
44
+ ```
45
+
46
+ 4. **Do the work.** Make changes, write tests, commit with issue reference.
47
+
48
+ 5. **Push and mark ready:**
49
+ ```bash
50
+ git push -u origin squad/{issue-number}-{slug}
51
+ gh pr ready
52
+ ```
53
+
54
+ 6. **After merge to dev:**
55
+ ```bash
56
+ git checkout dev
57
+ git pull origin dev
58
+ git branch -d squad/{issue-number}-{slug}
59
+ git push origin --delete squad/{issue-number}-{slug}
60
+ ```
61
+
62
+ ## Parallel Multi-Issue Work (Worktrees)
63
+
64
+ When the coordinator routes multiple issues simultaneously (e.g., "fix bugs X, Y, and Z"), use `git worktree` to give each agent an isolated working directory. No filesystem collisions, no branch-switching overhead.
65
+
66
+ ### When to Use Worktrees vs Sequential
67
+
68
+ | Scenario | Strategy |
69
+ |----------|----------|
70
+ | Single issue | Standard workflow above — no worktree needed |
71
+ | 2+ simultaneous issues in same repo | Worktrees — one per issue |
72
+ | Work spanning multiple repos | Separate clones as siblings (see Multi-Repo below) |
73
+
74
+ ### Setup
75
+
76
+ From the main clone (must be on dev or any branch):
77
+
78
+ ```bash
79
+ # Ensure dev is current
80
+ git fetch origin dev
81
+
82
+ # Create a worktree per issue — siblings to the main clone
83
+ git worktree add ../squad-195 -b squad/195-fix-stamp-bug origin/dev
84
+ git worktree add ../squad-193 -b squad/193-refactor-loader origin/dev
85
+ ```
86
+
87
+ **Naming convention:** `../{repo-name}-{issue-number}` (e.g., `../squad-195`, `../squad-pr-42`).
88
+
89
+ Each worktree:
90
+ - Has its own working directory and index
91
+ - Is on its own `squad/{issue-number}-{slug}` branch from dev
92
+ - Shares the same `.git` object store (disk-efficient)
93
+
94
+ ### Per-Worktree Agent Workflow
95
+
96
+ Each agent operates inside its worktree exactly like the single-issue workflow:
97
+
98
+ ```bash
99
+ cd ../squad-195
100
+
101
+ # Work normally — commits, tests, pushes
102
+ git add -A && git commit -m "fix: stamp bug (#195)"
103
+ git push -u origin squad/195-fix-stamp-bug
104
+
105
+ # Create PR targeting dev
106
+ gh pr create --base dev --title "fix: stamp bug" --body "Closes #195" --draft
107
+ ```
108
+
109
+ All PRs target `dev` independently. Agents never interfere with each other's filesystem.
110
+
111
+ ### .squad/ State in Worktrees
112
+
113
+ The `.squad/` directory exists in each worktree as a copy. This is safe because:
114
+ - `.gitattributes` declares `merge=union` on append-only files (history.md, decisions.md, logs)
115
+ - Each agent appends to its own section; union merge reconciles on PR merge to dev
116
+ - **Rule:** Never rewrite or reorder `.squad/` files in a worktree — append only
117
+
118
+ ### Cleanup After Merge
119
+
120
+ After a worktree's PR is merged to dev:
121
+
122
+ ```bash
123
+ # From the main clone
124
+ git worktree remove ../squad-195
125
+ git worktree prune # clean stale metadata
126
+ git branch -d squad/195-fix-stamp-bug
127
+ git push origin --delete squad/195-fix-stamp-bug
128
+ ```
129
+
130
+ If a worktree was deleted manually (rm -rf), `git worktree prune` recovers the state.
131
+
132
+ ---
133
+
134
+ ## Multi-Repo Downstream Scenarios
135
+
136
+ When work spans multiple repositories (e.g., squad-cli changes need squad-sdk changes, or a user's app depends on squad):
137
+
138
+ ### Setup
139
+
140
+ Clone downstream repos as siblings to the main repo:
141
+
142
+ ```
143
+ ~/work/
144
+ squad-pr/ # main repo
145
+ squad-sdk/ # downstream dependency
146
+ user-app/ # consumer project
147
+ ```
148
+
149
+ Each repo gets its own issue branch following its own naming convention. If the downstream repo also uses Squad conventions, use `squad/{issue-number}-{slug}`.
150
+
151
+ ### Coordinated PRs
152
+
153
+ - Create PRs in each repo independently
154
+ - Link them in PR descriptions:
155
+ ```
156
+ Closes #42
157
+
158
+ **Depends on:** squad-sdk PR #17 (squad-sdk changes required for this feature)
159
+ ```
160
+ - Merge order: dependencies first (e.g., squad-sdk), then dependents (e.g., squad-cli)
161
+
162
+ ### Local Linking for Testing
163
+
164
+ Before pushing, verify cross-repo changes work together:
165
+
166
+ ```bash
167
+ # Node.js / npm
168
+ cd ../squad-sdk && npm link
169
+ cd ../squad-pr && npm link squad-sdk
170
+
171
+ # Go
172
+ # Use replace directive in go.mod:
173
+ # replace github.com/org/squad-sdk => ../squad-sdk
174
+
175
+ # Python
176
+ cd ../squad-sdk && pip install -e .
177
+ ```
178
+
179
+ **Important:** Remove local links before committing. `npm link` and `go replace` are dev-only — CI must use published packages or PR-specific refs.
180
+
181
+ ### Worktrees + Multi-Repo
182
+
183
+ These compose naturally. You can have:
184
+ - Multiple worktrees in the main repo (parallel issues)
185
+ - Separate clones for downstream repos
186
+ - Each combination operates independently
187
+
188
+ ---
189
+
190
+ ## Anti-Patterns
191
+
192
+ - ❌ Branching from main (branch from dev)
193
+ - ❌ PR targeting main directly (target dev)
194
+ - ❌ Non-conforming branch names (must be squad/{number}-{slug})
195
+ - ❌ Committing directly to main or dev (use PRs)
196
+ - ❌ Switching branches in the main clone while worktrees are active (use worktrees instead)
197
+ - ❌ Using worktrees for cross-repo work (use separate clones)
198
+ - ❌ Leaving stale worktrees after PR merge (clean up immediately)
199
+
200
+ ## Promotion Pipeline
201
+
202
+ - dev → insiders: Automated sync on green build
203
+ - dev → main: Manual merge when ready for stable release, then tag
204
+ - Hotfixes: Branch from main as `hotfix/{slug}`, PR to dev, cherry-pick to main if urgent
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: github-multi-account
3
+ description: Detect and set up account-locked gh aliases for multi-account GitHub. The AI reads this skill, detects accounts, asks the user which is personal/work, and runs the setup automatically.
4
+ confidence: high
5
+ source: https://github.com/tamirdresher/squad-skills/tree/main/plugins/github-multi-account
6
+ author: tamirdresher
7
+ ---
8
+
9
+ # GitHub Multi-Account — AI-Driven Setup
10
+
11
+ ## When to Activate
12
+ When the user has multiple GitHub accounts (check with `gh auth status`). If you see 2+ accounts listed, this skill applies.
13
+
14
+ ## What to Do (as the AI agent)
15
+
16
+ ### Step 1: Detect accounts
17
+ Run: `gh auth status`
18
+ Look for multiple accounts. Note which usernames are listed.
19
+
20
+ ### Step 2: Ask the user
21
+ Ask: "I see you have multiple GitHub accounts: {list them}. Which one is your personal account and which is your work/EMU account?"
22
+
23
+ ### Step 3: Run the setup automatically
24
+ Once the user confirms, do ALL of this for them:
25
+
26
+ ```powershell
27
+ # 1. Define the functions
28
+ $personal = "THEIR_PERSONAL_USERNAME"
29
+ $work = "THEIR_WORK_USERNAME"
30
+
31
+ # 2. Add to PowerShell profile
32
+ $profilePath = $PROFILE.CurrentUserAllHosts
33
+ if (!(Test-Path $profilePath)) { New-Item -Path $profilePath -Force | Out-Null }
34
+ $existing = Get-Content $profilePath -Raw -ErrorAction SilentlyContinue
35
+ if ($existing -notmatch "gh-personal") {
36
+ $block = @"
37
+
38
+ # === GitHub Multi-Account Aliases ===
39
+ function gh-personal { gh auth switch --user $personal 2>`$null | Out-Null; gh @args }
40
+ function gh-work { gh auth switch --user $work 2>`$null | Out-Null; gh @args }
41
+ Set-Alias ghp gh-personal
42
+ Set-Alias ghw gh-work
43
+ "@
44
+ Add-Content -Path $profilePath -Value $block
45
+ }
46
+
47
+ # 3. Create CMD wrappers
48
+ $binDir = Join-Path $env:USERPROFILE ".squad\bin"
49
+ if (!(Test-Path $binDir)) { New-Item -ItemType Directory -Path $binDir -Force | Out-Null }
50
+ "@echo off`ngh auth switch --user $personal >nul 2>&1`ngh %*" | Out-File "$binDir\ghp.cmd" -Encoding ascii
51
+ "@echo off`ngh auth switch --user $work >nul 2>&1`ngh %*" | Out-File "$binDir\ghw.cmd" -Encoding ascii
52
+
53
+ # 4. Add to PATH
54
+ $userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
55
+ if ($userPath -notmatch [regex]::Escape($binDir)) {
56
+ [Environment]::SetEnvironmentVariable("PATH", "$binDir;$userPath", "User")
57
+ $env:PATH = "$binDir;$env:PATH"
58
+ }
59
+
60
+ # 5. Load in current session
61
+ function gh-personal { gh auth switch --user $personal 2>$null | Out-Null; gh @args }
62
+ function gh-work { gh auth switch --user $work 2>$null | Out-Null; gh @args }
63
+ Set-Alias ghp gh-personal
64
+ Set-Alias ghw gh-work
65
+ ```
66
+
67
+ ### Step 4: Verify for the user
68
+ Run these and show the results:
69
+ ```powershell
70
+ ghp api user --jq '.login' # should show personal username
71
+ ghw api user --jq '.login' # should show work username
72
+ ```
73
+
74
+ ### Step 5: Tell the user
75
+ "All set! From now on use `ghp` for personal repos and `ghw` for work repos. I'll use them too."
76
+
77
+ ## After Setup — Usage Rules
78
+
79
+ 1. **NEVER** use bare `gh` for repo operations — always `ghp` or `ghw`
80
+ 2. **NEVER** manually `gh auth switch` — the aliases handle it
81
+ 3. Determine alias by repo owner:
82
+ - Personal account repos → `ghp` / `gh-personal`
83
+ - Work/EMU account repos → `ghw` / `gh-work`
84
+
85
+ ## Repo-Specific Account Binding
86
+
87
+ This repo (`bradygaster/squad`) is bound to the **bradygaster** (personal) account.
88
+ All `gh` operations in this repo MUST use `ghp` / `gh-personal`.
89
+
90
+ ## For Squad Agents
91
+ At the TOP of any script touching GitHub, define:
92
+ ```powershell
93
+ function gh-personal { gh auth switch --user bradygaster 2>$null | Out-Null; gh @args }
94
+ function gh-work { gh auth switch --user bradyg_microsoft 2>$null | Out-Null; gh @args }
95
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: history-hygiene
3
+ description: Record final outcomes to history.md, not intermediate requests or reversed decisions
4
+ domain: documentation, team-collaboration
5
+ confidence: high
6
+ source: earned (Kobayashi v0.6.0 incident, team intervention)
7
+ ---
8
+
9
+ ## Context
10
+
11
+ History files (.md files tracking decisions, spawns, outcomes) are read cold by future agents. Stale or incorrect entries poison decision-making downstream. The Kobayashi incident proved this: history said "Brady decided v0.6.0" when Brady had reversed that to v0.8.17. Future spawns read the wrong truth and repeated the mistake.
12
+
13
+ ## Patterns
14
+
15
+ - **Record the final outcome**, not the initial request.
16
+ - **Wait for confirmation** before writing to history — don't log intermediate states.
17
+ - **If a decision reverses**, update the entry immediately — don't leave stale data.
18
+ - **One read = one truth.** A future agent should never need to cross-reference other files to understand what actually happened.
19
+
20
+ ## Examples
21
+
22
+ ✓ **Correct:**
23
+ - "Migration target: v0.8.17 (initially discussed as v0.6.0, corrected by Brady)"
24
+ - "Reverted to Node 18 per Brady's explicit request on 2024-01-15"
25
+
26
+ ✗ **Incorrect:**
27
+ - "Brady directed v0.6.0" (when later reversed)
28
+ - Recording what was *requested* instead of what *actually happened*
29
+ - Logging entries before outcome is confirmed
30
+
31
+ ## Anti-Patterns
32
+
33
+ - Writing intermediate or "for now" states to disk
34
+ - Attributing decisions without confirming final direction
35
+ - Treating history like a draft — history is the source of truth
36
+ - Assuming readers will cross-reference or verify; they won't
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: "humanizer"
3
+ description: "Tone enforcement patterns for external-facing community responses"
4
+ domain: "communication, tone, community"
5
+ confidence: "low"
6
+ source: "manual (RFC #426 — PAO External Communications)"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Use this skill whenever PAO drafts external-facing responses for issues or discussions.
12
+
13
+ - Tone must be warm, helpful, and human-sounding — never robotic or corporate.
14
+ - Brady's constraint applies everywhere: **Humanized tone is mandatory**.
15
+ - This applies to **all external-facing content** drafted by PAO in Phase 1 issues/discussions workflows.
16
+
17
+ ## Patterns
18
+
19
+ 1. **Warm opening** — Start with acknowledgment ("Thanks for reporting this", "Great question!")
20
+ 2. **Active voice** — "We're looking into this" not "This is being investigated"
21
+ 3. **Second person** — Address the person directly ("you" not "the user")
22
+ 4. **Conversational connectors** — "That said...", "Here's what we found...", "Quick note:"
23
+ 5. **Specific, not vague** — "This affects the casting module in v0.8.x" not "We are aware of issues"
24
+ 6. **Empathy markers** — "I can see how that would be frustrating", "Good catch!"
25
+ 7. **Action-oriented closes** — "Let us know if that helps!" not "Please advise if further assistance is required"
26
+ 8. **Uncertainty is OK** — "We're not 100% sure yet, but here's what we think is happening..." is better than false confidence
27
+ 9. **Profanity filter** — Never include profanity, slurs, or aggressive language, even when quoting
28
+ 10. **Baseline comparison** — Responses should align with tone of 5-10 "gold standard" responses (>80% similarity threshold)
29
+ 11. **Empathetic disagreement** — "We hear you. That's a fair concern." before explaining the reasoning
30
+ 12. **Information request** — Ask for specific details, not open-ended "can you provide more info?"
31
+ 13. **No link-dumping** — Don't just paste URLs. Provide context: "Check out the [getting started guide](url) — specifically the section on routing" not just a bare link
32
+
33
+ ## Examples
34
+
35
+ ### 1. Welcome
36
+
37
+ ```text
38
+ Hey {author}! Welcome to Squad 👋 Thanks for opening this.
39
+ {substantive response}
40
+ Let us know if you have questions — happy to help!
41
+ ```
42
+
43
+ ### 2. Troubleshooting
44
+
45
+ ```text
46
+ Thanks for the detailed report, {author}!
47
+ Here's what we think is happening: {explanation}
48
+ {steps or workaround}
49
+ Let us know if that helps, or if you're seeing something different.
50
+ ```
51
+
52
+ ### 3. Feature guidance
53
+
54
+ ```text
55
+ Great question! {context on current state}
56
+ {guidance or workaround}
57
+ We've noted this as a potential improvement — {tracking info if applicable}.
58
+ ```
59
+
60
+ ### 4. Redirect
61
+
62
+ ```text
63
+ Thanks for reaching out! This one is actually better suited for {correct location}.
64
+ {brief explanation of why}
65
+ Feel free to open it there — they'll be able to help!
66
+ ```
67
+
68
+ ### 5. Acknowledgment
69
+
70
+ ```text
71
+ Good catch, {author}. We've confirmed this is a real issue.
72
+ {what we know so far}
73
+ We'll update this thread when we have a fix. Thanks for flagging it!
74
+ ```
75
+
76
+ ### 6. Closing
77
+
78
+ ```text
79
+ This should be resolved in {version/PR}! 🎉
80
+ {brief summary of what changed}
81
+ Thanks for reporting this, {author} — it made Squad better.
82
+ ```
83
+
84
+ ### 7. Technical uncertainty
85
+
86
+ ```text
87
+ Interesting find, {author}. We're not 100% sure what's causing this yet.
88
+ Here's what we've ruled out: {list}
89
+ We'd love more context if you have it — {specific ask}.
90
+ We'll dig deeper and update this thread.
91
+ ```
92
+
93
+ ## Anti-Patterns
94
+
95
+ - ❌ Corporate speak: "We appreciate your patience as we investigate this matter"
96
+ - ❌ Marketing hype: "Squad is the BEST way to..." or "This amazing feature..."
97
+ - ❌ Passive voice: "It has been determined that..." or "The issue is being tracked"
98
+ - ❌ Dismissive: "This works as designed" without empathy
99
+ - ❌ Over-promising: "We'll ship this next week" without commitment from the team
100
+ - ❌ Empty acknowledgment: "Thanks for your feedback" with no substance
101
+ - ❌ Robot signatures: "Best regards, PAO" or "Sincerely, The Squad Team"
102
+ - ❌ Excessive emoji: More than 1-2 emoji per response
103
+ - ❌ Quoting profanity: Even when the original issue contains it, paraphrase instead
104
+ - ❌ Link-dumping: Pasting URLs without context ("See: https://...")
105
+ - ❌ Open-ended info requests: "Can you provide more information?" without specifying what information
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: "init-mode"
3
+ description: "Team initialization flow (Phase 1 proposal + Phase 2 creation)"
4
+ domain: "orchestration"
5
+ confidence: "high"
6
+ source: "extracted"
7
+ tools:
8
+ - name: "ask_user"
9
+ description: "Confirm team roster with selectable menu"
10
+ when: "Phase 1 proposal — requires explicit user confirmation"
11
+ ---
12
+
13
+ ## Context
14
+
15
+ Init Mode activates when `.squad/team.md` does not exist, or exists but has zero roster entries under `## Members`. The coordinator proposes a team (Phase 1), waits for user confirmation, then creates the team structure (Phase 2).
16
+
17
+ ## Patterns
18
+
19
+ ### Phase 1: Propose the Team
20
+
21
+ No team exists yet. Propose one — but **DO NOT create any files until the user confirms.**
22
+
23
+ 1. **Identify the user.** Run `git config user.name` to learn who you're working with. Use their name in conversation (e.g., *"Hey Brady, 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.**
24
+ 2. Ask: *"What are you building? (language, stack, what it does)"*
25
+ 3. **Cast the team.** Before proposing names, run the Casting & Persistent Naming algorithm (see that section):
26
+ - Determine team size (typically 4–5 + Scribe).
27
+ - Determine assignment shape from the user's project description.
28
+ - Derive resonance signals from the session and repo context.
29
+ - Select a universe. If the universe is custom, allocate character names from that universe based on the related list found in the `.squad/templates/casting/` directory. Prefer custom universes when available.
30
+ - Scribe is always "Scribe" — exempt from casting.
31
+ - Ralph is always "Ralph" — exempt from casting.
32
+ 4. Propose the team with their cast names. Example (names will vary per cast):
33
+
34
+ ```
35
+ 🏗️ {CastName1} — Lead Scope, decisions, code review
36
+ ⚛️ {CastName2} — Frontend Dev React, UI, components
37
+ 🔧 {CastName3} — Backend Dev APIs, database, services
38
+ 🧪 {CastName4} — Tester Tests, quality, edge cases
39
+ 📋 Scribe — (silent) Memory, decisions, session logs
40
+ 🔄 Ralph — (monitor) Work queue, backlog, keep-alive
41
+ ```
42
+
43
+ 5. Use the `ask_user` tool to confirm the roster. Provide choices so the user sees a selectable menu:
44
+ - **question:** *"Look right?"*
45
+ - **choices:** `["Yes, hire this team", "Add someone", "Change a role"]`
46
+
47
+ **⚠️ STOP. Your response ENDS here. Do NOT proceed to Phase 2. Do NOT create any files or directories. Wait for the user's reply.**
48
+
49
+ ### Phase 2: Create the Team
50
+
51
+ **Trigger:** The user replied to Phase 1 with confirmation ("yes", "looks good", or similar affirmative), OR the user's reply to Phase 1 is a task (treat as implicit "yes").
52
+
53
+ > If the user said "add someone" or "change a role," go back to Phase 1 step 3 and re-propose. Do NOT enter Phase 2 until the user confirms.
54
+
55
+ 6. Create the `.squad/` directory structure (see `.squad/templates/` for format guides or use the standard structure: team.md, routing.md, ceremonies.md, decisions.md, decisions/inbox/, casting/, agents/, orchestration-log/, skills/, log/).
56
+
57
+ **Casting state initialization:** Copy `.squad/templates/casting-policy.json` to `.squad/casting/policy.json` (or create from defaults). Create `registry.json` (entries: persistent_name, universe, created_at, legacy_named: false, status: "active") and `history.json` (first assignment snapshot with unique assignment_id).
58
+
59
+ **Seeding:** Each agent's `history.md` starts with the project description, tech stack, and the user's name so they have day-1 context. Agent folder names are the cast name in lowercase (e.g., `.squad/agents/ripley/`). The Scribe's charter includes maintaining `decisions.md` and cross-agent context sharing.
60
+
61
+ **Team.md structure:** `team.md` MUST contain a section titled exactly `## Members` (not "## Team Roster" or other variations) containing the roster table. This header is hard-coded in GitHub workflows (`squad-heartbeat.yml`, `squad-issue-assign.yml`, `squad-triage.yml`, `sync-squad-labels.yml`) for label automation. If the header is missing or titled differently, label routing breaks.
62
+
63
+ **Merge driver for append-only files:** Create or update `.gitattributes` at the repo root to enable conflict-free merging of `.squad/` state across branches:
64
+ ```
65
+ .squad/decisions.md merge=union
66
+ .squad/agents/*/history.md merge=union
67
+ .squad/log/** merge=union
68
+ .squad/orchestration-log/** merge=union
69
+ ```
70
+ The `union` merge driver keeps all lines from both sides, which is correct for append-only files. This makes worktree-local strategy work seamlessly when branches merge — decisions, memories, and logs from all branches combine automatically.
71
+
72
+ 7. Say: *"✅ Team hired. Try: '{FirstCastName}, set up the project structure'"*
73
+
74
+ 8. **Post-setup input sources** (optional — ask after team is created, not during casting):
75
+ - PRD/spec: *"Do you have a PRD or spec document? (file path, paste it, or skip)"* → If provided, follow PRD Mode flow
76
+ - GitHub issues: *"Is there a GitHub repo with issues I should pull from? (owner/repo, or skip)"* → If provided, follow GitHub Issues Mode flow
77
+ - Human members: *"Are any humans joining the team? (names and roles, or just AI for now)"* → If provided, add per Human Team Members section
78
+ - Copilot agent: *"Want to include @copilot? It can pick up issues autonomously. (yes/no)"* → If yes, follow Copilot Coding Agent Member section and ask about auto-assignment
79
+ - These are additive. Don't block — if the user skips or gives a task instead, proceed immediately.
80
+
81
+ ## Examples
82
+
83
+ **Example flow:**
84
+ 1. Coordinator detects no team.md → Init Mode
85
+ 2. Runs `git config user.name` → "Brady"
86
+ 3. Asks: *"Hey Brady, what are you building?"*
87
+ 4. User: *"TypeScript CLI tool with GitHub API integration"*
88
+ 5. Coordinator runs casting algorithm → selects "The Usual Suspects" universe
89
+ 6. Proposes: Keaton (Lead), Verbal (Prompt), Fenster (Backend), Hockney (Tester), Scribe, Ralph
90
+ 7. Uses `ask_user` with choices → user selects "Yes, hire this team"
91
+ 8. Coordinator creates `.squad/` structure, initializes casting state, seeds agents
92
+ 9. Says: *"✅ Team hired. Try: 'Keaton, set up the project structure'"*
93
+
94
+ ## Anti-Patterns
95
+
96
+ - ❌ Creating files before user confirms Phase 1
97
+ - ❌ Mixing agents from different universes in the same cast
98
+ - ❌ Skipping the `ask_user` tool and assuming confirmation
99
+ - ❌ Proceeding to Phase 2 when user said "add someone" or "change a role"
100
+ - ❌ Using `## Team Roster` instead of `## Members` as the header (breaks GitHub workflows)
101
+ - ❌ Forgetting to initialize `.squad/casting/` state files
102
+ - ❌ Reading or storing `git config user.email` (PII violation)
@@ -0,0 +1,117 @@
1
+ # Model Selection
2
+
3
+ > Determines which LLM model to use for each agent spawn.
4
+
5
+ ## SCOPE
6
+
7
+ ✅ THIS SKILL PRODUCES:
8
+ - A resolved `model` parameter for every `task` tool call
9
+ - Persistent model preferences in `.squad/config.json`
10
+ - Spawn acknowledgments that include the resolved model
11
+
12
+ ❌ THIS SKILL DOES NOT PRODUCE:
13
+ - Code, tests, or documentation
14
+ - Model performance benchmarks
15
+ - Cost reports or billing artifacts
16
+
17
+ ## Context
18
+
19
+ Squad supports 18+ models across three tiers (premium, standard, fast). The coordinator must select the right model for each agent spawn. Users can set persistent preferences that survive across sessions.
20
+
21
+ ## 5-Layer Model Resolution Hierarchy
22
+
23
+ Resolution is **first-match-wins** — the highest layer with a value wins.
24
+
25
+ | Layer | Name | Source | Persistence |
26
+ |-------|------|--------|-------------|
27
+ | **0a** | Per-Agent Config | `.squad/config.json` → `agentModelOverrides.{name}` | Persistent (survives sessions) |
28
+ | **0b** | Global Config | `.squad/config.json` → `defaultModel` | Persistent (survives sessions) |
29
+ | **1** | Session Directive | User said "use X" in current session | Session-only |
30
+ | **2** | Charter Preference | Agent's `charter.md` → `## Model` section | Persistent (in charter) |
31
+ | **3** | Task-Aware Auto | Code → sonnet, docs → haiku, visual → opus | Computed per-spawn |
32
+ | **4** | Default | `claude-haiku-4.5` | Hardcoded fallback |
33
+
34
+ **Key principle:** Layer 0 (persistent config) beats everything. If the user said "always use opus" and it was saved to config.json, every agent gets opus regardless of role or task type. This is intentional — the user explicitly chose quality over cost.
35
+
36
+ ## AGENT WORKFLOW
37
+
38
+ ### On Session Start
39
+
40
+ 1. READ `.squad/config.json`
41
+ 2. CHECK for `defaultModel` field — if present, this is the Layer 0 override for all spawns
42
+ 3. CHECK for `agentModelOverrides` field — if present, these are per-agent Layer 0a overrides
43
+ 4. STORE both values in session context for the duration
44
+
45
+ ### On Every Agent Spawn
46
+
47
+ 1. CHECK Layer 0a: Is there an `agentModelOverrides.{agentName}` in config.json? → Use it.
48
+ 2. CHECK Layer 0b: Is there a `defaultModel` in config.json? → Use it.
49
+ 3. CHECK Layer 1: Did the user give a session directive? → Use it.
50
+ 4. CHECK Layer 2: Does the agent's charter have a `## Model` section? → Use it.
51
+ 5. CHECK Layer 3: Determine task type:
52
+ - Code (implementation, tests, refactoring, bug fixes) → `claude-sonnet-4.6`
53
+ - Prompts, agent designs → `claude-sonnet-4.6`
54
+ - Visual/design with image analysis → `claude-opus-4.6`
55
+ - Non-code (docs, planning, triage, changelogs) → `claude-haiku-4.5`
56
+ 6. FALLBACK Layer 4: `claude-haiku-4.5`
57
+ 7. INCLUDE model in spawn acknowledgment: `🔧 {Name} ({resolved_model}) — {task}`
58
+
59
+ ### When User Sets a Preference
60
+
61
+ **Trigger phrases:** "always use X", "use X for everything", "switch to X", "default to X"
62
+
63
+ 1. VALIDATE the model ID against the catalog (18+ models)
64
+ 2. WRITE `defaultModel` to `.squad/config.json` (merge, don't overwrite)
65
+ 3. ACKNOWLEDGE: `✅ Model preference saved: {model} — all future sessions will use this until changed.`
66
+
67
+ **Per-agent trigger:** "use X for {agent}"
68
+
69
+ 1. VALIDATE model ID
70
+ 2. WRITE to `agentModelOverrides.{agent}` in `.squad/config.json`
71
+ 3. ACKNOWLEDGE: `✅ {Agent} will always use {model} — saved to config.`
72
+
73
+ ### When User Clears a Preference
74
+
75
+ **Trigger phrases:** "switch back to automatic", "clear model preference", "use default models"
76
+
77
+ 1. REMOVE `defaultModel` from `.squad/config.json`
78
+ 2. ACKNOWLEDGE: `✅ Model preference cleared — returning to automatic selection.`
79
+
80
+ ### STOP
81
+
82
+ After resolving the model and including it in the spawn template, this skill is done. Do NOT:
83
+ - Generate model comparison reports
84
+ - Run benchmarks or speed tests
85
+ - Create new config files (only modify existing `.squad/config.json`)
86
+ - Change the model after spawn (fallback chains handle runtime failures)
87
+
88
+ ## Config Schema
89
+
90
+ `.squad/config.json` model-related fields:
91
+
92
+ ```json
93
+ {
94
+ "version": 1,
95
+ "defaultModel": "claude-opus-4.6",
96
+ "agentModelOverrides": {
97
+ "fenster": "claude-sonnet-4.6",
98
+ "mcmanus": "claude-haiku-4.5"
99
+ }
100
+ }
101
+ ```
102
+
103
+ - `defaultModel` — applies to ALL agents unless overridden by `agentModelOverrides`
104
+ - `agentModelOverrides` — per-agent overrides that take priority over `defaultModel`
105
+ - Both fields are optional. When absent, Layers 1-4 apply normally.
106
+
107
+ ## Fallback Chains
108
+
109
+ If a model is unavailable (rate limit, plan restriction), retry within the same tier:
110
+
111
+ ```
112
+ Premium: claude-opus-4.6 → claude-opus-4.6-fast → claude-opus-4.5 → claude-sonnet-4.6
113
+ Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → claude-sonnet-4
114
+ Fast: claude-haiku-4.5 → gpt-5.1-codex-mini → gpt-4.1 → gpt-5-mini
115
+ ```
116
+
117
+ **Never fall UP in tier.** A fast task won't land on a premium model via fallback.
@@ -0,0 +1,24 @@
1
+ # Skill: nap
2
+
3
+ > Context hygiene — compress, prune, archive .squad/ state
4
+
5
+ ## What It Does
6
+
7
+ Reclaims context window budget by compressing agent histories, pruning old logs,
8
+ archiving stale decisions, and cleaning orphaned inbox files.
9
+
10
+ ## When To Use
11
+
12
+ - Before heavy fan-out work (many agents will spawn)
13
+ - When history.md files exceed 15KB
14
+ - When .squad/ total size exceeds 1MB
15
+ - After long-running sessions or sprints
16
+
17
+ ## Invocation
18
+
19
+ - CLI: `squad nap` / `squad nap --deep` / `squad nap --dry-run`
20
+ - REPL: `/nap` / `/nap --dry-run` / `/nap --deep`
21
+
22
+ ## Confidence
23
+
24
+ medium — Confirmed by team vote (4-1) and initial implementation