跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

fix-pr-review

Use when the user asks to fix, address, or respond to a PR review — "fix the PR review", "/fix-pr-review". Optional PR number/URL (defaults to the current branch's PR); optional `codex` argument selects Codex.

richkuo · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add richkuo/rk-skills --skill fix-pr-review

技能说明


name: fix-pr-review description: Use when the user asks to fix, address, or respond to a PR review — "fix the PR review", "/fix-pr-review". Optional PR number/URL (defaults to the current branch's PR); optional codex argument selects Codex.

fix-pr-review

Resolve every unaddressed review finding autonomously: validate, fix or refute, implement judgment calls and optional improvements, request a re-review. Never stop to ask the user. The review is a hypothesis: trace every finding to current file:line before changing anything.

Input

In any order: an optional PR reference (number or URL; default = the current branch's PR) and an optional literal codex token selecting Codex as this cycle's re-review bot. Any other token is ignored and named in the step 11 report. No PR found → say so and stop.

Steps

0. Resolve the PR and sync

gh pr view [<N>] --json number,headRefName,headRefOid,headRepositoryOwner,baseRefName,state,mergeable,mergeStateStatus, then git fetch origin. MERGED/CLOSED → stop and report. Be on the PR's head branch (gh pr checkout <N> if not; never fix a review on the base branch). On a fork PR (headRepositoryOwner differs) pull from and push to the tracked upstream, which may differ from origin. git pull --ff-only; no fast-forward → stop and report. CONFLICTING/DIRTY → step 7 runs this invocation.

1. Fetch all unaddressed review feedback

Three channels: formal reviews, issue comments, inline diff threads. Fetch and select the unaddressed set per fetch-recipes.md, read completely. Never delete, edit, or bury a disposition comment: the next review reads them on purpose. Record whether the set contains any blocking finding (a Needs Fixing / Requires Human Review item, a thread asserting a real defect, or a step 2 CI failure) — step 10 routes on it.

LGTM with non-blocking items still gets them. Bare LGTM (no finding items, no open threads, and after step 2 no CI failure this PR caused) → report approved and stop, naming any **Verification limitation:** lines and any CI failure attributed elsewhere. A conflict on a bare-LGTM PR still runs steps 7 through 9; step 7's merge re-review rule decides whether step 10 posts a trigger.

2. Fetch failing CI checks

One gh pr checks snapshot; never wait or poll. Buckets, failing detail, and cancelled-check attribution per fetch-recipes.md. Each fail-bucket check is one finding: CI Failure — <check name>.

3. Extract findings

Parse everything into atomic findings (split compound feedback, merge duplicates across sources noting all), tagged Needs Fixing (blocking; every CI Failure starts here), Requires Human Review (blocking), Recommended Optional (non-blocking), or Create Follow-up Issue (tracked separately; an issue this run files gets a complete body per github-issue-format, including a ## Plain simple English section under 55 words). Free-form feedback classifies by substance. A **Verification limitation:** line is never a finding.

4. Re-validate each finding

Trace every finding to current code and assign a verdict with your own file:line: ✅ Confirmed (fix it, step 6); ❌ Refuted (the claim or its remedy does not hold, or the cited code already changed → no change; record a code-grounded rebuttal); ⚠️ Partial (real but narrower or broader → fix the true part, note the correction); ❓ Judgment (a real tradeoff → derive and implement the best solution, below).

A ### Needs Fixing item's stated **Reachability:** precondition is part of its claim. On a code-grounded refutation of the trigger, the blocking status is refuted while the defect may still stand: re-route the finding to ### Recommended Optional, scope-test its remedy, and record it under ### Corrected scope (partial) in the disposition. A finding never re-routes on a likelihood judgment of your own; with no stated precondition it is validated as written.

Apply the validation discipline in red-flags-and-mistakes.md: whole-body reads, negative proofs, a suggested fix verified as its own claim, the safety carve-out (money, data integrity, security, auto-protective mechanisms: fix or escalate even at low confidence; a drop needs code proof), and CI-failure attribution (fix only failures this PR's diff caused).

Scope: the second axis on every finding

Scope says whether a real finding's remedy belongs in this PR. The yardstick: the issue(s) this PR closes (union of asks), else the PR body's stated scope. Classify each ✅/⚠️/❓ finding's remedy, except one the reviewer routed to ### Create Follow-up Issue, which is filed and never implemented; Rule 1 is that exclusion's only exception (the disposition says so). Apply in order; the first match decides:

  1. PR-caused — always in scope. The defect lives in code this PR adds or changes, or this PR creates the hazard → implement it, however much mechanism the fix needs; no later rule or step may reclassify it.
  2. New mechanism the yardstick never asked for — out of scope. The remedy introduces a mechanism the PR lacks (a new persistent store, lifecycle scheme, cross-cutting invariant, retry path, or subsystem) → file a follow-up issue, naming a deferred pre-existing hazard plainly.
  3. Everything else — in scope, including a pre-existing defect whose remedy needs no new mechanism.

Remedy size never decides scope, in either direction, and a reviewer's Recommended Optional carries no authority to enlarge the PR: same test, file the out-of-scope ones.

For every ❓ Judgment finding, do the analysis the reviewer could not and implement the result; never hand the tradeoff back. Derive the absolute-best solution per the CLAUDE.md/AGENTS.md rule (a Recommended proposed solution: line is verified like any remedy); record the decision, file:line reasoning, and rejected

阅读完整来源 ↗