.claude/skills/workflow/batch/SKILL.md
Parallel agent swarm — decomposes work into independent units, spawns isolated workers, tracks PRs via fan-in
npx skillsauth add andrem-sec/psc-comet batchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Orchestrates 5–30 parallel agents working on independent code changes in isolated git worktrees. Each agent makes targeted changes, runs tests, and opens a PR. The orchestrator tracks completion via a PR-sentinel protocol.
Without batch, parallelizable work runs sequentially. A task that 10 agents could complete in parallel takes 10x longer. Sequential execution also forces agents to share context, introducing noise from earlier subtasks into later ones.
Batch gives each unit a clean slate (isolated worktree) and a clear contract (self-contained prompt + PR sentinel).
Before spawning any worker, decompose the full task into units that satisfy all of the following:
If you cannot satisfy rule 1 or 2 for a unit, it is not parallelizable. Add it to a dependency chain instead.
Write a concrete, executable test recipe that every worker must run:
E2E Test Recipe:
Command: [exact command to run]
Expected: [expected output or exit code]
Scope: [what this verifies — e.g., "auth flow", "all unit tests", "API endpoint"]
The recipe must be runnable from the worktree root without setup beyond git clone.
Spawn all workers in one response — this is critical for true parallelism.
Each worker must receive:
isolation: "worktree"
run_in_background: true
subagent_type: "general-purpose"
And a fully self-contained prompt. The prompt must never say "based on the coordinator's findings" or reference the coordinator's conversation — the worker has no access to it.
You are implementing [unit name] as part of [mission name].
## Your Task
[Specific, concrete description of what to implement. Include file paths, function names,
line numbers. Do not say "implement the feature" — say exactly what to do.]
## Codebase Context
[Relevant facts the worker needs: architecture, key files, conventions.
Do not assume the worker has any prior context.]
## E2E Test Recipe
[Copy the e2e recipe exactly — worker must run it before creating the PR]
## Done Condition
[Binary condition: "unit tests pass AND e2e returns 200"]
## Reporting
When complete, your final line must be exactly one of:
PR: <url> (success — link to opened PR)
PR: none — <reason> (could not open PR — explain why)
The PR: <url> sentinel is the fan-in mechanism. No shared database, no callbacks — each worker ends its output with this line and the orchestrator parses it.
Parse rules:
PR: https://github.com/... → success, extract URL, mark unit donePR: none — <reason> → failure, log reason, consider continuing that workerRender and update as notifications arrive:
Batch Status — [mission name]
| Unit | Status | PR |
|------|--------|----|
| unit-1-auth | done | #142 |
| unit-2-logging | running | — |
| unit-3-tests | failed | none — test suite not found |
| unit-4-docs | done | #143 |
Progress: 2/4 complete, 1 failed, 1 running
If a worker reports failure:
SendMessage with corrected instructionsEvery worker prompt must include these steps before creating the PR:
Before creating the PR:
1. Run Skill: simplify (parallel code review — do not skip)
2. Run the unit test suite
3. Run the e2e test recipe
4. Commit all changes with: feat: [unit name] — [one line description]
5. Push branch and create PR with: gh pr create --title "[unit name]" --body "..."
6. End your response with: PR: <url>
Do not spawn workers before plan approval. The decomposition must be reviewed.
Do not write worker prompts that reference the coordinator or other workers. Each prompt must stand alone.
Do not wait for all workers to finish before updating the status table. Update as each notification arrives.
Do not spawn more than 30 workers. Beyond that, use multiple batch rounds.
Do not use batch for sequential tasks (where unit B depends on unit A completing). Use loop-operator instead.
testing
Audit animations and transitions for motion accessibility, performance safety, and design intent. Enforces prefers-reduced-motion compliance and blocks layout-triggering transitions.
testing
Test specifically for AI-introduced regressions that repeat without tests
development
Framework for decomposing agent-driven tasks into independently verifiable units
development
Framework for designing quality agents with proper action space and contracts