@tastehub/ckb-darwin-arm64 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/LICENSE +40 -0
- package/bin/README.md +388 -0
- package/bin/ckb +0 -0
- package/package.json +9 -0
package/bin/LICENSE
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
CKB License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SimplyLiz
|
|
4
|
+
|
|
5
|
+
PERSONAL USE LICENSE
|
|
6
|
+
|
|
7
|
+
This software is free to use for personal, non-commercial purposes.
|
|
8
|
+
|
|
9
|
+
ENTERPRISE/COMMERCIAL USE
|
|
10
|
+
|
|
11
|
+
Commercial use, including but not limited to use by corporations, businesses,
|
|
12
|
+
government entities, or any organization generating revenue, requires a
|
|
13
|
+
separate commercial license.
|
|
14
|
+
|
|
15
|
+
To acquire a commercial license: Licensing information coming soon.
|
|
16
|
+
|
|
17
|
+
TERMS
|
|
18
|
+
|
|
19
|
+
1. PERSONAL USE: Individuals may use, copy, and modify this software for
|
|
20
|
+
personal, non-commercial projects at no cost.
|
|
21
|
+
|
|
22
|
+
2. COMMERCIAL USE PROHIBITED WITHOUT LICENSE: Any use of this software by
|
|
23
|
+
or for commercial entities, including internal business tools, products,
|
|
24
|
+
or services, requires a paid commercial license.
|
|
25
|
+
|
|
26
|
+
3. REDISTRIBUTION: Redistribution of this software, with or without
|
|
27
|
+
modification, must retain this license notice and is limited to
|
|
28
|
+
non-commercial purposes unless a commercial license is obtained.
|
|
29
|
+
|
|
30
|
+
4. NO WARRANTY: This software is provided "as is", without warranty of any
|
|
31
|
+
kind, express or implied. The authors are not liable for any damages
|
|
32
|
+
arising from its use.
|
|
33
|
+
|
|
34
|
+
5. DEFINITION OF COMMERCIAL USE: Commercial use includes, but is not limited to:
|
|
35
|
+
- Use by any for-profit organization
|
|
36
|
+
- Use by employees or contractors on behalf of a commercial entity
|
|
37
|
+
- Integration into commercial products or services
|
|
38
|
+
- Use to generate revenue directly or indirectly
|
|
39
|
+
|
|
40
|
+
For licensing inquiries: https://github.com/SimplyLiz/CodeMCP/issues
|
package/bin/README.md
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
# CKB — Code Knowledge Backend
|
|
2
|
+
|
|
3
|
+
**The missing link between your codebase and AI assistants.**
|
|
4
|
+
|
|
5
|
+
CKB gives AI assistants deep understanding of your code. Instead of grepping through files, your AI can now *navigate* code like a senior engineer—with knowledge of who owns what, what's risky to change, and how everything connects.
|
|
6
|
+
|
|
7
|
+
> CKB analyzes and explains your code but never modifies it. Think of it as a librarian who knows everything about the books but never rewrites them.
|
|
8
|
+
|
|
9
|
+
## The Problem
|
|
10
|
+
|
|
11
|
+
### AI Assistants Are Blind to Code Structure
|
|
12
|
+
|
|
13
|
+
When you ask an AI "what calls this function?", it typically:
|
|
14
|
+
1. Searches for text patterns (error-prone)
|
|
15
|
+
2. Reads random files hoping to find context (inefficient)
|
|
16
|
+
3. Gives up and asks you to provide more context (frustrating)
|
|
17
|
+
|
|
18
|
+
### Existing Tools Don't Talk to Each Other
|
|
19
|
+
|
|
20
|
+
Your codebase has valuable intelligence scattered across SCIP indexes, language servers, git history, and CODEOWNERS files. Each speaks a different language. None are optimized for AI consumption.
|
|
21
|
+
|
|
22
|
+
### Context Windows Are Limited
|
|
23
|
+
|
|
24
|
+
Even with 100K+ token context, you can't dump your entire codebase into an LLM. You need relevant information only, properly compressed, with smart truncation.
|
|
25
|
+
|
|
26
|
+
## What CKB Gives You
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
You: "What's the impact of changing UserService.authenticate()?"
|
|
30
|
+
|
|
31
|
+
CKB provides:
|
|
32
|
+
├── Symbol details (signature, visibility, location)
|
|
33
|
+
├── 12 direct callers across 4 modules
|
|
34
|
+
├── Risk score: HIGH (public API, many dependents)
|
|
35
|
+
├── Affected modules: auth, api, admin, tests
|
|
36
|
+
├── Code owners: @security-team, @api-team
|
|
37
|
+
└── Suggested drilldowns for deeper analysis
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
You: "Show me the architecture of this codebase"
|
|
42
|
+
|
|
43
|
+
CKB provides:
|
|
44
|
+
├── Module dependency graph
|
|
45
|
+
├── Key symbols per module
|
|
46
|
+
├── Module responsibilities and ownership
|
|
47
|
+
├── Import/export relationships
|
|
48
|
+
└── Compressed to fit LLM context
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
You: "Is it safe to rename this function?"
|
|
53
|
+
|
|
54
|
+
CKB provides:
|
|
55
|
+
├── All references (not just text matches)
|
|
56
|
+
├── Cross-module dependencies
|
|
57
|
+
├── Test coverage of affected code
|
|
58
|
+
├── Hotspot risk assessment
|
|
59
|
+
└── Breaking change warnings
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Quick Start
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# 1. Build
|
|
66
|
+
git clone https://github.com/SimplyLiz/CodeMCP.git
|
|
67
|
+
cd CodeMCP
|
|
68
|
+
go build -o ckb ./cmd/ckb
|
|
69
|
+
|
|
70
|
+
# 2. Initialize in your project
|
|
71
|
+
cd /path/to/your/project
|
|
72
|
+
/path/to/ckb init
|
|
73
|
+
|
|
74
|
+
# 3. Generate index (Go example)
|
|
75
|
+
go install github.com/sourcegraph/scip-go/cmd/scip-go@latest
|
|
76
|
+
scip-go --repository-root=.
|
|
77
|
+
|
|
78
|
+
# 4. Connect to Claude Code
|
|
79
|
+
claude mcp add --transport stdio ckb -- /path/to/ckb mcp
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Now Claude can answer questions like:
|
|
83
|
+
- *"What calls the HandleRequest function?"*
|
|
84
|
+
- *"How is ProcessPayment reached from the API?"*
|
|
85
|
+
- *"What's the blast radius if I change UserService?"*
|
|
86
|
+
- *"Who owns the internal/api module?"*
|
|
87
|
+
- *"Is this legacy code still used?"*
|
|
88
|
+
|
|
89
|
+
## Why CKB?
|
|
90
|
+
|
|
91
|
+
| Without CKB | With CKB |
|
|
92
|
+
|-------------|----------|
|
|
93
|
+
| AI greps for patterns | AI navigates semantically |
|
|
94
|
+
| "I found 47 matches for Handler" | "HandleRequest is called by 3 routes via CheckoutService" |
|
|
95
|
+
| Guessing at impact | Knowing the blast radius with risk scores |
|
|
96
|
+
| Reading entire files for context | Getting exactly what's relevant |
|
|
97
|
+
| "Who owns this?" → search CODEOWNERS | Instant ownership with reviewer suggestions |
|
|
98
|
+
| "Is this safe to change?" → hope | Hotspot trends + impact analysis |
|
|
99
|
+
|
|
100
|
+
## Three Ways to Use It
|
|
101
|
+
|
|
102
|
+
| Interface | Best For |
|
|
103
|
+
|-----------|----------|
|
|
104
|
+
| **Claude Code (MCP)** | AI-assisted development — Claude queries your codebase directly |
|
|
105
|
+
| **CLI** | Quick lookups from terminal, scripting |
|
|
106
|
+
| **HTTP API** | IDE plugins, CI integration, custom tooling |
|
|
107
|
+
|
|
108
|
+
## Features
|
|
109
|
+
|
|
110
|
+
### Core Intelligence
|
|
111
|
+
- **Symbol Navigation** — Find any function, class, or variable in milliseconds
|
|
112
|
+
- **Call Flow & Tracing** — Trace how code is reached from API endpoints, CLI commands, or jobs
|
|
113
|
+
- **Impact Analysis** — Know exactly what breaks before refactoring, with risk scores
|
|
114
|
+
- **Architecture Maps** — Module dependency graphs, responsibilities, domain concepts
|
|
115
|
+
- **Dead Code Detection** — Keep/investigate/remove verdicts based on usage analysis
|
|
116
|
+
|
|
117
|
+
### Ownership & Risk
|
|
118
|
+
- **Ownership Intelligence** — CODEOWNERS + git blame with time-weighted analysis
|
|
119
|
+
- **Hotspot Detection** — Track churn trends, get 30-day risk projections
|
|
120
|
+
- **Architectural Decisions** — Record and query ADRs with full-text search
|
|
121
|
+
|
|
122
|
+
### Production Ready (v6.1)
|
|
123
|
+
- **Background Jobs** — Queue long operations, track progress, cancel jobs
|
|
124
|
+
- **CI/CD Integration** — PR risk analysis, ownership drift detection
|
|
125
|
+
|
|
126
|
+
### Cross-Repository (v6.2+)
|
|
127
|
+
- **Federation** — Query across multiple repos organization-wide
|
|
128
|
+
- **Daemon Mode** — Always-on service with HTTP API, scheduled tasks, file watching, webhooks
|
|
129
|
+
- **Tree-sitter Complexity** — Language-agnostic cyclomatic/cognitive complexity for 7 languages
|
|
130
|
+
|
|
131
|
+
### Contract-Aware (v6.3)
|
|
132
|
+
- **API Boundary Detection** — Protobuf and OpenAPI contract discovery
|
|
133
|
+
- **Consumer Tracking** — Three evidence tiers for cross-repo dependencies
|
|
134
|
+
- **Cross-Repo Impact** — "What breaks if I change this shared API?"
|
|
135
|
+
|
|
136
|
+
### Runtime Observability (v6.4)
|
|
137
|
+
- **OpenTelemetry Integration** — See real call counts, not just static analysis
|
|
138
|
+
- **Dead Code Confidence** — Find symbols with zero runtime calls
|
|
139
|
+
- **Observed Callers** — Enrich impact analysis with production data
|
|
140
|
+
|
|
141
|
+
### Developer Intelligence (v6.5)
|
|
142
|
+
- **Symbol Origins** — Why does this code exist? Git history, linked issues/PRs
|
|
143
|
+
- **Co-change Coupling** — Find files that historically change together
|
|
144
|
+
- **LLM Export** — Token-efficient codebase summaries with importance ranking
|
|
145
|
+
- **Risk Audit** — 8-factor scoring (complexity, coverage, bus factor, security, staleness, errors, coupling, churn)
|
|
146
|
+
|
|
147
|
+
## MCP Tools (58 Available)
|
|
148
|
+
|
|
149
|
+
CKB exposes code intelligence through the Model Context Protocol:
|
|
150
|
+
|
|
151
|
+
<details>
|
|
152
|
+
<summary><strong>v5.1 — Core Navigation</strong></summary>
|
|
153
|
+
|
|
154
|
+
| Tool | Purpose |
|
|
155
|
+
|------|---------|
|
|
156
|
+
| `searchSymbols` | Find symbols by name with filtering |
|
|
157
|
+
| `getSymbol` | Get symbol details |
|
|
158
|
+
| `findReferences` | Find all usages |
|
|
159
|
+
| `explainSymbol` | AI-friendly symbol explanation |
|
|
160
|
+
| `justifySymbol` | Keep/investigate/remove verdict |
|
|
161
|
+
| `getCallGraph` | Caller/callee relationships |
|
|
162
|
+
| `getModuleOverview` | Module statistics |
|
|
163
|
+
| `analyzeImpact` | Change risk analysis |
|
|
164
|
+
| `getStatus` | System health |
|
|
165
|
+
| `doctor` | Diagnostics |
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><strong>v5.2 — Discovery & Flow</strong></summary>
|
|
171
|
+
|
|
172
|
+
| Tool | Purpose |
|
|
173
|
+
|------|---------|
|
|
174
|
+
| `traceUsage` | How is this symbol reached? |
|
|
175
|
+
| `listEntrypoints` | System entrypoints (API, CLI, jobs) |
|
|
176
|
+
| `explainFile` | File-level orientation |
|
|
177
|
+
| `explainPath` | Why does this path exist? |
|
|
178
|
+
| `summarizeDiff` | What changed, what might break? |
|
|
179
|
+
| `getArchitecture` | Module dependency overview |
|
|
180
|
+
| `getHotspots` | Volatile areas with trends |
|
|
181
|
+
| `listKeyConcepts` | Domain concepts in codebase |
|
|
182
|
+
| `recentlyRelevant` | What matters now? |
|
|
183
|
+
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
<details>
|
|
187
|
+
<summary><strong>v6.0 — Architectural Memory</strong></summary>
|
|
188
|
+
|
|
189
|
+
| Tool | Purpose |
|
|
190
|
+
|------|---------|
|
|
191
|
+
| `getOwnership` | Who owns this code? |
|
|
192
|
+
| `getModuleResponsibilities` | What does this module do? |
|
|
193
|
+
| `recordDecision` | Create an ADR |
|
|
194
|
+
| `getDecisions` | Query architectural decisions |
|
|
195
|
+
| `annotateModule` | Add module metadata |
|
|
196
|
+
| `refreshArchitecture` | Rebuild architectural model |
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary><strong>v6.1 — Production Ready</strong></summary>
|
|
202
|
+
|
|
203
|
+
| Tool | Purpose |
|
|
204
|
+
|------|---------|
|
|
205
|
+
| `getJobStatus` | Query background job status |
|
|
206
|
+
| `listJobs` | List jobs with filters |
|
|
207
|
+
| `cancelJob` | Cancel queued/running job |
|
|
208
|
+
| `summarizePr` | PR risk analysis & reviewers |
|
|
209
|
+
| `getOwnershipDrift` | CODEOWNERS vs actual ownership |
|
|
210
|
+
|
|
211
|
+
</details>
|
|
212
|
+
|
|
213
|
+
<details>
|
|
214
|
+
<summary><strong>v6.2+ — Federation, Daemon, Contracts, Telemetry, Intelligence</strong></summary>
|
|
215
|
+
|
|
216
|
+
| Tool | Purpose |
|
|
217
|
+
|------|---------|
|
|
218
|
+
| `listFederations` | List all federations |
|
|
219
|
+
| `federationStatus` | Get federation status |
|
|
220
|
+
| `federationSearchModules` | Cross-repo module search |
|
|
221
|
+
| `federationSearchOwnership` | Cross-repo ownership search |
|
|
222
|
+
| `federationGetHotspots` | Merged hotspots across repos |
|
|
223
|
+
| `daemonStatus` | Daemon health and stats |
|
|
224
|
+
| `listSchedules` | List scheduled tasks |
|
|
225
|
+
| `listWebhooks` | List configured webhooks |
|
|
226
|
+
| `getFileComplexity` | Cyclomatic/cognitive complexity |
|
|
227
|
+
| `listContracts` | List contracts in federation |
|
|
228
|
+
| `analyzeContractImpact` | Contract change impact |
|
|
229
|
+
| `getTelemetryStatus` | Coverage metrics and sync status |
|
|
230
|
+
| `getObservedUsage` | Observed usage for a symbol |
|
|
231
|
+
| `findDeadCodeCandidates` | Zero runtime call detection |
|
|
232
|
+
| `explainOrigin` | Why does this code exist? |
|
|
233
|
+
| `analyzeCoupling` | Co-change analysis |
|
|
234
|
+
| `exportForLLM` | LLM-friendly export |
|
|
235
|
+
| `auditRisk` | Multi-signal risk audit |
|
|
236
|
+
|
|
237
|
+
</details>
|
|
238
|
+
|
|
239
|
+
## CLI Usage
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# System status
|
|
243
|
+
ckb status
|
|
244
|
+
|
|
245
|
+
# Search for symbols
|
|
246
|
+
ckb search NewServer
|
|
247
|
+
|
|
248
|
+
# Find references
|
|
249
|
+
ckb refs NewServer
|
|
250
|
+
|
|
251
|
+
# Get architecture overview
|
|
252
|
+
ckb arch
|
|
253
|
+
|
|
254
|
+
# Analyze change impact
|
|
255
|
+
ckb impact <symbol-id>
|
|
256
|
+
|
|
257
|
+
# Query ownership
|
|
258
|
+
ckb ownership internal/api/handler.go
|
|
259
|
+
|
|
260
|
+
# List architectural decisions
|
|
261
|
+
ckb decisions
|
|
262
|
+
|
|
263
|
+
# Run diagnostics
|
|
264
|
+
ckb doctor
|
|
265
|
+
|
|
266
|
+
# Start MCP server for AI assistants
|
|
267
|
+
ckb mcp
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
<details>
|
|
271
|
+
<summary><strong>More CLI commands</strong></summary>
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Federation (v6.2)
|
|
275
|
+
ckb federation create platform --description "Our microservices"
|
|
276
|
+
ckb federation add platform --repo-id=api --path=/code/api
|
|
277
|
+
ckb federation status platform
|
|
278
|
+
ckb federation sync platform
|
|
279
|
+
|
|
280
|
+
# Daemon (v6.2.1)
|
|
281
|
+
ckb daemon start [--port=9120]
|
|
282
|
+
ckb daemon status
|
|
283
|
+
ckb daemon logs --follow
|
|
284
|
+
ckb daemon stop
|
|
285
|
+
|
|
286
|
+
# Contracts (v6.3)
|
|
287
|
+
ckb contracts list platform
|
|
288
|
+
ckb contracts impact platform --repo=api --path=proto/api/v1/user.proto
|
|
289
|
+
ckb contracts deps platform --repo=api
|
|
290
|
+
|
|
291
|
+
# Telemetry (v6.4)
|
|
292
|
+
ckb telemetry status
|
|
293
|
+
ckb telemetry usage --symbol="internal/api/handler.go:HandleRequest"
|
|
294
|
+
ckb dead-code --min-confidence=0.7
|
|
295
|
+
|
|
296
|
+
# Developer Intelligence (v6.5)
|
|
297
|
+
ckb explain internal/api/handler.go:42
|
|
298
|
+
ckb coupling internal/query/engine.go --min-correlation=0.5
|
|
299
|
+
ckb export --min-complexity=10 --max-symbols=200
|
|
300
|
+
ckb audit --min-score=60 --quick-wins
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
</details>
|
|
304
|
+
|
|
305
|
+
## HTTP API
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Start the HTTP server
|
|
309
|
+
ckb serve --port 8080
|
|
310
|
+
|
|
311
|
+
# Example calls
|
|
312
|
+
curl http://localhost:8080/health
|
|
313
|
+
curl http://localhost:8080/status
|
|
314
|
+
curl http://localhost:8080/search?q=NewServer
|
|
315
|
+
curl http://localhost:8080/architecture
|
|
316
|
+
curl "http://localhost:8080/ownership?path=internal/api"
|
|
317
|
+
curl http://localhost:8080/hotspots
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## MCP Server (Claude Code)
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# Add to current project
|
|
324
|
+
claude mcp add --transport stdio ckb --scope project -- /path/to/ckb mcp
|
|
325
|
+
|
|
326
|
+
# Or add globally
|
|
327
|
+
claude mcp add --transport stdio ckb --scope user -- /path/to/ckb mcp
|
|
328
|
+
|
|
329
|
+
# Verify
|
|
330
|
+
claude mcp list
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Or manually add to `.mcp.json`:
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"mcpServers": {
|
|
337
|
+
"ckb": {
|
|
338
|
+
"command": "/path/to/ckb",
|
|
339
|
+
"args": ["mcp"]
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Under the Hood
|
|
346
|
+
|
|
347
|
+
CKB orchestrates multiple code intelligence backends:
|
|
348
|
+
|
|
349
|
+
- **SCIP** — Precise, pre-indexed symbol data (fastest)
|
|
350
|
+
- **LSP** — Real-time language server queries
|
|
351
|
+
- **Git** — Blame, history, churn analysis, ownership
|
|
352
|
+
|
|
353
|
+
Results are merged intelligently and compressed for LLM context limits.
|
|
354
|
+
|
|
355
|
+
Persistent knowledge survives across sessions:
|
|
356
|
+
- **Module Registry** — Boundaries, responsibilities, tags
|
|
357
|
+
- **Ownership Registry** — CODEOWNERS + git-blame with time decay
|
|
358
|
+
- **Hotspot Tracker** — Historical snapshots with trend analysis
|
|
359
|
+
- **Decision Log** — ADRs with full-text search
|
|
360
|
+
|
|
361
|
+
## Who Should Use CKB?
|
|
362
|
+
|
|
363
|
+
- **Developers using AI assistants** — Give your AI tools superpowers
|
|
364
|
+
- **Teams with large codebases** — Navigate complexity efficiently
|
|
365
|
+
- **Anyone doing refactoring** — Understand impact before changing
|
|
366
|
+
- **Code reviewers** — See the full picture of changes
|
|
367
|
+
- **Tech leads** — Track architectural health over time
|
|
368
|
+
|
|
369
|
+
## Documentation
|
|
370
|
+
|
|
371
|
+
See the **[Full Documentation Wiki](https://github.com/SimplyLiz/CodeMCP/wiki)** for:
|
|
372
|
+
|
|
373
|
+
- [Quick Start](https://github.com/SimplyLiz/CodeMCP/wiki/Quick-Start) — Step-by-step installation
|
|
374
|
+
- [Prompt Cookbook](https://github.com/SimplyLiz/CodeMCP/wiki/Prompt-Cookbook) — Real prompts for real problems
|
|
375
|
+
- [Practical Limits](https://github.com/SimplyLiz/CodeMCP/wiki/Practical-Limits) — Accuracy notes, blind spots
|
|
376
|
+
- [User Guide](https://github.com/SimplyLiz/CodeMCP/wiki/User-Guide) — CLI commands and best practices
|
|
377
|
+
- [API Reference](https://github.com/SimplyLiz/CodeMCP/wiki/API-Reference) — HTTP API documentation
|
|
378
|
+
- [Configuration](https://github.com/SimplyLiz/CodeMCP/wiki/Configuration) — All options including MODULES.toml
|
|
379
|
+
|
|
380
|
+
## Requirements
|
|
381
|
+
|
|
382
|
+
- Go 1.21+
|
|
383
|
+
- Git
|
|
384
|
+
- Optional: gopls (for LSP support), scip-go (for SCIP indexing)
|
|
385
|
+
|
|
386
|
+
## License
|
|
387
|
+
|
|
388
|
+
Free for personal use. Commercial/enterprise use requires a license. See [LICENSE](LICENSE) for details.
|
package/bin/ckb
ADDED
|
Binary file
|