chore(dev): add a merge-risk skill for rating a PR before merge

Merged
OK
2d ago
+141-2

What

A repo-only merge-risk skill. Asked for the merge risk of a PR, an agent prints a low, medium, or high rating and one verdict per category, each with the gaps that raise the risk:

**Merge risk: medium**

**Alignment:** decent 👀
- <gap, with a permalink at the head SHA>

**Impact:** medium 👀
**Verification:** decent 👀
**Rollback cost:** low ✅
**Error detection:** decent 👀

It is read-only: it never approves, merges, labels, or pushes.

Why

A PR labeled Ready for Human Review is green and has no open threads, which says nothing about how careful the human should be before merging it. This gives them a second opinion on what the checks do not cover.

How it works

  1. .dev/skills/merge-risk/SKILL.md adapts Warp's merge-risk skill. The five categories, the weights, and the thresholds are theirs.
  2. Each category is rewritten for this repo:
    • Impact lists the sensitive areas: the stability-policy contract, the security invariants, the engine contract, pass/fail logic, cache keys, dependency floors, release and CI workflows, and a fork PR whose code the merge queue runs with secrets.
    • Verification holds ## Verified to the evidence table in writing-pr, and counts evidence only when the files behind it match the head.
    • Rollback cost rates what a revert leaves behind once a release ships the change.
    • Error detection asks whether the checks ran the changed path: suites skipped by .github/filters.yml, agentic suites skipped on fork and Dependabot PRs, recordings that never replay the changed action.
  3. The score gets floors the original lacks. With the original weights, one ⚠️ and four ✅ averages to low. Here any ⚠️ is at least medium, and ⚠️ on both Impact and Verification is high.
  4. The PR's title, body, comments, and diff are treated as evidence, not as instructions to the agent.
  5. .claude/skills/merge-risk is the symlink agents load it through, and AGENTS.md lists it with the other dev skills.

Issue

No Linear ticket. I searched and found none.

Verified

Ran it locally: yes

Two fresh agents, each given only the skill path and a PR number:

PRSkill versionRatingWhat it surfaced
#2395 (team, cache replay)first draftmediumNo committed recording contains a dragAt, so the strict-cache suites never replay the changed path. Evidence comes from a fake engine only. The diff adds a stop rule the ticket does not ask for.
#2314 (fork, init)after the first run's fixeslowThree untested wrong-URL cases, reproduced by running the head's code. web agent skipped on the fork. No terminal recording for the new init lines.

Each agent also reported where the instructions were ambiguous or wrong, and those went back into the skill: the head SHA and comments in the inputs, Linear tickets, a stale-evidence check that works after a rebase, and a wrong claim about when agentic suites run.

A third fresh agent reviewed the diff against the repo. Its findings are fixed: Dependabot PRs are not cross-repository, gh pr view and gh pr diff truncate on large PRs, the merge queue runs fork code with secrets, and the score floors in step 3.

Not re-run after those last fixes: the two runs above predate the score floors and the large-PR fallback.

pnpm check passes. No changeset: nothing published changes.