agentleFS
ravidsrkravidsrk/agent-skills/skills/parallel-build-integrator/SKILL.md

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

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
  1. Very specific:

    If the work needs live API keys, the user puts them in $SCRATCH/app-keys.env (mode 600) or in environment secrets.

    line 37
  2. Very specific:

    Start each owner in an isolated worktree, in the background, with the brief from references/owner-brief.md.

    line 50
  3. Very specific:

    Overlapping fixes: when two owners fixed the same bug, keep one fix, not two.

    line 71
  4. Very specific:

    If your machine runs as root and CI doesn't,: run permission-sensitive tests through scripts/as-user.sh.

    line 84
  5. Distinctive:

    Check which of your SHAs actually reached main (git merge-base --is-ancestor).

    line 98
  6. Very specific:

    Remove finished owners' worktrees.

    line 103
  7. Very specific:

    Run live checks early. Fakes hide the bugs that matter: spend caps compared against the wrong field, response shapes, buffer limits, …

    line 107
  8. Distinctive:

    Resources: every created resource recorded and deleted.

    line 111

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Copy templates/config.sh to .integrator/config.sh in 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.
  2. Commit as the user, never as the agent. Ask once which name and email to use, then set git config user.name and user.email in 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.sh re-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.
  3. Pick a scratch directory outside the repo for the integration worktree, logs and the keys file ($SCRATCH).
  4. 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 in references/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.sh continues the cherry-pick. It resolves append-only indexes with union.py and status tables row by row with merge_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-shaped

Rules 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 Closes lines edited after a merge close nothing.

Step 6: After merge

  1. Check which of your SHAs actually reached main (git merge-base --is-ancestor).
  2. Comment on the closed issues: what landed, and where each remaining live item is tracked.
  3. Close an epic once all its sub-issues are closed.
  4. Watch main's CI on the merge commit. A PR merged before its own CI finished gets its first full run here.
  5. Reset the integration branch to origin/main by fast-forward, and fast-forward the main checkout.
  6. 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>/cmdline is 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

SymptomCauseFix
The user objects to the agent's name on hundreds of commitsCommits used the runtime's default identity and co-author trailersSet 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 redOnly the last line of output was readgate.sh keeps the full log; read it all
Tests pass here, EACCES in CIThe container runs as rootscripts/as-user.sh for permission-sensitive tests
DB-backed tests time out after a few hoursEvery owner wrote to one shared dev DBA fresh DB per full run (FRESH_DB_CMD) and one DB per owner
`` lines committedA union resolver didn't understand diff3 markersunion.py handles diff3; merge_loop.sh refuses to continue with markers left
Duplicate rows in the status tableOne branch moved a row, the other edited itmerge_rows.py exits 1 on duplicate keys; resolve by hand
Typecheck fails right after integrationGenerated types (env, codegen) are staleRegenerate (REGEN_CMD), the same as CI's install step
Late commits missing from mainThe PR merged before the last pushCheck merge state before pushing; open a follow-up PR
Closes #N didn't closeThe PR body was edited after the mergeClose by hand with a comment, or use a follow-up PR
A UI target measures 43 px, not 44The audit ran mid-animation under loadWait for finite animations before measuring
ENOBUFS reading a large fileA default 1 MiB exec bufferSize the buffer to the file; refuse over the API limit
Dozens of DB tests fail with a client validation error after integratingA hand-back added a migration or an env var, and the generated client or env types are staleRun REGEN_CMD before every full run; gate.sh does
A Docker sandbox test passes here but fails in CIdocker cp kept the non-root runner's uid, and git in the container refused the checkoutChown 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 wantThe GitHub tool appended it at creationRead the description back and update it without the footer
Review comments on merged PRs went unansweredBot findings were treated as noiseRun the review-comment sweep (references/pr-lifecycle.md)
A spend cap never tripsThe vendor's "dollars" field was a fee, not usagePrice the tokens yourself; verify the cap live
The disk fills mid-dayFinished worktrees and leaked test temp dirsRemove finished worktrees; point the test runner's TMPDIR at one per-run directory
A force-push or billing change was refusedThe runtime's safety checkUse fast-forward or a follow-up PR; ask the user for billing changes

References

FileLoad when
references/owner-brief.mdWriting an owner's brief (Step 2)
references/integration.mdCherry-picking, conflicts, overlapping fixes (Step 3)
references/gate.mdBefore every push (Step 4)
references/pr-lifecycle.mdOpening, shepherding and closing out a PR (Steps 5–6)
references/issue-hygiene.mdThe status ledger, trackers, closing issues and epics
references/live-verification.mdAny run with real keys or paid resources (Step 7)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.