repomap-cli 1.0.0__tar.gz
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.
- repomap_cli-1.0.0/.github/workflows/build-binaries.yml +63 -0
- repomap_cli-1.0.0/.gitignore +5 -0
- repomap_cli-1.0.0/AGENTS.md +188 -0
- repomap_cli-1.0.0/CLAUDE.md +1 -0
- repomap_cli-1.0.0/LICENSE +21 -0
- repomap_cli-1.0.0/PKG-INFO +284 -0
- repomap_cli-1.0.0/README.md +241 -0
- repomap_cli-1.0.0/README.zh-CN.md +234 -0
- repomap_cli-1.0.0/docs/BOUNDARIES.md +95 -0
- repomap_cli-1.0.0/pyproject.toml +63 -0
- repomap_cli-1.0.0/repomap/__init__.py +320 -0
- repomap_cli-1.0.0/repomap/ai.py +1108 -0
- repomap_cli-1.0.0/repomap/check.py +1212 -0
- repomap_cli-1.0.0/repomap/cli/__init__.py +3 -0
- repomap_cli-1.0.0/repomap/cli/__main__.py +12 -0
- repomap_cli-1.0.0/repomap/cli/cli.py +2475 -0
- repomap_cli-1.0.0/repomap/core.py +730 -0
- repomap_cli-1.0.0/repomap/lsp.py +753 -0
- repomap_cli-1.0.0/repomap/parser.py +1697 -0
- repomap_cli-1.0.0/repomap/ranking.py +639 -0
- repomap_cli-1.0.0/repomap/resolver.py +906 -0
- repomap_cli-1.0.0/repomap/toolkit.py +850 -0
- repomap_cli-1.0.0/repomap/topic.py +600 -0
- repomap_cli-1.0.0/skills/repomap/SKILL.md +159 -0
- repomap_cli-1.0.0/skills/repomap/references/authoring-checklist.md +10 -0
- repomap_cli-1.0.0/skills/repomap/references/command-map.md +168 -0
- repomap_cli-1.0.0/skills/repomap/references/prompt-examples.md +482 -0
- repomap_cli-1.0.0/skills/repomap/scripts/validate-skill.sh +98 -0
- repomap_cli-1.0.0/tests/__init__.py +1 -0
- repomap_cli-1.0.0/tests/test_repomap_binary_e2e.py +79 -0
- repomap_cli-1.0.0/tests/test_repomap_cli.py +1196 -0
- repomap_cli-1.0.0/tests/test_repomap_engine.py +860 -0
- repomap_cli-1.0.0/tests/test_repomap_lsp.py +292 -0
- repomap_cli-1.0.0/tests/test_repomap_parser_ast.py +268 -0
- repomap_cli-1.0.0/tests/test_repomap_toolkit.py +124 -0
- repomap_cli-1.0.0/uv.lock +428 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: build-binaries
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- master
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os:
|
|
17
|
+
- ubuntu-latest
|
|
18
|
+
- windows-latest
|
|
19
|
+
- macos-latest
|
|
20
|
+
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Python
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.13"
|
|
31
|
+
|
|
32
|
+
- name: Setup uv
|
|
33
|
+
uses: astral-sh/setup-uv@v6
|
|
34
|
+
|
|
35
|
+
- name: Run test suite
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
uv run --with pyinstaller,tree-sitter,tree-sitter-python,tree-sitter-javascript,tree-sitter-typescript,tree-sitter-go,tree-sitter-rust,tree-sitter-html,tree-sitter-css,tree-sitter-json \
|
|
39
|
+
python -m unittest discover -s tests -v
|
|
40
|
+
|
|
41
|
+
- name: Build binary
|
|
42
|
+
shell: bash
|
|
43
|
+
run: |
|
|
44
|
+
uv run --with pyinstaller,tree-sitter,tree-sitter-python,tree-sitter-javascript,tree-sitter-typescript,tree-sitter-go,tree-sitter-rust,tree-sitter-html,tree-sitter-css,tree-sitter-json \
|
|
45
|
+
python -m src.cli build-binary --output dist
|
|
46
|
+
|
|
47
|
+
- name: Smoke test binary on Unix
|
|
48
|
+
if: runner.os != 'Windows'
|
|
49
|
+
shell: bash
|
|
50
|
+
run: |
|
|
51
|
+
./dist/repomap doctor
|
|
52
|
+
|
|
53
|
+
- name: Smoke test binary on Windows
|
|
54
|
+
if: runner.os == 'Windows'
|
|
55
|
+
shell: pwsh
|
|
56
|
+
run: |
|
|
57
|
+
.\dist\repomap.exe doctor
|
|
58
|
+
|
|
59
|
+
- name: Upload binary artifact
|
|
60
|
+
uses: actions/upload-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: repomap-${{ runner.os }}
|
|
63
|
+
path: dist/repomap*
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# RepoMap — Skill + CLI for AI-Agent Repository Intelligence
|
|
2
|
+
|
|
3
|
+
`repomap` is a **skill + CLI tool**. AI agents (Claude Code, Codex, OpenCode) invoke it via the skill definition in `skills/repomap/SKILL.md`. The skill tells the agent *when* to call `repomap`; the CLI binary does the actual work: tree-sitter AST scanning, dependency graph building, PageRank ranking, and structured report generation.
|
|
4
|
+
|
|
5
|
+
**Distribution**: users clone the skill directory + download the prebuilt binary. No server, no daemon, no MCP. See [README.md](./README.md) for the user-facing description.
|
|
6
|
+
|
|
7
|
+
## Project Snapshot
|
|
8
|
+
|
|
9
|
+
- **Shape**: Python package (`src/`) + prebuilt binaries for Linux/macOS/Windows (via GitHub Releases)
|
|
10
|
+
- **Core capability**: tree-sitter AST → symbol extraction → import resolution → call-chain analysis → AI-friendly reports
|
|
11
|
+
- **Languages**: Python, JS/TS (including TSX), Go, Rust, Java, Kotlin, Swift, C/C++, C#, PHP, Ruby, HTML, CSS, JSON
|
|
12
|
+
- **Distribution**: `skills/repomap/` → `~/.claude/skills/repomap/`; binary → `~/.local/bin/repomap`
|
|
13
|
+
- **No server/daemon**: LSP integration is opt-in, local-only, stdio-based
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
All via `repomap <subcommand> --project <path>`.
|
|
18
|
+
|
|
19
|
+
| Command | Purpose |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `overview` | Project map: modules, entry points, reading order, hotspots, key symbols |
|
|
22
|
+
| `query --query "keyword"` | Topic/feature discovery by business words |
|
|
23
|
+
| `file-detail --file-path <f>` | Symbols and structure of a known file |
|
|
24
|
+
| `impact --files <f...> --with-symbols` | Pre-edit blast radius + edit planning |
|
|
25
|
+
| `query-symbol --symbol <name>` | Exact/fuzzy symbol lookup |
|
|
26
|
+
| `call-chain --symbol <name>` | Caller/callee context |
|
|
27
|
+
| `refs --symbol <name>` | Reference discovery |
|
|
28
|
+
| `verify [--quick] [--with-lsp] [--with-diff]` | Post-edit evidence gate |
|
|
29
|
+
| `check` | Compiler/type/lint diagnostics |
|
|
30
|
+
| `routes [--json]` | HTTP/API route inventory |
|
|
31
|
+
| `orphan [--json]` | Dead-code candidate discovery |
|
|
32
|
+
| `hotspots` | Dense-file inventory |
|
|
33
|
+
| `cache save` / `diff` | Graph baseline + comparison |
|
|
34
|
+
| `lsp doctor` | Inspect local LSP availability |
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Run from source
|
|
38
|
+
uv run repomap --help
|
|
39
|
+
|
|
40
|
+
# Tests
|
|
41
|
+
uv run python -m unittest discover -s tests -v
|
|
42
|
+
|
|
43
|
+
# Build binary
|
|
44
|
+
uv run --with pyinstaller python -m src.cli build-binary --output dist
|
|
45
|
+
```
|
|
46
|
+
## Architecture
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
src/ # Python package (flat)
|
|
50
|
+
├── __init__.py # Core data structures: Symbol, Edge, RepoGraph, ScanStats
|
|
51
|
+
├── cli/ # CLI entrypoint
|
|
52
|
+
│ ├── __init__.py
|
|
53
|
+
│ ├── __main__.py # python -m repomap entry
|
|
54
|
+
│ └── cli.py # argparse CLI, all subcommand dispatch
|
|
55
|
+
├── core.py # RepoMapEngine: scan pipeline, graph build, skip lists
|
|
56
|
+
├── parser.py # TreeSitterAdapter: AST parsing, import/export bindings
|
|
57
|
+
├── resolver.py # ImportResolver: resolve imports to file paths
|
|
58
|
+
├── ranking.py # EdgeBuilder, GraphAnalyzer: PageRank, call-graph edges
|
|
59
|
+
├── topic.py # Topic scoring, test matching, file role classification
|
|
60
|
+
├── check.py # RepoMapChecker: diagnostics (eslint, tsc, ruff, go vet, ...)
|
|
61
|
+
├── toolkit.py # Cache/diff/git helper logic
|
|
62
|
+
├── ai.py # Markdown report rendering (overview, impact, verify, query)
|
|
63
|
+
└── lsp.py # Optional local LSP integration (stdio, on-demand)
|
|
64
|
+
skills/repomap/ # AI agent skill definition
|
|
65
|
+
├── SKILL.md # Agent decision procedure
|
|
66
|
+
└── references/ # Command map, prompt examples, authoring checklist
|
|
67
|
+
tests/ # Test suite
|
|
68
|
+
dist/repomap # Local build output (CI builds Linux/macOS/Windows via GitHub Actions)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Dependency flow**: `cli.py` → `core.py` (engine) → `parser.py` (AST) → `resolver.py` (imports) → `ranking.py` (graph) → `ai.py` (reports). Cross-cutting: `__init__.py` (data types), `topic.py` (scoring), `check.py` (diagnostics), `toolkit.py` (cache/git).
|
|
72
|
+
|
|
73
|
+
## Change Map
|
|
74
|
+
|
|
75
|
+
- **Parser/AST**: `src/parser.py`, `src/resolver.py` → all symbol/call-chain commands
|
|
76
|
+
- **Graph/ranking**: `src/ranking.py` → `overview`, `call-chain`, `query-symbol`, `impact`, `hotspots`
|
|
77
|
+
- **CLI/commands**: `src/cli/cli.py` → add subparser + wire to engine + renderer in `src/ai.py`
|
|
78
|
+
- **Reports**: `src/ai.py` → each `render_*` function owns one report type
|
|
79
|
+
- **Topic scoring**: `src/topic.py` → `impact`, `verify`, `query` test suggestions
|
|
80
|
+
- **Diagnostics**: `src/check.py` → `check`, `verify`
|
|
81
|
+
- **Cache/diff**: `src/toolkit.py` → `cache save`, `diff`, `verify --with-diff`
|
|
82
|
+
- **LSP**: `src/lsp.py` → opt-in, affects `diagnostics`, `query-symbol --with-lsp`, etc.
|
|
83
|
+
|
|
84
|
+
## Verification
|
|
85
|
+
|
|
86
|
+
| Scope | Command |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Parser | `uv run python -m unittest discover -s tests -p 'test_repomap_parser_ast.py' -v` |
|
|
89
|
+
| CLI | `uv run python -m unittest discover -s tests -p 'test_repomap_cli.py' -v` |
|
|
90
|
+
| Engine | `uv run python -m unittest discover -s tests -p 'test_repomap_engine.py' -v` |
|
|
91
|
+
| Toolkit | `uv run python -m unittest discover -s tests -p 'test_repomap_toolkit.py' -v` |
|
|
92
|
+
| LSP | `uv run python -m unittest discover -s tests -p 'test_repomap_lsp.py' -v` |
|
|
93
|
+
| Binary E2E | `uv run --with pyinstaller python -m unittest discover -s tests -p 'test_repomap_binary_e2e.py' -v` |
|
|
94
|
+
| Full | `uv run python -m unittest discover -s tests -v` |
|
|
95
|
+
| Smoke | `repomap doctor && repomap overview --project . && repomap verify --project . --quick` |
|
|
96
|
+
|
|
97
|
+
## README Maintenance
|
|
98
|
+
|
|
99
|
+
The public README files serve different audiences than this document:
|
|
100
|
+
|
|
101
|
+
- **README.md** (English, primary): user-facing — what, how to install, how to use. Keep concise, answer "what/why/how" within 10 seconds.
|
|
102
|
+
- **README.zh-CN.md** (Chinese): same content and structure — not literal translation but content-equivalent. All sections, commands, tables must exist in both.
|
|
103
|
+
- **SKILL.md** (`skills/repomap/SKILL.md`): AI agent operating procedure. Describes *when and how* to call each command. Distributed to users.
|
|
104
|
+
|
|
105
|
+
**Rules for README changes**:
|
|
106
|
+
- README describes the *product*, not the implementation. No module names, internal architecture, or refactoring details.
|
|
107
|
+
- Binary URLs must point to GitHub Releases: `repomap-linux`, `repomap-macos`, `repomap.exe`.
|
|
108
|
+
- Language support list must match `src/parser.py` and `pyproject.toml`.
|
|
109
|
+
- When adding commands, update README.md, README.zh-CN.md, and SKILL.md.
|
|
110
|
+
- README does NOT say "For Humans" / "For AI Agents" — present information directly.
|
|
111
|
+
|
|
112
|
+
## Project Rules
|
|
113
|
+
|
|
114
|
+
- `src/cli/cli.py` owns all argparse definitions and subcommand dispatch.
|
|
115
|
+
- `src/__init__.py` is single source of truth for data structures (Symbol, Edge, RepoGraph, ScanStats, HttpRoute).
|
|
116
|
+
- Report rendering stays in `src/ai.py`; engine/parser/ranking produce data, `ai.py` formats it.
|
|
117
|
+
- Import resolution goes through `src/resolver.py`; do not hand-roll path resolution.
|
|
118
|
+
- Session cache version in `cli.py` must be bumped when scan cache semantics change.
|
|
119
|
+
- `--project` must be absolute when called from AI/Agent contexts.
|
|
120
|
+
- LSP is strictly opt-in, local-only. Never auto-install servers, never run `npx`/`pnpx`/`bunx`.
|
|
121
|
+
- `verify` suggests tests but does not run them. Agents must run tests explicitly.
|
|
122
|
+
- Cache directories are keyed by canonical project path.
|
|
123
|
+
- `.gitignore` keeps `docs/` local-only (not in public repo).
|
|
124
|
+
|
|
125
|
+
## Agent Boundary Discovery
|
|
126
|
+
|
|
127
|
+
When using `repomap`, AI agents encounter tool boundaries that specs don't cover. These discoveries are logged in [`docs/BOUNDARIES.md`](docs/BOUNDARIES.md) for continuous improvement.
|
|
128
|
+
|
|
129
|
+
**What to log**: language/framework gaps, performance boundaries, output precision issues, workflow friction, edge cases.
|
|
130
|
+
|
|
131
|
+
**When to log**: after any `repomap` command that fails or produces unexpected results; when output requires post-processing; when a real coding task exposes a capability gap.
|
|
132
|
+
|
|
133
|
+
**Format**: each entry uses `[ ]` (pending) or `[x]` (resolved) checkbox format with discovery scenario, current behavior, expected behavior, and impact on agent workflow.
|
|
134
|
+
|
|
135
|
+
**Workflow**: use repomap normally → hit a boundary → find alternative approach → log the discovery → after fix is implemented, verify and mark `[x]`.
|
|
136
|
+
|
|
137
|
+
The SKILL.md `## Optimization Feedback` section is the authoritative procedure for what to capture and how to format entries.
|
|
138
|
+
|
|
139
|
+
## Skill Distribution
|
|
140
|
+
|
|
141
|
+
The open-source skill (`skills/repomap/SKILL.md`) is distributed to users and must NOT include:
|
|
142
|
+
- `## Optimization Feedback` section — local maintainer use only
|
|
143
|
+
- Any references to local file paths (e.g., absolute paths on maintainer's machine)
|
|
144
|
+
- Any maintainer-specific workflow or feedback mechanisms
|
|
145
|
+
|
|
146
|
+
The local skill (`~/.agents/skills/repomap/SKILL.md`) includes the full `## Optimization Feedback` section for continuous improvement based on real-world usage.
|
|
147
|
+
|
|
148
|
+
## Binary Build Workflow
|
|
149
|
+
|
|
150
|
+
After any code change to `src/`, rebuild the binary and verify PATH is fresh:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. Build binary
|
|
154
|
+
uv run --with pyinstaller python -m src.cli build-binary --output dist
|
|
155
|
+
|
|
156
|
+
# 2. Verify the new binary is in PATH and works
|
|
157
|
+
which repomap
|
|
158
|
+
repomap doctor
|
|
159
|
+
repomap overview --project . --quick
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The built binary at `dist/repomap` must be the one in PATH (symlinked or copied to `~/.local/bin/repomap`). After rebuild, run `repomap doctor` then `repomap overview --project . --quick` to smoke-test.
|
|
163
|
+
|
|
164
|
+
## Skill Sync Rules
|
|
165
|
+
|
|
166
|
+
After modifying repomap source code or skill files, sync between skill directories:
|
|
167
|
+
|
|
168
|
+
| Path | Role |
|
|
169
|
+
|------|------|
|
|
170
|
+
| `skills/repomap/` | Source of truth — edit here first |
|
|
171
|
+
| `~/.agents/skills/repomap/` | Local deployment — sync from source |
|
|
172
|
+
|
|
173
|
+
**Sync procedure**:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Sync references and scripts (must be byte-identical)
|
|
177
|
+
cp -r skills/repomap/references/* ~/.agents/skills/repomap/references/
|
|
178
|
+
cp -r skills/repomap/scripts/* ~/.agents/skills/repomap/scripts/
|
|
179
|
+
|
|
180
|
+
# Sync SKILL.md then add Optimization Feedback section locally
|
|
181
|
+
cp skills/repomap/SKILL.md ~/.agents/skills/repomap/SKILL.md
|
|
182
|
+
# Manually append ## Optimization Feedback to local copy
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Consistency rules**:
|
|
186
|
+
- `references/` and `scripts/`: byte-identical at all times
|
|
187
|
+
- `SKILL.md` in `~/.agents/skills/repomap/`: open-source version **plus** `## Optimization Feedback` appended — no other differences
|
|
188
|
+
- After changes, verify with `diff -r skills/repomap/references/ ~/.agents/skills/repomap/references/`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
AGENTS.md
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gjczone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: repomap-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Standalone RepoMap CLI with tree-sitter AST parsing, PageRank symbol ranking, impact analysis, and post-edit verification
|
|
5
|
+
Project-URL: Homepage, https://github.com/gjczone/repomap
|
|
6
|
+
Project-URL: Repository, https://github.com/gjczone/repomap
|
|
7
|
+
Project-URL: Issues, https://github.com/gjczone/repomap/issues
|
|
8
|
+
Author: gjczone
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ast,cli,code-analysis,pagerank,repomap,tree-sitter
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: tree-sitter-css>=0.23.0
|
|
24
|
+
Requires-Dist: tree-sitter-go>=0.23.0
|
|
25
|
+
Requires-Dist: tree-sitter-html>=0.23.0
|
|
26
|
+
Requires-Dist: tree-sitter-javascript>=0.23.0
|
|
27
|
+
Requires-Dist: tree-sitter-json>=0.23.0
|
|
28
|
+
Requires-Dist: tree-sitter-python>=0.23.0
|
|
29
|
+
Requires-Dist: tree-sitter-rust>=0.23.0
|
|
30
|
+
Requires-Dist: tree-sitter-typescript>=0.23.0
|
|
31
|
+
Requires-Dist: tree-sitter>=0.23.0
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: tree-sitter-embedded-template>=0.23.0; extra == 'all'
|
|
34
|
+
Requires-Dist: tree-sitter-kotlin>=0.4.0; extra == 'all'
|
|
35
|
+
Requires-Dist: tree-sitter-markdown>=0.3.0; extra == 'all'
|
|
36
|
+
Requires-Dist: tree-sitter-php>=0.23.0; extra == 'all'
|
|
37
|
+
Requires-Dist: tree-sitter-ruby>=0.23.0; extra == 'all'
|
|
38
|
+
Requires-Dist: tree-sitter-swift>=0.0.1; extra == 'all'
|
|
39
|
+
Requires-Dist: tree-sitter-yaml>=0.7.0; extra == 'all'
|
|
40
|
+
Provides-Extra: build
|
|
41
|
+
Requires-Dist: pyinstaller>=6.0.0; extra == 'build'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# RepoMap — Skill + CLI for AI-Agent Repository Intelligence
|
|
45
|
+
|
|
46
|
+
> **A skill + CLI tool that gives AI agents (Claude Code, Codex, OpenCode) a "project map" — so they know what to read, what a change affects, and what to verify — before and after editing code.**
|
|
47
|
+
>
|
|
48
|
+
> Inspired by [aider](https://github.com/Aider-AI/aider)'s repo map concept.
|
|
49
|
+
|
|
50
|
+
[中文 README](README.zh-CN.md)
|
|
51
|
+
|
|
52
|
+
`repomap` is a CLI tool distributed as a skill + binary. AI agents invoke it to get structured repository-level context instead of guessing via `grep` + raw file reads:
|
|
53
|
+
|
|
54
|
+
- **Before editing**: entry points, keyword-to-file mapping, change impact, risk level, suggested reading order
|
|
55
|
+
- **After editing**: changed files, risk assessment, suggested tests, compiler/linter diagnostics
|
|
56
|
+
|
|
57
|
+
It doesn't modify code. It doesn't replace tests. It just gives the agent a "map" before reading files, and a safety check after editing.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
Prebuilt binaries available for Linux, macOS, and Windows. Copy the instructions for your platform to your AI agent:
|
|
64
|
+
|
|
65
|
+
**LLM agent: read the code block matching the user's OS. Execute every step in order. Do not skip any step. Do not ask the user for confirmation between steps.**
|
|
66
|
+
|
|
67
|
+
### Linux (x86_64)
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Install repomap for me:
|
|
71
|
+
|
|
72
|
+
1. Clone the skill:
|
|
73
|
+
mkdir -p ~/.claude/skills
|
|
74
|
+
git clone https://github.com/gjczone/repomap.git /tmp/repomap-install
|
|
75
|
+
cp -r /tmp/repomap-install/skills/repomap ~/.claude/skills/repomap
|
|
76
|
+
rm -rf /tmp/repomap-install
|
|
77
|
+
|
|
78
|
+
2. Download binary:
|
|
79
|
+
mkdir -p ~/.local/bin
|
|
80
|
+
curl -L -o ~/.local/bin/repomap https://github.com/gjczone/repomap/releases/latest/download/repomap-linux
|
|
81
|
+
chmod +x ~/.local/bin/repomap
|
|
82
|
+
|
|
83
|
+
3. Set up language support (agent handles this):
|
|
84
|
+
Tell your agent: "Check what languages I use and set up repomap accordingly."
|
|
85
|
+
The agent will install tree-sitter parsers for your languages. 8 languages
|
|
86
|
+
work out of the box; if you use Java, Kotlin, Swift, C/C++, C#, PHP, or Ruby,
|
|
87
|
+
the agent will also run `uv sync --all-extras` for you.
|
|
88
|
+
|
|
89
|
+
Then the agent runs `repomap lsp doctor` to check LSP. If any are missing:
|
|
90
|
+
|
|
91
|
+
| Language | LSP install |
|
|
92
|
+
|----------|------------|
|
|
93
|
+
| TypeScript | `npm install -g typescript-language-server` |
|
|
94
|
+
| Python | `npm install -g pyright` |
|
|
95
|
+
| Rust | `rustup component add rust-analyzer` |
|
|
96
|
+
| Go | `go install golang.org/x/tools/gopls@latest` |
|
|
97
|
+
|
|
98
|
+
You don't need to understand what these are. The agent handles everything.
|
|
99
|
+
|
|
100
|
+
4. Verify:
|
|
101
|
+
repomap doctor
|
|
102
|
+
|
|
103
|
+
If ~/.local/bin is not on PATH:
|
|
104
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### macOS (arm64)
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Install repomap for me:
|
|
111
|
+
|
|
112
|
+
1. Clone the skill:
|
|
113
|
+
mkdir -p ~/.claude/skills
|
|
114
|
+
git clone https://github.com/gjczone/repomap.git /tmp/repomap-install
|
|
115
|
+
cp -r /tmp/repomap-install/skills/repomap ~/.claude/skills/repomap
|
|
116
|
+
rm -rf /tmp/repomap-install
|
|
117
|
+
|
|
118
|
+
2. Download binary:
|
|
119
|
+
mkdir -p ~/.local/bin
|
|
120
|
+
curl -L -o ~/.local/bin/repomap https://github.com/gjczone/repomap/releases/latest/download/repomap-macos
|
|
121
|
+
chmod +x ~/.local/bin/repomap
|
|
122
|
+
|
|
123
|
+
3. Set up language support (agent handles this):
|
|
124
|
+
Tell your agent: "Check what languages I use and set up repomap accordingly."
|
|
125
|
+
The agent will install tree-sitter parsers for your languages. 8 languages
|
|
126
|
+
work out of the box; if you use Java, Kotlin, Swift, C/C++, C#, PHP, or Ruby,
|
|
127
|
+
the agent will also run `uv sync --all-extras` for you.
|
|
128
|
+
|
|
129
|
+
Then the agent runs `repomap lsp doctor` to check LSP. If any are missing:
|
|
130
|
+
|
|
131
|
+
| Language | LSP install |
|
|
132
|
+
|----------|------------|
|
|
133
|
+
| TypeScript | `npm install -g typescript-language-server` |
|
|
134
|
+
| Python | `npm install -g pyright` |
|
|
135
|
+
| Rust | `rustup component add rust-analyzer` |
|
|
136
|
+
| Go | `go install golang.org/x/tools/gopls@latest` |
|
|
137
|
+
|
|
138
|
+
You don't need to understand what these are. The agent handles everything.
|
|
139
|
+
|
|
140
|
+
4. Verify:
|
|
141
|
+
repomap doctor
|
|
142
|
+
|
|
143
|
+
If ~/.local/bin is not on PATH:
|
|
144
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Windows (x86_64)
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Install repomap for me:
|
|
151
|
+
|
|
152
|
+
1. Clone the skill:
|
|
153
|
+
mkdir -p ~/.claude/skills
|
|
154
|
+
git clone https://github.com/gjczone/repomap.git /tmp/repomap-install
|
|
155
|
+
cp -r /tmp/repomap-install/skills/repomap ~/.claude/skills/repomap
|
|
156
|
+
rm -rf /tmp/repomap-install
|
|
157
|
+
|
|
158
|
+
2. Download binary:
|
|
159
|
+
mkdir -p ~/AppData/Local/Microsoft/WindowsApps
|
|
160
|
+
curl -L -o ~/AppData/Local/Microsoft/WindowsApps/repomap.exe https://github.com/gjczone/repomap/releases/latest/download/repomap.exe
|
|
161
|
+
|
|
162
|
+
3. Set up language support (agent handles this):
|
|
163
|
+
Tell your agent: "Check what languages I use and set up repomap accordingly."
|
|
164
|
+
The agent will install tree-sitter parsers for your languages. 8 languages
|
|
165
|
+
work out of the box; if you use Java, Kotlin, Swift, C/C++, C#, PHP, or Ruby,
|
|
166
|
+
the agent will also run `uv sync --all-extras` for you.
|
|
167
|
+
|
|
168
|
+
Then the agent runs `repomap lsp doctor` to check LSP. If any are missing:
|
|
169
|
+
|
|
170
|
+
| Language | LSP install |
|
|
171
|
+
|----------|------------|
|
|
172
|
+
| TypeScript | `npm install -g typescript-language-server` |
|
|
173
|
+
| Python | `npm install -g pyright` |
|
|
174
|
+
| Rust | `rustup component add rust-analyzer` |
|
|
175
|
+
| Go | `go install golang.org/x/tools/gopls@latest` |
|
|
176
|
+
|
|
177
|
+
You don't need to understand what these are. The agent handles everything.
|
|
178
|
+
|
|
179
|
+
4. Verify:
|
|
180
|
+
repomap.exe doctor
|
|
181
|
+
|
|
182
|
+
Note for LLM agent: on Windows the binary is repomap.exe. If repomap.exe is on
|
|
183
|
+
PATH, the SKILL.md commands (repomap overview, repomap verify, etc.) work as-is.
|
|
184
|
+
If not on PATH, use the full path or repomap.exe in every command.
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
> After installation, the agent automatically uses repomap during coding tasks — it calls commands like `overview`, `impact`, and `verify` on its own when needed.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Typical Usage
|
|
192
|
+
|
|
193
|
+
> You don't type these commands yourself. The AI agent uses the repomap skill during its work — it decides when to call `overview`, `impact`, `verify`, etc. based on what you ask it to do.
|
|
194
|
+
|
|
195
|
+
### Before editing
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# First contact: get project structure
|
|
199
|
+
repomap overview --project /path/to/project
|
|
200
|
+
|
|
201
|
+
# Search by business keyword (when you don't know file names)
|
|
202
|
+
repomap query --project /path/to/project --query "auth token refresh"
|
|
203
|
+
|
|
204
|
+
# Inspect a file before reading it
|
|
205
|
+
repomap file-detail --project /path/to/project --file-path src/auth/login.ts
|
|
206
|
+
|
|
207
|
+
# Assess impact before changing a file
|
|
208
|
+
repomap impact --project /path/to/project --files src/auth/login.ts --with-symbols
|
|
209
|
+
|
|
210
|
+
# Trace who calls a function and what it calls
|
|
211
|
+
repomap call-chain --project /path/to/project --symbol refreshToken
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### After editing
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Quick: changed files + risk + suggested tests
|
|
218
|
+
repomap verify --project /path/to/project --quick
|
|
219
|
+
|
|
220
|
+
# Full: above + compiler/linter diagnostics + optional LSP
|
|
221
|
+
repomap verify --project /path/to/project
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## All Commands
|
|
227
|
+
|
|
228
|
+
| Command | Purpose |
|
|
229
|
+
|---------|---------|
|
|
230
|
+
| `overview` | Project map: entry points, hotspots, key symbols (by PageRank), reading order |
|
|
231
|
+
| `query --query <keywords>` | Topic/keyword search across paths, filenames, and symbols |
|
|
232
|
+
| `file-detail --file-path <file>` | All symbols in a file: signatures, visibility, PageRank scores |
|
|
233
|
+
| `impact --files <files> --with-symbols` | Pre-edit blast radius: affected files, key symbols, risk level, suggested tests |
|
|
234
|
+
| `call-chain --symbol <name>` | Callers and callees of a symbol, sorted by importance |
|
|
235
|
+
| `query-symbol --symbol <name>` | Exact or fuzzy symbol lookup (shows definition location) |
|
|
236
|
+
| `refs --symbol <name>` | All references to a symbol (opt-in LSP for precise results) |
|
|
237
|
+
| `verify` | Post-edit gate: git changes, risk, diagnostics, suggested tests |
|
|
238
|
+
| `verify --quick` | Post-edit risk-only (skips compiler/LSP, faster) |
|
|
239
|
+
| `check` | Language diagnostics: tsc, cargo check, ruff, mypy, go vet |
|
|
240
|
+
| `routes --json` | HTTP API route inventory (FastAPI, Express, Axum, Spring Boot) |
|
|
241
|
+
| `orphan` | Dead-code candidate detection with confidence tiers |
|
|
242
|
+
| `lsp doctor` | Check locally installed LSP servers (typescript, pyright, rust-analyzer, gopls) |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Supported Languages
|
|
247
|
+
|
|
248
|
+
> **You don't need to do anything.** The AI agent handles language setup automatically during install — just tell it which languages you use.
|
|
249
|
+
|
|
250
|
+
8 languages work out of the box: Python, JavaScript, TypeScript (TSX), Go, Rust, HTML, CSS, JSON.
|
|
251
|
+
|
|
252
|
+
7 more (Java, Kotlin, Swift, C/C++, C#, PHP, Ruby) need one extra command that the agent runs for you: `uv sync --all-extras`.
|
|
253
|
+
|
|
254
|
+
For deeper analysis, the agent can use language servers already on your machine. If missing, install:
|
|
255
|
+
|
|
256
|
+
| Language | Install command |
|
|
257
|
+
|----------|----------------|
|
|
258
|
+
| TypeScript | `npm install -g typescript-language-server` |
|
|
259
|
+
| Python | `npm install -g pyright` |
|
|
260
|
+
| Rust | `rustup component add rust-analyzer` |
|
|
261
|
+
| Go | `go install golang.org/x/tools/gopls@latest` |
|
|
262
|
+
|
|
263
|
+
Without them, `overview` / `query` / `impact` still work — LSP only adds extra precision for symbol-level lookups.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Origin
|
|
268
|
+
|
|
269
|
+
`repomap`'s name and core idea come from **[aider](https://github.com/Aider-AI/aider)**. aider's author Paul Gauthier pioneered "repo mapping" — using tree-sitter + PageRank to give CLI AI agents codebase awareness. He proved a counterintuitive insight: a compact structural map often outperforms large amounts of raw code for agent understanding. We keep the "repo map" name to honor that origin.
|
|
270
|
+
|
|
271
|
+
`repomap` extends the concept: 15 languages, incremental scanning, pre-edit impact analysis, post-edit verification, and optional local LSP integration. Built by [@gjczone](https://github.com/gjczone), a non-programmer, using DeepSeek-V4-Pro, with GLM-5.1 and MIMO-V2.5-Pro for cross-validation and review.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Related Projects
|
|
276
|
+
|
|
277
|
+
- **[aider](https://github.com/Aider-AI/aider)** — the original CLI repo mapping pioneer. Paul Gauthier first conceived of tree-sitter + PageRank for AI-agent codebase awareness. This project stands on that foundation.
|
|
278
|
+
- **[DeepSeek-TUI](https://github.com/Hmbown/DeepSeek-TUI)** — `deepmap` (Rust port of `repomap`'s engine, [PR submitted](https://github.com/Hmbown/DeepSeek-TUI/pulls?q=deepmap))
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
MIT — [LICENSE](./LICENSE)
|