All notable changes to SigMap are documented here.
Format: Semantic Versioning
- Query-aware retrieval —
src/retrieval/tokenizer.jsandsrc/retrieval/ranker.js: zero-dependency relevance ranker that scores every file against a free-text query by exact token, symbol, prefix, path, and recency signals. --query "<text>"CLI flag — ranks all context files by relevance and prints a scored table (Rank | File | Score | Sigs | Tokens) plus the top-3 signature blocks;--query "<text>" --jsonfor machine-readable output;--query "<text>" --top <n>to limit result set.query_contextMCP tool — 8th MCP tool; accepts{ query: string, topK?: number }and returns the same ranked table as the--queryCLI flag; live within any running MCP session.- Retrieval config —
config.retrieval.topK(default 10) andconfig.retrieval.recencyBoost(default 1.5×) added tosrc/config/defaults.js. test/integration/retrieval.test.js— 23 integration tests covering tokenizer unit tests, ranker sorting/scoring/topK/empty-query,formatRankTable,formatRankJSON, CLI--queryflags, and MCPquery_context.
src/mcp/server.jsversion bumped to2.3.0.test/integration/mcp-server.test.jsandmcp-v14.test.jsupdated to assert 8 tools.test/integration/analyze.test.jsversion assertion updated to2.3.0.
- 21/21 extractor unit tests passed
- 20/20 integration suites passed (0 failures)
node gen-context.js --version→2.3.0node gen-context.js --query "python extractor"→src/extractors/python.jsin top-3node gen-context.js --query "fix secret scanning" --json→ valid JSON- MCP
tools/list→ 8 tools includingquery_context
- Diagnostics & analyze command —
src/eval/analyzer.js: per-file breakdown of signature count, token cost, extractor used, and test coverage status. --analyzeCLI flag — prints a per-file table (File | Extractor | Sigs | Tokens | Covered) across all srcDirs; respectsexcludeconfig.--analyze --jsonflag — outputs the same breakdown as structured JSON ({ files, totalSigs, totalTokens, slowFiles, fileCount }).--analyze --slowflag — re-times each extractor and flags any file whose extraction takes >50ms in the table.--diagnose-extractorsCLI flag — runs all 21 language extractors againsttest/fixtures/and compares output totest/expected/; exits non-zero if any extractor diverges, shows first diff line per failure.test/integration/analyze.test.js— 14 integration tests coveringanalyzeFiles,formatAnalysisTable,formatAnalysisJSON, and all four CLI flags.
- 21/21 extractor tests passed
- All integration suites passed (19 suites, 19 passed, 0 failed — includes 14 new analyze tests)
node gen-context.js --version→2.2.0node gen-context.js --analyzeruns without error on SigMap reponode gen-context.js --analyze --json→ valid JSON with required keysnode gen-context.js --diagnose-extractors→ exits 0 on SigMap repo
- Benchmark & evaluation system —
src/eval/runner.jsandsrc/eval/scorer.js: zero-dependency retrieval quality measurement pipeline. Computes hit@5, MRR, and precision@5 against a JSONL task file. benchmarks/directory structure —benchmarks/tasks/retrieval.jsonl(20 tasks against SigMap's own codebase),benchmarks/results/(gitignored run output),benchmarks/reports/(human-readable summaries).--benchmarkCLI flag — runs retrieval through all tasks inbenchmarks/tasks/retrieval.jsonl, prints a markdown table (Task | Query | hit@5 | RR | Tokens) plus aggregate metrics;--benchmark --jsonfor machine-readable output.--evalCLI flag — alias for--benchmark.src/eval/scorer.js— pure metric functions:hitAtK(ranked, expected, k),reciprocalRank(ranked, expected),precisionAtK(ranked, expected, k),aggregate(results). Never throws.src/eval/runner.js— task loader (loadTasks), sig-index builder (buildSigIndex), keyword ranker (rank,tokenize), and mainrun(tasksFile, cwd)entry point. Reads generated context file from disk; no in-memory state.test/integration/benchmark.test.js— 10 integration tests covering scorer unit tests, tokenizer, task loading, empty-file edge case, metrics shape, and--benchmark --jsonCLI output.
- 21/21 extractor tests passed
- All integration suites passed (includes 10 new benchmark tests)
node gen-context.js --version→2.1.0node gen-context.js --benchmarkruns without error on SigMap reponode gen-context.js --benchmark --json→ valid JSON withmetrics.hitAt5,metrics.mrr,tasksarraynode gen-context.js --eval --json→ same output as--benchmark --json
- v2 output enrichment pipeline — compact
deps,todos,changessections auto-generated in context output. - Structural diff mode —
--diff <base-ref>writes a signature-level diff section comparing current signatures against a base branch. - Test coverage markers — opt-in per-function
✓/✗hints by scanning test directories (testCoverage: true). - Impact radius hints — opt-in reverse dependency annotations (
impactRadius: true). - New helper extractors:
src/extractors/deps.js— Python and TS/JS dependency extraction + reverse dep map.src/extractors/todos.js— TODO/FIXME/HACK/XXX harvesting (max 20 entries).src/extractors/coverage.js— lightweight function/test correlation.src/extractors/prdiff.js— signature-level base-ref diffs.
- New config keys:
enrichSignatures,depMap,schemaFields,todos,changes,changesCommits,testCoverage,testDirs,impactRadius. test/integration/v2plus.test.js— 3 integration tests for todos, coverage markers, and structural diff.test/integration/all.js— unified integration runner andtest:integration:allnpm script.
- Enriched multi-language extractors — return-type hints (
→ Type) and richer signatures across C++, C#, Dart, Go, Java, JavaScript, Kotlin, PHP, Python, Ruby, Rust, Scala, Svelte, Swift, TypeScript, and Vue. - Python extractor — dataclass/BaseModel field collapse, top-level docstring hints, fixed field bleed across class boundaries.
- TypeScript extractor — interface property types, class method return hints, compact hook return shapes for
export function useX(), union type truncation extended to 35 chars. - Removed stale development files:
TIMELINE.md,scripts/bundle.js,scripts/make-icon.py,scripts/inject-search.py,scripts/backfill-npm.sh,examples/slack-context-bot.js,examples/copilot-prompts.code-snippets.
- Python
tryExtractBaseModelFieldsno longer bleeds fields into subsequent classes. - TypeScript interface member type previews preserve longer union strings (20 → 35 chars).
- TypeScript function-style hooks (
export function useX) now include compact return object shapes.
- 21/21 extractor tests passed
- 17/17 integration suites passed (262 individual tests)
node gen-context.js --report→ ~93.5% reduction
- VS Code extension (
vscode-extension/) — zero-dependency extension for VS Code / VS Code-compatible editors:- Status bar item — shows health grade (A/B/C/D) and time since last regeneration; refreshes every 60 s and immediately on file-system change to
copilot-instructions.md. SigMap: Regenerate Contextcommand — runsnode gen-context.jsin an integrated terminal from the workspace root.SigMap: Open Context Filecommand — opens.github/copilot-instructions.mdin the editor.- Stale context notification — warns when
copilot-instructions.mdis > 24 h old; offers one-click regeneration or "Don't show again" suppression per workspace. contextforge.scriptPathsetting — override the path togen-context.jswhen it is not at the project root.onStartupFinishedactivation — loads within 3 s of VS Code opening, does not block startup.
- Status bar item — shows health grade (A/B/C/D) and time since last regeneration; refreshes every 60 s and immediately on file-system change to
- Docs site search — lightweight client-side keyword search added to all 6 HTML docs pages (
index.html,quick-start.html,strategies.html,languages.html,roadmap.html,repomix.html):- Press
/anywhere to open the search overlay;Escapeor click outside to close. - Searches all headings, paragraphs, and list items in the current page.
- Up to 12 results shown with snippet preview; matching text highlighted in amber.
- Click a result to scroll to the exact section with a 2-second amber outline highlight.
- Zero external dependencies — ~60 lines of inline JS per page. Theme-aware (dark/light).
- Press
.npmignore— excludestest/,docs/,scripts/,examples/,.claude/,vscode-extension/,.github/workflows/and planning docs from npm publish. Published package contains only the runtime files listed inpackage.json#files.test/integration/v1.5.test.js— 58 integration tests covering all v1.5 features:- npm package integrity (name, bin, engines, zero deps, .npmignore exclusions)
- shebang line presence and correctness
- extension manifest structure (commands, configuration, activation)
- extension.js API coverage (status bar, notification, commands, scriptPath)
- search injection verified in all 6 docs pages (overlay, input, keyboard handlers, highlights)
- The VS Code extension requires the
vscodepeer dependency at runtime (provided by the editor). It has no npm runtime dependencies of its own.
node gen-context.js --version→1.5.0✔ (note: version bumped separately if desired)node test/integration/v1.5.test.js→ 58/58 pass ✔node test/run.js→ 21/21 extractor tests pass ✔npm pack --dry-run→ notest/,docs/, orvscode-extension/in artifact ✔- All 6 docs pages: press
/→ search overlay opens; type "python" → result appears ✔
explain_fileMCP tool — deep-dive tool for a single file. Given a relative path, returns three sections:## Signatures(from the indexed context file),## Imports(resolved relative dependencies from the live source file), and## Callers(reverse import lookup across all indexed files). Gracefully returns partial output if the file is not on disk.list_modulesMCP tool — returns a markdown table listing all top-level module directories found in the context file, sorted by token count descending, with columns:Module | Files | Tokens. Helps agents pick the rightmodulearg forread_context.- Strategy-aware health scorer —
src/health/scorer.jsand--healthdisplay now readgen-context.config.jsonand adjust the low-reduction penalty threshold by strategy:full(default): 60% reduction threshold — unchanged behaviour.hot-cold/per-module: reduction penalty disabled — intentionally small hot outputs are not penalised.hot-coldonly: adds acontext-cold.mdfreshness check (strategyFreshnessDays). If the cold context file is >1 day stale, up to 10 pts are deducted.
- New
--healthoutput fields —strategy:line always visible;cold freshness:line shown forhot-coldstrategy. test/integration/mcp-v14.test.js— 13 integration tests coveringexplain_fileandlist_modules:- 7-tool count verification
- Signature extraction from index
- Imports and Callers sections (file on disk)
- Graceful error for unknown path, missing arg, no context file
- Token count and table structure in
list_modules - Multi-call session combining both new tools
test/integration/observability.test.js— 12 new unit tests for strategy-aware scorer:strategyfield in all return objects- No reduction penalty for
hot-coldandper-module - Reduction penalty still applied for
full strategyFreshnessDaysnull/populated correctly- Grade A for a fresh, untracked project
- Health scorer: projects with zero tracking history (brand-new or never run with
--track) are no longer penalised for "0% reduction".tokenReductionPctis only set whentotalRuns > 0.
- MCP server now exposes 7 tools (was 5 before v1.3, 5 in v1.3).
tools/listassertion updated inmcp-server.test.js. gen-context.jsVERSION bumped to1.4.0- MCP server
SERVER_INFO.versionbumped to1.4.0 package.jsonversion bumped to1.4.0
node gen-context.js --version→1.4.0✔echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node gen-context.js --mcp→ 7 tools ✔node test/integration/mcp-v14.test.js→ 13/13 pass ✔node test/integration/observability.test.js→ 35/35 pass ✔node test/integration/mcp-server.test.js→ 16/16 pass ✔node test/run.js→ 21/21 extractor tests pass ✔
--diffCLI flag — generates context only for files changed in the current git working tree (git diff HEAD --name-only). Useful in CI and pre-review workflows where you only want signatures for files you've touched.--diff --stagedvariant — restricts context to files in the git staging area only (git diff --cached --name-only). Ideal as a pre-commit check.- Smart fallback — both
--diffmodes automatically fall back to a fullrunGeneratewhen: outside a git repo, no changed files, or all changed files are outside trackedsrcDirs. No silent failures. --diff --report— when both flags are used together, prints a side-by-side comparison of diff-mode vs full-mode token counts and savings.watchDebounceconfig key — new key ingen-context.config.json(default:300) controls the debounce delay (ms) between file-system events and regeneration in watch mode. Configurable per project.test/integration/diff.test.js— 6 integration tests covering all diff-mode scenarios:- Diff-only output excludes unchanged files
--stagedexcludes unstaged modifications- Empty diff fallback to full generate
- Non-git-repo fallback
- Changed files outside srcDirs fallback
- Multiple changed files all appear in output
- Watch mode debounce reduced from 500 ms → 300 ms (default). Now reads
config.watchDebounce || 300— fully configurable. gen-context.jsVERSION bumped to1.3.0- MCP server version bumped to
1.3.0 package.jsonversion bumped to1.3.0src/config/defaults.js— addedwatchDebounce: 300key
node gen-context.js --version→1.3.0✔node gen-context.js --diffon a repo with changes → output contains only changed-file sigs ✔node gen-context.js --diff --staged→ output contains only staged-file sigs ✔node test/integration/diff.test.js→ 6/6 pass ✔node test/run.js→ 21/21 extractor tests pass ✔
--initnow scaffolds.contextignorealongsidegen-context.config.json. Runningnode gen-context.js --initon a fresh project creates both files..contextignoreis pre-populated with sensible defaults (node_modules/,dist/,build/,*.generated.*, etc.). Safe to re-run — existing files are never overwritten.test/integration/strategy.test.js— 9 integration tests coveringper-moduleandhot-coldstrategies:per-module: asserts onecontext-<module>.mdpersrcDir, overview file references all modules, cross-module signature isolationhot-cold: assertscontext-cold.mdis created, primary output contains only hot files,hotCommitsconfig controls the boundary- Both strategies: fallback behaviour when
srcDiris missing or repo has no git history
sigmapnpm binary alias —package.jsonbinnow exposes bothgen-context(existing) andsigmap(new alias), makingnpx sigmapwork ahead of full npm publish in v1.5--diffand--diff --stagedlisted in--help— help text documents the upcoming flags so tooling auto-complete picks them up
package.jsonversion bumped to1.1.0(syncs with already-shipped v1.1 strategy features)gen-context.jsVERSIONconstant bumped to1.1.0src/mcp/server.jsSERVER_INFO.versionbumped to1.1.0--initno longer exits early when config already exists — it still skips writing config but continues to check / write.contextignorekeywordsinpackage.jsonexpanded: addedtoken-reduction,code-signatures
node gen-context.js --version→1.1.0✔cat package.json | grep version→"version": "1.1.0"✔node gen-context.js --initon a fresh dir → bothgen-context.config.jsonand.contextignorecreated ✔node test/integration/strategy.test.js→ all 9 tests pass ✔node test/run.js→ 21/21 extractor tests pass ✔
- Context strategies — new
"strategy"config key with three options:"full"(default) — existing behaviour, single output file, all signatures"per-module"— one.github/context-<module>.mdper top-levelsrcDirplus a thin always-injected overview table (~100–300 tokens); ~70% fewer injected tokens per question with zero context loss; no MCP required"hot-cold"— recently committed files auto-injected as usual; all other files written to.github/context-cold.mdfor MCP on-demand retrieval; ~90% fewer always-injected tokens; best with Claude Code / Cursor MCP enabled
"hotCommits"config key — controls how many recent git commits count as "hot" for thehot-coldstrategy (default: 10)docs/CONTEXT_STRATEGIES.md— comprehensive strategy guide: decision tree, four worked-scenario comparisons (fix-a-bug, cross-module question, daily dev, onboarding), full configuration reference, migration guide, and feature-compatibility matrix- README: new "Context strategies" section with inline examples linking to full guide
gen-context.config.json.example:strategyandhotCommitskeys with comments
gen-context.jsversion remains1.0.0;runGeneratenow dispatches torunPerModuleStrategyorrunHotColdStrategybased onconfig.strategygetRecentlyCommittedFiles(cwd, count)now accepts a count parameter sohotCommitsis respected--helptext updated with strategy descriptions
strategy: per-moduleon arbi-platform:3 modules, overview ~117 tokens, total ~4,058 tokensstrategy: hot-coldon arbi-platform:79 hot files ~3,700 tokens, 1 cold ~363 tokensstrategy: fullunchanged:80 files, ~3,980 tokens, 94.9% reduction- All 21 checks pass post-deployment
- Self-healing CI —
examples/self-healing-github-action.yml: weekly cron workflow that queries the GitHub Enterprise Copilot API for acceptance rate; automatically opens a PR with regenerated context when rate drops below threshold (default 30%) or context file is stale (> 7 days); falls back to staleness check when no API token is configured scripts/ci-update.sh— CI helper script:--fail-over-budget(exits 1 if output tokens exceed budget),--track,--format cache; designed for required CI pipeline steps--suggest-tool "<task>"— recommends a model tier (fast / balanced / powerful) from a free-text task description using keyword matching againstsrc/routing/hints.jsTIERS;--jsonvariant returns machine-readable{ tier, label, models, costHint }for IDE integrations--health— composite 0-100 health score derived from: context staleness (days since last regeneration), average token reduction %, and over-budget run rate; letter grade A–D;--jsonvariant for dashboards and CIsrc/health/scorer.js— zero-dependency health scoring module:score(cwd)reads usage log + context file mtime; never throws- Integration test:
test/integration/system.test.js— 15 tests covering suggest-tool (all three tiers,--jsonshape, missing-description guard) and health (--jsonfield presence, score range, grade values, run counters)
gen-context.jsversion bumped to1.0.0; help text expanded with--suggest-tool,--healthpackage.jsonversion bumped to1.0.0src/mcp/server.jsversion bumped to1.0.0- README updated: v1.0 features section, new CLI reference entries, updated project structure tree
- 177/177 tests pass (21 extractor + 156 integration)
node gen-context.js --suggest-tool "security audit"→ tier: powerfulnode gen-context.js --health --json→{ score, grade, tokenReductionPct, daysSinceRegen, ... }- Self-healing CI workflow validates via
node gen-context.js --health --jsonin check job
- Enhanced
--report --json— structured JSON report now includesversion,timestamp,overBudget, andbudgetLimitfields alongside existing token stats; exits with code1when output exceedsmaxTokensso CI pipelines can fail automatically --trackCLI flag — appends one NDJSON record per run to.context/usage.ndjson; also enabled by"tracking": truein configsrc/tracking/logger.js— zero-dependency append-only log module; exportslogRun(entry, cwd),readLog(cwd), andsummarize(entries); uses NDJSON (one JSON object per line) compatible with standard Unix tools--report --history— prints aggregate summary from.context/usage.ndjson(total runs, avg reduction %, avg tokens, over-budget count, first/last run timestamps); add--jsonfor machine-readable outputdocs/ENTERPRISE_SETUP.md— comprehensive enterprise guide: GitHub Enterprise REST API acceptance rate tracking, CI token reporting with Prometheus/Grafana dashboard integration, self-hosted runner configuration, usage log analysis examplestracking: falsedefault added tosrc/config/defaults.js- Integration test:
test/integration/observability.test.js— 23 tests coveringlogRun,readLog,summarize, CLI--report --json,--track, config-driven tracking, and--report --history
gen-context.jsversion bumped to0.9.0package.jsonversion bumped to0.9.0src/mcp/server.jsversion bumped to0.9.0--reporthuman output now includesversionandbudget limitlines- README updated:
--track/--report --historyin CLI reference, new Observability section, updated project structure tree
- 162/162 tests pass (21 extractor + 141 integration)
node gen-context.js --report --jsonoutputs JSON withversion,timestamp,overBudgetnode gen-context.js --trackwrites.context/usage.ndjsonnode gen-context.js --report --historyprints usage summarynode gen-context.js --report --history --jsonoutputs valid JSON
--format cacheCLI flag — alongside the standard markdown output, writes.github/copilot-instructions.cache.json, a single Anthropic content block withcache_control: { type: "ephemeral" }ready for direct use in Anthropic API callssrc/format/cache.js— zero-dependency formatter; exportsformatCache(content) → JSON string(single content block) andformatCachePayload(content, model) → JSON string(full messages API payload with system array)format: 'default'config key — set"format": "cache"ingen-context.config.jsonto always write the cache JSON file on every run; default is'default'(markdown only)docs/REPOMIX_CACHE.md— full prompt cache strategy: two-layer design (Repomix as stable cached prefix + SigMap as dynamic segment), cost calculations (~60% reduction), API call examples, CI integration, cache warm-up strategy- Integration test:
test/integration/cache.test.js— 20 tests coveringformatCache(),formatCachePayload(), CLI--format cacheflag, config-driven mode, and absence of cache file when flag is not set
gen-context.jsversion bumped to0.8.0package.jsonversion bumped to0.8.0- README updated:
--format cacheentry in CLI reference, new Prompt Caching section, updated project structure tree
- 139/139 tests pass (21 extractor + 118 integration)
node gen-context.js --format cachewrites.github/copilot-instructions.cache.json- Cache JSON has
type: "text"andcache_control: { type: "ephemeral" } node gen-context.jswithout--format cachedoes NOT write cache file
- Model routing hints — classifies every indexed file into
fast,balanced, orpowerfultier based on path conventions and signature count, then appends a## Model routing hintssection to the context output --routingCLI flag —node gen-context.js --routingappends routing hints in one pass; set"routing": truein config to always include themsrc/routing/classifier.js— zero-dependency heuristic classifier (path patterns, sig count, indented method count)src/routing/hints.js— tier definitions (TIERS) andformatRoutingSection()formatterget_routingMCP tool (5th tool) — returns routing hints for the current project on demand; reads context file, classifies files, returns formatted markdowndocs/MODEL_ROUTING.md— full routing guide: tier criteria, task-to-tier decision flow, VS Code / Claude Code / CI integration, cost calculation reference- Integration test:
test/integration/routing.test.js— 25 tests covering classifier unit tests, classifyAll grouping, formatRoutingSection, CLI flag, config flag, and MCP tool routing: falsedefault added tosrc/config/defaults.jssrc/mcp/server.jsversion bumped to0.7.0
tools/listnow returns 5 tools (previously 4) — addsget_routing
- 119/119 tests pass (21 extractor + 98 integration)
node gen-context.js --routingproduces## Model routing hintsin outputtools/listreturns 5 tools includingget_routingget_routingMCP call returns tier classification for current project
create_checkpointMCP tool — returns a markdown session snapshot: active branch, last 5 commits, context token count, modules indexed, and route table summary (whenPROJECT_MAP.mdis present)examples/copilot-prompts.code-snippets— 20 VS Code code snippets withcf-prefix covering the full session lifecycle (cf-start,cf-checkpoint,cf-end,cf-pr,cf-debug,cf-test,cf-search,cf-map-*, and more)examples/slack-context-bot.js— zero-dependency Node.js script that posts daily context-freshness reminders to a Slack channel via an Incoming Webhook URL; includes branch, recent commit, token count, and a session checklistdocs/SESSION_DISCIPLINE.md— complete session discipline guide: session lifecycle, 30-minute checkpoint cadence, token hygiene table, multi-session workflow, git hook integration, MCP tool reference, and VS Code snippet install instructionssrc/mcp/server.jsversion bumped to0.6.0- Integration tests: 5 new tests for
create_checkpointintest/integration/mcp-server.test.js
tools/listnow returns 4 tools (previously 3) —read_context,search_signatures,get_map,create_checkpoint
- 94/94 tests pass (21 extractor + 73 integration)
create_checkpointMCP tool returns JSON with# SigMap Checkpointheadercreate_checkpointwithnoteparam includes note in outputtools/listreturns 4 tools includingcreate_checkpoint- VS Code snippets file has JSON-valid syntax;
cf-prefix on all 20 snippets
--monorepoCLI flag — auto-detects packages underpackages/,apps/,services/,libs/and writes oneCLAUDE.mdper package- Manifest detection covers
package.json,Cargo.toml,go.mod,pyproject.toml,pom.xml,build.gradle config.monorepo: truetriggers monorepo mode without the CLI flag- Git-diff priority output ordering — recently committed files now appear first in the generated output (not just protected from token-budget drops)
examples/github-action.yml— ready-to-use 4-job CI workflow: SigMap, gen-project-map, Repomix, test suite (Node 18/20/22 matrix)docs/CI_GUIDE.md— full CI setup guide, monorepo config,.contextignorepatterns, token report in CI- Integration test:
test/integration/monorepo.test.js— 8 tests (packages/, apps/, services/, multi-manifest, 5-package smoke) - Integration test:
test/integration/contextignore.test.js— 7 tests (patterns, wildcards, comments, union of both ignore files)
- 89/89 tests pass (21 extractor + 68 integration)
node gen-context.js --monorepowritesCLAUDE.mdper detected packagenode gen-context.js --reportconfirms git-diff files appear first in output
gen-project-map.js— standalone zero-dependency CLI; generatesPROJECT_MAP.mdsrc/map/import-graph.js— static import/require analysis for JS, TS, Python; DFS cycle detection with⚠warningssrc/map/class-hierarchy.js— extractsextends/implementsrelationships across TypeScript, JavaScript, Python, Java, Kotlin, C#src/map/route-table.js— HTTP route extraction for Express, Fastify, NestJS, Flask, FastAPI, Go (Gin/stdlib), Spring- Output:
PROJECT_MAP.mdwith### Import graph,### Class hierarchy,### Route tablesections (MCP-compatible headers) gen-project-map.js --versionand--helpflags- Integration test:
test/integration/project-map.test.js— 12 tests covering all frameworks, circular detection, MCP section extraction package.jsonupdated tov0.4.0;gen-project-mapadded tobin
- 74/74 tests pass (21 extractor + 53 integration)
node gen-project-map.jswritesPROJECT_MAP.mdwith all three sections- MCP
get_maptool correctly extracts each section by###header
src/mcp/server.js— stdio JSON-RPC 2.0 MCP server (zero npm dependencies); handlesinitialize,tools/list,tools/callsrc/mcp/tools.js— 3 tool definitions:read_context,search_signatures,get_mapsrc/mcp/handlers.js— tool implementations; reads context files from disk on every call (no in-memory state)--mcpCLI flag — starts MCP server on stdio- MCP auto-registration in
.claude/settings.jsonand.cursor/mcp.jsonvia--setup examples/claude-code-settings.json— pre-configured entry for both SigMap and Repomix MCP serversdocs/MCP_SETUP.md— full MCP setup guide with both Claude Code and Cursor examples- Integration test:
test/integration/mcp-server.test.js— 11 tests
| Tool | Input | Output |
|---|---|---|
read_context |
{ module?: string } |
All signatures or module-scoped subset |
search_signatures |
{ query: string } |
Matching signatures with file paths |
get_map |
{ type: "imports" | "classes" | "routes" } |
Section from PROJECT_MAP.md |
- 62/62 tests pass (21 extractor + 41 integration)
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node gen-context.js --mcpreturns 3 tools
src/security/patterns.js— 10 secret detection patterns (AWS, GCP, GitHub, JWT, DB URLs, SSH, Stripe, Twilio, generic key=value)src/security/scanner.js—scan(sigs, filePath) → { safe, redacted }; never throws; redacts per-file onlysrc/config/loader.js— reads and deep-mergesgen-context.config.jsonwith defaults; warns on unknown keyssrc/config/defaults.js— all config keys documented with defaults- Token budget drop order: generated → test → config → least-recently-changed
- Multi-agent output targets:
copilot,claude,cursor,windsurf CLAUDE.mdappend strategy — appends below## Auto-generated signaturesmarker; never overwrites human content abovedocs/REPOMIX_INTEGRATION.md— companion tool integration guide- Integration tests:
secret-scan.test.js(12),config-loader.test.js(6),token-budget.test.js(5),multi-output.test.js(7)
- 51/51 tests pass (21 extractor + 30 integration)
- Secret in fixture →
[REDACTED — AWS Access Key detected]in output - Output ≤ 6000 tokens on any project over 200 files
gen-context.js— single-file zero-dependency CLI entry point- 21 language extractors: TypeScript, JavaScript, Python, Java, Kotlin, Go, Rust, C#, C/C++, Ruby, PHP, Swift, Dart, Scala, Vue, Svelte, HTML, CSS/SCSS, YAML, Shell, Dockerfile
- CLI flags:
--generate,--watch,--setup,--report,--report --json,--init,--help,--version .contextignoresupport (gitignore syntax), also reads.repomixignorefs.watchauto-update with 500ms debouncepost-commitgit hook installer via--setup- Token budget enforcement with priority drop order
test/run.jszero-dependency test runner- 21 fixture files and expected outputs
gen-context.config.json.exampleand.contextignore.example
- 21/21 extractor tests pass
- Runs on a Node 18 machine with zero npm install
- Output written to
.github/copilot-instructions.md