Agentic PR Workflow skill for Codex
Agent PRs with evidence, not just claims. Codex prepares pull requests a reviewer can verify: one concern per branch, commits that separate mechanical and behavioural changes, gates for tests, scope, secrets and weakened checks, a self-review with codex review, and a description whose every claim cites a command and result. Pushing and opening the PR wait for explicit confirmation.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- agentic-pr-workflow Installs to ~/.agents/skills/agentic-pr-workflow/ for every project on this machine.
curl -fsSL codexskills.dev/cli.mjs -o codex-skills.mjsnode codex-skills.mjs install agentic-pr-workflow The CLI also searches, updates and removes skills. Run it with no arguments to pick from a list. Needs Node 20.12+.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- --project agentic-pr-workflow Installs to .agents/skills/agentic-pr-workflow/ in the current repository. Commit it and everyone who runs Codex there gets it.
curl -fsSLO codexskills.dev/downloads/agentic-pr-workflow.zipunzip -o agentic-pr-workflow.zip -d ~/.agents/skills/ The archive holds the skill folder with its generated agents/openai.yaml. Unzip into .agents/skills/ to scope it to a repo.
& ([scriptblock]::Create((irm codexskills.dev/install.ps1))) agentic-pr-workflow PowerShell 5.1 or 7. Installs to %USERPROFILE%\.agents\skills\. Add -Project for the current repo.
104-line POSIX script. No sudo, no telemetry. Read install.sh
Use it in Codex
Start a prompt with $agentic-pr-workflow, or pick it from /skills.
You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.
What Codex reads before loading it
Produces agent-authored branches, commits and pull requests that reviewers can trust, with scoped branches, one-concern diffs, pre-PR gates (tests, lint, codex review --base, secret and test-weakening scans), an evidence-based PR description that discloses agent authorship, confirmed push and gh pr create steps, and disciplined handling of review comments and CI failures. Use when Codex should open or prepare a PR, the user asks for a PR description, wants agent changes made reviewable, or needs to respond to review feedback on an agent-written PR.
Use it when
- Codex should prepare or open a pull request
- An agent-written branch needs to become reviewable
- Writing a PR description backed by test evidence
- Responding to review comments or CI failures on an agent PR
Use something else when
- You want Codex to review someone else's diff: use codex-code-review
- Setting up Codex inside GitHub Actions: use codex-github-action
How to check the result
The scope, secret and suppression scans are clean or explained, codex review --base main shows no unaddressed findings, and every row in the PR's verification table reruns with the same result.
The mistake it prevents
Shipping stray formatting, lockfile churn or skipped tests inside an agent PR and claiming all checks pass without the commands that prove it.
An agent PR is trustworthy when its scope is obvious from the title, every claim in the description is backed by a command and result the reviewer can rerun, nothing outside the stated scope changed, and the reviewer knows exactly where human judgment is needed.
Ground rules
- One concern per PR. Unrelated cleanups go in a separate PR or a follow-up list.
- Never push, open, merge or force-push without explicit user confirmation in this conversation. Merging is always a human action.
- Never weaken a check to make it pass: no deleted or skipped tests, no new
@ts-ignore,# type: ignore,eslint-disableornoqawithout stating why in the description. - Read
AGENTS.mdfirst for branch naming, commit style, test commands and any## Code Review Rulessection.
Workflow
- [ ] 1. Branch from an up-to-date base
- [ ] 2. Make the change in reviewable commits
- [ ] 3. Run the pre-PR gates
- [ ] 4. Self-review the diff with Codex review
- [ ] 5. Write the PR description from evidence
- [ ] 6. Confirm, push, open as draft
- [ ] 7. Handle review comments and CI
1. Branch
git fetch origin
git switch -c codex/<short-slug> origin/main # follow AGENTS.md naming if it differs
Work in a worktree when another task is in progress (see codex-parallel-worktrees).
2. Reviewable commits
- Separate mechanical changes (renames, moves, formatting) from behaviour changes; a reviewer can skim the first and must read the second.
- Each commit builds and passes tests when feasible.
- Messages say why, not only what. Follow the repo’s convention (Conventional Commits if used).
- In
workspace-write,.gitis read-only, so commits need approval; batch them at logical points rather than asking for approval on every small edit.
3. Pre-PR gates
Run the project’s own commands from AGENTS.md; a typical set:
npm run lint && npm run typecheck && npm test # or the repo's equivalents
git diff --stat origin/main...HEAD # scope check
git diff origin/main...HEAD --name-only | rg -v '^(src/billing|tests/billing)/' || true # files outside scope
git diff origin/main...HEAD | rg -n -i '(api[_-]?key|secret|token|password)\s*[:=]' || true
git diff origin/main...HEAD | rg -n '^\+.*(ts-ignore|eslint-disable|noqa|type: ignore|\.skip\(|xit\(|@Disabled)' || true
git diff origin/main...HEAD --stat -- '*lock*' '*.snap' # unexpected lockfile/snapshot churn
Every hit in the last four commands needs either a fix or a sentence in the PR description.
Size guide: under ~400 changed lines of non-generated code reviews well. Above that, split (stacked PRs or preparatory refactor first) unless the change is mechanical.
4. Self-review
codex review --base main # non-interactive review of the branch diff
codex review --uncommitted # before committing
Or /review in the TUI or IDE (base branch, uncommitted changes, or a commit). Fix
real findings; list deliberate non-fixes in the description. review_model in config
can point reviews at a stronger model.
5. PR description
Write it from evidence gathered above, not from memory of intent:
## What
Adds per-tenant rate limiting to public API routes (token bucket, Redis-backed).
## Why
Tenants can exhaust shared capacity (#482). Spec requires burst tolerance.
## Changes
- src/middleware/ratelimit.ts: token bucket + Redis adapter (new)
- src/server.ts: registers middleware after auth (L40-75)
- docs/api/limits.md: limits and headers
## Verification
| Check | Command | Result |
|---|---|---|
| Unit + integration | `npm test` | 1,302 passed, 0 failed |
| Types / lint | `npm run typecheck && npm run lint` | clean |
| Latency | `make bench` | p95 41ms -> 42ms |
## Risks and review focus
- Redis outage behaviour: fails open (allows requests). Please confirm this is acceptable.
- Not covered: websocket routes (follow-up #495).
## Authorship
Prepared with Codex (model: gpt-6.1-sol, session <id>). Reviewed by the agent with
`codex review --base main`; human review required.
6. Confirm, push, open as draft
Ask first, showing branch, commit count and target:
Ready to push codex/rate-limit (4 commits) and open a draft PR against main. Proceed?
After a clear yes:
git push -u origin codex/rate-limit
gh pr create --draft --base main --title "Add per-tenant API rate limiting" --body-file pr-body.md
Push needs network access and credentials; if the sandbox blocks it, hand the commands to the user instead of widening access.
7. Review comments and CI
- Fetch comments (
gh pr view --comments, or the review UI), then address each one: change the code, or reply with the reason it stays. Never resolve a thread silently. - Push follow-up commits during review; do not rebase or force-push an open PR unless the reviewer asks, because it breaks “changes since last review”.
- After pushing, reply with a summary: “Addressed 5/6 comments in a1b2c3d; kept X because Y.”
- CI failure: read the failing job log (
gh run view <id> --log-failed | tail -n 200), reproduce locally, fix forward with a new commit, rerun the gate locally first. - On GitHub with Codex code review set up,
@codex reviewon the PR requests another review pass; repo-specific checks belong in## Code Review RulesinAGENTS.md.
Gotchas
- Descriptions that claim “all tests pass” without the command and count are not evidence; reviewers learn to ignore them.
- Agent PRs often carry stray changes: formatting of untouched files, lockfile churn, debug logging. The scope check catches them; revert, do not explain them away.
- Generated files (snapshots, lockfiles, codegen) should be regenerated by the tool, not edited by hand, and called out in the description.
- A green CI run on a draft does not replace the local gates when CI skips jobs on drafts.
- Keep the session id in the description; it lets a reviewer inspect how a decision was reached.
What the zip contains
SKILL.md plus the interface file below. Nothing runs on install.
agents/openai.yaml
Gives the Codex app a display name, a one-line description and a starter prompt for this skill.
interface:
display_name: "Agentic PR Workflow"
short_description: "Agent PRs with evidence, not just claims"
default_prompt: "$agentic-pr-workflow Open a draft PR for this change with a description reviewers can verify" About this skill
Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.