phnx-labs/agents-cli/.agents/skills/cgraph/SKILL.md
cgraph
Use FIRST for any question about THIS codebase's structure, symbols, or relationships — where a function/class/file is defined, what calls or imports it, what breaks if you change it, how two parts connect, or to load focused source context before editing or reviewing. Routes to the cgraph MCP tools (graph_query / graph_explain / graph_impact / graph_path / graph_context), which serve ranked file:line results, node neighborhoods, transitive blast radius, and token-budgeted source bundles from a
- Source repository stars
- 13
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-05
- Source checked
- 2026-08-05
Decision brief
What it does—and where it fits
cgraph keeps a live, queryable graph of the current project — symbols (functions, classes, types, files), their call/import/inheritance/containment edges, and centrality ranking — served by a resident per-project daemon through MCP tools.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/phnx-labs/agents-cli --skill ".agents/skills/cgraph"Inspect the Agent Skill "cgraph" from https://github.com/phnx-labs/agents-cli/blob/2a7cf84f58b0ec8d9ba215ee95e288874b70419e/.agents/skills/cgraph/SKILL.md at commit 2a7cf84f58b0ec8d9ba215ee95e288874b70419e. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Setup (one-time — the tools don't exist until this is done)
This skill routes to the cgraph MCP server. On a cold checkout that server is not registered — until it is, the graph tools below don't exist and you should navigate with grep/read. Registration is a local, per-machine step (the .mcp.json it writes is gitignored, not committed),…
Build cgraph from source — it's a native C++ engine (CMake + vcpkg,Register the MCP server (project-scoped, absolute binary paths):Restart the agent session so it picks up the server. graphstatus should - 02
How to use the results
graphquery matches case-insensitively and can be narrowed with kind
graphquery matches case-insensitively and can be narrowed with kindEvery id-taking tool (graphexplain / graphimpact / graphpath /graphquery returns ids and sourcefile:line. Open the file at line - 03
Routing: question → tool
Review the “Routing: question → tool” section in the pinned source before continuing.
Review and apply the “Routing: question → tool” source section. - 04
Freshness-sensitive navigation
When a task must rely on the graph being current with the worktree — before impact analysis of a symbol you just moved, or after a batch of file edits — use the synchronize-then-pin pattern:
When a task must rely on the graph being current with the worktree — before impact analysis of a symbol you just moved, or after a batch of file edits — use the synchronize-then-pin pattern:graphupdate is a blocking content-verified barrier: it hashes every detected code file and re-extracts any whose content changed. The returned freshness.contentroot uniquely identifies that source snapshot. The response…Ordinary reads (without expectedcontentroot) do not scan the filesystem. They read the latest published snapshot and return its freshness metadata; during startup or for non-source seam graphs, freshness.verified can be… - 05
Session memory (survive /compact and /clear)
The daemon and graph.json live outside your context window, so a checkpoint written before a /compact or /clear is still recall-able afterward. Use this to carry the task thread across a context reset instead of losing it.
graphremember {title, body, touches?, tags?} — write one checkpoint. bodygraphrecall {query?, limit?} — return recent checkpoints newest-first, eachThe daemon and graph.json live outside your context window, so a checkpoint written before a /compact or /clear is still recall-able afterward. Use this to carry the task thread across a context reset instead of losing…
Permission review
Static risk signals and limitations
Reads files
The documentation asks the agent to read local files, directories, or repositories.
`graph_query` returns ids and `source_file`:`line`. Open the file at `line`Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 89/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 13 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- phnx-labs/agents-cli
- Skill path
- .agents/skills/cgraph/SKILL.md
- Commit
- 2a7cf84f58b0ec8d9ba215ee95e288874b70419e
- License
- Apache-2.0
- Collected
- 2026-08-05
- Default branch
- main
View the original SKILL.md
cgraph
cgraph keeps a live, queryable graph of the current project — symbols (functions, classes, types, files), their call/import/inheritance/containment edges, and centrality ranking — served by a resident per-project daemon through MCP tools.
Reach for these tools before grepping or reading files when a question is about code structure or relationships. A graph call is one ~10ms round-trip and returns exactly the file:line (and often the source) you need, instead of many grep/read calls that burn context.
Setup (one-time — the tools don't exist until this is done)
This skill routes to the cgraph MCP server. On a cold checkout that server is
not registered — until it is, the graph_* tools below don't exist and you
should navigate with grep/read. Registration is a local, per-machine step (the
.mcp.json it writes is gitignored, not committed), so a fresh clone needs it.
- Build cgraph from source — it's a native C++ engine (CMake + vcpkg,
C++20; on Linux
igraphalso needsgfortran). Full instructions: https://github.com/taylor009/CGraph → Install & Setup. This producescgraph,graphd,cgraph-client, andcgraph-mcp. - Register the MCP server (project-scoped, absolute binary paths):
agents mcp add cgraph -s project -a claude,codex -- \ /abs/path/to/cgraph-mcp --root "$(pwd)" --daemon /abs/path/to/graphd agents mcp register cgraph - Restart the agent session so it picks up the server.
graph_statusshould then answer, and the first query triggers a one-time build (seconds).
If the graph_* tools return "no such tool", registration hasn't happened —
fall back to grep/read and (if you can) run the steps above.
Routing: question → tool
| When the user / task needs… | Call |
|---|---|
| "Where is X? Find the symbol named …" | graph_query {query} — ranked by importance, each hit has source_file + line |
| "What is X? Show its callers/callees/imports" | graph_explain {id} — node + neighbors (each with direction and a navigable brief) + a source snippet |
| "What breaks if I change X? What depends on it?" | graph_impact {id, direction:"dependents"} — transitive blast radius, bounded by max_depth |
| "What does X rely on?" | graph_impact {id, direction:"dependencies"} |
| "How does A connect to B?" | graph_path {source, target} — shortest path, with path_nodes briefs |
| "Load context on X" / before editing or reviewing X | graph_context {query or id, budget} — focal node + most-relevant neighbors with snippets, packed to a token budget |
| "Verify the graph is current before I rely on it" | graph_update {path:"."} — blocking content-verified synchronization; returns freshness.content_root. Pin subsequent reads by passing the root as expected_content_root. |
| "Is the graph current? / I just changed files" | Nothing for ordinary reads — the daemon watches the tree and folds edits in within seconds. Use graph_update when you need a verified content_root to pin reads. |
How to use the results
graph_querymatches case-insensitively and can be narrowed withkind(e.g."function","class","file"),file(source-path substring), andlimit. On zero matches it returnssuggestions— the closest symbol names — so correct the spelling and retry instead of falling back to grep.- Every id-taking tool (
graph_explain/graph_impact/graph_path/graph_context) also accepts a bare symbol name (e.g."merge_fragments"); the response echoes the canonicalidit resolved. A miss comes back withfound: falseplussuggestions. graph_queryreturns ids andsource_file:line. Open the file atlinedirectly — no second search needed.graph_explaintakesdirection("in"= callers/importers,"out"= callees/imports) andlimit; neighbors are ordered most-important-first andneighbor_count/truncatedflag when a hub has more edges than returned.graph_contextis the highest-leverage call before an edit or review: ask for a budget (e.g.4000) and it returns the focal symbol's source plus its neighborhood's source, ranked and trimmed to fit. Read that instead of opening files one by one. It reportsomitted/truncatedif more existed.graph_contexthas two gather modes. The default (gather:"fixed") packs the whole k-hop neighborhood. When you have a task in hand, passgather:"adaptive"together with aquery— it keeps the full 2-hop core but expands the third hop only along query-relevant nodes. On the retrieval eval that lifted grade-2 recall by +0.057 for +13% candidate tokens, versus the +96% a full 3-hop gather costs. The relevance gate is a no-op without a query, so never sendadaptivewithout one. The response echoesgather:"adaptive",packing:"knapsack", and areachsummary ({candidates, expanded_past_core, gated_at_core}—expanded_past_core: 0means nothing relevant lay past the 2-hop core, so it collapsed to it). Raise or lowergather_thetato tighten or loosen the relevance threshold.graph_impactwithdependentsis the safety check before changing a signature or deleting a symbol: it lists everything that would be affected, by depth.
Freshness-sensitive navigation
When a task must rely on the graph being current with the worktree — before impact analysis of a symbol you just moved, or after a batch of file edits — use the synchronize-then-pin pattern:
1. update = graph_update {path: "."}
2. root = update.freshness.content_root
3. graph_query / graph_explain / graph_impact / graph_path / graph_context
{…, expected_content_root: root}
graph_update is a blocking content-verified barrier: it hashes every detected
code file and re-extracts any whose content changed. The returned
freshness.content_root uniquely identifies that source snapshot. The response
also reports files_hashed and bytes_hashed. Passing the root as
expected_content_root on a subsequent read pins the response to the same
snapshot; the daemon returns an
error instead of graph data if it has published a different root since then.
Ordinary reads (without expected_content_root) do not scan the filesystem. They
read the latest published snapshot and return its freshness metadata; during
startup or for non-source seam graphs, freshness.verified can be false. The
daemon keeps source-backed snapshots current through automatic file watching.
Use synchronization and a pin when you need proof that the graph matches specific
source content.
Session memory (survive /compact and /clear)
The daemon and graph.json live outside your context window, so a checkpoint
written before a /compact or /clear is still recall-able afterward. Use this
to carry the task thread across a context reset instead of losing it.
graph_remember {title, body, touches?, tags?}— write one checkpoint.bodyis a distilled markdown summary of what you did and what's next;toucheslists the code symbols (ids or bare names) the work concerns, so recall can link back to them. Persist only the distilled outcome — never raw tool output, DOM snapshots, or chain-of-thought.graph_recall {query?, limit?}— return recent checkpoints newest-first, each with its body and briefs of the code it touched. After a/clear, recall first (~KB payload) to restore the thread, thengraph_contexton a linked symbol to reload just-enough source.
The discipline is distill → checkpoint → clear → recall. Checkpoints are
inert to code analysis (they never shift query/impact/context rankings) and
survive daemon restart, incremental edits, and full rescans — the sidecars under
cgraph-out/memory/ are the durable source of truth.
Practicalities
- The
cgraphMCP server must be registered (it auto-spawns a per-project daemon keyed to the project root). The first tool call in a project triggers a one-time graph build (seconds), then queries are warm (~10ms). - While that first build runs, results carry
"graph_state": "building"— an empty result then means "not built yet", not "no match". Retry after a few seconds or pollgraph_statusuntilbuild_stateis"ready". - The daemon watches the project tree (
graph_statusreportswatching): file edits land in the graph automatically within a few seconds, and the graph is re-persisted in the background. - Fall back to grep/read only when cgraph genuinely has no answer — e.g. a string literal, a comment, a config value, or a file type cgraph does not extract. For symbols and their relationships, prefer the graph.
- cgraph indexes code structure deterministically. Prose/doc relationships
appear only if semantic enrichment fragments have been ingested; don't assume
documentation concepts are present unless
graph_statusshows enrichment.
Alternatives
Compare before choosing
coreyhaines31/marketingskills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
alirezarezvani/claude-skills
app-store-optimization
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
migrate-vstest-to-mtp
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
JasonColapietro/suede-creator-skills
suede-ab-testing
Suede-owned experimentation discipline for hypotheses, sample sizing, test duration, significance, and repeatable experiment programs. Use when comparing variants, deciding whether a result is reliable, or building an experiment backlog and cadence. NOT FOR: analytics instrumentation (use suede-analytics), post-click conversion diagnosis (use suede-site-alchemy), or writing the variant copy itself (use suede-copy).