Continuous Delivery with AI Assistance
Continuous delivery with AI assistance means shipping small, verified changes continuously and handing the pipeline’s glue work to an agent: commit messages, PR descriptions, diff review, workflow YAML, deploy gates, and release notes. The discipline that makes it work is committing after every completed task rather than after the whole feature.
You spent four hours building a feature in a single AI session. The diff is 1,200 lines across 18 files. The reviewer’s first comment is “can you break this into smaller PRs?” and you cannot, because the changes are tangled together. Then the PR sits for two days waiting on a reviewer, the deploy needs three manual approvals across two Slack channels, the release notes are still a TODO, and the night CI went red nobody triaged it until standup.
Continuous delivery is the antidote to the big-bang feature branch, and its principle is simple: ship small, verified changes as often as possible. The reason teams don’t is that the glue work between a merged PR and production — reviews, YAML, gates, changelog, failure triage — is exactly the tedium nobody wants to own.
That glue work is where an AI assistant earns its keep. Not “AI writes your app”, but AI as a tireless reviewer, commit-message writer, YAML generator, and first responder wired directly into the pipeline.
What AI-assisted continuous delivery gives you
Section titled “What AI-assisted continuous delivery gives you”- The incremental commit discipline that keeps AI-generated diffs reviewable
- Prompts for commit messages, PR descriptions, release notes, and changelog entries
- A real GitHub Actions step that runs Claude Code headless on every PR diff
- Copy-paste prompts to generate pipeline YAML, gate a deploy, and triage a red build, one per tool
- The Cursor / Claude Code / Codex split for where each tool fits in the pipeline
- The failure modes AI-generated pipelines hit in production, and the checks that catch them
Commit after every task, not after every feature
Section titled “Commit after every task, not after every feature”The single most impactful habit here: commit after every successful task, not after the entire feature. If you are following the PRD to plan to todo methodology, each todo item should produce one commit. That is what makes the difference between a 1,200-line tangle and a stack of changes a reviewer can actually read.
After each completed task, ask Cursor to commit with a meaningful message:
The rate limiter implementation passes all tests. Commit this changewith a descriptive commit message following our conventional commitsformat (feat/fix/chore). Include what changed and why.Cursor runs git add and git commit directly from Agent mode. For a faster flow, hand commits to a Cursor Cloud Agent (formerly Background Agent) while you move to the next task.
Claude Code excels at git workflows. After each task:
All tests pass. Commit this change with a conventional commit message.Stage only the files related to the rate limiter task. Do not stageunrelated changes.For headless CI integration, it can commit on its own:
claude -p "Run the linter and tests. If they pass, commit with a descriptive message."Hooks can auto-format code before every commit, so style stays consistent without manual intervention.
Codex can commit and open the PR in the same breath:
All tests pass for the rate limiter. Commit the changes with aconventional commit message. Then create a draft PR with asummary of what changed and how to test it.The GitHub integration is what makes this work from ChatGPT desktop. A Codex Cloud task can handle PR creation in its hosted environment while you keep working locally.
Turning a branch into a reviewable PR
Section titled “Turning a branch into a reviewable PR”Pull requests are where review happens, and a well-documented PR gets reviewed faster than a bare one. The agent has the diff, so it can write the description that actually helps a reviewer.
After pushing your branch, ask Cursor to open the PR — it drives the gh CLI from Agent mode:
Push the current branch and create a PR against main.
For the PR description:1. Summarize what this PR does and why2. List the key files changed with a brief explanation of each3. Include testing instructions4. Mention any deployment considerations (new env vars, migrations)
Use our PR template format.Claude Code’s PR workflow is battle-tested:
Push this branch and create a PR against main using gh.
Write the PR description covering:- Summary of changes- Key decisions and trade-offs- Testing done (include test output)- Deployment notes (migrations, env vars, feature flags)
Use conventional PR title format.The same job runs headless as a pipeline step, with structured output you can post as a comment:
claude -p "Review the current diff against main. Generate a PR description." --output-format jsonCodex has native GitHub integration for PR workflows:
Create a pull request for the current branch against main.
Include:- Summary of what changed and why- Files changed with explanations- Test coverage information- Any breaking changes or deployment requirements
Add relevant labels and request review from the team.Codex can also be triggered from Slack or Linear to create PRs from issue descriptions, closing the loop between project management and code delivery.
Splitting an oversized diff into stacked PRs
Section titled “Splitting an oversized diff into stacked PRs”Sometimes a session produces a change that should have been three PRs. Rather than untangling the git history by hand, have the agent do the surgery.
The current branch has changes across the database layer, API layer,and frontend. Help me split this into three separate PRs that canbe reviewed and merged independently:
1. PR 1: Database migration and model changes2. PR 2: API endpoint changes (depends on PR 1)3. PR 3: Frontend changes (depends on PR 2)
Create a new branch for PR 1 with only the database changes.The current diff is too large for a single PR. Help me split it:
1. Run git diff --stat to see all changed files2. Group files by layer (db, api, frontend)3. Create branch feature/rate-limiter-db with only database changes4. Create branch feature/rate-limiter-api with API changes5. Create branch feature/rate-limiter-ui with frontend changes
Each branch should be independently testable. Start with thedatabase branch.The diff on this branch is too large. Split it into stacked PRs:
1. Database layer changes (first to merge)2. API layer changes (stacks on database PR)3. Frontend changes (stacks on API PR)
Create separate branches for each. Make sure each branch's testspass independently. Create draft PRs with dependencies noted.One git worktree per Codex task makes this particularly smooth: each PR is developed and tested in its own checkout without branch switching. ChatGPT desktop can create an optional managed worktree; CLI and IDE users create one with git.
Running a reviewer on every PR
Section titled “Running a reviewer on every PR”Automated PR review is the highest-leverage place to start automating the pipeline itself: it is low-risk (comments only, no deploys) and pays off on day one. The three tools occupy different surfaces here, so pick based on where your team already lives.
Cursor’s BugBot reviews PRs automatically once enabled on the repo and posts inline comments on likely bugs. Re-trigger a review on demand by commenting bugbot run on the PR. When it flags something, Autofix (GA since February 2026) can spawn a background Cloud Agent that opens a follow-up PR with the proposed fix, so a reviewer approves a diff instead of writing one. As of May 2026 BugBot bills per review (roughly $1.20 for a default-effort pass, more for large diffs) on Teams and Individual plans instead of the old flat per-seat fee.
Use Cursor when your team reviews in the GitHub UI and wants fixes proposed as PRs they can eyeball.
Claude Code shines in headless CI. Run claude -p inside a GitHub Action to review a diff, gate a deploy, or draft a changelog — scripted, no TUI. Pair it with a PreToolUse hook locally so a risky command (a raw kubectl apply, a force-push) pauses for confirmation before the agent runs it.
Use Claude Code when CD lives in your .github/workflows and you want the agent invoked from a script with explicit allowed tools.
Codex spans ChatGPT desktop, CLI, IDE, and Cloud. Codex Cloud runs tasks in a separate hosted environment; optional managed worktrees belong to local tasks in ChatGPT desktop, while CLI/IDE users can choose their own git worktree. The GitHub integration lets Codex open and review PRs, and the Slack integration lets a teammate kick off a task from a channel. Automations run recurring prompts and deliver findings to the task inbox.
Use Codex when you want async, cloud-side tasks and chat-driven approvals rather than a local terminal loop.
Here is a real, minimal GitHub Actions step that runs Claude Code headless against the PR diff. The flags are the load-bearing part: --allowedTools (not --allow-tools) restricts what the agent may touch, and --output-format json (not --json) makes the result parseable downstream.
name: AI PR Reviewon: pull_requestpermissions: contents: read pull-requests: writejobs: review: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Run Claude Code review env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | git diff origin/${{ github.base_ref }}...HEAD > /tmp/pr.diff npx -y @anthropic-ai/claude-code -p \ "Review the diff in /tmp/pr.diff for security issues, logic bugs, and missing error handling. Be specific and cite file:line. Skip style nits." \ --allowedTools "Read,Grep,Bash(git diff:*)" \ --output-format json > review.jsonThe point is the inversion: you do not paste a diff into a chat window. The pipeline feeds the diff to the agent and captures structured output you can post as a comment or fail the job on.
Generating the pipeline instead of hand-writing it
Section titled “Generating the pipeline instead of hand-writing it”Nobody should write CI YAML from a blank file. Describe the pipeline in plain English, let the agent emit it, then review the result against your real runner and secret names.
In Agent mode the agent can read your package.json and existing .github/workflows, so it will match your real scripts and Node version instead of guessing:
Create .github/workflows/ci.yml. Read package.json first to use the realscript names and Node version. The workflow should: install deps withnpm ci, run npm run lint, run npm run test (Vitest), then build a Dockerimage only on pushes to main. Use actions/checkout@v6 andactions/setup-node@v6. Cache npm. Do not invent scripts that aren'tin package.json.From the terminal, let Claude Code read the project and write the file in one shot, then diff it before committing:
Read package.json and any existing workflows. Write .github/workflows/ci.ymlthat runs npm ci, npm run lint, and npm run test on every PR, and buildsand pushes a Docker image to GHCR only on push to main. Useactions/checkout@v6, pin the registry login to secrets.GITHUB_TOKEN, andadd a concurrency group keyed on the ref so superseded runs cancel.Show me the file before writing it.Run with workspace-write so Codex can create the file, and configure on-request separately so it asks before crossing that sandbox boundary. Routine in-sandbox edits and commands do not each trigger a prompt:
codex --sandbox workspace-write -c approval_policy=on-request \ "Read package.json, then create .github/workflows/ci.yml that runs npm ci, \ lint, and Vitest on PRs and builds a Docker image on push to main. \ Match the real script names. Use actions/checkout@v6."Gating the deploy with a human in the loop
Section titled “Gating the deploy with a human in the loop”Full auto-deploy is the last thing to adopt, not the first. Start with the agent preparing the deploy and running pre-flight checks, then hand off to a human for the final yes. The approval can live in Slack, in a GitHub environment protection rule, or in a chat with the agent itself.
For the release-notes step, give the agent a commit range and a format rather than a vague “summarize”:
Triaging a red build
Section titled “Triaging a red build”The agent is also useful on the pipeline itself, and a red build at 2am is the case where a first responder that never sleeps genuinely helps. The constraint in the prompt matters more than the diagnosis: without it, the fastest way to a green check is to delete the test.