purecontext-mcp 1.2.0 → 1.5.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 (177) hide show
  1. package/AGENT_INSTRUCTIONS.md +110 -784
  2. package/AGENT_REFERENCE.md +561 -0
  3. package/CHANGELOG.md +177 -6
  4. package/FRAMEWORK-ADAPTERS.md +351 -0
  5. package/LANGUAGE-SUPPORT.md +144 -0
  6. package/README.md +92 -12
  7. package/USER-GUIDE.md +8 -0
  8. package/dist/cli/hooks.d.ts +28 -0
  9. package/dist/cli/hooks.d.ts.map +1 -0
  10. package/dist/cli/hooks.js +570 -0
  11. package/dist/cli/hooks.js.map +1 -0
  12. package/dist/cli/install-detect.d.ts +16 -0
  13. package/dist/cli/install-detect.d.ts.map +1 -0
  14. package/dist/cli/install-detect.js +70 -0
  15. package/dist/cli/install-detect.js.map +1 -0
  16. package/dist/cli/install-writers.d.ts +59 -0
  17. package/dist/cli/install-writers.d.ts.map +1 -0
  18. package/dist/cli/install-writers.js +292 -0
  19. package/dist/cli/install-writers.js.map +1 -0
  20. package/dist/cli/install.d.ts +14 -0
  21. package/dist/cli/install.d.ts.map +1 -0
  22. package/dist/cli/install.js +150 -0
  23. package/dist/cli/install.js.map +1 -0
  24. package/dist/config/config-loader.js +3 -0
  25. package/dist/config/config-loader.js.map +1 -1
  26. package/dist/config/config-schema.d.ts +11 -0
  27. package/dist/config/config-schema.d.ts.map +1 -1
  28. package/dist/config/config-schema.js +15 -0
  29. package/dist/config/config-schema.js.map +1 -1
  30. package/dist/core/db/symbol-store.d.ts +1 -0
  31. package/dist/core/db/symbol-store.d.ts.map +1 -1
  32. package/dist/core/db/symbol-store.js +120 -6
  33. package/dist/core/db/symbol-store.js.map +1 -1
  34. package/dist/core/file-discovery.d.ts +6 -0
  35. package/dist/core/file-discovery.d.ts.map +1 -1
  36. package/dist/core/file-discovery.js +20 -13
  37. package/dist/core/file-discovery.js.map +1 -1
  38. package/dist/core/file-processor.d.ts.map +1 -1
  39. package/dist/core/file-processor.js +26 -1
  40. package/dist/core/file-processor.js.map +1 -1
  41. package/dist/core/git-log-reader.d.ts.map +1 -1
  42. package/dist/core/git-log-reader.js +21 -0
  43. package/dist/core/git-log-reader.js.map +1 -1
  44. package/dist/core/index-manager.d.ts.map +1 -1
  45. package/dist/core/index-manager.js +21 -7
  46. package/dist/core/index-manager.js.map +1 -1
  47. package/dist/core/indexing-worker.d.ts.map +1 -1
  48. package/dist/core/indexing-worker.js +14 -0
  49. package/dist/core/indexing-worker.js.map +1 -1
  50. package/dist/core/parse-dispatcher.d.ts.map +1 -1
  51. package/dist/core/parse-dispatcher.js +20 -5
  52. package/dist/core/parse-dispatcher.js.map +1 -1
  53. package/dist/core/search/query-preprocessor.d.ts +69 -3
  54. package/dist/core/search/query-preprocessor.d.ts.map +1 -1
  55. package/dist/core/search/query-preprocessor.js +450 -17
  56. package/dist/core/search/query-preprocessor.js.map +1 -1
  57. package/dist/core/search/relevance-ranker.d.ts +60 -5
  58. package/dist/core/search/relevance-ranker.d.ts.map +1 -1
  59. package/dist/core/search/relevance-ranker.js +931 -33
  60. package/dist/core/search/relevance-ranker.js.map +1 -1
  61. package/dist/core/test-mapper.d.ts.map +1 -1
  62. package/dist/core/test-mapper.js +7 -1
  63. package/dist/core/test-mapper.js.map +1 -1
  64. package/dist/core/types.d.ts +28 -1
  65. package/dist/core/types.d.ts.map +1 -1
  66. package/dist/handlers/angular-html.d.ts +3 -0
  67. package/dist/handlers/angular-html.d.ts.map +1 -0
  68. package/dist/handlers/angular-html.js +215 -0
  69. package/dist/handlers/angular-html.js.map +1 -0
  70. package/dist/handlers/c.d.ts.map +1 -1
  71. package/dist/handlers/c.js +19 -0
  72. package/dist/handlers/c.js.map +1 -1
  73. package/dist/handlers/cpp-macro-registry.d.ts +21 -0
  74. package/dist/handlers/cpp-macro-registry.d.ts.map +1 -0
  75. package/dist/handlers/cpp-macro-registry.js +44 -0
  76. package/dist/handlers/cpp-macro-registry.js.map +1 -0
  77. package/dist/handlers/cpp.d.ts.map +1 -1
  78. package/dist/handlers/cpp.js +579 -10
  79. package/dist/handlers/cpp.js.map +1 -1
  80. package/dist/handlers/csharp.d.ts.map +1 -1
  81. package/dist/handlers/csharp.js +39 -2
  82. package/dist/handlers/csharp.js.map +1 -1
  83. package/dist/handlers/css.d.ts +3 -0
  84. package/dist/handlers/css.d.ts.map +1 -0
  85. package/dist/handlers/css.js +154 -0
  86. package/dist/handlers/css.js.map +1 -0
  87. package/dist/handlers/erlang.d.ts.map +1 -1
  88. package/dist/handlers/erlang.js +8 -1
  89. package/dist/handlers/erlang.js.map +1 -1
  90. package/dist/handlers/fortran.js +1 -1
  91. package/dist/handlers/fortran.js.map +1 -1
  92. package/dist/handlers/go.d.ts.map +1 -1
  93. package/dist/handlers/go.js +87 -2
  94. package/dist/handlers/go.js.map +1 -1
  95. package/dist/handlers/handler-registry.d.ts.map +1 -1
  96. package/dist/handlers/handler-registry.js +4 -0
  97. package/dist/handlers/handler-registry.js.map +1 -1
  98. package/dist/handlers/hcl.d.ts +3 -0
  99. package/dist/handlers/hcl.d.ts.map +1 -0
  100. package/dist/handlers/hcl.js +193 -0
  101. package/dist/handlers/hcl.js.map +1 -0
  102. package/dist/handlers/java.d.ts.map +1 -1
  103. package/dist/handlers/java.js +33 -16
  104. package/dist/handlers/java.js.map +1 -1
  105. package/dist/handlers/kotlin.d.ts.map +1 -1
  106. package/dist/handlers/kotlin.js +48 -3
  107. package/dist/handlers/kotlin.js.map +1 -1
  108. package/dist/handlers/less.d.ts +3 -0
  109. package/dist/handlers/less.d.ts.map +1 -0
  110. package/dist/handlers/less.js +255 -0
  111. package/dist/handlers/less.js.map +1 -0
  112. package/dist/handlers/objective-c.d.ts.map +1 -1
  113. package/dist/handlers/objective-c.js +122 -64
  114. package/dist/handlers/objective-c.js.map +1 -1
  115. package/dist/handlers/openapi.d.ts.map +1 -1
  116. package/dist/handlers/openapi.js +30 -5
  117. package/dist/handlers/openapi.js.map +1 -1
  118. package/dist/handlers/php.d.ts.map +1 -1
  119. package/dist/handlers/php.js +287 -41
  120. package/dist/handlers/php.js.map +1 -1
  121. package/dist/handlers/protobuf.d.ts.map +1 -1
  122. package/dist/handlers/protobuf.js +1 -0
  123. package/dist/handlers/protobuf.js.map +1 -1
  124. package/dist/handlers/python.d.ts.map +1 -1
  125. package/dist/handlers/python.js +1 -3
  126. package/dist/handlers/python.js.map +1 -1
  127. package/dist/handlers/ruby-dsl.d.ts +23 -0
  128. package/dist/handlers/ruby-dsl.d.ts.map +1 -0
  129. package/dist/handlers/ruby-dsl.js +251 -0
  130. package/dist/handlers/ruby-dsl.js.map +1 -0
  131. package/dist/handlers/ruby.d.ts.map +1 -1
  132. package/dist/handlers/ruby.js +29 -4
  133. package/dist/handlers/ruby.js.map +1 -1
  134. package/dist/handlers/rust.d.ts.map +1 -1
  135. package/dist/handlers/rust.js +98 -2
  136. package/dist/handlers/rust.js.map +1 -1
  137. package/dist/handlers/scss.d.ts +3 -0
  138. package/dist/handlers/scss.d.ts.map +1 -0
  139. package/dist/handlers/scss.js +290 -0
  140. package/dist/handlers/scss.js.map +1 -0
  141. package/dist/handlers/sql.d.ts.map +1 -1
  142. package/dist/handlers/sql.js +37 -18
  143. package/dist/handlers/sql.js.map +1 -1
  144. package/dist/handlers/typescript.d.ts.map +1 -1
  145. package/dist/handlers/typescript.js +65 -17
  146. package/dist/handlers/typescript.js.map +1 -1
  147. package/dist/handlers/xml.d.ts.map +1 -1
  148. package/dist/handlers/xml.js +35 -2
  149. package/dist/handlers/xml.js.map +1 -1
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +91 -0
  152. package/dist/index.js.map +1 -1
  153. package/dist/server/mcp-server.d.ts.map +1 -1
  154. package/dist/server/mcp-server.js +10 -0
  155. package/dist/server/mcp-server.js.map +1 -1
  156. package/dist/server/tools/detect-antipatterns.d.ts +1 -1
  157. package/dist/server/tools/get-architecture-snapshot.d.ts +1 -1
  158. package/dist/server/tools/get-entry-points.d.ts +1 -1
  159. package/dist/server/tools/get-lexical-scope-matches.d.ts +54 -0
  160. package/dist/server/tools/get-lexical-scope-matches.d.ts.map +1 -0
  161. package/dist/server/tools/get-lexical-scope-matches.js +470 -0
  162. package/dist/server/tools/get-lexical-scope-matches.js.map +1 -0
  163. package/dist/server/tools/search-symbols.d.ts +10 -0
  164. package/dist/server/tools/search-symbols.d.ts.map +1 -1
  165. package/dist/server/tools/search-symbols.js +353 -8
  166. package/dist/server/tools/search-symbols.js.map +1 -1
  167. package/dist/server/tools/trace-invocation-chain.d.ts +53 -0
  168. package/dist/server/tools/trace-invocation-chain.d.ts.map +1 -0
  169. package/dist/server/tools/trace-invocation-chain.js +280 -0
  170. package/dist/server/tools/trace-invocation-chain.js.map +1 -0
  171. package/dist/version.d.ts +1 -1
  172. package/dist/version.js +1 -1
  173. package/docs/02-installation.md +89 -17
  174. package/docs/05-cli-reference.md +89 -0
  175. package/docs/dev/benchmark-findings-eu-za-tebe.md +210 -0
  176. package/docs/dev/phase-35-coverage-audit.md +469 -0
  177. package/package.json +4 -1
@@ -0,0 +1,144 @@
1
+ # Language Support
2
+
3
+ PureContext indexes **34 languages** out of the box, plus a small set of regex-based handlers for stylesheets. Every grammar is bundled as a WASM file — no separate install, no native compilation, no language servers to start. When you point it at a polyglot repo, all handlers run in parallel.
4
+
5
+ This page is the user-facing tour: what's supported, what gets pulled out, and what to expect from each major category. For parameter-level details (every node kind, every signature shape), see the [reference manual](docs/07-language-support.md).
6
+
7
+ ---
8
+
9
+ ## The full list
10
+
11
+ ### Web and application languages
12
+
13
+ | Language | Extensions | What you get |
14
+ |----------|-----------|-------------|
15
+ | TypeScript | `.ts`, `.tsx`, `.mts`, `.cts` | functions, classes, methods, consts, types, interfaces, enums — full type annotations in signatures |
16
+ | JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | functions, classes, methods, exported consts |
17
+ | Python | `.py` | functions, classes, methods, module-level consts — docstrings used as summaries |
18
+ | PHP | `.php` | functions, classes, interfaces, traits, enums, methods, properties, constants — PHP 8 attributes supported |
19
+ | Ruby | `.rb` | functions, classes, methods, modules, constants |
20
+ | Go | `.go` | functions, methods (bare names, no receiver prefix), structs, interfaces, consts, types — unexported names are skipped |
21
+ | Java | `.java` | classes, interfaces, enums, methods (including package-private), inner classes |
22
+ | Kotlin | `.kt`, `.kts` | functions, extension functions, classes, interfaces, objects, enums, typealiases — KDoc summaries |
23
+ | C# | `.cs` | classes, interfaces, enums, structs, records, methods, properties, consts |
24
+ | Scala | `.scala`, `.sc` | classes, traits, objects, case classes, functions, methods, types, enums |
25
+ | Dart | `.dart` | classes, mixins, extensions, enums, functions, methods — `_`-prefixed names are skipped |
26
+ | Swift | `.swift` | classes, structs, protocols, actors, extensions, methods, enums |
27
+ | Elixir | `.ex`, `.exs` | modules, functions, macros, structs, protocols |
28
+ | Haskell | `.hs`, `.lhs` | functions, data types, typeclasses, instances, type aliases, newtypes |
29
+ | Lua | `.lua` | functions, methods, consts |
30
+ | R | `.r`, `.R`, `.Rmd` | functions, consts, S3/S4/R6 classes — Roxygen2 doc comments |
31
+ | Perl | `.pl`, `.pm` | functions, packages |
32
+ | Groovy | `.groovy` | functions, classes, methods |
33
+ | Erlang | `.erl`, `.hrl` | functions, modules |
34
+ | Gleam | `.gleam` | functions, types |
35
+
36
+ ### Systems languages
37
+
38
+ | Language | Extensions | What you get |
39
+ |----------|-----------|-------------|
40
+ | C | `.c`, `.h` | functions, structs, enums, macros, types — `static` functions skipped (translation-unit internal) |
41
+ | C++ | `.cpp`, `.cxx`, `.cc`, `.hpp`, `.hxx`, `.hh` | All C kinds plus namespaces, templates, template classes with export macros |
42
+ | Rust | `.rs` | functions, methods (bare names), structs, enums, traits, consts, types — `pub` filter for impl methods |
43
+ | Fortran | `.f90`, `.f95`, `.for`, `.f` | functions, subroutines, modules |
44
+ | Objective-C | `.m`, `.h` | functions, classes, methods |
45
+
46
+ ### Scripting and game
47
+
48
+ | Language | Extensions | What you get |
49
+ |----------|-----------|-------------|
50
+ | Bash | `.sh`, `.bash` | functions |
51
+ | GDScript | `.gd` | functions, classes, signals |
52
+
53
+ ### Infrastructure and config
54
+
55
+ | Language | Extensions | What you get |
56
+ |----------|-----------|-------------|
57
+ | Terraform / HCL | `.tf`, `.hcl` | resources, modules, variables, outputs |
58
+ | Nix | `.nix` | functions, attributes |
59
+
60
+ ### Data and API
61
+
62
+ | Language | Extensions | What you get |
63
+ |----------|-----------|-------------|
64
+ | SQL | `.sql` | tables, views, functions, procedures |
65
+ | Protobuf | `.proto` | messages, services, enums, RPCs |
66
+ | GraphQL | `.graphql`, `.gql` | types, queries, mutations, subscriptions, fragments |
67
+ | OpenAPI / YAML | `.yaml`, `.yml` | endpoints, schemas (OpenAPI detected by content) |
68
+ | XML | `.xml` | elements (configurable patterns — opt-in) |
69
+
70
+ ### Stylesheets (regex-based, no WASM grammar)
71
+
72
+ CSS-family languages don't have a stable tree-sitter grammar, so PureContext extracts a focused subset using regex. Only named, reusable constructs are indexed — plain selectors are skipped because they would flood the index with noise.
73
+
74
+ | Language | Extensions | What you get |
75
+ |----------|-----------|-------------|
76
+ | SCSS / SASS | `.scss`, `.sass` | `@mixin`, `@function`, top-level `$variables`, `%placeholders`, `@keyframes` |
77
+ | LESS | `.less` | `.mixin(@params)`, top-level `@variables`, `@keyframes` |
78
+ | CSS | `.css` | `--custom-properties` (opt-in via `indexing.cssVariables: true`) |
79
+
80
+ ---
81
+
82
+ ## What gets indexed for every language
83
+
84
+ Regardless of language, every symbol you find through `search_symbols` carries:
85
+
86
+ - **Name** — the identifier as it appears in source
87
+ - **Kind** — function, class, method, route, component, etc.
88
+ - **Byte offsets** — `startByte` / `endByte` for precise source retrieval; no need to re-read the whole file to grab a function body
89
+ - **Signature** — a one-line declaration with the full type information available in that language
90
+ - **Summary** — sourced from the docstring/JSDoc/Javadoc/Roxygen comment if present, otherwise inferred from framework context (route path, ORM table, etc.), otherwise a one-line AI summary, otherwise the signature itself
91
+ - **Import / dependency edges** — used by the dependency graph, blast radius, and cycle detection tools
92
+
93
+ The summary chain (docstring → framework inference → AI → signature fallback) is what makes search across an undocumented codebase still work. See [AI Summaries](AI-SUMMARIES.md) for how to enable LLM summaries on legacy projects.
94
+
95
+ ---
96
+
97
+ ## What is filtered out automatically
98
+
99
+ Some things you don't want in the index — they bloat it and pollute search results. PureContext excludes:
100
+
101
+ - Standard build and dependency directories: `node_modules/`, `.git/`, `dist/`, `build/`, `target/`, `.next/`, `.nuxt/`, `.claude/`
102
+ - Lock files (`*.lock`) and environment files (`.env*`)
103
+ - Binary files (detected by null-byte scanning of the first 8 KB — works without a hardcoded extension list)
104
+ - Files larger than 1 MB (raise the limit with `maxFileSizeBytes` in config)
105
+ - Secret files: `*.pem`, `*.key`, `id_rsa`, `credentials.json`, `serviceAccountKey*.json`
106
+
107
+ It also respects language-level visibility:
108
+
109
+ - **Go**: unexported names (lowercase first letter)
110
+ - **C**: `static` functions (translation-unit internal)
111
+ - **Java / C# / PHP**: `private` members
112
+ - **Dart**: `_`-prefixed names
113
+
114
+ Public API tools (`get_public_api`) rely on these rules being applied consistently — they assume the index already reflects what is externally visible.
115
+
116
+ ---
117
+
118
+ ## Known limitations
119
+
120
+ - **TypeScript `.tsx`** uses a separate `tree-sitter-tsx` grammar from `.ts`. Both are bundled.
121
+ - **Python stubs** (`.pyi`) are not indexed — only `.py` files.
122
+ - **Terraform** `dynamic` blocks with complex expressions may not be fully extracted.
123
+ - **XML** element extraction uses configurable patterns rather than indexing every tag — turn it on per project if you need it.
124
+ - **CSS** custom properties (`--foo`) are off by default; enable with `indexing.cssVariables: true` when you have a design system worth indexing.
125
+
126
+ ---
127
+
128
+ ## Adding a new language
129
+
130
+ If a grammar you care about is missing, the path to support is straightforward:
131
+
132
+ 1. Add a new file in `src/handlers/`, implementing `LanguageHandler`
133
+ 2. Bundle the `.wasm` grammar in `grammars/`
134
+ 3. Register the handler in the language dispatcher
135
+ 4. Add tests against fixture files in `test/handlers/`
136
+
137
+ Regex-only handlers (like SCSS) skip step 2 entirely — they return `null` from `grammarPath()`.
138
+
139
+ See `docs/25-architecture-overview.md` for the three-layer design (Core → Handlers → Adapters) and the conventions every handler follows.
140
+
141
+ ---
142
+
143
+ → Full parameter-level reference: [docs/07-language-support.md](docs/07-language-support.md)
144
+ → Adapter layer that adds framework-specific symbols on top: [FRAMEWORK-ADAPTERS.md](FRAMEWORK-ADAPTERS.md)
package/README.md CHANGED
@@ -18,8 +18,12 @@ But token savings are the mechanism, not the point. The point is that AI gets be
18
18
  ## Quick start
19
19
 
20
20
  ```bash
21
- # Connect to Claude Code (no global install needed)
21
+ # 1. Connect to Claude Code (no global install needed)
22
22
  claude mcp add purecontext-mcp -- npx purecontext-mcp
23
+
24
+ # 2. Inside your project, install the workflow rules
25
+ # (auto-detects Claude / Cursor / Windsurf / Continue / Cline / Roo Code / VS Code / Claude Desktop)
26
+ npx purecontext-mcp install all
23
27
  ```
24
28
 
25
29
  Then in a Claude Code conversation:
@@ -54,6 +58,8 @@ The guide explains what PureContext does, why each feature exists, and how to us
54
58
  | [Visualizing Code Structure](VISUALIZING-CODE.md) | Mermaid/DOT diagrams, architecture snapshots |
55
59
  | [AST-Level Search](AST-SEARCH.md) | Node types, signatures, decorators, complexity |
56
60
  | [Code Intelligence](CODE-INTELLIGENCE.md) | Entry points, public API, TODOs, coverage |
61
+ | [Language Support](LANGUAGE-SUPPORT.md) | All 34 supported languages and what's extracted |
62
+ | [Framework Adapters](FRAMEWORK-ADAPTERS.md) | Vue, React, Django, Spring, Rails, Flutter, ORMs, and more |
57
63
  | [Using PureContext with a Team](TEAM-SETUP.md) | Shared server, enterprise setup |
58
64
 
59
65
  **Real-world workflows:**
@@ -77,9 +83,39 @@ You should start from docs/README.md.
77
83
 
78
84
  ## What it indexes
79
85
 
80
- **34 languages** including TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, Kotlin, Swift, Dart, C, C++, Elixir, Haskell, Scala, R, Bash, Terraform, Protobuf, GraphQL, SQL, and more.
86
+ ### Languages
87
+
88
+ **34 languages** via bundled tree-sitter WASM grammars — no separate install required.
89
+
90
+ | Category | Languages |
91
+ |----------|-----------|
92
+ | Web / Application | TypeScript, JavaScript, Python, PHP, Ruby, Go, Java, Kotlin, C#, Scala, Dart, Swift, Elixir, Haskell, Lua, R, Perl, Groovy, Erlang, Gleam |
93
+ | Systems | C, C++, Rust, Fortran, Objective-C |
94
+ | Scripting & Game | Bash, GDScript |
95
+ | Infrastructure & Config | Terraform / HCL, Nix |
96
+ | Data & API | SQL, Protobuf, GraphQL, OpenAPI / YAML, XML |
97
+ | Styling (regex-based) | SCSS, SASS, LESS, CSS |
98
+
99
+ → [Language Support guide](LANGUAGE-SUPPORT.md) · [Full reference](docs/07-language-support.md)
100
+
101
+ ### Frameworks
102
+
103
+ **Framework-aware extraction** — routes, components, hooks, models, ORM entities, and middleware are pulled out as first-class symbols (not just functions and classes).
104
+
105
+ | Stack | Frameworks |
106
+ |-------|-----------|
107
+ | JavaScript / TypeScript | Vue 3, React, Nuxt, Next.js (Pages + App Router), Angular, NestJS, Express, Fastify |
108
+ | Python | Django, FastAPI, Flask |
109
+ | Go | Gin, Echo, Fiber |
110
+ | PHP | Laravel, Symfony |
111
+ | Ruby | Rails, Sinatra |
112
+ | Java | Spring Boot, Micronaut, Quarkus |
113
+ | Kotlin | Ktor, Spring (Kotlin) |
114
+ | Rust | Axum, Actix-web, Rocket |
115
+ | Mobile | Flutter |
116
+ | ORMs | Hibernate, SQLAlchemy, Django ORM, Prisma, TypeORM |
81
117
 
82
- **Framework-aware extraction** for Vue, React, Nuxt, Next.js, Angular, NestJS, Express, Fastify, Django, FastAPI, Flask, Gin, Rails, Laravel, Spring Boot, and more. Routes, components, hooks, models, and middleware are extracted as first-class symbols.
118
+ → [Framework Adapters guide](FRAMEWORK-ADAPTERS.md) · [Full reference](docs/08-framework-adapters.md)
83
119
 
84
120
  ---
85
121
 
@@ -180,22 +216,66 @@ If your team runs a shared PureContext server, connect with an HTTP transport in
180
216
 
181
217
  Installing PureContext gives your agent the tools. Adding the agent instructions tells it *how* to use them — which tool to pick for each task, in what order, and what to avoid.
182
218
 
183
- Two instruction files are provided at the repository root:
219
+ Without these instructions, an agent may default to reading entire files rather than using `search_symbols`, or may not know to call `list_repos` first to get the repository ID required by every tool.
220
+
221
+ ### One-command install (recommended)
184
222
 
185
- **`AGENT_INSTRUCTIONS_SHORT.md`** — ~2 KB. The mandatory workflow, tool selection table, core rules, and common patterns. Use this for agents with limited system prompt space.
223
+ Run this once inside your project directory:
186
224
 
187
- **`AGENT_INSTRUCTIONS.md`** — ~15 KB. Adds detailed parameter notes, every usage pattern, decision trees, and anti-patterns. Use this for complex multi-step workflows.
225
+ ```bash
226
+ npx purecontext-mcp install all
227
+ ```
188
228
 
189
- **Claude Code** add to your project's `CLAUDE.md`:
229
+ This auto-detects which AI coding tools you have set up in the project and writes the PureContext workflow rules to the right place for each. Re-running is safe — every writer is idempotent (managed blocks are marked and replaced rather than appended).
230
+
231
+ When no `--scope` flag is given, the CLI prompts you to choose where to install:
232
+
233
+ ```
234
+ Where should PureContext be installed?
235
+ 1) Local — this project only
236
+ 2) Global — all projects (user-level config)
237
+ 3) Both
238
+ ```
239
+
240
+ Pass `--scope` to skip the prompt:
190
241
 
191
242
  ```bash
192
- cat AGENT_INSTRUCTIONS_SHORT.md >> CLAUDE.md
243
+ npx purecontext-mcp install all --scope=local # this project only
244
+ npx purecontext-mcp install all --scope=global # user-level, all projects
245
+ npx purecontext-mcp install all --scope=both # both places at once
193
246
  ```
194
247
 
195
- **Cursor** paste into `.cursorrules` or via Cursor Settings → Rules.
248
+ For a single tool:
196
249
 
197
- **Windsurf** — paste into your workspace memory or rules configuration.
250
+ ```bash
251
+ npx purecontext-mcp install <tool> --scope=global
252
+ ```
198
253
 
199
- **Any other agent** paste into whatever system prompt or memory configuration it supports.
254
+ To preview without writing files:
200
255
 
201
- Without these instructions, an agent may default to reading entire files rather than using `search_symbols`, or may not know to call `list_repos` first to get the repository ID required by every tool.
256
+ ```bash
257
+ npx purecontext-mcp install all --dry-run
258
+ npx purecontext-mcp install --list # show which IDEs were detected
259
+ ```
260
+
261
+ Supported tools and where each one writes:
262
+
263
+ | Tool | Local | Global |
264
+ |------|-------|--------|
265
+ | `claude` | `CLAUDE.md` in project | `~/.claude/CLAUDE.md` + hooks |
266
+ | `cursor` | `.cursor/rules/purecontext.mdc` | `~/.cursor/rules/purecontext.mdc` |
267
+ | `windsurf` | `.windsurfrules` | `~/.windsurfrules` |
268
+ | `continue` | `.continue/config.json` | `~/.continue/config.json` |
269
+ | `cline` | `.clinerules` | local only |
270
+ | `roo-code` | `.roo/rules-code.md` | local only |
271
+ | `vscode` | `.github/copilot-instructions.md` | local only |
272
+ | `claude-desktop` | always global | always global |
273
+
274
+ ### Manual install
275
+
276
+ If you'd rather paste the rules yourself, two instruction files are at the repository root:
277
+
278
+ - **`AGENT_INSTRUCTIONS_SHORT.md`** — ~2 KB. Mandatory workflow, tool selection table, core rules.
279
+ - **`AGENT_INSTRUCTIONS.md`** — ~15 KB. Adds parameter notes, decision trees, anti-patterns.
280
+
281
+ Paste the contents into whatever system prompt, memory, or rules configuration your agent uses.
package/USER-GUIDE.md CHANGED
@@ -46,6 +46,14 @@ For parameter-level documentation — every tool input, output, and flag — see
46
46
 
47
47
  ---
48
48
 
49
+ ## Language and framework coverage
50
+
51
+ - [Language Support](LANGUAGE-SUPPORT.md) — All 34 supported languages plus regex-based stylesheet handlers: what's extracted, what's filtered, and known limitations
52
+
53
+ - [Framework Adapters](FRAMEWORK-ADAPTERS.md) — Routes, components, and ORM entities pulled out as first-class symbols for Vue, React, Nuxt, Next.js, Angular, NestJS, Django, FastAPI, Flask, Spring Boot, Rails, Laravel, Flutter, and more
54
+
55
+ ---
56
+
49
57
  ## For teams and enterprise
50
58
 
51
59
  - [Using PureContext with a Team](team-setup.md) — Why a shared server is fundamentally different from local use, how to set it up, how to keep the index current automatically, and what enterprise deployments need to consider
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `purecontext-mcp hooks --install` / `hooks --list`
3
+ * `purecontext-mcp hook-pretooluse|hook-posttooluse|hook-precompact|hook-worktree-create|hook-worktree-remove`
4
+ *
5
+ * Merges hook entries into ~/.claude/settings.json using CLI-style commands
6
+ * (npx purecontext-mcp hook-*) so no scripts need to be copied to ~/.claude/hooks/.
7
+ * Also injects PureContext agent instructions into ~/.claude/CLAUDE.md.
8
+ */
9
+ export declare function cmdHooksInstall(): void;
10
+ export declare function cmdHooksList(): void;
11
+ export declare function mergeSettings(): void;
12
+ export declare function injectClaudeMd(): void;
13
+ /** PreToolUse: warn before Edit/Write/MultiEdit. */
14
+ export declare function cmdHookPreToolUse(): Promise<void>;
15
+ /** PostToolUse: re-index the repo after Edit/Write/MultiEdit. */
16
+ export declare function cmdHookPostToolUse(): Promise<void>;
17
+ /** PreCompact: inject session snapshot before context compaction. */
18
+ export declare function cmdHookPreCompact(): Promise<void>;
19
+ /** WorktreeCreate: auto-index a new agent worktree. */
20
+ export declare function cmdHookWorktreeCreate(): Promise<void>;
21
+ /** WorktreeRemove: fires when an agent worktree is removed. No-op for now. */
22
+ export declare function cmdHookWorktreeRemove(): Promise<void>;
23
+ /** TaskCompleted: surface post-task diagnostics and remind about available tools. */
24
+ export declare function cmdHookTaskCompleted(): Promise<void>;
25
+ /** SubagentStart: inject condensed repo orientation for spawned subagents. */
26
+ export declare function cmdHookSubagentStart(): Promise<void>;
27
+ export declare function runHooksCommand(args: string[]): void;
28
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0IH,wBAAgB,eAAe,IAAI,IAAI,CAetC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAenC;AAID,wBAAgB,aAAa,IAAI,IAAI,CAoDpC;AA6BD,wBAAgB,cAAc,IAAI,IAAI,CAuBrC;AAuCD,oDAAoD;AACpD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBvD;AAED,iEAAiE;AACjE,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8BxD;AA6DD,qEAAqE;AACrE,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgBvD;AAED,uDAAuD;AACvD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB3D;AAED,8EAA8E;AAC9E,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3D;AAyED,qFAAqF;AACrF,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAwC1D;AAED,8EAA8E;AAC9E,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8C1D;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAUpD"}