---
name: squad-ops
description: >
  Runs any task bigger than a quick answer or a one-line change with a squad of helper agents, each on the
  model and effort its job needs: a scout sizes the task, then a review, docs, build or feel squad does it,
  with a challenger trying to prove each finding or plan wrong. Use whenever the user reports a problem or
  something that seems wrong ("X is broken", "this didn't save", "why does…", "it feels janky"), or asks for
  a fix, a feature, a change, a review or audit, a docs check, or work on smoothness, frames or haptics.
  Not for a question already answered by what's known, or a one-line edit.
---

# Squad ops

You are the lead. A squad is a few helper agents you brief, launch and read. You don't do their work, and you keep your own context small, because every step you take re-reads all of it. Helpers write their reports to files; you read the summaries, and open a report only when the user asks about that part.

This file and `${CLAUDE_SKILL_DIR}/roles/` are the method, the same in every project. What belongs to the project (where its rules, known faults and open questions are, its commands, any device, where runs are kept) is in the project's squad-ops file, `.claude/squad-ops.md`. Read it once a session, before the first run. If it isn't there, set it up first (next section).

## First run in a project

No `.claude/squad-ops.md` yet: this is a Solo job, no helpers.

1. Copy `${CLAUDE_SKILL_DIR}/templates/project.md` to `.claude/squad-ops.md`.
2. Fill it in by reading the project: its `CLAUDE.md` or `AGENTS.md`, `README`, test and build setup, and any docs, backlog or decisions files. Point at files rather than copying them. Write `none` where the project has no such thing.
3. Add `.claude/squad-runs/` to the project's `.gitignore`.
4. Show the user the file in a few lines, then carry on with their task.

## Fixed rules

These are the skill's design. The learning step at the end never changes them; if a run suggests one should change, say so in your final message, and the user can edit it by hand.

- It starts by itself when a task fits the description above. The user never needs a command.
- Facts before fixes. A problem the user brings goes to Alpha first, and Charlie fixes only what Alpha confirmed.
- Don't stop for the user. Stop only when their hands or eyes are needed: a verdict on feel, or a device that's locked or not connected. A call that's theirs to make (product, design, a rule nothing settles): record it where the project file says, carry on with everything that doesn't depend on it, and list it at the end.
- Propose the squad and shape every time, from Recon's report, with a one-line reason.
- Every role has its own model and effort (below). A cheaper model does any job that's well specified.
- Device work has a budget and an end. Copy the user's data off first, count what fills the device, give every command a time limit, stop a step that fails twice the same way, and put the normal build back at the end. The project file holds the numbers. Nothing runs until someone stops it.
- Stop-proofing only when Recon expects the run to outlast a usage window.

## The flow

1. **Solo, or a squad?** A question you can answer from what you know, a lookup, a one-line change: do it yourself, and stop reading here.
2. **Recon.** Send the scout (`roles/recon.md`). Its short report gives the areas and files involved, the known faults and open questions that match, where the rules are, whether a device is needed, how much of a usage window it expects, and a suggested squad and shape.
3. **Propose,** in two or three lines: squad, shape, models, expected cost, device use, and why. Then go, in the same reply, whatever the size. If the task needs more helpers or stronger models, that's your judgement to make: don't wait for a word. The proposal is there so the user can redirect you if they want to.
4. **Set up.** Make the run's folder (the project file says where). Write each helper's task to `tasks/<role>-<n>.md` there before launching it, from the template below. A helper cut off by a limit is started again fresh from its file: an agent can't be resumed on another model.
5. **Launch** with the Agent tool, passing the role's model and effort. At most three at once. Not Workflow scripts: those need the user to ask for one each time, and a squad starts by itself.
6. **Read summaries,** never a whole report, diff or log. Send each next step as soon as its input is ready; don't wait for helpers it doesn't depend on.
7. **Finish.** Tell the user what was found or changed, numbered so they can say "fix 2 and 5", what's theirs to decide, and what wasn't checked. Then the debrief (the last section).

## The squads

| Squad | For | Steps |
|---|---|---|
| **Solo** | Quick tasks | You do it |
| **Alpha** (review) | Fact-finding before any fix: a problem the user brings, a worry, a review or audit | Investigate → challenge each serious finding → confirmed findings |
| **Bravo** (docs) | The docs against the code | Check and fix the docs → challenge a sample; faults in the code go to the known faults |
| **Charlie** (build) | Fixes and features | Plan → challenge the plan → build, failing test first → review the whole change → merge and test |
| **Delta** (frames) | How it feels: smoothness, dropped frames, response to touch, haptics | Measure → analyse → one change → the user's verdict on the device → the next change |

The challenge is the point of a squad. A helper asked to confirm something tends to confirm it, so the challenger is asked to prove it wrong, on a different model from whoever made the claim. A finding is a claim until a challenger or a failing test backs it: in the review this method came from, 14 of 39 findings that were checked turned out narrower than first reported.

## Shapes, by kind of task

Pick the row that fits; Recon suggests one. A shape is where you start; the runs log shows whether it was right.

| Kind of task | Squad | Starting shape |
|---|---|---|
| One problem the user saw | Alpha, then Charlie | 1 investigator, 1 challenger; then 1 builder, 1 change reviewer |
| A worry across the app ("frames drop everywhere") | Alpha | 1 investigator per area involved, up to 3; 1 challenger per area with serious findings |
| A whole review | Alpha | 1 investigator per area, in waves of 3; challengers for serious findings only |
| A feature, or a change in parts | Charlie | 1 planner, 1 challenger, 1 builder per part that shares no files, 1 change reviewer, 1 merger |
| Known faults with their fix written down (batch fix) | Charlie | 1 builder per fault, up to 3 at once; 1 change reviewer over all of them; 1 merger |
| Docs, one area | Bravo | 1 doc checker, 1 challenger on a sample |
| Docs, all of them | Bravo | 1 doc checker per group of docs, in waves of 3; 1 challenger on a sample |
| How it feels | Delta | 1 measurer, 1 analyst, 1 builder; one change per round |

A single confirmed fault whose fix is plain needs no planner: the finding is the plan, and the change reviewer checks the result.

## Roles

| Role | Brief | Model | Effort | Why |
|---|---|---|---|---|
| Recon | `roles/recon.md` | sonnet | low | Maps and counts. A wrong size costs more than haiku would save |
| Investigator | `roles/investigator.md` | opus | high | Finds subtle faults |
| Planner | `roles/planner.md` | opus | high | Designs the change |
| Challenger | `roles/challenger.md` | sonnet medium against an opus claim; opus medium against a sonnet one | | Not the claimant's model, so fewer shared blind spots |
| Builder, a change that needs judgement | `roles/builder.md` | opus | high | |
| Builder, a fault with its fix written down | `roles/builder.md` | sonnet | high | The instructions are exact |
| Change reviewer | `roles/change-reviewer.md` | sonnet high after an opus builder; opus medium after sonnet ones | | Not the builder's model |
| Merger | `roles/merger.md` | haiku | low | Mechanical. On a conflict it stops: send the merge to sonnet |
| Doc checker | `roles/doc-checker.md` | sonnet | high | Reads code against one rule at a time |
| Frames measurer | `roles/frames.md` | sonnet | medium | Runs set steps |
| Frames analyst | `roles/frames.md` | opus | high | Works out why from the numbers |

No other model unless the user asks: a model's weekly cap can run out in the middle of a run.

## A helper's task file

```
# <role> <n>: <the goal in one line>
Read first: ${CLAUDE_SKILL_DIR}/roles/_common.md, then ${CLAUDE_SKILL_DIR}/roles/<role>.md
Project file: <the project>/.claude/squad-ops.md
Model and effort: <…> (for a restart)
Goal: <what the user wants, in their words if short>
Scope: <files, areas, docs>. Not in scope: <…>
Input: <paths: Recon's report, the findings to challenge, the plan>
Done when: <…>
Limits: <at most n builds, test runs, device runs; when to stop and report>
Where: <worktree and branch> for a builder, or <folder> read-only
Report: <run folder>/<role>-<n>.md
```

Use absolute paths: helpers work in other folders. Name the files and the rule. A helper that has to search for them costs more than the line that would have named them.

## Spending well

Most of a run's cost is re-reading, not writing: every step an agent takes re-reads its whole context. In one 36-agent review, 97% of the tokens were re-reads. Each step of the lead's re-read about 375k; a helper's, 110k to 270k.

- Keep your own context small: summaries, not reports.
- Fewer, broader helpers, briefed exactly. Cheaper models for checks; a failing test is the cheapest check of all.
- At most three helpers at once: nine at once used a five-hour usage window in about an hour.
- Stop anything you've replaced (TaskStop). Work stopped by a limit starts again by itself when the limit lifts.
- Every helper has a "done when" and limits. A step that fails twice the same way stops and reports.

## When a run may outlast a window

Only when Recon expects it. Then, from the first step: `STATE.md` in the run folder (what's done, what's running, what's next), one commit per finished piece, and a recurring wake-up (CronCreate) that reads `STATE.md` and carries on.

## Debrief: how the skill learns

After every run except Solo:

1. **Log the run:** one line in the runs log (the project file says where):
   `date · task · squad and shape · helpers and models · cost (share of a window) · challenge: confirmed n, narrowed n, refuted n · shape: smaller / right / bigger needed · device: installs, test runs, recordings`
2. **Read the "Next time" lines.** Every helper's report ends with one: what would have made its job cheaper or better.
3. **Learn.** A lesson with plain evidence from this run, that would change how a later run is set up (a brief that lacked a file, a model more or less than its job needed, a shape too big), is written where it acts. One lesson, one commit, `squad-ops: <lesson> (run <date-task>)`:
   - about this project: in the project file, on the run's branch (or a branch of its own if the run changed no code);
   - about the method: in this file or `roles/`, but only if the project file's "Skill source" names a git clone of this skill that the user owns. Commit there; push only when the user says. With no skill source, write it under "Lessons for the method" in the project file instead, for the user to send upstream.

   A hunch goes in the log line only; act on it when another run shows it too.
4. **Keep it lean.** This file stays under 200 lines: a lesson that would take it over replaces or merges something. Nothing about one project goes in the method, so the skill stays usable in any project.
5. **Every fifth run,** read the whole log. Cut a shape nobody chose, a challenge that never changed a finding, a model that was more than its job needed. Each cut is a commit, as in step 3.
6. **Say what changed:** your final message lists each edit to the skill or the project file, in one line each.
