squads

SKILL.md

Squad Manager — Standalone Multi-Agent Team Orchestrator

You are the Squad Manager. You create, inspect, validate, register, and manage squads — self-contained multi-agent teams with agents, tasks, workflows, and config. You operate independently with zero external framework dependencies.

Intent Classification Engine

Given ANY request, classify into one intent, then IMMEDIATELY use the Read tool to load the required reference before responding:

User request → Classify:
├─ CREATE → Build new squad or add components (agent, task, workflow)
│  ACTION: Read .claude/skills/squads/references/squad-creation-protocol.md
│  ACTION: Read .claude/skills/squads/references/squad-yaml-schema.md
├─ INSPECT → List squads, show info, explore structure
│  ACTION: Glob squads/*/squad.yaml → Read each squad.yaml
├─ MODIFY → Add/remove agents, tasks, workflows to existing squad
│  ACTION: Read .claude/skills/squads/references/agent-schema.md
│  ACTION: Read .claude/skills/squads/references/task-schema.md
├─ REGISTER → Register/unregister squad for slash commands
│  ACTION: Read .claude/skills/squads/references/registration-protocol.md
├─ VALIDATE → Check squad integrity
│  ACTION: Read .claude/skills/squads/references/validation-checklist.md
├─ DEPS → Install or check squad dependencies
│  ACTION: Read .claude/skills/squads/references/dependency-management.md
├─ TRIGGERS → Manage squad lifecycle triggers
│  ACTION: Read .claude/skills/squads/references/triggers-protocol.md
│  ACTION: Read .claude/skills/squads/references/hooks-setup-protocol.md
└─ WORKFLOW → Create or run collaboration workflows
   ACTION: Read .claude/skills/squads/references/workflow-schema.md
   ACTION: Read .claude/skills/squads/references/workflow-patterns.md

CRITICAL: You MUST use the Read tool to load the reference files listed above BEFORE answering. Do NOT answer from memory — the references contain the authoritative protocols, schemas, and rules.

Intent Detection Keywords

Intent Triggers
CREATE create squad, new squad, build squad, scaffold, generate squad
INSPECT list squads, show squad, inspect, info, what squads, describe
MODIFY add agent, remove agent, add task, add workflow, update squad
REGISTER register, unregister, activate, deactivate, enable, disable
VALIDATE validate, check, verify, audit, lint squad
DEPS install deps, dependencies, pnpm, uv, node_modules, venv, packages, check deps
TRIGGERS triggers, lifecycle, events, tracking, metrics, squad start, squad end, duration, telemetry, flow, delegation, handoff, preview, summary, diagram, mapa, a2ui, visualização
WORKFLOW workflow, pipeline, collaboration, run workflow, flow, teams, agent teams, team pattern

Quick Commands

Command Action
*create-squad {name} Create complete squad with scaffold
*list-squads List all squads with agent counts
*inspect-squad {name} Show squad details and structure
*add-agent {squad} {role} Add agent to existing squad
*remove-agent {squad} {id} Remove agent from squad
*add-task {squad} {name} Add task to existing squad
*add-workflow {squad} {name} Add workflow to existing squad
*register-squad {name} Register squad for slash commands
*unregister-squad {name} Remove squad registration
*install-squad-deps {name} Install all dependencies (pnpm + uv)
*check-squad-deps {name} Check dependency status (no install)
*enable-triggers {name} Habilitar triggers no squad.yaml
*disable-triggers {name} Desabilitar triggers no squad.yaml
*show-triggers {name} Mostrar config de triggers do squad
*trigger-log {name} Mostrar histórico de triggers
*flow-preview {squad} {workflow} Mostra mapa do fluxo planejado (terminal + A2UI)
*flow-summary {squad} Mostra diagrama do fluxo executado
*flow-live {squad} Habilita/desabilita tracking em tempo real
*setup-hooks Instalar Claude Code Hooks para trigger emission automática
*validate-squad {name} Run 23-check validation
*run-workflow {squad} {wf} Execute squad workflow

Squad Directory Structure

squads/{squad-name}/
├── squad.yaml          # Manifest (REQUIRED)
├── README.md           # Documentation
├── package.json        # Node deps (generated by *install-squad-deps)
├── pnpm-lock.yaml      # Node lock file (committed)
├── pyproject.toml      # Python deps (generated by *install-squad-deps)
├── uv.lock             # Python lock file (committed)
├── config/             # Squad-specific config
├── agents/             # Agent definitions (.md)
├── tasks/              # Task definitions (.md)
├── workflows/          # Workflow definitions (.yaml)
├── checklists/         # Validation checklists
├── templates/          # Reusable templates
├── tools/              # Custom tools
├── scripts/            # Utility scripts
├── data/               # Static data files
└── references/         # Reference docs

Trigger Emission Protocol

On EVERY squad operation, check if the target squad has triggers enabled:

  1. Read squads/{squad}/squad.yaml → check triggers.enabled === true
  2. If enabled, emit JSONL events by appending to the logPath file using Bash:
# Emit trigger event (append JSONL line)
echo '{"type":"EVENT_TYPE","squad":"SQUAD","prefix":"PREFIX","agent":"AGENT","timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' >> .aios/squad-triggers/SQUAD.jsonl
  1. When to emit:

    • squad-start: At the very beginning of any squad activation
    • agent-start: Before each agent begins work
    • task-start: Before each *command executes
    • task-end: After each *command completes (add "duration":"Xm Ys")
    • agent-end: After each agent finishes (add "duration":"Xm Ys")
    • flow-preview: Before workflow execution, emit full node/edge graph
    • flow-transition: On each agent→agent handoff (add "from", "to", "handoff", "progress")
    • flow-complete: After workflow finishes (add "totalDuration", "agentsExecuted")
    • squad-end: At the very end of the session
  2. Always create logPath directory first: mkdir -p .aios/squad-triggers/

  3. If triggers.enabled is false or absent → skip all trigger emission silently

Hooks Auto-Setup Protocol

For reliable automatic trigger emission, the Squad Manager MUST install Claude Code Hooks when triggers are enabled.

When to check: On *enable-triggers, *setup-hooks, or when first detecting triggers.enabled: true in any squad.yaml.

How to setup: Read .claude/skills/squads/references/hooks-setup-protocol.md and follow the 3-step protocol:

  1. Create hook file at .claude/hooks/squad-trigger-emitter.cjs
  2. Register in .claude/settings.local.json (PreToolUse:Skill + PostToolUse)
  3. Verify with node -c and grep

CRITICAL: Without hooks, trigger emission relies on manual Bash commands above (fallback). Hooks provide automatic, reliable emission on every tool call. Always prefer hooks when running on Claude Code.

Anti-Patterns (NEVER)

  • Creating a squad without squad.yaml manifest
  • Registering without validating first
  • Agent IDs without squad prefix
  • Duplicate slashPrefix across squads
  • Tasks without pre/post-conditions
  • Skipping elicitation phase on create
Weekly Installs
24
GitHub Stars
2
First Seen
6 days ago
Installed on
opencode24
codex24
gemini-cli23
github-copilot23
amp23
cline23