Skip to content

Commit 2dac22f

Browse files
tae2089claude
andcommitted
docs: remove pgvector/MySQL references from README and skills
- README: remove pgvector feature, --graph flag, pgvector MCP config, MySQL from multi-DB list, architecture diagram updated - skills/ccg.md, .claude/skills/ccg.md: remove --graph subcommand, pgvector smart behavior section, sync both files to same content - Config examples updated: sqlite | postgres only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1b0d0ec commit 2dac22f

3 files changed

Lines changed: 33 additions & 118 deletions

File tree

.claude/skills/ccg.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ user-invocable: true
66

77
# code-context-graph CLI Skill
88

9-
A local code analysis tool that parses codebases via Tree-sitter into a knowledge graph with 15 language support, annotation-powered search, and pgvector semantic search.
9+
A local code analysis tool that parses codebases via Tree-sitter into a knowledge graph with 16 language support and annotation-powered search.
1010

1111
## Subcommands
1212

1313
| Command | Description | Example |
1414
|---------|-------------|---------|
1515
| `build [dir]` | Parse directory, build graph + search index | `ccg build .` |
16-
| `build --graph [dir]` | Build + sync to PostgreSQL + pgvector | `ccg build --graph .` |
16+
| `build --exclude <pat>` | Exclude files/paths (repeatable) | `ccg build --exclude vendor` |
17+
| `build --no-recursive [dir]` | Only parse top-level directory | `ccg build --no-recursive .` |
1718
| `update [dir]` | Incremental sync (changed files only) | `ccg update .` |
1819
| `status` | Show graph statistics (nodes/edges/files) | `ccg status` |
1920
| `search <query>` | FTS keyword search (includes @annotations) | `ccg search "authentication"` |
@@ -137,9 +138,6 @@ When the user asks about business concepts, use FTS search which includes annota
137138
138139
Example: user asks "결제 관련 코드" → `ccg search "결제"` finds functions annotated with payment-related @intent/@domainRule.
139140
140-
### Semantic search via pgvector MCP
141-
When FTS keyword search is insufficient (cross-language, fuzzy matching), use the pgvector MCP server for semantic similarity search. This requires PostgreSQL mode (`ccg build --graph`).
142-
143141
## Graph Schema
144142
145143
Node kinds: `function`, `class`, `type`, `test`, `file`

README.md

Lines changed: 9 additions & 35 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 16 languages, 18 MCP tools, custom annotation search, and pgvector semantic search.
3+
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 16 languages, 18 MCP tools, and custom annotation search.
44

55
Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph) — a Python-based code analysis tool. This project reimplements and extends the concept in Go with multi-DB support, custom annotation system, and MCP integration for AI-powered code understanding.
66

@@ -9,9 +9,8 @@ Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph)
99
- **16 languages**: Go, Python, TypeScript, Java, Ruby, JavaScript, C, C++, Rust, C#, Kotlin, PHP, Swift, Scala, Lua, Bash
1010
- **18 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, and more
1111
- **Custom annotations**: `@intent`, `@domainRule`, `@sideEffect`, `@mutates`, `@index` — search code by business context
12-
- **pgvector**: semantic similarity search via PostgreSQL pgvector extension
13-
- **Multi-DB**: SQLite (local), PostgreSQL, MySQL
14-
- **Full-text search**: FTS5 (SQLite), tsvector+GIN (PostgreSQL), FULLTEXT (MySQL)
12+
- **Multi-DB**: SQLite (local), PostgreSQL
13+
- **Full-text search**: FTS5 (SQLite), tsvector+GIN (PostgreSQL)
1514

1615
## Installation
1716

@@ -131,23 +130,6 @@ func AuthenticateUser(username, password string) (string, error) {
131130
| `@return` | Return description | `@return JWT token on success` |
132131
| `@see` | Related function | `@see SessionManager.Create` |
133132
134-
## PostgreSQL + pgvector (Semantic Search)
135-
136-
### Setup
137-
138-
```bash
139-
docker compose up pgvector -d
140-
```
141-
142-
### Build with pgvector sync
143-
144-
```bash
145-
PG_DSN="host=127.0.0.1 port=5455 dbname=ccg user=ccg password=ccg sslmode=disable" \
146-
ccg build --graph .
147-
```
148-
149-
This stores nodes, edges, and annotation content in PostgreSQL with pgvector, enabling semantic similarity search via the pgvector MCP server.
150-
151133
## Claude Code Integration
152134
153135
### MCP Server
@@ -160,19 +142,12 @@ Add `.mcp.json` to your project:
160142
"ccg": {
161143
"command": "ccg",
162144
"args": ["serve", "--db", "sqlite", "--dsn", "ccg.db"]
163-
},
164-
"pgvector": {
165-
"command": "npx",
166-
"args": ["-y", "mcp-pgvector-server"],
167-
"env": {
168-
"DATABASE_URL": "postgresql://ccg:ccg@localhost:5455/ccg"
169-
}
170145
}
171146
}
172147
}
173148
```
174149
175-
Claude Code automatically connects and gets access to 18 MCP tools + pgvector semantic search.
150+
Claude Code automatically connects and gets access to 18 MCP tools.
176151
177152
### Skill
178153
@@ -207,9 +182,9 @@ Claude: reads code → generates @intent, @domainRule, @sideEffect, @mutates
207182
Source Code → Tree-sitter Parser → Nodes + Edges + Annotations
208183
209184
SQLite / PostgreSQL (GORM)
210-
211-
FTS Search pgvector (semantic)
212-
185+
186+
FTS Search
187+
213188
MCP Server (18 tools)
214189
215190
Claude Code
@@ -220,7 +195,6 @@ Source Code → Tree-sitter Parser → Nodes + Edges + Annotations
220195
| Command | Description |
221196
|---------|-------------|
222197
| `ccg build [dir]` | Parse and build code graph |
223-
| `ccg build --graph [dir]` | Build + sync to PostgreSQL + pgvector |
224198
| `ccg build --exclude <pat>` | Exclude files/paths (repeatable) |
225199
| `ccg build --no-recursive [dir]` | Only parse top-level directory |
226200
| `ccg update [dir]` | Incremental sync |
@@ -244,7 +218,7 @@ Project-level defaults loaded automatically from the current directory:
244218
245219
```yaml
246220
db:
247-
driver: sqlite # sqlite | postgres | mysql
221+
driver: sqlite # sqlite | postgres
248222
dsn: ccg.db
249223

250224
exclude:
@@ -290,7 +264,7 @@ CGO_ENABLED=1 go test -tags "fts5" ./... -count=1
290264
# Build
291265
CGO_ENABLED=1 go build -tags "fts5" -o ccg ./cmd/ccg/
292266

293-
# Docker (PostgreSQL + pgvector + MySQL)
267+
# Docker (PostgreSQL)
294268
docker compose up -d
295269
```
296270

skills/ccg.md

Lines changed: 21 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: ccg
3-
description: code-context-graph CLI — build code knowledge graphs, search by annotations, generate documentation
3+
description: code-context-graph CLI — build code knowledge graphs, search by annotations, analyze with 18 MCP tools
44
user-invocable: true
55
---
66

@@ -13,23 +13,11 @@ A local code analysis tool that parses codebases via Tree-sitter into a knowledg
1313
| Command | Description | Example |
1414
|---------|-------------|---------|
1515
| `build [dir]` | Parse directory, build graph + search index | `ccg build .` |
16-
| `build --graph [dir]` | Build + sync to PostgreSQL + pgvector | `ccg build --graph .` |
1716
| `build --exclude <pat>` | Exclude files/paths (repeatable) | `ccg build --exclude vendor` |
1817
| `build --no-recursive [dir]` | Only parse top-level directory | `ccg build --no-recursive .` |
1918
| `update [dir]` | Incremental sync (changed files only) | `ccg update .` |
2019
| `status` | Show graph statistics (nodes/edges/files) | `ccg status` |
2120
| `search <query>` | FTS keyword search (includes @annotations) | `ccg search "authentication"` |
22-
| `search --path <prefix> <query>` | Scope search to file path prefix | `ccg search --path internal/auth "login"` |
23-
| `docs [--out dir]` | Generate Markdown documentation | `ccg docs --out docs/` |
24-
| `docs --exclude <pat>` | Exclude paths from docs (repeatable) | `ccg docs --exclude vendor` |
25-
| `index [--out dir]` | Regenerate index.md only | `ccg index --out docs/` |
26-
| `languages` | List all supported languages + extensions | `ccg languages` |
27-
| `example [language]` | Show annotation example for a language | `ccg example go` |
28-
| `tags` | Show all @tag reference with descriptions | `ccg tags` |
29-
| `hooks install` | Install pre-commit git hook | `ccg hooks install` |
30-
| `hooks install --lint-strict` | Install hook that blocks commit on lint issues | `ccg hooks install --lint-strict` |
31-
| `lint [--out dir]` | 8-category lint: orphan, missing, stale, unannotated, contradiction, dead-ref, incomplete, drift | `ccg lint --out docs/` |
32-
| `lint --strict` | Exit 1 on issues; ignore rules with `action: ignore` excluded from count | `ccg lint --strict` |
3321
| `annotate [file\|dir]` | AI-generate annotations for code | `ccg annotate internal/analysis/` |
3422

3523
## Execution
@@ -52,40 +40,13 @@ Show available commands:
5240

5341
```
5442
Available ccg commands:
55-
ccg build [dir] — Build code knowledge graph
56-
ccg update [dir] — Incremental update
57-
ccg status — Graph statistics
58-
ccg search <query> — Full-text search (annotations included)
59-
ccg docs [--out dir] — Generate Markdown documentation
60-
ccg index [--out dir] — Regenerate index.md only
61-
ccg languages — List supported languages
62-
ccg example [language] — Annotation writing example
63-
ccg tags — Annotation tag reference
64-
ccg hooks install — Install pre-commit git hook
65-
ccg lint [--out dir] — Detect orphan, missing, stale, unannotated
66-
ccg lint --strict — Same as lint, exit 1 on issues (CI/hooks)
67-
ccg annotate [file|dir] — AI-generate @annotations for code
43+
ccg build [dir] — Build code knowledge graph
44+
ccg update [dir] — Incremental update
45+
ccg status — Graph statistics
46+
ccg search <query> — Full-text search (annotations included)
47+
ccg annotate [file|dir] — AI-generate @annotations for code
6848
```
6949

70-
## Config File (.ccg.yaml)
71-
72-
Project-level defaults loaded automatically from the working directory:
73-
74-
```yaml
75-
db:
76-
driver: sqlite # sqlite | postgres | mysql
77-
dsn: ccg.db
78-
79-
exclude:
80-
- vendor
81-
- "*.pb.go"
82-
83-
docs:
84-
out: docs
85-
```
86-
87-
Override with `ccg --config path/to/.ccg.yaml`.
88-
8950
## Annotate Command
9051

9152
`ccg annotate` is NOT a CLI binary command — it is an AI-driven workflow executed by Claude.
@@ -153,26 +114,19 @@ func AuthenticateUser(username, password string) (string, error) {
153114
### Auto-rebuild when stale
154115
If `ccg.db` doesn't exist or the user asks to analyze the project, run `ccg build .` first.
155116
156-
### Suggest Cypher queries
157-
When the user asks graph-related questions, suggest and execute appropriate Cypher:
117+
### Use MCP tools for graph analysis
118+
When the user asks graph-related questions, use the 18 MCP tools via the ccg MCP server:
158119
159-
| User intent | Suggested Cypher |
160-
|-------------|------------------|
161-
| "What calls this function?" | `MATCH (a)-[:CALLS]->(b {name: 'X'}) RETURN a.qualified_name` |
162-
| "Impact of changing X" | `MATCH ({name: 'X'})-[*1..3]-(affected) RETURN DISTINCT affected.qualified_name` |
163-
| "Path from A to B" | `MATCH path = (a {name: 'A'})-[:CALLS*]->(b {name: 'B'}) RETURN path` |
164-
| "Dead code" | `MATCH (n:Function) WHERE NOT ()-[:CALLS]->(n) RETURN n.qualified_name` |
165-
| "Most called functions" | `MATCH ()-[:CALLS]->(n) RETURN n.name, count(*) AS c ORDER BY c DESC LIMIT 10` |
166-
| "Module dependencies" | `MATCH (a)-[:CALLS]->(b) WHERE a.file_path STARTS WITH 'X' RETURN DISTINCT b.file_path` |
167-
168-
### Token-efficient search
169-
Use `--path` to scope results to a module, reducing token load:
170-
171-
```bash
172-
ccg search --path internal/auth "login" # auth 모듈만
173-
ccg search --path internal/payment "charge" # payment 모듈만
174-
ccg search --path cmd/ "main" # CLI 진입점만
175-
```
120+
| User intent | MCP tool |
121+
|-------------|----------|
122+
| "What calls this function?" | `query_graph` (pattern: callers_of) |
123+
| "Impact of changing X" | `get_impact_radius` (depth: 3) |
124+
| "Dead code" | `find_dead_code` |
125+
| "Large functions" | `find_large_functions` |
126+
| "Module structure" | `list_communities` |
127+
| "Architecture overview" | `get_architecture_overview` |
128+
| "Test coverage gaps" | `get_community` (include coverage) |
129+
| "What changed?" | `detect_changes` |
176130
177131
### Annotation-aware search
178132
When the user asks about business concepts, use FTS search which includes annotation content:
@@ -184,23 +138,12 @@ When the user asks about business concepts, use FTS search which includes annota
184138
185139
Example: user asks "결제 관련 코드" → `ccg search "결제"` finds functions annotated with payment-related @intent/@domainRule.
186140
187-
### Multi-column Cypher
188-
When RETURN has multiple values, use `--columns N`:
189-
190-
```bash
191-
ccg query "MATCH (a)-[:CALLS]->(b) RETURN a.name, b.name" --columns 2
192-
```
193-
194141
## Graph Schema
195142
196-
Vertex labels: `Function`, `Class`, `Type`, `Test`, `File`
143+
Node kinds: `function`, `class`, `type`, `test`, `file`
197144
198-
Edge labels: `CALLS`, `IMPORTS_FROM`, `INHERITS`, `IMPLEMENTS`, `CONTAINS`, `TESTED_BY`, `DEPENDS_ON`, `REFERENCES`
145+
Edge kinds: `calls`, `imports_from`, `inherits`, `implements`, `contains`, `tested_by`, `depends_on`, `references`
199146
200-
Vertex properties: `node_id`, `qualified_name`, `name`, `kind`, `file_path`, `language`, `start_line`, `end_line`
201-
202-
## Supported Languages (16)
147+
## Supported Languages (15)
203148
204149
Go, Python, TypeScript, Java, Ruby, JavaScript, C, C++, Rust, C#, Kotlin, PHP, Swift, Scala, Lua, Bash
205-
206-
Run `ccg languages` for the full list with extensions.

0 commit comments

Comments
 (0)