Index of every page on this site: llms.txt
All skills
oaustegard avatar

/swarming-to-green

@b9eb735
Run it yourself

Runs a long swarm of hundreds to thousands of cheap headless coding workers that drive a large failing-test backlog to green. Failures are clustered by signature, each worker fixes one cluster in its own git worktree, a serial no-regression merge gate lands the fixes, the loop resumes across restarts for hours, and it federates across sibling sessions over git branches when one container's CPU is not enough. Use for "fix these thousands of failing tests with a Haiku swarm", "drive the test suite to green with hundreds of agents", "build this compiler or interpreter against a conformance suite", "launch, relaunch or check in on the swarm loop", "the swarm is stuck, idle or rejecting everything", "parallel agents fixing tests keep hitting merge conflicts and regressions", "add sibling containers to the swarm", or "compare models on the tail the swarm could not fix". Ships the harness, a per-project TOML config, a fake-worker selftest, check-in signals and the 2026-10-12 haiku-cc failure catalogue.

Use this Skill: https://skilld.dev/gh/oaustegard/claude-skills/swarming-to-green

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

assetssibling-brief.md

≈994 tokens on demand. Your agent reads this file only when SKILL.md points to it.

You are sibling {NAME} of a federated swarm. The hub Claude Code session started you for {OWNER}'s {PROJECT} work ({ONE LINE: what the project is}). Thousands of headless {WORKER MODEL} workers fix its failing tests, and each fix passes a merge gate before it lands. The hub's container is CPU-bound, so {K} sibling sessions each work one partition of the test suites. You run workers and gate their fixes locally, then send accepted commits back. The hub owns main and re-checks every commit before merging it.

Provenance: started by hub session {HUB_SESSION_ID} on {DATE}. The harness is the swarming-to-green skill; its SKILL.md is the runbook.

This checkout is {TRANSPORT_REPO} at branch {PREFIX}main, which is the hub's main. Branches are the transport, and the loop pushes and fetches them for you. Never push anything by hand, never force-push, never delete a branch, and never edit {CODE_DIRS}, {FORBIDDEN_DIRS} or the harness yourself. Workers change {CODE_DIRS}; the gate does the merging.

Your partition: {ONLY_DESC}. Work only this partition: never pass a wider --only, and do not chase root causes in other suites (the hub or another sibling owns them).

  1. Bootstrap. It is idempotent, so rerun it after any container restart:

    cd "$(git rev-parse --show-toplevel)"
    SK=/mnt/skills/user/swarming-to-green/scripts
    [ -f $SK/swarm.py ] || { git clone -q --depth 1 https://github.com/oaustegard/claude-skills ~/claude-skills; SK=~/claude-skills/swarming-to-green/scripts; }
    bash $SK/sibling_setup.sh {NAME}

    Read its last two lines: claude and fanout must be present, and note the SWARM= path. A WARN from the project setup is not fatal unless a suite in your partition needs that tool.

  2. Launch the loop as ONE Bash call with run_in_background: true and timeout: 7200000. Run the job itself, not a waiter, not nohup:

    cd "$(git rev-parse --show-toplevel)" && python3 $SWARM run --sibling {NAME} --only '{ONLY}' --suites {SUITES} \
      --concurrency {C} --max-usd {USD} --model {MODEL} --batch 6 --sample 80 --max-minutes 110 --idle-max 86400 \
      >> runs/sib-{NAME}.log 2>&1

    {SUITES} is your partition's suites plus every cheap suite (the gate samples those as regression guards). In the same turn, check ps aux | grep '[s]warm.py run'. The loop seeds its state from {PREFIX}state, re-baselines your suites in the background (10-60 min the first time), dispatches workers, merges locally, pushes each merge to {PREFIX}cand/{NAME}, and rebases onto {PREFIX}main every 15 minutes.

  3. The loop exits by itself after 110 minutes (--max-minutes), before the 2-hour background cap kills it. It is resumable: the state dir keeps the ledger, and live workers are adopted by pid. Relaunch with exactly the same command at each check-in when it is not running.

  4. Check in every ~50 minutes with send_later (delay_minutes 50, initiation own_followup). Each check-in re-arms the next. At each one:

    • tail -40 runs/sib-{NAME}.log, python3 $SWARM status, python3 $SWARM fed-status;
    • read the SIGNALS block of status and act on it as the skill's runbook says;
    • relaunch the loop if it is not running. Never loop on sleep.
  5. Stop and report, without relaunching, when:

    • status shows PARTITION EXHAUSTED for two check-ins running (your partition is done: the hub will stand you down);
    • SAME FAILURE or DENIALS appears (auth, "no result", permission denials);
    • GATE REJECTS ALL appears;
    • fed push ... failed lines repeat in the log;
    • spend reaches --max-usd;
    • an auto-mode classifier denies an action: stop, report the action and the classifier's reason, and do not route around it.
  6. When you report: merged, rejected and failed counts, spend, your suites' pass counts ("known now"), the last pushed {PREFIX}cand/{NAME} sha. Do not push your ledger or anything else: the hub collects it at stand-down, after {OWNER} approves the push in this session.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warnings5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    This skill provides a specialized harness for running large-scale 'swarms' of AI agents to fix software bugs. It automates git worktree management, test execution, clustering of failures, and the merging of verified fixes. It also supports federated execution across multiple containers using Git for state synchronization.

  • Socket5d

    1 alert: gptAnomaly

  • Snyk5d

    Risk: MEDIUM · 2 issues

Signed by skilld at b9eb735. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
metadata
{
  "version": "0.7.1"
}

README badge

README badge for oaustegard/claude-skills/swarming-to-green