Agent PR Authoring
Get an agent-authored change through review and landed, without a giant diff, an evidence-free Test Plan, or a gate-confusion incident.
Use This For
- Scoping a coding agent's change into one reviewable PR before opening it.
- Writing a
## Summary and ## Test Plan with real commands and observed output, not a claim.
- Triaging red CI: separating a real required gate (lint, tests, roadmap-link,
pr-requirements-guard) from an external, non-blocking check (a Cloudflare Pages preview build).
- Running draft-while-iterating, marking ready only when the real gates are green, and processing bot/human review as named fixup commits.
- Landing through a merge queue: enqueue, let the queue pick the strategy, rebase and recheck when the base moves — never force-push, never
--admin past a real gate.
Do Not Use This For
- This repo's specific release ceremony, internal actor embodiments, or skill-mirror sync mechanics (
port-daddy-internal-dev).
- Tracking a backlog item's lifecycle across a board or issue tracker (
agent-issue-tracker-workflow).
- Deciding what to build next or sequencing a roadmap of side-quests (
legible-roadmap-with-sidequests).
Process
flowchart TD
A[Scope one reviewable diff] --> B[Draft Summary + evidence-backed Test Plan]
B --> C[Open PR as draft]
C --> D[Push commits, CI runs]
D --> E{Gate triage}
E -->|Real required gate red| F[Fix root cause]
F --> D
E -->|External check red| G[Note it, do not block on it]
E -->|All required gates green| H[Mark PR ready]
H --> I[Review arrives: bot + human]
I --> J[Fix HIGH findings as named fixups]
J --> K[Rebase onto latest base]
K --> L{Still mergeable?}
L -->|No, base moved| K
L -->|Yes| M[Enqueue in merge queue]
M --> N[Queue applies its strategy and lands]
- Scope the diff before opening it. One PR = one reviewable change. If the work mixes a refactor, a feature, and a dependency bump, split it into separate PRs even if that means three PRs instead of one.
- Write the Summary and Test Plan together. Summary states what changed and why (and what it deliberately does not do). Test Plan lists the exact commands run and the observed output — a reviewer should be able to reproduce the claim without asking. "Tests pass" with no command or output is not a Test Plan.
- Open as a draft while iterating. Draft signals "not yet reviewable"; push commits and let CI run until the real required gates are green before asking for review.
- Triage every check before reacting to red. Classify it from the live
ruleset as required or advisory; repo-owned does not mean required, and
external does not mean advisory. Fix a required gate. Inspect advisory
failures for real findings, but never hold a merge merely for their status.
See
references/gate-taxonomy.md for the Port Daddy repository custom.
- Mark ready only when real gates are green, then process review: pull bot and human comments, fix the real findings as separate named fixup commits (
fixup: address <bot> finding on <file> — <what>), reply to the rest with fixed/deferred/contested-because. See references/review-and-merge-mechanics.md.
- Rebase onto the latest base and recheck mergeability before landing —
MERGEABLE can flip to CONFLICTING the moment another PR lands on the base.
- Land through the merge queue. Enqueue the PR and let the queue's configured strategy pick squash/merge/rebase and branch deletion; do not force a strategy by hand, do not force-push, and do not use an admin override to bypass a real required gate.
Output Contract
A landing-ready PR carries:
summary: what changed, why, and what it deliberately does not do.
testPlan: exact commands plus observed output, exit codes, or artifact paths — never a bare claim.
gateClassification: every check labeled required-and-blocking or external-and-advisory, with the real ones green.
fixups: named commits addressing every HIGH/critical review finding (or a contested-because reply on the thread).
mergeReadiness: rebased on the latest base, no admin bypass, no force-push, merge method left to the queue.
Use scripts/pr_readiness.mjs to audit a PR JSON description and return { pass, score, findings, recommendations }.
Anti-Patterns
The Giant Unreviewable PR
Novice: Ship 40+ files mixing a refactor, a new feature, and a dependency bump because it was all "part of the same task."
Expert: One PR is one reviewable change. Split by concern before opening — a reviewer who can't hold the diff in their head will rubber-stamp it or let it rot unreviewed.
Detection: pr_readiness.mjs returns an oversized-diff finding when filesChanged/linesChanged exceed the documented thresholds, or a mixed-concerns finding when diff.mixedConcerns is true.
Evidence-Free Test Plan
Novice: "✅ All tests pass" with no command and no output — or no Test Plan section at all.
Expert: The Test Plan lists the exact commands run and the observed result (pasted output, exit code, screenshot/artifact path). If it isn't reproducible from the PR body alone, it isn't evidence.
Detection: pr_readiness.mjs returns missing-test-plan (critical) when body.hasTestPlan is false, or test-plan-not-evidence-backed (critical) when it's true but testPlanHasEvidence is false.
Gate Confusion
Novice: Blocks a merge waiting for an external preview build (e.g. Cloudflare Pages) to go green, OR runs gh pr merge --admin to skip a failing lint/test/roadmap-link check.
Expert: Classify every check as required-and-repo-owned or external-and-advisory before reacting to red. Never bypass a real required gate with an admin override or force-push; never wait on, or treat as a blocker, a check that isn't repo CI.
Detection: pr_readiness.mjs flags required-check-failing (critical) for a red real gate, external-check-marked-required / external-gate-treated-as-blocker for gate-confused configuration, admin-bypass-skips-required-gate (critical) when --admin is used without every required repo-owned check verified green (failing/pending/skipped, or none reported — it fails closed), admin-bypass-used (medium) only when all required checks are green and it merely skips the BEHIND gate or an external non-blocking check, and force-pushed (critical) for a force-push.
References
| File |
Load When |
references/gate-taxonomy.md |
Need to classify a specific CI check as required-and-blocking versus external-and-advisory, or need the Cloudflare Pages / roadmap-link specifics. |
references/review-and-merge-mechanics.md |
Need the mechanics of pulling bot/human review, writing named fixups, rebasing on conflict, or enqueueing through a merge queue. |
examples/expected-output.md |
Need to see a bad PR audited, then the same PR fixed and passing. |
templates/output-template.md |
Need a reusable PR description template (Summary + Test Plan) to fill in. |
schemas/pr-plan.schema.json |
Need to validate a PR-plan JSON payload's structure before auditing it. |
scripts/pr_readiness.mjs |
Need deterministic scoring of a PR's readiness to land. |
agents/openai.yaml |
Need a subagent descriptor for delegated PR authoring/triage. |
Skill Bundle Index
Every file in this skill, and when to open it. Auto-generated; run scripts/index_references.py --fix.
root
CHANGELOG.md — Agent PR Authoring — Changelog — - Initial skill creation - Core process defined - Reference files and deterministic pr_readiness script added
README.md — Agent PR Authoring — Author a pull request an AI coding agent can actually get merged: a scoped diff, an evidence-backed narrative, correct real-vs-external gate
agents/
agents/openai.yaml — openai (data/schema)
examples/
examples/expected-output.md — Example Output: Agent PR Authoring — Scenario: an agent finishes a daemon fix and a batch of unrelated skill-doc edits in one session, opens one PR for everything, force-pushes
examples/sample-input.json — sample input (data/schema)
references/
references/gate-taxonomy.md — Gate Taxonomy: Required vs External — Use this when you need to decide whether a red or pending check should block a merge, or whether it's noise you should note and move past.
references/review-and-merge-mechanics.md — Review And Merge Mechanics — Use this when you need the mechanics of pulling review comments, turning findings into fixups, rebasing on conflict, or landing through a me
schemas/
schemas/pr-plan.schema.json — pr plan.schema (data/schema)
scripts/
templates/
templates/output-template.md — PR Description Template — Fill in every section before opening the PR.
1---2name: agent-pr-authoring3description: >-4 Author a pull request an AI coding agent can actually get merged: a scoped, coherent diff; a Summary and Test Plan5 backed by real evidence; correct triage of required-and-blocking CI gates versus external/advisory checks (e.g. a6 Cloudflare Pages preview build); draft-while-WIP discipline; named fixup commits for real review findings; and a7 clean landing through a merge queue without force-pushing or bypassing branch protection. Use when opening, updating,8 triaging red CI on, or landing an agent-authored GitHub PR. NOT for this repo's internal release ceremony, actor9 embodiments, or contributor mirror-sync mechanics (use port-daddy-internal-dev), tracking backlog/issue lifecycle10 across a board (use agent-issue-tracker-workflow), or deciding what to build next / sequencing a roadmap (use11 legible-roadmap-with-sidequests).12license: Apache-2.013allowed-tools: Read,Write,Edit,Bash,Grep,Glob14metadata:15 source: https://skillmd.com/skills/curiositech/agent-pr-authoring16 category: Agent & Orchestration17 tags:18 - pull-request19 - ci-gates20 - code-review21 - merge-queue22 - github-agent-workflow23 provenance:24 kind: first-party25 owners:26 - port-daddy27 pairs-with:28 - skill: agent-work-receipt-designer29 reason: A receipt's diffSummary and artifact-backed validation are exactly what a real Test Plan should contain.30 - skill: agent-issue-tracker-workflow31 reason: Tracks the work item a PR closes; this skill covers landing the PR itself, not the backlog lifecycle around it.32 - skill: port-daddy-internal-dev33 reason: Supplies this repo's specific release ceremony and mirror-sync rules that sit on top of the general PR mechanics here.34 io-contract:35 kind: deliverable36 consumes:37 - kind: pr-diff-and-metadata38 format: json39 - kind: ci-check-results40 format: json41 produces:42 - kind: pr-readiness-audit43 format: json44 - kind: pr-description45 format: markdown46---4748# Agent PR Authoring4950Get an agent-authored change through review and landed, without a giant diff, an evidence-free Test Plan, or a gate-confusion incident.5152## Use This For5354- Scoping a coding agent's change into one reviewable PR before opening it.55- Writing a `## Summary` and `## Test Plan` with real commands and observed output, not a claim.56- Triaging red CI: separating a real required gate (lint, tests, roadmap-link, `pr-requirements-guard`) from an external, non-blocking check (a Cloudflare Pages preview build).57- Running draft-while-iterating, marking ready only when the real gates are green, and processing bot/human review as named fixup commits.58- Landing through a merge queue: enqueue, let the queue pick the strategy, rebase and recheck when the base moves — never force-push, never `--admin` past a real gate.5960## Do Not Use This For6162- This repo's specific release ceremony, internal actor embodiments, or skill-mirror sync mechanics (`port-daddy-internal-dev`).63- Tracking a backlog item's lifecycle across a board or issue tracker (`agent-issue-tracker-workflow`).64- Deciding what to build next or sequencing a roadmap of side-quests (`legible-roadmap-with-sidequests`).6566## Process6768```mermaid69flowchart TD70 A[Scope one reviewable diff] --> B[Draft Summary + evidence-backed Test Plan]71 B --> C[Open PR as draft]72 C --> D[Push commits, CI runs]73 D --> E{Gate triage}74 E -->|Real required gate red| F[Fix root cause]75 F --> D76 E -->|External check red| G[Note it, do not block on it]77 E -->|All required gates green| H[Mark PR ready]78 H --> I[Review arrives: bot + human]79 I --> J[Fix HIGH findings as named fixups]80 J --> K[Rebase onto latest base]81 K --> L{Still mergeable?}82 L -->|No, base moved| K83 L -->|Yes| M[Enqueue in merge queue]84 M --> N[Queue applies its strategy and lands]85```86871. **Scope the diff before opening it.** One PR = one reviewable change. If the work mixes a refactor, a feature, and a dependency bump, split it into separate PRs even if that means three PRs instead of one.882. **Write the Summary and Test Plan together.** Summary states what changed and why (and what it deliberately does not do). Test Plan lists the exact commands run and the observed output — a reviewer should be able to reproduce the claim without asking. "Tests pass" with no command or output is not a Test Plan.893. **Open as a draft while iterating.** Draft signals "not yet reviewable"; push commits and let CI run until the real required gates are green before asking for review.904. **Triage every check before reacting to red.** Classify it from the live91 ruleset as required or advisory; repo-owned does not mean required, and92 external does not mean advisory. Fix a required gate. Inspect advisory93 failures for real findings, but never hold a merge merely for their status.94 See `references/gate-taxonomy.md` for the Port Daddy repository custom.955. **Mark ready only when real gates are green**, then process review: pull bot and human comments, fix the real findings as separate named fixup commits (`fixup: address <bot> finding on <file> — <what>`), reply to the rest with fixed/deferred/contested-because. See `references/review-and-merge-mechanics.md`.966. **Rebase onto the latest base and recheck mergeability** before landing — `MERGEABLE` can flip to `CONFLICTING` the moment another PR lands on the base.977. **Land through the merge queue.** Enqueue the PR and let the queue's configured strategy pick squash/merge/rebase and branch deletion; do not force a strategy by hand, do not force-push, and do not use an admin override to bypass a real required gate.9899## Output Contract100101A landing-ready PR carries:102103- `summary`: what changed, why, and what it deliberately does not do.104- `testPlan`: exact commands plus observed output, exit codes, or artifact paths — never a bare claim.105- `gateClassification`: every check labeled required-and-blocking or external-and-advisory, with the real ones green.106- `fixups`: named commits addressing every HIGH/critical review finding (or a contested-because reply on the thread).107- `mergeReadiness`: rebased on the latest base, no admin bypass, no force-push, merge method left to the queue.108109Use `scripts/pr_readiness.mjs` to audit a PR JSON description and return `{ pass, score, findings, recommendations }`.110111## Anti-Patterns112113### The Giant Unreviewable PR114115**Novice**: Ship 40+ files mixing a refactor, a new feature, and a dependency bump because it was all "part of the same task."116**Expert**: One PR is one reviewable change. Split by concern before opening — a reviewer who can't hold the diff in their head will rubber-stamp it or let it rot unreviewed.117**Detection**: `pr_readiness.mjs` returns an `oversized-diff` finding when `filesChanged`/`linesChanged` exceed the documented thresholds, or a `mixed-concerns` finding when `diff.mixedConcerns` is true.118119### Evidence-Free Test Plan120121**Novice**: "✅ All tests pass" with no command and no output — or no Test Plan section at all.122**Expert**: The Test Plan lists the exact commands run and the observed result (pasted output, exit code, screenshot/artifact path). If it isn't reproducible from the PR body alone, it isn't evidence.123**Detection**: `pr_readiness.mjs` returns `missing-test-plan` (critical) when `body.hasTestPlan` is false, or `test-plan-not-evidence-backed` (critical) when it's true but `testPlanHasEvidence` is false.124125### Gate Confusion126127**Novice**: Blocks a merge waiting for an external preview build (e.g. Cloudflare Pages) to go green, OR runs `gh pr merge --admin` to skip a failing lint/test/roadmap-link check.128**Expert**: Classify every check as required-and-repo-owned or external-and-advisory before reacting to red. Never bypass a real required gate with an admin override or force-push; never wait on, or treat as a blocker, a check that isn't repo CI.129**Detection**: `pr_readiness.mjs` flags `required-check-failing` (critical) for a red real gate, `external-check-marked-required` / `external-gate-treated-as-blocker` for gate-confused configuration, `admin-bypass-skips-required-gate` (critical) when `--admin` is used without every required repo-owned check verified green (failing/pending/skipped, or none reported — it fails closed), `admin-bypass-used` (medium) only when all required checks are green and it merely skips the BEHIND gate or an external non-blocking check, and `force-pushed` (critical) for a force-push.130131## References132133| File | Load When |134| --- | --- |135| `references/gate-taxonomy.md` | Need to classify a specific CI check as required-and-blocking versus external-and-advisory, or need the Cloudflare Pages / roadmap-link specifics. |136| `references/review-and-merge-mechanics.md` | Need the mechanics of pulling bot/human review, writing named fixups, rebasing on conflict, or enqueueing through a merge queue. |137| `examples/expected-output.md` | Need to see a bad PR audited, then the same PR fixed and passing. |138| `templates/output-template.md` | Need a reusable PR description template (Summary + Test Plan) to fill in. |139| `schemas/pr-plan.schema.json` | Need to validate a PR-plan JSON payload's structure before auditing it. |140| `scripts/pr_readiness.mjs` | Need deterministic scoring of a PR's readiness to land. |141| `agents/openai.yaml` | Need a subagent descriptor for delegated PR authoring/triage. |142143<!-- BEGIN BUNDLE INDEX (auto: index_references.py) -->144145## Skill Bundle Index146147*Every file in this skill, and when to open it. Auto-generated; run `scripts/index_references.py --fix`.*148149**root**150- [`CHANGELOG.md`](CHANGELOG.md) — Agent PR Authoring — Changelog — - Initial skill creation - Core process defined - Reference files and deterministic pr_readiness script added151- [`README.md`](README.md) — Agent PR Authoring — Author a pull request an AI coding agent can actually get merged: a scoped diff, an evidence-backed narrative, correct real-vs-external gate152153**`agents/`**154- [`agents/openai.yaml`](agents/openai.yaml) — openai (data/schema)155156**`examples/`**157- [`examples/expected-output.md`](examples/expected-output.md) — Example Output: Agent PR Authoring — Scenario: an agent finishes a daemon fix and a batch of unrelated skill-doc edits in one session, opens one PR for everything, force-pushes 158- [`examples/sample-input.json`](examples/sample-input.json) — sample input (data/schema)159160**`references/`**161- [`references/gate-taxonomy.md`](references/gate-taxonomy.md) — Gate Taxonomy: Required vs External — Use this when you need to decide whether a red or pending check should block a merge, or whether it's noise you should note and move past.162- [`references/review-and-merge-mechanics.md`](references/review-and-merge-mechanics.md) — Review And Merge Mechanics — Use this when you need the mechanics of pulling review comments, turning findings into fixups, rebasing on conflict, or landing through a me163164**`schemas/`**165- [`schemas/pr-plan.schema.json`](schemas/pr-plan.schema.json) — pr plan.schema (data/schema)166167**`scripts/`**168- [`scripts/pr_readiness.mjs`](scripts/pr_readiness.mjs)169170**`templates/`**171- [`templates/output-template.md`](templates/output-template.md) — PR Description Template — Fill in every section before opening the PR.172173<!-- END BUNDLE INDEX -->