agentleFS
Leo-AtienzaLeo-Atienza/atlas-claude/skills/_archived/graph-aware-review/SKILL.md

graph-aware-review

Skill4 starsChanged 4 months agoMITView on GitHub

Token-efficient code review using structural graph analysis and blast-radius computation. 8.2x average token reduction by reviewing only affected files instead of entire codebase. Use when: reviewing PRs, analyzing change impact, pre-merge checks, or user says 'review this PR', 'what does this change affect', 'blast radius'. Enhances CE-005 Code Review.

  • Installs packages

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before any code review, compute the blast radius:

    line 37
  2. Distinctive:

    Use community detection to understand module boundaries and flag cross-module changes that need extra scrutiny.

    line 49
  3. Distinctive:

    When reviewing code (local changes or PRs), prepend blast-radius analysis:

    line 53
  4. Distinctive:

    Read all changed files

    line 56
  5. Distinctive:

    Read changed files + affected dependents (minimal set)

    line 62
  6. Distinctive:

    Verify test coverage for affected paths

    line 65
  7. Distinctive:

    Keep the graph fresh with git hooks:

    line 112

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

Enhance code review with structural dependency analysis. Instead of reading the entire codebase, compute the minimal set of affected files through blast-radius analysis.

Prerequisites

pip install code-review-graph
code-review-graph install --platform claude
code-review-graph build  # Initial graph construction

Core Concept: Blast-Radius Analysis

Given a set of changed files, trace the dependency graph to find:

  1. Direct dependents — files that import/call changed code
  2. Transitive dependents — files affected through dependency chains
  3. Test coverage — which tests exercise the changed code
  4. Unaffected files — everything else (skip these entirely)

Result: In a 2,900-file project, typically ~15 files need review instead of scanning the full codebase.

Workflow

1. Build/Update Graph

code-review-graph build          # First time
code-review-graph build --update # Incremental (SHA256 change detection, <2s)

2. Compute Impact

Before any code review, compute the blast radius:

What changed? → Which files depend on changes? → Review only those files

3. Review with Context

For each affected file, the graph provides:

  • Why it's affected (which dependency chain)
  • What functions/classes are impacted
  • Related test files that should pass

4. Architecture Overview

Use community detection to understand module boundaries and flag cross-module changes that need extra scrutiny.

Integration with CE-005 Code Review

When reviewing code (local changes or PRs), prepend blast-radius analysis:

Before (standard review):

  1. Read all changed files
  2. Review each file
  3. Check for issues

After (graph-aware review):

  1. Compute blast radius of changes
  2. Read changed files + affected dependents (minimal set)
  3. Review with dependency context
  4. Flag cross-module impacts
  5. Verify test coverage for affected paths

MCP Tools (when installed as MCP server)

ToolPurpose
build_or_update_graphConstruct/refresh the structural graph
get_impact_radiusCompute blast radius for changed files
get_review_contextToken-optimized review summaries
query_graphStructural queries (callers, callees, tests)
semantic_search_nodesFind entities by name/meaning
detect_changesRisk-scored impact analysis
get_architecture_overviewCommunity-based architecture maps

Performance

MetricValue
Token reduction8.2x average (range 0.7x–16.4x)
Impact recall100% (never misses affected files)
Build latency95–128ms flow detection
Search latency0.4–1.5ms
Incremental update<2s for 2,900-file projects

Note: Single-file changes in small packages may show <1x efficiency (structural metadata overhead). Benefits compound on multi-file changes in larger codebases.

Language Support

19 languages + Jupyter notebooks:

  • Web: TypeScript/TSX, JavaScript, Vue
  • Backend: Python, Go, Java, Scala, Rust, PHP
  • Mobile: Kotlin, Swift, Dart
  • Systems: C/C++, Ruby
  • Other: R, Perl, Lua, Solidity

When to Use vs Standard Review

ScenarioUse Graph-Aware?
PR in a large codebase (100+ files)Yes — massive token savings
Multi-file refactorYes — dependency tracing essential
Single-file bug fix in small repoNo — overhead exceeds benefit
Architecture reviewYes — community detection helps
Security-sensitive changesYes — blast radius reveals attack surface

Auto-Update Hooks

Keep the graph fresh with git hooks:

code-review-graph hook install  # Adds post-commit and post-checkout hooks

File-save hooks trigger incremental updates, ensuring the graph reflects current code state.

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.