audit-pr
Use when asked to audit, review or check a pull request, whether a pull request is safe or "perfectly safe" to merge, whether it is completely finished, or to fix what a review found before merging.
reyxdz · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add reyxdz/going-dark --skill audit-pr技能说明
name: audit-pr description: Use when asked to audit, review or check a pull request, whether a pull request is safe or "perfectly safe" to merge, whether it is completely finished, or to fix what a review found before merging.
Audit a pull request
What this skill is for
You decide whether a pull request is perfectly safe to merge while keeping its purpose, and you fix what stops it, on its own branch. Then you report in a fixed format.
- Anything that needs even a little attention is fixed, not only reported.
- If the pull request is already fine, say so plainly. Never invent findings to look thorough.
- Being asked to audit is being asked to fix and push. You do not need to ask again before pushing fixes to the pull request's branch.
How to follow this file
- Do the steps in order, from Step 1 to Step 9. Do not skip a step. Do not change the order.
- Each step has three parts:
- Do — what to do. Commands are shown in code blocks. Replace every
<word in angle brackets>with the real value and remove the brackets. - Check — what must be true before you go on.
- If not — what to do when the check fails.
- Do — what to do. Commands are shown in code blocks. Replace every
- When this file says STOP, stop working, send the message it gives, and wait for the answer.
- Never invent a fact. Every finding must point to a file and the text in it, a command output, or the pull request's own words. For something that is missing (a promised job that is not in the diff), quote the words that promise it.
- When you cannot check something — no access, a command fails, a file is missing — do not guess. Write it under Not verified in the report, with why and how to check it, and go on.
- The project's own rules win. If a file you read in Step 1 says something
different from this file, do what the project says, and say so in the
report:
The project's rule "<quote>" replaced this skill's rule "<quote>". - Never merge the pull request, approve it, close it, or force-push. Only the owner merges.
Words used in this file
| Word | Meaning |
|---|---|
| owner | The person who merges pull requests. Step 1 shows how to find them. |
| base branch | The branch the pull request goes into, usually main. |
| head branch | The pull request's own branch. |
| fork | A pull request from someone else's copy of the repository. You usually cannot push to it. |
| scratch copy | A separate folder with its own checkout (a git worktree), outside the person's own folder. All your work happens there. |
| scratch folder | A folder outside the repository for temporary files. Use the one your tool gives you (a scratchpad or temp folder). If it gives none: /tmp/going-dark on macOS and Linux, %TEMP%\going-dark on Windows. |
| acceptance criteria | What the pull request must do, taken from its issue's "What to build" and "Verify" sections and its plan's phase. The pull request's description is a claim to check, not the specification. |
| finding | Anything that needs attention. Each finding gets one of: fixed, blocker, question, not worth holding. |
| blocker | A finding that makes the pull request unsafe to merge until it is fixed or decided. |
| behaviour fix | A fix that changes what runs: source code, SQL, migrations, config, scripts, CI. |
| records fix | A fix that changes only words: docs, plans, decision records, index tables, comments, the pull request description. |
| test fix | A fix that changes only test files: removing an unrelated test, making a test deterministic. It needs no extra test. |
| unsafe | Would fall under severity 1, 2 or 3 in Step 6: breaks the deploy or loses data, a security or privacy problem, or broken for users. |
| unrelated | Not needed for any acceptance criterion or anything the description promises. |
| small | All of these are true: under about 50 changed lines; no new dependency; no new table, column or migration; no new scheduled job, service, environment variable or setting; no new text users read that the owner has not approved; no product decision. |
| cosmetic | Changes nothing about behaviour, safety, data, accessibility, the accuracy of records, or what users read. Example: blank lines in code, word order in a code comment. |
| deployment skew | During a release, the new frontend may talk to the old backend (or the reverse) for a few minutes. Both must keep working. |
Step 1 — Read the pull request and its context
Do:
-
Get the latest state:
git fetch origin -
Read the pull request:
gh pr view <N> --json number,title,body,state,isDraft,isCrossRepository,baseRefName,headRefName,mergeable,files,commitsWrite down: its state, base branch, head branch, whether it is from a fork (
isCrossRepository), its files and its commit messages. -
Read the project's rule files, every one that exists:
git ls-files AGENTS.md CLAUDE.md GEMINI.md CONTRIBUTING.md .github/copilot-instructions.md .github/pull_request_template.md "docs/guides/*"Note: the owner (look for "owner", "maintainer", "only … merges"; also
.github/CODEOWNERS), the check commands, how migrations run, rules about releases and old clients, and any pull request check. -
Find the pull request check, if any: in
package.jsonunder"scripts", a name containingprorcheck; in.github/workflows/, a workflow that reads the pull request body. Write down its command, or "none". -
Read the issue it names (
Closes #<n>orPart of #<n>) and the plan that issue names:gh issue view <issue number> --comments git grep -l "#<issue number>" origin/<base branch> -- docs git show origin/<base branch>:<plan path>Write the acceptance criteria as a numbered list.
-
Choose the mode. Use the first rule that matches:
If Mode The state is CLOSED(not merged)STOP.