Agent skill
graph-sync
[Code Intelligence] Sync the code review knowledge graph with current git state. Detects files changed since last sync via git diff and re-parses them. Runs automatically on session start; use manually after pulling code or switching branches.
Install this agent skill to your Project
npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/graph-sync
SKILL.md
Sync Graph
Sync the knowledge graph with the current git state by diffing last_synced_commit against HEAD.
When to Use
- After
git pull/git merge/git checkoutto update graph with new code - When you suspect the graph is stale (e.g., colleague pushed changes)
- After resolving merge conflicts
- Runs automatically on session start — manual invocation only needed mid-session
How It Works
- Reads
last_synced_commitfrom graph metadata - Gets current
HEADcommit hash - If same: graph is up to date, no action needed
- If different: runs
git diff --name-status {last}..{HEAD}to find changed/added/deleted files - Parses changed/added files, removes deleted files from graph
- Stores new HEAD as
last_synced_commit
Auto-Connect Behavior
After syncing changed files, the sync command automatically re-runs:
- API connector (
connect-api) — refreshes frontend-to-backend API endpoint edges - Implicit connector (
connect-implicit) — refreshes behavioral edges (MESSAGE_BUS, TRIGGERS_EVENT, PRODUCES_EVENT, TRIGGERS_COMMAND_EVENT)
This means after sync, ALL connections are up-to-date — not just direct code edges. If a new bus message producer was added in a synced file, the implicit connector will create MESSAGE_BUS edges to all matching consumers.
Steps
- Run sync (committed changes) via Bash:
bash
python .claude/scripts/code_graph sync --json - Report results: Files synced, added, modified, deleted
- If sync reports
full_rebuild_fallback(unreachable commit), inform user that a full rebuild was triggered - Run update (working tree changes) via Bash:
bash
python .claude/scripts/code_graph update --json - Report update results: Files updated from working tree, or "working tree clean"
Fallback Behavior
- No stored commit: First sync — scans for files on disk not in graph, adds them
- Unreachable commit (after rebase/force-push): Falls back to full rebuild automatically
- No git: Skips sync silently (non-git projects)
Important: Scope & Limitations
synconly detects committed changes (diffslast_synced_commitvs HEAD)- For uncommitted/staged changes, use
update --jsoninstead (detects working tree changes) - There is NO
incrementalsubcommand — useupdatefor incremental builds - There is NO
--filesflag onsync— it auto-detects changed files from git
sync vs update
| Command | Scope | Use When |
|---|---|---|
sync --json |
Committed changes only (last_synced_commit → HEAD) | After pull, merge, checkout |
update --json |
Working tree changes from base (default HEAD~1) | Staged/uncommitted changes, mid-session refresh |
Related Skills
/graph-update— Update graph with uncommitted working tree changes (explicitly invoked in step 4)/graph-build— Full or incremental graph build/graph-blast-radius— Analyze structural impact of changes/graph-query— Query code relationships
Closing Reminders
- MUST break work into small todo tasks using
TaskCreateBEFORE starting - MUST search codebase for 3+ similar patterns before creating new code
- MUST cite
file:lineevidence for every claim (confidence >80% to act) - MUST add a final review todo task to verify work quality
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fix-parallel
[Implementation] Analyze & fix issues with parallel fullstack-developer agents
ask
[Utilities] Answer technical and architectural questions.
claude-code
[Utilities] Claude Code CLI setup, configuration, troubleshooting, and feature guidance. Triggers on claude code setup, hook not firing, MCP connection, context limit, skill creation, slash command setup.
workflow-deployment
[Workflow] Trigger Deployment & Infrastructure workflow — CI/CD pipelines, Docker, Kubernetes setup and deployment.
workflow-idea-to-pbi
[Workflow] Trigger Idea to PBI workflow — po/ba workflow: capture idea, refine to pbi, create stories, prioritize.
easy-claude-help
[Utilities] Configuration guide for the easy-claude framework — explain settings, guide users through configuring .ck.json.
Didn't find tool you were looking for?