Harness Intelligence Wiki
SpecsCLIPR Authoring

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-grill and 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, merges

The 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/skills has skills/misc/pr/SKILL.md with frontmatter name: pr and a description that triggers whenever an agent writes or rewrites a PR body; skills/misc/pr/UPSTREAM.md pins mattpocock/skills commit e484a8095543718ced436b9b49a8160ed4554000 path skills/engineering/pr/SKILL.md; skills/misc/pr/LICENSE is the upstream MIT license.
  • AC-002: The pr template is one Managed Region between <!-- hi:pr-body:start --> and <!-- hi:pr-body:end --> that starts at ## Summary and has, in order, ## Summary, ## Evidence, ## Merge Danger (fields Door, Blast Radius, How to revert, Risk), ## Authority, ## Review, and the attribution line last inside the region.
  • AC-003: The Summary rule resolves $show-me for the choice of view, and pr/SKILL.md contains no copy of the show-me view 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.
  • AC-005: The Merge Danger rule sets Door: one-way with 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 Risk High for every One-Way Door, Low for docs, copy, internal-only or additive-behind-a-flag changes, and Medium otherwise.
  • AC-006: pr/SKILL.md states that the pr format replaces a repository .github/pull_request_template.md and 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-spec references/lifecycle.md § Draft pull request visibility resolves $pr before it creates the draft with gh pr create --draft --body-file or rewrites the Managed Region of a reused draft, and records the read-back Managed Region hash with the PR identity in IMPLEMENTATION-NOTES.md.
  • AC-009: delivery-phase phases/closeout.md, after its existing checks pass, resolves $pr to regenerate the Managed Region from final evidence, runs gh pr ready only 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, isDraft and reviewRequests under tracker 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-spec references/ui-screenshot-evidence.md and closeout.md put the durable UI Evidence links into the pr Evidence before/after entries; the PR-ready snippet in IMPLEMENTATION-NOTES.md stays for runs without a PR.
  • AC-012: .agents/rules/repository/one-way-doors.md exists with id HI-REPO-005, lists packages/db migrations, npm / @punks/lints / Registry publication, packages/contract, packages/auth, .github/workflows and external side effects, and .agents/rules/index.md has its row.
  • AC-013: apps/cli/src/data/catalog/skills.ts has an entry id: "pr", sourceDirectory: "skills/misc/pr", tier: "agnostic", and the misc Pack in packs.ts lists "pr"; the CLI test suite passes.
  • AC-014: The bun run sync:skills receipt names the skills commit that contains the change; BASELINE_CHANGELOG.md Unreleased describes the pr skill and the delivery PR flow; the affected harness wiki pages describe the flow; release classification reports releaseKind: baseline.
  • AC-015: review-phase and delivery-phase/phases/review.md are unchanged by this capability, and no skill text makes the Risk Tier change review passes or approvals.

Constraints

  • Skill source is wearedevpunks/skills on main; synced copies under .agents/skills and apps/cli/skills change only through bun run sync:skills (rule HI-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 on main directly (root CLAUDE.md shared skills rule); no pull request.
  • wearedevpunks/harness-intelligence: branch team/stefan/encode-pr-skill-delivery-flow from main @ c0a547ba0; the operator asked for one squashed commit on main followed by a baseline release.

Architecture Source

Accepted Technical Decisions

  • Standalone pr skill at skills/misc/pr (SKILL.md, UPSTREAM.md, LICENSE), id pr, tier agnostic, default misc Pack (D1, D12; ARC-001, ARC-006).
  • Vendored from mattpocock/skills@e484a809 skills/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-file or gh pr edit --body-file; closeout via gh pr edit --body-file, gh pr ready, gh pr edit --add-reviewer, readback with gh pr view --json body,isDraft,reviewRequests,author,state (D3, D4, D8; ARC-004, ARC-005).
  • One-Way Door Rule HI-REPO-005 at .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.md Unreleased (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/cli test suite and bun 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

ItemOwnerResume trigger
Risk Tier drives review passes and approvals (proposal E)Parent operatorRevert/incident data exists, or explicit request
Answer PR review threads after readyParent operatorExplicit request
Important / Nit / Pre-existing finding tagsreview-phase ownerExplicit request
PR size signalParent operatorExplicit request

Decision Log

DecisionEvidenceRationale
D1–D6Operator acceptance 2026-10-28; architecture Decision RecordRecommended proposals A–D, questions 1–5
D7–D12Operator acceptance of all recommendations; auto-pinned defaultsClose gaps G3–G8 without a grill
D13CLAUDE.md release classificationBaseline-only change

On this page