You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -38,8 +38,9 @@ Graceful shutdown: SIGINT/SIGTERM 시 진행 중인 clone/build에 context cance
38
38
주요 커맨드:
39
39
40
40
-`ccg build [dir]` — 코드 그래프 빌드 (`--exclude`, `--no-recursive` 지원)
41
+
-`ccg docs [--out dir]` — 마크다운 문서 및 기본 RAG 인덱스 생성
42
+
-`ccg rag-index [--out dir]` — 이미 계산된 커뮤니티와 생성 문서 기반 RAG 인덱스 생성
41
43
-`ccg search <query>` — 전문 검색 (어노테이션 포함)
42
-
-`ccg docs [--out dir]` — 마크다운 문서 생성
43
44
-`ccg lint [--strict]` — 문서 품질 체크
44
45
-`ccg annotate [file|dir]` — AI 어노테이션 생성
45
46
@@ -49,17 +50,18 @@ Graceful shutdown: SIGINT/SIGTERM 시 진행 중인 clone/build에 context cance
49
50
50
51
코드 위치, 관련 구현, 호출 관계, 영향 범위, 아키텍처 맥락을 찾을 때는 먼저 ccg MCP 도구와 CLI Skills를 활용합니다.
51
52
52
-
- 의미 기반 검색과 관련 코드 탐색은 ccg MCP `search`, `query_graph`, `get_node`, `get_minimal_context` 또는 `/ccg` skill을 우선 사용합니다.
53
+
- 자연어 기반 코드 이해, 모듈 탐색, 아키텍처 맥락 수집은 `/ccg-docs` skill과 `retrieve_docs`, `get_rag_tree`, `get_doc_content`를 우선 사용합니다.
54
+
- 정확한 심볼 위치, 호출 관계, 그래프 메타데이터 확인은 ccg MCP `query_graph`, `get_node`, `get_minimal_context` 또는 `/ccg` skill을 사용합니다.
55
+
- 어노테이션/키워드 기반 후보 검색은 ccg MCP `search` 또는 `ccg search`를 보조로 사용합니다.
53
56
- 영향 범위, 플로우, 데드코드, 구조 분석은 `/ccg-analyze` skill과 관련 MCP 도구(`get_impact_radius`, `trace_flow`, `find_dead_code`, `get_architecture_overview`)를 우선 사용합니다.
54
-
- 문서/RAG 기반 맥락 검색은 `/ccg-docs` skill과 `search_docs`, `get_rag_tree`, `get_doc_content`를 우선 사용합니다.
55
57
- 단순 문자열 확인, 파일 존재 확인, ccg 인덱스가 없거나 오래된 경우에는 `rg`를 보조로 사용하고, 필요한 경우 `ccg build .` 또는 `ccg update .`로 그래프를 갱신합니다.
56
58
57
59
## 문서
58
60
59
61
상세 문서는 `guide/` 디렉토리를 참조하세요:
60
62
61
63
-[CLI Reference](guide/cli-reference.md) — 전체 명령어, 플래그, 설정 파일
Copy file name to clipboardExpand all lines: README.md
+20-4Lines changed: 20 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# code-context-graph
2
2
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, 35 MCP tools, and custom annotation search.
4
4
5
5
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.
6
6
@@ -11,7 +11,8 @@ Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph)
-**33 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, postprocess operations, namespace file management, and more
14
+
-**35 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, postprocess operations, namespace file management, and more
15
+
-**RAG-first code exploration**: generated docs + community structure let LLM agents answer natural-language questions before drilling into exact graph nodes
15
16
-**Custom annotations**: `@intent`, `@domainRule`, `@sideEffect`, `@mutates`, `@index` — search code by business context ([details](guide/annotations.md))
16
17
-**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))
17
18
-**Eval**: Golden corpus-based parser accuracy (P/R/F1) and search quality (P@K, MRR, nDCG) evaluation ([details](guide/eval.md))
@@ -60,6 +61,9 @@ ccg search "authentication"
60
61
# Search by business context
61
62
ccg search "payment"# finds functions with @intent/@domainRule about payments
62
63
64
+
# Build docs and the default vectorless RAG index for agent-oriented exploration
65
+
ccg docs --out docs
66
+
63
67
# Graph statistics
64
68
ccg status
65
69
@@ -77,6 +81,18 @@ ccg eval --suite parser
77
81
ccg eval --suite parser --update
78
82
```
79
83
84
+
`ccg docs` refreshes community structure and writes `.ccg/doc-index.json` by
85
+
default. Use `--rag=false` when you only want Markdown, or
86
+
`--rag-refresh=false` when you want to rebuild the index from existing community
87
+
rows without recalculating communities.
88
+
89
+
For LLM agents, treat generated docs and the RAG index as the primary entrypoint
90
+
for natural-language questions such as "how does webhook sync work?" or "where
91
+
are the operational risks?". Use graph tools for exact symbols, call relations,
92
+
impact radius, and pagination-safe result sets. Use `ccg search` as a focused
93
+
annotation/keyword candidate search rather than the first tool for broad code
94
+
understanding.
95
+
80
96
If you use PostgreSQL, a custom SQLite DSN, an existing schema, or a controlled
81
97
upgrade workflow, run `ccg migrate` explicitly before runtime commands. This
82
98
also applies when upgrading CCG against an existing default `ccg.db` created by
@@ -192,7 +208,7 @@ For remote HTTP mode:
192
208
}
193
209
```
194
210
195
-
Claude Code automatically connects and gets access to 33 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
211
+
Claude Code automatically connects and gets access to 35 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
196
212
197
213
## Architecture
198
214
@@ -223,7 +239,7 @@ See [Architecture Details](guide/architecture.md) for component breakdown and DB
223
239
|[CLI Reference](guide/cli-reference.md)| All commands, flags, and config file (`.ccg.yaml`) |
224
240
|[Eval](guide/eval.md)| Parser/search quality evaluation, golden corpus, and metrics |
225
241
|[Lint](guide/lint.md)| Detailed `ccg lint` category reference, interpretation guide, and CI usage |
Copy file name to clipboardExpand all lines: guide/annotations.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,14 @@
1
1
# Custom Annotations
2
2
3
-
Add structured metadata to your code so that AI and search can leverage business context. Annotations are indexed and searchable via `ccg search`.
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.
7
+
8
+
For LLM-agent natural-language exploration, prefer the docs/RAG path first:
9
+
`ccg docs`, then MCP `retrieve_docs`, `get_rag_tree`, and `get_doc_content`.
10
+
Use `ccg search` when you need a focused list of
11
+
annotation/keyword-matched symbol candidates.
4
12
5
13
Annotation quality is validated by `ccg lint`. For category meanings such as `unannotated`, `incomplete`, `dead-ref`, `contradiction`, and `drifted`, see [Lint Guide](lint.md).
For the default local SQLite database (`ccg.db`, including `./ccg.db`, absolute paths ending in `ccg.db`, and `file:` DSNs for that file), runtime commands auto-run migrations only when the schema is missing. Existing SQLite schemas, PostgreSQL, custom SQLite DSNs, and controlled upgrades require an explicit `ccg migrate`. If you already have a default `ccg.db` from an older CCG version, treat it as an existing schema and run `ccg migrate` after upgrading.
| Impact analysis, flow tracing, dead code, large functions | MCP analysis tools such as `get_impact_radius`, `trace_flow`, `find_dead_code`, `find_large_functions`|
78
+
| Focused annotation/keyword candidate search |`ccg search` or MCP `search`|
79
+
80
+
For coding agents, the recommended natural-language path is:
81
+
82
+
```bash
83
+
ccg build .
84
+
ccg docs --out docs
85
+
```
86
+
87
+
`ccg docs` refreshes community structure and writes the default
88
+
`.ccg/doc-index.json` RAG index unless `--rag=false` is set. Use
89
+
`--rag-refresh=false` only when you intentionally want to reuse existing
90
+
community rows. The standalone `ccg rag-index` command remains available for
91
+
manual rebuilds from generated docs and already-computed communities.
92
+
93
+
Then use MCP `retrieve_docs` to retrieve document candidates and bounded
94
+
Markdown content with tree evidence. Use `get_rag_tree` to expand the
95
+
module/community context and `get_doc_content` to read a specific generated doc
96
+
directly. `search_docs` and `ccg search` remain useful for quick keyword or
97
+
annotation matches, but they should not be treated as the primary answering
98
+
surface for broad natural-language questions.
99
+
66
100
### Database Choice
67
101
68
102
Use SQLite for local, single-user workflows where the database is a disposable
Copy file name to clipboardExpand all lines: guide/ko/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,15 @@ code-context-graph의 문서 인덱스입니다. 한국어 문서는 영어 가
6
6
7
7
CCG는 GPT, Claude, Codex 같은 LLM 기반 코딩 에이전트가 개발 중 코드베이스 맥락을 정확하고 작게 가져오도록 만든 로컬/셀프호스트 context infrastructure입니다. 일반 SaaS 관리자용 제품이 아니라, CLI, MCP, 로그, 문서를 이해하는 개발자와 코딩 에이전트가 코드 검색, 영향 분석, 호출 그래프, 문서/RAG, bounded response를 활용하도록 설계되었습니다.
8
8
9
+
LLM 에이전트 워크플로우에서는 자연어 기반 코드 탐색을 생성 문서와 RAG 인덱스에서 시작하십시오. 관련 모듈, 문서 또는 심볼 후보를 찾은 뒤 graph/search 도구로 정확한 위치와 관계를 확인하는 흐름을 권장합니다.
10
+
9
11
| 문서 | 설명 |
10
12
|------|------|
11
13
|[CLI 레퍼런스](cli-reference.md)| 모든 CLI 명령어, 옵션 및 설정 파일(`.ccg.yaml`) 안내 |
12
14
|[Eval](eval.md)| 파서/검색 품질 평가, golden corpus, 지표 설명 |
13
15
|[Lint](lint.md)|`ccg lint` 카테고리 상세 레퍼런스, 결과 해석 및 CI 활용법 |
14
-
|[MCP 도구](mcp-tools.md)|33개의 MCP 도구, Claude Code Skill, AI 기반 어노테이션 |
15
-
|[어노테이션](annotations.md)| 커스텀 어노테이션 시스템 — 태그, 예시, 검색 방법|
16
+
|[MCP 도구](mcp-tools.md)|35개의 MCP 도구, Claude Code Skill, RAG 우선 라우팅, AI 기반 어노테이션 |
17
+
|[어노테이션](annotations.md)| 커스텀 어노테이션 시스템 — 태그, 예시, 검색/RAG 품질|
Copy file name to clipboardExpand all lines: guide/ko/annotations.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
[English](../annotations.md)
4
4
5
-
코드에 구조화된 메타데이터를 추가하여 AI와 검색 엔진이 비즈니스 컨텍스트를 활용할 수 있도록 합니다. 어노테이션은 인덱싱되어 `ccg search`를 통해 검색할 수 있습니다.
5
+
코드에 구조화된 메타데이터를 추가하여 AI, 생성 문서, RAG, 집중 검색이 비즈니스 컨텍스트를 활용할 수 있도록 합니다. 어노테이션은 `ccg search`를 위해 인덱싱되며, RAG 인덱스의 입력이 되는 생성 Markdown에도 반영됩니다.
6
+
7
+
LLM 에이전트의 자연어 기반 코드 탐색에는 docs/RAG 경로를 먼저 사용하십시오. `ccg docs`를 실행한 뒤 MCP `retrieve_docs`, `get_rag_tree`, `get_doc_content`를 사용합니다. `ccg search`는 어노테이션/키워드에 매칭되는 심볼 후보 목록이 필요할 때 사용하십시오.
6
8
7
9
어노테이션 품질은 `ccg lint`에 의해 검증됩니다. `unannotated`, `incomplete`, `dead-ref`, `contradiction`, `drifted`와 같은 카테고리의 의미는 [Lint 가이드](lint.md)를 참조하십시오.
0 commit comments