{"id":25121,"library":"context-compiler","title":"Context Compiler","description":"Agentic context compiler for AI-assisted development in TypeScript/JavaScript projects. Version 0.1.15 scans package.json, tsconfig.json, ESLint config, and CONTEXT.md, then uses an LLM via OpenRouter to resolve conflicts and generate a single Cursor rules file (.mdc). It bundles skill files for Angular, React, Node.js, TypeScript, etc., prioritized by project config. Requires Node >=22.0.0. Differentiators: automated detection of project technologies and ESLint/TSConfig constraints; priority hierarchy where CONTEXT.md overrides all; single OpenRouter call for synthesis; dry-run mode. Release cadence: early stage, frequent updates.","status":"active","version":"0.1.15","language":"javascript","source_language":"en","source_url":"https://github.com/AlekseyVY/context-compiler","tags":["javascript","ai","agent","cursor","context","typescript","angular","react","llm"],"install":[{"cmd":"npm install context-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add context-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add context-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to call OpenRouter API via OpenAI-compatible client","package":"openai","optional":false},{"reason":"Glob patterns to scan project files","package":"globby","optional":false},{"reason":"Terminal output styling","package":"chalk","optional":false}],"imports":[{"note":"ESM-only; no CommonJS support as of v0.1.x. compile is a named export, not default.","wrong":"const compile = require('context-compiler')","symbol":"compile","correct":"import { compile } from 'context-compiler'"},{"note":"init is a named export. Default import is undefined.","wrong":"import contextCompiler from 'context-compiler'","symbol":"init","correct":"import { init } from 'context-compiler'"},{"note":"scanProject is exported from internal module for advanced use; not part of main public API.","wrong":"import { scanProject } from 'context-compiler'","symbol":"scanProject","correct":"import { scanProject } from 'context-compiler/internal'"}],"quickstart":{"code":"import { compile, init } from 'context-compiler';\nimport { config } from 'openai';\n\n// Initialize: prompts for API key if not set\nawait init();\n\n// Compile context\nconst result = await compile({\n  openRouterApiKey: process.env.OPENROUTER_API_KEY ?? '',\n  dryRun: true, // Preview without writing\n  skills: ['react', 'typescript'], // Override auto-detection\n});\n\nconsole.log(result); // Generated .mdc content","lang":"typescript","description":"Shows how to programmatically initialize and compile context using the library's named exports."},"warnings":[{"fix":"Upgrade Node to v22 or later.","message":"Requires Node >=22.0.0; will throw on older versions.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Replace `skills` with `customSkills` in compile() call.","message":"The 'skills' option in compile() is deprecated; use 'customSkills' instead.","severity":"deprecated","affected_versions":">=0.1.10"},{"fix":"Set OPENROUTER_API_KEY environment variable or call init() first.","message":"OpenRouter API key is required; if not provided via env or init, the compile will fail with a non-descriptive error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Create the directory manually or run init() which creates it.","message":"The compile function writes to .cursor/rules/auto-context.mdc. Ensure .cursor/rules/ directory exists prior to calling compile without dryRun.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use import statements and ensure package.json has \"type\": \"module\".","message":"ESM-only; using require() will cause a runtime error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Explicitly set model in compile options to avoid unexpected changes.","message":"In v0.1.12, the default model changed from 'gpt-4' to 'anthropic/claude-3.5-sonnet'. Existing code may use deprecated model.","severity":"breaking","affected_versions":">=0.1.12"},{"fix":"Avoid using internal exports; rely on public API.","message":"scanProject() from 'context-compiler/internal' is not stable; its output format may change without major version bump.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.15':15 '22.0.0':56 'agent':3,89 'ai':8,88 'ai-assist':7 'angular':45,93 'assist':9 'autom':58 'bundl':41 'cadenc':82 'call':74 'compil':2,5 'config':20,53 'conflict':31 'constraint':65 'context':1,4,91 'context.md':22,69 'cursor':36,90 'detect':59 'develop':10 'differenti':57 'dri':78 'dry-run':77 'earli':83 'eslint':19 'eslint/tsconfig':64 'etc':49 'file':38,43 'frequent':85 'generat':33 'hierarchi':67 'javascript':87 'llm':26,95 'mdc':39 'mode':80 'node':55 'node.js':47 'openrout':28,73 'overrid':70 'package.json':17 'priorit':50 'prioriti':66 'project':13,52,61 'react':46,94 'releas':81 'requir':54 'resolv':30 'rule':37 'run':79 'scan':16 'singl':35,72 'skill':42 'stage':84 'synthesi':76 'technolog':62 'tsconfig.json':18 'typescript':48,92 'typescript/javascript':12 'updat':86 'use':24 'version':14 'via':27","created_at":"2026-05-01T13:43:07.887998+00:00","updated_at":"2026-05-01T13:43:07.887998+00:00","problems":[{"fix":"Use import syntax; add \"type\": \"module\" to package.json or use .mjs extension.","cause":"Package is ESM-only; CommonJS require is not supported.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use `import { init } from 'context-compiler'`.","cause":"Using default import instead of named import for init.","error":"TypeError: init is not a function"},{"fix":"Run `npx context-compiler init` or set process.env.OPENROUTER_API_KEY.","cause":"Missing API key for OpenRouter.","error":"OpenRouter API key not found. Set OPENROUTER_API_KEY env or run init."},{"fix":"Create directory: `mkdir -p .cursor/rules` or run init first.","cause":"Directory .cursor/rules does not exist and compile() tries to write without --dry-run.","error":"ENOENT: no such file or directory, mkdir '.cursor/rules'"},{"fix":"Upgrade Node to >=22 and use ESM imports.","cause":"Running Node <22 or using CommonJS import/require mismatch.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"context-compiler","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/AlekseyVY/context-compiler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/context-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}