@praneeth_54/agentdoctor 1.1.0 → 2.0.0

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.
Files changed (170) hide show
  1. package/CHANGELOG.md +119 -5
  2. package/README.md +165 -332
  3. package/dist/agents/aider/adapter.d.ts +1 -0
  4. package/dist/agents/aider/adapter.js +1 -0
  5. package/dist/agents/aider/detector.d.ts +14 -0
  6. package/dist/agents/aider/detector.js +120 -0
  7. package/dist/agents/copilot/adapter.d.ts +1 -0
  8. package/dist/agents/copilot/adapter.js +1 -0
  9. package/dist/agents/copilot/detector.d.ts +13 -0
  10. package/dist/agents/copilot/detector.js +113 -0
  11. package/dist/agents/gemini/adapter.d.ts +1 -0
  12. package/dist/agents/gemini/adapter.js +1 -0
  13. package/dist/agents/gemini/detector.d.ts +13 -0
  14. package/dist/agents/gemini/detector.js +151 -0
  15. package/dist/agents/registry.js +13 -1
  16. package/dist/agents/types.d.ts +1 -1
  17. package/dist/agents/windsurf/adapter.d.ts +1 -0
  18. package/dist/agents/windsurf/adapter.js +1 -0
  19. package/dist/agents/windsurf/detector.d.ts +14 -0
  20. package/dist/agents/windsurf/detector.js +119 -0
  21. package/dist/architecture/c4.d.ts +22 -0
  22. package/dist/architecture/c4.js +62 -0
  23. package/dist/cli/commands/brain.d.ts +12 -0
  24. package/dist/cli/commands/brain.js +162 -0
  25. package/dist/cli/commands/complete.d.ts +23 -0
  26. package/dist/cli/commands/complete.js +232 -0
  27. package/dist/cli/commands/explain.js +1 -1
  28. package/dist/cli/commands/fix.js +22 -2
  29. package/dist/cli/commands/mcp.d.ts +8 -0
  30. package/dist/cli/commands/mcp.js +14 -0
  31. package/dist/cli/commands/platform.d.ts +15 -0
  32. package/dist/cli/commands/platform.js +191 -0
  33. package/dist/cli/commands/v2.d.ts +55 -0
  34. package/dist/cli/commands/v2.js +278 -0
  35. package/dist/cli/program.js +809 -2
  36. package/dist/constants.d.ts +3 -2
  37. package/dist/constants.js +5 -1
  38. package/dist/contracts/adapters.d.ts +7 -0
  39. package/dist/contracts/adapters.js +60 -0
  40. package/dist/contracts/index.d.ts +162 -0
  41. package/dist/contracts/index.js +18 -0
  42. package/dist/core/baseline/store.d.ts +48 -0
  43. package/dist/core/baseline/store.js +163 -0
  44. package/dist/core/brain-cli/service.d.ts +26 -0
  45. package/dist/core/brain-cli/service.js +175 -0
  46. package/dist/core/brain-product/init.d.ts +45 -0
  47. package/dist/core/brain-product/init.js +232 -0
  48. package/dist/core/changes/analyze.d.ts +41 -0
  49. package/dist/core/changes/analyze.js +223 -0
  50. package/dist/core/context-health/analyze.d.ts +15 -0
  51. package/dist/core/context-health/analyze.js +234 -0
  52. package/dist/core/fix/apply.d.ts +21 -4
  53. package/dist/core/fix/apply.js +118 -18
  54. package/dist/core/fix/backup.d.ts +30 -0
  55. package/dist/core/fix/backup.js +193 -0
  56. package/dist/core/fix/plan.d.ts +6 -3
  57. package/dist/core/fix/plan.js +113 -9
  58. package/dist/core/fix/render.d.ts +2 -0
  59. package/dist/core/fix/render.js +36 -21
  60. package/dist/core/fix/run.js +5 -1
  61. package/dist/core/fix/safe-target.d.ts +14 -0
  62. package/dist/core/fix/safe-target.js +81 -0
  63. package/dist/core/fix/types.d.ts +12 -1
  64. package/dist/core/fix/types.js +2 -0
  65. package/dist/core/fix/writers/claude-settings.js +3 -1
  66. package/dist/core/fix/writers/codex-config.d.ts +3 -0
  67. package/dist/core/fix/writers/codex-config.js +24 -3
  68. package/dist/core/fix/writers/cursorignore.js +3 -1
  69. package/dist/core/fix/writers/simple-ignore.d.ts +16 -0
  70. package/dist/core/fix/writers/simple-ignore.js +68 -0
  71. package/dist/core/monorepo/detect.d.ts +13 -0
  72. package/dist/core/monorepo/detect.js +121 -0
  73. package/dist/core/rules/build-context.js +22 -3
  74. package/dist/core/rules/context/generated-directory.js +11 -1
  75. package/dist/core/rules/context/large-instruction-file.js +6 -0
  76. package/dist/core/rules/context/large-log-file.js +16 -1
  77. package/dist/core/rules/ignore.d.ts +11 -1
  78. package/dist/core/rules/ignore.js +22 -1
  79. package/dist/core/rules/instructions/empty-instructions.js +7 -0
  80. package/dist/core/rules/security/env-file-exposure.js +23 -2
  81. package/dist/core/rules/security/private-key-file.js +1 -1
  82. package/dist/core/scanner/scan.js +1 -1
  83. package/dist/core/schemas/validate.d.ts +6 -0
  84. package/dist/core/schemas/validate.js +62 -0
  85. package/dist/core/scoring/compute-scores.d.ts +1 -1
  86. package/dist/core/scoring/compute-scores.js +5 -1
  87. package/dist/core/scoring/placeholder.d.ts +1 -1
  88. package/dist/core/scoring/placeholder.js +5 -1
  89. package/dist/core/secrets/scan.d.ts +23 -0
  90. package/dist/core/secrets/scan.js +172 -0
  91. package/dist/dashboard/server.d.ts +24 -0
  92. package/dist/dashboard/server.js +386 -0
  93. package/dist/enforcement/runner.d.ts +23 -0
  94. package/dist/enforcement/runner.js +56 -0
  95. package/dist/index.d.ts +13 -0
  96. package/dist/index.js +12 -0
  97. package/dist/integrations/github/pr-analyze.d.ts +28 -0
  98. package/dist/integrations/github/pr-analyze.js +98 -0
  99. package/dist/integrations/local-ai/provider.d.ts +45 -0
  100. package/dist/integrations/local-ai/provider.js +104 -0
  101. package/dist/intelligence/git/analyze.d.ts +34 -0
  102. package/dist/intelligence/git/analyze.js +136 -0
  103. package/dist/intelligence/graph/build.d.ts +13 -0
  104. package/dist/intelligence/graph/build.js +215 -0
  105. package/dist/knowledge/store.d.ts +25 -0
  106. package/dist/knowledge/store.js +91 -0
  107. package/dist/mcp/agentdoctor/server.d.ts +16 -0
  108. package/dist/mcp/agentdoctor/server.js +67 -0
  109. package/dist/mcp/brain/session.js +7 -7
  110. package/dist/mcp/intelligence/handlers.d.ts +11 -0
  111. package/dist/mcp/intelligence/handlers.js +175 -0
  112. package/dist/mcp/intelligence/path-safety.d.ts +11 -0
  113. package/dist/mcp/intelligence/path-safety.js +82 -0
  114. package/dist/mcp/intelligence/registry.d.ts +8 -0
  115. package/dist/mcp/intelligence/registry.js +160 -0
  116. package/dist/ops/health.d.ts +18 -0
  117. package/dist/ops/health.js +51 -0
  118. package/dist/platform/ai-quality/analyze.d.ts +9 -0
  119. package/dist/platform/ai-quality/analyze.js +65 -0
  120. package/dist/platform/architecture/drift.d.ts +17 -0
  121. package/dist/platform/architecture/drift.js +74 -0
  122. package/dist/platform/auth/local.d.ts +15 -0
  123. package/dist/platform/auth/local.js +58 -0
  124. package/dist/platform/context-security/analyze.d.ts +6 -0
  125. package/dist/platform/context-security/analyze.js +97 -0
  126. package/dist/platform/firewall/evaluate.d.ts +54 -0
  127. package/dist/platform/firewall/evaluate.js +308 -0
  128. package/dist/platform/graph/build.d.ts +6 -0
  129. package/dist/platform/graph/build.js +193 -0
  130. package/dist/platform/health/analyze.d.ts +7 -0
  131. package/dist/platform/health/analyze.js +186 -0
  132. package/dist/platform/index.d.ts +27 -0
  133. package/dist/platform/index.js +87 -0
  134. package/dist/platform/knowledge/analyze.d.ts +20 -0
  135. package/dist/platform/knowledge/analyze.js +96 -0
  136. package/dist/platform/provenance/build.d.ts +44 -0
  137. package/dist/platform/provenance/build.js +65 -0
  138. package/dist/platform/readiness/scorecard.d.ts +5 -0
  139. package/dist/platform/readiness/scorecard.js +98 -0
  140. package/dist/platform/refactor/impact.d.ts +20 -0
  141. package/dist/platform/refactor/impact.js +60 -0
  142. package/dist/platform/reports/export.d.ts +12 -0
  143. package/dist/platform/reports/export.js +92 -0
  144. package/dist/platform/security/redact.d.ts +15 -0
  145. package/dist/platform/security/redact.js +87 -0
  146. package/dist/platform/sessions/store.d.ts +32 -0
  147. package/dist/platform/sessions/store.js +97 -0
  148. package/dist/platform/store.d.ts +6 -0
  149. package/dist/platform/store.js +57 -0
  150. package/dist/platform/test-impact/analyze.d.ts +32 -0
  151. package/dist/platform/test-impact/analyze.js +164 -0
  152. package/dist/platform/time-machine/compare.d.ts +17 -0
  153. package/dist/platform/time-machine/compare.js +62 -0
  154. package/dist/platform/tokens/plan.d.ts +28 -0
  155. package/dist/platform/tokens/plan.js +89 -0
  156. package/dist/platform/types.d.ts +111 -0
  157. package/dist/platform/types.js +5 -0
  158. package/dist/plugins/runtime.d.ts +36 -0
  159. package/dist/plugins/runtime.js +101 -0
  160. package/dist/plugins/sdk.d.ts +29 -0
  161. package/dist/plugins/sdk.js +114 -0
  162. package/dist/policy/packs.d.ts +9 -0
  163. package/dist/policy/packs.js +59 -0
  164. package/dist/reporters/terminal/report.js +38 -5
  165. package/dist/storage/provider.d.ts +35 -0
  166. package/dist/storage/provider.js +103 -0
  167. package/dist/team/auth.d.ts +35 -0
  168. package/dist/team/auth.js +70 -0
  169. package/dist/types/index.d.ts +5 -1
  170. package/package.json +14 -7
package/README.md CHANGED
@@ -1,436 +1,269 @@
1
1
  # AgentDoctor
2
2
 
3
+ **Codebase intelligence for developers, agents, and engineering teams.**
4
+
5
+ Local-first tooling that helps you understand a repository, keep AI coding agents safer, and query evidence-backed project knowledge — without requiring a cloud account or API key.
6
+
3
7
  [![npm](https://img.shields.io/npm/v/@praneeth_54/agentdoctor?label=npm)](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
4
- [![npm downloads](https://img.shields.io/npm/dm/@praneeth_54/agentdoctor)](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
5
- [![CI](https://img.shields.io/github/actions/workflow/status/pranee54/AgentDoctor/ci.yml?branch=main&label=CI)](https://github.com/pranee54/AgentDoctor/actions)
8
+ [![CI](https://img.shields.io/github/actions/workflow/status/pranee54/AgentDoctor/ci.yml?branch=main&label=CI)](https://github.com/pranee54/AgentDoctor/actions/workflows/ci.yml)
6
9
  [![Node](https://img.shields.io/node/v/@praneeth_54/agentdoctor)](https://nodejs.org)
7
10
  [![License](https://img.shields.io/github/license/pranee54/AgentDoctor)](LICENSE)
8
11
 
9
- **Lighthouse for AI coding agents.**
10
-
11
- Audit coding-agent configuration before it becomes a repository problem.
12
-
13
- AgentDoctor is a local CLI that inspects project-level AI coding agent setup — Cursor, Claude Code, and Codex — for security, instructions, context, and MCP configuration. Deterministic static analysis. No API key. No code upload by default.
14
-
15
- ```bash
16
- npx @praneeth_54/agentdoctor
17
- ```
12
+ **Published package:** `@praneeth_54/agentdoctor@`**2.0.0**
18
13
 
19
- Public release track: Safety V1 (`1.0.0`) plus Project Brain MCP for agents (`1.1.0`).
20
- Scan → Fix → Verify → CI remains the Safety contract. Brain MCP helps agents understand
21
- what is in a repository, what can be trusted, and why — not a generic coding assistant.
14
+ [Documentation index](docs/README.md) · [AgentDoctor 2.0 docs](docs/2.0/README.md) · [Known limitations](docs/2.0/overview/known-limitations.md) · [Readiness matrix](docs/2.0/overview/readiness-matrix.md) · [Security](SECURITY.md) · [Changelog](CHANGELOG.md)
22
15
 
23
16
  ---
24
17
 
25
- ## What you get
26
-
27
- ![AgentDoctor scanning a repository and reporting coding-agent security findings](docs/images/cli-scan.png)
28
-
29
- _Real scan of the included `insecure-agent-project` fixture using AgentDoctor v1.0.0._
30
-
31
- ```text
32
- $ npx @praneeth_54/agentdoctor
33
-
34
- 🩺 AgentDoctor v1.0.0
35
-
36
- Scanning repository...
18
+ ## What AgentDoctor does
37
19
 
38
- Repository
39
- Framework: Node.js
40
- Language: JavaScript
41
- Package manager: npm
42
- Files scanned: 7
20
+ AgentDoctor combines three complementary layers:
43
21
 
44
- AI Coding Agents
22
+ 1. **Safety** — audit and safely fix AI coding-agent configuration (scan → fix → verify → policy → CI).
23
+ 2. **Repository Brain** — evidence-backed claims, proposals, human review, and Project Brain MCP tools.
24
+ 3. **Codebase intelligence** — TypeScript/JavaScript AST graphs, git hotspots, impact analysis, knowledge governance, evaluate-only policy, and a combined MCP server.
45
25
 
46
- ✓ Cursor configured
47
- ✓ Claude Code configured
48
- ✓ Codex configured
26
+ It is **not** an autonomous coding agent, chatbot, or IDE process interceptor. It does **not** block Cursor/Claude/Codex unless you deliberately run commands through AgentDoctor’s controlled runner.
49
27
 
50
- Findings
51
-
52
- CRITICAL
53
-
54
- ✗ Sensitive environment file may enter agent context
55
- .env
56
- Affected: Claude Code, Codex
57
- Fix: Add an agent-specific exclusion (for example .cursorignore or a
58
- Claude Code Read deny rule), keep the file out of version control,
59
- and rotate any credentials that may have been exposed.
60
-
61
- ✗ Private key or credential file present in repository
62
- test-private-key.pem
63
- Affected: Claude Code, Codex, Cursor
64
-
65
- WARNING
66
-
67
- ! Claude Code bypassPermissions mode enabled
68
- .claude/settings.json
69
-
70
- Summary
28
+ ---
71
29
 
72
- 3 critical
73
- 1 warning
74
- 0 info
30
+ ## Install
75
31
 
76
- Readiness: 13/100
77
- Category and agent scores: agentdoctor scan --json
32
+ ```bash
33
+ npm install -g @praneeth_54/agentdoctor
34
+ # or
35
+ npx @praneeth_54/agentdoctor --help
78
36
  ```
79
37
 
80
- Abbreviated text example from the same fixture for accessibility and search. Secret values are never printed. Re-run the scan if counts change.
38
+ Requires **Node.js 20+**. The runtime depends on the TypeScript compiler API for AST analysis.
81
39
 
82
40
  ---
83
41
 
84
- ## Why AgentDoctor?
85
-
86
- Repositories accumulate agent configuration quickly:
87
-
88
- - Multiple instruction formats (`.cursor/rules`, `CLAUDE.md`, `AGENTS.md`)
89
- - Stale path references in always-on instructions
90
- - Ignore differences between `.gitignore`, `.cursorignore`, and agent defaults
91
- - MCP filesystem scopes that are broader than intended
92
- - Generated directories and large logs that waste context
93
- - Credential-like files that may be readable by agents
94
- - Conflicting assumptions about what each agent can see
95
-
96
- Manually reviewing all of that across Cursor, Claude Code, and Codex is slow and inconsistent. AgentDoctor provides one deterministic local audit with stable rule IDs, evidence paths, and affected-agent information.
97
-
98
- | Analogy | Domain |
99
- | --------------- | -------------------------------- |
100
- | Lighthouse | Web pages |
101
- | `npm audit` | Dependencies |
102
- | ESLint | Source code |
103
- | **AgentDoctor** | **AI coding agent environments** |
42
+ ## Quick start
104
43
 
105
- AgentDoctor analyzes configuration. It does not run agents or call an LLM. `agentdoctor fix` may append safe context exclusions (Cursor `.cursorignore`, Claude Code Read deny rules, and Codex filesystem deny keys); it does not rewrite secrets, credentials, or security modes such as `bypassPermissions`.
44
+ ```bash
45
+ # Safety loop
46
+ agentdoctor scan
47
+ agentdoctor fix --dry-run
48
+ agentdoctor verify --baseline agentdoctor-report.json
49
+
50
+ # Repository Brain proposals (never auto-approved)
51
+ agentdoctor init --name "My App" --domain "payments"
52
+ agentdoctor brain proposals
53
+ agentdoctor brain review --artifact <id> --decision approved
54
+
55
+ # Intelligence
56
+ agentdoctor graph --mode auto --json
57
+ agentdoctor health --json
58
+ agentdoctor c4 --json
59
+ agentdoctor impact --json
60
+ agentdoctor refactor-impact --symbol MySymbol --json
61
+
62
+ # Knowledge (draft → human approve)
63
+ agentdoctor knowledge-create --title "Standard" --content "…"
64
+ agentdoctor knowledge-approve --id <id> --decision approved
65
+
66
+ # Policy (evaluate-only by default)
67
+ agentdoctor enforce --command "npm test" --json
68
+
69
+ # MCP (Brain tools preserved; combined server adds intelligence tools)
70
+ agentdoctor brain-mcp --root /ABS/PATH/TO/REPO
71
+ agentdoctor mcp --root /ABS/PATH/TO/REPO
72
+
73
+ # Local dashboard (loopback)
74
+ agentdoctor dashboard
75
+ ```
106
76
 
107
77
  ---
108
78
 
109
- ## Before / after
79
+ ## Capability status (honest)
110
80
 
111
- **Before**
81
+ Classifications match [docs/2.0/overview/readiness-matrix.md](docs/2.0/overview/readiness-matrix.md). **No blanket 5/5 claims.**
112
82
 
113
- A repository may contain:
83
+ ### Fully verified (shipped & regression-tested core)
114
84
 
115
- ```text
116
- .cursor/rules/
117
- AGENTS.md
118
- CLAUDE.md
119
- .claude/settings.json
120
- .mcp.json
121
- .env
122
- ```
85
+ | Capability | Notes |
86
+ | --------------------------------------------------------------------------------- | ---------------------------------------------------------- |
87
+ | Safety scan / Safe Fix / verify / policy gates | Exit codes and CI Action preserved |
88
+ | Agent adapters (Cursor, Claude Code, Codex, Copilot, Windsurf, Gemini CLI, Aider) | Detect + rules; Safe Fix where official ignore/deny exists |
89
+ | Project Brain store + Brain MCP tool names (`brain_*`) | STDIO MCP; `--root` required |
123
90
 
124
- Potential problems stay invisible until something leaks into model context, CI, or a teammate’s agent session:
91
+ ### Partially validated (implemented, tested; accuracy/perf not independently certified)
125
92
 
126
- - environment or credential-like files reachable by agents
127
- - stale instruction path references
128
- - broad MCP filesystem access
129
- - oversized always-on context
93
+ | Capability | Entry points |
94
+ | ----------------------------------------------- | ------------------------------------------- |
95
+ | Repository Brain init / proposal review | `init`, `brain review`, `brain proposals` |
96
+ | TS/JS AST intelligence graph (+ regex fallback) | `graph` |
97
+ | Git hotspots / bus-factor style metrics | `health` (method disclosed per metric) |
98
+ | Impact / test-impact / refactor-impact | `impact`, `test-impact`, `refactor-impact` |
99
+ | Knowledge governance + abstention | `knowledge*`; MCP `knowledge_retrieve` |
100
+ | Policy packs + controlled enforcement runner | `enforce`, `platform policy-check` |
101
+ | Combined MCP (`agentdoctor mcp`) | Brain + intelligence tools |
102
+ | Dashboard + `/api/v2/*` | `dashboard` (loopback default) |
103
+ | Local-dev team auth (scrypt) | `team-register`, `team-login` — **not SSO** |
130
104
 
131
- **Run**
105
+ ### Experimental
132
106
 
133
- ```bash
134
- npx @praneeth_54/agentdoctor
135
- ```
136
-
137
- **After**
107
+ | Capability | Notes |
108
+ | -------------- | --------------------------------------------------------------------------------- |
109
+ | C4-style views | `c4` — **inferred/proposed** from graph evidence, not approved architecture truth |
138
110
 
139
- You get deterministic findings with:
111
+ ### Unsupported / not claimed
140
112
 
141
- - stable rule IDs (for example `security/env-file-exposure`)
142
- - evidence paths
143
- - affected agents when exposure claims are supported
144
- - conservative recommendations
145
- - readiness score (`scores.overall` in JSON; overall line in the terminal)
146
-
147
- Safe context exclusions (Cursor / Claude Code / Codex) can be applied with `agentdoctor fix`. Security and review findings stay manual — Fix explains why and does not invent unsafe edits.
113
+ | Topic | Status |
114
+ | ------------------------------------------------ | -------------------------------------------------- |
115
+ | Enterprise SSO / IdP | Not bundled |
116
+ | Production SQLite / Postgres / vector search | Flags off / stub only |
117
+ | Full multi-language AST (Python, Go, …) | Unsupported |
118
+ | Direct IDE interception / agent process blocking | Unsupported |
119
+ | Coverage-backed test selection as ground truth | Not bundled (test-impact is heuristic/graph-based) |
148
120
 
149
121
  ---
150
122
 
151
- ## Quick start
152
-
153
- ### One-shot (recommended)
154
-
155
- ```bash
156
- npx @praneeth_54/agentdoctor
157
- ```
123
+ ## Safety (preserved)
158
124
 
159
- Pin a version when you need a fixed install:
125
+ Scan agent configs and repository hygiene; apply Safe Fix where supported; verify against a baseline; fail CI on severity/score gates.
160
126
 
161
127
  ```bash
162
- npx @praneeth_54/agentdoctor@1.0.0
128
+ agentdoctor scan --json
129
+ agentdoctor fix -y
130
+ agentdoctor verify --baseline agentdoctor-report.json
163
131
  ```
164
132
 
165
- ### Global (optional)
166
-
167
- ```bash
168
- npm install -g @praneeth_54/agentdoctor
169
- agentdoctor
170
- ```
171
-
172
- ### Scan → Fix → Verify
173
-
174
- ```bash
175
- # 1. Scan (save a baseline for Verify)
176
- npx @praneeth_54/agentdoctor scan . --json > agentdoctor-report.json
177
-
178
- # 2. Fix safe context exclusions (preview first with --dry-run)
179
- npx @praneeth_54/agentdoctor fix . --dry-run
180
- npx @praneeth_54/agentdoctor fix . -y
133
+ GitHub Action: pin `pranee54/AgentDoctor@v2.0.0` (default npm version input is `2.0.0`). Surfaces matrix: [docs/reference/surfaces-and-adapters.md](docs/reference/surfaces-and-adapters.md).
181
134
 
182
- # 3. Verify against the baseline
183
- npx @praneeth_54/agentdoctor verify . --baseline agentdoctor-report.json
135
+ ```yaml
136
+ - uses: pranee54/AgentDoctor@v2.0.0
137
+ with:
138
+ path: .
139
+ version: "2.0.0"
184
140
  ```
185
141
 
186
- `fix` writes safe context exclusions for Cursor (`.cursorignore`), Claude Code
187
- (`permissions.deny` Read rules in `.claude/settings.json`), and Codex (filesystem `deny`
188
- keys under a permissions profile in `.codex/config.toml`) for findings such as unignored
189
- `build/` or large logs. Review/manual security findings are listed as skipped — address those
190
- yourself, then re-run `verify`.
191
-
192
- ### Common commands
193
-
194
- ```bash
195
- agentdoctor .
196
- agentdoctor scan . --json
197
- agentdoctor fix . --dry-run
198
- agentdoctor verify . --ci --baseline agentdoctor-report.json
199
- agentdoctor explain security/env-file-exposure
200
- agentdoctor doctor
201
- ```
142
+ ---
202
143
 
203
- Package name: `@praneeth_54/agentdoctor` (npm blocks the unscoped name). CLI binary: `agentdoctor`. Requires **Node.js 20+**.
144
+ ## Repository Brain
204
145
 
205
- ### Programmatic API
146
+ `agentdoctor init` writes **PROPOSED** artifacts under `.agentdoctor/repository-brain/proposals/`. They are **not** facts until a human reviews them.
206
147
 
207
148
  ```bash
208
- npm install @praneeth_54/agentdoctor
149
+ agentdoctor brain init
150
+ agentdoctor brain snapshot
151
+ agentdoctor brain review --artifact prop_… --decision approved|rejected
209
152
  ```
210
153
 
211
- ```ts
212
- import { scan, verify, buildFixPlan, applyFixPlan } from "@praneeth_54/agentdoctor";
213
-
214
- const result = await scan({ cwd: process.cwd() });
215
- console.log(result.summary);
216
- console.log(result.scores?.overall);
217
- console.log(result.agentSecurityAnalysis); // "full" | "limited"
218
- ```
154
+ Guide: [docs/2.0/guides/repository-brain.md](docs/2.0/guides/repository-brain.md).
219
155
 
220
156
  ---
221
157
 
222
- ## Supported agents
158
+ ## Codebase intelligence
223
159
 
224
- Project-level configuration only (repository files). Global user settings are not scanned.
160
+ - **AST graph** — TypeScript/JavaScript via the TypeScript compiler API; regex fallback when needed (`graph --mode auto|typescript-ast|regex`).
161
+ - **Git intelligence** — recent-window hotspots / co-change heuristics with method disclosure (`health`).
162
+ - **C4 views** — inferred diagrams (`c4`); label them proposed/inferred.
163
+ - **Impact** — change/test/refactor blast-radius helpers (`impact`, `refactor-impact`).
225
164
 
226
- | Agent | What AgentDoctor inspects |
227
- | --------------- | ---------------------------------------------------------------------- |
228
- | **Cursor** | `.cursor/rules/*.mdc`, `.cursorignore`, Cursor MCP config, `AGENTS.md` |
229
- | **Claude Code** | `CLAUDE.md`, `.claude/settings*.json`, `.claude/rules`, MCP config |
230
- | **Codex** | `AGENTS.md` / overrides, project `.codex/` configuration |
231
-
232
- Additional adapters are planned — see [ROADMAP.md](ROADMAP.md).
165
+ Limitations: call resolution is best-effort; non-TS languages are not deeply analyzed.
233
166
 
234
167
  ---
235
168
 
236
- ## Finding categories
237
-
238
- | Category | Examples |
239
- | ---------------- | --------------------------------------------------------------------- |
240
- | **Security** | Env-file exposure, private-key filenames, broad MCP filesystem scopes |
241
- | **Context** | Large instruction files, large logs, unignored generated directories |
242
- | **Instructions** | Empty instructions, duplicate content, missing path references |
243
- | **MCP** | Malformed MCP config, high-risk filesystem path arguments |
169
+ ## Knowledge governance
244
170
 
245
- Full catalog with severities and fixability: [docs/rules.md](docs/rules.md).
171
+ Draft → pending-review → approved/rejected. Retrieval **abstains** when no approved record matches.
246
172
 
247
- Explain any rule:
248
-
249
- ```bash
250
- npx @praneeth_54/agentdoctor explain security/env-file-exposure
251
- ```
173
+ Guide: [docs/2.0/guides/knowledge-governance.md](docs/2.0/guides/knowledge-governance.md).
252
174
 
253
175
  ---
254
176
 
255
- ## Privacy and trust
256
-
257
- **Scans run locally on your machine.**
177
+ ## Policy evaluation and controlled enforcement
258
178
 
259
- AgentDoctor:
179
+ | Mode | Behavior |
180
+ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
181
+ | Policy evaluation (`platform policy-check`, MCP `policy_evaluate`) | Verdict only; `executionResult: "not-executed"` |
182
+ | Controlled runner (`enforce`) | Can report `blocked-by-enforcement` when **AgentDoctor** refuses to run a blocked command |
183
+ | Third-party IDEs | **Not** intercepted |
260
184
 
261
- - does not require an API key
262
- - does not upload repository contents by default
263
- - does not call an LLM for core scanning
264
- - does not execute MCP servers
265
- - does not execute project code
266
- - never prints secret values from files it flags by name
267
- - enforces repository boundary checks for path references and symlink escape
268
-
269
- This is still software that reads untrusted repository trees. Treat findings as guidance, not a security certification. AgentDoctor is **not** a complete secret-content scanner.
185
+ Trust boundaries: [docs/2.0/overview/trust-boundaries.md](docs/2.0/overview/trust-boundaries.md).
270
186
 
271
187
  ---
272
188
 
273
- ## CI usage
189
+ ## MCP
274
190
 
275
- ### GitHub Action
191
+ | Command | Server | Tools |
192
+ | ------------------------------------- | ---------- | -------------------------- |
193
+ | `agentdoctor brain-mcp --root <path>` | Brain only | Stable `brain_*` names |
194
+ | `agentdoctor mcp --root <path>` | Combined | Brain + intelligence tools |
276
195
 
277
- Run AgentDoctor directly in a workflow:
196
+ MCP docs: [docs/2.0/guides/mcp.md](docs/2.0/guides/mcp.md) · legacy detail: [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md).
278
197
 
279
- ```yaml
280
- permissions:
281
- contents: read
282
-
283
- steps:
284
- - uses: actions/checkout@v4
285
-
286
- - name: Audit coding-agent configuration
287
- id: agentdoctor
288
- uses: pranee54/AgentDoctor@v1.0.0
289
- with:
290
- path: .
291
- version: "1.0.0"
292
- output-file: agentdoctor-report.json
293
- minimum-score: "70"
294
- fail-on-severity: critical
295
- summary: "true"
296
-
297
- - name: Upload AgentDoctor report
298
- uses: actions/upload-artifact@v4
299
- with:
300
- name: agentdoctor-report
301
- path: ${{ steps.agentdoctor.outputs.report-path }}
302
- ```
303
-
304
- Policy inputs: `minimum-score`, `fail-on-severity`, `fail-on-rule`, `fail-on-new`,
305
- `verify-baseline`, `summary`, `annotations`. The Action stays report-only until you set a
306
- policy input. The Action default `version` is `1.0.0`. For local CI against this repo, use
307
- `version: workspace` after `npm run build`. The action installs `@praneeth_54/agentdoctor`,
308
- runs scan (or `verify` when `verify-baseline` is set) with `--json`, and writes the report
309
- inside the workspace.
198
+ ---
310
199
 
311
- ### CLI
200
+ ## CLI / API / dashboard
312
201
 
313
- Use JSON directly in other CI systems:
202
+ - CLI index: [docs/2.0/guides/cli.md](docs/2.0/guides/cli.md)
203
+ - HTTP API (local dashboard): [docs/2.0/guides/api.md](docs/2.0/guides/api.md)
204
+ - Dashboard defaults to `127.0.0.1`; `?user=` role selection is **not** authentication
314
205
 
315
206
  ```bash
316
- # Report-only (exit 0 even when findings exist; scores still in JSON)
317
- npx @praneeth_54/agentdoctor --json
318
-
319
- # Fail when any critical finding exists
320
- npx @praneeth_54/agentdoctor --ci --json
321
-
322
- # Fail when overall readiness is below 70 (with --ci also fails on criticals)
323
- npx @praneeth_54/agentdoctor --ci --json --min-score 70
324
-
325
- # Fail on warning-or-higher (overrides the default critical gate from --ci)
326
- npx @praneeth_54/agentdoctor --ci --json --fail-on-severity warning
207
+ agentdoctor dashboard
208
+ agentdoctor doctor --json
327
209
  ```
328
210
 
329
- `--ci` fails when any **critical** finding exists. Override the severity floor with
330
- `--fail-on-severity`, and use `--min-score` / `--fail-on-rule` for additional gates.
331
- Omit `--ci` for report-only JSON (exit `0` even when findings exist).
332
-
333
- Exit codes: [docs/exit-codes.md](docs/exit-codes.md). Compatibility promises: [docs/compatibility.md](docs/compatibility.md).
334
-
335
- ### Readiness scoring
336
-
337
- Scans populate `scoringAvailable: true` and a deterministic `scores` object
338
- (overall, categories, agents). The terminal prints overall readiness; category and agent
339
- scores are in JSON (`--json`).
340
-
341
- `--min-score N` is enforced by the CLI. Details (weights, security caps, threshold rules,
342
- and deferred v2 items): [docs/scoring.md](docs/scoring.md).
343
-
344
- ---
345
-
346
- ## Known limitations
347
-
348
- Honest limits of v1:
349
-
350
- | Limitation | Status |
351
- | --------------------------- | ------------------------------------------------------------------------------- |
352
- | Automatic fixes | Safe Cursor / Claude Code / Codex context exclusions only |
353
- | Security findings | Review/manual — Fix does not rewrite secrets or security modes |
354
- | Secret-content scanning | Filename / config heuristics only |
355
- | Detection style | Intentionally conservative; false security findings are avoided |
356
- | Agent coverage | Cursor, Claude Code, Codex project configs |
357
- | Missing-path residual noise | Broad path-lattice expansion deferred; instruction-directory resolution shipped |
358
-
359
- See [CHANGELOG.md](CHANGELOG.md) and [docs/compatibility.md](docs/compatibility.md).
360
-
361
211
  ---
362
212
 
363
- ## Architecture
213
+ ## Local-development team authentication
364
214
 
365
- ```text
366
- Discovery → Project detect → Agent adapters → Rule engine → Findings → Scores → Terminal / JSON
215
+ ```bash
216
+ agentdoctor team-register --username alice --password '………'
217
+ agentdoctor team-login --username alice --password '………'
367
218
  ```
368
219
 
369
- Details: [docs/architecture.md](docs/architecture.md)
220
+ This is **local-dev scrypt auth**, clearly labeled — **not** enterprise SSO.
370
221
 
371
222
  ---
372
223
 
373
- ## Documentation
374
-
375
- | Doc | Contents |
376
- | ------------------------------------------------------------------ | ------------------------------- |
377
- | [docs/README.md](docs/README.md) | Documentation index |
378
- | [docs/architecture.md](docs/architecture.md) | Scan pipeline |
379
- | [docs/rules.md](docs/rules.md) | Stable rule IDs |
380
- | [docs/exit-codes.md](docs/exit-codes.md) | Process exit codes |
381
- | [docs/scoring.md](docs/scoring.md) | Readiness scoring specification |
382
- | [docs/compatibility.md](docs/compatibility.md) | v1 compatibility promises |
383
- | [docs/project-brain.md](docs/project-brain.md) | Project Brain understanding |
384
- | [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md) | Brain → MCP → Agent bridge |
385
- | [docs/development.md](docs/development.md) | Local development |
386
- | [docs/github-launch-checklist.md](docs/github-launch-checklist.md) | GitHub About / topics / launch |
387
- | [ROADMAP.md](ROADMAP.md) | Near- and medium-term plans |
388
- | [CHANGELOG.md](CHANGELOG.md) | Release history |
224
+ ## Important limitations (read before adopting)
389
225
 
390
- ---
226
+ 1. AST depth is **TypeScript/JavaScript**-oriented.
227
+ 2. Test-impact is **heuristic / graph-based**, not coverage-oracle accurate.
228
+ 3. C4 views are **inferred**, not approved architecture.
229
+ 4. Firewall is **evaluate-only** unless you use AgentDoctor’s controlled runner.
230
+ 5. Team auth is **local-dev**, not SSO.
231
+ 6. No IDE interception.
232
+ 7. No production SQLite/Postgres/vector backend in this package.
233
+ 8. No complete multi-language AST.
234
+ 9. Deep 2.0 audits and readiness reports live on GitHub under [docs/2.0/](docs/2.0/README.md) (not inside the npm tarball — packaging Option B).
391
235
 
392
- ## Contributing
236
+ Full list: [docs/2.0/overview/known-limitations.md](docs/2.0/overview/known-limitations.md).
393
237
 
394
- Issues and pull requests are welcome.
238
+ ---
395
239
 
396
- 1. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md)
397
- 2. Prefer [good first issues](docs/good-first-issues.md) ideas
398
- 3. Report security issues via [SECURITY.md](SECURITY.md) — never paste real secrets into issues
240
+ ## Compatibility
399
241
 
400
- ```bash
401
- git clone https://github.com/pranee54/AgentDoctor.git
402
- cd AgentDoctor
403
- npm install
404
- npm run verify
405
- node dist/cli/index.js ./fixtures/clean-configured-project
406
- ```
242
+ - Safety CLI exit codes and Brain MCP tool names are preserved.
243
+ - Additive 2.0 commands do not remove 1.x workflows.
244
+ - Migration notes: [docs/2.0/guides/migration.md](docs/2.0/guides/migration.md).
407
245
 
408
246
  ---
409
247
 
410
- ## Project Brain MCP (agent context)
248
+ ## Documentation map
411
249
 
412
- Evidence-backed repository understanding for agents (not a search MCP):
413
-
414
- ```bash
415
- agentdoctor brain-mcp --root /absolute/path/to/project
416
- ```
417
-
418
- Tools: overview, query, explain, trace, claims, evidence, ownership, risk, delta, snapshot.
419
- Local STDIO only — no API key, no upload. Docs: [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md).
420
- Examples: [examples/mcp/](examples/mcp/).
250
+ | Area | Link |
251
+ | ---------------- | -------------------------------------------------------------------------- |
252
+ | 2.0 index | [docs/2.0/README.md](docs/2.0/README.md) |
253
+ | CLI / MCP / API | [docs/2.0/guides/](docs/2.0/guides/) |
254
+ | Release blockers | [docs/2.0/audits/release-blockers.md](docs/2.0/audits/release-blockers.md) |
255
+ | Docs hub | [docs/README.md](docs/README.md) |
256
+ | Changelog | [CHANGELOG.md](CHANGELOG.md) |
257
+ | Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |
421
258
 
422
259
  ---
423
260
 
424
- ## Next steps
261
+ ## Contributing
425
262
 
426
- - **Try it:** `npx @praneeth_54/agentdoctor`
427
- - **Report a false positive / false negative:** use the issue templates (include version, rule ID, anonymized evidence — no secrets)
428
- - **Propose a rule or adapter:** [feature request](.github/ISSUE_TEMPLATE/feature_request.md) / [rule proposal](.github/ISSUE_TEMPLATE/rule_proposal.md)
429
- - **Contribute:** [CONTRIBUTING.md](CONTRIBUTING.md)
430
- - **Useful?** Star or watch the repository so you see updates
263
+ See [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/development/development.md](docs/development/development.md).
431
264
 
432
265
  ---
433
266
 
434
267
  ## License
435
268
 
436
- [MIT](LICENSE) © AgentDoctor Contributors
269
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1 @@
1
+ export { aiderAdapter, detectAider } from "./detector.js";
@@ -0,0 +1 @@
1
+ export { aiderAdapter, detectAider } from "./detector.js";
@@ -0,0 +1,14 @@
1
+ import type { AgentAdapter, AgentDetectionContext, AgentDetectionResult } from "../types.js";
2
+ /**
3
+ * Aider project configuration detection.
4
+ *
5
+ * Official sources (aider.chat docs):
6
+ * - Config: `.aider.conf.yml` (cwd / git root); `.aider.conf.yaml` also seen in the wild
7
+ * - Ignore: `.aiderignore` (gitignore-style; default at git root)
8
+ * - Conventions: `CONVENTIONS.md` commonly loaded via conf `read:` — only counted when
9
+ * an Aider config/ignore file is also present (avoids false positives)
10
+ *
11
+ * We do NOT inspect `~/.aider.conf.yml` — repository only.
12
+ */
13
+ export declare function detectAider(context: AgentDetectionContext): Promise<AgentDetectionResult>;
14
+ export declare const aiderAdapter: AgentAdapter;