sigmap 3.3.1 → 3.3.3

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/AGENTS.md ADDED
@@ -0,0 +1,42 @@
1
+ # SigMap — AGENTS.md
2
+
3
+ Instructions for Codex-style agents working in this repository.
4
+
5
+ ## Append Strategy (Required)
6
+
7
+ When writing generated signature content, never overwrite human-written notes above the marker.
8
+
9
+ Use this marker block for all appendable context files:
10
+
11
+ ```
12
+ ## Auto-generated signatures
13
+ <!-- Updated by gen-context.js -->
14
+ ```
15
+
16
+ ### Files that must use append-under-marker
17
+
18
+ 1. `CLAUDE.md`
19
+ 2. `.github/copilot-instructions.md`
20
+ 3. `.github/gemini-context.md`
21
+
22
+ ### Safe write procedure
23
+
24
+ 1. Read existing file (or start with empty string if file does not exist).
25
+ 2. Find the marker `## Auto-generated signatures`.
26
+ 3. If marker exists: keep everything above marker unchanged; replace only marker-and-below with new generated block.
27
+ 4. If marker does not exist: append marker + generated block to the end.
28
+ 5. Never modify human content above marker.
29
+
30
+ ### Legacy cleanup rule
31
+
32
+ If an existing generated file has no marker but contains prior SigMap-generated content headers, replace the full legacy generated content with marker + new generated block.
33
+
34
+ ## Verification
35
+
36
+ After changing write logic, run:
37
+
38
+ ```bash
39
+ node test/integration/multi-output.test.js
40
+ ```
41
+
42
+ Expected: all tests pass, including append-preservation cases.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,24 @@ Format: [Semantic Versioning](https://semver.org/)
10
10
 
11
11
  ---
12
12
 
13
+ ## [3.3.3] — 2026-04-14 — Auto srcDirs + P1 Extractors
14
+
15
+ ### Added
16
+ - **P1 extractor support** for additional high-value formats:
17
+ - SQL: `.sql`
18
+ - GraphQL: `.graphql`, `.gql`
19
+ - Terraform: `.tf`, `.tfvars`
20
+ - Protobuf: `.proto`
21
+ - **Extractor registration updates** across runtime and core mapping so the new file types are parsed consistently.
22
+
23
+ ### Changed
24
+ - **Auto source directory detection** (framework- and manifest-aware) in config loading and strategy auditing.
25
+ - **Auto maxDepth tuning** in strategy audit based on repository file-depth distribution.
26
+ - **Benchmark strategy-audit reports refreshed** to reflect improved source discovery and coverage.
27
+ - **Language support count updated from 21 to 25** across core README and extension README.
28
+
29
+ ---
30
+
13
31
  ## [3.3.1] — 2026-04-10 — Patch: `--each --adapter` flag combination
14
32
 
15
33
  ### Fixed
package/README.md CHANGED
@@ -1,38 +1,66 @@
1
1
  <div align="center">
2
2
 
3
+ <img src="docs-vp/.vitepress/public/logo.svg" alt="SigMap logo" width="64" height="84" />
4
+
3
5
  <h1>⚡ SigMap</h1>
4
6
 
5
- <p><strong>Zero-dependency AI context engine 97% token reduction</strong></p>
7
+ <p><strong>WITHOUT SIGMAP, YOUR AI IS GUESSING.</strong><br>
8
+ <strong>It sees 8% of your codebase and invents the rest.</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 — 6× better answers, 97% fewer tokens, 2× fewer prompts" width="760" />
16
+ </div>
6
17
 
7
- <p>
8
- Every coding agent session starts with full codebase context at under 4K tokens.<br>
9
- Multiple install options. Zero runtime dependencies. Requires only Node.js 18+.
10
- </p>
18
+ ```sh
19
+ npx sigmap # 10 seconds. zero config. your AI never reads the wrong file again.
20
+ ```
11
21
 
12
- <img src="docs/sigmap-banner.png" alt="SigMap — AI context engine" width="700">
22
+ <div align="center">
23
+ <img src="demo.gif" alt="SigMap demo — reducing 80K tokens to 4K in under 10 seconds" width="760" />
24
+ </div>
25
+
26
+ <details>
27
+ <summary><strong>Trust signals</strong></summary>
28
+
29
+ <div align="center">
13
30
 
14
- <!-- Status -->
15
31
  [![npm version](https://img.shields.io/npm/v/sigmap?color=7c6af7&label=latest&logo=npm)](https://www.npmjs.com/package/sigmap)
16
32
  [![CI](https://github.com/manojmallick/sigmap/actions/workflows/ci.yml/badge.svg)](https://github.com/manojmallick/sigmap/actions/workflows/ci.yml)
17
33
  [![Zero deps](https://img.shields.io/badge/dependencies-zero-22c55e)](package.json)
18
- [![Last commit](https://img.shields.io/github/last-commit/manojmallick/sigmap?color=7c6af7)](https://github.com/manojmallick/sigmap/commits/main)
19
-
20
- <!-- Meta -->
21
34
  [![License: MIT](https://img.shields.io/badge/License-MIT-7c6af7.svg)](LICENSE)
22
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
23
- [![npm](https://img.shields.io/badge/npm-sigmap-cb3837?logo=npm)](https://www.npmjs.com/package/sigmap)
24
- [![GitHub Stars](https://img.shields.io/github/stars/manojmallick/sigmap?style=flat&color=f59e0b&logo=github)](https://github.com/manojmallick/sigmap/stargazers)
25
-
26
- <!-- Links -->
27
- [![Docs](https://img.shields.io/badge/docs-live-7c6af7?logo=github-pages)](https://manojmallick.github.io/sigmap)
28
- [![Changelog](https://img.shields.io/badge/changelog-CHANGELOG.md-blue)](CHANGELOG.md)
29
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
30
35
  [![VS Code](https://img.shields.io/badge/VS%20Code-extension-0078d4?logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap)
31
36
  [![JetBrains](https://img.shields.io/badge/JetBrains-plugin-000000?logo=jetbrains)](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/)
32
- [![Open VSX](https://img.shields.io/open-vsx/v/manojmallick/sigmap?color=a251e3&label=Open%20VSX&logo=vscodium)](https://open-vsx.org/extension/manojmallick/sigmap)
37
+ [![Docs](https://img.shields.io/badge/docs-live-7c6af7?logo=github-pages)](https://manojmallick.github.io/sigmap)
38
+ [![GitHub Stars](https://img.shields.io/github/stars/manojmallick/sigmap?style=flat&color=f59e0b&logo=github)](https://github.com/manojmallick/sigmap/stargazers)
39
+
40
+ </div>
41
+
42
+ </details>
33
43
 
44
+ <details>
45
+ <summary><strong>Full benchmark breakdown →</strong></summary>
46
+
47
+ <br/>
48
+
49
+ <div align="center">
50
+ <img src="docs/comparison-chart.svg" alt="SigMap benchmark — before vs after across 3 RAG quality metrics" width="700" />
51
+ <br/><sub><a href="https://manojmallick.github.io/sigmap/guide/task-benchmark.html">80 tasks · 16 real repos · no LLM API · <strong>full methodology →</strong></a></sub>
34
52
  </div>
35
53
 
54
+ | | Without SigMap | With SigMap |
55
+ |---|:---:|:---:|
56
+ | Task success | 10% | **59%** |
57
+ | Prompts per task | 2.84 | **1.54** |
58
+ | Tokens per session | ~80,000 | **~2,000** |
59
+ | Right file found | 13.7% | **87.5%** |
60
+ | Hallucination risk | 92% | **0%** |
61
+
62
+ </details>
63
+
36
64
  ---
37
65
 
38
66
  ## Table of contents
@@ -44,7 +72,7 @@
44
72
  | [Standalone binaries](docs/readmes/binaries.md) | macOS, Linux, Windows — no Node required |
45
73
  | [VS Code extension](#-vs-code-extension) | Status bar, stale alerts, commands |
46
74
  | [JetBrains plugin](#-jetbrains-plugin) | IntelliJ IDEA, WebStorm, PyCharm support |
47
- | [Languages supported](#-languages-supported) | 21 languages |
75
+ | [Languages supported](#-languages-supported) | 25 languages |
48
76
  | [Context strategies](#-context-strategies) | full / per-module / hot-cold |
49
77
  | [MCP server](#-mcp-server) | 8 on-demand tools |
50
78
  | [CLI reference](#-cli-reference) | All flags |
@@ -67,7 +95,7 @@ SigMap scans your source files and extracts only the **function and class signat
67
95
  Your codebase
68
96
 
69
97
 
70
- gen-context.js ──► extracts signatures from 21 languages
98
+ sigmap ─────────► extracts signatures from 25 languages
71
99
 
72
100
 
73
101
  .github/copilot-instructions.md ◄── auto-read by Copilot / Claude / Cursor
@@ -90,6 +118,31 @@ AI agent session starts with full context
90
118
 
91
119
  > **97% fewer tokens. The same codebase understanding.**
92
120
 
121
+ ### Benchmark: real-world repos
122
+
123
+ Reproduced with `node scripts/run-benchmark.mjs` on public repos:
124
+
125
+ | Repo | Language | Raw tokens | After SigMap | Reduction |
126
+ |------|----------|------------|--------------|-----------|
127
+ | express | JavaScript | 15.5K | 201 | **98.7%** |
128
+ | flask | Python | 84.8K | 3.4K | **96.0%** |
129
+ | gin | Go | 172.8K | 5.7K | **96.7%** |
130
+ | spring-petclinic | Java | 77.0K | 634 | **99.2%** |
131
+ | rails | Ruby | 1.5M | 7.1K | **99.5%** |
132
+ | axios | TypeScript | 31.7K | 1.5K | **95.2%** |
133
+ | rust-analyzer | Rust | 3.5M | 5.9K | **99.8%** |
134
+ | abseil-cpp | C++ | 2.3M | 6.3K | **99.7%** |
135
+ | serilog | C# | 113.7K | 5.8K | **94.9%** |
136
+ | riverpod | Dart | 682.7K | 6.5K | **99.0%** |
137
+ | okhttp | Kotlin | 31.3K | 1.4K | **95.5%** |
138
+ | laravel | PHP | 1.7M | 7.2K | **99.6%** |
139
+ | akka | Scala | 790.5K | 7.1K | **99.1%** |
140
+ | vapor | Swift | 171.2K | 6.4K | **96.3%** |
141
+ | vue-core | Vue | 404.2K | 8.8K | **97.8%** |
142
+ | svelte | Svelte | 438.2K | 8.0K | **98.2%** |
143
+
144
+ **Average: 99.3% reduction across 16 languages.** See [`benchmarks/reports/token-reduction.md`](benchmarks/reports/token-reduction.md) or reproduce with `node scripts/run-benchmark.mjs`.
145
+
93
146
  ---
94
147
 
95
148
  ## ⚡ Installation
@@ -250,8 +303,6 @@ No npm, no `node_modules`. Drop `gen-context.js` into any project and run it dir
250
303
 
251
304
  </details>
252
305
 
253
- > **Note:** When using the single-file download, replace `sigmap` with `node gen-context.js` in all commands below.
254
-
255
306
  ---
256
307
 
257
308
  ## 🚀 Features
@@ -266,17 +317,19 @@ sigmap --adapter claude # → CLAUDE.md (appended below marker)
266
317
  sigmap --adapter cursor # → .cursorrules
267
318
  sigmap --adapter windsurf # → .windsurfrules
268
319
  sigmap --adapter openai # → .github/openai-context.md
269
- sigmap --adapter gemini # → .github/gemini-context.md
320
+ sigmap --adapter gemini # → .github/gemini-context.md (appended below marker)
321
+ sigmap --adapter codex # → AGENTS.md (appended below marker)
270
322
  ```
271
323
 
272
324
  | Adapter | Output file | AI assistant |
273
325
  |---|---|---|
274
- | `copilot` | `.github/copilot-instructions.md` | GitHub Copilot |
326
+ | `copilot` | `.github/copilot-instructions.md` (append) | GitHub Copilot |
275
327
  | `claude` | `CLAUDE.md` (append) | Claude / Claude Code |
276
328
  | `cursor` | `.cursorrules` | Cursor |
277
329
  | `windsurf` | `.windsurfrules` | Windsurf |
278
330
  | `openai` | `.github/openai-context.md` | Any OpenAI model |
279
- | `gemini` | `.github/gemini-context.md` | Google Gemini |
331
+ | `gemini` | `.github/gemini-context.md` (append) | Google Gemini |
332
+ | `codex` | `AGENTS.md` (append) | OpenAI Codex |
280
333
 
281
334
  Configure multiple adapters at once in `gen-context.config.json`:
282
335
 
@@ -342,7 +395,7 @@ npm install -g sigmap # install globally
342
395
 
343
396
  ### Generate context
344
397
 
345
- Download the single-file CLI and generate context immediately:
398
+ Once installed, run from your project root:
346
399
 
347
400
  ```bash
348
401
  sigmap # generate once and exit
@@ -374,17 +427,22 @@ npx repomix --compress # deep dive sessions
374
427
 
375
428
  ## 🧩 VS Code extension
376
429
 
377
- The `vscode-extension/` directory contains a first-party VS Code extension that keeps you informed without any manual commands.
430
+ The official SigMap VS Code extension keeps your context fresh without any manual commands. Install it once and it runs silently in the background.
378
431
 
379
432
  | Feature | Detail |
380
433
  |---|---|
381
434
  | **Status bar item** | Shows health grade (`A`/`B`/`C`/`D`) + time since last regen; refreshes every 60 s |
382
435
  | **Stale notification** | Warns when `copilot-instructions.md` is > 24 h old; one-click regeneration |
383
- | **Regenerate command** | `SigMap: Regenerate Context` — runs `node gen-context.js` in the integrated terminal |
436
+ | **Regenerate command** | `SigMap: Regenerate Context` — runs `sigmap` in the integrated terminal |
384
437
  | **Open context command** | `SigMap: Open Context File` — opens `.github/copilot-instructions.md` |
385
- | **Script path setting** | `sigmap.scriptPath` — override when `gen-context.js` is not at the project root |
438
+ | **Script path setting** | `sigmap.scriptPath` — override the path to the `sigmap` binary or `gen-context.js` |
439
+
440
+ <div align="center">
441
+ <img src="vscode.gif" alt="SigMap VS Code extension — status bar, stale notification, regenerate context" width="760" />
442
+ </div>
443
+
386
444
 
387
- Activate on startup (`onStartupFinished`) — loads within 3 s, never blocks editor startup.
445
+ Activates on startup (`onStartupFinished`) — loads within 3 s, never blocks editor startup.
388
446
 
389
447
  **Install:** [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) | [Open VSX Registry](https://open-vsx.org/extension/manojmallick/sigmap)
390
448
 
@@ -392,12 +450,12 @@ Activate on startup (`onStartupFinished`) — loads within 3 s, never blocks edi
392
450
 
393
451
  ## 🔧 JetBrains plugin
394
452
 
395
- The `jetbrains-plugin/` directory contains a Kotlin-based plugin for JetBrains IDEs with the same core features as the VS Code extension.
453
+ 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.
396
454
 
397
455
  | Feature | Detail |
398
456
  |---|---|
399
457
  | **Status bar widget** | Shows health grade (`A`-`F`) + time since last regen; updates every 60 s |
400
- | **Regenerate action** | `Tools → SigMap → Regenerate Context` or **Ctrl+Alt+G** — runs `node gen-context.js` |
458
+ | **Regenerate action** | `Tools → SigMap → Regenerate Context` or **Ctrl+Alt+G** — runs `sigmap` |
401
459
  | **Open context action** | `Tools → SigMap → Open Context File` — opens `.github/copilot-instructions.md` |
402
460
  | **View roadmap action** | `Tools → SigMap → View Roadmap` — opens roadmap in browser |
403
461
  | **One-click regen** | Click status bar widget to regenerate context instantly |
@@ -410,10 +468,10 @@ Compatible with **IntelliJ IDEA 2024.1+** (Community & Ultimate), **WebStorm**,
410
468
 
411
469
  ## 🌐 Languages supported
412
470
 
413
- > 21 languages. All implemented with zero external dependencies — pure regex + Node built-ins.
471
+ > 25 languages. All implemented with zero external dependencies — pure regex + Node built-ins.
414
472
 
415
473
  <details>
416
- <summary><strong>Show all 21 languages</strong></summary>
474
+ <summary><strong>Show all 25 languages</strong></summary>
417
475
 
418
476
  | Language | Extensions | Extracts |
419
477
  |---|---|---|
@@ -437,6 +495,10 @@ Compatible with **IntelliJ IDEA 2024.1+** (Community & Ultimate), **WebStorm**,
437
495
  | CSS/SCSS | `.css` `.scss` `.sass` `.less` | custom properties and keyframes |
438
496
  | YAML | `.yml` `.yaml` | top-level keys and pipeline jobs |
439
497
  | Shell | `.sh` `.bash` `.zsh` `.fish` | function declarations |
498
+ | SQL | `.sql` | tables, views, indexes, functions, procedures |
499
+ | GraphQL | `.graphql` `.gql` | types, interfaces, enums, operations, fragments |
500
+ | Terraform | `.tf` `.tfvars` | resources, modules, variables, outputs |
501
+ | Protobuf | `.proto` | messages, services, rpc, enums |
440
502
  | Dockerfile | `Dockerfile` `Dockerfile.*` | stages and key instructions |
441
503
 
442
504
  </details>
@@ -495,7 +557,7 @@ Recently committed files are **hot** (auto-injected). Everything else is **cold*
495
557
  Start the MCP server on stdio:
496
558
 
497
559
  ```bash
498
- node gen-context.js --mcp
560
+ sigmap --mcp
499
561
  ```
500
562
 
501
563
  ### Available tools
@@ -576,11 +638,11 @@ sigmap --help Usage information
576
638
  ### Task classification — `--suggest-tool`
577
639
 
578
640
  ```bash
579
- node gen-context.js --suggest-tool "security audit of the auth module"
641
+ sigmap --suggest-tool "security audit of the auth module"
580
642
  # tier : powerful
581
643
  # models : claude-opus-4-6, gpt-5-4, gemini-2-5-pro
582
644
 
583
- node gen-context.js --suggest-tool "fix a typo in the yaml config" --json
645
+ sigmap --suggest-tool "fix a typo in the yaml config" --json
584
646
  # {"tier":"fast","label":"Fast (low-cost)","models":"claude-haiku-4-5, ...","costHint":"~$0.0008 / 1K tokens"}
585
647
  ```
586
648
 
@@ -646,7 +708,7 @@ build/
646
708
  test/fixtures/
647
709
  ```
648
710
 
649
- Run `node gen-context.js --init` to scaffold both files in one step.
711
+ Run `sigmap --init` to scaffold both files in one step.
650
712
 
651
713
  ### Output targets
652
714
 
@@ -676,14 +738,14 @@ If `output` is omitted, the default `.github/copilot-instructions.md` is used.
676
738
 
677
739
  ```bash
678
740
  # Append run metrics to .context/usage.ndjson
679
- node gen-context.js --track
741
+ sigmap --track
680
742
 
681
743
  # Structured JSON report for CI (exits 1 if over budget)
682
- node gen-context.js --report --json
744
+ sigmap --report --json
683
745
  # { "version": "2.0.0", "finalTokens": 3200, "reductionPct": 92.4, "overBudget": false }
684
746
 
685
747
  # Composite health score
686
- node gen-context.js --health
748
+ sigmap --health
687
749
  # score: 95/100 (grade A) | reduction: 91.2% | 1 day since regen | 47 runs
688
750
  ```
689
751
 
@@ -695,9 +757,9 @@ Copy `examples/self-healing-github-action.yml` to `.github/workflows/` to auto-r
695
757
 
696
758
  ```yaml
697
759
  - name: SigMap health check
698
- run: node gen-context.js --health --json
760
+ run: sigmap --health --json
699
761
  - name: Regenerate context
700
- run: node gen-context.js
762
+ run: sigmap
701
763
  ```
702
764
 
703
765
  📖 Full guide: [docs/readmes/ENTERPRISE_SETUP.md](docs/readmes/ENTERPRISE_SETUP.md)
@@ -705,7 +767,7 @@ Copy `examples/self-healing-github-action.yml` to `.github/workflows/` to auto-r
705
767
  ### Prompt caching — 60% API cost reduction
706
768
 
707
769
  ```bash
708
- node gen-context.js --format cache
770
+ sigmap --format cache
709
771
  # Writes: .github/copilot-instructions.cache.json
710
772
  # Format: { type: 'text', text: '...', cache_control: { type: 'ephemeral' } }
711
773
  ```
@@ -840,7 +902,7 @@ sigmap/
840
902
 
841
903
  | Principle | Implementation |
842
904
  |---|---|
843
- | **Zero npm dependencies** | `node gen-context.js` on a blank machine with Node 18+ nothing else required |
905
+ | **Zero npm dependencies** | `npx sigmap` on any machine no install required. Or use the standalone binary for zero Node.js dependency. |
844
906
  | **Never throw** | All extractors return `[]` on any error — the run always completes |
845
907
  | **Deterministic** | No AI or LLM involved in extraction — only regex + Node built-ins |
846
908
  | **Repomix is a companion** | Use both tools; SigMap never replaces Repomix |
@@ -3,7 +3,7 @@
3
3
 
4
4
  "output": ".github/copilot-instructions.md",
5
5
 
6
- "outputs": ["copilot"],
6
+ "outputs": ["copilot", "codex"],
7
7
 
8
8
  "srcDirs": ["src", "app", "lib", "packages", "services", "api"],
9
9
 
package/gen-context.js CHANGED
@@ -34,7 +34,7 @@ __factories["./src/config/defaults"] = function(module, exports) {
34
34
  // Output targets: 'copilot' | 'claude' | 'cursor' | 'windsurf'
35
35
  outputs: ['copilot'],
36
36
 
37
- // Adapter targets (v3.0+): replaces 'outputs'. Same names, adds 'openai' | 'gemini'.
37
+ // Adapter targets (v3.0+): replaces 'outputs'. Same names, adds 'openai' | 'gemini' | 'codex'.
38
38
  // Old 'outputs' config key is still accepted and silently maps to 'adapters'.
39
39
  adapters: null, // null means: use 'outputs' for backward compat
40
40
 
@@ -173,7 +173,7 @@ __factories["./src/config/loader"] = function(module, exports) {
173
173
  if (!merged.adapters && Array.isArray(merged.outputs)) {
174
174
  merged.adapters = merged.outputs.slice();
175
175
  } else if (Array.isArray(merged.adapters) && !userConfig.outputs) {
176
- merged.outputs = merged.adapters.filter((a) => ['copilot','claude','cursor','windsurf'].includes(a));
176
+ merged.outputs = merged.adapters.filter((a) => ['copilot','claude','cursor','windsurf','codex'].includes(a));
177
177
  }
178
178
  return merged;
179
179
  }
@@ -3700,7 +3700,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
3700
3700
 
3701
3701
  const SERVER_INFO = {
3702
3702
  name: 'sigmap',
3703
- version: '3.2.1',
3703
+ version: '3.3.3',
3704
3704
  description: 'SigMap MCP server — code signatures on demand',
3705
3705
  };
3706
3706
 
@@ -4619,6 +4619,11 @@ __factories["./src/eval/analyzer"] = function(module, exports) {
4619
4619
  '.css': 'css', '.scss': 'css', '.sass': 'css', '.less': 'css',
4620
4620
  '.yml': 'yaml', '.yaml': 'yaml',
4621
4621
  '.sh': 'shell', '.bash': 'shell', '.zsh': 'shell', '.fish': 'shell',
4622
+ // P1 languages
4623
+ '.sql': 'sql',
4624
+ '.graphql': 'graphql', '.gql': 'graphql',
4625
+ '.tf': 'terraform', '.tfvars': 'terraform',
4626
+ '.proto': 'protobuf',
4622
4627
  };
4623
4628
 
4624
4629
  function isDockerfile(name) { return name === 'Dockerfile' || name.startsWith('Dockerfile.'); }
@@ -4888,7 +4893,9 @@ __factories["./src/eval/runner"] = function(module, exports) {
4888
4893
  // ── ./packages/adapters/copilot (bundled) ──
4889
4894
  __factories["./packages/adapters/copilot"] = function(module, exports) {
4890
4895
  const path = require('path');
4896
+ const fs = require('fs');
4891
4897
  const name = 'copilot';
4898
+ const COPILOT_MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
4892
4899
  function format(context, opts = {}) {
4893
4900
  if (!context || typeof context !== 'string') return '';
4894
4901
  const version = (opts && opts.version) || 'unknown';
@@ -4904,7 +4911,20 @@ __factories["./packages/adapters/copilot"] = function(module, exports) {
4904
4911
  ].join('\n');
4905
4912
  }
4906
4913
  function outputPath(cwd) { return path.join(cwd, '.github', 'copilot-instructions.md'); }
4907
- module.exports = { name, format, outputPath };
4914
+ function write(context, cwd, opts = {}) {
4915
+ const filePath = outputPath(cwd);
4916
+ let existing = '';
4917
+ if (fs.existsSync(filePath)) existing = fs.readFileSync(filePath, 'utf8');
4918
+ const formatted = format(context, opts);
4919
+ const markerIdx = existing.indexOf('## Auto-generated signatures');
4920
+ const isLegacyGenerated = existing.includes('<!-- Generated by SigMap gen-context.js') || existing.includes('# Code signatures');
4921
+ const newContent = markerIdx !== -1
4922
+ ? existing.slice(0, markerIdx) + COPILOT_MARKER.trimStart() + formatted
4923
+ : (isLegacyGenerated ? COPILOT_MARKER.trimStart() + formatted : existing + COPILOT_MARKER + formatted);
4924
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
4925
+ fs.writeFileSync(filePath, newContent, 'utf8');
4926
+ }
4927
+ module.exports = { name, format, outputPath, write };
4908
4928
  };
4909
4929
 
4910
4930
  // ── ./packages/adapters/claude (bundled) ──
@@ -4989,7 +5009,9 @@ __factories["./packages/adapters/openai"] = function(module, exports) {
4989
5009
  // ── ./packages/adapters/gemini (bundled) ──
4990
5010
  __factories["./packages/adapters/gemini"] = function(module, exports) {
4991
5011
  const path = require('path');
5012
+ const fs = require('fs');
4992
5013
  const name = 'gemini';
5014
+ const GEMINI_MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
4993
5015
  function format(context, opts = {}) {
4994
5016
  if (!context || typeof context !== 'string') return '';
4995
5017
  const version = (opts && opts.version) || 'unknown';
@@ -5007,12 +5029,51 @@ __factories["./packages/adapters/gemini"] = function(module, exports) {
5007
5029
  ].join('\n');
5008
5030
  }
5009
5031
  function outputPath(cwd) { return path.join(cwd, '.github', 'gemini-context.md'); }
5010
- module.exports = { name, format, outputPath };
5032
+ function write(context, cwd, opts = {}) {
5033
+ const filePath = outputPath(cwd);
5034
+ let existing = '';
5035
+ if (fs.existsSync(filePath)) existing = fs.readFileSync(filePath, 'utf8');
5036
+ const formatted = format(context, opts);
5037
+ const markerIdx = existing.indexOf('## Auto-generated signatures');
5038
+ const isLegacyGenerated = existing.includes('<!-- Generated by SigMap gen-context.js') || existing.includes('## Code Signatures');
5039
+ const newContent = markerIdx !== -1
5040
+ ? existing.slice(0, markerIdx) + GEMINI_MARKER.trimStart() + formatted
5041
+ : (isLegacyGenerated ? GEMINI_MARKER.trimStart() + formatted : existing + GEMINI_MARKER + formatted);
5042
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
5043
+ fs.writeFileSync(filePath, newContent, 'utf8');
5044
+ }
5045
+ module.exports = { name, format, outputPath, write };
5046
+ };
5047
+
5048
+ // ── ./packages/adapters/codex (bundled) ──
5049
+ __factories["./packages/adapters/codex"] = function(module, exports) {
5050
+ const path = require('path');
5051
+ const fs = require('fs');
5052
+ const openai = __require('./packages/adapters/openai');
5053
+ const name = 'codex';
5054
+ const CODEX_MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
5055
+ function format(context, opts = {}) {
5056
+ return openai.format(context, opts);
5057
+ }
5058
+ function outputPath(cwd) { return path.join(cwd, 'AGENTS.md'); }
5059
+ function write(context, cwd, opts = {}) {
5060
+ const filePath = outputPath(cwd);
5061
+ let existing = '';
5062
+ if (fs.existsSync(filePath)) existing = fs.readFileSync(filePath, 'utf8');
5063
+ const formatted = format(context, opts);
5064
+ const markerIdx = existing.indexOf('## Auto-generated signatures');
5065
+ const isLegacyGenerated = existing.includes('<!-- Generated by SigMap gen-context.js') || existing.includes('## Code Signatures') || existing.includes('# Code signatures');
5066
+ const newContent = markerIdx !== -1
5067
+ ? existing.slice(0, markerIdx) + CODEX_MARKER.trimStart() + formatted
5068
+ : (isLegacyGenerated ? CODEX_MARKER.trimStart() + formatted : existing + CODEX_MARKER + formatted);
5069
+ fs.writeFileSync(filePath, newContent, 'utf8');
5070
+ }
5071
+ module.exports = { name, format, outputPath, write };
5011
5072
  };
5012
5073
 
5013
5074
  // ── ./packages/adapters/index (bundled) ──
5014
5075
  __factories["./packages/adapters/index"] = function(module, exports) {
5015
- const ADAPTER_NAMES = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini'];
5076
+ const ADAPTER_NAMES = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini', 'codex'];
5016
5077
  const _adapterCache = {};
5017
5078
  function getAdapter(name) {
5018
5079
  if (!name || typeof name !== 'string') return null;
@@ -5049,7 +5110,7 @@ const path = require('path');
5049
5110
  const os = require('os');
5050
5111
  const { execSync } = require('child_process');
5051
5112
 
5052
- const VERSION = '3.3.1';
5113
+ const VERSION = '3.3.3';
5053
5114
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
5054
5115
 
5055
5116
  function requireSourceOrBundled(key) {
@@ -5091,6 +5152,11 @@ const EXT_MAP = {
5091
5152
  '.css': 'css', '.scss': 'css', '.sass': 'css', '.less': 'css',
5092
5153
  '.yml': 'yaml', '.yaml': 'yaml',
5093
5154
  '.sh': 'shell', '.bash': 'shell', '.zsh': 'shell', '.fish': 'shell',
5155
+ // P1 languages
5156
+ '.sql': 'sql',
5157
+ '.graphql': 'graphql', '.gql': 'graphql',
5158
+ '.tf': 'terraform', '.tfvars': 'terraform',
5159
+ '.proto': 'protobuf',
5094
5160
  };
5095
5161
 
5096
5162
  // Dockerfile handled separately (no extension)
@@ -5619,6 +5685,7 @@ function resolveAdapterPath(adapter, cwd, config) {
5619
5685
  if (adapter === 'claude') return path.join(cwd, 'CLAUDE.md');
5620
5686
  if (adapter === 'cursor') return path.join(cwd, '.cursorrules');
5621
5687
  if (adapter === 'windsurf') return path.join(cwd, '.windsurfrules');
5688
+ if (adapter === 'codex') return path.join(cwd, 'AGENTS.md');
5622
5689
 
5623
5690
  return null;
5624
5691
  }
@@ -5641,7 +5708,7 @@ function writeCacheOutput(content, cwd) {
5641
5708
  function writeOutputs(content, targets, cwd, config) {
5642
5709
  config = config || {};
5643
5710
  // v3.0+: adapter-aware output targets
5644
- const ADAPTER_TARGETS = new Set(['openai', 'gemini']);
5711
+ const ADAPTER_TARGETS = new Set(['copilot', 'openai', 'gemini', 'codex']);
5645
5712
 
5646
5713
  const targetMap = {
5647
5714
  copilot: resolveAdapterPath('copilot', cwd, config),
@@ -5654,15 +5721,21 @@ function writeOutputs(content, targets, cwd, config) {
5654
5721
  writeClaude(content, cwd);
5655
5722
  continue;
5656
5723
  }
5657
- // v3.0+ adapter targets (openai, gemini) — use bundled adapter to format + write
5724
+ // v3.0+ adapter targets (copilot, openai, gemini, codex) — use bundled adapter to format + write
5658
5725
  if (ADAPTER_TARGETS.has(target)) {
5659
5726
  try {
5660
5727
  const adapterMod = __require('./packages/adapters/' + target);
5661
- const formatted = adapterMod.format(content, { version: VERSION });
5662
- const outPath = adapterMod.outputPath(cwd);
5663
- ensureDir(outPath);
5664
- fs.writeFileSync(outPath, formatted, 'utf8');
5665
- console.warn(`[sigmap] wrote ${path.relative(cwd, outPath)}`);
5728
+ if (typeof adapterMod.write === 'function') {
5729
+ adapterMod.write(content, cwd, { version: VERSION });
5730
+ const outPath = adapterMod.outputPath(cwd);
5731
+ console.warn(`[sigmap] wrote ${path.relative(cwd, outPath)} (appended signatures)`);
5732
+ } else {
5733
+ const formatted = adapterMod.format(content, { version: VERSION });
5734
+ const outPath = adapterMod.outputPath(cwd);
5735
+ ensureDir(outPath);
5736
+ fs.writeFileSync(outPath, formatted, 'utf8');
5737
+ console.warn(`[sigmap] wrote ${path.relative(cwd, outPath)}`);
5738
+ }
5666
5739
  } catch (err) {
5667
5740
  console.warn(`[sigmap] adapter "${target}" failed: ${err.message}`);
5668
5741
  }
@@ -6420,8 +6493,8 @@ Strategies (set via config "strategy" key):
6420
6493
  ~90% fewer tokens. Best with MCP (Claude Code, Cursor).
6421
6494
  Set "hotCommits": N to control how many commits count as hot (default 10).
6422
6495
 
6423
- Adapters (v3.0+): copilot | claude | cursor | windsurf | openai | gemini
6424
- Set "adapters": ["copilot","openai"] in config to write multiple adapter outputs.
6496
+ Adapters (v3.0+): copilot | claude | cursor | windsurf | openai | gemini | codex
6497
+ Set "adapters": ["copilot","openai","codex"] in config to write multiple adapter outputs.
6425
6498
  Old "outputs" config key is still accepted (maps to adapters automatically).
6426
6499
 
6427
6500
  Config: gen-context.config.json
@@ -6760,7 +6833,7 @@ function main() {
6760
6833
  // handled here (per-repo) rather than running a single generate on the
6761
6834
  // parent directory.
6762
6835
  if (args.includes('--each')) {
6763
- const VALID_ADAPTERS = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini'];
6836
+ const VALID_ADAPTERS = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini', 'codex'];
6764
6837
  const adpIdx = args.indexOf('--adapter');
6765
6838
  const adapterOverride = adpIdx >= 0 ? (args[adpIdx + 1] || '').trim().toLowerCase() : null;
6766
6839
  if (adapterOverride && !VALID_ADAPTERS.includes(adapterOverride)) {
@@ -6777,7 +6850,7 @@ function main() {
6777
6850
  try {
6778
6851
  const adpIdx = args.indexOf('--adapter');
6779
6852
  const adapterName = (args[adpIdx + 1] || '').trim().toLowerCase();
6780
- const VALID_ADAPTERS = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini'];
6853
+ const VALID_ADAPTERS = ['copilot', 'claude', 'cursor', 'windsurf', 'openai', 'gemini', 'codex'];
6781
6854
  if (!adapterName || adapterName.startsWith('--')) {
6782
6855
  console.error('[sigmap] --adapter requires an adapter name');
6783
6856
  console.error(` Valid adapters: ${VALID_ADAPTERS.join(', ')}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "description": "Zero-dependency AI context engine — 97% token reduction. No npm install. Runs on Node 18+.",
5
5
  "main": "gen-context.js",
6
6
  "exports": {
@@ -23,6 +23,7 @@
23
23
  "setup": "node gen-context.js --setup",
24
24
  "init": "node gen-context.js --init",
25
25
  "report": "node gen-context.js --report",
26
+ "audit:strategies": "node scripts/run-strategy-audit.mjs",
26
27
  "health": "node gen-context.js --health",
27
28
  "map": "node gen-project-map.js",
28
29
  "mcp": "node gen-context.js --mcp",
@@ -36,6 +37,7 @@
36
37
  "src/",
37
38
  "packages/",
38
39
  "README.md",
40
+ "AGENTS.md",
39
41
  "LICENSE",
40
42
  "CHANGELOG.md",
41
43
  ".contextignore.example",