Capstone 3: An Autonomous Coding Pipeline
Wire up a pipeline where agents pick up issues, implement changes in isolated branches, run tests, and open pull requests for review.
Up to now you've driven coding agents yourself: you write the task, watch the agent work, and review the result. The next step is a pipeline that does the driving. A maintainer labels an issue, and a while later a draft pull request appears, written by an agent in its own isolated branch, with tests that passed on a machine that didn't take the agent's word for it.
That sounds like handing over the keys, and done carelessly it is. In this capstone you'll build the pipeline with the controls that make it safe to run: a human gate before work starts, an isolated git worktree per issue, a strict permission policy on every tool call, independent verification, and draft pull requests that a person must review before anything merges.
What you'll build
A TypeScript program you point at a GitHub repository:
npx tsx pipeline.ts ~/code/my-appFor each open issue labeled agent-ready, it:
- Claims the issue by swapping its label to
agent-working. - Creates a fresh git worktree on a new branch,
agent/issue-<number>. - Runs a coding agent built with the Claude Agent SDK inside that worktree, with a permission policy you write.
- Runs the tests itself, checks the size and location of the diff, and refuses to continue if anything fails.
- Shows you the diff summary and asks before pushing (skip with
--yesonce you trust it). - Opens a draft pull request with the agent's summary, and comments on the issue either way.
This capstone builds on Git, Branches, and Worktrees for Agent Work, Writing Tasks an Agent Can Actually Finish, Reviewing Agent-Written Code, and Leveling Up with an Agent SDK.