Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .changeset/fix-squad-slash-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
"@bradygaster/squad-sdk": minor
"@bradygaster/squad-cli": minor
---

Make `/squad` a real slash command — rename `squad-commands` skill to `squad` with `user-invocable: true`

## What this enables

Users can type `/squad` in any Copilot CLI session in a squad-initialized project and get the categorized command catalog (Install & Upgrade, Team Management, Issues & PRs, Plugins & Skills, Model & Cost, Sessions & State). This is what users naturally expect — Squad ships an in-chat command surface, and the slash key is the muscle memory.

## Verified mechanism (Copilot CLI 1.0.62-2)

Decompiling `~/.copilot/pkg/win32-x64/1.0.62-2/sdk/index.js` line 2618:

```js
getLoadedSkills().filter(e => e.userInvocable)
.map(e => ({name: `/${eF(e)}`, isSkill: true, skill: e}))
```

Any skill with frontmatter `user-invocable: true` is auto-registered by Copilot CLI as a slash command at `/<skill-name>`. The built-in `customize-cloud-agent` skill shipped with Copilot CLI uses this exact pattern with `user-invocable: false`; setting it to `true` makes the skill appear in `/skills` AND as a slash keystroke.

The previous skill `squad-commands` had no `user-invocable` field (Copilot CLI defaults to false), so `/squad-commands` did not exist. Users either typed natural language ("squad commands", "what can squad do") or never discovered the menu.

## Changes

1. **Renamed** the `squad-commands` skill to `squad` (canonical source in `.squad/skills/squad/`).
2. **Frontmatter rewritten** to match Copilot CLI's actual schema (verified against decompiled source):
- `name: squad` (was `squad-commands` — `/squad` is shorter, intuitive, and matches the agent name without colliding because slash commands and skill lookups are separate namespaces)
- `user-invocable: true` ← **the load-bearing change**
- `description:` rewritten to be self-explanatory so natural-language match also still works
- `allowedTools: []` (matches Copilot CLI's schema)
- Removed unused fields: `domain:`, `confidence:`, `source:`, `triggers:` (all silently ignored by Copilot CLI)
3. **Body text** updated to reference `/squad` as the primary invocation path.
4. **`MANIFEST_SKILL_NAMES`** in `packages/squad-sdk/src/config/init.ts`: `'squad-commands'` → `'squad'`.
5. **`TEMPLATE_MANIFEST`** in `packages/squad-cli/src/cli/core/templates.ts`: updated `source` + `destination` + `description` to reflect the rename.
6. **Removed** stale `packages/{squad-cli,squad-sdk}/templates/skills/squad-commands/` directories.

## Test coverage

New `test/init.test.ts > should install the squad slash-command skill with user-invocable: true`:
- Asserts `.copilot/skills/squad/SKILL.md` exists after `initSquad()`
- Asserts frontmatter contains `user-invocable: true` (load-bearing — without this, no slash command)
- Asserts frontmatter `name: squad` (load-bearing — slash command is `/<name>`)
- Asserts the menu presentation rules are still in the body

26/26 init tests pass; `npm run lint` clean.

## How users will experience this

After `squad init` + opening Copilot CLI in the project:

```
> /squad
📋 Squad Commands — pick a category:
1. Install & Upgrade
2. Team Management
3. Issues & PRs
4. Plugins & Skills
5. Model & Cost
6. Sessions & State
```

## Composability with other open PRs

- **Disjoint from #1292** (skills bundling, 4 new entries). Both modify `MANIFEST_SKILL_NAMES` but `squad-commands → squad` is a rename, not an add. Merge order doesn't matter — the renamer wins.
- **Disjoint from #1302** (`squad-help` disambiguation skill). `squad-help` covers the `skill(Squad)` misdirect case; this PR covers the `/squad` slash command UX. They're complementary.

## Out of scope (future, mentioned in user request)

The user wants to eventually install the `squad` skill **machine-wide** (e.g., `~/.copilot/skills/squad/`) so `/squad init` works in any folder even before `squad` is initialized in that project. That's a separate piece of work because:
1. It requires a `squad install --global-skill` command or similar (none exists today)
2. The `/squad` menu currently calls into `squad` CLI subcommands that assume `.squad/` exists in cwd — the menu would need a "Init Mode" branch for the "no `.squad/` yet" case
3. Copilot CLI's `~/.copilot/skills/` is a personal scope, so it'd need to be opt-in per-user

Will file a follow-up issue tracking that work after this lands.
2 changes: 1 addition & 1 deletion .github/agents/squad.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ The routing table determines **WHO** handles work. After routing, use Response M
| PRD intake ("here's the PRD", "read the PRD at X", pastes spec) | Follow PRD Mode (see that section) |
| Human member management ("add {name} as PM", routes to human) | Follow Human Team Members (see that section) |
| Ralph commands ("Ralph, go", "keep working", "Ralph, status", "Ralph, idle") | Follow Ralph — Work Monitor (see that section) |
| "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.copilot/skills/squad-commands/SKILL.md`, present categorized menu (see squad-commands skill) |
| "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.copilot/skills/squad/SKILL.md`, present categorized menu (see squad skill). Users can also invoke this directly via `/squad`. |
| "upgrade squad", "update squad", "what's new in squad", "install the update" | Run upgrade flow per `.squad/templates/session-init-reference.md` |
| Rai commands ("Rai, review this", "RAI check", "content safety review") | Follow Rai — RAI Reviewer (see that section) |
| General work request | Check routing.md, spawn best match + any anticipatory agents |
Expand Down
2 changes: 1 addition & 1 deletion .squad-templates/squad.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ The routing table determines **WHO** handles work. After routing, use Response M
| PRD intake ("here's the PRD", "read the PRD at X", pastes spec) | Follow PRD Mode (see that section) |
| Human member management ("add {name} as PM", routes to human) | Follow Human Team Members (see that section) |
| Ralph commands ("Ralph, go", "keep working", "Ralph, status", "Ralph, idle") | Follow Ralph — Work Monitor (see that section) |
| "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.copilot/skills/squad-commands/SKILL.md`, present categorized menu (see squad-commands skill) |
| "squad commands", "what can squad do", "show me squad options", "slash commands", "what commands are available" | Read `.copilot/skills/squad/SKILL.md`, present categorized menu (see squad skill). Users can also invoke this directly via `/squad`. |
| "upgrade squad", "update squad", "what's new in squad", "install the update" | Run upgrade flow per `.squad/templates/session-init-reference.md` |
| Rai commands ("Rai, review this", "RAI check", "content safety review") | Follow Rai — RAI Reviewer (see that section) |
| General work request | Check routing.md, spawn best match + any anticipatory agents |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
---
name: squad-commands
description: >
Categorized catalog of common Squad operations. Coordinator reads this
file and presents it as an interactive menu when the user asks for
available commands or help.
domain: squad-operations
confidence: high
source: first-party
triggers: ["squad commands", "what can squad do", "show me squad options", "slash commands"]
name: squad
description: >-
Squad's command catalog and interactive menu. Invoke via /squad (slash command) or natural language ("squad commands", "what can squad do", "show me squad options"). Presents categorized operations (Install & Upgrade, Team Management, Issues & PRs, Plugins & Skills, Model & Cost, Sessions & State) as an interactive picker. Routes to the right squad CLI command or the Squad coordinator agent.
user-invocable: true
allowedTools: []
---

## Menu Presentation Rules

When the user triggers this skill ("squad commands", "help", "what can squad do", etc.):
When the user triggers this skill (via `/squad` slash command, "squad commands", "help", "what can squad do", etc.):

1. **Category-level menu first.** Present category names as an `ask_user` choice list:
```
Expand Down
6 changes: 3 additions & 3 deletions packages/squad-cli/src/cli/core/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ export const TEMPLATE_MANIFEST: TemplateFile[] = [
description: 'Multi-agent collaboration and handoff patterns',
},
{
source: 'skills/squad-commands/SKILL.md',
destination: '../.copilot/skills/squad-commands/SKILL.md',
source: 'skills/squad/SKILL.md',
destination: '../.copilot/skills/squad/SKILL.md',
overwriteOnUpgrade: true,
description: 'In-chat command discovery — categorized menu of Squad operations',
description: 'Squad command catalog — invokable via /squad slash command',
},
{
source: 'skills/squad-version-check/SKILL.md',
Expand Down
Loading
Loading