|
1 | 1 | # COCOA — Code Context Agent |
2 | 2 |
|
3 | | -Precise static system graphs of polyglot, k8s-native codebases — code + RPC |
4 | | -topology + data access — for AI agents. Powered by [CLDK](https://github.com/codellm-devkit/python-sdk). |
| 3 | +**Precise static system graphs of polyglot, k8s-native codebases — for AI agents.** |
5 | 4 |
|
6 | | -Status: v1 under construction. See issue #1 (epic). |
| 5 | +Point COCOA at a repo and it derives one queryable graph of the whole system: |
| 6 | +per-service call graphs, cross-service RPC edges (stitched from protos, call sites, |
| 7 | +and k8s wiring), and datastore access — every edge tagged `DERIVED-STATIC` (real |
| 8 | +static analysis, via [CLDK](https://github.com/codellm-devkit/python-sdk)) or |
| 9 | +`INFERRED` (labeled fallback). Never guessed. |
| 10 | + |
| 11 | +> **Graphify indexes files. COCOA understands systems.** |
| 12 | +> See the head-to-head: [docs/COMPARISON.md](docs/COMPARISON.md) |
| 13 | +
|
| 14 | +## The hero query: blast radius |
| 15 | + |
| 16 | +```bash |
| 17 | +cocoa blast -p . --target hipstershop.Money.units --kind proto-field |
| 18 | +``` |
| 19 | + |
| 20 | +…returns exactly which functions in which services break — across languages, across |
| 21 | +RPC boundaries, through the database — with call sites and provenance per hop. |
| 22 | +On Google's Online Boutique (11 services, 5 languages), the answer costs ~1/25,000th |
| 23 | +of the tokens an agent would burn reading every service (estimated; `cocoa demo` |
| 24 | +prints the measurement). |
7 | 25 |
|
8 | 26 | ## Quick start |
9 | 27 |
|
10 | 28 | ```bash |
11 | | -uv run cocoa map -p /path/to/your/polyglot/repo # build .cocoa/ artifacts |
12 | | -uv run cocoa blast -p /path/to/repo --target hipstershop.Money.units --kind proto-field |
13 | | -uv run cocoa serve -p /path/to/repo # MCP server (5 system tools) |
14 | | -uv run cocoa demo # Online Boutique flagship demo |
| 29 | +# no install (uv required): |
| 30 | +uvx --from git+https://github.com/codellm-devkit/cocoa cocoa map -p /path/to/repo |
| 31 | +uvx --from git+https://github.com/codellm-devkit/cocoa cocoa blast -p /path/to/repo \ |
| 32 | + --target <target> --kind <proto-field|rpc|function|table|redis-key> |
| 33 | + |
| 34 | +# flagship demo (clones Online Boutique, maps it, blasts a proto field): |
| 35 | +uvx --from git+https://github.com/codellm-devkit/cocoa cocoa demo |
| 36 | + |
| 37 | +# docker (all analyzers baked in, incl. the unreleased Go analyzer): |
| 38 | +docker run --rm -v "$PWD:/work" ghcr.io/codellm-devkit/cocoa map -p /work |
15 | 39 | ``` |
16 | 40 |
|
17 | | -Requires Docker-less local analyzers today: Java/Python/TypeScript run via CLDK |
18 | | -automatically; Go needs `codeanalyzer-go` on PATH (or pointed to via |
19 | | -`CODEANALYZER_GO_BIN`); C# is recorded as skipped until `codeanalyzer-dotnet` ships. |
| 41 | +Agent setups (Claude Code plugin with skills + slash commands + MCP, Codex, Cursor, |
| 42 | +plain MCP): [docs/INSTALL.md](docs/INSTALL.md). |
| 43 | + |
| 44 | +## What you get |
| 45 | + |
| 46 | +| Artifact | What it is | |
| 47 | +|---|---| |
| 48 | +| `.cocoa/system-graph.json` | the full graph — query it forever without re-reading source | |
| 49 | +| `.cocoa/system-map.html` | self-contained interactive map, provenance-colored | |
| 50 | +| `.cocoa/SYSTEM_REPORT.md` | services, topology, data access, dead-RPC candidates, and **every skipped service with its reason** | |
| 51 | + |
| 52 | +## Language & analyzer status (honest) |
| 53 | + |
| 54 | +| Language | Analyzer | Status | |
| 55 | +|---|---|---| |
| 56 | +| Java | codeanalyzer-java (via cldk) | works; clean pip installs need the jar workaround ([python-sdk#236](https://github.com/codellm-devkit/python-sdk/issues/236)) — the Docker image includes it | |
| 57 | +| Python | codeanalyzer-python (via cldk) | works | |
| 58 | +| JS/TS | codeanalyzer-typescript (via cldk) | works | |
| 59 | +| Go | codeanalyzer-go | unreleased ([codeanalyzer-go#5](https://github.com/codellm-devkit/codeanalyzer-go/issues/5)); Docker image builds it from source; host installs need `codeanalyzer-go` on PATH or `$CODEANALYZER_GO_BIN` | |
| 60 | +| C# | codeanalyzer-dotnet | pending ([codeanalyzer-dotnet#1](https://github.com/codellm-devkit/codeanalyzer-dotnet/issues/1)) — services are recorded as skipped, never silently dropped | |
| 61 | + |
| 62 | +## Skills (the agent discipline layer) |
| 63 | + |
| 64 | +The plugin ships four skills modeled on the |
| 65 | +[obra/superpowers](https://github.com/obra/superpowers) paradigm: `using-cocoa` |
| 66 | +(answer system questions from the graph, not file reads), `mapping-a-system`, |
| 67 | +`blast-radius`, and `grounding-claims` — whose HARD-GATE is the product promise: |
| 68 | +*never present an `INFERRED` edge as fact.* |
| 69 | + |
| 70 | +## License |
| 71 | + |
| 72 | +MIT. Built on [CodeLLM-DevKit](https://codellm-devkit.info). |
0 commit comments