|
1 | | -# SigMap — AI Context Engine for VS Code |
| 1 | +<div align="center"> |
2 | 2 |
|
3 | | -**Zero-dependency AI context engine. 97% token reduction. Always-on code signatures.** |
| 3 | +# SigMap |
4 | 4 |
|
5 | | -[](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) |
6 | | -[](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) |
| 5 | +### Zero-dependency AI context engine for VS Code |
| 6 | + |
| 7 | +**97% token reduction · 21 languages · Always-on · Node 18+** |
| 8 | + |
| 9 | +[](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) |
| 10 | +[](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) |
| 11 | +[](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) |
7 | 12 | [](https://github.com/manojmallick/sigmap/blob/main/LICENSE) |
| 13 | +[](https://nodejs.org) |
| 14 | + |
| 15 | +</div> |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## What is SigMap? |
| 20 | + |
| 21 | +SigMap extracts a compact **signature map** of your entire codebase — function names, class hierarchies, exported types, interfaces — and writes it to `.github/copilot-instructions.md` automatically. |
| 22 | + |
| 23 | +Every AI coding assistant (GitHub Copilot, Claude, Cursor, Windsurf, Gemini) reads that file as its **first-message context**. Without it, the AI starts each session knowing nothing about your project. With SigMap, it starts with everything. |
| 24 | + |
| 25 | +``` |
| 26 | +Before SigMap: "I don't know your codebase structure — can you share some files?" |
| 27 | +After SigMap: "I can see your AuthService, UserRepository, 47 API routes …" |
| 28 | +``` |
| 29 | + |
| 30 | +**A 50,000-line TypeScript monorepo → ~3,800 tokens of pure signatures — 97% reduction, zero information loss.** |
8 | 31 |
|
9 | 32 | --- |
10 | 33 |
|
11 | | -## What it does |
| 34 | +## ✨ Features |
| 35 | + |
| 36 | +### 🔄 Auto-regeneration on startup |
| 37 | +The extension checks your context file every time VS Code starts and every 60 seconds while it's running. If the file is missing or stale, you're immediately notified. |
| 38 | + |
| 39 | +### 📊 Live health grade in the status bar |
| 40 | +A persistent status bar item shows your context health at a glance — no need to dig into files. |
| 41 | + |
| 42 | +| Grade | Status bar | Meaning | |
| 43 | +|:---:|---|---| |
| 44 | +| **A** | `✔ A • 2h ago` | Fresh and complete — AI has full codebase context | |
| 45 | +| **B** | `ℹ B • 6h ago` | Good — minor gaps, regenerate when convenient | |
| 46 | +| **C** | `⚠ C • 1d ago` | Stale — missing recent changes, regenerate soon | |
| 47 | +| **D** | `✖ D • 3d ago` | Very stale or incomplete — regenerate now | |
12 | 48 |
|
13 | | -SigMap extracts a compact **signature map** of your codebase — function names, class hierarchies, exported types — and writes it to `.github/copilot-instructions.md`. Every time you open VS Code or run a regeneration, GitHub Copilot (and any other AI assistant) starts with full codebase context at under **4,000 tokens**. |
| 49 | +Click the status bar item to trigger an **instant regeneration**. |
14 | 50 |
|
15 | | -- **21 language extractors** — TypeScript, JavaScript, Python, Go, Rust, Java, C#, C++, Ruby, PHP, Swift, Dart, Kotlin, Scala, Vue, Svelte, HTML, CSS, YAML, Shell, Dockerfile |
16 | | -- **Zero npm dependencies** — runs on any machine with Node.js 18+ |
17 | | -- **Secret scanning** — redacts AWS keys, GitHub tokens, DB connection strings before writing |
18 | | -- **MCP server** — exposes `read_context`, `search_signatures`, `get_map` tools for Claude / Cursor |
19 | | -- **Health scoring** — grades your context file A–D so you know when to regenerate |
| 51 | +### 🔔 Stale context notifications |
| 52 | +If your context hasn't been refreshed in over **24 hours**, SigMap pops up a smart notification with a one-click **Regenerate** button — or you can dismiss it permanently per workspace. |
| 53 | + |
| 54 | +### ⚡ One-command regeneration |
| 55 | +Run `SigMap: Regenerate Context` from the Command Palette and watch the terminal produce a fresh context file in seconds. |
| 56 | + |
| 57 | +### 🔒 Secret scanning built-in |
| 58 | +SigMap scans every signature before writing. If an AWS key, GitHub token, DB connection string, or Stripe key is detected in a function signature, it's **automatically redacted** — never leaks into your context file. |
| 59 | + |
| 60 | +### 🗺 MCP server support |
| 61 | +SigMap ships with a built-in **Model Context Protocol (MCP) server** for Claude and Cursor, exposing three tools: |
| 62 | +- `read_context` — full or per-module signature map |
| 63 | +- `search_signatures` — keyword search across all signatures |
| 64 | +- `get_map` — import graph, class hierarchy, or route table |
20 | 65 |
|
21 | 66 | --- |
22 | 67 |
|
23 | | -## Requirements |
| 68 | +## 🌐 21 Language Support |
24 | 69 |
|
25 | | -- **Node.js 18+** installed on the machine |
26 | | -- `gen-context.js` present in your workspace root (comes with the [`sigmap`](https://www.npmjs.com/package/sigmap) npm package) |
| 70 | +| Language | Extensions | |
| 71 | +|---|---| |
| 72 | +| TypeScript | `.ts`, `.tsx` | |
| 73 | +| JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | |
| 74 | +| Python | `.py`, `.pyw` | |
| 75 | +| Go | `.go` | |
| 76 | +| Rust | `.rs` | |
| 77 | +| Java | `.java` | |
| 78 | +| C# | `.cs` | |
| 79 | +| C / C++ | `.c`, `.cpp`, `.h`, `.hpp`, `.cc` | |
| 80 | +| Ruby | `.rb`, `.rake` | |
| 81 | +| PHP | `.php` | |
| 82 | +| Swift | `.swift` | |
| 83 | +| Dart | `.dart` | |
| 84 | +| Kotlin | `.kt`, `.kts` | |
| 85 | +| Scala | `.scala`, `.sc` | |
| 86 | +| Vue | `.vue` | |
| 87 | +| Svelte | `.svelte` | |
| 88 | +| HTML | `.html`, `.htm` | |
| 89 | +| CSS / SCSS / Sass | `.css`, `.scss`, `.sass`, `.less` | |
| 90 | +| YAML | `.yml`, `.yaml` | |
| 91 | +| Shell | `.sh`, `.bash`, `.zsh`, `.fish` | |
| 92 | +| Dockerfile | `Dockerfile`, `Dockerfile.*` | |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## 🚀 Quick Start |
| 97 | + |
| 98 | +### Step 1 — Install the sigmap CLI |
27 | 99 |
|
28 | | -Install via npm (optional — the extension auto-detects it): |
29 | 100 | ```bash |
30 | 101 | npm install -g sigmap |
31 | | -# or use it without installing: |
| 102 | +``` |
| 103 | + |
| 104 | +Or use it without installing: |
| 105 | +```bash |
32 | 106 | npx sigmap |
33 | 107 | ``` |
34 | 108 |
|
35 | | ---- |
| 109 | +### Step 2 — Generate your first context file |
36 | 110 |
|
37 | | -## Getting Started |
| 111 | +Open your project in VS Code, then open the Command Palette (`⇧⌘P` / `Ctrl+Shift+P`) and run: |
38 | 112 |
|
39 | | -1. Install the extension |
40 | | -2. Open a project that has `gen-context.js` in its root (or install `sigmap` globally) |
41 | | -3. The **SigMap status bar item** appears at the bottom — showing your context health grade and how long ago it was last generated |
42 | | -4. Run **`SigMap: Regenerate Context`** from the Command Palette (`⇧⌘P`) to refresh |
| 113 | +``` |
| 114 | +SigMap: Regenerate Context |
| 115 | +``` |
43 | 116 |
|
44 | | ---- |
| 117 | +This creates `.github/copilot-instructions.md` in your workspace root. |
45 | 118 |
|
46 | | -## Features |
| 119 | +### Step 3 — Done |
47 | 120 |
|
48 | | -### Status Bar |
49 | | -The status bar item shows your context health at a glance: |
| 121 | +GitHub Copilot automatically picks up `.github/copilot-instructions.md`. Claude, Cursor, Windsurf and Gemini also read it when configured. Your AI assistant now knows your entire codebase. |
50 | 122 |
|
51 | | -| Icon | Meaning | |
52 | | -|---|---| |
53 | | -| `$(check) A` | Context is fresh and complete | |
54 | | -| `$(info) B` | Good — minor gaps | |
55 | | -| `$(warning) C` | Stale or incomplete — regenerate soon | |
56 | | -| `$(error) D` | Context is very stale or missing | |
| 123 | +> **Tip:** Commit `.github/copilot-instructions.md` to your repo so every team member and CI run benefits. |
57 | 124 |
|
58 | | -Click the status bar item to **open the context file** directly. |
| 125 | +--- |
59 | 126 |
|
60 | | -### Commands |
| 127 | +## 🔧 Requirements |
61 | 128 |
|
62 | | -| Command | Description | |
| 129 | +| Requirement | Details | |
63 | 130 | |---|---| |
64 | | -| `SigMap: Regenerate Context` | Runs `node gen-context.js` in your workspace root | |
65 | | -| `SigMap: Open Context File` | Opens `.github/copilot-instructions.md` in the editor | |
| 131 | +| **Node.js** | Version 18 or higher — [download here](https://nodejs.org) | |
| 132 | +| **sigmap CLI** | `npm install -g sigmap` or `npx sigmap` per-project | |
| 133 | +| **VS Code** | 1.85.0 or higher | |
| 134 | + |
| 135 | +> The extension automatically detects `gen-context.js` in your workspace root. If installed globally, set `sigmap.scriptPath` in settings. |
| 136 | +
|
| 137 | +--- |
66 | 138 |
|
67 | | -Access both from the Command Palette (`⇧⌘P` / `Ctrl+Shift+P`). |
| 139 | +## ⚙️ Extension Settings |
68 | 140 |
|
69 | | -### Stale Context Notification |
70 | | -If your context file hasn't been updated in **24 hours**, SigMap shows a notification with a one-click **Regenerate** button. |
| 141 | +Access via `File → Preferences → Settings` → search for **SigMap**, or edit `settings.json` directly. |
| 142 | + |
| 143 | +| Setting | Type | Default | Description | |
| 144 | +|---|---|---|---| |
| 145 | +| `sigmap.scriptPath` | `string` | `""` | Absolute path to `gen-context.js`. Leave empty to auto-detect from workspace root or global install. | |
| 146 | + |
| 147 | +**Example `settings.json`:** |
| 148 | +```json |
| 149 | +{ |
| 150 | + "sigmap.scriptPath": "/Users/you/.npm-global/lib/node_modules/sigmap/gen-context.js" |
| 151 | +} |
| 152 | +``` |
71 | 153 |
|
72 | 154 | --- |
73 | 155 |
|
74 | | -## Extension Settings |
| 156 | +## 🖥 Commands Reference |
| 157 | + |
| 158 | +Open the Command Palette (`⇧⌘P` / `Ctrl+Shift+P`) and type **SigMap**: |
75 | 159 |
|
76 | | -| Setting | Default | Description | |
| 160 | +| Command | Keyboard | Description | |
77 | 161 | |---|---|---| |
78 | | -| `sigmap.scriptPath` | `""` | Absolute path to `gen-context.js`. Leave empty to auto-detect from workspace root. | |
| 162 | +| `SigMap: Regenerate Context` | — | Runs `node gen-context.js` in your workspace root | |
| 163 | +| `SigMap: Open Context File` | — | Opens `.github/copilot-instructions.md` in the editor | |
79 | 164 |
|
80 | 165 | --- |
81 | 166 |
|
82 | | -## How SigMap works |
| 167 | +## 🏗 How It Works |
83 | 168 |
|
84 | 169 | ``` |
85 | | -Your codebase → 21 language extractors → signatures only → token budget |
86 | | - ↓ |
87 | | - .github/copilot-instructions.md |
88 | | - ↓ |
89 | | - Copilot / Claude / Cursor / Gemini |
| 170 | +┌─────────────────────────────────────────────────────────┐ |
| 171 | +│ Your codebase │ |
| 172 | +│ src/auth.ts src/api/*.go lib/models.py ... │ |
| 173 | +└─────────────────┬───────────────────────────────────────┘ |
| 174 | + │ 21 language extractors (regex, zero deps) |
| 175 | + ▼ |
| 176 | +┌─────────────────────────────────────────────────────────┐ |
| 177 | +│ Signature map (function names, │ |
| 178 | +│ class hierarchy, exported types) │ |
| 179 | +│ ~3,800 tokens ← 97% smaller │ |
| 180 | +└─────────────────┬───────────────────────────────────────┘ |
| 181 | + │ secret scan → token budget → format |
| 182 | + ▼ |
| 183 | + .github/copilot-instructions.md |
| 184 | + │ |
| 185 | + ┌───────┴────────┐ |
| 186 | + ▼ ▼ |
| 187 | + GitHub Copilot Claude / Cursor |
| 188 | + Gemini / Windsurf (via MCP server) |
90 | 189 | ``` |
91 | 190 |
|
92 | | -A 50,000-line TypeScript monorepo becomes ~3,800 tokens of pure signatures — **97% reduction** with zero information loss for AI navigation. |
| 191 | +**The extractors use only regex and string operations — no AST parser, no npm install, runs in under 1 second on most codebases.** |
93 | 192 |
|
94 | 193 | --- |
95 | 194 |
|
96 | | -## Companion: Repomix |
| 195 | +## 📈 Token Reduction in Practice |
97 | 196 |
|
98 | | -For deep one-off sessions (full code review, major refactor), use [Repomix](https://github.com/yamadashy/repomix) alongside SigMap: |
| 197 | +| Codebase | Raw tokens | After SigMap | Reduction | |
| 198 | +|---|---:|---:|---:| |
| 199 | +| Small SaaS (15 files, TS) | ~12,000 | ~480 | **96%** | |
| 200 | +| Mid-size API (60 files, Go+TS) | ~85,000 | ~2,100 | **97.5%** | |
| 201 | +| Large monorepo (200+ files) | ~400,000 | ~5,800 | **98.5%** | |
99 | 202 |
|
100 | | -- **SigMap** — always-on, daily context at < 4K tokens |
101 | | -- **Repomix** — deep sessions, full file content, when you need everything |
| 203 | +> Token counts estimated at 4 chars/token (standard approximation). |
102 | 204 |
|
103 | 205 | --- |
104 | 206 |
|
105 | | -## Related Resources |
| 207 | +## 🤝 AI Tool Integration |
106 | 208 |
|
107 | | -- [GitHub Repository](https://github.com/manojmallick/sigmap) |
108 | | -- [npm package: sigmap](https://www.npmjs.com/package/sigmap) |
109 | | -- [Documentation](https://manojmallick.github.io/sigmap/) |
110 | | -- [Changelog](https://github.com/manojmallick/sigmap/blob/main/CHANGELOG.md) |
111 | | -- [Report an Issue](https://github.com/manojmallick/sigmap/issues) |
| 209 | +### GitHub Copilot |
| 210 | +No configuration needed. Copilot reads `.github/copilot-instructions.md` automatically in every chat and inline suggestion. |
| 211 | + |
| 212 | +### Claude (claude.ai / Claude Code) |
| 213 | +Append to `CLAUDE.md` by adding to your config: |
| 214 | +```json |
| 215 | +{ "outputs": ["claude"] } |
| 216 | +``` |
| 217 | + |
| 218 | +### Cursor |
| 219 | +Add `.cursorrules` output: |
| 220 | +```json |
| 221 | +{ "outputs": ["cursor"] } |
| 222 | +``` |
| 223 | + |
| 224 | +### Windsurf |
| 225 | +Add `.windsurfrules` output: |
| 226 | +```json |
| 227 | +{ "outputs": ["windsurf"] } |
| 228 | +``` |
| 229 | + |
| 230 | +### MCP server (Claude / Cursor) |
| 231 | +```bash |
| 232 | +node gen-context.js --mcp |
| 233 | +``` |
| 234 | +Exposes `read_context`, `search_signatures`, `get_map` over stdio JSON-RPC. |
| 235 | + |
| 236 | +--- |
| 237 | + |
| 238 | +## 🔍 Companion: Repomix |
| 239 | + |
| 240 | +SigMap is designed to work alongside **[Repomix](https://github.com/yamadashy/repomix)** (15K ⭐): |
| 241 | + |
| 242 | +| Tool | Use case | Tokens | |
| 243 | +|---|---|---| |
| 244 | +| **SigMap** | Always-on daily context, fast iteration | < 4K | |
| 245 | +| **Repomix** | Deep one-off sessions, full code review | 50K–200K | |
| 246 | + |
| 247 | +Use SigMap for every session. Reach for Repomix when you need full file content. |
| 248 | + |
| 249 | +--- |
| 250 | + |
| 251 | +## 🐛 Troubleshooting |
| 252 | + |
| 253 | +**Status bar shows "no context"** |
| 254 | +→ Run `SigMap: Regenerate Context`. If it fails, check that Node.js 18+ is installed: `node --version` |
| 255 | + |
| 256 | +**"gen-context.js not found" warning** |
| 257 | +→ Either run `npm install -g sigmap` or set `sigmap.scriptPath` in VS Code settings to the absolute path. |
| 258 | + |
| 259 | +**Context file is generated but Copilot doesn't seem to use it** |
| 260 | +→ The file must be at `.github/copilot-instructions.md` in your workspace root. Check `File → Open Folder` opened the right directory. |
| 261 | + |
| 262 | +**Grade is always "A" even on a stale file** |
| 263 | +→ `gen-context.js --health --json` may not be available in older versions. Upgrade: `npm update -g sigmap` |
| 264 | + |
| 265 | +**Want to exclude files from the context?** |
| 266 | +→ Create `.contextignore` in your project root (gitignore syntax). Example: |
| 267 | +``` |
| 268 | +node_modules/ |
| 269 | +*.test.ts |
| 270 | +dist/ |
| 271 | +``` |
112 | 272 |
|
113 | 273 | --- |
114 | 274 |
|
115 | | -## License |
| 275 | +## 📦 Related Resources |
| 276 | + |
| 277 | +| Resource | Link | |
| 278 | +|---|---| |
| 279 | +| 📖 Documentation | [manojmallick.github.io/sigmap](https://manojmallick.github.io/sigmap/) | |
| 280 | +| 📦 npm package | [npmjs.com/package/sigmap](https://www.npmjs.com/package/sigmap) | |
| 281 | +| 💻 GitHub | [github.com/manojmallick/sigmap](https://github.com/manojmallick/sigmap) | |
| 282 | +| 📝 Changelog | [CHANGELOG.md](https://github.com/manojmallick/sigmap/blob/main/CHANGELOG.md) | |
| 283 | +| 🐛 Issues | [github.com/manojmallick/sigmap/issues](https://github.com/manojmallick/sigmap/issues) | |
| 284 | +| 💬 Discussions | [github.com/manojmallick/sigmap/discussions](https://github.com/manojmallick/sigmap/discussions) | |
| 285 | + |
| 286 | +--- |
| 287 | + |
| 288 | +## 🤗 Contributing |
| 289 | + |
| 290 | +Contributions welcome! To add a new language extractor: |
| 291 | + |
| 292 | +1. Fork the [sigmap repo](https://github.com/manojmallick/sigmap) |
| 293 | +2. Add `src/extractors/{language}.js` following the extractor contract in [CONTRIBUTING.md](https://github.com/manojmallick/sigmap/blob/main/CONTRIBUTING.md) |
| 294 | +3. Add fixture + expected output in `test/` |
| 295 | +4. Submit a PR |
| 296 | + |
| 297 | +--- |
| 298 | + |
| 299 | +<div align="center"> |
| 300 | + |
| 301 | +MIT © 2026 [Manoj Mallick](https://github.com/manojmallick) · Made in Amsterdam 🇳🇱 |
| 302 | + |
| 303 | +*SigMap for daily always-on context · Repomix for deep one-off sessions — use both.* |
116 | 304 |
|
117 | | -MIT © 2026 [Manoj Mallick](https://github.com/manojmallick) |
| 305 | +</div> |
0 commit comments