@bradygaster/squad-sdk 0.9.1 → 0.9.2-insider.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/README.md +340 -296
  2. package/dist/agents/history-shadow.d.ts +7 -5
  3. package/dist/agents/history-shadow.d.ts.map +1 -1
  4. package/dist/agents/history-shadow.js +69 -78
  5. package/dist/agents/history-shadow.js.map +1 -1
  6. package/dist/agents/index.d.ts +12 -1
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/agents/index.js +62 -9
  9. package/dist/agents/index.js.map +1 -1
  10. package/dist/agents/lifecycle.d.ts +4 -0
  11. package/dist/agents/lifecycle.d.ts.map +1 -1
  12. package/dist/agents/lifecycle.js +6 -7
  13. package/dist/agents/lifecycle.js.map +1 -1
  14. package/dist/agents/onboarding.d.ts +4 -2
  15. package/dist/agents/onboarding.d.ts.map +1 -1
  16. package/dist/agents/onboarding.js +26 -16
  17. package/dist/agents/onboarding.js.map +1 -1
  18. package/dist/agents/personal.d.ts +2 -1
  19. package/dist/agents/personal.d.ts.map +1 -1
  20. package/dist/agents/personal.js +11 -12
  21. package/dist/agents/personal.js.map +1 -1
  22. package/dist/build/bundle.d.ts.map +1 -1
  23. package/dist/build/bundle.js +6 -6
  24. package/dist/build/bundle.js.map +1 -1
  25. package/dist/build/github-dist.js +42 -42
  26. package/dist/build/release.d.ts.map +1 -1
  27. package/dist/build/release.js +7 -5
  28. package/dist/build/release.js.map +1 -1
  29. package/dist/casting/index.d.ts.map +1 -1
  30. package/dist/casting/index.js +4 -3
  31. package/dist/casting/index.js.map +1 -1
  32. package/dist/config/agent-source.d.ts +5 -1
  33. package/dist/config/agent-source.d.ts.map +1 -1
  34. package/dist/config/agent-source.js +85 -41
  35. package/dist/config/agent-source.js.map +1 -1
  36. package/dist/config/init.d.ts +4 -3
  37. package/dist/config/init.d.ts.map +1 -1
  38. package/dist/config/init.js +257 -236
  39. package/dist/config/init.js.map +1 -1
  40. package/dist/config/legacy-fallback.d.ts +3 -2
  41. package/dist/config/legacy-fallback.d.ts.map +1 -1
  42. package/dist/config/legacy-fallback.js +16 -14
  43. package/dist/config/legacy-fallback.js.map +1 -1
  44. package/dist/config/models.d.ts +9 -6
  45. package/dist/config/models.d.ts.map +1 -1
  46. package/dist/config/models.js +35 -25
  47. package/dist/config/models.js.map +1 -1
  48. package/dist/index.d.ts +5 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +14 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/marketplace/packaging.d.ts.map +1 -1
  53. package/dist/marketplace/packaging.js +18 -16
  54. package/dist/marketplace/packaging.js.map +1 -1
  55. package/dist/multi-squad.d.ts.map +1 -1
  56. package/dist/multi-squad.js +10 -9
  57. package/dist/multi-squad.js.map +1 -1
  58. package/dist/platform/comms-file-log.d.ts.map +1 -1
  59. package/dist/platform/comms-file-log.js +7 -6
  60. package/dist/platform/comms-file-log.js.map +1 -1
  61. package/dist/platform/comms.d.ts.map +1 -1
  62. package/dist/platform/comms.js +6 -5
  63. package/dist/platform/comms.js.map +1 -1
  64. package/dist/platform/index.d.ts.map +1 -1
  65. package/dist/platform/index.js +4 -3
  66. package/dist/platform/index.js.map +1 -1
  67. package/dist/ralph/capabilities.d.ts +30 -1
  68. package/dist/ralph/capabilities.d.ts.map +1 -1
  69. package/dist/ralph/capabilities.js +51 -6
  70. package/dist/ralph/capabilities.js.map +1 -1
  71. package/dist/ralph/index.d.ts +1 -1
  72. package/dist/ralph/index.d.ts.map +1 -1
  73. package/dist/ralph/index.js +4 -3
  74. package/dist/ralph/index.js.map +1 -1
  75. package/dist/ralph/rate-limiting.d.ts.map +1 -1
  76. package/dist/ralph/rate-limiting.js +4 -4
  77. package/dist/ralph/rate-limiting.js.map +1 -1
  78. package/dist/remote/bridge.d.ts.map +1 -1
  79. package/dist/remote/bridge.js +2 -2
  80. package/dist/remote/bridge.js.map +1 -1
  81. package/dist/resolution.d.ts +9 -0
  82. package/dist/resolution.d.ts.map +1 -1
  83. package/dist/resolution.js +39 -16
  84. package/dist/resolution.js.map +1 -1
  85. package/dist/roles/catalog.d.ts +1 -1
  86. package/dist/runtime/config.d.ts.map +1 -1
  87. package/dist/runtime/config.js +8 -7
  88. package/dist/runtime/config.js.map +1 -1
  89. package/dist/runtime/cross-squad.d.ts.map +1 -1
  90. package/dist/runtime/cross-squad.js +8 -7
  91. package/dist/runtime/cross-squad.js.map +1 -1
  92. package/dist/runtime/scheduler.d.ts.map +1 -1
  93. package/dist/runtime/scheduler.js +8 -8
  94. package/dist/runtime/scheduler.js.map +1 -1
  95. package/dist/runtime/squad-observer.d.ts.map +1 -1
  96. package/dist/runtime/squad-observer.js +7 -4
  97. package/dist/runtime/squad-observer.js.map +1 -1
  98. package/dist/sharing/consult.d.ts +1 -1
  99. package/dist/sharing/consult.d.ts.map +1 -1
  100. package/dist/sharing/consult.js +144 -142
  101. package/dist/sharing/consult.js.map +1 -1
  102. package/dist/sharing/export.d.ts.map +1 -1
  103. package/dist/sharing/export.js +16 -16
  104. package/dist/sharing/export.js.map +1 -1
  105. package/dist/sharing/import.d.ts.map +1 -1
  106. package/dist/sharing/import.js +13 -12
  107. package/dist/sharing/import.js.map +1 -1
  108. package/dist/skills/skill-loader.d.ts.map +1 -1
  109. package/dist/skills/skill-loader.js +10 -9
  110. package/dist/skills/skill-loader.js.map +1 -1
  111. package/dist/skills/skill-script-loader.d.ts.map +1 -1
  112. package/dist/skills/skill-script-loader.js +6 -4
  113. package/dist/skills/skill-script-loader.js.map +1 -1
  114. package/dist/skills/skill-source.d.ts +3 -1
  115. package/dist/skills/skill-source.d.ts.map +1 -1
  116. package/dist/skills/skill-source.js +18 -16
  117. package/dist/skills/skill-source.js.map +1 -1
  118. package/dist/state/collection-map.d.ts +43 -0
  119. package/dist/state/collection-map.d.ts.map +1 -0
  120. package/dist/state/collection-map.js +9 -0
  121. package/dist/state/collection-map.js.map +1 -0
  122. package/dist/state/collections.d.ts +102 -0
  123. package/dist/state/collections.d.ts.map +1 -0
  124. package/dist/state/collections.js +317 -0
  125. package/dist/state/collections.js.map +1 -0
  126. package/dist/state/domain-types.d.ts +122 -0
  127. package/dist/state/domain-types.d.ts.map +1 -0
  128. package/dist/state/domain-types.js +54 -0
  129. package/dist/state/domain-types.js.map +1 -0
  130. package/dist/state/handles.d.ts +16 -0
  131. package/dist/state/handles.d.ts.map +1 -0
  132. package/dist/state/handles.js +161 -0
  133. package/dist/state/handles.js.map +1 -0
  134. package/dist/state/index.d.ts +17 -0
  135. package/dist/state/index.d.ts.map +1 -0
  136. package/dist/state/index.js +15 -0
  137. package/dist/state/index.js.map +1 -0
  138. package/dist/state/io/charter-io.d.ts +28 -0
  139. package/dist/state/io/charter-io.d.ts.map +1 -0
  140. package/dist/state/io/charter-io.js +94 -0
  141. package/dist/state/io/charter-io.js.map +1 -0
  142. package/dist/state/io/decisions-io.d.ts +42 -0
  143. package/dist/state/io/decisions-io.d.ts.map +1 -0
  144. package/dist/state/io/decisions-io.js +66 -0
  145. package/dist/state/io/decisions-io.js.map +1 -0
  146. package/dist/state/io/history-io.d.ts +37 -0
  147. package/dist/state/io/history-io.d.ts.map +1 -0
  148. package/dist/state/io/history-io.js +102 -0
  149. package/dist/state/io/history-io.js.map +1 -0
  150. package/dist/state/io/index.d.ts +19 -0
  151. package/dist/state/io/index.d.ts.map +1 -0
  152. package/dist/state/io/index.js +19 -0
  153. package/dist/state/io/index.js.map +1 -0
  154. package/dist/state/io/routing-io.d.ts +37 -0
  155. package/dist/state/io/routing-io.d.ts.map +1 -0
  156. package/dist/state/io/routing-io.js +99 -0
  157. package/dist/state/io/routing-io.js.map +1 -0
  158. package/dist/state/io/team-io.d.ts +46 -0
  159. package/dist/state/io/team-io.d.ts.map +1 -0
  160. package/dist/state/io/team-io.js +82 -0
  161. package/dist/state/io/team-io.js.map +1 -0
  162. package/dist/state/schema.d.ts +24 -0
  163. package/dist/state/schema.d.ts.map +1 -0
  164. package/dist/state/schema.js +41 -0
  165. package/dist/state/schema.js.map +1 -0
  166. package/dist/state/squad-state.d.ts +42 -0
  167. package/dist/state/squad-state.d.ts.map +1 -0
  168. package/dist/state/squad-state.js +68 -0
  169. package/dist/state/squad-state.js.map +1 -0
  170. package/dist/storage/fs-storage-provider.d.ts +60 -0
  171. package/dist/storage/fs-storage-provider.d.ts.map +1 -0
  172. package/dist/storage/fs-storage-provider.js +377 -0
  173. package/dist/storage/fs-storage-provider.js.map +1 -0
  174. package/dist/storage/in-memory-storage-provider.d.ts +46 -0
  175. package/dist/storage/in-memory-storage-provider.d.ts.map +1 -0
  176. package/dist/storage/in-memory-storage-provider.js +264 -0
  177. package/dist/storage/in-memory-storage-provider.js.map +1 -0
  178. package/dist/storage/index.d.ts +6 -0
  179. package/dist/storage/index.d.ts.map +1 -0
  180. package/dist/storage/index.js +5 -0
  181. package/dist/storage/index.js.map +1 -0
  182. package/dist/storage/sqlite-storage-provider.d.ts +95 -0
  183. package/dist/storage/sqlite-storage-provider.d.ts.map +1 -0
  184. package/dist/storage/sqlite-storage-provider.js +383 -0
  185. package/dist/storage/sqlite-storage-provider.js.map +1 -0
  186. package/dist/storage/storage-error.d.ts +28 -0
  187. package/dist/storage/storage-error.d.ts.map +1 -0
  188. package/dist/storage/storage-error.js +35 -0
  189. package/dist/storage/storage-error.js.map +1 -0
  190. package/dist/storage/storage-provider.d.ts +161 -0
  191. package/dist/storage/storage-provider.d.ts.map +1 -0
  192. package/dist/storage/storage-provider.js +18 -0
  193. package/dist/storage/storage-provider.js.map +1 -0
  194. package/dist/streams/resolver.d.ts.map +1 -1
  195. package/dist/streams/resolver.js +6 -5
  196. package/dist/streams/resolver.js.map +1 -1
  197. package/dist/tools/index.d.ts +5 -1
  198. package/dist/tools/index.d.ts.map +1 -1
  199. package/dist/tools/index.js +54 -15
  200. package/dist/tools/index.js.map +1 -1
  201. package/dist/upstream/resolver.d.ts +3 -2
  202. package/dist/upstream/resolver.d.ts.map +1 -1
  203. package/dist/upstream/resolver.js +33 -32
  204. package/dist/upstream/resolver.js.map +1 -1
  205. package/package.json +33 -1
  206. package/templates/casting/Futurama.json +9 -9
  207. package/templates/casting-history.json +4 -4
  208. package/templates/casting-policy.json +37 -37
  209. package/templates/casting-reference.md +104 -104
  210. package/templates/casting-registry.json +3 -3
  211. package/templates/ceremonies.md +41 -41
  212. package/templates/charter.md +53 -53
  213. package/templates/constraint-tracking.md +38 -38
  214. package/templates/cooperative-rate-limiting.md +229 -229
  215. package/templates/copilot-instructions.md +46 -46
  216. package/templates/history.md +10 -10
  217. package/templates/identity/now.md +9 -9
  218. package/templates/identity/wisdom.md +15 -15
  219. package/templates/issue-lifecycle.md +412 -412
  220. package/templates/keda-scaler.md +164 -164
  221. package/templates/machine-capabilities.md +74 -74
  222. package/templates/mcp-config.md +90 -90
  223. package/templates/multi-agent-format.md +28 -28
  224. package/templates/plugin-marketplace.md +49 -49
  225. package/templates/ralph-circuit-breaker.md +313 -313
  226. package/templates/raw-agent-output.md +37 -37
  227. package/templates/roster.md +60 -60
  228. package/templates/routing.md +39 -39
  229. package/templates/run-output.md +50 -50
  230. package/templates/schedule.json +19 -19
  231. package/templates/scribe-charter.md +123 -119
  232. package/templates/skill.md +24 -24
  233. package/templates/skills/agent-collaboration/SKILL.md +42 -42
  234. package/templates/skills/agent-conduct/SKILL.md +24 -24
  235. package/templates/skills/architectural-proposals/SKILL.md +151 -151
  236. package/templates/skills/ci-validation-gates/SKILL.md +84 -84
  237. package/templates/skills/cli-wiring/SKILL.md +47 -47
  238. package/templates/skills/client-compatibility/SKILL.md +89 -89
  239. package/templates/skills/cross-machine-coordination/SKILL.md +434 -0
  240. package/templates/skills/cross-squad/SKILL.md +114 -114
  241. package/templates/skills/distributed-mesh/SKILL.md +287 -287
  242. package/templates/skills/distributed-mesh/mesh.json.example +30 -30
  243. package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -111
  244. package/templates/skills/distributed-mesh/sync-mesh.sh +104 -104
  245. package/templates/skills/docs-standards/SKILL.md +71 -71
  246. package/templates/skills/economy-mode/SKILL.md +114 -114
  247. package/templates/skills/error-recovery/SKILL.md +99 -0
  248. package/templates/skills/external-comms/SKILL.md +329 -329
  249. package/templates/skills/gh-auth-isolation/SKILL.md +183 -183
  250. package/templates/skills/git-workflow/SKILL.md +204 -204
  251. package/templates/skills/github-multi-account/SKILL.md +95 -95
  252. package/templates/skills/history-hygiene/SKILL.md +36 -36
  253. package/templates/skills/humanizer/SKILL.md +105 -105
  254. package/templates/skills/init-mode/SKILL.md +102 -102
  255. package/templates/skills/iterative-retrieval/SKILL.md +165 -0
  256. package/templates/skills/model-selection/SKILL.md +117 -117
  257. package/templates/skills/nap/SKILL.md +24 -24
  258. package/templates/skills/notification-routing/SKILL.md +105 -0
  259. package/templates/skills/personal-squad/SKILL.md +57 -57
  260. package/templates/skills/pr-screenshots/SKILL.md +149 -0
  261. package/templates/skills/project-conventions/SKILL.md +56 -56
  262. package/templates/skills/ralph-two-pass-scan/SKILL.md +35 -0
  263. package/templates/skills/reflect/SKILL.md +229 -0
  264. package/templates/skills/release-process/SKILL.md +131 -423
  265. package/templates/skills/reskill/SKILL.md +92 -92
  266. package/templates/skills/retro-enforcement/SKILL.md +148 -0
  267. package/templates/skills/reviewer-protocol/SKILL.md +79 -79
  268. package/templates/skills/secret-handling/SKILL.md +200 -200
  269. package/templates/skills/session-recovery/SKILL.md +155 -155
  270. package/templates/skills/squad-conventions/SKILL.md +69 -69
  271. package/templates/skills/test-discipline/SKILL.md +37 -37
  272. package/templates/skills/tiered-memory/SKILL.md +234 -0
  273. package/templates/skills/windows-compatibility/SKILL.md +98 -74
  274. package/templates/{squad.agent.md → squad.agent.md.template} +57 -28
  275. package/templates/workflows/squad-ci.yml +24 -24
  276. package/templates/workflows/squad-docs.yml +54 -54
  277. package/templates/workflows/squad-heartbeat.yml +167 -171
  278. package/templates/workflows/squad-insider-release.yml +61 -61
  279. package/templates/workflows/squad-issue-assign.yml +161 -161
  280. package/templates/workflows/squad-label-enforce.yml +181 -181
  281. package/templates/workflows/squad-preview.yml +55 -55
  282. package/templates/workflows/squad-promote.yml +120 -120
  283. package/templates/workflows/squad-release.yml +77 -77
  284. package/templates/workflows/squad-triage.yml +260 -260
  285. package/templates/workflows/sync-squad-labels.yml +169 -169
@@ -1,151 +1,151 @@
1
- ---
2
- name: "architectural-proposals"
3
- description: "How to write comprehensive architectural proposals that drive alignment before code is written"
4
- domain: "architecture, product-direction"
5
- confidence: "high"
6
- source: "earned (2026-02-21 interactive shell proposal)"
7
- tools:
8
- - name: "view"
9
- description: "Read existing codebase, prior decisions, and team context before proposing changes"
10
- when: "Always read .squad/decisions.md, relevant PRDs, and current architecture docs before writing proposal"
11
- - name: "create"
12
- description: "Create proposal in docs/proposals/ with structured format"
13
- when: "After gathering context, before any implementation work begins"
14
- ---
15
-
16
- ## Context
17
-
18
- Proposals create alignment before code is written. Cheaper to change a doc than refactor code. Use this pattern when:
19
- - Architecture shifts invalidate existing assumptions
20
- - Product direction changes require new foundation
21
- - Multiple waves/milestones will be affected by a decision
22
- - External dependencies (Copilot CLI, SDK APIs) change
23
-
24
- ## Patterns
25
-
26
- ### Proposal Structure (docs/proposals/)
27
-
28
- **Required sections:**
29
- 1. **Problem Statement** — Why current state is broken (specific, measurable evidence)
30
- 2. **Proposed Architecture** — Solution with technical specifics (not hand-waving)
31
- 3. **What Changes** — Impact on existing work (waves, milestones, modules)
32
- 4. **What Stays the Same** — Preserve existing functionality (no regression)
33
- 5. **Key Decisions Needed** — Explicit choices with recommendations
34
- 6. **Risks and Mitigations** — Likelihood + impact + mitigation strategy
35
- 7. **Scope** — What's in v1, what's deferred (timeline clarity)
36
-
37
- **Optional sections:**
38
- - Implementation Plan (high-level milestones)
39
- - Success Criteria (measurable outcomes)
40
- - Open Questions (unresolved items)
41
- - Appendix (prior art, alternatives considered)
42
-
43
- ### Tone Ceiling Enforcement
44
-
45
- **Always:**
46
- - Cite specific evidence (user reports, performance data, failure modes)
47
- - Justify recommendations with technical rationale
48
- - Acknowledge trade-offs (no perfect solutions)
49
- - Be specific about APIs, libraries, file paths
50
-
51
- **Never:**
52
- - Hype ("revolutionary", "game-changing")
53
- - Hand-waving ("we'll figure it out later")
54
- - Unsubstantiated claims ("users will love this")
55
- - Vague timelines ("soon", "eventually")
56
-
57
- ### Wave Restructuring Pattern
58
-
59
- When a proposal invalidates existing wave structure:
60
- 1. **Acknowledge the shift:** "This becomes Wave 0 (Foundation)"
61
- 2. **Cascade impacts:** Adjust downstream waves (Wave 1, Wave 2, Wave 3)
62
- 3. **Preserve non-blocking work:** Identify what can proceed in parallel
63
- 4. **Update dependencies:** Document new blocking relationships
64
-
65
- **Example (Interactive Shell):**
66
- - Wave 0 (NEW): Interactive Shell — blocks all other waves
67
- - Wave 1 (ADJUSTED): npm Distribution — shell bundled in cli.js
68
- - Wave 2 (DEFERRED): SquadUI — waits for shell foundation
69
- - Wave 3 (ADJUSTED): Public Docs — now documents shell as primary interface
70
-
71
- ### Decision Framing
72
-
73
- **Format:** "Recommendation: X (recommended) or alternatives?"
74
-
75
- **Components:**
76
- - Recommendation (pick one, justify)
77
- - Alternatives (what else was considered)
78
- - Decision rationale (why recommended option wins)
79
- - Needs sign-off from (which agents/roles must approve)
80
-
81
- **Example:**
82
- ```
83
- ### 1. Terminal UI Library: `ink` (recommended) or alternatives?
84
-
85
- **Recommendation:** `ink`
86
- **Alternatives:** `blessed`, raw readline
87
- **Decision rationale:** Component model enables testable UI. Battle-tested ecosystem.
88
-
89
- **Needs sign-off from:** Brady (product direction), Fortier (runtime performance)
90
- ```
91
-
92
- ### Risk Documentation
93
-
94
- **Format per risk:**
95
- - **Risk:** Specific failure mode
96
- - **Likelihood:** Low / Medium / High (not percentages)
97
- - **Impact:** Low / Medium / High
98
- - **Mitigation:** Concrete actions (measurable)
99
-
100
- **Example:**
101
- ```
102
- ### Risk 2: SDK Streaming Reliability
103
-
104
- **Risk:** SDK streaming events might drop messages or arrive out of order.
105
- **Likelihood:** Low (SDK is production-grade).
106
- **Impact:** High — broken streaming makes shell unusable.
107
-
108
- **Mitigation:**
109
- - Add integration test: Send 1000-message stream, verify all deltas arrive in order
110
- - Implement fallback: If streaming fails, fall back to polling session state
111
- - Log all SDK events to `.squad/orchestration-log/sdk-events.jsonl` for debugging
112
- ```
113
-
114
- ## Examples
115
-
116
- **File references from interactive shell proposal:**
117
- - Full proposal: `docs/proposals/squad-interactive-shell.md`
118
- - User directive: `.squad/decisions/inbox/copilot-directive-2026-02-21T202535Z.md`
119
- - Team decisions: `.squad/decisions.md`
120
- - Current architecture: `docs/architecture/module-map.md`, `docs/prd-23-release-readiness.md`
121
-
122
- **Key patterns demonstrated:**
123
- 1. Read user directive first (understand the "why")
124
- 2. Survey current architecture (module map, existing waves)
125
- 3. Research SDK APIs (exploration task to validate feasibility)
126
- 4. Document problem with specific evidence (unreliable handoffs, zero visibility, UX mismatch)
127
- 5. Propose solution with technical specifics (ink components, SDK session management, spawn.ts module)
128
- 6. Restructure waves when foundation shifts (Wave 0 becomes blocker)
129
- 7. Preserve backward compatibility (squad.agent.md still works, VS Code mode unchanged)
130
- 8. Frame decisions explicitly (5 key decisions with recommendations)
131
- 9. Document risks with mitigations (5 risks, each with concrete actions)
132
- 10. Define scope (what's in v1 vs. deferred)
133
-
134
- ## Anti-Patterns
135
-
136
- **Avoid:**
137
- - ❌ Proposals without problem statements (solution-first thinking)
138
- - ❌ Vague architecture ("we'll use a shell") — be specific (ink components, session registry, spawn.ts)
139
- - ❌ Ignoring existing work — always document impact on waves/milestones
140
- - ❌ No risk analysis — every architecture has risks, document them
141
- - ❌ Unbounded scope — draw the v1 line explicitly
142
- - ❌ Missing decision ownership — always say "needs sign-off from X"
143
- - ❌ No backward compatibility plan — users don't care about your replatform
144
- - ❌ Hand-waving timelines ("a few weeks") — be specific (2-3 weeks, 1 engineer full-time)
145
-
146
- **Red flags in proposal reviews:**
147
- - "Users will love this" (citation needed)
148
- - "We'll figure out X later" (scope creep incoming)
149
- - "This is revolutionary" (tone ceiling violation)
150
- - No section on "What Stays the Same" (regression risk)
151
- - No risks documented (wishful thinking)
1
+ ---
2
+ name: "architectural-proposals"
3
+ description: "How to write comprehensive architectural proposals that drive alignment before code is written"
4
+ domain: "architecture, product-direction"
5
+ confidence: "high"
6
+ source: "earned (2026-02-21 interactive shell proposal)"
7
+ tools:
8
+ - name: "view"
9
+ description: "Read existing codebase, prior decisions, and team context before proposing changes"
10
+ when: "Always read .squad/decisions.md, relevant PRDs, and current architecture docs before writing proposal"
11
+ - name: "create"
12
+ description: "Create proposal in docs/proposals/ with structured format"
13
+ when: "After gathering context, before any implementation work begins"
14
+ ---
15
+
16
+ ## Context
17
+
18
+ Proposals create alignment before code is written. Cheaper to change a doc than refactor code. Use this pattern when:
19
+ - Architecture shifts invalidate existing assumptions
20
+ - Product direction changes require new foundation
21
+ - Multiple waves/milestones will be affected by a decision
22
+ - External dependencies (Copilot CLI, SDK APIs) change
23
+
24
+ ## Patterns
25
+
26
+ ### Proposal Structure (docs/proposals/)
27
+
28
+ **Required sections:**
29
+ 1. **Problem Statement** — Why current state is broken (specific, measurable evidence)
30
+ 2. **Proposed Architecture** — Solution with technical specifics (not hand-waving)
31
+ 3. **What Changes** — Impact on existing work (waves, milestones, modules)
32
+ 4. **What Stays the Same** — Preserve existing functionality (no regression)
33
+ 5. **Key Decisions Needed** — Explicit choices with recommendations
34
+ 6. **Risks and Mitigations** — Likelihood + impact + mitigation strategy
35
+ 7. **Scope** — What's in v1, what's deferred (timeline clarity)
36
+
37
+ **Optional sections:**
38
+ - Implementation Plan (high-level milestones)
39
+ - Success Criteria (measurable outcomes)
40
+ - Open Questions (unresolved items)
41
+ - Appendix (prior art, alternatives considered)
42
+
43
+ ### Tone Ceiling Enforcement
44
+
45
+ **Always:**
46
+ - Cite specific evidence (user reports, performance data, failure modes)
47
+ - Justify recommendations with technical rationale
48
+ - Acknowledge trade-offs (no perfect solutions)
49
+ - Be specific about APIs, libraries, file paths
50
+
51
+ **Never:**
52
+ - Hype ("revolutionary", "game-changing")
53
+ - Hand-waving ("we'll figure it out later")
54
+ - Unsubstantiated claims ("users will love this")
55
+ - Vague timelines ("soon", "eventually")
56
+
57
+ ### Wave Restructuring Pattern
58
+
59
+ When a proposal invalidates existing wave structure:
60
+ 1. **Acknowledge the shift:** "This becomes Wave 0 (Foundation)"
61
+ 2. **Cascade impacts:** Adjust downstream waves (Wave 1, Wave 2, Wave 3)
62
+ 3. **Preserve non-blocking work:** Identify what can proceed in parallel
63
+ 4. **Update dependencies:** Document new blocking relationships
64
+
65
+ **Example (Interactive Shell):**
66
+ - Wave 0 (NEW): Interactive Shell — blocks all other waves
67
+ - Wave 1 (ADJUSTED): npm Distribution — shell bundled in cli.js
68
+ - Wave 2 (DEFERRED): SquadUI — waits for shell foundation
69
+ - Wave 3 (ADJUSTED): Public Docs — now documents shell as primary interface
70
+
71
+ ### Decision Framing
72
+
73
+ **Format:** "Recommendation: X (recommended) or alternatives?"
74
+
75
+ **Components:**
76
+ - Recommendation (pick one, justify)
77
+ - Alternatives (what else was considered)
78
+ - Decision rationale (why recommended option wins)
79
+ - Needs sign-off from (which agents/roles must approve)
80
+
81
+ **Example:**
82
+ ```
83
+ ### 1. Terminal UI Library: `ink` (recommended) or alternatives?
84
+
85
+ **Recommendation:** `ink`
86
+ **Alternatives:** `blessed`, raw readline
87
+ **Decision rationale:** Component model enables testable UI. Battle-tested ecosystem.
88
+
89
+ **Needs sign-off from:** Brady (product direction), Fortier (runtime performance)
90
+ ```
91
+
92
+ ### Risk Documentation
93
+
94
+ **Format per risk:**
95
+ - **Risk:** Specific failure mode
96
+ - **Likelihood:** Low / Medium / High (not percentages)
97
+ - **Impact:** Low / Medium / High
98
+ - **Mitigation:** Concrete actions (measurable)
99
+
100
+ **Example:**
101
+ ```
102
+ ### Risk 2: SDK Streaming Reliability
103
+
104
+ **Risk:** SDK streaming events might drop messages or arrive out of order.
105
+ **Likelihood:** Low (SDK is production-grade).
106
+ **Impact:** High — broken streaming makes shell unusable.
107
+
108
+ **Mitigation:**
109
+ - Add integration test: Send 1000-message stream, verify all deltas arrive in order
110
+ - Implement fallback: If streaming fails, fall back to polling session state
111
+ - Log all SDK events to `.squad/orchestration-log/sdk-events.jsonl` for debugging
112
+ ```
113
+
114
+ ## Examples
115
+
116
+ **File references from interactive shell proposal:**
117
+ - Full proposal: `docs/proposals/squad-interactive-shell.md`
118
+ - User directive: `.squad/decisions/inbox/copilot-directive-2026-02-21T202535Z.md`
119
+ - Team decisions: `.squad/decisions.md`
120
+ - Current architecture: `docs/architecture/module-map.md`, `docs/prd-23-release-readiness.md`
121
+
122
+ **Key patterns demonstrated:**
123
+ 1. Read user directive first (understand the "why")
124
+ 2. Survey current architecture (module map, existing waves)
125
+ 3. Research SDK APIs (exploration task to validate feasibility)
126
+ 4. Document problem with specific evidence (unreliable handoffs, zero visibility, UX mismatch)
127
+ 5. Propose solution with technical specifics (ink components, SDK session management, spawn.ts module)
128
+ 6. Restructure waves when foundation shifts (Wave 0 becomes blocker)
129
+ 7. Preserve backward compatibility (squad.agent.md still works, VS Code mode unchanged)
130
+ 8. Frame decisions explicitly (5 key decisions with recommendations)
131
+ 9. Document risks with mitigations (5 risks, each with concrete actions)
132
+ 10. Define scope (what's in v1 vs. deferred)
133
+
134
+ ## Anti-Patterns
135
+
136
+ **Avoid:**
137
+ - ❌ Proposals without problem statements (solution-first thinking)
138
+ - ❌ Vague architecture ("we'll use a shell") — be specific (ink components, session registry, spawn.ts)
139
+ - ❌ Ignoring existing work — always document impact on waves/milestones
140
+ - ❌ No risk analysis — every architecture has risks, document them
141
+ - ❌ Unbounded scope — draw the v1 line explicitly
142
+ - ❌ Missing decision ownership — always say "needs sign-off from X"
143
+ - ❌ No backward compatibility plan — users don't care about your replatform
144
+ - ❌ Hand-waving timelines ("a few weeks") — be specific (2-3 weeks, 1 engineer full-time)
145
+
146
+ **Red flags in proposal reviews:**
147
+ - "Users will love this" (citation needed)
148
+ - "We'll figure out X later" (scope creep incoming)
149
+ - "This is revolutionary" (tone ceiling violation)
150
+ - No section on "What Stays the Same" (regression risk)
151
+ - No risks documented (wishful thinking)
@@ -1,84 +1,84 @@
1
- ---
2
- name: "ci-validation-gates"
3
- description: "Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22"
4
- domain: "ci-cd"
5
- confidence: "high"
6
- source: "extracted from Drucker and Trejo charters — earned knowledge from v0.8.22 release incident"
7
- ---
8
-
9
- ## Context
10
-
11
- CI workflows must be defensive. These patterns were learned from the v0.8.22 release disaster where invalid semver, wrong token types, missing retry logic, and draft releases caused a multi-hour outage. Both Drucker (CI/CD) and Trejo (Release Manager) carried this knowledge in their charters — now centralized here.
12
-
13
- ## Patterns
14
-
15
- ### Semver Validation Gate
16
- Every publish workflow MUST validate version format before `npm publish`. 4-part versions (e.g., 0.8.21.4) are NOT valid semver — npm mangles them.
17
-
18
- ```yaml
19
- - name: Validate semver
20
- run: |
21
- VERSION="${{ github.event.release.tag_name }}"
22
- VERSION="${VERSION#v}"
23
- if ! npx semver "$VERSION" > /dev/null 2>&1; then
24
- echo "❌ Invalid semver: $VERSION"
25
- echo "Only 3-part versions (X.Y.Z) or prerelease (X.Y.Z-tag.N) are valid."
26
- exit 1
27
- fi
28
- echo "✅ Valid semver: $VERSION"
29
- ```
30
-
31
- ### NPM Token Type Verification
32
- NPM_TOKEN MUST be an Automation token, not a User token with 2FA:
33
- - User tokens require OTP — CI can't provide it → EOTP error
34
- - Create Automation tokens at npmjs.com → Settings → Access Tokens → Automation
35
- - Verify before first publish in any workflow
36
-
37
- ### Retry Logic for npm Registry Propagation
38
- npm registry uses eventual consistency. After `npm publish` succeeds, the package may not be immediately queryable.
39
- - Propagation: typically 5-30s, up to 2min in rare cases
40
- - All verify steps: 5 attempts, 15-second intervals
41
- - Log each attempt: "Attempt 1/5: Checking package..."
42
- - Exit loop on success, fail after max attempts
43
-
44
- ```yaml
45
- - name: Verify package (with retry)
46
- run: |
47
- MAX_ATTEMPTS=5
48
- WAIT_SECONDS=15
49
- for attempt in $(seq 1 $MAX_ATTEMPTS); do
50
- echo "Attempt $attempt/$MAX_ATTEMPTS: Checking $PACKAGE@$VERSION..."
51
- if npm view "$PACKAGE@$VERSION" version > /dev/null 2>&1; then
52
- echo "✅ Package verified"
53
- exit 0
54
- fi
55
- [ $attempt -lt $MAX_ATTEMPTS ] && sleep $WAIT_SECONDS
56
- done
57
- echo "❌ Failed to verify after $MAX_ATTEMPTS attempts"
58
- exit 1
59
- ```
60
-
61
- ### Draft Release Detection
62
- Draft releases don't emit `release: published` event. Workflows MUST:
63
- - Trigger on `release: published` (NOT `created`)
64
- - If using workflow_dispatch: verify release is published via GitHub API before proceeding
65
-
66
- ### Build Script Protection
67
- Set `SKIP_BUILD_BUMP=1` (or `$env:SKIP_BUILD_BUMP = "1"` on Windows) before ANY release build. bump-build.mjs is for dev builds ONLY — it silently mutates versions.
68
-
69
- ## Known Failure Modes (v0.8.22 Incident)
70
-
71
- | # | What Happened | Root Cause | Prevention |
72
- |---|---------------|-----------|------------|
73
- | 1 | 4-part version published, npm mangled it | No semver validation gate | `npx semver` check before every publish |
74
- | 2 | CI failed 5+ times with EOTP | User token with 2FA | Automation token only |
75
- | 3 | Verify returned false 404 | No retry logic for propagation | 5 attempts, 15s intervals |
76
- | 4 | Workflow never triggered | Draft release doesn't emit event | Never create draft releases |
77
- | 5 | Version mutated during release | bump-build.mjs ran in release | SKIP_BUILD_BUMP=1 |
78
-
79
- ## Anti-Patterns
80
- - ❌ Publishing without semver validation gate
81
- - ❌ Single-shot verification without retry
82
- - ❌ Hard-coded secrets in workflows
83
- - ❌ Silent CI failures — every error needs actionable output with remediation
84
- - ❌ Assuming npm publish is instantly queryable
1
+ ---
2
+ name: "ci-validation-gates"
3
+ description: "Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22"
4
+ domain: "ci-cd"
5
+ confidence: "high"
6
+ source: "extracted from Drucker and Trejo charters — earned knowledge from v0.8.22 release incident"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ CI workflows must be defensive. These patterns were learned from the v0.8.22 release disaster where invalid semver, wrong token types, missing retry logic, and draft releases caused a multi-hour outage. Both Drucker (CI/CD) and Trejo (Release Manager) carried this knowledge in their charters — now centralized here.
12
+
13
+ ## Patterns
14
+
15
+ ### Semver Validation Gate
16
+ Every publish workflow MUST validate version format before `npm publish`. 4-part versions (e.g., 0.8.21.4) are NOT valid semver — npm mangles them.
17
+
18
+ ```yaml
19
+ - name: Validate semver
20
+ run: |
21
+ VERSION="${{ github.event.release.tag_name }}"
22
+ VERSION="${VERSION#v}"
23
+ if ! npx semver "$VERSION" > /dev/null 2>&1; then
24
+ echo "❌ Invalid semver: $VERSION"
25
+ echo "Only 3-part versions (X.Y.Z) or prerelease (X.Y.Z-tag.N) are valid."
26
+ exit 1
27
+ fi
28
+ echo "✅ Valid semver: $VERSION"
29
+ ```
30
+
31
+ ### NPM Token Type Verification
32
+ NPM_TOKEN MUST be an Automation token, not a User token with 2FA:
33
+ - User tokens require OTP — CI can't provide it → EOTP error
34
+ - Create Automation tokens at npmjs.com → Settings → Access Tokens → Automation
35
+ - Verify before first publish in any workflow
36
+
37
+ ### Retry Logic for npm Registry Propagation
38
+ npm registry uses eventual consistency. After `npm publish` succeeds, the package may not be immediately queryable.
39
+ - Propagation: typically 5-30s, up to 2min in rare cases
40
+ - All verify steps: 5 attempts, 15-second intervals
41
+ - Log each attempt: "Attempt 1/5: Checking package..."
42
+ - Exit loop on success, fail after max attempts
43
+
44
+ ```yaml
45
+ - name: Verify package (with retry)
46
+ run: |
47
+ MAX_ATTEMPTS=5
48
+ WAIT_SECONDS=15
49
+ for attempt in $(seq 1 $MAX_ATTEMPTS); do
50
+ echo "Attempt $attempt/$MAX_ATTEMPTS: Checking $PACKAGE@$VERSION..."
51
+ if npm view "$PACKAGE@$VERSION" version > /dev/null 2>&1; then
52
+ echo "✅ Package verified"
53
+ exit 0
54
+ fi
55
+ [ $attempt -lt $MAX_ATTEMPTS ] && sleep $WAIT_SECONDS
56
+ done
57
+ echo "❌ Failed to verify after $MAX_ATTEMPTS attempts"
58
+ exit 1
59
+ ```
60
+
61
+ ### Draft Release Detection
62
+ Draft releases don't emit `release: published` event. Workflows MUST:
63
+ - Trigger on `release: published` (NOT `created`)
64
+ - If using workflow_dispatch: verify release is published via GitHub API before proceeding
65
+
66
+ ### Build Script Protection
67
+ Set `SKIP_BUILD_BUMP=1` (or `$env:SKIP_BUILD_BUMP = "1"` on Windows) before ANY release build. bump-build.mjs is for dev builds ONLY — it silently mutates versions.
68
+
69
+ ## Known Failure Modes (v0.8.22 Incident)
70
+
71
+ | # | What Happened | Root Cause | Prevention |
72
+ |---|---------------|-----------|------------|
73
+ | 1 | 4-part version published, npm mangled it | No semver validation gate | `npx semver` check before every publish |
74
+ | 2 | CI failed 5+ times with EOTP | User token with 2FA | Automation token only |
75
+ | 3 | Verify returned false 404 | No retry logic for propagation | 5 attempts, 15s intervals |
76
+ | 4 | Workflow never triggered | Draft release doesn't emit event | Never create draft releases |
77
+ | 5 | Version mutated during release | bump-build.mjs ran in release | SKIP_BUILD_BUMP=1 |
78
+
79
+ ## Anti-Patterns
80
+ - ❌ Publishing without semver validation gate
81
+ - ❌ Single-shot verification without retry
82
+ - ❌ Hard-coded secrets in workflows
83
+ - ❌ Silent CI failures — every error needs actionable output with remediation
84
+ - ❌ Assuming npm publish is instantly queryable
@@ -1,47 +1,47 @@
1
- # Skill: CLI Command Wiring
2
-
3
- **Bug class:** Commands implemented in `packages/squad-cli/src/cli/commands/` but never routed in `cli-entry.ts`.
4
-
5
- ## Checklist — Adding a New CLI Command
6
-
7
- 1. **Create command file** in `packages/squad-cli/src/cli/commands/<name>.ts`
8
- - Export a `run<Name>(cwd, options)` async function (or class with static methods for utility modules)
9
-
10
- 2. **Add routing block** in `packages/squad-cli/src/cli-entry.ts` inside `main()`:
11
- ```ts
12
- if (cmd === '<name>') {
13
- const { run<Name> } = await import('./cli/commands/<name>.js');
14
- // parse args, call function
15
- await run<Name>(process.cwd(), options);
16
- return;
17
- }
18
- ```
19
-
20
- 3. **Add help text** in the help section of `cli-entry.ts` (search for `Commands:`):
21
- ```ts
22
- console.log(` ${BOLD}<name>${RESET} <description>`);
23
- console.log(` Usage: <name> [flags]`);
24
- ```
25
-
26
- 4. **Verify both exist** — the recurring bug is doing step 1 but missing steps 2-3.
27
-
28
- ## Wiring Patterns by Command Type
29
-
30
- | Type | Example | How to wire |
31
- |------|---------|-------------|
32
- | Standard command | `export.ts`, `build.ts` | `run*()` function, parse flags from `args` |
33
- | Placeholder command | `loop`, `hire` | Inline in cli-entry.ts, prints pending message |
34
- | Utility/check module | `rc-tunnel.ts`, `copilot-bridge.ts` | Wire as diagnostic check (e.g., `isDevtunnelAvailable()`) |
35
- | Subcommand of another | `init-remote.ts` | Already used inside parent + standalone alias |
36
-
37
- ## Common Import Pattern
38
-
39
- ```ts
40
- import { BOLD, RESET, DIM, RED, GREEN, YELLOW } from './cli/core/output.js';
41
- ```
42
-
43
- Use dynamic `await import()` for command modules to keep startup fast (lazy loading).
44
-
45
- ## History
46
-
47
- - **#237 / PR #244:** 4 commands wired (rc, copilot-bridge, init-remote, rc-tunnel). aspire, link, loop, hire were already present.
1
+ # Skill: CLI Command Wiring
2
+
3
+ **Bug class:** Commands implemented in `packages/squad-cli/src/cli/commands/` but never routed in `cli-entry.ts`.
4
+
5
+ ## Checklist — Adding a New CLI Command
6
+
7
+ 1. **Create command file** in `packages/squad-cli/src/cli/commands/<name>.ts`
8
+ - Export a `run<Name>(cwd, options)` async function (or class with static methods for utility modules)
9
+
10
+ 2. **Add routing block** in `packages/squad-cli/src/cli-entry.ts` inside `main()`:
11
+ ```ts
12
+ if (cmd === '<name>') {
13
+ const { run<Name> } = await import('./cli/commands/<name>.js');
14
+ // parse args, call function
15
+ await run<Name>(process.cwd(), options);
16
+ return;
17
+ }
18
+ ```
19
+
20
+ 3. **Add help text** in the help section of `cli-entry.ts` (search for `Commands:`):
21
+ ```ts
22
+ console.log(` ${BOLD}<name>${RESET} <description>`);
23
+ console.log(` Usage: <name> [flags]`);
24
+ ```
25
+
26
+ 4. **Verify both exist** — the recurring bug is doing step 1 but missing steps 2-3.
27
+
28
+ ## Wiring Patterns by Command Type
29
+
30
+ | Type | Example | How to wire |
31
+ |------|---------|-------------|
32
+ | Standard command | `export.ts`, `build.ts` | `run*()` function, parse flags from `args` |
33
+ | Placeholder command | `loop`, `hire` | Inline in cli-entry.ts, prints pending message |
34
+ | Utility/check module | `rc-tunnel.ts`, `copilot-bridge.ts` | Wire as diagnostic check (e.g., `isDevtunnelAvailable()`) |
35
+ | Subcommand of another | `init-remote.ts` | Already used inside parent + standalone alias |
36
+
37
+ ## Common Import Pattern
38
+
39
+ ```ts
40
+ import { BOLD, RESET, DIM, RED, GREEN, YELLOW } from './cli/core/output.js';
41
+ ```
42
+
43
+ Use dynamic `await import()` for command modules to keep startup fast (lazy loading).
44
+
45
+ ## History
46
+
47
+ - **#237 / PR #244:** 4 commands wired (rc, copilot-bridge, init-remote, rc-tunnel). aspire, link, loop, hire were already present.