squad-station 0.5.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.
- package/.squad/examples/orchestrator-claude.yml +31 -0
- package/.squad/examples/orchestrator-gemini.yml +31 -0
- package/.squad/sdd/bmad-playbook.md +240 -0
- package/.squad/sdd/gsd-playbook.md +621 -0
- package/.squad/sdd/superpowers-playbook.md +349 -0
- package/bin/run.js +180 -0
- package/package.json +31 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Superpowers — Playbook v5.0.0
|
|
2
|
+
|
|
3
|
+
> Practical guide for Superpowers — installation, usage, troubleshooting.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation & Setup
|
|
8
|
+
|
|
9
|
+
### Claude Code — Official Marketplace
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
/plugin install superpowers@claude-plugins-official
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Claude Code — Community Marketplace
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
/plugin marketplace add obra/superpowers-marketplace
|
|
19
|
+
/plugin install superpowers@superpowers-marketplace
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Cursor
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
/plugin-add superpowers
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Codex
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### OpenCode
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.opencode/INSTALL.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Verify Installation
|
|
41
|
+
|
|
42
|
+
After installation, start a new session and try:
|
|
43
|
+
- Say: **"help me plan this feature"** → Superpowers auto-triggers brainstorming skill
|
|
44
|
+
- Say: **"let's debug this issue"** → Superpowers auto-triggers systematic-debugging skill
|
|
45
|
+
- If the agent uses a skill automatically → ✅ installation successful
|
|
46
|
+
|
|
47
|
+
### Update
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
/plugin update superpowers
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Day 1 Workflow
|
|
56
|
+
|
|
57
|
+
### Scenario: Build a new feature
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
1. Open Claude Code / Cursor (Superpowers installed)
|
|
61
|
+
2. Say: "Build feature X for project Y"
|
|
62
|
+
3. Agent AUTOMATICALLY invokes brainstorming
|
|
63
|
+
4. Agent asks you questions (1 question at a time, usually MCQ)
|
|
64
|
+
5. You answer → Agent continues asking until it has enough understanding
|
|
65
|
+
6. Agent proposes 2-3 approaches + recommendation
|
|
66
|
+
7. You choose an approach
|
|
67
|
+
8. Agent presents design section by section → you approve/modify
|
|
68
|
+
9. Agent writes spec → docs/superpowers/specs/
|
|
69
|
+
10. Agent AUTOMATICALLY transitions to writing-plans
|
|
70
|
+
11. Agent creates plan with bite-sized tasks
|
|
71
|
+
12. You say "Go" → Agent dispatches subagents (SDD workflow)
|
|
72
|
+
13. Each task: Implement → Spec Review → Quality Review
|
|
73
|
+
14. All done → Agent asks: Merge / PR / Keep / Discard?
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Your actions on Day 1
|
|
77
|
+
|
|
78
|
+
| Step | What you do | What the agent does |
|
|
79
|
+
|------|-------------|---------------------|
|
|
80
|
+
| 1 | Describe feature | Invoke brainstorming |
|
|
81
|
+
| 2 | Answer questions | Ask 1 question at a time, MCQ preferred |
|
|
82
|
+
| 3 | Choose approach | Propose 2-3 options |
|
|
83
|
+
| 4 | Approve design sections | Present section by section |
|
|
84
|
+
| 5 | Say "Go" | Create plan + dispatch subagents |
|
|
85
|
+
| 6 | (Wait) | SDD: implement → review → fix per task |
|
|
86
|
+
| 7 | Choose Merge/PR/Keep/Discard | Execute choice + cleanup |
|
|
87
|
+
|
|
88
|
+
**Autonomous run time:** The agent can run **for hours** after you say "Go" without intervention (unless BLOCKED).
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Daily Operations
|
|
93
|
+
|
|
94
|
+
### When you want to build a new feature
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
"Build [feature description]"
|
|
98
|
+
→ Agent auto-triggers: brainstorming → writing-plans → SDD
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### When you want to fix a bug
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
"Fix [bug description]"
|
|
105
|
+
→ Agent auto-triggers: systematic-debugging → 4-phase investigation → TDD fix
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### When you want to debug a complex issue
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
"Debug: [issue description]"
|
|
112
|
+
→ Agent MUST: Root Cause Investigation → Pattern Analysis → Hypothesis → Implementation
|
|
113
|
+
→ NO random fixes allowed
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### When you want to review code
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
"Review the changes I made in [branch/file]"
|
|
120
|
+
→ Agent dispatches code-reviewer subagent
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### When you want to create a custom skill
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
"Help me create a skill for [technique description]"
|
|
127
|
+
→ Agent triggers: writing-skills (TDD for documentation)
|
|
128
|
+
→ RED: Baseline test → GREEN: Write skill → REFACTOR: Close loopholes
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### When you want to brainstorm only (no implementation)
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
"Let's brainstorm about [topic]"
|
|
135
|
+
→ Agent follows full brainstorming process
|
|
136
|
+
→ Ends with spec document, does not auto-transition to implementation
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Strategic Configuration
|
|
142
|
+
|
|
143
|
+
### Instruction Priority
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
User instructions (CLAUDE.md, AGENTS.md) > Superpowers skills > System prompt
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Override example: If `CLAUDE.md` says "don't use TDD" → Superpowers TDD skill is overridden.
|
|
150
|
+
|
|
151
|
+
### Personal Skills (Shadowing)
|
|
152
|
+
|
|
153
|
+
Personal skills override superpowers skills with the same name:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
~/.claude/skills/brainstorming/SKILL.md ← Agent uses this
|
|
157
|
+
plugin/skills/brainstorming/SKILL.md ← Shadowed
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Force using the superpowers version:
|
|
161
|
+
```
|
|
162
|
+
Invoke superpowers:brainstorming ← Bypasses personal skill
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Skill Types
|
|
166
|
+
|
|
167
|
+
| Type | Behavior | Example |
|
|
168
|
+
|------|----------|---------|
|
|
169
|
+
| **Rigid** | Follow exactly, no adaptation | TDD, debugging, verification |
|
|
170
|
+
| **Flexible** | Adapt principles to context | Patterns, techniques |
|
|
171
|
+
|
|
172
|
+
### Model Selection for SDD
|
|
173
|
+
|
|
174
|
+
| Task | Model recommendation | Signal |
|
|
175
|
+
|------|---------------------|--------|
|
|
176
|
+
| Mechanical implementation | Cheap/Fast | 1-2 files, clear spec |
|
|
177
|
+
| Integration tasks | Standard | Multi-file, pattern matching |
|
|
178
|
+
| Design/Architecture/Review | Most Capable | Judgment, broad understanding |
|
|
179
|
+
|
|
180
|
+
### Output Locations
|
|
181
|
+
|
|
182
|
+
| Content | Default Path |
|
|
183
|
+
|---------|-------------|
|
|
184
|
+
| Specs | `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` |
|
|
185
|
+
| Plans | `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md` |
|
|
186
|
+
| Personal skills | `~/.claude/skills/` (CC) / `~/.agents/skills/` (Codex) |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Cheat Sheet
|
|
191
|
+
|
|
192
|
+
### Skills Reference
|
|
193
|
+
|
|
194
|
+
| Skill | Triggered when | Iron Law |
|
|
195
|
+
|-------|---------------|----------|
|
|
196
|
+
| `brainstorming` | Any creative work | NO code before design approved |
|
|
197
|
+
| `writing-plans` | Spec/requirements exist for multi-step task | Bite-sized tasks (2-5 min each) |
|
|
198
|
+
| `subagent-driven-development` | Plan exists + platform supports subagent | Fresh subagent per task + two-stage review |
|
|
199
|
+
| `executing-plans` | Plan exists + platform does NOT have subagent | Execute continuously, stop only on blocker |
|
|
200
|
+
| `test-driven-development` | All implementation | NO production code without failing test first |
|
|
201
|
+
| `systematic-debugging` | All technical issues | NO fixes without root cause investigation |
|
|
202
|
+
| `verification-before-completion` | Before claiming done/fixed/passing | NO claims without fresh verification evidence |
|
|
203
|
+
| `using-git-worktrees` | Before starting implementation | Isolated workspace, verify clean baseline |
|
|
204
|
+
| `finishing-a-development-branch` | Implementation done, tests pass | Verify tests → Present 4 options → Execute |
|
|
205
|
+
| `requesting-code-review` | After each task (SDD) or before merge | Dispatch code-reviewer subagent |
|
|
206
|
+
| `receiving-code-review` | Receiving feedback from reviewer | Fix Critical immediately, Important before continuing |
|
|
207
|
+
| `dispatching-parallel-agents` | Multiple independent domains | Identify domains → Create tasks → Dispatch → Integrate |
|
|
208
|
+
| `writing-skills` | Creating a new skill | TDD for documentation: RED → GREEN → REFACTOR |
|
|
209
|
+
| `using-superpowers` | Every conversation | 1% rule: if a skill COULD apply → MUST invoke |
|
|
210
|
+
|
|
211
|
+
### TDD Cycle Quick Reference
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
1. RED — Write failing test (one behavior, clear name)
|
|
215
|
+
2. VERIFY RED — Run test, confirm fails correctly (not errors)
|
|
216
|
+
3. GREEN — Write MINIMAL code to pass
|
|
217
|
+
4. VERIFY GREEN — Run test, confirm ALL pass
|
|
218
|
+
5. REFACTOR — Clean up (keep green)
|
|
219
|
+
6. REPEAT — Next behavior
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### SDD Per-Task Flow
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
1. Dispatch implementer subagent (full task text + context)
|
|
226
|
+
2. Handle status: DONE → review | BLOCKED → assess | NEEDS_CONTEXT → provide
|
|
227
|
+
3. Dispatch spec reviewer → approved? → yes → next | no → fix → re-review
|
|
228
|
+
4. Dispatch quality reviewer → approved? → yes → next task | no → fix → re-review
|
|
229
|
+
5. Mark task complete
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Finishing Branch Options
|
|
233
|
+
|
|
234
|
+
| Option | Command | Cleanup worktree? |
|
|
235
|
+
|--------|---------|-------------------|
|
|
236
|
+
| 1. Merge locally | `git checkout main && git merge <branch>` | ✅ |
|
|
237
|
+
| 2. Create PR | `git push -u origin <branch> && gh pr create` | ✅ |
|
|
238
|
+
| 3. Keep as-is | (nothing) | ❌ |
|
|
239
|
+
| 4. Discard | Type "discard" to confirm | ✅ |
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Troubleshooting
|
|
244
|
+
|
|
245
|
+
### Installation Issues
|
|
246
|
+
|
|
247
|
+
| Error | Fix |
|
|
248
|
+
|-------|-----|
|
|
249
|
+
| Skills not triggering | Re-run `/plugin install superpowers` |
|
|
250
|
+
| "Legacy skills dir" warning | Move skills to `~/.claude/skills/` then delete old dir |
|
|
251
|
+
| Codex not loading skills | Follow `docs/README.codex.md` step by step |
|
|
252
|
+
|
|
253
|
+
### Runtime Issues
|
|
254
|
+
|
|
255
|
+
| Error | Fix |
|
|
256
|
+
|-------|-----|
|
|
257
|
+
| Agent doesn't brainstorm and codes directly | Say explicitly: "Let's brainstorm first" or check plugin install |
|
|
258
|
+
| Agent skips TDD | Check if CLAUDE.md has an override |
|
|
259
|
+
| Subagent BLOCKED continuously | Break task into smaller pieces, upgrade model |
|
|
260
|
+
| Review loop runs forever | After 5 iterations → escalate to human |
|
|
261
|
+
| Agent uses "should work" | Agent MUST run command before claiming |
|
|
262
|
+
| Personal skill override | Use `superpowers:skill-name` prefix to force |
|
|
263
|
+
|
|
264
|
+
### SDD Issues
|
|
265
|
+
|
|
266
|
+
| Error | Fix |
|
|
267
|
+
|-------|-----|
|
|
268
|
+
| Implementer NEEDS_CONTEXT | Provide missing context, re-dispatch |
|
|
269
|
+
| Spec reviewer reject | Implementer fixes, re-review |
|
|
270
|
+
| Multiple subagents conflict | NEVER dispatch parallel implementation subagents |
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Best Practices
|
|
275
|
+
|
|
276
|
+
### ✅ Gold Rules
|
|
277
|
+
|
|
278
|
+
1. **Always let the agent brainstorm first** — Even if the project seems "simple"
|
|
279
|
+
2. **No code before tests** — If you've already coded → DELETE. Start over
|
|
280
|
+
3. **Verify before claiming** — Run command → Read output → THEN claim
|
|
281
|
+
4. **1 question per message** — Don't overwhelm with multiple questions
|
|
282
|
+
5. **Strict YAGNI** — Remove unnecessary features from every design
|
|
283
|
+
6. **Commit frequently** — Every completed step → commit
|
|
284
|
+
7. **Worktree for all implementation** — Don't code on main/master
|
|
285
|
+
8. **Trust the process** — Systematic debugging > random fixes
|
|
286
|
+
9. **Two-stage review** — Spec compliance FIRST, code quality SECOND
|
|
287
|
+
10. **Escalate when stuck** — After 5 review iterations → ask human
|
|
288
|
+
|
|
289
|
+
### ❌ Anti-Patterns
|
|
290
|
+
|
|
291
|
+
| Anti-Pattern | Replace with |
|
|
292
|
+
|-------------|-------------|
|
|
293
|
+
| "Too simple to need a design" | Keep brainstorming brief but it MUST happen |
|
|
294
|
+
| "I'll test after" | RED-GREEN-REFACTOR |
|
|
295
|
+
| "Should work now" | Run verification command |
|
|
296
|
+
| "Just this once" | No exceptions |
|
|
297
|
+
| "TDD is dogmatic" | TDD IS pragmatic: faster than debugging |
|
|
298
|
+
| "This doesn't need a skill" | If skill exists → use it. 1% rule |
|
|
299
|
+
| "Fix multiple things at once" | One variable at a time |
|
|
300
|
+
| Skip spec review, go to quality | Spec compliance ✅ THEN quality |
|
|
301
|
+
|
|
302
|
+
### When NOT to use Superpowers workflow
|
|
303
|
+
|
|
304
|
+
| Scenario | Reason |
|
|
305
|
+
|----------|--------|
|
|
306
|
+
| Throwaway prototypes | TDD not needed |
|
|
307
|
+
| Generated code | Machine-generated, manual TDD not needed |
|
|
308
|
+
| Configuration files | TDD can be skipped |
|
|
309
|
+
| Quick one-line fix | Brainstorming can be skipped |
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Custom Skills — Creating New Skills
|
|
314
|
+
|
|
315
|
+
### SKILL.md Template
|
|
316
|
+
|
|
317
|
+
```markdown
|
|
318
|
+
---
|
|
319
|
+
name: my-skill-name
|
|
320
|
+
description: Use when [specific triggering conditions]
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
# My Skill Name
|
|
324
|
+
|
|
325
|
+
## Overview
|
|
326
|
+
Core principle in 1-2 sentences.
|
|
327
|
+
|
|
328
|
+
## When to Use
|
|
329
|
+
- Symptom A
|
|
330
|
+
- Symptom B
|
|
331
|
+
- NOT for: [exclusions]
|
|
332
|
+
|
|
333
|
+
## The Process
|
|
334
|
+
[Steps, flowcharts, checklists]
|
|
335
|
+
|
|
336
|
+
## Red Flags
|
|
337
|
+
[Signs to STOP]
|
|
338
|
+
|
|
339
|
+
## Common Mistakes
|
|
340
|
+
[Anti-patterns + fixes]
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### TDD Process for Skills
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
1. RED: Run baseline scenario (agent WITHOUT skill) → document violations
|
|
347
|
+
2. GREEN: Write minimal SKILL.md addressing those violations
|
|
348
|
+
3. REFACTOR: Find new rationalizations → plug loopholes → re-verify
|
|
349
|
+
```
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bin/run.js — entry point for npx squad-station
|
|
3
|
+
// Handles "install" in JS (download binary + scaffold project files).
|
|
4
|
+
// All other subcommands proxy to the native Rust binary.
|
|
5
|
+
|
|
6
|
+
const { spawnSync } = require('child_process');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
|
|
10
|
+
const subcommand = process.argv[2];
|
|
11
|
+
|
|
12
|
+
if (subcommand === 'install') {
|
|
13
|
+
install();
|
|
14
|
+
} else {
|
|
15
|
+
proxyToBinary();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ── Install ─────────────────────────────────────────────────────────
|
|
19
|
+
// 1. Download squad-station binary to system PATH
|
|
20
|
+
// 2. Copy .squad/ project files to CWD
|
|
21
|
+
|
|
22
|
+
function install() {
|
|
23
|
+
var args = process.argv.slice(3);
|
|
24
|
+
var force = args.includes('--force') || args.includes('-f');
|
|
25
|
+
|
|
26
|
+
console.log('\n\x1b[32m══════════════════════════════════\x1b[0m');
|
|
27
|
+
console.log(' \x1b[1mSquad Station Install\x1b[0m');
|
|
28
|
+
console.log('\x1b[32m══════════════════════════════════\x1b[0m\n');
|
|
29
|
+
|
|
30
|
+
// Step 1: Install binary
|
|
31
|
+
installBinary();
|
|
32
|
+
|
|
33
|
+
// Step 2: Scaffold project files
|
|
34
|
+
scaffoldProject(force);
|
|
35
|
+
|
|
36
|
+
// Done
|
|
37
|
+
console.log('\n\x1b[1mNext steps:\x1b[0m');
|
|
38
|
+
console.log(' 1. Copy an example config:');
|
|
39
|
+
console.log(' \x1b[36mcp .squad/examples/orchestrator-claude.yml squad.yml\x1b[0m');
|
|
40
|
+
console.log(' 2. Edit \x1b[36msquad.yml\x1b[0m — set project name, providers, models');
|
|
41
|
+
console.log(' 3. Run \x1b[36msquad-station init\x1b[0m — launch tmux sessions\n');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function installBinary() {
|
|
45
|
+
var VERSION = require('../package.json').version;
|
|
46
|
+
var REPO = 'thientranhung/squad-station';
|
|
47
|
+
|
|
48
|
+
var platformMap = { darwin: 'darwin', linux: 'linux' };
|
|
49
|
+
var archMap = { x64: 'x86_64', arm64: 'arm64' };
|
|
50
|
+
|
|
51
|
+
var p = platformMap[process.platform];
|
|
52
|
+
var a = archMap[process.arch];
|
|
53
|
+
|
|
54
|
+
if (!p || !a) {
|
|
55
|
+
console.error('Unsupported platform: ' + process.platform + ' ' + process.arch);
|
|
56
|
+
console.error('Manual install: https://github.com/' + REPO + '/releases');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var assetName = 'squad-station-' + p + '-' + a;
|
|
61
|
+
var url = 'https://github.com/' + REPO + '/releases/download/v' + VERSION + '/' + assetName;
|
|
62
|
+
|
|
63
|
+
// Determine install directory
|
|
64
|
+
var installDir = '/usr/local/bin';
|
|
65
|
+
var fallback = false;
|
|
66
|
+
try {
|
|
67
|
+
fs.accessSync(installDir, fs.constants.W_OK);
|
|
68
|
+
} catch (_) {
|
|
69
|
+
installDir = path.join(process.env.HOME || process.env.USERPROFILE || '~', '.local', 'bin');
|
|
70
|
+
fallback = true;
|
|
71
|
+
fs.mkdirSync(installDir, { recursive: true });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var destPath = path.join(installDir, 'squad-station');
|
|
75
|
+
|
|
76
|
+
// Check if binary already exists and is the right version
|
|
77
|
+
if (fs.existsSync(destPath)) {
|
|
78
|
+
try {
|
|
79
|
+
var result = spawnSync(destPath, ['--version'], { encoding: 'utf8' });
|
|
80
|
+
if (result.stdout && result.stdout.includes(VERSION)) {
|
|
81
|
+
console.log(' \x1b[32m✓\x1b[0m squad-station v' + VERSION + ' already installed at ' + destPath);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
} catch (_) {
|
|
85
|
+
// Can't check version, re-download
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
console.log(' Downloading ' + assetName + ' v' + VERSION + '...');
|
|
90
|
+
|
|
91
|
+
// Use curl (available on macOS/Linux) for simplicity
|
|
92
|
+
var curlResult = spawnSync('curl', [
|
|
93
|
+
'-fsSL', '--proto', '=https', '--tlsv1.2',
|
|
94
|
+
'-o', destPath,
|
|
95
|
+
url
|
|
96
|
+
], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
97
|
+
|
|
98
|
+
if (curlResult.status !== 0) {
|
|
99
|
+
var stderr = curlResult.stderr ? curlResult.stderr.toString() : '';
|
|
100
|
+
console.error(' Download failed: ' + stderr);
|
|
101
|
+
console.error(' Manual install: https://github.com/' + REPO + '/releases');
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
fs.chmodSync(destPath, 0o755);
|
|
106
|
+
console.log(' \x1b[32m✓\x1b[0m Installed squad-station to ' + destPath);
|
|
107
|
+
|
|
108
|
+
if (fallback) {
|
|
109
|
+
console.log(' \x1b[33m!\x1b[0m Add ~/.local/bin to your PATH if not already present.');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function scaffoldProject(force) {
|
|
114
|
+
// Source: bundled .squad/ directory inside npm package
|
|
115
|
+
var pkgRoot = path.join(__dirname, '..');
|
|
116
|
+
var srcSquad = path.join(pkgRoot, '.squad');
|
|
117
|
+
var destSquad = path.join(process.cwd(), '.squad');
|
|
118
|
+
|
|
119
|
+
console.log('');
|
|
120
|
+
|
|
121
|
+
// Copy sdd/ playbooks
|
|
122
|
+
var sddSrc = path.join(srcSquad, 'sdd');
|
|
123
|
+
var sddDest = path.join(destSquad, 'sdd');
|
|
124
|
+
fs.mkdirSync(sddDest, { recursive: true });
|
|
125
|
+
|
|
126
|
+
var sddFiles = fs.readdirSync(sddSrc).filter(function(f) { return f.endsWith('.md'); });
|
|
127
|
+
sddFiles.forEach(function(file) {
|
|
128
|
+
var dest = path.join(sddDest, file);
|
|
129
|
+
if (fs.existsSync(dest) && !force) {
|
|
130
|
+
console.log(' \x1b[33m–\x1b[0m .squad/sdd/' + file + ' \x1b[2m(exists, use --force to overwrite)\x1b[0m');
|
|
131
|
+
} else {
|
|
132
|
+
fs.copyFileSync(path.join(sddSrc, file), dest);
|
|
133
|
+
console.log(' \x1b[32m✓\x1b[0m .squad/sdd/' + file);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Copy examples/
|
|
138
|
+
var exSrc = path.join(srcSquad, 'examples');
|
|
139
|
+
var exDest = path.join(destSquad, 'examples');
|
|
140
|
+
fs.mkdirSync(exDest, { recursive: true });
|
|
141
|
+
|
|
142
|
+
var exFiles = fs.readdirSync(exSrc).filter(function(f) { return f.endsWith('.yml'); });
|
|
143
|
+
exFiles.forEach(function(file) {
|
|
144
|
+
var dest = path.join(exDest, file);
|
|
145
|
+
if (fs.existsSync(dest) && !force) {
|
|
146
|
+
console.log(' \x1b[33m–\x1b[0m .squad/examples/' + file + ' \x1b[2m(exists, use --force to overwrite)\x1b[0m');
|
|
147
|
+
} else {
|
|
148
|
+
fs.copyFileSync(path.join(exSrc, file), dest);
|
|
149
|
+
console.log(' \x1b[32m✓\x1b[0m .squad/examples/' + file);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ── Proxy ───────────────────────────────────────────────────────────
|
|
155
|
+
// Forward all non-install subcommands to the native binary.
|
|
156
|
+
|
|
157
|
+
function proxyToBinary() {
|
|
158
|
+
var binaryPath = null;
|
|
159
|
+
|
|
160
|
+
// Try system-installed binary via PATH
|
|
161
|
+
var which = spawnSync('which', ['squad-station'], { encoding: 'utf8' });
|
|
162
|
+
if (which.status === 0 && which.stdout) {
|
|
163
|
+
binaryPath = which.stdout.trim();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (!binaryPath) {
|
|
167
|
+
console.error('squad-station binary not found.');
|
|
168
|
+
console.error('Run: npx squad-station install');
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
var result = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
173
|
+
|
|
174
|
+
if (result.error) {
|
|
175
|
+
console.error(result.error.message);
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
process.exit(result.status != null ? result.status : 0);
|
|
180
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "squad-station",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Message routing and orchestration for AI agent squads",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/thientranhung/squad-station.git"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"squad-station": "./bin/run.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin/",
|
|
14
|
+
".squad/sdd/",
|
|
15
|
+
".squad/examples/"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=14"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ai",
|
|
22
|
+
"agents",
|
|
23
|
+
"orchestration",
|
|
24
|
+
"tmux",
|
|
25
|
+
"squad",
|
|
26
|
+
"claude",
|
|
27
|
+
"gemini",
|
|
28
|
+
"cli"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT"
|
|
31
|
+
}
|