{"_id":"repo-context-doctor","_rev":"3-184c9053b412f8c6ca63617c5eba222f","name":"repo-context-doctor","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"repo-context-doctor","version":"0.1.0","keywords":["coding-agents","codex","claude-code","cursor","lint","cli"],"author":{"name":"Debaditya Hait"},"license":"MIT","_id":"repo-context-doctor@0.1.0","maintainers":[{"name":"dhait","email":"debaditya2005hait@gmail.com"}],"homepage":"https://github.com/DebadityaHait/repo-context-doctor#readme","bugs":{"url":"https://github.com/DebadityaHait/repo-context-doctor/issues"},"bin":{"context-doctor":"dist/cli.js"},"dist":{"shasum":"c0be2ba2c3d5290f0ec0a1764182a26bdace7ddd","tarball":"https://registry.npmjs.org/repo-context-doctor/-/repo-context-doctor-0.1.0.tgz","fileCount":21,"integrity":"sha512-McqIzlwVEk0/it6pegmw4DwyWR5/8VQBCiljkxC4Wm0r/79aMkLpMuSmWYfxIfzshDH7fu0LOdhaN7S3MbZzrw==","signatures":[{"sig":"MEUCIQDYK7Z8E1i5df8Jza7LFrCArOFKCh0hFaOJegGn4ufuvgIgPosucH+zU7K44jskChNR/24geU9C5ATWFrVyOY0SUwo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31688},"type":"module","engines":{"node":">=20"},"gitHead":"4a2bb75ea9129031db350623d2a1a936cbc599c2","scripts":{"lint":"tsc -p tsconfig.json --noEmit","test":"npm run build:test && node --test dist/test/*.test.js","build":"tsc -p tsconfig.json && node -e \"require('node:fs').rmSync('dist/test',{recursive:true,force:true})\"","clean":"node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"","test:cli":"npm run build && node dist/cli.js --help && node dist/cli.js --json","typecheck":"tsc -p tsconfig.json --noEmit","build:test":"tsc -p tsconfig.json"},"_npmUser":{"name":"dhait","email":"debaditya2005hait@gmail.com"},"repository":{"url":"git+https://github.com/DebadityaHait/repo-context-doctor.git","type":"git"},"_npmVersion":"12.0.1","description":"Show the instruction graph your coding agents actually receive.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/repo-context-doctor_0.1.0_1787160097388_0.37850748584086835","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"repo-context-doctor","version":"0.2.0","keywords":["coding-agents","codex","claude-code","cursor","lint","cli"],"author":{"name":"Debaditya Hait"},"license":"MIT","_id":"repo-context-doctor@0.2.0","maintainers":[{"name":"dhait","email":"debaditya2005hait@gmail.com"}],"homepage":"https://github.com/DebadityaHait/repo-context-doctor#readme","bugs":{"url":"https://github.com/DebadityaHait/repo-context-doctor/issues"},"bin":{"context-doctor":"dist/cli.js"},"dist":{"shasum":"25f56fb919f61ead1a75d2fd02af25e9cdfce43f","tarball":"https://registry.npmjs.org/repo-context-doctor/-/repo-context-doctor-0.2.0.tgz","fileCount":25,"integrity":"sha512-92rQU4ErC7H3FbE1dFWJX8e/9xU9aaqzN2iT6qM39OyY71TNu4lcflg+D5nGGOa4oM5iNue6z/OyzV7SNvSdzQ==","signatures":[{"sig":"MEUCIQDLy0jbR7ByurZnQcmWHokyOu3Kz9nfloR4JPMBawMQQwIgNEqhzZ8UYfCcdXnle1FkNQy5XhSqfIH8bzl2UKzqcGI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40353},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ed800b6022b7356cc778efae26fa541db1efdef6","scripts":{"lint":"tsc -p tsconfig.json --noEmit","test":"npm run build:test && node --test dist/test/*.test.js","build":"tsc -p tsconfig.json && node -e \"require('node:fs').rmSync('dist/test',{recursive:true,force:true})\"","clean":"node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"","test:cli":"npm run build && node dist/cli.js --help && node dist/cli.js --mermaid","typecheck":"tsc -p tsconfig.json --noEmit","build:test":"tsc -p tsconfig.json"},"_npmUser":{"name":"dhait","email":"debaditya2005hait@gmail.com"},"repository":{"url":"git+https://github.com/DebadityaHait/repo-context-doctor.git","type":"git"},"_npmVersion":"12.0.1","description":"Show the instruction graph your coding agents actually receive.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/repo-context-doctor_0.2.0_1787163241711_0.28433185377789605","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"repo-context-doctor","version":"0.3.0","description":"Show the instruction graph your coding agents actually receive.","author":{"name":"Debaditya Hait"},"keywords":["coding-agents","codex","claude-code","cursor","lint","cli"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"repo-context-doctor":"dist/cli.js","rctx-doctor":"dist/cli.js"},"engines":{"node":">=20"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DebadityaHait/repo-context-doctor.git"},"bugs":{"url":"https://github.com/DebadityaHait/repo-context-doctor/issues"},"homepage":"https://github.com/DebadityaHait/repo-context-doctor#readme","publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsc -p tsconfig.json && node -e \"require('node:fs').rmSync('dist/test',{recursive:true,force:true})\"","build:test":"tsc -p tsconfig.json","lint":"tsc -p tsconfig.json --noEmit","typecheck":"tsc -p tsconfig.json --noEmit","test":"npm run build:test && node --test dist/test/*.test.js","test:cli":"npm run build && node dist/cli.js --help && node dist/cli.js --mermaid","clean":"node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.7.2"},"gitHead":"31247f654fd11350d3ec29ee1a6a5152725d0de1","_id":"repo-context-doctor@0.3.0","_nodeVersion":"24.18.0","_npmVersion":"12.0.1","dist":{"integrity":"sha512-5NDWkApWjBoFMGWi1HF4/oAq2AW7W9lDaltA/gsdYrGhvuvHTwFc6iJ5FClQORG6HEn+eF8FQ1Z/te3RnnN/gw==","shasum":"f9eb80e320f0cfa218711159d68bae30dd9a549f","tarball":"https://registry.npmjs.org/repo-context-doctor/-/repo-context-doctor-0.3.0.tgz","fileCount":25,"unpackedSize":46020,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCUOkMaadevBBJ5VLpDOKg1FV7fIcS2LXK5s+xpJiedtAIgTfX6/uLSjFhBznIU1imGnvpdvBZ5k/C2/BfHeYPMneg="}]},"_npmUser":{"name":"dhait","email":"debaditya2005hait@gmail.com"},"directories":{},"maintainers":[{"name":"dhait","email":"debaditya2005hait@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/repo-context-doctor_0.3.0_1787166753336_0.013703970391322207"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T17:21:37.103Z","modified":"2026-08-19T19:12:33.696Z","0.1.0":"2026-08-19T17:21:37.531Z","0.2.0":"2026-08-19T18:14:01.883Z","0.3.0":"2026-08-19T19:12:33.525Z"},"bugs":{"url":"https://github.com/DebadityaHait/repo-context-doctor/issues"},"author":{"name":"Debaditya Hait"},"license":"MIT","homepage":"https://github.com/DebadityaHait/repo-context-doctor#readme","keywords":["coding-agents","codex","claude-code","cursor","lint","cli"],"repository":{"type":"git","url":"git+https://github.com/DebadityaHait/repo-context-doctor.git"},"description":"Show the instruction graph your coding agents actually receive.","maintainers":[{"name":"dhait","email":"debaditya2005hait@gmail.com"}],"readme":"# Repo Context Doctor\n\n[![npm version](https://img.shields.io/npm/v/repo-context-doctor?logo=npm)](https://www.npmjs.com/package/repo-context-doctor)\n[![CI](https://github.com/DebadityaHait/repo-context-doctor/actions/workflows/ci.yml/badge.svg)](https://github.com/DebadityaHait/repo-context-doctor/actions/workflows/ci.yml)\n[![Node.js](https://img.shields.io/node/v/repo-context-doctor)](https://nodejs.org/)\n[![License](https://img.shields.io/npm/l/repo-context-doctor)](./LICENSE)\n\nMap the instruction files a coding agent can inherit, then find conflicts, stale references, duplicated rules, unsafe guidance, and context pressure before they change agent behavior.\n\nRepo Context Doctor is a read-only repository linter and graph inspector. It does not generate rules, package a codebase, call an LLM, or upload source content. That boundary is intentional: [Rulesync](https://github.com/dyoshikawa/rulesync) synchronizes agent configuration, [Repomix](https://github.com/yamadashy/repomix) packages repositories for model input, and [DheerG/context-doctor](https://github.com/DheerG/context-doctor) provides interactive context diagnosis. This tool verifies the instruction surface itself.\n\n> The executable is named `repo-context-doctor` (or `rctx-doctor`) to avoid colliding with the established [`context-doctor`](https://www.npmjs.com/package/context-doctor) package, which profiles and optimizes LLM conversation windows.\n\n## Install\n\n```bash\nnpm install --save-dev repo-context-doctor\nnpx repo-context-doctor check .\n```\n\nNode.js 20 or newer is required.\n\n## What it discovers\n\n| Ecosystem | Sources | Activation evidence |\n| --- | --- | --- |\n| OpenAI Codex | `AGENTS.md`, `AGENTS.override.md` | repository and nested-directory scope |\n| Claude Code | `CLAUDE.md`, `CLAUDE.local.md` | project/local-style override layers |\n| Cursor | `.cursorrules`, `.cursor/rules/**/*.mdc` | rule files and Cursor rule scope |\n| Gemini CLI | `GEMINI.md` | project and ancestor files |\n| GitHub Copilot | `.github/copilot-instructions.md` | repository instruction file |\n| Windsurf | `.windsurfrules`, `.windsurf/rules/**/*.md` | rule files and rule scope |\n\nUse `--include-global` to include ancestor files above the project root. Without it, scanning stays inside the selected repository.\n\n## Checks\n\n- `CTX001` contradictory package-manager, test, lint, or build guidance\n- `CTX002` references to missing files\n- `CTX003` missing `npm run` scripts\n- `CTX004` duplicated directives loaded from multiple sources\n- `CTX005` provider context approaching its configured budget\n- `CTX008` unsafe shell, secret-handling, or safety-bypass guidance\n\nEvery finding includes evidence paths and line numbers. JSON redacts directive bodies; SARIF points back to source files; Mermaid shows provider-to-source and override relationships.\n\n## Commands\n\n```bash\n# Human report; exits 1 for errors\nnpx repo-context-doctor check .\n\n# Inspect a nested service and one provider\nnpx repo-context-doctor check . --cwd services/payments --agent codex\n\n# Include ancestor instruction files explicitly\nnpx repo-context-doctor check . --include-global --json > context-report.json\n\n# Pull-request annotations and graph visualization\nnpx repo-context-doctor check . --sarif > context.sarif\nnpx repo-context-doctor graph . --mermaid > context.mmd\n\n# Treat warnings as blocking in a strict CI gate\nnpx repo-context-doctor check . --strict\n```\n\nExit codes are `0` for a clean report, `1` for an actionable finding (or a warning under `--strict`), and `3` when the scanner cannot complete. The JSON schema is versioned and contains no instruction bodies.\n\n## Library API\n\n```ts\nimport { scan } from \"repo-context-doctor\";\n\nconst report = await scan(process.cwd(), \".\", undefined, { includeGlobal: true });\nconsole.log(report.sources, report.findings, report.edges);\n```\n\n## Privacy and limits\n\n- Offline and read-only; no subprocesses, model calls, network access, or file writes.\n- Source paths, line numbers, normalized metadata, and graph edges are retained; instruction bodies are omitted from JSON reports.\n- Natural-language interpretation and undocumented provider precedence cannot be proven statically.\n- Findings are evidence for review, not a guarantee of what a closed-source agent will do.\n\n## Development\n\n```bash\nnpm install\nnpm run lint\nnpm test\nnpm run test:cli\nnpm pack --dry-run\n```\n\nIssues and pull requests are welcome in the [GitHub repository](https://github.com/DebadityaHait/repo-context-doctor).\n\n## License\n\nMIT © Debaditya Hait\n","readmeFilename":"README.md"}