graph-engineering
Skill1 starsChanged 4 months agoMITView on GitHub
Guide for applying current (2025-2026) graph engineering practice when building software with AI agents: domain graphs as a maintained repo artifact, code knowledge graphs, GraphRAG-family retrieval, temporal knowledge-graph memory, and agent-orchestration-as-graphs. Use this skill whenever the user wants to start a new project with domain modeling, build or maintain a knowledge graph or ontology, add graph-based retrieval (GraphRAG/LightRAG) over documents, give an agent long-term memory, do impact analysis before changing code, or asks about "graph engineering", "knowledge graph", "ontology", "world model", "domain model", "GraphRAG", "context graph", 图工程, 知识图谱, 领域建模, or 图驱动开发 — even if they don't say the word "graph" explicitly, trigger this when they ask to "model the domain first" or "understand the domain before coding".
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Jamie-BitFlight/claude_skillstheir own version, first seen Sep 23, 2026
- HM-Li/graph-engineeringtheir own version, first seen Aug 8, 2026
- vupercentmove/claude-skillstheir own version, first seen Aug 2, 2026
- luxiaolei/graph-engineeringtheir own version, first seen Jul 26, 2026
- codejunkie99/graph-engineeringtheir own version, first seen Jul 23, 2026
- Mark393295827/third-brain-v7-skillstheir own version, first seen May 22, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- codejunkie99/graph-engineering★ 538same name
- Mark393295827/third-brain-v7-skills★ 141same name
- Jamie-BitFlight/claude_skills★ 67same name
- HM-Li/graph-engineering★ 4same name
- luxiaolei/graph-engineering★ 2same name
- vupercentmove/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- graph-reviewSkill
- graph-testSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 7 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
If the user asks what graph engineering *is*, or which approach fits their situation, read references/landscape.md — it maps the 2026 …
- Very specific: line 46
Lightweight path (important): if the task is a small change to an existing project that already has a .graph/ directory — a bug fix, copy …
- Distinctive: line 55
Never model an unfamiliar domain from your priors alone.
- Distinctive: line 60
Search for: standard terminology of the domain, existing ontologies or industry schemas (schema.org, industry standards), how the top 2-3 …
- Very specific: line 66
Write the findings to .graph/research.md as a domain dossier: key concepts with definitions, disputed/ambiguous terms, constraints, and a …
- Distinctive: line 71
Keep it proportionate: a weekend tool needs a 20-line dossier.
- Very specific: line 76
Create .graph/world.yaml from templates/world.yaml (a fully worked example is in examples/world.example.yaml — read it before writing your …
- Very specific: line 96
Every entity/rule that came from research gets a source: field pointing to the dossier entry.
- Distinctive: line 101
Before implementing ANY feature or change, answer these six questions explicitly — in the plan, in the PR description, or aloud to the user:
- Very specific: line 137
Write nothing tool-specific into project artifacts: .graph/ is plain YAML/Markdown, so any agent (or human) can read it.
- Distinctive: line 144
Don't build a graph database (Neo4j etc.) for a domain graph under ~200 nodes — files in git are strictly better: diffable, reviewable, no …
- Distinctive: line 146
Don't run entity extraction over a whole corpus "to have a graph".
- Very specific: line 148
Don't create a multi-agent orchestration graph when a single agent loop solves it — this is the field's own hardest-won lesson (see …
- Distinctive: line 151
Don't let this skill turn a one-line fix into a ceremony.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Graph Engineering
<!-- 中文注释:本 skill 的核心立场 —— 图是被维护的工件,代码和上下文从图派生。
但不是所有任务都需要图:先分类,再选路线,小改动走轻量通道。 -->You are helping build software where a graph is a maintained artifact, and code, context, and agent behavior derive from it. This is the durable core of what the field calls "graph engineering" as of 2026. The term itself is young and contested; what matters is the practice, which splits into four distinct problem families. Route first, then work.
Step 0 — Route the task
Classify what the user actually needs. Most tasks need exactly ONE of these families; do not build all four.
| Family | Signal from the user | Where to go |
| A. Domain graph — model a business domain as source-of-truth for a project | "new project", "model the domain", "领域建模", requirements docs, UGIOS-style workflows | This file, Steps 1–4, plus references/domain-graph.md |
| B. Retrieval graph — answer questions over a document corpus | "RAG over our docs", "GraphRAG", corpus QA, "global questions across many files" | references/retrieval-and-memory.md |
| C. Memory graph — an agent that remembers across sessions | "agent memory", "remember users", facts that change over time | references/retrieval-and-memory.md |
| D. Orchestration graph — structure a multi-step agent system | "multi-agent", "workflow", "pipeline of agents", LangGraph | references/orchestration.md |
| E. Code graph — navigate/analyze an existing codebase | "who calls this", "impact of changing X", large unfamiliar repo | references/domain-graph.md § Code graphs |
If the user asks what graph engineering is, or which approach fits their
situation, read references/landscape.md — it maps the 2026 terminology
(graph engineering, context graphs, world models, ontology) with sources.
Lightweight path (important): if the task is a small change to an existing
project that already has a .graph/ directory — a bug fix, copy change, minor
feature — do NOT rerun the full pipeline. Run only the six-question impact check
in Step 3. If all six answers are "no", just make the change. A graph workflow
that taxes every one-line fix will be abandoned; protecting the lightweight path
is what keeps the graph alive.
Step 1 — Research before modeling (调研理解)
Never model an unfamiliar domain from your priors alone. Before creating any graph artifact:
- Use web search if available (Claude Code and Codex both may have it; if not, ask the user for source material instead — do not silently skip). Search for: standard terminology of the domain, existing ontologies or industry schemas (schema.org, industry standards), how the top 2-3 existing products in this space model the same concepts, and regulatory/business rules that constrain the domain.
- Interrogate what the user gave you — requirements docs, an existing codebase (reverse-engineer its implicit domain model), conversation history.
- Write the findings to
.graph/research.mdas a domain dossier: key concepts with definitions, disputed/ambiguous terms, constraints, and a source URL for every claim that came from the web. The dossier is what makes the graph auditable — a reviewer can trace every entity back to why it exists.
Keep it proportionate: a weekend tool needs a 20-line dossier; a compliance system needs a thorough one.
Step 2 — Build the domain graph
Create .graph/world.yaml from templates/world.yaml (a fully worked example is
in examples/world.example.yaml — read it before writing your first graph; the
example teaches more than the schema).
Modeling rules that current practice converged on (rationale in
references/domain-graph.md):
- Property-graph style, in plain YAML/Markdown — reviewable in a pull request, no graph database required. Reach for RDF/OWL only when you must interop with external ontologies.
- Entities, relationships, events, rules, capabilities are the five node classes. Model events and decisions as first-class nodes, not just static entities — "why did X happen" queries are what make the graph worth having (this is the "context graph" insight: record decisions, not just objects).
- Timestamps on facts that can change. For any relationship that can become
false (employment, pricing, status), add
valid_from/valid_toinstead of deleting — supersede, don't erase (bi-temporal pattern from Graphiti/Zep). - Start minimal, evolve incrementally. A 15-node graph that the team actually updates beats a 300-node graph that rots. Add nodes when a real feature needs them.
- Every entity/rule that came from research gets a
source:field pointing to the dossier entry.
Step 3 — Graph-driven change (the six questions)
Before implementing ANY feature or change, answer these six questions explicitly — in the plan, in the PR description, or aloud to the user:
- New entity?
- New relationship?
- New event?
- New rule (business rule / invariant / permission)?
- New capability (something the system can now do)?
- Changed meaning of anything already in the graph?
Any "yes" → update .graph/world.yaml in the SAME change set as the code, and
say which nodes changed. All "no" → the graph is untouched; implement directly.
The graph updates with the code, never "later" — a stale graph is worse than
no graph because agents will trust it.
Step 4 — Validate
- Structural checks (run whenever the graph changes): every relationship
endpoint names an existing entity; no duplicate IDs; every rule references at
least one entity or relationship; every research-derived node has a
source.references/domain-graph.md§ Validation has a ready-to-adapt Python check script and CI wiring — put it in CI so the graph can't silently rot. - Review checklist (before calling a milestone done): use the yes/no
checklist in
references/domain-graph.md§ Review. Answer each question with evidence, not vibes; "Architecture: ✓" is not a review.
Working across Claude Code and Codex
This skill follows the Agent Skills standard and runs unchanged in both tools:
- Claude Code:
~/.claude/skills/graph-engineering/(personal) or.claude/skills/(project) - Codex:
~/.codex/skills/graph-engineering/or the shared~/.agents/skills/location; invoke explicitly with$graph-engineeringif it doesn't auto-trigger
Write nothing tool-specific into project artifacts: .graph/ is plain
YAML/Markdown, so any agent (or human) can read it. Reference the graph from the
project's AGENTS.md / CLAUDE.md with three lines: where the graph lives, the
six-question rule, and where the dossier is.
What NOT to do
- Don't build a graph database (Neo4j etc.) for a domain graph under ~200 nodes — files in git are strictly better: diffable, reviewable, no infra.
- Don't run entity extraction over a whole corpus "to have a graph". Graphs are built to answer a class of questions; name the questions first.
- Don't create a multi-agent orchestration graph when a single agent loop
solves it — this is the field's own hardest-won lesson (see
references/orchestration.md). - Don't let this skill turn a one-line fix into a ceremony. Lightweight path exists; use it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

