Skip to content

README.md

63 lines · 3.4 KB · Markdown
Raw

@kentcdodds/ship-pr

Intent

Make shipping a pull request a short, repeatable loop for agents. Instead of a long skill that every agent re-reads and re-interprets, the agent calls one tick export, reads where the PR stands, and acts.

The first tick returns a brief checklist of the whole process, what is done and what remains, and full details only for the current step. Later ticks (the re-tick examples pass brief: true) skip the checklist and prose so repeat calls stay small. That includes example npx @kodycodes/cli execute --local --code 'import run from "kody:@kentcdodds/ship-pr/…"; …' calls for the helpers that fit. The package reports state and options. The agent decides what to do about CI failures and AI-review feedback. It can fix and push, reply on a thread, or record a 7-day decision (ignored / skipped / wontfix / accepted, reason required) so noise stops showing up in later ticks.

Success: an agent can take a PR from "opened" to merged (or parked), verify the deploy, file leftover friction, and post the Discord summary. It needs only this package plus the short ship-pr skill in kentcdodds/kody.

This package is the source of truth for the Bugbot / Devin / Seer review-bot sort. It was ported from the old in-repo classify-review-bot.mjs / sort-review-bot-comments.mjs.

What it covers

StepWhat tick checks
readyPR open and not a draft (safe automation can mark it ready)
ciHead-SHA checks, statuses, and workflow runs all terminal, with CI started since the latest push / open / ready-for-review (deduped re-runs; AI reviewer checks excluded)
ai-reviewBugbot state on the head SHA (trigger, running, stalled, unavailable for non-kentcdodds authors), CodeRabbit / Devin / Seer state, sorted bot findings (including CodeRabbit outside-diff body findings), and other unresolved threads
mergeRisk policy (high parks unless merge authority), mergeability
deployWorkflow runs on the merge SHA (cancelled counts as superseded, not failed) plus, for kentcdodds/kody, whether production /health serves the merge SHA or a descendant
frictionLeftover papercuts (incl. brittle/flaky low-value tests) via @kentcdodds/friction-log/file, then a step decision
reportDiscord summary via ./send-summary (wraps @kentcdodds/discord/send-shipped-pr; optional door / cleanup)

Risk tiers follow Kent's standing policy (2026-08-08). low means green CI, and AI review is optional. medium waits for Bugbot and handles valid findings. high also waits for CodeRabbit and Devin, then parks unless the user granted merge authority.

Prerequisites

  • @kentcdodds/github OAuth connections: github-bot (kody-bot, all reads, replies, merges) and github-kent (used only by @kentcdodds/bugbot to post bugbot run).
  • @kentcdodds/discord configured for send-shipped-pr (Cursor API key for cost lookup).
  • Node ≥ 22 with npx @kodycodes/cli signed in (kody login or MCP cliCredentialBootstrap). Do not use hosted MCP execute.

Done when

  • tick on an open PR returns a focus step with details and runnable example invokes, and stays read-only unless applySafeAutomations: true.
  • decide hides the chosen thread, check, or step until it expires (≤ 7 days).
  • The loop reaches exit.done: true after merge or park, deploy, friction, and report.

Agent runbook: AGENTS.md.