agentleFS
zitdevszitdevs/vault-skills/skills/cr/SKILL.md

cr

Skill0 starsChanged 3 months agoMITView on GitHub

Review a pull request the way the user reviews: understand the ticket before the diff, leave specific inline comments as suggestions, flag critical findings with an emoji, connect repetition across tickets, and close with a sandwich note in English. Use when asked to review a PR, review a diff, do a code review, or check someone's changes on any project.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before opening the diff:

    line 43
  2. Distinctive:

    Read the description and every comment.

    line 49
  3. Distinctive:

    If a ticket is referenced, open and study it.

    line 51
  4. Distinctive:

    When repetition appears, connect it to the backlog:

    line 117
  5. Very specific:

    Never end on --comment because the PR "felt" incomplete.

    line 188
  6. Very specific:

    If a note for that subsystem exists, update it — append to the relevant section and bump updated:.

    line 217
  7. Distinctive:

    Write for the person who picks up the next ticket here, having forgotten everything.

    line 225
  8. Distinctive:

    Never the detail. The detail is the vault's job, and two copies drift.

    line 234

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

/cr

Code review following the user's documented process, as recorded in their Obsidian vault.

The process itself lives in the vault, not here. This skill drives the mechanics — fetching the PR, walking files, posting comments. The standards come from the vault every run, so updating the vault updates this skill's behavior.

Usage

/cr <pr-url>
/cr <number> -R <org>/<repo>
/cr                          # current branch's PR

Step 0 — Load the standards

Invoke the brain skill with code review, or load directly:

"${CLAUDE_PLUGIN_ROOT}/skills/brain/find-notes.sh" 'topic/review'

Load the core process and the addendum for the entity this repo belongs to. Determine the entity from the repo owner — a repo under an employer or client GitHub org means that entity's addendum applies.

Also load topic/architecture and topic/testing; they are the standards the diff is being judged against.

Do not proceed without these. A review from generic defaults is exactly what this skill exists to prevent.

Step 1 — Understand the intent

Before opening the diff:

gh pr view <number> -R <org>/<repo> --json title,body,labels,author,reviews,statusCheckRollup,comments
  • Read the description and every comment.
  • Open the links in them.
  • If a ticket is referenced, open and study it. Prefer a dedicated skill or MCP for the tracker (Linear, Jira, Plane) over raw API calls when one is available.

Without this there is no standard to judge the diff against.

Step 2 — Read the existing comments

Before adding anything:

SituationAction
A comment already raises your point, unresolvedReact 👍 — do not duplicate it
Resolved, and the code changedNothing
Resolved, but no code change and no replyNote it in the final review

For the last case, state it plainly and without accusation. Resolving without changing is usually an oversight.

Step 3 — Walk the diff

gh pr diff <number> -R <org>/<repo>

File by file, tracking which are done so nothing is skipped on a long PR. Comments go inline, on the line they concern — never a vague summary note.

Inline comments may only target CHANGED lines

GitHub's review API accepts any line inside a diff hunk, including unchanged context lines. Nothing stops a comment landing on code the author never touched. Compute the allowed set instead of eyeballing it:

"${CLAUDE_PLUGIN_ROOT}/skills/cr/changed-lines.sh" <number> -R <org>/<repo>

It prints one path:line per added line, in new-file coordinates. Every inline comment must match an entry. If the line you want is not in that list, the finding belongs in the review body, not inline — see the vault note on findings about code the PR did not touch.

This is a gate, not a guideline. Check the target against the list before posting, every time.

Apply the checks from the vault's review note: any in TypeScript, weak types, redundant comments, missing comments where the code cannot stand alone, SOLID, DRY.

Findings relayed from a review bot follow the same gate. A bot reporting something outside the diff does not make it this author's problem — put it in the review body labeled as pre-existing, or leave it out.

For changes with real blast radius, do not stop at the diff. Read the related files in the codebase; a diff hides its own context.

Step 4 — Severity

  • Suggestion — the default. Inline, framed as a suggestion. The author decides.
  • Critical — marked with an emoji and raised in the review body, stated as required.

Framing everything as required makes the truly required invisible.

Step 5 — The cross-ticket pass

When repetition appears, connect it to the backlog:

  • Forward — a related upcoming ticket will need this: recommend building it reusable now, and name the ticket.
  • Backward — a previous ticket already did something similar: point the author at it.

This is the highest-value comment in the review. The author sees one ticket; the reviewer holds the backlog.

Step 6 — The final note

Short PR: LGTM. Do not manufacture feedback to look thorough.

Long PR: sandwich — a genuine positive opener, then the improvements as suggestions (with anything critical stated as required), then a positive close.

Human, friendly, professional.

Language: English always. The only exception is a PR that is entirely in Spanish. Any English in the PR means the review is in English.

Step 7 — Close with a verdict

A review must end with a decision. Comments alone leave the PR in limbo and the author waiting.

Diagnose CI before it influences anything

gh pr checks <number> -R <org>/<repo>

A red or pending check is not a verdict input until you know its cause. Open the failing job rather than reading the color.

CauseWhat to do
Not the author's doing — infra, tooling, unrecognized author, rate limits, queued runnerNote it as a check this in the review body, approve anyway
Caused by the change — real test failure, typecheck errorCritical → --request-changes

Also read the bot comments, not just their check status. A bot that reports success because it hit a usage limit reviewed nothing — that is a false green, and the review should say so instead of counting it as coverage.

Then check for a merge conflict — it gates the verdict:

gh pr view <number> -R <org>/<repo> --json mergeable,mergeStateStatus

mergeable is MERGEABLE, CONFLICTING, or UNKNOWN. GitHub computes it asynchronously, so UNKNOWN is not an answer — wait a moment and query again rather than treating it as clean.

SituationVerdict
Nothing to flag — clear LGTM--approve
Suggestions only, nothing critical--approve
Otherwise approvable, but CONFLICTING--comment asking for the conflict to be resolved. Do not approve yet
A critical finding requires changes--request-changes
Requesting changes and CONFLICTING--request-changes, with the conflict as a reminder line inside it

Suggestions do not block. If the code can ship, approve it — the suggestions ride along with the approval and the author decides. Withholding approval over a suggestion silently turns it into a requirement.

A conflict is not a finding about the code, it is a condition on the branch. It does not change what the review says, only when the approval lands. Approve once it is resolved.

Never end on --comment because the PR "felt" incomplete. Either something critical blocks it, a conflict is pending, or it ships.

Step 8 — Capture what the review taught

A review is the deepest read anyone gives that code. Losing it means relearning the same subsystem on the next ticket.

Filter first — most PRs teach nothing durable

Capture only when the PR reveals something that survives it:

  • A new subsystem, module, or capability
  • Non-obvious behavior the code does not explain about itself
  • A domain rule encoded in the code
  • A gotcha that will bite the next person
  • What a teammate is building here and why

Skip dependency bumps, typo and copy fixes, formatting, config tweaks, and pure refactors that introduce no new concept. Say "nothing durable to capture" and move on. A vault full of PR summaries is worse than one without them — noise makes the real notes harder to find.

One note per subsystem, never one per PR

"${CLAUDE_PLUGIN_ROOT}/skills/brain/find-notes.sh" '^repo: <repo-name>$'

If a note for that subsystem exists, update it — append to the relevant section and bump updated:. Only create one when the subsystem genuinely has none.

Notes live in <Entity>/Engineering/, are type: knowledge, and carry a repo: field. That entity's Engineering.md index lists the sections and what belongs in each — follow it rather than inventing a shape, and add the new note to it.

Write for the person who picks up the next ticket here, having forgotten everything. Not a diff summary — git has that, and better.

Then the Engram pointer — index, not content

Engram holds only what makes the vault note findable: the subsystem, the repo, one line on what it does, the vault path, and the domain terms a future ticket would use.

Never the detail. The detail is the vault's job, and two copies drift.

The payoff is the next ticket: Engram surfaces "there is a note on this", and the full context is one file read away.

Delegate this whole step to the learn skill when it is more than a small append — same rules, and it handles the wiring.

Posting

Draft the full review and show it before posting. Posting a review is outward-facing and visible to the team — confirm first, every time, including approvals.

# approve — clear LGTM, or suggestions that do not block
gh pr review <number> -R <org>/<repo> --approve --body-file <file>

# comment — otherwise approvable, but conflicted
gh pr review <number> -R <org>/<repo> --comment --body-file <file>

# request changes — only for a critical finding
gh pr review <number> -R <org>/<repo> --request-changes --body-file <file>

For a clear LGTM with nothing to add, --approve --body "LGTM" is the whole review. Do not manufacture comments to look thorough.

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.