@bradygaster/squad-sdk 0.8.24 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/client.d.ts +17 -0
- package/dist/adapter/client.d.ts.map +1 -1
- package/dist/adapter/client.js +101 -1
- package/dist/adapter/client.js.map +1 -1
- package/dist/agents/history-shadow.d.ts.map +1 -1
- package/dist/agents/history-shadow.js +99 -32
- package/dist/agents/history-shadow.js.map +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-selector.d.ts +2 -0
- package/dist/agents/model-selector.d.ts.map +1 -1
- package/dist/agents/model-selector.js +41 -35
- package/dist/agents/model-selector.js.map +1 -1
- package/dist/agents/personal.d.ts +35 -0
- package/dist/agents/personal.d.ts.map +1 -0
- package/dist/agents/personal.js +67 -0
- package/dist/agents/personal.js.map +1 -0
- package/dist/builders/index.d.ts +3 -2
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +28 -0
- package/dist/builders/index.js.map +1 -1
- package/dist/builders/types.d.ts +13 -0
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/config/init.d.ts +8 -0
- package/dist/config/init.d.ts.map +1 -1
- package/dist/config/init.js +131 -20
- package/dist/config/init.js.map +1 -1
- package/dist/config/models.d.ts +112 -0
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +329 -18
- package/dist/config/models.js.map +1 -1
- package/dist/coordinator/index.js +2 -2
- package/dist/coordinator/index.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/platform/azure-devops.d.ts +42 -0
- package/dist/platform/azure-devops.d.ts.map +1 -1
- package/dist/platform/azure-devops.js +75 -0
- package/dist/platform/azure-devops.js.map +1 -1
- package/dist/platform/comms-file-log.d.ts.map +1 -1
- package/dist/platform/comms-file-log.js +2 -1
- package/dist/platform/comms-file-log.js.map +1 -1
- package/dist/platform/index.d.ts +2 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +1 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/ralph/capabilities.d.ts +67 -0
- package/dist/ralph/capabilities.d.ts.map +1 -0
- package/dist/ralph/capabilities.js +111 -0
- package/dist/ralph/capabilities.js.map +1 -0
- package/dist/ralph/index.d.ts +2 -0
- package/dist/ralph/index.d.ts.map +1 -1
- package/dist/ralph/index.js +6 -5
- package/dist/ralph/index.js.map +1 -1
- package/dist/ralph/rate-limiting.d.ts +99 -0
- package/dist/ralph/rate-limiting.d.ts.map +1 -0
- package/dist/ralph/rate-limiting.js +170 -0
- package/dist/ralph/rate-limiting.js.map +1 -0
- package/dist/resolution.d.ts +24 -2
- package/dist/resolution.d.ts.map +1 -1
- package/dist/resolution.js +106 -6
- package/dist/resolution.js.map +1 -1
- package/dist/roles/catalog-categories.d.ts +146 -0
- package/dist/roles/catalog-categories.d.ts.map +1 -0
- package/dist/roles/catalog-categories.js +374 -0
- package/dist/roles/catalog-categories.js.map +1 -0
- package/dist/roles/catalog-engineering.d.ts +212 -0
- package/dist/roles/catalog-engineering.d.ts.map +1 -0
- package/dist/roles/catalog-engineering.js +549 -0
- package/dist/roles/catalog-engineering.js.map +1 -0
- package/dist/roles/catalog.d.ts +24 -0
- package/dist/roles/catalog.d.ts.map +1 -0
- package/dist/roles/catalog.js +28 -0
- package/dist/roles/catalog.js.map +1 -0
- package/dist/roles/index.d.ts +69 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/index.js +197 -0
- package/dist/roles/index.js.map +1 -0
- package/dist/roles/types.d.ts +87 -0
- package/dist/roles/types.d.ts.map +1 -0
- package/dist/roles/types.js +14 -0
- package/dist/roles/types.js.map +1 -0
- package/dist/runtime/benchmarks.js +5 -5
- package/dist/runtime/benchmarks.js.map +1 -1
- package/dist/runtime/constants.d.ts +2 -2
- package/dist/runtime/constants.d.ts.map +1 -1
- package/dist/runtime/constants.js +5 -3
- package/dist/runtime/constants.js.map +1 -1
- package/dist/runtime/cross-squad.d.ts +118 -0
- package/dist/runtime/cross-squad.d.ts.map +1 -0
- package/dist/runtime/cross-squad.js +234 -0
- package/dist/runtime/cross-squad.js.map +1 -0
- package/dist/runtime/otel-init.d.ts +24 -17
- package/dist/runtime/otel-init.d.ts.map +1 -1
- package/dist/runtime/otel-init.js +29 -20
- package/dist/runtime/otel-init.js.map +1 -1
- package/dist/runtime/otel-metrics.d.ts +5 -0
- package/dist/runtime/otel-metrics.d.ts.map +1 -1
- package/dist/runtime/otel-metrics.js +54 -0
- package/dist/runtime/otel-metrics.js.map +1 -1
- package/dist/runtime/rework.d.ts +71 -0
- package/dist/runtime/rework.d.ts.map +1 -0
- package/dist/runtime/rework.js +107 -0
- package/dist/runtime/rework.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +128 -0
- package/dist/runtime/scheduler.d.ts.map +1 -0
- package/dist/runtime/scheduler.js +427 -0
- package/dist/runtime/scheduler.js.map +1 -0
- package/dist/runtime/squad-observer.d.ts.map +1 -1
- package/dist/runtime/squad-observer.js +4 -0
- package/dist/runtime/squad-observer.js.map +1 -1
- package/dist/runtime/streaming.d.ts +2 -0
- package/dist/runtime/streaming.d.ts.map +1 -1
- package/dist/runtime/streaming.js +6 -0
- package/dist/runtime/streaming.js.map +1 -1
- package/dist/runtime/telemetry.d.ts +2 -0
- package/dist/runtime/telemetry.d.ts.map +1 -1
- package/dist/runtime/telemetry.js +6 -0
- package/dist/runtime/telemetry.js.map +1 -1
- package/dist/sharing/consult.d.ts +2 -2
- package/dist/sharing/consult.js +6 -6
- package/dist/sharing/consult.js.map +1 -1
- package/dist/sharing/export.d.ts.map +1 -1
- package/dist/sharing/export.js +17 -4
- package/dist/sharing/export.js.map +1 -1
- package/dist/skills/handler-types.d.ts +271 -0
- package/dist/skills/handler-types.d.ts.map +1 -0
- package/dist/skills/handler-types.js +31 -0
- package/dist/skills/handler-types.js.map +1 -0
- package/dist/skills/index.d.ts +3 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +3 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/skill-script-loader.d.ts +65 -0
- package/dist/skills/skill-script-loader.d.ts.map +1 -0
- package/dist/skills/skill-script-loader.js +227 -0
- package/dist/skills/skill-script-loader.js.map +1 -0
- package/dist/skills/skill-source.d.ts.map +1 -1
- package/dist/skills/skill-source.js +5 -1
- package/dist/skills/skill-source.js.map +1 -1
- package/dist/tools/index.d.ts +10 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +49 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/upstream/resolver.d.ts.map +1 -1
- package/dist/upstream/resolver.js +14 -5
- package/dist/upstream/resolver.js.map +1 -1
- package/package.json +34 -3
- package/templates/casting/Futurama.json +10 -0
- package/templates/casting-policy.json +4 -2
- package/templates/casting-reference.md +104 -0
- package/templates/cooperative-rate-limiting.md +229 -0
- package/templates/issue-lifecycle.md +412 -0
- package/templates/keda-scaler.md +164 -0
- package/templates/machine-capabilities.md +75 -0
- package/templates/mcp-config.md +0 -8
- package/templates/orchestration-log.md +27 -27
- package/templates/package.json +3 -0
- package/templates/ralph-circuit-breaker.md +313 -0
- package/templates/ralph-triage.js +543 -0
- package/templates/routing.md +5 -20
- package/templates/schedule.json +19 -0
- package/templates/scribe-charter.md +1 -1
- package/templates/skills/agent-collaboration/SKILL.md +42 -0
- package/templates/skills/agent-conduct/SKILL.md +24 -0
- package/templates/skills/architectural-proposals/SKILL.md +151 -0
- package/templates/skills/ci-validation-gates/SKILL.md +84 -0
- package/templates/skills/cli-wiring/SKILL.md +47 -0
- package/templates/skills/client-compatibility/SKILL.md +89 -0
- package/templates/skills/cross-squad/SKILL.md +114 -0
- package/templates/skills/distributed-mesh/SKILL.md +287 -0
- package/templates/skills/distributed-mesh/mesh.json.example +30 -0
- package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -0
- package/templates/skills/distributed-mesh/sync-mesh.sh +104 -0
- package/templates/skills/docs-standards/SKILL.md +71 -0
- package/templates/skills/economy-mode/SKILL.md +114 -0
- package/templates/skills/external-comms/SKILL.md +329 -0
- package/templates/skills/gh-auth-isolation/SKILL.md +183 -0
- package/templates/skills/git-workflow/SKILL.md +204 -0
- package/templates/skills/github-multi-account/SKILL.md +95 -0
- package/templates/skills/history-hygiene/SKILL.md +36 -0
- package/templates/skills/humanizer/SKILL.md +105 -0
- package/templates/skills/init-mode/SKILL.md +102 -0
- package/templates/skills/model-selection/SKILL.md +117 -0
- package/templates/skills/nap/SKILL.md +24 -0
- package/templates/skills/personal-squad/SKILL.md +57 -0
- package/templates/skills/release-process/SKILL.md +423 -0
- package/templates/skills/reskill/SKILL.md +92 -0
- package/templates/skills/reviewer-protocol/SKILL.md +79 -0
- package/templates/skills/secret-handling/SKILL.md +200 -0
- package/templates/skills/session-recovery/SKILL.md +155 -0
- package/templates/skills/squad-conventions/SKILL.md +69 -0
- package/templates/skills/test-discipline/SKILL.md +37 -0
- package/templates/skills/windows-compatibility/SKILL.md +74 -0
- package/templates/squad.agent.md +1287 -1146
- package/templates/workflows/squad-docs.yml +8 -4
- package/templates/workflows/squad-heartbeat.yml +55 -200
- package/templates/workflows/squad-insider-release.yml +1 -1
|
@@ -0,0 +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)
|
|
@@ -0,0 +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
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "client-compatibility"
|
|
3
|
+
description: "Platform detection and adaptive spawning for CLI vs VS Code vs other surfaces"
|
|
4
|
+
domain: "orchestration"
|
|
5
|
+
confidence: "high"
|
|
6
|
+
source: "extracted"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
Squad runs on multiple Copilot surfaces (CLI, VS Code, JetBrains, GitHub.com). The coordinator must detect its platform and adapt spawning behavior accordingly. Different tools are available on different platforms, requiring conditional logic for agent spawning, SQL usage, and response timing.
|
|
12
|
+
|
|
13
|
+
## Patterns
|
|
14
|
+
|
|
15
|
+
### Platform Detection
|
|
16
|
+
|
|
17
|
+
Before spawning agents, determine the platform by checking available tools:
|
|
18
|
+
|
|
19
|
+
1. **CLI mode** — `task` tool is available → full spawning control. Use `task` with `agent_type`, `mode`, `model`, `description`, `prompt` parameters. Collect results via `read_agent`.
|
|
20
|
+
|
|
21
|
+
2. **VS Code mode** — `runSubagent` or `agent` tool is available → conditional behavior. Use `runSubagent` with the task prompt. Drop `agent_type`, `mode`, and `model` parameters. Multiple subagents in one turn run concurrently (equivalent to background mode). Results return automatically — no `read_agent` needed.
|
|
22
|
+
|
|
23
|
+
3. **Fallback mode** — neither `task` nor `runSubagent`/`agent` available → work inline. Do not apologize or explain the limitation. Execute the task directly.
|
|
24
|
+
|
|
25
|
+
If both `task` and `runSubagent` are available, prefer `task` (richer parameter surface).
|
|
26
|
+
|
|
27
|
+
### VS Code Spawn Adaptations
|
|
28
|
+
|
|
29
|
+
When in VS Code mode, the coordinator changes behavior in these ways:
|
|
30
|
+
|
|
31
|
+
- **Spawning tool:** Use `runSubagent` instead of `task`. The prompt is the only required parameter — pass the full agent prompt (charter, identity, task, hygiene, response order) exactly as you would on CLI.
|
|
32
|
+
- **Parallelism:** Spawn ALL concurrent agents in a SINGLE turn. They run in parallel automatically. This replaces `mode: "background"` + `read_agent` polling.
|
|
33
|
+
- **Model selection:** Accept the session model. Do NOT attempt per-spawn model selection or fallback chains — they only work on CLI. In Phase 1, all subagents use whatever model the user selected in VS Code's model picker.
|
|
34
|
+
- **Scribe:** Cannot fire-and-forget. Batch Scribe as the LAST subagent in any parallel group. Scribe is light work (file ops only), so the blocking is tolerable.
|
|
35
|
+
- **Launch table:** Skip it. Results arrive with the response, not separately. By the time the coordinator speaks, the work is already done.
|
|
36
|
+
- **`read_agent`:** Skip entirely. Results return automatically when subagents complete.
|
|
37
|
+
- **`agent_type`:** Drop it. All VS Code subagents have full tool access by default. Subagents inherit the parent's tools.
|
|
38
|
+
- **`description`:** Drop it. The agent name is already in the prompt.
|
|
39
|
+
- **Prompt content:** Keep ALL prompt structure — charter, identity, task, hygiene, response order blocks are surface-independent.
|
|
40
|
+
|
|
41
|
+
### Feature Degradation Table
|
|
42
|
+
|
|
43
|
+
| Feature | CLI | VS Code | Degradation |
|
|
44
|
+
|---------|-----|---------|-------------|
|
|
45
|
+
| Parallel fan-out | `mode: "background"` + `read_agent` | Multiple subagents in one turn | None — equivalent concurrency |
|
|
46
|
+
| Model selection | Per-spawn `model` param (4-layer hierarchy) | Session model only (Phase 1) | Accept session model, log intent |
|
|
47
|
+
| Scribe fire-and-forget | Background, never read | Sync, must wait | Batch with last parallel group |
|
|
48
|
+
| Launch table UX | Show table → results later | Skip table → results with response | UX only — results are correct |
|
|
49
|
+
| SQL tool | Available | Not available | Avoid SQL in cross-platform code paths |
|
|
50
|
+
| Response order bug | Critical workaround | Possibly necessary (unverified) | Keep the block — harmless if unnecessary |
|
|
51
|
+
|
|
52
|
+
### SQL Tool Caveat
|
|
53
|
+
|
|
54
|
+
The `sql` tool is **CLI-only**. It does not exist on VS Code, JetBrains, or GitHub.com. Any coordinator logic or agent workflow that depends on SQL (todo tracking, batch processing, session state) will silently fail on non-CLI surfaces. Cross-platform code paths must not depend on SQL. Use filesystem-based state (`.squad/` files) for anything that must work everywhere.
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
**Example 1: CLI parallel spawn**
|
|
59
|
+
```typescript
|
|
60
|
+
// Coordinator detects task tool available → CLI mode
|
|
61
|
+
task({ agent_type: "general-purpose", mode: "background", model: "claude-sonnet-4.5", ... })
|
|
62
|
+
task({ agent_type: "general-purpose", mode: "background", model: "claude-haiku-4.5", ... })
|
|
63
|
+
// Later: read_agent for both
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Example 2: VS Code parallel spawn**
|
|
67
|
+
```typescript
|
|
68
|
+
// Coordinator detects runSubagent available → VS Code mode
|
|
69
|
+
runSubagent({ prompt: "...Fenster charter + task..." })
|
|
70
|
+
runSubagent({ prompt: "...Hockney charter + task..." })
|
|
71
|
+
runSubagent({ prompt: "...Scribe charter + task..." }) // Last in group
|
|
72
|
+
// Results return automatically, no read_agent
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Example 3: Fallback mode**
|
|
76
|
+
```typescript
|
|
77
|
+
// Neither task nor runSubagent available → work inline
|
|
78
|
+
// Coordinator executes the task directly without spawning
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Anti-Patterns
|
|
82
|
+
|
|
83
|
+
- ❌ Using SQL tool in cross-platform workflows (breaks on VS Code/JetBrains/GitHub.com)
|
|
84
|
+
- ❌ Attempting per-spawn model selection on VS Code (Phase 1 — only session model works)
|
|
85
|
+
- ❌ Fire-and-forget Scribe on VS Code (must batch as last subagent)
|
|
86
|
+
- ❌ Showing launch table on VS Code (results already inline)
|
|
87
|
+
- ❌ Apologizing or explaining platform limitations to the user
|
|
88
|
+
- ❌ Using `task` when only `runSubagent` is available
|
|
89
|
+
- ❌ Dropping prompt structure (charter/identity/task) on non-CLI platforms
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "cross-squad"
|
|
3
|
+
description: "Coordinating work across multiple Squad instances"
|
|
4
|
+
domain: "orchestration"
|
|
5
|
+
confidence: "medium"
|
|
6
|
+
source: "manual"
|
|
7
|
+
tools:
|
|
8
|
+
- name: "squad-discover"
|
|
9
|
+
description: "List known squads and their capabilities"
|
|
10
|
+
when: "When you need to find which squad can handle a task"
|
|
11
|
+
- name: "squad-delegate"
|
|
12
|
+
description: "Create work in another squad's repository"
|
|
13
|
+
when: "When a task belongs to another squad's domain"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Context
|
|
17
|
+
When an organization runs multiple Squad instances (e.g., platform-squad, frontend-squad, data-squad), those squads need to discover each other, share context, and hand off work across repository boundaries. This skill teaches agents how to coordinate across squads without creating tight coupling.
|
|
18
|
+
|
|
19
|
+
Cross-squad orchestration applies when:
|
|
20
|
+
- A task requires capabilities owned by another squad
|
|
21
|
+
- An architectural decision affects multiple squads
|
|
22
|
+
- A feature spans multiple repositories with different squads
|
|
23
|
+
- A squad needs to request infrastructure, tooling, or support from another squad
|
|
24
|
+
|
|
25
|
+
## Patterns
|
|
26
|
+
|
|
27
|
+
### Discovery via Manifest
|
|
28
|
+
Each squad publishes a `.squad/manifest.json` declaring its name, capabilities, and contact information. Squads discover each other through:
|
|
29
|
+
1. **Well-known paths**: Check `.squad/manifest.json` in known org repos
|
|
30
|
+
2. **Upstream config**: Squads already listed in `.squad/upstream.json` are checked for manifests
|
|
31
|
+
3. **Explicit registry**: A central `squad-registry.json` can list all squads in an org
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"name": "platform-squad",
|
|
36
|
+
"version": "1.0.0",
|
|
37
|
+
"description": "Platform infrastructure team",
|
|
38
|
+
"capabilities": ["kubernetes", "helm", "monitoring", "ci-cd"],
|
|
39
|
+
"contact": {
|
|
40
|
+
"repo": "org/platform",
|
|
41
|
+
"labels": ["squad:platform"]
|
|
42
|
+
},
|
|
43
|
+
"accepts": ["issues", "prs"],
|
|
44
|
+
"skills": ["helm-developer", "operator-developer", "pipeline-engineer"]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Context Sharing
|
|
49
|
+
When delegating work, share only what the target squad needs:
|
|
50
|
+
- **Capability list**: What this squad can do (from manifest)
|
|
51
|
+
- **Relevant decisions**: Only decisions that affect the target squad
|
|
52
|
+
- **Handoff context**: A concise description of why this work is being delegated
|
|
53
|
+
|
|
54
|
+
Do NOT share:
|
|
55
|
+
- Internal team state (casting history, session logs)
|
|
56
|
+
- Full decision archives (send only relevant excerpts)
|
|
57
|
+
- Authentication credentials or secrets
|
|
58
|
+
|
|
59
|
+
### Work Handoff Protocol
|
|
60
|
+
1. **Check manifest**: Verify the target squad accepts the work type (issues, PRs)
|
|
61
|
+
2. **Create issue**: Use `gh issue create` in the target repo with:
|
|
62
|
+
- Title: `[cross-squad] <description>`
|
|
63
|
+
- Label: `squad:cross-squad` (or the squad's configured label)
|
|
64
|
+
- Body: Context, acceptance criteria, and link back to originating issue
|
|
65
|
+
3. **Track**: Record the cross-squad issue URL in the originating squad's orchestration log
|
|
66
|
+
4. **Poll**: Periodically check if the delegated issue is closed/completed
|
|
67
|
+
|
|
68
|
+
### Feedback Loop
|
|
69
|
+
Track delegated work completion:
|
|
70
|
+
- Poll target issue status via `gh issue view`
|
|
71
|
+
- Update originating issue with status changes
|
|
72
|
+
- Close the feedback loop when delegated work merges
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Discovering squads
|
|
77
|
+
```bash
|
|
78
|
+
# List all squads discoverable from upstreams and known repos
|
|
79
|
+
squad discover
|
|
80
|
+
|
|
81
|
+
# Output:
|
|
82
|
+
# platform-squad → org/platform (kubernetes, helm, monitoring)
|
|
83
|
+
# frontend-squad → org/frontend (react, nextjs, storybook)
|
|
84
|
+
# data-squad → org/data (spark, airflow, dbt)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Delegating work
|
|
88
|
+
```bash
|
|
89
|
+
# Delegate a task to the platform squad
|
|
90
|
+
squad delegate platform-squad "Add Prometheus metrics endpoint for the auth service"
|
|
91
|
+
|
|
92
|
+
# Creates issue in org/platform with cross-squad label and context
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Manifest in squad.config.ts
|
|
96
|
+
```typescript
|
|
97
|
+
export default defineSquad({
|
|
98
|
+
manifest: {
|
|
99
|
+
name: 'platform-squad',
|
|
100
|
+
capabilities: ['kubernetes', 'helm'],
|
|
101
|
+
contact: { repo: 'org/platform', labels: ['squad:platform'] },
|
|
102
|
+
accepts: ['issues', 'prs'],
|
|
103
|
+
skills: ['helm-developer', 'operator-developer'],
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Anti-Patterns
|
|
109
|
+
- **Direct file writes across repos** — Never modify another squad's `.squad/` directory. Use issues and PRs as the communication protocol.
|
|
110
|
+
- **Tight coupling** — Don't depend on another squad's internal structure. Use the manifest as the public API contract.
|
|
111
|
+
- **Unbounded delegation** — Always include acceptance criteria and a timeout. Don't create open-ended requests.
|
|
112
|
+
- **Skipping discovery** — Don't hardcode squad locations. Use manifests and the discovery protocol.
|
|
113
|
+
- **Sharing secrets** — Never include credentials, tokens, or internal URLs in cross-squad issues.
|
|
114
|
+
- **Circular delegation** — Track delegation chains. If squad A delegates to B which delegates back to A, something is wrong.
|