code-graph
Skill1 starsChanged 32 days agoApache-2.0View on GitHub
Read and record the project's code dependency graph with the `cg` CLI - C4 nodes, function contracts (CALLS edges), tasks, ADRs, the utility registry and EVAL verdicts. Use whenever you plan, implement or review code in a project that has a code_graph/ folder, before writing any helper/utility, before adding or changing a function another class calls, and whenever a cg command exits with code 3.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- kekzl/imptheir own version, first seen Nov 7, 2026
- FalkorDB/code-graphtheir own version, first seen Oct 8, 2026
- alinaqi/claude-bootstraptheir own version, first seen Oct 8, 2026
- handsontable/handsontabletheir own version, first seen Oct 8, 2026
- Manav1011/mcp-and-skillstheir own version, first seen Oct 8, 2026
- aniruddha-adhikary/skillstheir own version, first seen Aug 16, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- handsontable/handsontable★ 22ksame name
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- FalkorDB/code-graph★ 350same name
- kekzl/imp★ 77same name
- aniruddha-adhikary/skills★ 7same name
- valarpirai/code-graph★ 1same name
- kekzl/cplusplus-cuda-graph★ 0same name
- Manav1011/mcp-and-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 repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- c4-designSkill
- orchestrate-cycleSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Before writing a helper: cg util find <keywords>.
- Distinctive: line 36
Every command, with examples: reference/cli.md
“Common” is measured: kept by at least 6 in 10 of the 9 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
Code graph
The graph is the project ledger: C4 nodes (COMPONENT → SERVICE_CLASS → CLASS / INTERFACE / UTILITY_CLASS / CONFIG_CLASS), the function contracts between them, who is working on what, the ADRs behind changes, and review verdicts. Humans watch it live in the UI. Your job is to keep it true.
Run it
From the project root: python code_graph/cg.py <command> ... (prints JSON).
Shell state does not persist between tool calls, so pass identity on every mutating command:
--actor <your agent name> --task <task id> (add --adr <id> when an ADR authorises the change).
Exit codes
0ok ·2bad input or not found: fix the command and retry.3POLICY_VIOLATION: stop. Do not work around it. Followdetails.next_step(usually: propose an ADR), then escalate to the orchestrator with the ADR id anddetails.impacted.
Coder loop
cg task get <T>→cg task start <T> --actor <me>- For each node in the task:
cg node get <id> --brief(intent, extensibility, contract, calls in/out). - Before writing a helper:
cg util find <keywords>. Reuse any match. A new shared helper:cg util add. - For every call you implement between classes:
cg edge add CALLS <from> <to> --fn <name> --sig "<exact signature>" --purpose "<why>". For an existing contract, reuse its signature exactly. For a class realising an interface:cg edge add IMPLEMENTS <class> <interface>. For every shared type you import from another node without calling it (domain models, config classes):cg edge add USES <me> <type node>, so its blast radius is visible. cg node update <id> --path <file>::<Class> --loc <n> --complexity <1-10> --complexity-note "<why>", thencg node status <id> COMPLETED. Once its unit tests pass:TESTED.cg task done <T> --summary "<what changed>"
Reviewer loop
cg node get <id> · cg check · cg impact <id> → cg eval record <EVAL> --node <id> --verdict PASS|FAIL|WAIVED --notes "<evidence and fix>" --actor <me>
Never
- Change a node outside your task, a signature another class depends on, or the design after lock, without an ACCEPTED ADR. The tool enforces this and exits with code 3.
- Set a node to EVALUATED (orchestrator only; the tool blocks it while any EVAL is failing).
- Edit
code_graph.dbdirectly.
More
- Every command, with examples: reference/cli.md
- Node fields, lifecycle, edge rules, governance policies, checks and metrics: reference/data-model.md
- Seed JSON for bulk design import (orchestrator): reference/seed-format.md
- UI for humans:
cg serve --port 8770→http://127.0.0.1:8770/ui/(deep link#node=<id>)
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.

