codegraph-partner
Skill515 starsChanged 47 days agoMITView on GitHub
Use when the user explicitly mentions codegraph, asks structural code questions such as callers/callees/impact, asks where a symbol is defined, asks what breaks if a symbol changes, or asks for an architectural overview of a code repository. Skip for prose-only or vault-only questions.
- Installs packages
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- brain-memorySkill
- decision-model-setupSkill
- embeddings-setupSkill
- open-second-brainSkill
- schema-authorSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Run these checks in order.
- Distinctive: line 28
If neither cwd nor the user's named project is a code project, look at the vault's parent directory and inspect the top-level entries (one …
- Very specific: line 77
If the repo does not have a .gitignore, do not create one yourself.
- Distinctive: line 85
Use this table to pick the right tool for each kind of question.
- Distinctive: line 119
If the user says no, drop the topic for the rest of the session.
- Very specific: line 124
Do not call codegraph install, codegraph init, or codegraph index automatically.
- Very specific: line 126
Do not read or write .codegraph/codegraph.db.
- Distinctive: line 127
Do not mirror codegraph data into the Brain or the vault search index.
- Very specific: line 129
Do not modify ~/.claude.json, .cursor/rules/, or any other agent config on behalf of codegraph.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codegraph partner
OSB and codegraph are complementary, not overlapping. OSB owns the vault (Markdown prose, the Brain layer, preferences, paid-action audit). The codegraph CLI and its MCP server own the code-symbol graph of a repository - callers, callees, impact radius, AST. This skill teaches the agent to detect codegraph in the current scope and to use, recommend, or stay quiet about it, depending on what is actually nearby.
This skill never installs, initializes, or writes data for codegraph itself. Those actions stay in the user's hands or in codegraph's own installer.
Step 1 - detect
Run these checks in order. Stop at the first state that matches.
- CLI presence:
which codegraph(or, in Bun runtimes,Bun.which("codegraph")). - Code-project signal in the current working directory: a
.git/directory plus at least one ofpackage.json,pyproject.toml,Cargo.toml,go.mod,tsconfig.json,Gemfile,composer.json,build.gradle,pom.xml. - If neither cwd nor the user's named project is a code project, look at the vault's parent directory and inspect the top-level entries (one level only). Many users keep their repos as siblings of the vault. All discovered code projects are candidates, not just the first.
- Index state: a
.codegraph/directory inside the code project root. - Confirmed index:
codegraph status -j <project_path>returns{"initialized": true, ...}. The same command on an uninitialized project returns{"initialized": false, ...}rather than failing.
The structured way to ask is o2b doctor. When OSB is installed in the
workspace, the doctor report carries a code_graph line that summarises
the detection result with node count and file count.
Multi-project workspaces: when more than one code project is discovered,
the code_graph line covers EVERY project. Status is threaded per project
by passing each project's path to codegraph status, and the line
aggregates one entry per project (N code projects: followed by a bullet
per project naming its path and index state/health). This per-query
project-path threading is feature-detected: if the installed codegraph CLI
does not document a positional [path] argument for status, OSB cannot
trust per-project queries, so it degrades to reporting the first project
only and appends an explicit note: codegraph CLI has no per-query
project_path support - reported 1 of N discovered projects only. A
single-project workspace is unaffected and its line is unchanged.
Step 2 - branch on result
| State | Agent behaviour |
| ok (CLI present, indexed) | Use codegraph for AST and graph queries. No install talk. |
not_indexed (CLI present, no .codegraph/ or initialized: false) | Offer one line: "run codegraph init <path> to index this repo". Do not run it yourself unless the user asks. |
| missing + code project | Argued recommendation (Step 5). |
| missing + no code project in scope | Stay quiet. |
error (CLI present, status -j errors with a lock or schema issue) | Suggest codegraph unlock <path> or a rebuild, but do not run it. |
In a multi-project workspace the aggregate code_graph line can mix these
states across projects (one indexed, one not); read each bullet and act per
project. When the line ends with the note: ... project_path support marker,
only the first project was checked - query the others explicitly with
codegraph status <their_path> before trusting a single-project verdict.
Step 3 - hard rule after codegraph init
Whenever you run codegraph init in any repository on the user's
behalf, immediately read that repo's .gitignore and append a
.codegraph/ line if one is not already present. The append must be
atomic, must preserve the existing trailing newline policy, and must
not touch any other line.
If the repo does not have a .gitignore, do not create one yourself.
Tell the user the file is missing and that they should decide whether
to add it.
This rule exists so the local codegraph index never lands in a commit.
Step 4 - tool-vs-tool disambiguation
Use this table to pick the right tool for each kind of question. Do not duplicate a codegraph answer by also running a grep; treat its output as authoritative.
| Question shape | Tool |
| Where is symbol X defined? | codegraph_search |
| Who calls function Y? | codegraph_callers |
| What does Y call? | codegraph_callees |
| What would break if I change Z? | codegraph_impact |
| Show Y's signature or body. | codegraph_node |
| Survey several related symbols at once. | codegraph_explore |
| What files exist under path P? | codegraph_files |
| Prose, page bodies, MOC content, daily notes. | brain_search |
| Confirmed preferences, taste rules. | brain_query |
| Free-text fallback when neither index helps. | Plain grep, last resort. |
Step 5 - argued install recommendation
Trigger only when both conditions hold: there is a code project in the
current scope, and codegraph is not on the user's PATH.
Show the user a short paragraph that uses real numbers from their project, with no emoji and no marketing voice. Template:
Found a code project at
<path>with N source files. Without an index, every structural question (callers, impact, "where is X") spawns a grep+read loop that burns several thousand tokens per answer. codegraph keeps a SQLite knowledge graph and serves the same question in sub-millisecond time. Install it withnpm i -g @colbymchenry/codegraph(other options: https://github.com/colbymchenry/codegraph#1-install-the-cli). After install:codegraph init <path>from inside the repo.
If the user says no, drop the topic for the rest of the session. Do not nag.
Out of scope
- Do not call
codegraph install,codegraph init, orcodegraph indexautomatically. - Do not read or write
.codegraph/codegraph.db. - Do not mirror codegraph data into the Brain or the vault search index.
- Do not modify
~/.claude.json,.cursor/rules/, or any other agent config on behalf of codegraph.
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.

