squadrant 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -0
  3. package/dist/index.js +9154 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/squadrantd.js +3928 -0
  6. package/dist/squadrantd.js.map +1 -0
  7. package/package.json +68 -0
  8. package/plugin/.claude-plugin/plugin.json +5 -0
  9. package/plugin/skills/add-pick-crew-rule/SKILL.md +88 -0
  10. package/plugin/skills/captain-ops/SKILL.md +390 -0
  11. package/plugin/skills/command-ops/SKILL.md +157 -0
  12. package/plugin/skills/config-doctor/SKILL.md +46 -0
  13. package/plugin/skills/daily-log/SKILL.md +44 -0
  14. package/plugin/skills/karpathy-principles/SKILL.md +82 -0
  15. package/plugin/skills/set-effort/SKILL.md +59 -0
  16. package/plugin/skills/side-session/SKILL.md +113 -0
  17. package/plugin/skills/squadrant-effort/SKILL.md +8 -0
  18. package/plugin/skills/squadrant-new-project/SKILL.md +67 -0
  19. package/plugin/skills/squadrant-register-project/SKILL.md +60 -0
  20. package/plugin/skills/where-i-am/SKILL.md +102 -0
  21. package/plugin/skills/wiki-ops/SKILL.md +96 -0
  22. package/plugin/skills/wim/SKILL.md +8 -0
  23. package/scripts/acceptance-interactive-codex.sh +56 -0
  24. package/scripts/capture-skill.sh +32 -0
  25. package/scripts/claude-iv-smoke.mjs +133 -0
  26. package/scripts/fix-skill.sh +39 -0
  27. package/scripts/gen-codex-types.sh +18 -0
  28. package/scripts/mailbox-injector-smoke.mjs +124 -0
  29. package/scripts/mark-learning-useful.sh +22 -0
  30. package/scripts/migrate-to-squadrant.sh +158 -0
  31. package/scripts/notify-relay-placement-smoke.mjs +59 -0
  32. package/scripts/read-handoff.sh +22 -0
  33. package/scripts/record-learning.sh +31 -0
  34. package/scripts/record-side-handoff.sh +32 -0
  35. package/scripts/smoke-push-notify.mjs +147 -0
  36. package/scripts/spawn-crew-pane.sh +17 -0
  37. package/scripts/spawn-workspace.sh +206 -0
  38. package/scripts/wiki-ingest.sh +121 -0
  39. package/scripts/wiki-log.sh +20 -0
  40. package/scripts/wiki-query.sh +36 -0
  41. package/scripts/write-handoff.sh +31 -0
  42. package/templates/captain.claude.md +44 -0
  43. package/templates/captain.generic.md +45 -0
  44. package/templates/command.claude.md +32 -0
  45. package/templates/crew.claude.md +64 -0
  46. package/templates/crew.generic.md +51 -0
  47. package/templates/crew.opencode.md +51 -0
  48. package/templates/learnings.claude.md +40 -0
  49. package/templates/side.debug.claude.md +78 -0
  50. package/templates/side.research.claude.md +63 -0
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: command-ops
3
+ description: Command playbook — invoked on-demand by `squadrant command [--task ...]`. Covers daily briefing, delegation workflow, project registration, status checking, and learnings review. Command is no longer always-on.
4
+ ---
5
+
6
+ # Command Operations
7
+
8
+ > **On-demand only.** Command is no longer launched by `squadrant launch --all`. You were spawned by `squadrant command --task <briefing|learnings-review|wiki-aggregate>` to run a single task and exit. Do the task, then exit cleanly — no persistent loop.
9
+
10
+ ## Daily Briefing (Session Start)
11
+
12
+ Run when session starts, or user says "morning", "catch up", "summary":
13
+
14
+ 1. **Check handoffs from all projects** (context from yesterday's sessions):
15
+ ```bash
16
+ for vault in $(cat ~/.config/squadrant/config.json | python3 -c "import json,sys; [print(p['spokeVault']) for p in json.loads(sys.stdin.read())['projects'].values()]"); do
17
+ echo "=== $(basename $vault) ==="
18
+ ~/.config/squadrant/scripts/read-handoff.sh "$vault" --keep
19
+ done
20
+ ```
21
+ Handoffs contain: currentState, openBranches, nextSteps, blockedItems, decisions. Use these to understand where each project left off.
22
+
23
+ 2. Search **claude-mem** (`mem-search` skill) for recent activity across all projects.
24
+ 3. Read yesterday's logs:
25
+ ```bash
26
+ YESTERDAY=$(date -v-1d +"%Y-%m-%d")
27
+ for vault in $(cat ~/.config/squadrant/config.json | python3 -c "import json,sys; [print(p['spokeVault']) for p in json.loads(sys.stdin.read())['projects'].values()]"); do
28
+ echo "=== $vault ==="
29
+ cat "$vault/daily-logs/${YESTERDAY}.md" 2>/dev/null || echo "(no log)"
30
+ done
31
+ ```
32
+ 4. Read current status: `~/.config/squadrant/scripts/read-status.sh`
33
+ 5. Run quick standup for context: `squadrant standup --yesterday --raw`
34
+ 6. Present briefing, then save to `{hubVault}/daily-logs/YYYY-MM-DD.md`
35
+
36
+ ## Delegation Workflow
37
+
38
+ When the user gives a task for a project:
39
+
40
+ ### 1. Identify project
41
+ Match to `~/.config/squadrant/config.json`.
42
+
43
+ ### 2. Check for captain workspace
44
+ ```bash
45
+ /Applications/cmux.app/Contents/Resources/bin/cmux list-workspaces
46
+ ```
47
+ **CRITICAL:** Match the EXACT `captainName` from config. `Brove` ≠ `⚓ brove-captain`.
48
+
49
+ ### 3. Freshness gate (run BEFORE deciding to reuse)
50
+ A name match is **not** sufficient — the workspace may be holding a session from a previous day. Check `sessions.json` against today before reusing:
51
+ ```bash
52
+ TODAY=$(date +%Y-%m-%d)
53
+ LAST=$(python3 -c "import json; d=json.load(open('$HOME/.config/squadrant/sessions.json')); print(d.get('workspaces',{}).get('{captainName}',{}).get('lastLaunched',''))" 2>/dev/null)
54
+ [ "$LAST" = "$TODAY" ] && echo "fresh" || echo "stale"
55
+ ```
56
+ - `fresh` → reuse the existing workspace, proceed to step 5.
57
+ - `stale` (or no entry) → close the existing workspace, then go to step 4 to respawn so `spawn-workspace.sh` runs its `↻ new day — starting fresh session` path:
58
+ ```bash
59
+ /Applications/cmux.app/Contents/Resources/bin/cmux close-workspace --workspace "workspace:N"
60
+ ```
61
+
62
+ Never skip this gate when a workspace was found by name — that's how stale captains get reused.
63
+
64
+ ### 4. Spawn captain (missing or stale)
65
+ ```bash
66
+ ~/.config/squadrant/scripts/spawn-workspace.sh "{captainName}" "{projectPath}"
67
+ ```
68
+ Wait a few seconds, then `list-workspaces` again to get its ref. Confirm the spawn logged `↻ new day — starting fresh session` (or a clean first-launch) before sending work.
69
+
70
+ ### 5. Send the task
71
+ ```bash
72
+ /Applications/cmux.app/Contents/Resources/bin/cmux send --workspace "workspace:N" "Task description with all context"
73
+ /Applications/cmux.app/Contents/Resources/bin/cmux send-key --workspace "workspace:N" Enter
74
+ ```
75
+
76
+ ### 6. Report back
77
+ "Delegated to {captainName}."
78
+
79
+ ## Checking Status
80
+
81
+ ```bash
82
+ ~/.config/squadrant/scripts/read-status.sh
83
+ ```
84
+ Or read a captain's screen:
85
+ ```bash
86
+ /Applications/cmux.app/Contents/Resources/bin/cmux read-screen --workspace "workspace:N"
87
+ ```
88
+
89
+ ## Registering Projects
90
+
91
+ 1. Explore directory: `find {path} -maxdepth 2 -name ".git" -type d`
92
+ 2. Identify primary repo (most active, main application)
93
+ 3. Identify siblings (docs, sites, forks)
94
+ 4. Register with groups:
95
+ ```bash
96
+ squadrant projects add {name} {path/to/repo} --group {group}
97
+ squadrant projects add {name}-docs {path/to/docs} --group {group} --group-role "documentation site"
98
+ ```
99
+ 5. Confirm with user. Always register the `.git` directory, not the parent.
100
+
101
+ ## Monitoring Captains
102
+
103
+ Captains will send you reports via `cmux send` when tasks complete or blockers arise. When you receive a captain report:
104
+
105
+ 1. Acknowledge the report
106
+ 2. Update your dashboard / briefing notes
107
+ 3. If the captain reported a blocker — escalate to the user
108
+ 4. If all tasks for a project are done — inform the user
109
+
110
+ You can also **proactively check** captain progress:
111
+ ```bash
112
+ # Read all captain statuses at once
113
+ for vault in $(cat ~/.config/squadrant/config.json | python3 -c "import json,sys; [print(p['spokeVault']) for p in json.loads(sys.stdin.read())['projects'].values()]"); do
114
+ echo "=== $(basename $vault) ==="
115
+ head -15 "$vault/status.md" 2>/dev/null || echo "(no status)"
116
+ done
117
+ ```
118
+
119
+ Do this when:
120
+ - The user asks for a status update
121
+ - A captain hasn't reported back in a while
122
+ - Before your daily briefing
123
+
124
+ ## Reviewing Learnings
125
+
126
+ 1. Scan `{spokeVault}/learnings/*.md` where `applied: false`
127
+ 2. Group by category, identify cross-project patterns
128
+ 3. If same issue in 2+ projects → propose a **captured skill**
129
+ 4. If a skill keeps failing → propose a **fix**
130
+ 5. Propose specific changes to the user
131
+ 6. After approval, apply and mark `applied: true`
132
+
133
+ ## Wiki Aggregation (Hub Knowledge Base)
134
+
135
+ Periodically review spoke wikis across all projects to build a cross-project knowledge base.
136
+
137
+ ### 1. Scan spoke wiki indexes
138
+ ```bash
139
+ for vault in $(cat ~/.config/squadrant/config.json | python3 -c "import json,sys; [print(p['spokeVault']) for p in json.loads(sys.stdin.read())['projects'].values()]"); do
140
+ echo "=== $(basename $vault) ==="
141
+ cat "$vault/wiki/index.md" 2>/dev/null || echo "(no wiki)"
142
+ done
143
+ ```
144
+
145
+ ### 2. Identify cross-project knowledge
146
+ If a pattern appears in 2+ spoke wikis, create a hub-level wiki page that synthesizes both.
147
+
148
+ ### 3. Create hub wiki pages
149
+ ```bash
150
+ ~/.config/squadrant/scripts/wiki-ingest.sh "{hubVaultPath}" "{slug}" "{title}" "{category}" "{body}" "{tags}" "aggregated from spoke wikis"
151
+ ```
152
+
153
+ ### 4. Wiki health check
154
+ During daily briefing, check for:
155
+ - Projects with zero wiki pages (captains not compiling knowledge)
156
+ - Stale wiki pages (not updated in 2+ weeks)
157
+ - Missing cross-references between related pages
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: config-doctor
3
+ description: Reconcile squadrant config drift that needs human judgment — changed defaults and invalid values surfaced by `squadrant config check`. Use when the drift banner says "items need review" or the user asks to fix config drift.
4
+ ---
5
+
6
+ # Config Doctor
7
+
8
+ Reconcile the config-drift items that `squadrant config check --fix` deliberately does NOT auto-apply: `changed-default` (you may have customized on purpose) and `invalid` (a value that no longer resolves). The safe tier (missing/deprecated) is already handled by `--fix`; do not duplicate it.
9
+
10
+ ## Steps
11
+
12
+ 1. **Get structured drift:**
13
+ ```bash
14
+ squadrant config check --json
15
+ ```
16
+ This prints a `DriftItem[]`. Focus only on items with `kind` of `changed-default` or `invalid`.
17
+
18
+ 2. **Apply the safe tier first (if any missing/deprecated remain):**
19
+ ```bash
20
+ squadrant config check --fix
21
+ ```
22
+ Re-run `--json` afterward to see what judgment items remain.
23
+
24
+ 3. **For each `changed-default` item:**
25
+ - Show the user: `path`, their `current` value, the new `suggested` default, and the `note`.
26
+ - Ask: *adopt the new default, or keep your value?*
27
+ - If keep → no edit needed (it will be dismissed in step 5 via `--accept`).
28
+ - If adopt → edit `~/.config/squadrant/config.json`, setting `path` to `suggested`. Edit ONLY that path.
29
+
30
+ 4. **For each `invalid` item:**
31
+ - Explain why it's invalid (the `note` says, e.g. "unknown driver 'aider'").
32
+ - Propose the correct value (e.g. switch driver to `claude`/`codex`/`opencode`, or remove the dead agent).
33
+ - On confirmation, edit `~/.config/squadrant/config.json` for that path only. Never touch `projects`, `hubVault`, `commandName`, or other user-data sections.
34
+
35
+ 5. **Finalize:**
36
+ ```bash
37
+ squadrant config check # confirm zero remaining drift
38
+ squadrant config check --accept # stamp the version so the banner goes quiet
39
+ ```
40
+ If `check` still shows items the user intentionally kept, `--accept` is the correct way to dismiss them.
41
+
42
+ ## Rules
43
+
44
+ - Edit only the exact dotted paths flagged. One concern per edit.
45
+ - Never auto-decide a `changed-default` — it is the user's call.
46
+ - After reconciling, the stamp must equal the running squadrant version or the banner returns.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: daily-log
3
+ description: Write an end-of-day log to your spoke vault. Use when session ends or user says "end of day" / "wrap up".
4
+ ---
5
+
6
+ # Daily Log
7
+
8
+ Write a daily log before your session ends.
9
+
10
+ ## Setup
11
+
12
+ ```bash
13
+ DATE=$(date +"%Y-%m-%d")
14
+ SPOKE_VAULT="{spokeVaultPath}"
15
+ mkdir -p "$SPOKE_VAULT/daily-logs"
16
+ ```
17
+
18
+ ## Write to `{spokeVaultPath}/daily-logs/YYYY-MM-DD.md`
19
+
20
+ ```markdown
21
+ ---
22
+ date: YYYY-MM-DD
23
+ project: {project-name}
24
+ ---
25
+
26
+ # {project-name} — Daily Log
27
+
28
+ ## Completed
29
+ - [tasks completed today]
30
+
31
+ ## In Progress
32
+ - [tasks still being worked on]
33
+
34
+ ## Blocked
35
+ - [anything stuck]
36
+
37
+ ## Key Decisions
38
+ - [important decisions made today]
39
+
40
+ ## Tomorrow
41
+ - [what should be picked up next]
42
+ ```
43
+
44
+ This log is read by the command session to generate the morning briefing. Keep it concise — bullet points, not paragraphs.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: karpathy-principles
3
+ description: Four coding principles derived from Andrej Karpathy's observations on LLM pitfalls. Use to reduce wrong assumptions, overengineering, drive-by refactors, and vague execution. Apply to every crew coding task and every captain review.
4
+ ---
5
+
6
+ # Karpathy Coding Principles
7
+
8
+ Derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on how LLMs fail at coding. Ported from [forrestchang/andrej-karpathy-skills](https://github.com/forrestchang/andrej-karpathy-skills) (MIT).
9
+
10
+ These four principles apply to every coding task — whether you are a captain reviewing a crew's work or a crew member writing code.
11
+
12
+ ## 1. Think Before Coding
13
+
14
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
15
+
16
+ - State assumptions explicitly — if uncertain, ask rather than guess
17
+ - Present multiple interpretations when ambiguity exists — don't pick silently
18
+ - Push back when warranted — if a simpler approach exists, say so
19
+ - Stop when confused — name what's unclear and ask
20
+
21
+ ## 2. Simplicity First
22
+
23
+ **Minimum code that solves the problem. Nothing speculative.**
24
+
25
+ - No features beyond what was asked
26
+ - No abstractions for single-use code
27
+ - No "flexibility" or "configurability" that wasn't requested
28
+ - No error handling for impossible scenarios
29
+ - If 200 lines could be 50, rewrite
30
+
31
+ **Test:** Would a senior engineer call this overcomplicated? If yes, simplify.
32
+
33
+ ## 3. Surgical Changes
34
+
35
+ **Touch only what you must. Clean up only your own mess.**
36
+
37
+ - Don't improve adjacent code, comments, or formatting
38
+ - Don't refactor things that aren't broken
39
+ - Match existing style, even if you'd do it differently
40
+ - If you notice unrelated dead code, **mention** it — don't delete it
41
+
42
+ When your changes create orphans:
43
+ - Remove imports/variables/functions that **your changes** made unused
44
+ - Don't remove pre-existing dead code unless asked
45
+
46
+ **Test:** Every changed line should trace directly to the user's request.
47
+
48
+ ## 4. Goal-Driven Execution
49
+
50
+ **Define success criteria. Loop until verified.**
51
+
52
+ Transform imperative tasks into verifiable goals:
53
+
54
+ | Instead of... | Transform to... |
55
+ |---|---|
56
+ | "Add validation" | "Write tests for invalid inputs, then make them pass" |
57
+ | "Fix the bug" | "Write a test that reproduces it, then make it pass" |
58
+ | "Refactor X" | "Ensure tests pass before and after" |
59
+
60
+ For multi-step tasks, state a brief plan with per-step verification:
61
+
62
+ ```
63
+ 1. [Step] → verify: [check]
64
+ 2. [Step] → verify: [check]
65
+ ```
66
+
67
+ Strong success criteria let the agent loop independently. Weak criteria ("make it work") force constant clarification.
68
+
69
+ ## Tradeoff
70
+
71
+ These principles bias toward **caution over speed**. For trivial tasks (typo fixes, obvious one-liners) use judgment — not every change needs the full rigor. The goal is reducing costly mistakes on non-trivial work, not slowing down simple tasks.
72
+
73
+ ## Squadrant-specific notes
74
+
75
+ - Squadrant already uses TDD via the `superpowers:test-driven-development` skill — principle 4 complements it, does not replace it
76
+ - Captains applying these principles during review: if a crew member violates principle 3 (drive-by refactors), request they split the commit
77
+ - Crew should report blockers in status.md when principle 1 triggers ("unclear" / "multiple interpretations")
78
+
79
+ ## Attribution
80
+
81
+ - Original principles: [Andrej Karpathy on X](https://x.com/karpathy/status/2015883857489522876)
82
+ - Packaging: [forrestchang/andrej-karpathy-skills](https://github.com/forrestchang/andrej-karpathy-skills) (MIT)
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: set-effort
3
+ description: Read or set the global crew tokenomics dial (max | balance | low). Use when the user wants to change how aggressively crews consume tokens, or to check the current setting.
4
+ ---
5
+
6
+ # squadrant:set-effort — Global Crew Effort Dial
7
+
8
+ The effort dial is a one-field toggle in `~/.config/squadrant/config.json` that biases the captain's crew spawning decisions. It does **not** rewrite routing rules — it is a hint the captain honors when choosing agent/model for new crews.
9
+
10
+ ## Modes
11
+
12
+ | Mode | Meaning |
13
+ |------|---------|
14
+ | **max** | Tokens are plentiful. Prefer claude/opus for crew spawns; don't downshift for cost. |
15
+ | **balance** | Normal. Use default crew routing rules unchanged. (Default when field is absent.) |
16
+ | **low** | Conserve tokens. Prefer opencode/sonnet for crews; reserve opus for work that genuinely needs it. |
17
+
18
+ ## Get current effort
19
+
20
+ ```bash
21
+ squadrant effort
22
+ ```
23
+
24
+ Prints the current mode and its one-line meaning. Does not write anything.
25
+
26
+ ## Set effort
27
+
28
+ ```bash
29
+ squadrant effort max
30
+ squadrant effort balance
31
+ squadrant effort low
32
+ ```
33
+
34
+ - Validates the value (errors with the 3 valid options if invalid).
35
+ - Writes `defaults.effort` via the existing `saveConfig` atomic path.
36
+ - Prints a confirmation line.
37
+ - Best-effort: sends a one-line notice to any running captain workspace so a live session adjusts immediately. If no captain is running, the change applies on next launch.
38
+
39
+ ## Manual edit (fallback)
40
+
41
+ If the CLI is unavailable, edit `~/.config/squadrant/config.json` directly:
42
+
43
+ ```json
44
+ {
45
+ "defaults": {
46
+ "effort": "low"
47
+ }
48
+ }
49
+ ```
50
+
51
+ Valid values: `"max"` | `"balance"` | `"low"`. Absent field is equivalent to `"balance"`.
52
+
53
+ ## Scope
54
+
55
+ Effort is **crew-only**. It does not affect captain, command, or side roles — those stay pinned to their configured model regardless of effort.
56
+
57
+ ## Precedence
58
+
59
+ Effort is the weakest signal. Explicit `--agent` / `--model` flags on `squadrant crew spawn` always win. Effort only biases the captain's default choice when nothing more specific applies.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: side-session
3
+ description: Spawn and manage side-sessions (research/debug) — dedicated fresh-context tabs off the captain's daemon lifecycle. Use when you want to research a topic, discuss an idea, or debug without polluting captain context.
4
+ ---
5
+
6
+ # Side-Sessions
7
+
8
+ A side-session is a dedicated tab with **fresh context** running the captain model (opus), loaded with a role-specific template. It runs **outside the crew/daemon lifecycle** — no `CREW IDLE/DONE` noise back to the primary captain. Its only upward signal is an explicit, user-confirmed structured handoff.
9
+
10
+ ## Spawn a side-session
11
+
12
+ ```bash
13
+ # Research a topic, discuss an idea, produce a spec or GH issue
14
+ squadrant side spawn <project> "<topic>" --role research
15
+
16
+ # Debug a bug in an isolated scratch worktree
17
+ squadrant side spawn <project> "<topic>" --role debug
18
+ ```
19
+
20
+ Options:
21
+ - `--name <name>` — custom tab name (default: auto `side-N`)
22
+ - `--direction <tab|right|down|left|up>` — placement (default: tab)
23
+ - `--agent <claude|opencode>` — agent to use (default: claude)
24
+ - `--topic-file <path>` — read topic from a file
25
+
26
+ ## Manage side-sessions
27
+
28
+ ```bash
29
+ squadrant side list <project> # see live side tabs
30
+ squadrant side send <project> <name> "<follow-up>" # send a follow-up turn
31
+ squadrant side close <project> <name> # close when done
32
+ ```
33
+
34
+ ## Role: research
35
+
36
+ **Can:** Read code/docs, run read-only commands, create GH issues, write specs/plans.
37
+ **Cannot:** Edit source code, spawn crews, merge/ship changes.
38
+
39
+ The session works in fresh context and produces artifacts (specs, GH issues, analysis). When done, it asks the user to confirm before sending a structured handoff to the primary captain.
40
+
41
+ ## Role: debug
42
+
43
+ **Can:** Read code/docs, run code and tests, edit source — but **scratch only** in its isolated worktree (instrumentation, logging, a failing test to pinpoint the root cause).
44
+ **Cannot:** Edit source outside the scratch worktree, spawn crews, merge/ship changes.
45
+
46
+ The debug role creates an isolated scratch git worktree on spawn. Edits made there are never shipped — the draft patch lives on the scratch branch and is referenced in the handoff for a crew to implement cleanly. Close prunes the scratch worktree.
47
+
48
+ ### Bug intake (required first step)
49
+
50
+ Before instrumenting, the debug session gathers from the user:
51
+ 1. Repro steps
52
+ 2. When/where the bug appears
53
+ 3. Expected vs actual behavior
54
+ 4. Recent changes that could be related
55
+
56
+ If the topic already contains all of this, it confirms and proceeds. Otherwise it asks.
57
+
58
+ ## Handoff workflow
59
+
60
+ ```
61
+ 1. Side session produces a result (root cause / artifact).
62
+ 2. Session asks: "Notify the primary captain now? (y/n)"
63
+ 3. On yes:
64
+ - Writes durable record: {spokeVault}/side-handoffs/<topic>.md
65
+ - Sends: squadrant runtime send <project> "🗒 Side handoff [<role>] — <topic> ..."
66
+ 4. Primary captain receives handoff delivered daemon-direct via cmux (#332).
67
+ 5. Captain does NOT auto-spawn a crew — waits for user's go.
68
+ ```
69
+
70
+ ### Structured handoff format (research)
71
+
72
+ ```
73
+ 🗒 Side handoff [research] — <topic>
74
+ Summary: <one-line summary>
75
+ Artifacts: <gh issue #NNN | spec: path/to/file.md | …>
76
+ Next: <recommended next action>
77
+ ```
78
+
79
+ ### Structured handoff format (debug)
80
+
81
+ ```
82
+ 🗒 Side handoff [debug] — <topic>
83
+ Root cause: <one-line root cause>
84
+ Artifacts: <failing test path | instrumentation: <file> | draft patch: scratch branch crew/<name> | issue #NNN>
85
+ Next: <what a crew should implement to fix this>
86
+ ```
87
+
88
+ ## Spawn by the primary captain
89
+
90
+ When the user asks you to start a side session, spawn one:
91
+
92
+ ```bash
93
+ # Research
94
+ squadrant side spawn <project> "<the research question or topic>" --role research
95
+
96
+ # Debug — creates a scratch worktree; pruned automatically on close
97
+ squadrant side spawn <project> "<the bug description>" --role debug
98
+ ```
99
+
100
+ Note the session name from the output (e.g. `side-1`) and tell the user they can steer it with:
101
+
102
+ ```bash
103
+ squadrant side send <project> side-1 "<follow-up>"
104
+ squadrant side close <project> side-1
105
+ ```
106
+
107
+ When the session completes, its handoff is delivered daemon-direct via cmux (#332) with the `🗒 Side handoff` prefix.
108
+
109
+ ## Key invariants
110
+
111
+ `squadrant side spawn` does **NOT** create a daemon task record. There is no `CREW IDLE/DONE` event for side-sessions. The only signal path is the explicit `squadrant runtime send` the side-session sends on user confirmation.
112
+
113
+ `squadrant side close` on a debug session automatically prunes its scratch worktree (the branch is preserved so the draft patch survives).
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: squadrant-effort
3
+ description: Shortcut for squadrant:set-effort — get or set the global crew tokenomics dial (max | balance | low). Use when the user types /squadrant-effort or asks about the effort setting.
4
+ ---
5
+
6
+ # squadrant-effort — shortcut for squadrant:set-effort
7
+
8
+ Shorthand alias. **Invoke the `set-effort` skill** (via the Skill tool) and follow it exactly. All logic lives there — this file intentionally holds none, so the two never drift.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: squadrant-new-project
3
+ description: Create a brand-new GitHub repo, clone it, and register it in squadrant. Handles both new workspace (new group) and existing workspace (join existing group).
4
+ ---
5
+
6
+ # Create and Register a New Project
7
+
8
+ Use when the project does not exist yet — you need to create the GitHub repo, clone it locally, and wire it into squadrant.
9
+
10
+ ## Step 1 — Collect inputs
11
+
12
+ You need:
13
+ - **Repo name** (kebab-case, e.g. `my-project`)
14
+ - **GitHub org or user** (e.g. `Quantum3-Labs` or your GitHub username)
15
+ - **Visibility** — `public` or `private`
16
+ - **Local parent directory** — where to clone into (e.g. `/Users/you/Q3/MyGroup/`)
17
+
18
+ ## Step 2 — Determine workspace placement
19
+
20
+ **New workspace** (no existing group):
21
+ - Pick a group name (kebab-case). This project will be `primary` automatically.
22
+ - No `--group-role` needed.
23
+
24
+ **Existing workspace** (joining an existing group):
25
+ - Run `squadrant projects list` to see current groups.
26
+ - Pick the group to join and specify a role for this project (e.g. `"landing page"`, `"mobile client"`, `"CLI tool"`).
27
+ - The role must NOT be `"primary"` — that slot is already taken.
28
+
29
+ ## Step 3 — Create the GitHub repo and clone
30
+
31
+ ```bash
32
+ gh repo create <org>/<repo-name> --[public|private] --clone --clone-dir <parent-dir>
33
+ ```
34
+
35
+ This creates the repo on GitHub and clones it into `<parent-dir>/<repo-name>`.
36
+
37
+ ## Step 4 — Optional: initial scaffold
38
+
39
+ If the repo should start with a README and first commit:
40
+ ```bash
41
+ cd <parent-dir>/<repo-name>
42
+ echo "# <repo-name>" > README.md
43
+ git add README.md
44
+ git commit -m "chore: initial commit"
45
+ git push
46
+ ```
47
+
48
+ Skip if the repo already has content or the user wants to scaffold separately.
49
+
50
+ ## Step 5 — Register in squadrant
51
+
52
+ ```bash
53
+ squadrant projects add <repo-name> <parent-dir>/<repo-name> \
54
+ --captain "⚓ <repo-name>-captain" \
55
+ [--group <group-name>] \
56
+ [--group-role "<role description>"]
57
+ ```
58
+
59
+ Omit `--group` and `--group-role` for a standalone project with no group.
60
+
61
+ ## Step 6 — Verify
62
+
63
+ ```bash
64
+ squadrant projects list
65
+ ```
66
+
67
+ Confirm the new entry appears with the correct path, group, and role.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: squadrant-register-project
3
+ description: Register an existing local repo (or GitHub URL) into squadrant config. Use when a project already exists and just needs to be wired into squadrant.
4
+ ---
5
+
6
+ # Register an Existing Project
7
+
8
+ Use when the repo already exists locally or on GitHub and you just need to register it in squadrant.
9
+
10
+ ## Step 1 — Resolve the local path
11
+
12
+ **Local path given:** use it directly.
13
+
14
+ **GitHub URL given:** clone first, then use the destination:
15
+ ```bash
16
+ gh repo clone <org>/<repo> <dest-path>
17
+ ```
18
+
19
+ ## Step 2 — Determine the project name
20
+
21
+ Default to the directory name:
22
+ ```bash
23
+ basename <path>
24
+ ```
25
+
26
+ Override if the directory name is ambiguous (e.g. `src`, `app`).
27
+
28
+ ## Step 3 — Determine group placement
29
+
30
+ List existing projects and their groups:
31
+ ```bash
32
+ squadrant projects list
33
+ ```
34
+
35
+ Then decide:
36
+
37
+ **New group** — pick a group name (kebab-case). This project will be `primary` automatically (first in group). No `--group-role` needed.
38
+
39
+ **Existing group** — pick the group name and specify a role that describes this project's purpose (e.g. `"documentation site"`, `"agent task queue"`, `"shared skills library"`). The role must NOT be `"primary"` — that slot is already taken by the first project in the group.
40
+
41
+ > Note: `--group-role` only auto-sets to `"primary"` when it is the first project registered in a group. All subsequent projects in the same group require an explicit `--group-role`.
42
+
43
+ ## Step 4 — Register
44
+
45
+ ```bash
46
+ squadrant projects add <name> <path> \
47
+ --captain "⚓ <name>-captain" \
48
+ [--group <group-name>] \
49
+ [--group-role "<role description>"]
50
+ ```
51
+
52
+ Omit `--group` and `--group-role` entirely if this is a standalone project with no group.
53
+
54
+ ## Step 5 — Verify
55
+
56
+ ```bash
57
+ squadrant projects list
58
+ ```
59
+
60
+ Confirm the new entry appears with the correct path, group, and role.