agentleFS
wzpersonwzperson/graph-engineering-skills/skills/graph-review/SKILL.md

graph-review

Skill1 starsChanged 4 months agoMITView on GitHub

Graph-aware code review: reviews a diff/PR on four lenses — code correctness, business-rule violations, shadow features, and temporal-integrity — by checking changed code against the project's domain graph (.graph/world.yaml) when one exists, and degrading gracefully to a disciplined code-layer review when it doesn't. Use this skill whenever the user asks to review code, review a PR or diff, check changes before merge, find bugs or logic problems in changes, audit a branch, or says "code review", "审查代码", "帮我 review", "看看这个 PR 有没有问题", "合并前检查一下", "找找逻辑问题". Companion to the graph-engineering skill (which builds the domain graph this one reviews against), but works standalone too.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. maxwellsdm1867/wheeler★ 12same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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. Very specific:

    Look for a domain graph: .graph/world.yaml (and .graph/research.md, AGENTS.md).

    line 30
  2. Very specific:

    If the diff touches .graph/ itself: run the project's own structural validation (the script graph-engineering places in the project's …

    line 72
  3. Very specific:

    Use the exact output format in references/output-format.md (read it before writing the report).

    line 93

≈ “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

Graph-Aware Code Review

<!-- 中文注释:四镜头审查。核心增量是领域层——把 world.yaml 里的业务规则 变成 review 时可对照的明文。没有图时降级为纪律化的代码层审查。 -->

Review changed code on four lenses. Traditional review checks "is the code right"; the domain lenses additionally check "is the code consistent with the business facts" — the class of defect that reads as clean code, passes tests, and is still wrong.

Step 1 — Establish scope and context

  1. Determine the diff under review: git diff main...HEAD (or the base branch / staged changes / PR the user names). List changed files.
  2. Look for a domain graph: .graph/world.yaml (and .graph/research.md, AGENTS.md). No graph → run lenses A only (plus the closing report), note in one line that domain lenses were skipped for lack of a graph, and move on — do not lecture about adopting one.
  3. From the graph, build the check map for this diff: every capability whose implemented_by paths intersect the changed files, every rule in those capabilities' guarded_by, and every relationship with temporal fields (valid_from/valid_to) whose entities the changed code touches. This map is your domain-review worklist; write it down before reading the diff so findings are checked against a list, not recalled from memory.

Step 2 — Four lenses

Lens A — Code correctness (always run). Logic errors, boundary conditions, null/None handling, always-true/always-false conditions, error-path behavior, concurrency and resource lifetimes, injection and authorization on new inputs, performance cliffs on hot paths. Read surrounding code, not just diff hunks — a correct-looking hunk can break an invariant maintained three lines outside the context window of the diff.

Lens B — Rule violations (graph required). For each rule in the check map, locate the code that enforces it AFTER the diff is applied. Three failure shapes to hunt: the guard was removed, the guard was weakened (bound changed, condition inverted, branch made unreachable), or a new path bypasses it (a new function reaches the guarded effect without going through the guard). Quote the rule id and statement in the finding.

Lens C — Shadow features (graph required). New externally-reachable behavior — endpoints, commands, public functions, scheduled jobs — that maps to no capability in the graph. Shadow features are not necessarily bad code; the defect is that they bypassed domain review, so no one has decided which rules should guard them. Also run the six-question check from the graph-engineering skill on the PR: if the diff introduces a new entity/relationship/event/rule/ capability or changes a meaning, and world.yaml is not updated in the same diff, flag it.

Lens D — Temporal integrity (graph required). For relationships and entities the graph marks with temporal fields: flag hard DELETEs or destructive UPDATEs where the graph's convention is supersession (close valid_to, insert new fact). Losing history silently breaks "what was true when we decided X" — that's why the graph marked the field temporal.

If the diff touches .graph/ itself: run the project's own structural validation (the script graph-engineering places in the project's scripts directory) and treat failures as findings.

Step 3 — Verify before reporting

For each candidate finding, attempt to refute it before it goes in the report: re-read the actual code (not your memory of it), check whether an enforcement lives elsewhere (middleware, DB constraint, calling layer), check tests that may prove intended behavior. Report only findings that survive, each with:

  • Severity: blocker (rule violation, data loss, exploitable) / major (logic error, shadow feature) / minor (edge case, hygiene)
  • Evidence: file:line plus, for domain findings, the graph node id
  • Fix: one concrete suggestion

False positives are the tax that makes teams ignore reviewers; a short verified list beats a long speculative one.

Step 4 — Report

Use the exact output format in references/output-format.md (read it before writing the report). Two hard requirements regardless of format details: findings grouped by the four lenses in severity order, and a closing "checked clean" list naming what was examined and found OK (rules verified enforced, no shadow features, temporal handling correct) — reviewers who only report problems leave silent gaps indistinguishable from unexamined areas.

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.