graph-sync
Installation
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 via 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
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-build— Full or incremental graph build/graph-blast-radius— Analyze structural impact of changes/graph-query— Query code relationships
Weekly Installs
2
Repository
duc01226/easyplatformGitHub Stars
6
First Seen
12 days ago
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
warp2