PR Authoring
Spec: PR Authoring
Context
Delivery already opens one draft pull request per Touched Repository after the
first in-scope push. No step owns the PR Body: it is written once, it goes
stale, and nothing marks the PR ready. The only required body content is a
UI Evidence section when UI changed. Nothing states the Door, the Blast
Radius or how to revert, which a human reviewer needs to decide how carefully
to read.
This capability adds one pr skill that owns the PR Body format, vendored from
Matt Pocock's pr skill with changes from Anthropic's code-review practice.
Delivery writes a provisional body at draft time, then refreshes it, marks the
PR ready and requests human review at closeout.
- Actors: the parent delivery agent; any agent that writes a PR Body; the Directing Human who reviews, approves and merges.
- Terms: PR Body, Managed Region, Door (One-Way Door, Two-Way Door), Blast Radius, Risk Tier, One-Way Door Rule, Directing Human. See architecture Canonical Terms.
- Decision authority: the operator waived
requirements-grilland accepted the recommended proposals on 2026-10-28. The architecture Decision Record D1–D13 is the durable decision source.
implement-spec draft visibility ──$pr──▶ provisional Managed Region (Evidence: Pending)
… implementation, review, docs …
delivery-phase closeout ─checks pass─▶ $pr ──▶ final Managed Region
└─▶ gh pr ready ─▶ review request ─▶ readback
Directing Human ◀── reviews, approves, mergesThe PR becomes ready only after every closeout check passes; the readback, not a command exit code, proves the state.
Non-Goals
- The Risk Tier does not change review passes, the review budget or approvals (D6). Proposal E is parked.
- No agent merges the PR.
- No answers to PR review threads after ready, no Important / Nit / Pre-existing tags on findings, no PR size signal.
- No built-in One-Way Door list ships inside the skill (D9).
- No use of a repository
.github/pull_request_template.md(D7).
Requirements and Outcomes
OUT-001: One skill owns the PR Body format
Any agent that writes or rewrites a PR Body, inside or outside delivery, uses
the pr skill. The body shows what changed as a visual, proof as a before and
an after, and Merge Danger as Door, Blast Radius, How to revert and Risk Tier,
followed by Authority and Review.
Architecture: OUT-001, ARC-001, FLOW-003.
OUT-002: A body rewrite keeps content the skill did not write
The skill writes only inside the Managed Region. Bot footers and human edits outside it survive every rewrite.
Architecture: OUT-002, ARC-002.
OUT-003: The draft PR shows its shape early
When implement-spec creates or reuses the draft PR, the body already has a
Summary from the plan, pending Evidence, Merge Danger and Authority.
Architecture: OUT-003, FLOW-001.
OUT-004: Closeout hands a current PR to the Directing Human
After every closeout check passes, closeout regenerates the body from final evidence, marks the PR ready, requests review from the Directing Human when GitHub allows it, and reports the read-back PR state.
Architecture: OUT-004, FLOW-002.
OUT-005: The project names its One-Way Doors
This repository keeps a path-triggered Codebase Rule that lists changes that are always a One-Way Door, so the Door call for them is never a guess.
Architecture: OUT-005, ARC-003.
OUT-006: Consumers receive the skill with release notes
The pr skill ships in the default misc Pack through a baseline release with
notes, and the harness wiki describes the new PR flow.
Architecture: OUT-006, ARC-006, ARC-008.
Acceptance Criteria
- AC-001:
wearedevpunks/skillshasskills/misc/pr/SKILL.mdwith frontmattername: prand a description that triggers whenever an agent writes or rewrites a PR body;skills/misc/pr/UPSTREAM.mdpinsmattpocock/skillscommite484a8095543718ced436b9b49a8160ed4554000pathskills/engineering/pr/SKILL.md;skills/misc/pr/LICENSEis the upstream MIT license. - AC-002: The
prtemplate is one Managed Region between<!-- hi:pr-body:start -->and<!-- hi:pr-body:end -->that starts at## Summaryand has, in order,## Summary,## Evidence,## Merge Danger(fieldsDoor,Blast Radius,How to revert,Risk),## Authority,## Review, and the attribution line last inside the region. - AC-003: The Summary rule resolves
$show-mefor the choice of view, andpr/SKILL.mdcontains no copy of theshow-meview catalog. - AC-004: The Evidence rule requires a before and an after taken from recorded evidence, prefers screenshots, then the exact failing-then-passing test as pseudocode, then changed output; it states that "tests are green" alone is not evidence and that missing proof is written as
Pending:with the planned proof.- Covers: OUT-001
- Architecture: AC-004, FLOW-002-STEP-002
- AC-005: The Merge Danger rule sets
Door: one-waywith the matched entry when a changed path or change kind matches the repository's One-Way Door Rule; without that rule it judges the Door from the diff and spec and writes a one-line reason; it sets RiskHighfor every One-Way Door,Lowfor docs, copy, internal-only or additive-behind-a-flag changes, andMediumotherwise. - AC-006:
pr/SKILL.mdstates that theprformat replaces a repository.github/pull_request_template.mdand does not read it. - AC-007: The rewrite rule reads the current body, replaces only the bytes between the markers and keeps every byte outside them; when the body has no markers, it puts the Managed Region first and keeps the old body below it.
- AC-008:
implement-specreferences/lifecycle.md§ Draft pull request visibility resolves$prbefore it creates the draft withgh pr create --draft --body-fileor rewrites the Managed Region of a reused draft, and records the read-back Managed Region hash with the PR identity inIMPLEMENTATION-NOTES.md. - AC-009:
delivery-phasephases/closeout.md, after its existing checks pass, resolves$prto regenerate the Managed Region from final evidence, runsgh pr readyonly when the PR is open and a draft, requests review only when the Directing Human's GitHub login is known and differs from the PR author (otherwise names who must approve), and reports the read-back body,isDraftandreviewRequestsundertracker or PR state. - AC-010: The closeout PR handover never merges, stops with the exact failed step when a GitHub write fails, and on rerun produces the same Managed Region without a second ready or duplicate review request.
- AC-011: For a delivery PR,
implement-specreferences/ui-screenshot-evidence.mdandcloseout.mdput the durable UI Evidence links into theprEvidence before/after entries; the PR-ready snippet inIMPLEMENTATION-NOTES.mdstays for runs without a PR. - AC-012:
.agents/rules/repository/one-way-doors.mdexists with idHI-REPO-005, listspackages/dbmigrations, npm /@punks/lints/ Registry publication,packages/contract,packages/auth,.github/workflowsand external side effects, and.agents/rules/index.mdhas its row. - AC-013:
apps/cli/src/data/catalog/skills.tshas an entryid: "pr",sourceDirectory: "skills/misc/pr",tier: "agnostic", and themiscPack inpacks.tslists"pr"; the CLI test suite passes. - AC-014: The
bun run sync:skillsreceipt names the skills commit that contains the change;BASELINE_CHANGELOG.mdUnreleaseddescribes theprskill and the delivery PR flow; the affected harness wiki pages describe the flow; release classification reportsreleaseKind: baseline. - AC-015:
review-phaseanddelivery-phase/phases/review.mdare unchanged by this capability, and no skill text makes the Risk Tier change review passes or approvals.
Constraints
- Skill source is
wearedevpunks/skillsonmain; synced copies under.agents/skillsandapps/cli/skillschange only throughbun run sync:skills(ruleHI-REPO-004). - Every changed agent-facing file goes through
writing-for-agents(operator rule, 2026-10-22). - One plan creates at most one pull request per Touched Repository; the existing draft visibility rules stay unchanged apart from the body.
- A provisional body is never completion evidence; "a visible draft PR does not satisfy these gates" stays.
Dependency Readiness
No Stack Required.
Branch/Base Intent
wearedevpunks/skills: commit onmaindirectly (rootCLAUDE.mdshared skills rule); no pull request.wearedevpunks/harness-intelligence: branchteam/stefan/encode-pr-skill-delivery-flowfrommain@c0a547ba0; the operator asked for one squashed commit onmainfollowed by a baseline release.
Architecture Source
- URL: https://github.com/wearedevpunks/harness-intelligence/blob/e448f43f3294490e3c7c5c089b65dee1ddb04eba/apps/wiki/content/docs/project/specs/cli/pr-authoring/ARCHITECTURE.md
- Commit:
e448f43f3294490e3c7c5c089b65dee1ddb04eba - Path:
apps/wiki/content/docs/project/specs/cli/pr-authoring/ARCHITECTURE.md - Content sha256:
9a809e6f4131869ff478c73d081b5030e682e7a8e02f90d357e959348d22508c
Accepted Technical Decisions
- Standalone
prskill atskills/misc/pr(SKILL.md,UPSTREAM.md,LICENSE), idpr, tieragnostic, defaultmiscPack (D1, D12; ARC-001, ARC-006). - Vendored from
mattpocock/skills@e484a809skills/engineering/pr/SKILL.md(MIT); keeps Summary, Evidence, Merge Danger and "skip preambles, keep prose brief"; adds How to revert, Risk, Authority, Review (D2; ARC-001). - Managed Region markers
<!-- hi:pr-body:start -->/<!-- hi:pr-body:end -->; replace-only-inside; prepend when absent; attribution inside (D10; ARC-002). - Draft write via
gh pr create --draft --body-fileorgh pr edit --body-file; closeout viagh pr edit --body-file,gh pr ready,gh pr edit --add-reviewer, readback withgh pr view --json body,isDraft,reviewRequests,author,state(D3, D4, D8; ARC-004, ARC-005). - One-Way Door Rule
HI-REPO-005at.agents/rules/repository/one-way-doors.md(D5; ARC-003). Risk Tiers Low / Medium / High; One-Way Door → High (D11). - Release as baseline through
BASELINE_CHANGELOG.mdUnreleased(D13; ARC-008).
Accepted Testing Decisions
- The skills are prose; their acceptance is checked by reading the changed files against AC-001–AC-012 and AC-015.
- Catalog and Pack changes are covered by the existing
apps/clitest suite andbun run --cwd apps/cli check(AC-013). - Release classification runs
node apps/cli/scripts/classify-release-impact.mjs --base origin/main --head HEAD(AC-014).
Verification Seams
- Skill text: the files named in AC-001–AC-012 at the synced skills commit.
- Catalog: the CLI catalog tests and the sync receipt
apps/cli/.devpunks-cache/skills-sync.json. - Runtime PR behavior (FLOW-001, FLOW-002) has no automated seam; the first delivery that runs the new closeout shows it through its PR readback.
Parked Decisions
| Item | Owner | Resume trigger |
|---|---|---|
| Risk Tier drives review passes and approvals (proposal E) | Parent operator | Revert/incident data exists, or explicit request |
| Answer PR review threads after ready | Parent operator | Explicit request |
| Important / Nit / Pre-existing finding tags | review-phase owner | Explicit request |
| PR size signal | Parent operator | Explicit request |
Decision Log
| Decision | Evidence | Rationale |
|---|---|---|
| D1–D6 | Operator acceptance 2026-10-28; architecture Decision Record | Recommended proposals A–D, questions 1–5 |
| D7–D12 | Operator acceptance of all recommendations; auto-pinned defaults | Close gaps G3–G8 without a grill |
| D13 | CLAUDE.md release classification | Baseline-only change |