agentleFS
andrewthetechieandrewthetechie/andrew-skills/skills/pr-code-review/SKILL.md

pr-code-review

Skill4 starsChanged 4 months agoMITView on GitHub

Review a GitHub pull request URL or changes since a fixed point along two independent axes — repository standards and originating spec — using parallel sub-agents. Use for pull requests, branches, work-in-progress changes, or review since a commit, branch, tag, or merge-base.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run both axes as parallel sub-agents, then report them side by side.

    line 11
  2. Very specific:

    When closing_issue_count is positive, that spec artifact is the complete spec.

    line 29
  3. Very specific:

    Ask the user. If no spec exists, skip the Spec sub-agent and report no spec available.

    line 42
  4. Very specific:

    Run /setup-matt-pocock-skills if the legacy lookup needs docs/agents/issue-tracker.md and it is missing.

    line 44
  5. Distinctive:

    If the spec is missing, skip the Spec sub-agent and note this in the final report.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Review a change on two independent axes:

  • Standards — does the code conform to this repo's documented coding standards?
  • Spec — does the code faithfully implement the originating issue / spec?

Run both axes as parallel sub-agents, then report them side by side.

Process

1. Freeze the review context

For a GitHub pull request URL, run this exactly once:

<skill-directory>/scripts/gather-pr-context.sh '<pull-request-url>'

The command prints one compact manifest. Keep the large artifacts out of the parent context; pass their paths from the manifest to the sub-agents:

  • diff — the changes in the pull request.
  • commits — every pull-request commit.
  • spec — the title and description of every issue in GitHub's closing relationship.

When closing_issue_count is positive, that spec artifact is the complete spec. When it is zero, use the legacy spec lookup below.

For any other argument, preserve the fixed-point flow:

Whatever the user said is the fixed point — a commit SHA, branch name, tag, main, HEAD~5, etc. If they didn't specify one, ask for it.

Capture git diff <fixed-point>...HEAD and git log <fixed-point>..HEAD --oneline. Confirm the fixed point resolves and the diff is non-empty before continuing.

Legacy spec lookup:

  1. Issue references in commit messages (#123, Closes #45, etc.), fetched through docs/agents/issue-tracker.md.
  2. A path the user passed as an argument.
  3. A spec file under docs/, specs/, or .scratch/ matching the branch name or feature.
  4. Ask the user. If no spec exists, skip the Spec sub-agent and report no spec available.

Run /setup-matt-pocock-skills if the legacy lookup needs docs/agents/issue-tracker.md and it is missing.

This step is complete when the exact diff is frozen and the spec source is identified or explicitly absent.

2. Identify the standards sources

List every repository file that documents how code should be written, such as CODING_STANDARDS.md or CONTRIBUTING.md.

The Standards sub-agent must also read references/smell-baseline.md. A documented repository standard overrides the baseline; baseline smells are judgement calls.

This step is complete when every applicable standards-source path is listed.

3. Spawn both sub-agents in parallel

Give both sub-agents the frozen diff artifact path, or the fixed-point diff command, plus the commit-list path or command. They must inspect the artifacts themselves.

Standards prompt:

  • Include every standards-source path and the absolute path to references/smell-baseline.md.
  • Brief: "Report by file/hunk: (a) every documented-standard violation, citing the standards file and rule; (b) every baseline smell, naming it and quoting the hunk. Separate hard violations from judgement calls. Repository standards override the baseline. Skip checks enforced by tooling. Under 400 words."

Spec prompt:

  • Include the spec artifact or source path.
  • Brief: "Report: (a) missing or partial requirements; (b) scope creep; (c) requirements whose implementation looks wrong. Quote the spec for every finding. Under 400 words."

If the spec is missing, skip the Spec sub-agent and note this in the final report.

This step is complete when each applicable axis returns a report grounded in the same frozen diff.

4. Aggregate

Present the reports under ## Standards and ## Spec, verbatim or lightly cleaned. Keep their findings separate.

End with one line containing each axis's finding count and worst issue, if any. Do not choose a winner across axes.

Why two axes

A standards-compliant change can implement the wrong thing; a spec-compliant change can violate repository conventions. Separation keeps either axis from masking the other.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.