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
5 changes: 2 additions & 3 deletions .claude/agents/squad-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ The orchestrator tells you which **mode** to run:
Lead instead of into the code.
2. Stage every new file you created with `git add <file>` before you hand back, in every launch (skeleton,
implementation, documentation or fix round): staging is yours, not the orchestrator's, since the *Coverage
gate* only counts files Git tracks; where the permission check denies `git add`, the report lists the new files
as untracked and the orchestrator stages them with the step's commit. A file the plan deletes is removed and
staged as *Git and GitHub* in `.squad/team.md` says. Run *Build*, *Test with coverage* and the *Coverage gate*
gate* only counts files Git tracks. A file the plan deletes is removed and staged, and a denied `git add` is
reported, as *Git and GitHub* in `.squad/team.md` says. Run *Build*, *Test with coverage* and the *Coverage gate*
from `stack.md`, and, when the change touches an input the container image's build is sensitive to, the *Image
build check* (*Criteria verified only in CI* in `.squad/routing.md`); report their results. Uncovered changed
lines go to the Tester, or you make them testable (hard-to-test code is a design signal β€” seams, injected
Expand Down
10 changes: 7 additions & 3 deletions .claude/agents/squad-lead.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ The orchestrator tells you which **mode** to run:
or contradicts an accepted decision record is `RESULT: NO CHANGE` with the reason and a proposed issue comment.
- `plan` β€” pick the tier on the change (`.squad/routing.md`, *Tiers*). For tiers `docs` and `patch` write
**no** `plan.md`: your result holds what their rows of *Tiers* name. A change that needs a decision record is
`trivial` or higher.
`trivial` or higher. The steps a tier skips are the ones its row of *Tiers* names, whatever code changes: a
`trivial` plan states no tests-first step (the Tester writes its tests in mode `coverage`) unless a `tasks.md` group
puts the Tester first.
Otherwise write `plan.md` from `specs/_template/plan.md` (features: `tasks.md` too, against the challenged
`spec.md`). For a feature you also close the spec: answer each entry of
its *Challenge notes* in a *Challenge* section of the spec (its template's comment) and fold the notes into it,
Expand Down Expand Up @@ -79,7 +81,8 @@ The orchestrator tells you which **mode** to run:
checked against the rules the *Analyzer gate* enforces on them (names, parameter count and names, nested types:
`.squad/stack.md`, *Writing code*, and the analyzer configuration), so step 4 renames and splits nothing; logic
two types need identically is planned as one shared helper from the start (the quality gate's duplication
condition on new code is reported by no local analyzer);
condition on new code is reported by no local analyzer), and a new block the plan puts into three or more files
(state handling, a guard, a setup) gets its shared home named in *Approach*, not one copy per file;
- the **test files** and the existing test call sites a changed signature affects, with who adapts them (the
template's *Test files*); a test kept unchanged has no input a new criterion handles differently, else it is
adapted, with owner;
Expand Down Expand Up @@ -179,7 +182,8 @@ Output format, always ending with exactly one of these lines:
- `RESULT: DONE` (spec/plan/revise), `RESULT: NO CHANGE β€” <reason and proposed issue comment>` (spec, plan, or revise after a challenge),
`RESULT: DECIDED β€” <option>` (decide; on review findings `FIX: <Dev|Tester|orchestrator|Code Officer> β€” <change>` per `;`-separated item and `ISSUE:
<each linked issue>` after the dash, `FIX:` in capitals whenever you order a change: `squad-next.py` sends the fix
round on that word, so a declined fix never writes it),
round on that word, so a declined fix never writes it; on a failed manual test whose result stands,
`NO MANUAL RERUN: <why>` as *Loop limits* says),
`RESULT: APPROVED` / `RESULT: NOT APPROVED β€” <reasons>` (approve-pr), or
- `RESULT: ESCALATE β€” <one question for the Product Manager, the options, your recommendation>`
(*Escalation to the Product Manager*).
Expand Down
2 changes: 2 additions & 0 deletions .claude/agents/squad-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ repository names this thing, and is that statement still true?**
pass? Check the rules listed there as easy to get wrong by hand.
- **Code style**: the conventions in *Writing code* (`stack.md`) and the
code style section of `AGENTS.md`.
- **Duplication**: the same block of five or more lines added in several files is blocking unless it has one shared
home; SonarQube's duplication condition on new code fails the pull request, and no local gate measures it.
- **Error handling**: are failures from external systems (network, file system, parsers, child processes) handled
rather than allowed to kill a long-running loop or silently produce wrong data? A fabricated or defaulted value
stored or shown as if it were real is a finding.
Expand Down
10 changes: 8 additions & 2 deletions .claude/agents/squad-tester.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ Mode `coverage` (after the Dev's implementation):
uncovered, (b) for a resource bound the plan names (memory, size, time ratio), or (c) for a test a reviewer
asked for (for example after a surviving mutation). For a test asked for against a named mutation, apply that
mutation once in a scratch `git worktree` (`.squad/team.md`, *Git and GitHub*), confirm the new test fails there
and passes without it, report both runs, and remove the worktree. Guards, pins of existing behavior and
and passes without it, report both runs, and remove the worktree. In a run whose tests-first step was skipped
(tiers `trivial` and `tests`), a new test of changed behavior is checked the same way against the base ref: it
fails there and passes on the head (`git stash` is denied). Guards, pins of existing behavior and
determinism tests beyond that are not written: every test is kept green in every later round. A test that only
executes lines without asserting behavior does not count. Report lines you believe no unit test can cover, with
the reason, for the Lead; a whole file (a script without a test runner, a generated file) belongs in the plan's
Expand All @@ -82,10 +84,14 @@ Rules:
- Follow `docs/UNIT_TESTS.md` and *Writing tests* in `stack.md` (framework, test doubles, naming, one
assertion message per assertion where the framework supports it). Write tests the analyzers accept from
the start (the Code Officer hands test-design findings back to you) and run the *Analyzer gate* and *Format*
(`.squad/team.md`) before handing over.
(`.squad/team.md`) before handing over. A finding the *Analyzer gate* reports in a test file you wrote is yours to
fix in mode `coverage`, without a structural change, and you run the gate on it again; findings in any other file
stay the Code Officer's.
- A test asserts what the plan requires: where the plan fixes a format or an error text, compare the exact
text instead of forbidding substrings, and make sure the test's own names and paths can neither satisfy
nor defeat the check (the stack's *Writing tests* section names the pitfalls).
- Write control and bidirectional characters in test data as escapes (`\u202E`), never as the raw character:
`scope-check.py` fails on a raw one.
- **Runtime budget:** no single test takes more than 10 s under the *Test* command of `stack.md`, and a
package stays well under half of the CI timeout; size stress tests with the smallest input that still
detects the failure, and measure before handing over.
Expand Down
2 changes: 2 additions & 0 deletions .claude/hooks/git-guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
GIT_INSTEAD = {
"git rm": "To delete a file the change removes, run `rm <path>`, then `git add <path>`, and name it in your report.",
"git mv": "To move a file, run `mv <old> <new>`, then `git add <old> <new>`, and name both in your report.",
"git stash": "To run a test against the base or another revision, run it in a scratch worktree "
"(`git worktree add --detach <dir> <ref>`) and remove the worktree afterwards.",
}
MEMBER_PREFIX = "squad-"

Expand Down
3 changes: 2 additions & 1 deletion .claude/skills/squad-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ create the follow-up issues the Lead decides on.
body, the plan or a decision record says the change breaks existing users); a PR the session already has for the
branch (`list_pull_requests` with `head: "<owner>:<branch>"`) gets its title, body and that label updated instead
(`update_pull_request`, `draft: true`). The body describes the bug, the fix and the reproducing test (or that the
fix is not verifiable without a real external system), `Closes #<number>` under Issues and the decision records,
fix is not verifiable without a real external system), `Closes #<number>` under Issues and the decision records (with every `Wording-only edit:` line
of a commit, `docs/decisions/README.md`),
the matrix as *Test Plan*; Next Steps lists **only linked GitHub issues** (create them now, the verification
issues included) or "None".
11. **After the PR.** Subscribe to the PR's activity at once (`subscribe_pr_activity`; without it, check CI and the
Expand Down
8 changes: 6 additions & 2 deletions .squad/orchestration.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ No lesson: a SonarQube rule the local analyzers do not report (the Code Officer
same change), a stop hook's demand for a commit (*The stop hook*), and a size or form warning of `.squad/project.md`
or of *Test doubles* in `docs/UNIT_TESTS.md` (fixed in the run: `routing.md`, *Scope of a product PR*).

One run's lessons go into at most one issue per label; the labels are created when missing. Before "no lessons",
One run's lessons go into at most one issue per label; the labels are created when missing. When creating an issue
with its labels fails, create it without them and add the labels in a second call. Before "no lessons",
the orchestrator checks its log for these **candidates**; each is a lesson unless it says nothing about the squad's
rules, agents or tools (a Lead `decide` that settled a product question):

Expand All @@ -85,6 +86,8 @@ lessons`; `squad-log.py --summary` exits 5 without it and lists the candidates t
Every member is launched with the model and effort of its agent file, except: every `squad-tester` launch of a run
whose `plan.md` names tier `security` gets `model: opus` (effort unchanged), passed explicitly from the first launch
on. `squad-next.py` prints the model of every launch, and `squad-log.py` warns when a launch ran on another one.
At intake `squad-next.py` warns when the orchestrating session itself runs on a model priced above Sonnet: switch the
model before the first launch, or state in `log.md` why the run continues on it.

## Continuing a member

Expand All @@ -94,7 +97,8 @@ agent id, or the Agent tool's resume) with the findings and the new head SHA; so
the first launch of any other mode and a launch after a session restart (the agent id is gone) or after one that
ended on an API error; so is, with a short hand-over (the plan or task group, what the earlier rounds settled, the
open findings and the head SHA), the next launch of an agent continued five times or from 250,000 reported tokens
on, run on another model than *Launch model* names, or already continued in another mode. `squad-next.py` names for
on, run on another model than *Launch model* names, or already continued in another mode; pass on the
`Hand-over text:` that `squad-next.py` prints for it rather than continue past the cap. `squad-next.py` names for
every launch the agent it continues, or why it is fresh; keep the agent id of every fresh launch, since that agent is
not always the member's last one. What a continued member may do: `team.md` (*Shared rules*).

Expand Down
Loading