Build, update, and query a persistent project knowledge graph from skills, memory, docs, and code structure — stdlib Python only, no external tools. Dual-mode: skill-library (agent-loom) or application (any consumer repo). Load when the user asks for a knowledge graph, project map, skill relationships, query the graph, update the graph, or trace how components connect. Auto-runs on memory-handoff and project-setup bootstrap. Also triggers on "build the graph", "what connects to X", "map this project".
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Build, update, and query a persistent project knowledge graph from skills, memory, docs, and code structure — stdlib Python only, no external tools. Dual-mode: skill-library (agent-loom) or application (any consumer repo). Load when the user asks for a knowledge graph, project map, skill relationships, query the graph, update the graph, or trace how components connect. Auto-runs on memory-handoff and project-setup bootstrap. Also triggers on "build the graph", "what connects to X", "map this project".
license
MIT
metadata
{"author":"dvy1987","version":"2.3","category":"project-specific","sources":"safishamsi/graphify patterns (native stdlib impl, no pip install)","resources":{"references":["schema.md","integration.md","examples.md"],"scripts":["build_graph.py","query_graph.py","graph_health.py"]}}
Knowledge Graph
You maintain a queryable project graph at docs/knowledge-graph/. Stdlib Python only — no Graphify, no pip deps, no external URLs in outputs.
Deployment Context
Host
Mode
Typical use
agent-loom (skill library)
skill-library
Map skill invoke chains, memory, handoffs
Any consumer project
application
Map modules, docs, memory for GRAPHIFY-style project management
Mode auto-detects from authoritative skill-library files: docs/skill-graph.mdanddocs/SKILL-INDEX.md → skill-library label; otherwise application. Both modes always perform a repo-wide scan — skills, all application source (any path), packages, config, docs, memory, directories. Never skills-only.
Hard Rules
Full repo, always.build_graph.py walks the entire repository for source files. .agents/skills/ is indexed as skills, not skipped — but application code in packages/, artifacts/, lib/, etc. must appear as module nodes.
Query before rebuild. Relational questions → query_graph.py first.
Authoritative > inferred.invokes from docs/skill-graph.md + SKILL-INDEX.mdCalls: lines are authoritative; references edges are hypotheses.
Shrink guard. No --force unless user confirms or graph is corrupt.
Handoff sync. Every memory-handoff → --incremental build.
No secrets. Skip .env, credentials, tokens by path name.
Common Rationalizations
Excuse
Reality
"I'll just grep"
Grep misses invoke chains and handoff lineage. Query the graph.
"Graph is stale, full rebuild"
Try --incremental first; authoritative sources may be unchanged.
Read GRAPH_INDEX.md and GRAPH_REPORT.md when present.
Step 2 — Build or update
python3 .agents/skills/knowledge-graph/scripts/build_graph.py # full repo scan
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --incremental # handoff/default
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --force # override shrink guard
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --strict # fail if source on disk but 0 modules
Stdout always prints: auto mode label, why that label was chosen, and scan layers (skills, code dirs, docs, memory). Read it before assuming skills-only — both modes scan the full repository.
Cite path, confidence, and provenance for every hit. routing_note in JSON output confirms authoritative-first ordering — prefer invokes edges from skill-graph.md over INFERRED heuristics when choosing skills.
Step 4 — Health audit (optional / validate-skills hook)
Build a knowledge graph for this project.
Ran `build_graph.py` → mode=skill-library, 120 nodes, 412 edges (164 authoritative invokes). Hubs: universal-skill-creator, validate-skills, secure-skill. Saved to `docs/knowledge-graph/`. See `GRAPH_REPORT.md` for communities and suggested questions.
How does memory-handoff connect to knowledge-graph?
`query_graph.py path memory-handoff knowledge-graph` → 1 hop via `invokes` [EXTRACTED, provenance: memory-handoff/SKILL.md]. Neighbors: memory-capture, agent-handoffs [recorded_in].
Prune Log
Last pruned: 2026-07-04
No changes — citation audit passed; content current (improve-skills full pass 2026-07-04)