gitnexus 1.4.1 → 1.4.6

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 (169) hide show
  1. package/README.md +215 -194
  2. package/dist/cli/ai-context.d.ts +2 -1
  3. package/dist/cli/ai-context.js +117 -90
  4. package/dist/cli/analyze.d.ts +2 -0
  5. package/dist/cli/analyze.js +57 -30
  6. package/dist/cli/augment.js +1 -1
  7. package/dist/cli/eval-server.d.ts +1 -1
  8. package/dist/cli/eval-server.js +14 -6
  9. package/dist/cli/index.js +18 -25
  10. package/dist/cli/lazy-action.d.ts +6 -0
  11. package/dist/cli/lazy-action.js +18 -0
  12. package/dist/cli/mcp.js +1 -1
  13. package/dist/cli/setup.js +42 -32
  14. package/dist/cli/skill-gen.d.ts +26 -0
  15. package/dist/cli/skill-gen.js +549 -0
  16. package/dist/cli/status.js +13 -4
  17. package/dist/cli/tool.d.ts +3 -2
  18. package/dist/cli/tool.js +48 -13
  19. package/dist/cli/wiki.js +2 -2
  20. package/dist/config/ignore-service.d.ts +25 -0
  21. package/dist/config/ignore-service.js +76 -0
  22. package/dist/config/supported-languages.d.ts +1 -0
  23. package/dist/config/supported-languages.js +1 -1
  24. package/dist/core/augmentation/engine.js +99 -72
  25. package/dist/core/embeddings/embedder.d.ts +1 -1
  26. package/dist/core/embeddings/embedder.js +1 -1
  27. package/dist/core/embeddings/embedding-pipeline.d.ts +3 -3
  28. package/dist/core/embeddings/embedding-pipeline.js +74 -47
  29. package/dist/core/embeddings/types.d.ts +1 -1
  30. package/dist/core/graph/types.d.ts +5 -2
  31. package/dist/core/ingestion/ast-cache.js +3 -2
  32. package/dist/core/ingestion/call-processor.d.ts +5 -7
  33. package/dist/core/ingestion/call-processor.js +430 -283
  34. package/dist/core/ingestion/call-routing.d.ts +53 -0
  35. package/dist/core/ingestion/call-routing.js +108 -0
  36. package/dist/core/ingestion/cluster-enricher.js +16 -16
  37. package/dist/core/ingestion/constants.d.ts +16 -0
  38. package/dist/core/ingestion/constants.js +16 -0
  39. package/dist/core/ingestion/entry-point-scoring.d.ts +2 -1
  40. package/dist/core/ingestion/entry-point-scoring.js +94 -24
  41. package/dist/core/ingestion/export-detection.d.ts +18 -0
  42. package/dist/core/ingestion/export-detection.js +231 -0
  43. package/dist/core/ingestion/filesystem-walker.js +4 -3
  44. package/dist/core/ingestion/framework-detection.d.ts +5 -1
  45. package/dist/core/ingestion/framework-detection.js +48 -8
  46. package/dist/core/ingestion/heritage-processor.d.ts +13 -5
  47. package/dist/core/ingestion/heritage-processor.js +109 -55
  48. package/dist/core/ingestion/import-processor.d.ts +16 -20
  49. package/dist/core/ingestion/import-processor.js +202 -696
  50. package/dist/core/ingestion/language-config.d.ts +46 -0
  51. package/dist/core/ingestion/language-config.js +167 -0
  52. package/dist/core/ingestion/mro-processor.d.ts +45 -0
  53. package/dist/core/ingestion/mro-processor.js +369 -0
  54. package/dist/core/ingestion/named-binding-extraction.d.ts +61 -0
  55. package/dist/core/ingestion/named-binding-extraction.js +363 -0
  56. package/dist/core/ingestion/parsing-processor.d.ts +3 -11
  57. package/dist/core/ingestion/parsing-processor.js +85 -181
  58. package/dist/core/ingestion/pipeline.d.ts +5 -1
  59. package/dist/core/ingestion/pipeline.js +192 -116
  60. package/dist/core/ingestion/process-processor.js +2 -1
  61. package/dist/core/ingestion/resolution-context.d.ts +53 -0
  62. package/dist/core/ingestion/resolution-context.js +132 -0
  63. package/dist/core/ingestion/resolvers/csharp.d.ts +22 -0
  64. package/dist/core/ingestion/resolvers/csharp.js +109 -0
  65. package/dist/core/ingestion/resolvers/go.d.ts +19 -0
  66. package/dist/core/ingestion/resolvers/go.js +42 -0
  67. package/dist/core/ingestion/resolvers/index.d.ts +18 -0
  68. package/dist/core/ingestion/resolvers/index.js +13 -0
  69. package/dist/core/ingestion/resolvers/jvm.d.ts +23 -0
  70. package/dist/core/ingestion/resolvers/jvm.js +87 -0
  71. package/dist/core/ingestion/resolvers/php.d.ts +15 -0
  72. package/dist/core/ingestion/resolvers/php.js +35 -0
  73. package/dist/core/ingestion/resolvers/python.d.ts +19 -0
  74. package/dist/core/ingestion/resolvers/python.js +52 -0
  75. package/dist/core/ingestion/resolvers/ruby.d.ts +12 -0
  76. package/dist/core/ingestion/resolvers/ruby.js +15 -0
  77. package/dist/core/ingestion/resolvers/rust.d.ts +15 -0
  78. package/dist/core/ingestion/resolvers/rust.js +73 -0
  79. package/dist/core/ingestion/resolvers/standard.d.ts +28 -0
  80. package/dist/core/ingestion/resolvers/standard.js +123 -0
  81. package/dist/core/ingestion/resolvers/utils.d.ts +33 -0
  82. package/dist/core/ingestion/resolvers/utils.js +122 -0
  83. package/dist/core/ingestion/symbol-table.d.ts +21 -1
  84. package/dist/core/ingestion/symbol-table.js +40 -12
  85. package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -11
  86. package/dist/core/ingestion/tree-sitter-queries.js +642 -485
  87. package/dist/core/ingestion/type-env.d.ts +49 -0
  88. package/dist/core/ingestion/type-env.js +611 -0
  89. package/dist/core/ingestion/type-extractors/c-cpp.d.ts +2 -0
  90. package/dist/core/ingestion/type-extractors/c-cpp.js +385 -0
  91. package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
  92. package/dist/core/ingestion/type-extractors/csharp.js +383 -0
  93. package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
  94. package/dist/core/ingestion/type-extractors/go.js +467 -0
  95. package/dist/core/ingestion/type-extractors/index.d.ts +22 -0
  96. package/dist/core/ingestion/type-extractors/index.js +31 -0
  97. package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
  98. package/dist/core/ingestion/type-extractors/jvm.js +681 -0
  99. package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
  100. package/dist/core/ingestion/type-extractors/php.js +549 -0
  101. package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
  102. package/dist/core/ingestion/type-extractors/python.js +406 -0
  103. package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
  104. package/dist/core/ingestion/type-extractors/ruby.js +389 -0
  105. package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
  106. package/dist/core/ingestion/type-extractors/rust.js +449 -0
  107. package/dist/core/ingestion/type-extractors/shared.d.ts +133 -0
  108. package/dist/core/ingestion/type-extractors/shared.js +703 -0
  109. package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
  110. package/dist/core/ingestion/type-extractors/swift.js +137 -0
  111. package/dist/core/ingestion/type-extractors/types.d.ts +127 -0
  112. package/dist/core/ingestion/type-extractors/types.js +1 -0
  113. package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
  114. package/dist/core/ingestion/type-extractors/typescript.js +494 -0
  115. package/dist/core/ingestion/utils.d.ts +98 -0
  116. package/dist/core/ingestion/utils.js +1064 -9
  117. package/dist/core/ingestion/workers/parse-worker.d.ts +38 -4
  118. package/dist/core/ingestion/workers/parse-worker.js +251 -359
  119. package/dist/core/ingestion/workers/worker-pool.js +8 -0
  120. package/dist/core/{kuzu → lbug}/csv-generator.d.ts +1 -1
  121. package/dist/core/{kuzu → lbug}/csv-generator.js +20 -4
  122. package/dist/core/{kuzu/kuzu-adapter.d.ts → lbug/lbug-adapter.d.ts} +19 -19
  123. package/dist/core/{kuzu/kuzu-adapter.js → lbug/lbug-adapter.js} +82 -82
  124. package/dist/core/{kuzu → lbug}/schema.d.ts +4 -4
  125. package/dist/core/{kuzu → lbug}/schema.js +304 -289
  126. package/dist/core/search/bm25-index.d.ts +4 -4
  127. package/dist/core/search/bm25-index.js +17 -16
  128. package/dist/core/search/hybrid-search.d.ts +2 -2
  129. package/dist/core/search/hybrid-search.js +9 -9
  130. package/dist/core/tree-sitter/parser-loader.js +9 -2
  131. package/dist/core/wiki/generator.d.ts +4 -52
  132. package/dist/core/wiki/generator.js +53 -552
  133. package/dist/core/wiki/graph-queries.d.ts +4 -46
  134. package/dist/core/wiki/graph-queries.js +103 -282
  135. package/dist/core/wiki/html-viewer.js +192 -192
  136. package/dist/core/wiki/llm-client.js +11 -73
  137. package/dist/core/wiki/prompts.d.ts +8 -52
  138. package/dist/core/wiki/prompts.js +86 -200
  139. package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
  140. package/dist/mcp/compatible-stdio-transport.js +200 -0
  141. package/dist/mcp/core/{kuzu-adapter.d.ts → lbug-adapter.d.ts} +7 -9
  142. package/dist/mcp/core/{kuzu-adapter.js → lbug-adapter.js} +77 -79
  143. package/dist/mcp/local/local-backend.d.ts +7 -6
  144. package/dist/mcp/local/local-backend.js +176 -147
  145. package/dist/mcp/resources.js +42 -42
  146. package/dist/mcp/server.js +18 -19
  147. package/dist/mcp/tools.js +103 -104
  148. package/dist/server/api.js +12 -12
  149. package/dist/server/mcp-http.d.ts +1 -1
  150. package/dist/server/mcp-http.js +1 -1
  151. package/dist/storage/repo-manager.d.ts +20 -2
  152. package/dist/storage/repo-manager.js +55 -1
  153. package/dist/types/pipeline.d.ts +1 -1
  154. package/hooks/claude/gitnexus-hook.cjs +238 -155
  155. package/hooks/claude/pre-tool-use.sh +79 -79
  156. package/hooks/claude/session-start.sh +42 -42
  157. package/package.json +99 -96
  158. package/scripts/patch-tree-sitter-swift.cjs +74 -74
  159. package/skills/gitnexus-cli.md +82 -82
  160. package/skills/gitnexus-debugging.md +89 -89
  161. package/skills/gitnexus-exploring.md +78 -78
  162. package/skills/gitnexus-guide.md +64 -64
  163. package/skills/gitnexus-impact-analysis.md +97 -97
  164. package/skills/gitnexus-pr-review.md +163 -163
  165. package/skills/gitnexus-refactoring.md +121 -121
  166. package/vendor/leiden/index.cjs +355 -355
  167. package/vendor/leiden/utils.cjs +392 -392
  168. package/dist/core/wiki/diagrams.d.ts +0 -27
  169. package/dist/core/wiki/diagrams.js +0 -163
package/README.md CHANGED
@@ -1,194 +1,215 @@
1
- # GitNexus
2
-
3
- **Graph-powered code intelligence for AI agents.** Index any codebase into a knowledge graph, then query it via MCP or CLI.
4
-
5
- Works with **Cursor**, **Claude Code**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
6
-
7
- [![npm version](https://img.shields.io/npm/v/gitnexus.svg)](https://www.npmjs.com/package/gitnexus)
8
- [![License: PolyForm Noncommercial](https://img.shields.io/badge/License-PolyForm%20Noncommercial-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
9
-
10
- ---
11
-
12
- ## Why?
13
-
14
- AI coding tools don't understand your codebase structure. They edit a function without knowing 47 other functions depend on it. GitNexus fixes this by **precomputing every dependency, call chain, and relationship** into a queryable graph.
15
-
16
- **Three commands to give your AI agent full codebase awareness.**
17
-
18
- ## Quick Start
19
-
20
- ```bash
21
- # Index your repo (run from repo root)
22
- npx gitnexus analyze
23
- ```
24
-
25
- That's it. This indexes the codebase, installs agent skills, registers Claude Code hooks, and creates `AGENTS.md` / `CLAUDE.md` context files — all in one command.
26
-
27
- To configure MCP for your editor, run `npx gitnexus setup` once — or set it up manually below.
28
-
29
- `gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
30
-
31
- ### Editor Support
32
-
33
- | Editor | MCP | Skills | Hooks (auto-augment) | Support |
34
- |--------|-----|--------|---------------------|---------|
35
- | **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
36
- | **Cursor** | Yes | Yes | — | MCP + Skills |
37
- | **Windsurf** | Yes | — | — | MCP |
38
- | **OpenCode** | Yes | Yes | — | MCP + Skills |
39
-
40
- > **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context.
41
-
42
- ### Community Integrations
43
-
44
- | Agent | Install | Source |
45
- |-------|---------|--------|
46
- | [pi](https://pi.dev) | `pi install npm:pi-gitnexus` | [pi-gitnexus](https://github.com/tintinweb/pi-gitnexus) |
47
-
48
- ## MCP Setup (manual)
49
-
50
- If you prefer to configure manually instead of using `gitnexus setup`:
51
-
52
- ### Claude Code (full support — MCP + skills + hooks)
53
-
54
- ```bash
55
- claude mcp add gitnexus -- npx -y gitnexus@latest mcp
56
- ```
57
-
58
- ### Cursor / Windsurf
59
-
60
- Add to `~/.cursor/mcp.json` (global — works for all projects):
61
-
62
- ```json
63
- {
64
- "mcpServers": {
65
- "gitnexus": {
66
- "command": "npx",
67
- "args": ["-y", "gitnexus@latest", "mcp"]
68
- }
69
- }
70
- }
71
- ```
72
-
73
- ### OpenCode
74
-
75
- Add to `~/.config/opencode/config.json`:
76
-
77
- ```json
78
- {
79
- "mcp": {
80
- "gitnexus": {
81
- "command": "npx",
82
- "args": ["-y", "gitnexus@latest", "mcp"]
83
- }
84
- }
85
- }
86
- ```
87
-
88
- ## How It Works
89
-
90
- GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:
91
-
92
- 1. **Structure** — Walks the file tree and maps folder/file relationships
93
- 2. **Parsing** — Extracts functions, classes, methods, and interfaces using Tree-sitter ASTs
94
- 3. **Resolution** — Resolves imports and function calls across files with language-aware logic
95
- 4. **Clustering** — Groups related symbols into functional communities
96
- 5. **Processes** — Traces execution flows from entry points through call chains
97
- 6. **Search** — Builds hybrid search indexes for fast retrieval
98
-
99
- The result is a **KuzuDB graph database** stored locally in `.gitnexus/` with full-text search and semantic embeddings.
100
-
101
- ## MCP Tools
102
-
103
- Your AI agent gets these tools automatically:
104
-
105
- | Tool | What It Does | `repo` Param |
106
- |------|-------------|--------------|
107
- | `list_repos` | Discover all indexed repositories | — |
108
- | `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional |
109
- | `context` | 360-degree symbol view — categorized refs, process participation | Optional |
110
- | `impact` | Blast radius analysis with depth grouping and confidence | Optional |
111
- | `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional |
112
- | `rename` | Multi-file coordinated rename with graph + text search | Optional |
113
- | `cypher` | Raw Cypher graph queries | Optional |
114
-
115
- > With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({query: "auth", repo: "my-app"})`.
116
-
117
- ## MCP Resources
118
-
119
- | Resource | Purpose |
120
- |----------|---------|
121
- | `gitnexus://repos` | List all indexed repositories (read first) |
122
- | `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools |
123
- | `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores |
124
- | `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details |
125
- | `gitnexus://repo/{name}/processes` | All execution flows |
126
- | `gitnexus://repo/{name}/process/{name}` | Full process trace with steps |
127
- | `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries |
128
-
129
- ## MCP Prompts
130
-
131
- | Prompt | What It Does |
132
- |--------|-------------|
133
- | `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level |
134
- | `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams |
135
-
136
- ## CLI Commands
137
-
138
- ```bash
139
- gitnexus setup # Configure MCP for your editors (one-time)
140
- gitnexus analyze [path] # Index a repository (or update stale index)
141
- gitnexus analyze --force # Force full re-index
142
- gitnexus analyze --skip-embeddings # Skip embedding generation (faster)
143
- gitnexus mcp # Start MCP server (stdio) serves all indexed repos
144
- gitnexus serve # Start local HTTP server (multi-repo) for web UI
145
- gitnexus list # List all indexed repositories
146
- gitnexus status # Show index status for current repo
147
- gitnexus clean # Delete index for current repo
148
- gitnexus clean --all --force # Delete all indexes
149
- gitnexus wiki [path] # Generate LLM-powered docs from knowledge graph
150
- gitnexus wiki --model <model> # Wiki with custom LLM model (default: gpt-4o-mini)
151
- ```
152
-
153
- ## Multi-Repo Support
154
-
155
- GitNexus supports indexing multiple repositories. Each `gitnexus analyze` registers the repo in a global registry (`~/.gitnexus/registry.json`). The MCP server serves all indexed repos automatically.
156
-
157
- ## Supported Languages
158
-
159
- TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Swift
160
-
161
- ## Agent Skills
162
-
163
- GitNexus ships with skill files that teach AI agents how to use the tools effectively:
164
-
165
- - **Exploring** — Navigate unfamiliar code using the knowledge graph
166
- - **Debugging** Trace bugs through call chains
167
- - **Impact Analysis**Analyze blast radius before changes
168
- - **Refactoring** Plan safe refactors using dependency mapping
169
-
170
- Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global).
171
-
172
- ## Requirements
173
-
174
- - Node.js >= 18
175
- - Git repository (uses git for commit tracking)
176
-
177
- ## Privacy
178
-
179
- - All processing happens locally on your machine
180
- - No code is sent to any server
181
- - Index stored in `.gitnexus/` inside your repo (gitignored)
182
- - Global registry at `~/.gitnexus/` stores only paths and metadata
183
-
184
- ## Web UI
185
-
186
- GitNexus also has a browser-based UI at [gitnexus.vercel.app](https://gitnexus.vercel.app) 100% client-side, your code never leaves the browser.
187
-
188
- **Local Backend Mode:** Run `gitnexus serve` and open the web UI locally it auto-detects the server and shows all your indexed repos, with full AI chat support. No need to re-upload or re-index. The agent's tools (Cypher queries, search, code navigation) route through the backend HTTP API automatically.
189
-
190
- ## License
191
-
192
- [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/)
193
-
194
- Free for non-commercial use. Contact for commercial licensing.
1
+ # GitNexus
2
+
3
+ **Graph-powered code intelligence for AI agents.** Index any codebase into a knowledge graph, then query it via MCP or CLI.
4
+
5
+ Works with **Cursor**, **Claude Code**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/gitnexus.svg)](https://www.npmjs.com/package/gitnexus)
8
+ [![License: PolyForm Noncommercial](https://img.shields.io/badge/License-PolyForm%20Noncommercial-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
9
+
10
+ ---
11
+
12
+ ## Why?
13
+
14
+ AI coding tools don't understand your codebase structure. They edit a function without knowing 47 other functions depend on it. GitNexus fixes this by **precomputing every dependency, call chain, and relationship** into a queryable graph.
15
+
16
+ **Three commands to give your AI agent full codebase awareness.**
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ # Index your repo (run from repo root)
22
+ npx gitnexus analyze
23
+ ```
24
+
25
+ That's it. This indexes the codebase, installs agent skills, registers Claude Code hooks, and creates `AGENTS.md` / `CLAUDE.md` context files — all in one command.
26
+
27
+ To configure MCP for your editor, run `npx gitnexus setup` once — or set it up manually below.
28
+
29
+ `gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
30
+
31
+ ### Editor Support
32
+
33
+ | Editor | MCP | Skills | Hooks (auto-augment) | Support |
34
+ |--------|-----|--------|---------------------|---------|
35
+ | **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
36
+ | **Cursor** | Yes | Yes | — | MCP + Skills |
37
+ | **Windsurf** | Yes | — | — | MCP |
38
+ | **OpenCode** | Yes | Yes | — | MCP + Skills |
39
+
40
+ > **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context.
41
+
42
+ ### Community Integrations
43
+
44
+ | Agent | Install | Source |
45
+ |-------|---------|--------|
46
+ | [pi](https://pi.dev) | `pi install npm:pi-gitnexus` | [pi-gitnexus](https://github.com/tintinweb/pi-gitnexus) |
47
+
48
+ ## MCP Setup (manual)
49
+
50
+ If you prefer to configure manually instead of using `gitnexus setup`:
51
+
52
+ ### Claude Code (full support — MCP + skills + hooks)
53
+
54
+ ```bash
55
+ claude mcp add gitnexus -- npx -y gitnexus@latest mcp
56
+ ```
57
+
58
+ ### Cursor / Windsurf
59
+
60
+ Add to `~/.cursor/mcp.json` (global — works for all projects):
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "gitnexus": {
66
+ "command": "npx",
67
+ "args": ["-y", "gitnexus@latest", "mcp"]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ### OpenCode
74
+
75
+ Add to `~/.config/opencode/config.json`:
76
+
77
+ ```json
78
+ {
79
+ "mcp": {
80
+ "gitnexus": {
81
+ "command": "npx",
82
+ "args": ["-y", "gitnexus@latest", "mcp"]
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ## How It Works
89
+
90
+ GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:
91
+
92
+ 1. **Structure** — Walks the file tree and maps folder/file relationships
93
+ 2. **Parsing** — Extracts functions, classes, methods, and interfaces using Tree-sitter ASTs
94
+ 3. **Resolution** — Resolves imports and function calls across files with language-aware logic
95
+ 4. **Clustering** — Groups related symbols into functional communities
96
+ 5. **Processes** — Traces execution flows from entry points through call chains
97
+ 6. **Search** — Builds hybrid search indexes for fast retrieval
98
+
99
+ The result is a **LadybugDB graph database** stored locally in `.gitnexus/` with full-text search and semantic embeddings.
100
+
101
+ ## MCP Tools
102
+
103
+ Your AI agent gets these tools automatically:
104
+
105
+ | Tool | What It Does | `repo` Param |
106
+ |------|-------------|--------------|
107
+ | `list_repos` | Discover all indexed repositories | — |
108
+ | `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional |
109
+ | `context` | 360-degree symbol view — categorized refs, process participation | Optional |
110
+ | `impact` | Blast radius analysis with depth grouping and confidence | Optional |
111
+ | `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional |
112
+ | `rename` | Multi-file coordinated rename with graph + text search | Optional |
113
+ | `cypher` | Raw Cypher graph queries | Optional |
114
+
115
+ > With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({query: "auth", repo: "my-app"})`.
116
+
117
+ ## MCP Resources
118
+
119
+ | Resource | Purpose |
120
+ |----------|---------|
121
+ | `gitnexus://repos` | List all indexed repositories (read first) |
122
+ | `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools |
123
+ | `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores |
124
+ | `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details |
125
+ | `gitnexus://repo/{name}/processes` | All execution flows |
126
+ | `gitnexus://repo/{name}/process/{name}` | Full process trace with steps |
127
+ | `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries |
128
+
129
+ ## MCP Prompts
130
+
131
+ | Prompt | What It Does |
132
+ |--------|-------------|
133
+ | `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level |
134
+ | `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams |
135
+
136
+ ## CLI Commands
137
+
138
+ ```bash
139
+ gitnexus setup # Configure MCP for your editors (one-time)
140
+ gitnexus analyze [path] # Index a repository (or update stale index)
141
+ gitnexus analyze --force # Force full re-index
142
+ gitnexus analyze --embeddings # Enable embedding generation (slower, better search)
143
+ gitnexus analyze --verbose # Log skipped files when parsers are unavailable
144
+ gitnexus mcp # Start MCP server (stdio) serves all indexed repos
145
+ gitnexus serve # Start local HTTP server (multi-repo) for web UI
146
+ gitnexus list # List all indexed repositories
147
+ gitnexus status # Show index status for current repo
148
+ gitnexus clean # Delete index for current repo
149
+ gitnexus clean --all --force # Delete all indexes
150
+ gitnexus wiki [path] # Generate LLM-powered docs from knowledge graph
151
+ gitnexus wiki --model <model> # Wiki with custom LLM model (default: gpt-4o-mini)
152
+ ```
153
+
154
+ ## Multi-Repo Support
155
+
156
+ GitNexus supports indexing multiple repositories. Each `gitnexus analyze` registers the repo in a global registry (`~/.gitnexus/registry.json`). The MCP server serves all indexed repos automatically.
157
+
158
+ ## Supported Languages
159
+
160
+ TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift, Ruby
161
+
162
+ ### Language Feature Matrix
163
+
164
+ | Language | Imports | Named Bindings | Exports | Heritage | Type Annotations | Constructor Inference | Config | Frameworks | Entry Points |
165
+ |----------|---------|----------------|---------|----------|-----------------|---------------------|--------|------------|-------------|
166
+ | TypeScript | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
167
+ | JavaScript | ✓ | ✓ | ✓ | ✓ | | | | ✓ | ✓ |
168
+ | Python | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
169
+ | Java | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
170
+ | Kotlin | | | | | ✓ | ✓ | — | ✓ | ✓ |
171
+ | C# | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
172
+ | Go | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
173
+ | Rust | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
174
+ | PHP | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
175
+ | Ruby | | | ✓ | ✓ | — | ✓ | — | ✓ | ✓ |
176
+ | Swift | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
177
+ | C | — | — | ✓ | — | ✓ | ✓ | — | ✓ | ✓ |
178
+ | C++ | — | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
179
+
180
+ **Imports** — cross-file import resolution · **Named Bindings** `import { X as Y }` / re-export tracking · **Exports** — public/exported symbol detection · **Heritage** — class inheritance, interfaces, mixins · **Type Annotations** — explicit type extraction for receiver resolution · **Constructor Inference** — infer receiver type from constructor calls (`self`/`this` resolution included for all languages) · **Config** — language toolchain config parsing (tsconfig, go.mod, etc.) · **Frameworks** — AST-based framework pattern detection · **Entry Points** — entry point scoring heuristics
181
+
182
+ ## Agent Skills
183
+
184
+ GitNexus ships with skill files that teach AI agents how to use the tools effectively:
185
+
186
+ - **Exploring**Navigate unfamiliar code using the knowledge graph
187
+ - **Debugging** — Trace bugs through call chains
188
+ - **Impact Analysis**Analyze blast radius before changes
189
+ - **Refactoring** — Plan safe refactors using dependency mapping
190
+
191
+ Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global).
192
+
193
+ ## Requirements
194
+
195
+ - Node.js >= 18
196
+ - Git repository (uses git for commit tracking)
197
+
198
+ ## Privacy
199
+
200
+ - All processing happens locally on your machine
201
+ - No code is sent to any server
202
+ - Index stored in `.gitnexus/` inside your repo (gitignored)
203
+ - Global registry at `~/.gitnexus/` stores only paths and metadata
204
+
205
+ ## Web UI
206
+
207
+ GitNexus also has a browser-based UI at [gitnexus.vercel.app](https://gitnexus.vercel.app) — 100% client-side, your code never leaves the browser.
208
+
209
+ **Local Backend Mode:** Run `gitnexus serve` and open the web UI locally — it auto-detects the server and shows all your indexed repos, with full AI chat support. No need to re-upload or re-index. The agent's tools (Cypher queries, search, code navigation) route through the backend HTTP API automatically.
210
+
211
+ ## License
212
+
213
+ [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/)
214
+
215
+ Free for non-commercial use. Contact for commercial licensing.
@@ -5,6 +5,7 @@
5
5
  * AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Cline, etc.
6
6
  * CLAUDE.md is for Claude Code which only reads that file.
7
7
  */
8
+ import { type GeneratedSkillInfo } from './skill-gen.js';
8
9
  interface RepoStats {
9
10
  files?: number;
10
11
  nodes?: number;
@@ -16,7 +17,7 @@ interface RepoStats {
16
17
  /**
17
18
  * Generate AI context files after indexing
18
19
  */
19
- export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats): Promise<{
20
+ export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[]): Promise<{
20
21
  files: string[];
21
22
  }>;
22
23
  export {};