understand-diff

Analyzes git diffs against a knowledge graph to identify changed and affected components.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/AO-HyS/aohys.com --skill understand-diff-ao-hys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: understand-diff
Source: https://github.com/AO-HyS/aohys.com/tree/main/.agents/skills/understand-diff
Command: npx skills add https://github.com/AO-HyS/aohys.com --skill understand-diff-ao-hys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reviewing a pull request or branch diff without architectural context makes it hard to judge blast radius, spot cross-layer impacts, and prioritize what to review carefully. ## Core Features & Use Cases - Diff-to-Graph Mapping: Matches changed files from git diff to nodes in the knowledge graph at .understand-anything/knowledge-graph.json. - Impact Analysis: Traces 1-hop import and call edges to find upstream callers and downstream dependencies affected by the change. - Risk Assessment: Reports affected architectural layers, node complexity, and blast radius to guide review focus. - Dashboard Overlay: Writes a diff-overlay.json file so the understand-dashboard can visualize changed and affected components. - Use Case: Before merging a feature branch, run the analysis to see which layers and components your changes touch and which connected modules might break. ## Quick Start Ask the assistant to analyze the current branch diff against the knowledge graph and summarize the changed components, affected components, and risks.

Frequently Asked Questions about understand-diff

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze what a git diff affects in my codebase?▼

Run this analysis to map changed files from git diff to nodes in the knowledge graph, then trace import and call edges one hop out. The result lists changed components, affected components, touched layers, and a risk assessment.

How to assess pull request risk before merging?▼

Provide the PR number so the diff is fetched, then each changed file is matched against graph nodes. Risk is scored from node complexity values, cross-layer edges, and the number of affected components.

What happens if the knowledge graph file does not exist?▼

The analysis stops and instructs you to run /understand first to generate .understand-anything/knowledge-graph.json. The diff analysis depends entirely on that graph for node and edge lookups.

Can I visualize the diff impact in a dashboard?▼

Yes. After the analysis, a diff-overlay.json file is written to .understand-anything containing changed and affected node IDs. Run /understand-anything:understand-dashboard to view the overlay visually.

Does the diff analysis read the entire knowledge graph?▼

No. It uses grep to search for specific file paths and node IDs within the JSON, reading only the project metadata and matched sections. This keeps context usage low even for large graphs.