Skip to content

Commit 07878b4

Browse files
committed
docs: align documentation with current CLI and MCP surface
1 parent bbe21b0 commit 07878b4

38 files changed

Lines changed: 312 additions & 1192 deletions

AGENTS.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ A local code analysis tool that parses codebases with Tree-sitter and builds a k
44

55
## MCP Server
66

7-
The ccg MCP server registered in `.mcp.json` provides 33 tools:
7+
The ccg MCP server registered in `.mcp.json` provides 17 tools:
88

99
- `parse_project`, `build_or_update_graph`, `run_postprocess`
10-
- `get_postprocess_policy`, `reset_postprocess_policy`
1110
- `get_node`, `search`, `query_graph`, `list_graph_stats`, `list_namespaces`, `get_minimal_context`
1211
- `get_impact_radius`, `trace_flow`
13-
- `find_large_functions`, `find_dead_code`
1412
- `detect_changes`, `get_affected_flows`, `list_flows`
15-
- `list_communities`, `get_community`, `get_architecture_overview`
1613
- `get_annotation`
17-
- `build_rag_index`, `get_rag_tree`, `get_doc_content`, `search_docs`, `retrieve_docs`
14+
- `get_doc_content`, `search_docs`
1815

1916
`ccg serve` is the local stdio MCP entry point. Self-hosted HTTP mode is provided by
2017
the separate `ccg-server` binary, which serves `/mcp`, `/health`, `/ready`, `/status`,
@@ -30,10 +27,10 @@ Graceful shutdown: SIGINT/SIGTERM propagates context cancellation to in-progress
3027
| Skill | Description |
3128
| ---------------- | ------------------------------------------------------------------- |
3229
| `/ccg` | Core build and search: parsing, graph build, query, search |
33-
| `/ccg-analyze` | Code analysis: impact radius, flow tracing, dead code, architecture |
30+
| `/ccg-analyze` | Code analysis: impact radius, flow tracing, and change risk |
3431
| `/ccg-annotate` | Annotation system: AI annotation workflow and tag reference |
35-
| `/ccg-docs` | Documentation: doc generation, RAG indexing, lint |
36-
| `/ccg-namespace` | Namespace file management: upload, list, delete |
32+
| `/ccg-docs` | Documentation: generation, DB-backed discovery, and lint |
33+
| `/ccg-namespace` | Namespace isolation for multi-project graph data |
3734

3835
Skill files are located under `skills/` and are written so coding agents such as Codex and Claude Code
3936
can use them as slash-command style workflows.
@@ -43,8 +40,7 @@ Main commands:
4340
- `ccg build [dir]` - build the code graph (supports `--exclude`, `--no-recursive`)
4441
- `ccg serve` - start the local MCP server over stdio
4542
- `ccg-server` - start the self-hosted HTTP MCP/webhook server
46-
- `ccg docs [--out dir]` - generate Markdown documentation and the default RAG index
47-
- `ccg rag-index [--out dir]` - build a RAG index from precomputed communities and generated docs
43+
- `ccg docs [--out dir]` - generate Markdown documentation and the Wiki compatibility index
4844
- `ccg search <query>` - full-text search (includes annotations)
4945
- `ccg lint [--strict]` - check documentation quality
5046
- `/ccg-annotate annotate [file|dir]` - AI annotation generation workflow
@@ -57,18 +53,18 @@ Use `.ccg.yaml` to manage project defaults such as exclude patterns and DB setti
5753
When looking for code locations, related implementations, call relationships, impact radius, or architecture context,
5854
use ccg MCP tools and Agent Skills first.
5955

60-
- For natural-language code understanding, module exploration, and architecture context, prefer the `/ccg-docs` skill: use `search_docs` to find relevant docs, then `get_doc_content` to read one (with `get_rag_tree` for module context).
56+
- For natural-language code understanding and module exploration, prefer the `/ccg-docs` skill: use `search_docs` to find relevant docs, then `get_doc_content` to read one.
6157
- For exact symbol locations, call relationships, and graph metadata, use ccg MCP `query_graph`, `get_node`, `get_minimal_context`, or the `/ccg` skill.
6258
- For annotation/keyword-based candidate search, use ccg MCP `search` or `ccg search` as a supplement.
63-
- For impact radius, flows, dead code, and structural analysis, prefer the `/ccg-analyze` skill and related MCP tools (`get_impact_radius`, `trace_flow`, `find_dead_code`, `get_architecture_overview`).
59+
- For impact radius, flows, and change-risk analysis, prefer the `/ccg-analyze` skill and related MCP tools (`get_impact_radius`, `trace_flow`, `detect_changes`, `get_affected_flows`).
6460
- For simple string checks, file existence checks, or cases where the ccg index is missing or stale, use `rg` as a supplement. If needed, refresh the graph with `ccg build .` or `ccg update .`.
6561

6662
## Documentation
6763

6864
See the `guide/` directory for detailed documentation:
6965

7066
- [CLI Reference](guide/cli-reference.md) - all commands, flags, and config files
71-
- [MCP Tools](guide/mcp-tools.md) - 33 MCP tools, Agent Skills, AI-Driven Annotation
67+
- [MCP Tools](guide/mcp-tools.md) - 17 MCP tools, Agent Skills, AI-Driven Annotation
7268
- [Annotations](guide/annotations.md) - annotation tags, examples, and search
7369
- [Webhook](guide/webhook.md) - webhook sync, branch filtering, HMAC, graceful shutdown
7470
- [Docker](guide/docker.md) - Docker builds, MCP server, PostgreSQL deployment

README.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# code-context-graph
22

3-
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 12 languages, 33 MCP tools, and custom annotation search.
3+
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 12 languages, 17 MCP tools, and custom annotation search.
44

55
CCG is built primarily for GPT, Claude, Codex, and other LLM-based coding agents. It acts as local or self-hosted context infrastructure: agents can search code by intent, inspect call graphs, trace impact, retrieve docs, and keep responses bounded instead of reading entire repositories into context.
66

@@ -11,12 +11,11 @@ Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph)
1111
## Features
1212

1313
- **12 languages**: Go, Python, TypeScript, Java, Ruby, JavaScript, C, C++, Rust, Kotlin, PHP, Lua/Luau
14-
- **33 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, postprocess operations, namespace file management, and more
14+
- **17 MCP tools**: parse, search, graph queries, impact analysis, flow tracing, change detection, documentation discovery, and more
1515
- **Evidence-driven code exploration**: DB-backed retrieval returns small file-level candidates with matched fields, evidence nodes, and optional docs before agents drill into exact graph nodes
1616
- **Browser Wiki UI**: `ccg-server` can serve generated docs, tree search, DB-backed retrieval, Context Tray copying, and an Obsidian-style graph viewer
1717
- **Custom annotations**: `@intent`, `@domainRule`, `@sideEffect`, `@mutates`, `@index` — search code by business context ([details](guide/annotations.md))
1818
- **Webhook sync**: GitHub / Gitea push events → auto clone + build with per-repo branch filtering and `.ccg.yaml` `include_paths` auto-loading ([details](guide/webhook.md))
19-
- **Eval**: Golden corpus-based parser accuracy (P/R/F1) and search quality (P@K, MRR, nDCG) evaluation ([details](guide/eval.md))
2019
- **Multi-DB**: SQLite (local), PostgreSQL
2120
- **Full-text search**: FTS5 (SQLite), tsvector+GIN (PostgreSQL)
2221

@@ -66,7 +65,7 @@ ccg search "authentication"
6665
# Search by business context
6766
ccg search "payment" # finds functions with @intent/@domainRule about payments
6867

69-
# Build docs and the default vectorless RAG index for agent-oriented exploration
68+
# Build generated docs and the browser Wiki compatibility index
7069
ccg docs --out docs
7170

7271
# Serve the browser Wiki UI from built assets; builds the graph for DB-backed APIs
@@ -82,22 +81,13 @@ ccg version
8281
ccg build ./backend --namespace backend
8382
ccg search --namespace backend "auth"
8483

85-
# Evaluate parser accuracy (12 languages)
86-
ccg eval --suite parser
87-
88-
# Update golden corpus
89-
ccg eval --suite parser --update
9084
```
9185

9286
`ccg docs` writes generated Markdown plus `.ccg/wiki-index.json` as a browser
9387
Wiki compatibility snapshot. The Wiki prefers the graph database for tree
9488
navigation and search, then uses `wiki-index.json` only when DB-backed
95-
navigation is unavailable. By default `ccg docs` also refreshes community
96-
structure and writes `.ccg/doc-index.json` as a compatibility snapshot for
97-
manual RAG-index workflows; runtime `search_docs` uses DB-backed graph and
98-
annotation evidence. Use `--rag=false` when you only want Markdown and the Wiki
99-
snapshot, or `--rag-refresh=false` when you want to rebuild the RAG index from
100-
existing community rows without recalculating communities.
89+
navigation is unavailable. Runtime `search_docs` uses DB-backed graph and
90+
annotation evidence; it does not depend on a separately generated retrieval index.
10191

10292
For LLM agents, use DB-backed `search_docs` as the first stop for broad
10393
natural-language questions such as "how does webhook sync work?" or "where are
@@ -140,9 +130,8 @@ Local development shortcut:
140130
make wiki-run
141131
```
142132

143-
Use `make wiki-run-indexed` when you also want generated Markdown,
144-
`wiki-index.json` snapshot, and the compatibility `doc-index.json` before
145-
starting the server.
133+
Use `make wiki-run-indexed` when you also want generated Markdown and the
134+
`wiki-index.json` compatibility snapshot before starting the server.
146135

147136
For self-hosted deployments, run `ccg-server --wiki-dir <dist-dir>` and protect
148137
`/wiki/api/*` with the same bearer token policy used for `/mcp`. See
@@ -262,7 +251,7 @@ server can also expose `/wiki` when `--wiki-dir` is configured:
262251
```
263252

264253
MCP-capable clients such as Codex or Claude Code can connect and get access to
265-
33 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
254+
17 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
266255

267256
## Architecture
268257

@@ -288,14 +277,12 @@ See [Architecture Details](guide/architecture.md) for component breakdown and DB
288277
|-------|-------------|
289278
| [Korean Guide](guide/ko/README.md) | 한국어 문서 인덱스 (Korean Documentation Index) |
290279
| [CLI Reference](guide/cli-reference.md) | All commands, flags, and config file (`.ccg.yaml`) |
291-
| [Eval](guide/eval.md) | Parser/search quality evaluation, golden corpus, and metrics |
292280
| [Lint](guide/lint.md) | Detailed `ccg lint` category reference, interpretation guide, and CI usage |
293-
| [MCP Tools](guide/mcp-tools.md) | 33 MCP tools, agent skills, AI-Driven Annotation |
281+
| [MCP Tools](guide/mcp-tools.md) | 17 MCP tools, agent skills, AI-Driven Annotation |
294282
| [Annotations](guide/annotations.md) | Annotation system — tags, examples, search |
295283
| [Webhook](guide/webhook.md) | Webhook sync, branch filtering, HMAC, graceful shutdown |
296284
| [Docker](guide/docker.md) | Docker build, MCP server, Wiki UI, PostgreSQL deployment |
297285
| [Operations](guide/operations.md) | Deployment profiles, database choice, readiness, webhook operations |
298-
| [Postprocess Failure Policy](guide/postprocess-failure-policy.md) | Status rules, failure causes, and automatic degraded/fail_closed policy for build and postprocess tools |
299286
| [Runtime Layout](guide/runtime-layout.md) | `ccg`, `ccg-server`, Wiki serving, and shared `ccg-core` ownership boundaries |
300287
| [Development](guide/development.md) | Dev guide, integration test, project structure |
301288
| [Namespace Migration](guide/namespace-migration.md) | Default namespace change and migration guide |

guide/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33
Documentation index for code-context-graph.
44

55
For LLM-agent workflows, start natural-language code exploration from the
6-
docs/RAG path: use `search_docs` to find relevant docs, then `get_doc_content`
6+
generated-docs path: use `search_docs` to find relevant docs, then `get_doc_content`
77
to read one. Treat these as an evidence-driven narrowing layer, not a Top1
88
search engine: use the small file-level candidates to choose the shortest route
99
into docs or graph tools.
1010

1111
The browser Wiki is served by `ccg-server` when `--wiki-dir` points at built
1212
React assets. It prefers the graph database for presentation, uses
1313
`wiki-index.json` as a compatibility tree snapshot, and uses `/wiki/api/graph`
14-
for the visual graph tab. Runtime retrieve mode uses DB-backed graph and
15-
annotation evidence. Use it when a human developer needs to browse docs,
14+
for the visual graph tab. Runtime documentation search uses DB-backed graph and
15+
annotation evidence. Use the Wiki when a human developer needs to browse docs,
1616
inspect annotation-rich symbol cards, collect Context Tray Markdown, or visually
1717
explore graph edges.
1818

1919
| Document | Description |
2020
|----------|-------------|
2121
| [CLI Reference](cli-reference.md) | Full CLI commands, options, and configuration file (`.ccg.yaml`) |
22-
| [Eval](eval.md) | Parser/search quality evaluation, golden corpus, and metrics |
2322
| [Lint](lint.md) | Detailed `ccg lint` category reference, interpretation guide, and CI usage |
24-
| [MCP Tools](mcp-tools.md) | 33 MCP tools, agent skills, evidence-first routing, AI-driven annotation |
25-
| [Annotations](annotations.md) | Custom annotation system — tags, examples, search/RAG quality |
23+
| [MCP Tools](mcp-tools.md) | 17 MCP tools, agent skills, evidence-first routing, AI-driven annotation |
24+
| [Annotations](annotations.md) | Custom annotation system — tags, examples, and search quality |
2625
| [Webhook](webhook.md) | GitHub / Gitea webhook sync, branch filtering, graceful shutdown |
2726
| [Docker](docker.md) | Docker image build, MCP server setup, Wiki UI deployment, PostgreSQL integration |
2827
| [Operations](operations.md) | Deployment profiles, database choice, readiness, webhook operations, troubleshooting |

guide/annotations.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Custom Annotations
22

3-
Add structured metadata to your code so that AI, generated docs, RAG, and
4-
focused search can leverage business context. Annotations are indexed for
5-
`ccg search` and are also rendered into generated Markdown that feeds the RAG
6-
index.
3+
Add structured metadata to your code so that AI, generated docs, and focused
4+
search can leverage business context. Annotations are indexed for `ccg search`
5+
and are also rendered into generated Markdown.
76

8-
For LLM-agent natural-language exploration, prefer the docs/RAG path first:
7+
For LLM-agent natural-language exploration, prefer the generated-docs path first:
98
`ccg docs`, then use MCP `search_docs` to find relevant docs and `get_doc_content`
10-
to read one (with `get_rag_tree` for module context). Use `ccg search` when you
9+
to read one. Use `ccg search` when you
1110
need a focused list of annotation/keyword-matched symbol candidates.
1211

1312
Annotation quality is validated by `ccg lint`. For category meanings such as `unannotated`, `incomplete`, `dead-ref`, `contradiction`, and `drifted`, see [Lint Guide](lint.md).

guide/architecture.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ pure incremental-update workflow only refreshes changed nodes, leaving
4949
untouched nodes without sub-tokens until they change.
5050

5151
Full builds and explicit postprocess runs rebuild namespace search state.
52-
Incremental updates refresh only affected search documents and FTS rows, while
53-
community postprocessing can still be namespace-wide. Persisted stored-flow
52+
Incremental updates refresh only affected search documents and FTS rows. Persisted stored-flow
5453
rebuild is implemented for full postprocess runs and explicit
5554
`run_postprocess(flows=true)` calls; use `trace_flow` for per-entry-point flow
5655
queries.
@@ -65,18 +64,9 @@ queries.
6564
| `query` | Graph queries (callers, callees, imports) |
6665
| `incremental` | Incremental update |
6766

68-
### Eval (`internal/eval/`)
69-
70-
Golden corpus-based parser accuracy and search quality evaluation framework.
71-
72-
- **Parser eval**: Parses 12-language source files and compares against golden JSON to compute Node/Edge P/R/F1
73-
- **Search eval**: Computes P@K, MRR, nDCG metrics for query corpus
74-
- **Golden update**: `--update` mode saves current parser output as golden files
75-
- **Corpus**: `testdata/eval/` directory with per-language sources + golden JSON + queries.json
76-
7767
### MCP Server (`internal/mcp/`)
7868

79-
Exposes 33 tools via MCP protocol. The local `ccg serve` command exposes these
69+
Exposes 17 tools via MCP protocol. The local `ccg serve` command exposes these
8070
tools over stdio. The self-hosted `ccg-server` binary exposes the same tool
8171
surface over Streamable HTTP and adds health/status/webhook endpoints.
8272

guide/claude-md-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ get_minimal_context ← always start here (graph state + recommended to
2525
│ → get_impact_radius(qualified_name: "...", depth: 3)
2626
│ → get_affected_flows(repo_root: ".")
2727
28-
├─ understand structure → get_architecture_overview()
29-
│ → list_communities()
28+
├─ understand structure → search_docs()
29+
│ → get_doc_content()
30+
│ → query_graph(file_summary)
3031
3132
└─ after code change → build_or_update_graph(path: ".", full_rebuild: false)
3233
```

0 commit comments

Comments
 (0)