parallel-build-integrator
Skill1 starsChanged 22 days agoMITView on GitHub
Turns a large GitHub backlog into merged, green PRs by running one owner agent per epic in parallel git worktrees and integrating their hand-backs on one branch. The integrator briefs each owner, cherry-picks the work, resolves docs-table conflicts row by row, gates every push (full lint output, types, drift, the full suite on a fresh database, a secret scan, a non-root check), shepherds the PR through CI and review bots, and closes each issue once its code is complete. Live checks that need outside accounts move to tracker issues, and live runs with real keys are capped and cleaned up. Use when the user says "build everything end to end", "run agents in parallel per epic", "don't ask me, review and merge the PRs yourself", "integrate the agents' work", "close the completed issues", "keep refreshing against main", or hands over a backlog of issues to finish autonomously.
- Reads credentials
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cloudflare-dnsSkill
- deep-researchSkill
- finish-lineSkill
- fly-to-aws-migrationSkill
- knowledge-captureSkill
- knowledge-maintenanceSkill
- knowledge-querySkill
- landing-page-craftSkill
- namecheap-dnsSkill
- terminal-posterSkill
- visual-regressionSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
If the work needs live API keys, the user puts them in $SCRATCH/app-keys.env (mode 600) or in environment secrets.
- Very specific: line 50
Start each owner in an isolated worktree, in the background, with the brief from references/owner-brief.md.
- Very specific: line 71
Overlapping fixes: when two owners fixed the same bug, keep one fix, not two.
- Very specific: line 84
If your machine runs as root and CI doesn't,: run permission-sensitive tests through scripts/as-user.sh.
- Distinctive: line 98
Check which of your SHAs actually reached main (git merge-base --is-ancestor).
- Very specific: line 103
Remove finished owners' worktrees.
- Very specific: line 107
Run live checks early. Fakes hide the bugs that matter: spend caps compared against the wrong field, response shapes, buffer limits, …
- Distinctive: line 111
Resources: every created resource recorded and deleted.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Parallel Build Integrator
One agent can't build a 100-issue backlog in a day, but six owner agents can, provided one integrator turns their work into green PRs. The hard part isn't writing code. It's integration: owners collide in shared docs, a single unread lint line turns main red, a test that passes as root fails in CI, a PR merges before its last push lands, and live checks find bugs that every fake missed. This skill is the integrator's loop, distilled from a session that took a 133-issue backlog to three open trackers in one day with fourteen epics closed.
You are the integrator. Owners write code in their own worktrees and hand back commit SHAs. Only you push, open PRs and close issues.
When to use
- A backlog of GitHub issues, grouped into epics, to build end to end
- The user wants parallel agents and autonomy ("review and merge them yourself")
- Several agents' work must land on one branch without breaking main
- Issues must close as code-complete, while outside-resource checks stay tracked
When NOT to use
- Driving one half-built product to launch-readiness with a frozen definition of done: use
finish-line - A single feature or bug: just do it
- Repos without CI or tests: the gate is the point; set them up first
Setup
- Copy
templates/config.shto.integrator/config.shin the project and fill in the project's real commands: lint, typecheck, drift checks, full test, fresh database, generated-file regeneration, and conflict-file globs. Every script here reads it. - Commit as the user, never as the agent. Ask once which name and email to use, then set
git config user.nameanduser.emailin the repo. Worktrees share the config. Use no AI co-author, agent-session or "Generated with" lines in commits or PR descriptions unless the user wants them.integrate.shre-authors every integrated commit (scripts/reauthor.sh), because cherry-picks keep the owner agent's author. Rewriting history later means a force-push to main. - Pick a scratch directory outside the repo for the integration worktree, logs and the keys file (
$SCRATCH). - If the work needs live API keys, the user puts them in
$SCRATCH/app-keys.env(mode 600) or in environment secrets. Never ask for them in chat. Loading them is covered inreferences/live-verification.md.
The loop
Step 1: Map the backlog to owners
- List the open issues and their epics.
- For each epic, read the issue bodies and the repo's status ledger (create one if missing, see
references/issue-hygiene.md). Separate buildable work from work blocked on outside resources. - Assign one owner per epic, or per cluster of issues that touch the same files. Two owners editing the same module is the most expensive conflict. When it can't be avoided, tell each owner about the other (Step 2).
- Cap concurrency at what the machine can test: about 4–6 owners on a 4-CPU box. Load average drives the timing flakes in Step 4.
Step 2: Brief each owner
Start each owner in an isolated worktree, in the background, with the brief from references/owner-brief.md. Every brief names:
- the exact base SHA to reset to, which is your integration branch, not main, when it carries unmerged work;
- its own database (the shared one bloats until timing tests fail);
- the decisions you've already made, so the owner doesn't re-litigate them;
- overlaps with other owners and which version wins;
- a spend cap, a deadline and a cleanup scope for any live resource;
- "done means": the full lint output read, types, the tests of touched packages, docs and status rows updated, and a secret scan of each staged diff;
- "commit, don't push; report SHAs".
Most bad hand-backs trace to a missing line in the brief.
Step 3: Integrate hand-backs
scripts/integrate.sh <integration-worktree> <side-name> <sha-or-range>...- Work in a side worktree of the integration branch, so a full test run in the main integration worktree keeps going.
- Conflicts:
scripts/merge_loop.shcontinues the cherry-pick. It resolves append-only indexes withunion.pyand status tables row by row withmerge_rows.py, and stops on anything else or on a row both sides changed. - Generated files (bundles, lockfiles, codegen, OpenAPI exports) are never hand-merged. Take either side and regenerate with the project's generator.
- Overlapping fixes: when two owners fixed the same bug, keep one fix, not two. Send the later owner back to rebase (
references/integration.md).
Step 4: Gate
scripts/gate.sh <worktree> # lint → typecheck → drift → pins → full suite on a fresh DB
scripts/keyscan.sh <base> # added lines only; exits 1 on anything secret-shapedRules that cost a red main when skipped are in references/gate.md:
- Read the whole lint log, not its last line.
- Run the full suite on a fresh database.
- If your machine runs as root and CI doesn't, run permission-sensitive tests through
scripts/as-user.sh. - A failure is "known flaky" only after it passes alone. Even then, find the timing cause: fixed sleeps, animations, load.
- Check every scan match by hand. A placeholder like
sk-ant-...in fixture data is fine; anything real stops the push.
Step 5: Push, PR, shepherd
- Push: push the integration branch as a fast-forward. Never force-push without the user's explicit permission.
- Open the PR with the body template from
references/pr-lifecycle.md. It lists what landed, the checks,Closes #…for the code-complete issues, and what's left for outside resources. - Subscribe to PR activity and keep one safety-net check-in.
- Review-bot findings are claims. Reproduce each real one, fix it with a test, and push. Decline the rest in a single PR comment and resolve their threads.
- Before any push to an open PR, check it hasn't merged. Owners of fast-moving repos merge before CI finishes. Commits pushed after a merge need a follow-up PR, and
Closeslines edited after a merge close nothing.
Step 6: After merge
- Check which of your SHAs actually reached main (
git merge-base --is-ancestor). - Comment on the closed issues: what landed, and where each remaining live item is tracked.
- Close an epic once all its sub-issues are closed.
- Watch main's CI on the merge commit. A PR merged before its own CI finished gets its first full run here.
- Reset the integration branch to
origin/mainby fast-forward, and fast-forward the main checkout. - Remove finished owners' worktrees. Kill leaked temp directories at the source (
references/gate.md).
Step 7: Live verification (when keys exist)
Run live checks early. Fakes hide the bugs that matter: spend caps compared against the wrong field, response shapes, buffer limits, missing identities. Follow references/live-verification.md:
- Keys: loaded from a mode-600 file and never echoed.
- Spend: capped per owner.
- Resources: every created resource recorded and deleted.
- Results: recorded in a dated doc with a spend table.
- Fakes: corrected to the live shapes.
Account-wide or billing changes need the user's explicit yes, in their words. If the runtime's safety check refuses an action, ask the user. Never route it through a sub-agent.
Rules
- Only the integrator pushes, opens PRs and closes issues. Owners commit in their worktrees.
- Every pushed commit is authored and committed as the user, with no agent trailers. Before each push, check
git log --format='%an <%ae> | %cn <%ce>' <base>..HEAD. - Close an issue when its code is complete. Its live checks move to a tracker issue grouped by resource (test org, datasets, third-party accounts). The backlog stays honest, and nothing is closed with buildable work left.
- Never skip, disable or quarantine a test to get green. Never push an empty commit to re-run CI.
- Secrets live in a mode-600 file or environment secrets, never in chat, commits, logs or command lines.
/proc/<pid>/cmdlineis world-readable; pass env through the environment. - Record deadlines in a file, not in memory. Key expiry, trial ends and rate-limit windows go in the plan, with a scheduled checkpoint.
Known gotchas
| Symptom | Cause | Fix | |||||||
| The user objects to the agent's name on hundreds of commits | Commits used the runtime's default identity and co-author trailers | Set the user's identity at the start; integrate.sh re-authors hand-backs. Fixing it afterwards needs a history rewrite and a force-push | |||||||
| Lint "passed" locally, CI red | Only the last line of output was read | gate.sh keeps the full log; read it all | |||||||
Tests pass here, EACCES in CI | The container runs as root | scripts/as-user.sh for permission-sensitive tests | |||||||
| DB-backed tests time out after a few hours | Every owner wrote to one shared dev DB | A fresh DB per full run (FRESH_DB_CMD) and one DB per owner | |||||||
| ` | ` lines committed | A union resolver didn't understand diff3 markers | union.py handles diff3; merge_loop.sh refuses to continue with markers left | ||||||
| Duplicate rows in the status table | One branch moved a row, the other edited it | merge_rows.py exits 1 on duplicate keys; resolve by hand | |||||||
| Typecheck fails right after integration | Generated types (env, codegen) are stale | Regenerate (REGEN_CMD), the same as CI's install step | |||||||
| Late commits missing from main | The PR merged before the last push | Check merge state before pushing; open a follow-up PR | |||||||
Closes #N didn't close | The PR body was edited after the merge | Close by hand with a comment, or use a follow-up PR | |||||||
| A UI target measures 43 px, not 44 | The audit ran mid-animation under load | Wait for finite animations before measuring | |||||||
ENOBUFS reading a large file | A default 1 MiB exec buffer | Size the buffer to the file; refuse over the API limit | |||||||
| Dozens of DB tests fail with a client validation error after integrating | A hand-back added a migration or an env var, and the generated client or env types are stale | Run REGEN_CMD before every full run; gate.sh does | |||||||
| A Docker sandbox test passes here but fails in CI | docker cp kept the non-root runner's uid, and git in the container refused the checkout | Chown the workspace as root to the image user's uid (references/gate.md) | |||||||
| A PR description ends with an AI footer the user didn't want | The GitHub tool appended it at creation | Read the description back and update it without the footer | |||||||
| Review comments on merged PRs went unanswered | Bot findings were treated as noise | Run the review-comment sweep (references/pr-lifecycle.md) | |||||||
| A spend cap never trips | The vendor's "dollars" field was a fee, not usage | Price the tokens yourself; verify the cap live | |||||||
| The disk fills mid-day | Finished worktrees and leaked test temp dirs | Remove finished worktrees; point the test runner's TMPDIR at one per-run directory | |||||||
| A force-push or billing change was refused | The runtime's safety check | Use fast-forward or a follow-up PR; ask the user for billing changes |
References
| File | Load when |
references/owner-brief.md | Writing an owner's brief (Step 2) |
references/integration.md | Cherry-picking, conflicts, overlapping fixes (Step 3) |
references/gate.md | Before every push (Step 4) |
references/pr-lifecycle.md | Opening, shepherding and closing out a PR (Steps 5–6) |
references/issue-hygiene.md | The status ledger, trackers, closing issues and epics |
references/live-verification.md | Any run with real keys or paid resources (Step 7) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

