sigmap 5.9.0 → 6.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/README.md CHANGED
@@ -2,420 +2,121 @@
2
2
 
3
3
  <img src="assets/logo.png" alt="SigMap logo" width="80" height="80" />
4
4
 
5
- <h1>⚡ SigMap</h1>
5
+ # SigMap
6
6
 
7
- <p><strong>WITHOUT SIGMAP, YOUR AI IS GUESSING.</strong><br>
8
- <strong>Without structured context, AI often reads the wrong file and fills the gaps with guesses.</strong></p>
9
-
10
- <p><sub>Run one command. Force every answer to come from real code.</sub></p>
11
-
12
- </div>
13
-
14
- <div align="center">
15
- <img src="docs/impact-banner.svg" alt="SigMap — grounded AI coding context with fewer prompts and smaller context windows" width="760" />
16
- </div>
17
-
18
- ```sh
19
- npx sigmap # 10 seconds. zero config. your AI never reads the wrong file again.
20
- ```
21
-
22
- **What you get in ~10 seconds**
23
- - A compact signature map of your codebase
24
- - The right file in context far more often (80.0% hit@5 vs 13.6% random)
25
- - Fewer retries (1.68 vs 2.84 prompts per task)
26
- - Far smaller context (~2K–4K tokens instead of ~80K)
27
-
28
- > Latest: **v5.9.0** — Binary Polish & Community Benchmarks. SHA-256 checksum generation for binaries, `sigmap bench --submit` for community benchmark sharing, extended binary smoke tests covering the full v5.x workflow.
29
-
30
- **What's new in v5.9**
31
- - `sigmap bench --submit` — formats local benchmark history as a shareable community block (text and `--json`)
32
- - Binary builds now write a `.sha256` checksum file alongside each artifact
33
- - `scripts/verify-checksums.mjs` — verify any downloaded binary against its checksum
34
- - Extended `verify-binary.mjs` smoke tests: `ask`, `weights`, `history`, `bench --submit`
35
-
36
- **Daily workflow**
37
-
38
- ```bash
39
- npx sigmap
40
- sigmap ask "explain the auth flow"
41
- sigmap validate --query "auth login token"
42
- sigmap judge --response response.txt --context .context/query-context.md
43
- sigmap weights
44
- ```
45
-
46
- <div align="center">
47
- <img src="demo.gif" alt="SigMap demo — reducing 80K tokens to 4K in under 10 seconds" width="760" />
48
- </div>
49
-
50
- <details>
51
- <summary><strong>Trust signals</strong></summary>
52
-
53
- <div align="center">
7
+ **SigMap finds the right files before your AI answers.**
54
8
 
55
9
  [![npm version](https://img.shields.io/npm/v/sigmap?color=7c6af7&label=latest&logo=npm)](https://www.npmjs.com/package/sigmap)
56
10
  [![CI](https://github.com/manojmallick/sigmap/actions/workflows/ci.yml/badge.svg)](https://github.com/manojmallick/sigmap/actions/workflows/ci.yml)
57
11
  [![Zero deps](https://img.shields.io/badge/dependencies-zero-22c55e)](package.json)
58
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-7c6af7.svg)](LICENSE)
59
- [![VS Code](https://img.shields.io/badge/VS%20Code-extension-0078d4?logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap)
60
- [![JetBrains](https://img.shields.io/badge/JetBrains-plugin-000000?logo=jetbrains)](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/)
61
- [![Docs](https://img.shields.io/badge/docs-live-7c6af7?logo=github-pages)](https://manojmallick.github.io/sigmap)
62
13
  [![GitHub Stars](https://img.shields.io/github/stars/manojmallick/sigmap?style=flat&color=f59e0b&logo=github)](https://github.com/manojmallick/sigmap/stargazers)
63
14
 
64
15
  </div>
65
16
 
66
- </details>
67
-
68
- <details>
69
- <summary><strong>Full benchmark breakdown →</strong></summary>
70
-
71
- <br/>
72
-
73
- <div align="center">
74
- <img src="docs/comparison-chart.svg" alt="SigMap benchmark — before vs after across 3 RAG quality metrics" width="700" />
75
- <br/><sub><a href="https://manojmallick.github.io/sigmap/guide/task-benchmark.html">90 tasks · 18 real repos · no LLM API · <strong>full methodology →</strong></a></sub>
76
- </div>
77
-
78
- | | Without SigMap | With SigMap |
79
- |---|:---:|:---:|
80
- | Task success | 10% | **52.2%** |
81
- | Prompts per task | 2.84 | **1.68** |
82
- | Tokens per session | ~80,000 | **~2,000** |
83
- | Right file found | 13.6% | **80.0%** |
84
- | Hidden-symbol risk | 74.7% | **context surfaced locally** |
85
-
86
- Measured on 90 coding tasks across 18 real public repos. Full methodology and raw benchmark pages are linked below.
87
-
88
- </details>
89
-
90
- ---
91
-
92
- ## Table of contents
93
-
94
- | | |
95
- |---|---|
96
- | [What it does](#-what-it-does) | Token reduction table, pipeline overview |
97
- | [Quick start](#-quick-start) | Install (binary or npm), generate in 60 seconds |
98
- | [Standalone binaries](docs/readmes/binaries.md) | macOS, Linux, Windows — no Node required |
99
- | [VS Code extension](#-vs-code-extension) | Status bar, stale alerts, commands |
100
- | [JetBrains plugin](#-jetbrains-plugin) | IntelliJ IDEA, WebStorm, PyCharm support |
101
- | [Neovim plugin](#-neovim-plugin) | `:SigMap`, `:SigMapQuery`, statusline, health check |
102
- | [Languages supported](#-languages-supported) | 29 languages |
103
- | [Context strategies](#-context-strategies) | full / per-module / hot-cold |
104
- | [MCP server](#-mcp-server) | 8 on-demand tools |
105
- | [CLI reference](#-cli-reference) | All flags |
106
- | [Configuration](#-configuration) | Config file + .contextignore |
107
- | [Observability](#-observability) | Health score, reports, CI |
108
- | [Programmatic API](#-programmatic-api) | Use as a Node.js library |
109
- | [Testing](#-testing) | Run the test suite |
110
- | [Project structure](#-project-structure) | File-by-file map |
111
- | [Principles](#-principles) | Design decisions |
112
-
113
- > 📖 **New to SigMap?** Read the **[Complete Getting Started Guide](docs/readmes/GETTING_STARTED.md)** — token savings walkthrough, every command, VS Code plugin, and CI setup.
114
-
115
- ---
116
-
117
- ## 🔍 What it does
118
-
119
- SigMap scans your source files and extracts only the **function and class signatures** — no bodies, no imports, no comments — then writes a compact context file that Copilot, Claude, Cursor, and Windsurf read automatically. Every session starts with full codebase awareness at a fraction of the token cost.
120
-
121
- ```
122
- Your codebase
123
-
124
-
125
- sigmap ─────────► extracts signatures from 29 languages
126
-
127
-
128
- .github/copilot-instructions.md ◄── auto-read by Copilot / Claude / Cursor
129
-
130
-
131
- AI agent session starts with full context
132
- ```
133
-
134
- > **Dogfooding:** SigMap runs on itself — 40 JS files, 8,600 lines of code.
135
- > View the generated context: [`.github/copilot-instructions.md`](.github/copilot-instructions.md)
136
-
137
- ### Token reduction at every stage
138
-
139
- | Stage | Tokens | Reduction |
140
- |---|---:|---:|
141
- | Raw source files | ~80,000 | — |
142
- | Repomix compressed | ~8,000 | 90% |
143
- | **SigMap signatures** | **~4,000** | **95%** |
144
- | SigMap + MCP (`hot-cold`) | ~200 | **99.75%** |
145
-
146
- > **98.1% fewer tokens in the latest saved benchmark snapshot.**
147
-
148
- ### Benchmark: real-world repos
149
-
150
- Reproduced with `node scripts/run-benchmark.mjs` on public repos:
151
-
152
- | Repo | Language | Raw tokens | After SigMap | Reduction |
153
- |------|----------|------------|--------------|-----------|
154
- | express | JavaScript | 70.6K | 911 | **98.7%** |
155
- | flask | Python | 147.9K | 6.7K | **95.4%** |
156
- | gin | Go | 216.4K | 6.0K | **97.2%** |
157
- | spring-petclinic | Java | 97.9K | 3.4K | **96.5%** |
158
- | rails | Ruby | 1.5M | 7.1K | **99.5%** |
159
- | axios | TypeScript | 105.7K | 6.1K | **94.3%** |
160
- | rust-analyzer | Rust | 3.5M | 6.3K | **99.8%** |
161
- | abseil-cpp | C++ | 2.3M | 6.3K | **99.7%** |
162
- | serilog | C# | 195.5K | 6.9K | **96.4%** |
163
- | riverpod | Dart | 747.2K | 6.5K | **99.1%** |
164
- | okhttp | Kotlin | 31.3K | 1.4K | **95.5%** |
165
- | laravel | PHP | 1.7M | 7.2K | **99.6%** |
166
- | akka | Scala | 790.5K | 7.1K | **99.1%** |
167
- | vapor | Swift | 171.4K | 6.4K | **96.2%** |
168
- | vue-core | Vue | 414.4K | 8.6K | **97.9%** |
169
- | svelte | Svelte | 438.2K | 8.0K | **98.2%** |
170
- | fastify | JavaScript | 54.4K | 2.6K | **95.3%** |
171
- | fastapi | Python | 178.4K | 5.2K | **97.1%** |
172
-
173
- **Average: 97.6% reduction across 18 repos (16 languages).** See [`benchmarks/reports/token-reduction.md`](benchmarks/reports/token-reduction.md), open `benchmarks/reports/benchmark-report.html` after a matrix run, or reproduce with `node scripts/run-benchmark.mjs`.
174
-
175
17
  ---
176
18
 
177
- ## Installation
178
-
179
- Pick the method that fits your workflow — all produce the same output.
180
-
181
- <details open>
182
- <summary><strong>npx — try without installing</strong></summary>
19
+ ## Try it now
183
20
 
184
21
  ```bash
185
22
  npx sigmap
23
+ sigmap ask "Where is auth handled?"
24
+ sigmap validate
25
+ sigmap judge
186
26
  ```
187
27
 
188
- Runs the latest version without any permanent install. Great for a quick try.
189
-
190
- </details>
191
-
192
- <details>
193
- <summary><strong>npm global — install once, run anywhere</strong></summary>
194
-
195
- ```bash
196
- npm install -g sigmap
197
- sigmap
198
- ```
199
-
200
- Available from any directory on your machine.
201
-
202
- </details>
203
-
204
- <details>
205
- <summary><strong>Standalone binaries — no Node.js, no npm</strong></summary>
206
-
207
- Download from the latest release:
208
-
209
- - <https://github.com/manojmallick/sigmap/releases/latest>
210
-
211
- Available assets:
212
-
213
- - `sigmap-darwin-arm64` (macOS Apple Silicon)
214
- - `sigmap-linux-x64` (Linux x64)
215
- - `sigmap-win32-x64.exe` (Windows x64)
216
- - `sigmap-checksums.txt` (SHA-256 checksums)
217
-
218
- <details>
219
- <summary><strong>macOS / Linux</strong></summary>
220
-
221
- Run directly:
222
-
223
- ```bash
224
- chmod +x ./sigmap-darwin-arm64 # or ./sigmap-linux-x64
225
- ./sigmap-darwin-arm64 --help
226
- ./sigmap-darwin-arm64
227
- ```
228
-
229
- Make it globally available in Bash/Zsh (no `./` needed):
230
-
231
- ```bash
232
- # 1) Pick a user bin dir and move/rename the binary
233
- mkdir -p "$HOME/.local/bin"
234
- mv ./sigmap-darwin-arm64 "$HOME/.local/bin/sigmap" # or sigmap-linux-x64
235
- chmod +x "$HOME/.local/bin/sigmap"
236
-
237
- # 2) Add to PATH in your shell profile
238
- echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.zshrc" # zsh
239
- # echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc" # bash
240
-
241
- # 3) Reload shell and verify
242
- source "$HOME/.zshrc" # or: source "$HOME/.bashrc"
243
- sigmap --version
244
- ```
245
-
246
- </details>
247
-
248
- <details>
249
- <summary><strong>Windows (PowerShell)</strong></summary>
250
-
251
- Run directly:
252
-
253
- ```powershell
254
- .\sigmap-win32-x64.exe --help
255
- .\sigmap-win32-x64.exe
256
- ```
257
-
258
- Make it globally available:
259
-
260
- ```powershell
261
- # 1) Create a user bin directory and rename the binary
262
- New-Item -ItemType Directory -Force "$HOME\bin" | Out-Null
263
- Move-Item .\sigmap-win32-x64.exe "$HOME\bin\sigmap.exe"
264
-
265
- # 2) Add user bin to PATH (current user)
266
- [Environment]::SetEnvironmentVariable(
267
- "Path",
268
- $env:Path + ";$HOME\bin",
269
- "User"
270
- )
271
-
272
- # 3) Restart PowerShell and verify
273
- sigmap --version
274
- ```
28
+ Zero config. Zero dependencies. Under 10 seconds.
275
29
 
276
- </details>
30
+ ---
277
31
 
278
- Optional checksum verification:
32
+ ## What is SigMap?
279
33
 
280
- ```bash
281
- shasum -a 256 sigmap-darwin-arm64
282
- # Compare with sigmap-checksums.txt
283
- ```
34
+ SigMap extracts function and class signatures from your codebase and feeds the right files — not the whole repo — to your AI.
284
35
 
285
- Full guide: [docs/readmes/binaries.md](docs/readmes/binaries.md)
36
+ Works with Copilot, Claude, Cursor, Windsurf, and any LLM.
286
37
 
287
- </details>
38
+ ---
288
39
 
289
- <details>
290
- <summary><strong>npm local — per-project, version-pinned</strong></summary>
40
+ ## Why SigMap?
291
41
 
292
- ```bash
293
- npm install --save-dev sigmap
294
- ```
42
+ - **80.0% hit@5** — right file found in top 5 results (vs 13.6% baseline)
43
+ - **40–98% token reduction** — 2K–4K tokens instead of 80K+
44
+ - **52.2% task success rate** — up from 10% without context
45
+ - **1.68 prompts per task** — down from 2.84
46
+ - **Works with any LLM** — no API key, no cloud, no accounts
47
+ - **Zero npm dependencies** — `npx sigmap` on any machine
295
48
 
296
- Add to `package.json` scripts for team consistency:
49
+ ---
297
50
 
298
- ```json
299
- {
300
- "scripts": {
301
- "context": "sigmap",
302
- "context:watch": "sigmap --watch"
303
- }
304
- }
305
- ```
51
+ ## Replace this with SigMap
306
52
 
307
- Run with `npm run context`. Version is pinned per project.
53
+ | Without SigMap | With SigMap |
54
+ |---|---|
55
+ | ❌ Guessing which files are relevant | ✅ Correct file selection every time |
56
+ | ❌ Sending the full repo to your AI | ✅ Minimal context — only what matters |
57
+ | ❌ Embeddings / vector DB required | ✅ Grounded answers, no infra needed |
308
58
 
309
- </details>
59
+ ---
310
60
 
311
- <details>
312
- <summary><strong>Volta — team-friendly, auto-pinned version</strong></summary>
61
+ ## How it works
313
62
 
314
- ```bash
315
- volta install sigmap
316
- sigmap
317
63
  ```
318
-
319
- [Volta](https://volta.sh) pins the exact version in `package.json` — every team member runs the same version automatically without configuration.
320
-
321
- </details>
322
-
323
- <details>
324
- <summary><strong>Single-file download — no npm, any machine</strong></summary>
325
-
326
- ```bash
327
- curl -O https://raw.githubusercontent.com/manojmallick/sigmap/main/gen-context.js
328
- node gen-context.js
64
+ Ask → Rank → Context → Validate → Judge → Learn
329
65
  ```
330
66
 
331
- No npm, no `node_modules`. Drop `gen-context.js` into any project and run it directly. Requires only Node.js 18+. Ideal for CI, locked-down environments, or one-off use.
332
-
333
- </details>
67
+ 1. **Ask** `sigmap ask "Where is auth handled?"` ranked file list
68
+ 2. **Rank** — TF-IDF scores every file against your query
69
+ 3. **Context** — writes compact signatures to your AI's context file
70
+ 4. **Validate** — `sigmap validate` — confirms right files are in scope
71
+ 5. **Judge** — `sigmap judge` — scores answer groundedness against context
72
+ 6. **Learn** — `sigmap weights` — boosts files that keep solving your tasks
334
73
 
335
74
  ---
336
75
 
337
- ## 🚀 Features
338
-
339
- ### Multi-adapter output
340
-
341
- Generate context for any AI assistant from a single run:
76
+ ## Benchmark
342
77
 
343
- ```bash
344
- sigmap --adapter copilot # → .github/copilot-instructions.md
345
- sigmap --adapter claude # → CLAUDE.md (appended below marker)
346
- sigmap --adapter cursor # → .cursorrules
347
- sigmap --adapter windsurf # → .windsurfrules
348
- sigmap --adapter openai # → .github/openai-context.md
349
- sigmap --adapter gemini # → .github/gemini-context.md (appended below marker)
350
- sigmap --adapter codex # → AGENTS.md (appended below marker)
351
78
  ```
79
+ Benchmark : sigmap-v5.9-main
80
+ Date : 2026-04-19
352
81
 
353
- | Adapter | Output file | AI assistant |
354
- |---|---|---|
355
- | `copilot` | `.github/copilot-instructions.md` (append) | GitHub Copilot |
356
- | `claude` | `CLAUDE.md` (append) | Claude / Claude Code |
357
- | `cursor` | `.cursorrules` | Cursor |
358
- | `windsurf` | `.windsurfrules` | Windsurf |
359
- | `openai` | `.github/openai-context.md` | Any OpenAI model |
360
- | `gemini` | `.github/gemini-context.md` (append) | Google Gemini |
361
- | `codex` | `AGENTS.md` (append) | OpenAI Codex |
362
-
363
- Configure multiple adapters at once in `gen-context.config.json`:
364
-
365
- ```json
366
- { "outputs": ["copilot", "claude", "cursor"] }
82
+ Hit@5 : 80.0% (baseline 13.6% — 5.9× lift)
83
+ Prompt reduction : 40.8%
84
+ Task success : 52.2% (baseline 10%)
85
+ Prompts / task : 1.68 (baseline 2.84)
86
+ Token reduction: 40–98% (avg 97.6% across 18 real repos)
367
87
  ```
368
88
 
369
- ### Programmatic API
89
+ Measured on 90 coding tasks across 18 real public repos. No LLM API — fully reproducible.
370
90
 
371
- Use SigMap as a Node.js library without spawning a subprocess. See the [full API reference](#-programmatic-api) below.
91
+ [Full methodology ](https://manojmallick.github.io/sigmap/guide/benchmark.html)
372
92
 
373
- ### Custom output path
93
+ <div align="center">
94
+ <img src="docs/comparison-chart.svg" alt="SigMap benchmark — before vs after across 3 RAG quality metrics" width="700" />
95
+ </div>
374
96
 
375
- Write signatures to any file location — useful for shared docs folders, monorepos,
376
- or tooling that expects context at a non-standard path:
97
+ ---
377
98
 
378
- ```bash
379
- sigmap --output .context/ai-context.md # write to custom path
380
- sigmap --adapter claude --output shared/sigs.md # adapter + custom path
381
- ```
99
+ ## Install
382
100
 
383
- The path is persisted to `gen-context.config.json`, so `--query` finds it
384
- automatically on subsequent runs — no need to pass `--output` again:
101
+ **Try without installing:**
385
102
 
386
103
  ```bash
387
- sigmap --output .context/ai-context.md # generates and saves the path
388
- sigmap --query "add an extractor" # auto-discovers .context/ai-context.md
104
+ npx sigmap
389
105
  ```
390
106
 
391
- ### Query-aware retrieval
392
-
393
- Find the most relevant files for any task without reading the whole codebase:
107
+ **Install globally:**
394
108
 
395
109
  ```bash
396
- sigmap --query "authentication middleware" # ranked file list
397
- sigmap --query "auth" --json # machine-readable output
398
- sigmap --query "auth" --top 5 # top 5 results only
399
- sigmap --query "auth" --adapter claude # query against CLAUDE.md specifically
110
+ npm install -g sigmap
400
111
  ```
401
112
 
402
- ### Diagnostic and evaluation tools
113
+ **Install per-project:**
403
114
 
404
115
  ```bash
405
- sigmap --analyze # per-file: sigs, tokens, extractor, coverage
406
- sigmap --analyze --slow # include extraction timing
407
- sigmap --diagnose-extractors # self-test all 21 extractors against fixtures
408
- sigmap --benchmark # hit@5 and MRR retrieval quality
409
- sigmap --benchmark --json # machine-readable benchmark results
116
+ npm install --save-dev sigmap
410
117
  ```
411
118
 
412
- ---
413
-
414
- ## ⚡ Quick start
415
-
416
- ### Install
417
-
418
- **Standalone binary** — no Node.js or npm required:
119
+ **Standalone binary** — no Node.js required:
419
120
 
420
121
  | Platform | Download |
421
122
  |---|---|
@@ -424,705 +125,143 @@ sigmap --benchmark --json # machine-readable benchmark results
424
125
  | Linux x64 | [`sigmap-linux-x64`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-linux-x64) |
425
126
  | Windows x64 | [`sigmap-win32-x64.exe`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-win32-x64.exe) |
426
127
 
427
- ```bash
428
- # macOS / Linux
429
- chmod +x ./sigmap-darwin-arm64
430
- ./sigmap-darwin-arm64
431
- ```
432
-
433
- See [docs/readmes/binaries.md](docs/readmes/binaries.md) for Gatekeeper / SmartScreen notes and checksum verification.
128
+ Each binary ships with a `.sha256` checksum. [Verify a binary →](docs/readmes/binaries.md)
434
129
 
435
- **npm** (requires Node.js 18+):
130
+ **Volta:**
436
131
 
437
132
  ```bash
438
- npx sigmap # run once without installing
439
- npm install -g sigmap # install globally
440
- ```
441
-
442
- ---
443
-
444
- ### Generate context
445
-
446
- Once installed, run from your project root:
447
-
448
- ```bash
449
- sigmap # generate once and exit
450
- sigmap --watch # regenerate on every file save
451
- sigmap --setup # generate + install git hook + start watcher
452
- sigmap --diff # context for git-changed files only (PR mode)
453
- sigmap --diff --staged # staged files only (pre-commit check)
454
- sigmap --health # show context health score (grade A–D)
455
- sigmap --mcp # start MCP server on stdio
456
- ```
457
-
458
- ### Companion tool: Repomix
459
-
460
- SigMap and [Repomix](https://github.com/yamadashy/repomix) are **complementary, not competing**:
461
-
462
- | Tool | When to use |
463
- |---|---|
464
- | **SigMap** | Always-on, git hooks, daily signature index (~4K tokens) |
465
- | **Repomix** | On-demand deep sessions, full file content, broader language support |
466
-
467
- ```bash
468
- sigmap --setup # always-on context
469
- npx repomix --compress # deep dive sessions
470
- ```
471
-
472
- *"SigMap for daily always-on context; Repomix for deep one-off sessions — use both."*
473
-
474
- ---
475
-
476
- ## 🧩 VS Code extension
477
-
478
- The official SigMap VS Code extension keeps your context fresh without any manual commands. Install it once and it runs silently in the background.
479
-
480
- | Feature | Detail |
481
- |---|---|
482
- | **Status bar item** | Shows health grade (`A`/`B`/`C`/`D`) + time since last regen; refreshes every 60 s |
483
- | **Stale notification** | Warns when `copilot-instructions.md` is > 24 h old; one-click regeneration |
484
- | **Regenerate command** | `SigMap: Regenerate Context` — runs `sigmap` in the integrated terminal |
485
- | **Open context command** | `SigMap: Open Context File` — opens `.github/copilot-instructions.md` |
486
- | **Script path setting** | `sigmap.scriptPath` — override the path to the `sigmap` binary or `gen-context.js` |
487
-
488
- <div align="center">
489
- <img src="vscode.gif" alt="SigMap VS Code extension — status bar, stale notification, regenerate context" width="760" />
490
- </div>
491
-
492
-
493
- Activates on startup (`onStartupFinished`) — loads within 3 s, never blocks editor startup.
494
-
495
- **Install:** [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) | [Open VSX Registry](https://open-vsx.org/extension/manojmallick/sigmap)
496
-
497
- ---
498
-
499
- ## 🔧 JetBrains plugin
500
-
501
- The official SigMap JetBrains plugin brings the same features to IntelliJ-based IDEs. Install it from the JetBrains Marketplace and it works identically to the VS Code extension.
502
-
503
- <div align="center">
504
- <img src="assets/intelij.gif" alt="SigMap JetBrains plugin — status bar health grade, regenerate action, and context auto-refresh in IntelliJ IDEA" width="700" />
505
- </div>
506
-
507
- | Feature | Detail |
508
- |---|---|
509
- | **Status bar widget** | Shows health grade (`A`-`F`) + time since last regen; updates every 60 s |
510
- | **Regenerate action** | `Tools → SigMap → Regenerate Context` or **Ctrl+Alt+G** — runs `sigmap` |
511
- | **Open context action** | `Tools → SigMap → Open Context File` — opens `.github/copilot-instructions.md` |
512
- | **View roadmap action** | `Tools → SigMap → View Roadmap` — opens roadmap in browser |
513
- | **One-click regen** | Click status bar widget to regenerate context instantly |
514
-
515
- Compatible with **IntelliJ IDEA 2024.1+** (Community & Ultimate), **WebStorm**, **PyCharm**, **GoLand**, **RubyMine**, **PhpStorm**, and all other IntelliJ-based IDEs.
516
-
517
- **Install:** [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/) | [Manual setup guide](docs/readmes/JETBRAINS_SETUP.md)
518
-
519
- ---
520
-
521
- ## 🖥️ Neovim plugin
522
-
523
- <a href="https://dotfyle.com/plugins/manojmallick/sigmap.nvim">
524
- <img src="https://dotfyle.com/plugins/manojmallick/sigmap.nvim/shield?style=flat" />
525
- </a>
526
-
527
- The official SigMap Neovim plugin (`sigmap.nvim`) brings first-class integration to the #1 most-admired editor (Stack Overflow 2025, 83% admiration rate). Power users who live in the terminal get context regeneration, ranked retrieval, and health checks without leaving Neovim.
528
-
529
- | Feature | Detail |
530
- |---|---|
531
- | **`:SigMap [args]`** | Regenerate your AI context file asynchronously |
532
- | **`:SigMapQuery <text>`** | TF-IDF ranked retrieval — results appear in a centered floating window |
533
- | **Auto-run on save** | `auto_run = true` triggers regen on `BufWritePost` for `.js/ts/py/go/rs/java/rb/lua` |
534
- | **Statusline widget** | `require('sigmap').statusline()` returns `sm:✓` (fresh) or `sm:⚠ Nh` (stale) |
535
- | **`:checkhealth sigmap`** | Validates Node 18+, binary presence, and context file freshness |
536
- | **Binary auto-detection** | Finds `sigmap` → `npx sigmap` → local `gen-context.js` automatically |
537
-
538
- **Install (lazy.nvim):**
539
- ```lua
540
- { 'manojmallick/sigmap.nvim',
541
- config = function()
542
- require('sigmap').setup({
543
- auto_run = true, -- regenerate on save
544
- float_query = true, -- show query results in a floating window
545
- })
546
- end,
547
- }
133
+ volta install sigmap
548
134
  ```
549
135
 
550
- **Repo:** [manojmallick/sigmap.nvim](https://github.com/manojmallick/sigmap.nvim)
551
-
552
136
  ---
553
137
 
554
- ## 🌐 Languages supported
555
-
556
- > 29 languages and formats. All implemented with zero external dependencies — pure regex + Node built-ins.
557
- >
558
- > Also includes lightweight config/doc extraction for `.toml`, `.properties`, `.xml`, and `.md` to improve real-repo coverage beyond source-code files.
138
+ ## Integrations
559
139
 
560
- <details>
561
- <summary><strong>Show all 29 languages</strong></summary>
140
+ **AI assistants — one run, all of them:**
562
141
 
563
- | Language | Extensions | Extracts |
142
+ | Adapter | Output file | Used by |
564
143
  |---|---|---|
565
- | TypeScript | `.ts` `.tsx` | interfaces, classes, functions, types, enums |
566
- | JavaScript | `.js` `.jsx` `.mjs` `.cjs` | classes, functions, exports |
567
- | Python | `.py` `.pyw` | classes, methods, functions |
568
- | Java | `.java` | classes, interfaces, methods |
569
- | Kotlin | `.kt` `.kts` | classes, data classes, functions |
570
- | Go | `.go` | structs, interfaces, functions |
571
- | Rust | `.rs` | structs, impls, traits, functions |
572
- | C# | `.cs` | classes, interfaces, methods |
573
- | C/C++ | `.cpp` `.c` `.h` `.hpp` `.cc` | classes, functions, templates |
574
- | Ruby | `.rb` `.rake` | classes, modules, methods |
575
- | PHP | `.php` | classes, interfaces, functions |
576
- | Swift | `.swift` | classes, structs, protocols, functions |
577
- | Dart | `.dart` | classes, mixins, functions |
578
- | Scala | `.scala` `.sc` | objects, classes, traits, functions |
579
- | Vue | `.vue` | `<script>` functions and components |
580
- | Svelte | `.svelte` | `<script>` functions and exports |
581
- | HTML | `.html` `.htm` | custom elements and script functions |
582
- | CSS/SCSS | `.css` `.scss` `.sass` `.less` | custom properties and keyframes |
583
- | YAML | `.yml` `.yaml` | top-level keys and pipeline jobs |
584
- | Shell | `.sh` `.bash` `.zsh` `.fish` | function declarations |
585
- | SQL | `.sql` | tables, views, indexes, functions, procedures |
586
- | GraphQL | `.graphql` `.gql` | types, interfaces, enums, operations, fragments |
587
- | Terraform | `.tf` `.tfvars` | resources, modules, variables, outputs |
588
- | Protobuf | `.proto` | messages, services, rpc, enums |
589
- | Dockerfile | `Dockerfile` `Dockerfile.*` | stages and key instructions |
590
-
591
- </details>
592
-
593
- ---
594
-
595
- ## 🗂 Context strategies
596
-
597
- > Reduce always-injected tokens by 70–90%.
598
-
599
- Set `"strategy"` in `gen-context.config.json`:
600
-
601
- | Strategy | Always-injected | Context lost? | Needs MCP? | Best for |
602
- |---|---:|:---:|:---:|---|
603
- | `full` | ~4,000 tokens | No | No | Starting out, cross-module work |
604
- | `per-module` | ~100–300 tokens | No | No | Large codebases, module-focused sessions |
605
- | `hot-cold` | ~200–800 tokens | Cold files only | Yes | Claude Code / Cursor with MCP enabled |
606
-
607
- ### `full` — default, works everywhere
608
-
609
- ```json
610
- { "strategy": "full" }
611
- ```
612
-
613
- One file, all signatures, always injected on every question.
614
-
615
- ### `per-module` — 70% fewer injected tokens, zero context loss
616
-
617
- ```json
618
- { "strategy": "per-module" }
619
- ```
620
-
621
- One `.github/context-<module>.md` per top-level source directory, plus a tiny overview table. Load the relevant module file for focused sessions. No MCP required.
622
-
623
- ```
624
- .github/copilot-instructions.md ← overview table, ~117 tokens (always-on)
625
- .github/context-server.md ← server/ signatures, ~2,140 tokens
626
- .github/context-web.md ← web/ signatures, ~335 tokens
627
- .github/context-desktop.md ← desktop/ signatures, ~1,583 tokens
628
- ```
629
-
630
- ### `hot-cold` — 90% fewer injected tokens, requires MCP
631
-
632
- ```json
633
- { "strategy": "hot-cold", "hotCommits": 10 }
634
- ```
635
-
636
- Recently committed files are **hot** (auto-injected). Everything else is **cold** (on-demand via MCP). Best reduction available — ~200 tokens always-on.
637
-
638
- 📖 Full guide: [docs/readmes/CONTEXT_STRATEGIES.md](docs/readmes/CONTEXT_STRATEGIES.md) — decision tree, scenario comparisons, migration steps.
639
-
640
- ---
641
-
642
- ## 🔌 MCP server
643
-
644
- Start the MCP server on stdio:
144
+ | `copilot` | `.github/copilot-instructions.md` | GitHub Copilot |
145
+ | `claude` | `CLAUDE.md` | Claude / Claude Code |
146
+ | `cursor` | `.cursorrules` | Cursor |
147
+ | `windsurf` | `.windsurfrules` | Windsurf |
148
+ | `openai` | `.github/openai-context.md` | OpenAI models |
149
+ | `gemini` | `.github/gemini-context.md` | Google Gemini |
150
+ | `codex` | `AGENTS.md` | OpenAI Codex |
645
151
 
646
152
  ```bash
647
- sigmap --mcp
153
+ sigmap --adapter copilot # default
154
+ sigmap --adapter claude
155
+ sigmap --adapter cursor
648
156
  ```
649
157
 
650
- ### Available tools
651
-
652
- | Tool | Input | Output |
653
- |---|---|---|
654
- | `read_context` | `{ module?: string }` | Signatures for one module or entire codebase |
655
- | `search_signatures` | `{ query: string }` | Matching signatures with file paths |
656
- | `get_map` | `{ type: "imports"\|"classes"\|"routes" }` | Structural section from `PROJECT_MAP.md` |
657
- | `explain_file` | `{ path: string }` | Signatures + imports + reverse callers for one file |
658
- | `list_modules` | — | Token-count table of all top-level module directories |
659
- | `create_checkpoint` | `{ summary: string }` | Write a session checkpoint to `.context/` |
660
- | `get_routing` | — | Full model routing table |
661
- | `query_context` | `{ query: string, topK?: number }` | Files ranked by relevance to the query |
662
-
663
- Reads files on every call — no stale state, no restart needed.
664
-
665
- 📖 Setup guide: [docs/readmes/MCP_SETUP.md](docs/readmes/MCP_SETUP.md)
666
-
667
- ---
668
-
669
- ## ⚙️ CLI reference
158
+ **IDE extensions:**
670
159
 
671
- > See [CHANGELOG.md](CHANGELOG.md) for the full history.
160
+ - [VS Code extension](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) status bar health grade, stale alerts, one-click regen
161
+ - [JetBrains plugin](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/) — IntelliJ IDEA, WebStorm, PyCharm, GoLand
162
+ - [Neovim plugin](https://github.com/manojmallick/sigmap.nvim) — `:SigMap`, `:SigMapQuery`, statusline widget
672
163
 
673
- All flags are the same regardless of how you invoke SigMap — swap the prefix to match your install:
674
-
675
- > `sigmap` · `npx sigmap` · `gen-context` · `node gen-context.js`
676
-
677
- <details>
678
- <summary><strong>All flags</strong></summary>
679
-
680
- ```
681
- sigmap Generate once and exit
682
- sigmap --watch Generate and watch for file changes
683
- sigmap --setup Generate + install git hook + start watcher
684
- sigmap --diff Generate context for git-changed files only
685
- sigmap --diff --staged Staged files only (pre-commit check)
686
- sigmap --mcp Start MCP server on stdio
687
-
688
- sigmap --output <file> Write signatures to a custom path (persists for --query)
689
- sigmap --output <file> --adapter <name> Adapter output + custom copy
690
-
691
- sigmap --query "<text>" Rank files by relevance to a query
692
- sigmap --query "<text>" --json Ranked results as JSON
693
- sigmap --query "<text>" --top <n> Limit results to top N files (default 10)
694
- sigmap --query "<text>" --adapter <name> Query against a specific adapter's output file
695
- sigmap --query "<text>" --output <file> Query against a specific custom file
696
-
697
- sigmap --analyze Per-file breakdown (sigs / tokens / extractor / coverage)
698
- sigmap --analyze --json Analysis as JSON
699
- sigmap --analyze --slow Include extraction timing per file
700
- sigmap --diagnose-extractors Self-test all 21 extractors against fixtures
701
-
702
- sigmap --benchmark Run retrieval quality benchmark (hit@5 / MRR)
703
- sigmap --benchmark --json Benchmark results as JSON
704
- sigmap --eval Alias for --benchmark
705
-
706
- sigmap --report Token reduction stats
707
- sigmap --report --json Structured JSON report (exits 1 if over budget)
708
- sigmap --report --history Usage log summary
709
- sigmap --report --history --json Usage history as JSON
710
-
711
- sigmap --health Composite health score (0–100, grade A–D)
712
- sigmap --health --json Machine-readable health JSON
713
-
714
- sigmap --suggest-tool "<task>" Recommend model tier for a task
715
- sigmap --suggest-tool "<task>" --json Machine-readable tier recommendation
716
-
717
- sigmap --monorepo Per-package context for monorepos (packages/, apps/, services/)
718
- sigmap --each Process each sub-repo under a parent directory
719
- sigmap --routing Include model routing hints in output
720
- sigmap --format cache Write Anthropic prompt-cache JSON
721
- sigmap --track Append run metrics to .context/usage.ndjson
722
-
723
- sigmap --init Write config + .contextignore scaffold
724
- sigmap --version Version string
725
- sigmap --help Usage information
726
- ```
727
- </details>
728
-
729
-
730
- ### Task classification — `--suggest-tool`
164
+ **MCP server** 9 on-demand tools for Claude Code and Cursor:
731
165
 
732
166
  ```bash
733
- sigmap --suggest-tool "security audit of the auth module"
734
- # tier : powerful
735
- # models : claude-opus-4-6, gpt-5-4, gemini-2-5-pro
736
-
737
- sigmap --suggest-tool "fix a typo in the yaml config" --json
738
- # {"tier":"fast","label":"Fast (low-cost)","models":"claude-haiku-4-5, ...","costHint":"~$0.0008 / 1K tokens"}
167
+ sigmap --mcp
739
168
  ```
740
169
 
741
- Tiers: `fast` (config/markup/typos) · `balanced` (features/tests/debug) · `powerful` (architecture/security/multi-file)
742
-
743
170
  ---
744
171
 
745
- ## 🔒 Security scanning
746
-
747
- SigMap automatically redacts secrets from all extracted signatures. Ten patterns are checked on every file:
748
-
749
- | Pattern | Example match |
750
- |---|---|
751
- | AWS Access Key | `AKIA...` |
752
- | AWS Secret Key | 40-char base64 |
753
- | GCP API Key | `AIza...` |
754
- | GitHub Token | `ghp_...` `gho_...` |
755
- | JWT | `eyJ...` |
756
- | DB Connection String | `postgres://user:pass@...` |
757
- | SSH Private Key | `-----BEGIN ... PRIVATE KEY-----` |
758
- | Stripe Key | `sk_live_...` `sk_test_...` |
759
- | Twilio Key | `SK[32 hex chars]` |
760
- | Generic secret | `password = "..."`, `api_key: "..."` |
761
-
762
- If a match is found, the signature is replaced with `[REDACTED — {pattern} detected in {file}]`. The run continues — no silent failures.
763
-
764
- ---
765
-
766
- ## ⚙️ Configuration
767
-
768
- Copy `gen-context.config.json.example` to `gen-context.config.json`:
769
-
770
- ```json
771
- {
772
- "output": ".github/copilot-instructions.md",
773
- "srcDirs": ["src", "app", "lib"],
774
- "outputs": ["copilot"],
775
- "secretScan": true,
776
- "strategy": "full",
777
- "watchDebounce": 300,
778
- "tracking": false
779
- }
780
- ```
781
-
782
- **Key fields:**
783
-
784
- - **`output`** — custom path for the primary markdown output file (used by `copilot` adapter). Default: `.github/copilot-instructions.md`
785
- - **`outputs`** — which adapters to write to: `copilot` | `claude` | `cursor` | `windsurf`
786
- - **`srcDirs`** — directories to scan (relative to project root)
787
- - **`secretScan`** — redact secrets (AWS keys, tokens, etc.) from output
788
- - **`strategy`** — output mode: `full` (default) | `per-module` | `hot-cold`
789
-
790
- **Token budget (auto-scaling):**
791
-
792
- | Key | Default | Description |
793
- |---|---|---|
794
- | `autoMaxTokens` | `true` | Auto-scale budget to repo size. Set `false` to pin a fixed `maxTokens`. |
795
- | `coverageTarget` | `0.80` | Fraction of source files to target (0.0–1.0). |
796
- | `modelContextLimit` | `128000` | Model context window size. Hard cap = `limit × maxTokensHeadroom`. |
797
- | `maxTokensHeadroom` | `0.20` | Fraction of the context window reserved for SigMap output (default: 25 600 tokens). |
798
- | `maxTokens` | `6000` | Used only when `autoMaxTokens: false`, or as a floor. |
799
-
800
- The formula: `effective = clamp(ceil(totalSigTokens × coverageTarget), 4000, floor(modelContextLimit × maxTokensHeadroom))`.
801
-
802
- Exclusions go in `.contextignore` (gitignore syntax). Also reads `.repomixignore` if present.
803
-
804
- ```
805
- # .contextignore
806
- node_modules/
807
- dist/
808
- build/
809
- *.generated.*
810
- test/fixtures/
811
- ```
812
-
813
- Run `sigmap --init` to scaffold both files in one step.
814
-
815
- ### Output targets
816
-
817
- | Key | Output file | Read by |
818
- |---|---|---|
819
- | `"copilot"` | `.github/copilot-instructions.md` *(or custom path via `output`)* | GitHub Copilot |
820
- | `"claude"` | `CLAUDE.md` (appends below marker) | Claude Code |
821
- | `"cursor"` | `.cursorrules` | Cursor |
822
- | `"windsurf"` | `.windsurfrules` | Windsurf |
823
-
824
- The **`output`** config key sets the primary output file path. It is used by the `copilot` adapter when enabled. Other adapters always write to their fixed paths.
825
-
826
- **Example:**
827
-
828
- ```json
829
- {
830
- "output": ".context/ai-context.md",
831
- "outputs": ["copilot"]
832
- }
833
- ```
834
-
835
- This writes to `.context/ai-context.md` instead of `.github/copilot-instructions.md`.
836
-
837
- If `output` is omitted, the default `.github/copilot-instructions.md` is used.
838
-
839
- ## 📊 Observability
840
-
841
- ### Coverage score
842
-
843
- Every run now prints a coverage line alongside token reduction:
844
-
845
- ```
846
- ───────────────────────────────────────────
847
- SigMap v5.6.0
848
- Files scanned : 76
849
- Symbols found : 332
850
- Token reduction: 94% (65,227 → 4,103)
851
- Coverage : A (97%) — 76 of 78 source files included [budget: 4000 auto-scaled]
852
- Output : .github/copilot-instructions.md
853
- ───────────────────────────────────────────
854
- ```
855
-
856
- The **coverage score** answers _how much of your codebase is represented in context_ after the token budget is applied. Grade scale: A ≥ 90% · B ≥ 75% · C ≥ 50% · D < 50%.
857
-
858
- ### Module heatmap in `--report`
172
+ ## Try it
859
173
 
860
174
  ```bash
861
- sigmap --report
862
- ```
863
-
864
- ```
865
- [sigmap] report:
866
- version : 5.6.0
867
- files processed : 76
868
- reduction : 93.7%
869
- coverage : A (97%) — 76 of 78 source files included
870
- confidence : HIGH
871
-
872
- Module Coverage:
873
- src ████████████████ 100% (64/64 files)
874
- packages ██████████████░░ 86% (12/14 files)
875
- ```
175
+ # 1. Generate context for your project
176
+ npx sigmap
876
177
 
877
- Machine-readable JSON (suitable for CI dashboards):
178
+ # 2. Ask a question — get ranked files
179
+ sigmap ask "Where is auth handled?"
878
180
 
879
- ```bash
880
- sigmap --report --json
881
- # { "version": "4.0.0", "finalTokens": 4103, "reductionPct": 93.7,
882
- # "coverage": { "score": 97, "grade": "A", "confidence": "HIGH", ... } }
883
- ```
181
+ # 3. Validate — confirm the right files are in scope
182
+ sigmap validate --query "auth login token"
884
183
 
885
- ### Composite health score
184
+ # 4. Judge score your AI's answer for groundedness
185
+ sigmap judge --response response.txt --context .context/query-context.md
886
186
 
887
- ```bash
187
+ # 5. Inspect health
888
188
  sigmap --health
889
189
  ```
890
190
 
891
- ```
892
- [sigmap] health:
893
- score : 80/100 (grade B)
894
- coverage : A (97%) — 76 of 78 source files
895
- strategy : full
896
- ...
897
- ```
898
-
899
- ```bash
900
- sigmap --health --json
901
- # { "score": 80, "grade": "B", "coverage": 97, "coverageGrade": "A",
902
- # "tokens": 4103, "reduction": 93.7, ... }
903
- ```
904
-
905
- ### Confidence indicators in generated files
906
-
907
- Every output file now carries a metadata line so you can inspect freshness at a glance:
908
-
909
- ```
910
- <!-- sigmap: version=5.6.0 confidence=HIGH coverage=97% dropped=2 commit=8540612 -->
911
- ```
912
-
913
- ### Diff risk score
914
-
915
- ```bash
916
- sigmap --diff HEAD~3
917
- ```
918
-
919
- ```
920
- [sigmap] Risk: Changed files (4):
921
- src/auth/service.ts [HIGH] — exports public API, 5 downstream dependents
922
- src/config/database.ts [MEDIUM] — config file
923
- src/utils/format.ts [LOW] — no dependents, internal utility
924
- ```
925
-
926
- ### Self-healing CI
927
-
928
- Copy `examples/self-healing-github-action.yml` to `.github/workflows/` to auto-regenerate context when:
929
- - Context file is more than 7 days old (always active)
930
- - Copilot acceptance rate drops below 30% (requires `COPILOT_API_TOKEN` — GitHub Enterprise)
931
-
932
- ```yaml
933
- - name: SigMap health check
934
- run: sigmap --health --json
935
- - name: Regenerate context
936
- run: sigmap
937
- ```
938
-
939
- 📖 Full guide: [docs/readmes/ENTERPRISE_SETUP.md](docs/readmes/ENTERPRISE_SETUP.md)
940
-
941
- ### Prompt caching — 60% API cost reduction
942
-
943
- ```bash
944
- sigmap --format cache
945
- # Writes: .github/copilot-instructions.cache.json
946
- # Format: { type: 'text', text: '...', cache_control: { type: 'ephemeral' } }
947
- ```
948
-
949
- 📖 Full guide: [docs/readmes/REPOMIX_CACHE.md](docs/readmes/REPOMIX_CACHE.md)
950
-
951
191
  ---
952
192
 
953
- ## 📦 Programmatic API
954
-
955
- Use SigMap as a library — no CLI subprocess needed:
956
-
957
- ```js
958
- const { extract, rank, buildSigIndex, scan, score } = require('sigmap');
193
+ ## Start guide
959
194
 
960
- // Extract signatures from source code
961
- const sigs = extract('function hello() {}', 'javascript');
962
-
963
- // Build an index and rank files by query
964
- const index = buildSigIndex('/path/to/project');
965
- const results = rank('authentication middleware', index);
966
-
967
- // Scan signatures for secrets before storing
968
- const { safe, redacted } = scan(sigs, 'src/config.ts');
969
-
970
- // Get a composite health score for a project
971
- const health = score('/path/to/project');
972
- ```
973
-
974
- 📖 Full API reference: [packages/core/README.md](packages/core/README.md)
195
+ | Who | Start here |
196
+ |---|---|
197
+ | 👶 **New** | [Quick start guide](docs/readmes/GETTING_STARTED.md) — setup in 60 seconds |
198
+ | **Daily** | `sigmap ask` / `sigmap validate` / `sigmap judge` |
199
+ | 🧠 **Advanced** | [Context strategies](docs/readmes/CONTEXT_STRATEGIES.md) · [MCP setup](docs/readmes/MCP_SETUP.md) |
200
+ | 🏢 **Teams** | [Config reference](https://manojmallick.github.io/sigmap/guide/config.html) · [CI setup](docs/readmes/ENTERPRISE_SETUP.md) |
975
201
 
976
202
  ---
977
203
 
978
- ## 🧪 Testing
979
-
980
- ```bash
981
- # All 21 language extractors
982
- node test/run.js
204
+ ## Docs
983
205
 
984
- # Single language
985
- node test/run.js typescript
206
+ **[manojmallick.github.io/sigmap](https://manojmallick.github.io/sigmap)**
986
207
 
987
- # Regenerate expected outputs after extractor changes
988
- node test/run.js --update
989
-
990
- # Full integration suite
991
- node test/integration/all.js
992
- ```
993
-
994
- ### Validation gates
995
-
996
- ```bash
997
- # Gate 1 — all tests pass
998
- node test/run.js
999
- # Expected: 21/21 PASS
1000
-
1001
- # Gate 2 — zero external dependencies
1002
- grep "require(" gen-context.js | grep -v "^.*//.*require"
1003
- # Expected: only fs, path, assert, os, crypto, child_process, readline
1004
-
1005
- # Gate 3 — MCP server responds correctly
1006
- echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node gen-context.js --mcp
1007
- # Expected: valid JSON with 8 tools
1008
-
1009
- # Gate 4 — npm artifact is clean
1010
- npm pack --dry-run
1011
- # Expected: no test/, docs/, vscode-extension/ in output
1012
- ```
208
+ | Section | Link |
209
+ |---|---|
210
+ | CLI reference (32 commands) | [cli.html](https://manojmallick.github.io/sigmap/guide/cli.html) |
211
+ | Benchmark methodology | [benchmark.html](https://manojmallick.github.io/sigmap/guide/benchmark.html) |
212
+ | Config reference | [config.html](https://manojmallick.github.io/sigmap/guide/config.html) |
213
+ | Roadmap | [roadmap.html](https://manojmallick.github.io/sigmap/guide/roadmap.html) |
214
+ | 29 languages | [generalization.html](https://manojmallick.github.io/sigmap/guide/generalization.html) |
1013
215
 
1014
216
  ---
1015
217
 
1016
- ## 📁 Project structure
1017
-
1018
- ```
1019
- sigmap/
1020
-
1021
- ├── gen-context.js ← PRIMARY ENTRY POINT — single file, zero deps
1022
- ├── gen-project-map.js ← import graph, class hierarchy, route table
1023
-
1024
- ├── packages/
1025
- │ ├── core/ ← programmatic API — require('sigmap') (v2.4)
1026
- │ │ └── index.js ← extract, rank, buildSigIndex, scan, score
1027
- │ └── cli/ ← thin CLI wrapper / v3 compat shim (v2.4)
1028
-
1029
- ├── src/
1030
- │ ├── extractors/ ← 21 language extractors (one file per language)
1031
- │ ├── retrieval/ ← query-aware ranker + tokenizer (v2.3)
1032
- │ ├── eval/ ← benchmark runner + scorer (v2.1), analyzer (v2.2)
1033
- │ ├── mcp/ ← MCP stdio server — 8 tools
1034
- │ ├── security/ ← secret scanner — 10 patterns
1035
- │ ├── routing/ ← model routing hints
1036
- │ ├── tracking/ ← NDJSON usage logger
1037
- │ ├── health/ ← composite health scorer
1038
- │ ├── format/ ← Anthropic prompt-cache formatter
1039
- │ └── config/ ← config loader + defaults
1040
-
1041
- ├── vscode-extension/ ← VS Code extension (v1.5)
1042
- │ ├── package.json ← manifest — commands, settings, activation
1043
- │ └── src/extension.js ← status bar, stale notification, commands
1044
-
1045
- ├── neovim-plugin/ ← Neovim plugin — sigmap.nvim (v5.4)
1046
- │ ├── lua/sigmap/init.lua ← M.setup(), M.run(), M.query(), M.statusline()
1047
- │ ├── lua/sigmap/health.lua ← :checkhealth sigmap
1048
- │ └── plugin/sigmap.lua ← :SigMap and :SigMapQuery user commands
1049
-
1050
- ├── test/
1051
- │ ├── fixtures/ ← one source file per language
1052
- │ ├── expected/ ← expected extractor output
1053
- │ ├── run.js ← zero-dep test runner
1054
- │ └── integration/ ← 20 integration test files (304 tests)
1055
-
1056
- ├── docs/ ← documentation site (GitHub Pages)
1057
- │ ├── index.html ← homepage
1058
- │ ├── quick-start.html
1059
- │ ├── strategies.html
1060
- │ ├── languages.html
1061
- │ ├── roadmap.html
1062
- │ └── repomix.html
1063
-
1064
- ├── scripts/
1065
- │ ├── ci-update.sh ← CI pipeline helper
1066
- │ └── release.sh ← version bump + npm publish helper
1067
-
1068
- ├── examples/
1069
- │ ├── self-healing-github-action.yml
1070
- │ ├── github-action.yml ← ready-to-use CI workflow
1071
- │ └── claude-code-settings.json ← MCP server config example
1072
-
1073
- ├── .npmignore ← excludes docs/, test/, vscode-extension/ from publish
1074
- ├── .contextignore.example ← exclusion template
1075
- └── gen-context.config.json.example ← annotated config reference
1076
- ```
1077
-
1078
- ---
218
+ ## Support
1079
219
 
1080
- ## 🏗 Principles
220
+ If SigMap saves you context or API spend, a ⭐ on [GitHub](https://github.com/manojmallick/sigmap) helps others find it.
1081
221
 
1082
- | Principle | Implementation |
1083
- |---|---|
1084
- | **Zero npm dependencies** | `npx sigmap` on any machine — no install required. Or use the standalone binary for zero Node.js dependency. |
1085
- | **Never throw** | All extractors return `[]` on any error — the run always completes |
1086
- | **Deterministic** | No AI or LLM involved in extraction — only regex + Node built-ins |
1087
- | **Repomix is a companion** | Use both tools; SigMap never replaces Repomix |
1088
- | **No telemetry** | Never phones home; all state is files in your repo |
1089
- | **Local-first** | No cloud service, no database, no accounts |
222
+ [Report an issue](https://github.com/manojmallick/sigmap/issues) · [Changelog](CHANGELOG.md)
1090
223
 
1091
224
  ---
1092
225
 
1093
- ## 🤝 Contributing
226
+ ## Why not embeddings?
1094
227
 
1095
- See [CONTRIBUTING.md](CONTRIBUTING.md) for how to add a language extractor or new feature.
228
+ | | Embeddings | SigMap |
229
+ |---|:---:|:---:|
230
+ | Vector DB required | ✅ | ❌ |
231
+ | Infrastructure to run | ✅ | ❌ |
232
+ | Drift over time | ✅ | ❌ |
233
+ | Deterministic results | ❌ | ✅ |
234
+ | Zero-config setup | ❌ | ✅ |
235
+ | Works offline | ❌ | ✅ |
236
+
237
+ - **No vector DB** — signatures are plain text files committed to your repo
238
+ - **No infra** — runs locally, zero cloud dependencies
239
+ - **No drift** — regenerating is `npx sigmap`, not a reindex pipeline
240
+ - **Deterministic** — same input always produces same ranked output
241
+ - **Faster** — TF-IDF ranking runs in milliseconds, no embeddings to compute
1096
242
 
1097
- Every extractor follows the same contract:
243
+ ---
1098
244
 
1099
- ```javascript
1100
- module.exports = { extract };
1101
- function extract(src) { // src: string → string[]
1102
- if (!src || typeof src !== 'string') return [];
1103
- // ... regex extraction only — no external dependencies ...
1104
- return sigs.slice(0, 25); // never more than 25 signatures per file
1105
- }
1106
- ```
245
+ ## 29 languages
1107
246
 
1108
- ---
247
+ TypeScript · JavaScript · Python · Java · Kotlin · Go · Rust · C# · C/C++ · Ruby · PHP · Swift · Dart · Scala · Vue · Svelte · HTML · CSS/SCSS · YAML · Shell · SQL · GraphQL · Terraform · Protobuf · Dockerfile · TOML · XML · Properties · Markdown
1109
248
 
1110
- ## Support
249
+ All implemented with zero external dependencies.
1111
250
 
1112
- If SigMap saves you context or API spend, a ⭐ on [GitHub](https://github.com/manojmallick/sigmap) helps others find it.
251
+ [Full language table ](https://manojmallick.github.io/sigmap/guide/generalization.html)
1113
252
 
1114
253
  ---
1115
254
 
1116
- ## 📄 License
255
+ ## License
1117
256
 
1118
- MIT © 2026 [Manoj Mallick](https://github.com/manojmallick) · Made in Amsterdam 🇳🇱
257
+ MIT © 2026 [Manoj Mallick](https://github.com/manojmallick) · Made in Amsterdam
1119
258
 
1120
259
  ---
1121
260
 
1122
261
  <div align="center">
1123
262
 
1124
- If SigMap saves you time a ⭐ on [GitHub](https://github.com/manojmallick/sigmap) helps others find it.
263
+ **[Docs](https://manojmallick.github.io/sigmap) · [Changelog](CHANGELOG.md) · [Roadmap](https://manojmallick.github.io/sigmap/roadmap.html) · [npm](https://www.npmjs.com/package/sigmap)**
1125
264
 
1126
- **[Docs](https://manojmallick.github.io/sigmap) · [Changelog](CHANGELOG.md) · [Roadmap](https://manojmallick.github.io/sigmap/roadmap.html) · [Repomix](https://github.com/yamadashy/repomix)**
265
+ [Star on GitHub](https://github.com/manojmallick/sigmap) if SigMap saves you tokens.
1127
266
 
1128
267
  </div>