|
1 | 1 | --- |
2 | 2 | name: axiomcode |
3 | 3 | description: >- |
4 | | - Use for any why, what or where question about code — how a codebase works, where something lives, who calls it, what a change to it breaks, which tests cover an edit. Also use when resolving an issue or bug report, which names a symptom rather than a file. Examples: "How does X work?", "Where do I change Y?", "What calls this?", "What breaks if I change Z?", "Which tests do I run?", "Fix this issue". Search with grep as usual; ask the graph for what grep cannot know — which declaration a call reaches and the callers that never spell the name. Answers come from a resolved call graph, so they include callers that never spell the name — through an interface, an override, a callback, dependency injection or a config key — and every place comes with the code of the function it sits in. Call the MCP tools directly, no need to load this skill first: impact(name) for who calls it and what a change reaches (with no name: your uncommitted edits), path(start, end) for how A reaches B, tests() for the tests your edits reach. Only when those tools are not in your list, the same from the shell: `axiomcode impact <name>`, `axiomcode path <A> <B>`, `axiomcode tests`. Java, TypeScript, Python, JavaScript, C#. |
| 4 | + Use for any why, what or where question about code — how a codebase works, where something lives, who calls it, what a change to it breaks, which tests cover an edit. Also use when resolving an issue or bug report, which names a symptom rather than a file. Examples: "How does X work?", "Where do I change Y?", "What calls this?", "What breaks if I change Z?", "Which tests do I run?", "Fix this issue". Search with grep as usual; ask the graph for what grep cannot know — which declaration a call reaches and the callers that never spell the name. Answers come from a resolved call graph, so they include callers that never spell the name — through an interface, an override, a callback, dependency injection or a config key — and every place comes with the code of the function it sits in. Call the MCP tools directly, no need to load this skill first: impact(name) for who calls it and what a change reaches (with no name: your uncommitted edits), path(start, end) for how A reaches B, tests() for the tests your edits reach, context(task, source=True) for how something works as a step-by-step call flow with each step's code. Only when those tools are not in your list, the same from the shell: `axiomcode impact <name>`, `axiomcode path <A> <B>`, `axiomcode tests`, `axiomcode context "<task>" --source`. Java, TypeScript, Python, JavaScript, C#. |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | # axiomcode |
8 | 8 |
|
9 | 9 | Search with grep as usual; the graph answers what grep cannot. Use the MCP tools when they are in your list (in Claude Code |
10 | | -`mcp__plugin_axiomcode_axiomcode__impact`, `__path`, `__tests`); otherwise run |
| 10 | +`mcp__plugin_axiomcode_axiomcode__impact`, `__path`, `__tests`, `__context`); otherwise run |
11 | 11 | `<this dir>/../../plugins/axiomcode/skills/axiomcode/scripts/axiomcode <verb>` from the repository root. Same answer either way. |
12 | 12 |
|
13 | 13 | | the question | MCP tool | shell | |
14 | 14 | |---|---|---| |
15 | 15 | | where is the code for this task? | your own search (grep), then bring the name here | — | |
16 | 16 | | who calls X, what does changing it reach, which tests? | `impact(name)` | `axiomcode impact <name>` | |
| 17 | +| what is the value of constant X, and who reads it? | `impact(name)` | `axiomcode impact <name>` | |
17 | 18 | | what do my uncommitted edits reach? | `impact()` | `axiomcode impact` | |
18 | 19 | | how does A reach B? | `path(start, end)` | `axiomcode path <A> <B>` | |
19 | 20 | | which tests do my edits need, and how do I run them? | `tests()` | `axiomcode tests` | |
20 | 21 | | an answer lists an unresolved call I can see the target of | `link(site, target)` | `axiomcode link <file:line> <target>` | |
| 22 | +| how does this work, start to finish? | `context(task, source=True)` | `axiomcode context "<task>" --source` | |
21 | 23 |
|
22 | 24 | Names are written as in the code: `Owner.method`, `function`, `Type`, or `file.py:123` for the declaration at that |
23 | 25 | line. There is no setup step: the first question builds the graph, and it refreshes itself after every edit. |
@@ -45,7 +47,8 @@ from an empty answer. |
45 | 47 |
|
46 | 48 | With a name: who calls it, what depends on it further out, and the tests that exercise it. Example: |
47 | 49 | `impact(name="PriceService.total")`. With no name: the first line is `your edits:` (each declaration you changed and |
48 | | -how), then the same answer for all of them. |
| 50 | +how), then the same answer for all of them. A constant answers with its value — `change: const MAX_ITEMS = 5` — |
| 51 | +so a limit, a default or a threshold is read off the first line rather than from the file. |
49 | 52 |
|
50 | 53 | ## path |
51 | 54 |
|
@@ -87,10 +90,46 @@ identifier as written in the code. |
87 | 90 |
|
88 | 91 | ## index |
89 | 92 |
|
90 | | -`axiomcode index` builds the graph explicitly; `--lang`, `--src` and `--library` narrow it. Never re-run it on an |
| 93 | +`axiomcode index` builds the graph explicitly; `--lang` and `--src` narrow it. Never re-run it on an |
91 | 94 | existing graph: the graph rebuilds itself after edits, and an answer given before that finishes says so on a |
92 | 95 | `graph refresh:` line. |
93 | 96 |
|
| 97 | +By default the graph is built without the project's dependencies: a call into one is unresolved or named only as an |
| 98 | +external boundary. When better coverage is needed, compile the dependencies and enable them with `--library`, given |
| 99 | +once on `index` and kept by every rebuild after it: |
| 100 | + |
| 101 | + axiomcode index --library auto # the dependencies the project imports |
| 102 | + axiomcode index --library .venv/lib/python3.12/site-packages/requests,/deps/ir/jdk # or name them |
| 103 | + |
| 104 | +`auto` finds what the project depends on, in every language: a Python package its source imports, in its virtual |
| 105 | +environment (`.venv`, `venv`, `$VIRTUAL_ENV`); a JavaScript / TypeScript package it imports, under `node_modules`; a |
| 106 | +Java dependency `pom.xml` or `build.gradle` declares, through its `-sources.jar` in the Maven repository or Gradle's |
| 107 | +cache, or its class jar decompiled when it ships no sources (needs Vineflower: `mvn dependency:get |
| 108 | +-Dartifact=org.vineflower:vineflower:1.10.1`); a NuGet package a `.csproj` references, decompiled from its assembly |
| 109 | +(needs `dotnet tool install -g ilspycmd`). Whatever it cannot find (a package never restored, a jar without sources) |
| 110 | +it names, with the command that fetches it. A named entry, comma-separated with no spaces, is a dependency's source |
| 111 | +directory or a library IR (a directory of the parser's CSV tables, as `axiomcode parser <source> <dir> --library` |
| 112 | +writes it). Every library is compiled once into `~/.cache/axiomcode/libir/` and reused until its files change; one no |
| 113 | +build has used for 30 days is removed. Entries are relative to the repository or absolute; write `~` out, since one |
| 114 | +after a comma is not expanded. `AXIOMCODE_LIBRARY` takes the same list. |
| 115 | + |
| 116 | +The choice is kept with the graph. Every rebuild after it stages the libraries again (`auto` discovers them |
| 117 | +again, so a new dependency is picked up), and with libraries on, a dependency change alone (a manifest or lockfile |
| 118 | +edit, `pip install -U`, `npm install`, `dotnet restore`, a Maven or Gradle fetch of a dependency that was missing) |
| 119 | +also marks the graph stale and rebuilds it. A graph built |
| 120 | +without `--library` never gains libraries by itself; `AXIOMCODE_REINDEX=1 axiomcode index` turns them off again. |
| 121 | + |
| 122 | +With them, a call into a dependency resolves to its declaration and a chain is typed through its declared return |
| 123 | +types (`client.post(...).json()`). Library bodies are not walked, so a dependency calling back into the project is |
| 124 | +not found this way. |
| 125 | + |
| 126 | +## graph |
| 127 | + |
| 128 | +`axiomcode graph` draws the codebase as one page for the user to look at: directories, files, types and methods, with |
| 129 | +the call edges between them and each edge's tier. It prints the page's path (`.axiomcode/graph/graph.html`); open it |
| 130 | +in a browser. It is drawn from the graph the index built, rebuilt first only when a source file changed. It is not an |
| 131 | +MCP tool: it answers no question, so when the user asks to see the graph, run it and give them the path. |
| 132 | + |
94 | 133 | ## What it cannot see — say so instead of guessing |
95 | 134 |
|
96 | 135 | Reflection, string dispatch, event buses; receivers the engine could not type; callbacks invoked by a library; what a |
|
0 commit comments