SuperAPI AI Directory

auto-sync

Coding & development

View repository

Updated 10-16 06:14

About this skill

Auto-Sync the Graph

Self-Evolving Skill: This skill improves through use. If the hook behavior or --watch semantics drift — fix this file immediately, don't defer. Only update for real, reproducible issues.

Two mechanisms keep graphify-out/ in step with a changing corpus. They don't conflict — pick per repo temperament.

Prerequisite: engine installed (graphify-tools:setup) and an initial graph built (graphify-tools:build-graph).

Option A — post-commit git hook (recommended default)

cd <repo> && graphify hook install
  • Rebuilds the graph once per commit; no background process
  • Safe alongside existing hooks (appends, doesn't replace)
  • Worktree-per-branch note: git hooks live in the shared .git dir config; a hook installed in the main checkout fires for worktree commits too — install once per repo, not per worktree

Verify:

cat <repo>/.git/hooks/post-commit | grep -n graphify

Option B — live watch mode

graphify <target> --watch
  • Code file saves → instant AST-only rebuild (no LLM, no tokens)
  • Doc/image changes → notifies; run graphify <target> --update for the LLM re-pass
  • Runs in the foreground — launch it via a background Bash task or a dedicated terminal pane, NOT inline in a Claude session
  • Useful for multi-agent workflows where parallel agents write code and the graph must stay current between waves

Choosing

Situation Pick
Normal repo, commit-granularity freshness is fine Hook (A)
Active multi-agent session mutating files continuously Watch (B)
Both installed Fine — watch covers between-commit drift; hook covers sessions where watch isn't running

Teardown

# Watch: kill the foreground process
# Hook: remove the graphify stanza
sed -i '' '/graphify/d' <repo>/.git/hooks/post-commit

Post-Execution Reflection

After this skill completes, reflect before closing the task:

  1. Locate yourself. — Find this SKILL.md's canonical path before editing.
  2. What failed? — Fix the instruction that caused it.
  3. What worked better than expected? — Promote to recommended practice.
  4. What drifted? — Fix any script, reference, or dependency (esp. references/backends.md) that no longer matches reality.
  5. Log it. — Add a dated note to the plugin CLAUDE.md provenance with trigger, fix, and evidence.

Do NOT defer. The next invocation inherits whatever you leave behind.