codexia 0.2.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 (224) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/LICENSE +663 -0
  3. package/README.md +392 -0
  4. package/dist/adapters/github/index.d.ts +66 -0
  5. package/dist/adapters/github/index.d.ts.map +1 -0
  6. package/dist/adapters/github/index.js +84 -0
  7. package/dist/adapters/github/index.js.map +1 -0
  8. package/dist/adapters/index.d.ts +5 -0
  9. package/dist/adapters/index.d.ts.map +1 -0
  10. package/dist/adapters/index.js +5 -0
  11. package/dist/adapters/index.js.map +1 -0
  12. package/dist/cli/commands/changelog.d.ts +3 -0
  13. package/dist/cli/commands/changelog.d.ts.map +1 -0
  14. package/dist/cli/commands/changelog.js +221 -0
  15. package/dist/cli/commands/changelog.js.map +1 -0
  16. package/dist/cli/commands/check.d.ts +3 -0
  17. package/dist/cli/commands/check.d.ts.map +1 -0
  18. package/dist/cli/commands/check.js +35 -0
  19. package/dist/cli/commands/check.js.map +1 -0
  20. package/dist/cli/commands/complexity.d.ts +3 -0
  21. package/dist/cli/commands/complexity.d.ts.map +1 -0
  22. package/dist/cli/commands/complexity.js +103 -0
  23. package/dist/cli/commands/complexity.js.map +1 -0
  24. package/dist/cli/commands/graph.d.ts +3 -0
  25. package/dist/cli/commands/graph.d.ts.map +1 -0
  26. package/dist/cli/commands/graph.js +46 -0
  27. package/dist/cli/commands/graph.js.map +1 -0
  28. package/dist/cli/commands/history.d.ts +3 -0
  29. package/dist/cli/commands/history.d.ts.map +1 -0
  30. package/dist/cli/commands/history.js +127 -0
  31. package/dist/cli/commands/history.js.map +1 -0
  32. package/dist/cli/commands/hotpaths.d.ts +3 -0
  33. package/dist/cli/commands/hotpaths.d.ts.map +1 -0
  34. package/dist/cli/commands/hotpaths.js +153 -0
  35. package/dist/cli/commands/hotpaths.js.map +1 -0
  36. package/dist/cli/commands/impact.d.ts +3 -0
  37. package/dist/cli/commands/impact.d.ts.map +1 -0
  38. package/dist/cli/commands/impact.js +37 -0
  39. package/dist/cli/commands/impact.js.map +1 -0
  40. package/dist/cli/commands/init.d.ts +3 -0
  41. package/dist/cli/commands/init.d.ts.map +1 -0
  42. package/dist/cli/commands/init.js +167 -0
  43. package/dist/cli/commands/init.js.map +1 -0
  44. package/dist/cli/commands/invariants.d.ts +3 -0
  45. package/dist/cli/commands/invariants.d.ts.map +1 -0
  46. package/dist/cli/commands/invariants.js +176 -0
  47. package/dist/cli/commands/invariants.js.map +1 -0
  48. package/dist/cli/commands/mcp-server.d.ts +3 -0
  49. package/dist/cli/commands/mcp-server.d.ts.map +1 -0
  50. package/dist/cli/commands/mcp-server.js +64 -0
  51. package/dist/cli/commands/mcp-server.js.map +1 -0
  52. package/dist/cli/commands/monorepo.d.ts +3 -0
  53. package/dist/cli/commands/monorepo.d.ts.map +1 -0
  54. package/dist/cli/commands/monorepo.js +156 -0
  55. package/dist/cli/commands/monorepo.js.map +1 -0
  56. package/dist/cli/commands/pr-report.d.ts +3 -0
  57. package/dist/cli/commands/pr-report.d.ts.map +1 -0
  58. package/dist/cli/commands/pr-report.js +32 -0
  59. package/dist/cli/commands/pr-report.js.map +1 -0
  60. package/dist/cli/commands/scan.d.ts +3 -0
  61. package/dist/cli/commands/scan.d.ts.map +1 -0
  62. package/dist/cli/commands/scan.js +25 -0
  63. package/dist/cli/commands/scan.js.map +1 -0
  64. package/dist/cli/commands/signals.d.ts +3 -0
  65. package/dist/cli/commands/signals.d.ts.map +1 -0
  66. package/dist/cli/commands/signals.js +34 -0
  67. package/dist/cli/commands/signals.js.map +1 -0
  68. package/dist/cli/commands/tests.d.ts +3 -0
  69. package/dist/cli/commands/tests.d.ts.map +1 -0
  70. package/dist/cli/commands/tests.js +30 -0
  71. package/dist/cli/commands/tests.js.map +1 -0
  72. package/dist/cli/commands/watch.d.ts +3 -0
  73. package/dist/cli/commands/watch.d.ts.map +1 -0
  74. package/dist/cli/commands/watch.js +131 -0
  75. package/dist/cli/commands/watch.js.map +1 -0
  76. package/dist/cli/engine.d.ts +162 -0
  77. package/dist/cli/engine.d.ts.map +1 -0
  78. package/dist/cli/engine.js +564 -0
  79. package/dist/cli/engine.js.map +1 -0
  80. package/dist/cli/formatter.d.ts +39 -0
  81. package/dist/cli/formatter.d.ts.map +1 -0
  82. package/dist/cli/formatter.js +444 -0
  83. package/dist/cli/formatter.js.map +1 -0
  84. package/dist/cli/index.d.ts +2 -0
  85. package/dist/cli/index.d.ts.map +1 -0
  86. package/dist/cli/index.js +63 -0
  87. package/dist/cli/index.js.map +1 -0
  88. package/dist/cli/interactive.d.ts +7 -0
  89. package/dist/cli/interactive.d.ts.map +1 -0
  90. package/dist/cli/interactive.js +644 -0
  91. package/dist/cli/interactive.js.map +1 -0
  92. package/dist/core/dependency-graph.d.ts +54 -0
  93. package/dist/core/dependency-graph.d.ts.map +1 -0
  94. package/dist/core/dependency-graph.js +190 -0
  95. package/dist/core/dependency-graph.js.map +1 -0
  96. package/dist/core/dependency-graph.test.d.ts +2 -0
  97. package/dist/core/dependency-graph.test.d.ts.map +1 -0
  98. package/dist/core/dependency-graph.test.js +106 -0
  99. package/dist/core/dependency-graph.test.js.map +1 -0
  100. package/dist/core/git-analyzer.d.ts +52 -0
  101. package/dist/core/git-analyzer.d.ts.map +1 -0
  102. package/dist/core/git-analyzer.js +250 -0
  103. package/dist/core/git-analyzer.js.map +1 -0
  104. package/dist/core/git-analyzer.test.d.ts +2 -0
  105. package/dist/core/git-analyzer.test.d.ts.map +1 -0
  106. package/dist/core/git-analyzer.test.js +71 -0
  107. package/dist/core/git-analyzer.test.js.map +1 -0
  108. package/dist/core/index.d.ts +7 -0
  109. package/dist/core/index.d.ts.map +1 -0
  110. package/dist/core/index.js +7 -0
  111. package/dist/core/index.js.map +1 -0
  112. package/dist/core/repo-indexer.d.ts +57 -0
  113. package/dist/core/repo-indexer.d.ts.map +1 -0
  114. package/dist/core/repo-indexer.js +356 -0
  115. package/dist/core/repo-indexer.js.map +1 -0
  116. package/dist/core/repo-indexer.test.d.ts +2 -0
  117. package/dist/core/repo-indexer.test.d.ts.map +1 -0
  118. package/dist/core/repo-indexer.test.js +89 -0
  119. package/dist/core/repo-indexer.test.js.map +1 -0
  120. package/dist/core/signals-engine.d.ts +38 -0
  121. package/dist/core/signals-engine.d.ts.map +1 -0
  122. package/dist/core/signals-engine.js +142 -0
  123. package/dist/core/signals-engine.js.map +1 -0
  124. package/dist/core/signals-engine.test.d.ts +2 -0
  125. package/dist/core/signals-engine.test.d.ts.map +1 -0
  126. package/dist/core/signals-engine.test.js +129 -0
  127. package/dist/core/signals-engine.test.js.map +1 -0
  128. package/dist/core/symbol-map.d.ts +45 -0
  129. package/dist/core/symbol-map.d.ts.map +1 -0
  130. package/dist/core/symbol-map.js +187 -0
  131. package/dist/core/symbol-map.js.map +1 -0
  132. package/dist/core/types.d.ts +514 -0
  133. package/dist/core/types.d.ts.map +1 -0
  134. package/dist/core/types.js +5 -0
  135. package/dist/core/types.js.map +1 -0
  136. package/dist/core/types.test.d.ts +2 -0
  137. package/dist/core/types.test.d.ts.map +1 -0
  138. package/dist/core/types.test.js +20 -0
  139. package/dist/core/types.test.js.map +1 -0
  140. package/dist/index.d.ts +5 -0
  141. package/dist/index.d.ts.map +1 -0
  142. package/dist/index.js +9 -0
  143. package/dist/index.js.map +1 -0
  144. package/dist/mcp/index.d.ts +3 -0
  145. package/dist/mcp/index.d.ts.map +1 -0
  146. package/dist/mcp/index.js +2 -0
  147. package/dist/mcp/index.js.map +1 -0
  148. package/dist/mcp/server.d.ts +89 -0
  149. package/dist/mcp/server.d.ts.map +1 -0
  150. package/dist/mcp/server.js +549 -0
  151. package/dist/mcp/server.js.map +1 -0
  152. package/dist/modules/changelog-generator.d.ts +82 -0
  153. package/dist/modules/changelog-generator.d.ts.map +1 -0
  154. package/dist/modules/changelog-generator.js +350 -0
  155. package/dist/modules/changelog-generator.js.map +1 -0
  156. package/dist/modules/complexity-engine.d.ts +86 -0
  157. package/dist/modules/complexity-engine.d.ts.map +1 -0
  158. package/dist/modules/complexity-engine.js +355 -0
  159. package/dist/modules/complexity-engine.js.map +1 -0
  160. package/dist/modules/convention-checker.d.ts +24 -0
  161. package/dist/modules/convention-checker.d.ts.map +1 -0
  162. package/dist/modules/convention-checker.js +181 -0
  163. package/dist/modules/convention-checker.js.map +1 -0
  164. package/dist/modules/graph-utils.d.ts +38 -0
  165. package/dist/modules/graph-utils.d.ts.map +1 -0
  166. package/dist/modules/graph-utils.js +40 -0
  167. package/dist/modules/graph-utils.js.map +1 -0
  168. package/dist/modules/hot-path-detector.d.ts +105 -0
  169. package/dist/modules/hot-path-detector.d.ts.map +1 -0
  170. package/dist/modules/hot-path-detector.js +332 -0
  171. package/dist/modules/hot-path-detector.js.map +1 -0
  172. package/dist/modules/impact-analyzer.d.ts +40 -0
  173. package/dist/modules/impact-analyzer.d.ts.map +1 -0
  174. package/dist/modules/impact-analyzer.js +218 -0
  175. package/dist/modules/impact-analyzer.js.map +1 -0
  176. package/dist/modules/impact-analyzer.test.d.ts +2 -0
  177. package/dist/modules/impact-analyzer.test.d.ts.map +1 -0
  178. package/dist/modules/impact-analyzer.test.js +308 -0
  179. package/dist/modules/impact-analyzer.test.js.map +1 -0
  180. package/dist/modules/index.d.ts +14 -0
  181. package/dist/modules/index.d.ts.map +1 -0
  182. package/dist/modules/index.js +20 -0
  183. package/dist/modules/index.js.map +1 -0
  184. package/dist/modules/invariant-engine.d.ts +119 -0
  185. package/dist/modules/invariant-engine.d.ts.map +1 -0
  186. package/dist/modules/invariant-engine.js +457 -0
  187. package/dist/modules/invariant-engine.js.map +1 -0
  188. package/dist/modules/memory-loader.d.ts +34 -0
  189. package/dist/modules/memory-loader.d.ts.map +1 -0
  190. package/dist/modules/memory-loader.js +313 -0
  191. package/dist/modules/memory-loader.js.map +1 -0
  192. package/dist/modules/memory-loader.test.d.ts +2 -0
  193. package/dist/modules/memory-loader.test.d.ts.map +1 -0
  194. package/dist/modules/memory-loader.test.js +120 -0
  195. package/dist/modules/memory-loader.test.js.map +1 -0
  196. package/dist/modules/monorepo-analyzer.d.ts +141 -0
  197. package/dist/modules/monorepo-analyzer.d.ts.map +1 -0
  198. package/dist/modules/monorepo-analyzer.js +453 -0
  199. package/dist/modules/monorepo-analyzer.js.map +1 -0
  200. package/dist/modules/plugin-system.d.ts +144 -0
  201. package/dist/modules/plugin-system.d.ts.map +1 -0
  202. package/dist/modules/plugin-system.js +428 -0
  203. package/dist/modules/plugin-system.js.map +1 -0
  204. package/dist/modules/smart-test-prioritizer.d.ts +95 -0
  205. package/dist/modules/smart-test-prioritizer.d.ts.map +1 -0
  206. package/dist/modules/smart-test-prioritizer.js +328 -0
  207. package/dist/modules/smart-test-prioritizer.js.map +1 -0
  208. package/dist/modules/temporal-analyzer.d.ts +71 -0
  209. package/dist/modules/temporal-analyzer.d.ts.map +1 -0
  210. package/dist/modules/temporal-analyzer.js +301 -0
  211. package/dist/modules/temporal-analyzer.js.map +1 -0
  212. package/dist/modules/test-suggester.d.ts +22 -0
  213. package/dist/modules/test-suggester.d.ts.map +1 -0
  214. package/dist/modules/test-suggester.js +145 -0
  215. package/dist/modules/test-suggester.js.map +1 -0
  216. package/dist/modules/visualizer.d.ts +49 -0
  217. package/dist/modules/visualizer.d.ts.map +1 -0
  218. package/dist/modules/visualizer.js +302 -0
  219. package/dist/modules/visualizer.js.map +1 -0
  220. package/dist/modules/watcher.d.ts +82 -0
  221. package/dist/modules/watcher.d.ts.map +1 -0
  222. package/dist/modules/watcher.js +298 -0
  223. package/dist/modules/watcher.js.map +1 -0
  224. package/package.json +70 -0
package/README.md ADDED
@@ -0,0 +1,392 @@
1
+ # Codexia
2
+
3
+ ![Codexia header banner showing brand colors and tagline](assets/codexia-header.png)
4
+
5
+ **Engineering intelligence layer for repositories.**
6
+
7
+ Codexia understands your codebase, its history, its architecture, and its rules—and produces evidence-based insight, not guesses.
8
+
9
+ ---
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # Install globally
15
+ npm install -g codexia
16
+
17
+ # Run the interactive wizard
18
+ codexia
19
+ ```
20
+
21
+ When you run `codexia` without any arguments, an interactive wizard guides you through all features:
22
+
23
+ ```text
24
+ ┌────────────────────────────────────────┐
25
+ │ 🧠 Codexia - Engineering Intelligence │
26
+ └────────────────────────────────────────┘
27
+
28
+ ? What would you like to do?
29
+ 📊 Analyze - Scan, signals, impact analysis
30
+ 📋 Reports - PR reports, changelog, history
31
+ 🎯 Quality - Complexity, invariants, conventions
32
+ 🧪 Testing - Test suggestions, prioritization
33
+ ⚙️ Setup - Initialize, watch mode, MCP server
34
+ ```
35
+
36
+ Select a category, then choose a specific command—the wizard handles paths, options, and output format prompts for you.
37
+
38
+ Or use commands directly for scripting and CI:
39
+
40
+ ```bash
41
+ codexia scan # Full repository scan
42
+ codexia impact # Analyze change impact
43
+ codexia signals # Detect code smells
44
+ ```
45
+
46
+ ---
47
+
48
+ ## What Codexia Does
49
+
50
+ ### 🔍 **Repository Scanning**
51
+
52
+ Indexes your codebase to understand structure, symbols, exports, and dependencies.
53
+
54
+ ```bash
55
+ codexia scan
56
+ ```
57
+
58
+ ### 📊 **Impact Analysis**
59
+
60
+ Shows exactly what your changes affect—which modules, which consumers, which tests.
61
+
62
+ ```bash
63
+ codexia impact --staged
64
+ codexia impact --branch feature/new-api
65
+ ```
66
+
67
+ ### ✅ **Convention Checking**
68
+
69
+ Validates changes against your project's documented conventions and architectural rules.
70
+
71
+ ```bash
72
+ codexia check
73
+ ```
74
+
75
+ ### 🧪 **Test Suggestions**
76
+
77
+ Recommends specific tests based on what code actually changed.
78
+
79
+ ```bash
80
+ codexia tests
81
+ ```
82
+
83
+ ### 📝 **PR Reports**
84
+
85
+ Generates comprehensive pull request analysis with risk scores and evidence.
86
+
87
+ ```bash
88
+ codexia pr-report --base main --head feature/new-api
89
+ ```
90
+
91
+ ### 🔗 **Dependency Visualization**
92
+
93
+ Visualize your dependency graph in multiple formats.
94
+
95
+ ```bash
96
+ codexia graph # ASCII tree view
97
+ codexia graph --format mermaid # Mermaid diagram
98
+ codexia graph --format dot # Graphviz DOT format
99
+ codexia graph src/core/types.ts # Focus on specific file
100
+ ```
101
+
102
+ ### 🧮 **Complexity Analysis**
103
+
104
+ Analyze code complexity, maintainability, and coupling metrics.
105
+
106
+ ```bash
107
+ codexia complexity # Analyze all files
108
+ codexia complexity src/ # Specific directory
109
+ codexia complexity --threshold 60 # Show files below threshold
110
+ codexia complexity --symbols # Include per-symbol breakdown
111
+ ```
112
+
113
+ ### 📜 **Git History Intelligence**
114
+
115
+ Understand temporal patterns, ownership, and risk from git history.
116
+
117
+ ```bash
118
+ codexia history # Full temporal analysis
119
+ codexia history --churn # File change frequency
120
+ codexia history --ownership # Code ownership & bus factor
121
+ codexia history --coupling # Files that change together
122
+ codexia history --regression-risk # Regression-prone areas
123
+ ```
124
+
125
+ ### 🛡️ **Architectural Invariants**
126
+
127
+ Enforce architectural rules and boundaries automatically.
128
+
129
+ ```bash
130
+ codexia invariants # Check all invariants
131
+ codexia invariants --init # Generate example config
132
+ codexia invariants --strict # Fail on any violation
133
+ ```
134
+
135
+ ### 🔥 **Hot Path Detection**
136
+
137
+ Identify critical code paths and their impact.
138
+
139
+ ```bash
140
+ codexia hotpaths # Auto-detect entry points
141
+ codexia hotpaths -e src/index.ts # From specific entry
142
+ codexia hotpaths --trace handleReq # Trace through symbol
143
+ codexia hotpaths --impact src/db.ts # Impact on hot paths
144
+ ```
145
+
146
+ ### 📋 **Changelog Generation**
147
+
148
+ Generate semantic changelogs from git history.
149
+
150
+ ```bash
151
+ codexia changelog --from v1.0.0 # Since tag
152
+ codexia changelog --from HEAD~20 # Last 20 commits
153
+ codexia changelog --include-api # Include API changes
154
+ codexia changelog -o CHANGELOG.md # Write to file
155
+ ```
156
+
157
+ ### 📦 **Monorepo Support**
158
+
159
+ Analyze multi-package repositories (npm, yarn, pnpm, lerna, nx, turborepo).
160
+
161
+ ```bash
162
+ codexia monorepo --detect # Detect packages
163
+ codexia monorepo --graph # Package dependency graph
164
+ codexia monorepo --impact @org/core # Cross-package impact
165
+ codexia monorepo --cycles # Circular dependencies
166
+ ```
167
+
168
+ ### 👀 **Watch Mode**
169
+
170
+ Live analysis as you code.
171
+
172
+ ```bash
173
+ codexia watch # Watch and scan on changes
174
+ codexia watch --signals # Watch and detect signals
175
+ codexia watch --impact # Watch and analyze impact
176
+ codexia watch --check # Watch and check conventions
177
+ ```
178
+
179
+ ### 🤖 **MCP Server (AI Integration)**
180
+
181
+ Model Context Protocol server for AI assistant integration.
182
+
183
+ ```bash
184
+ codexia mcp-server # Start stdio server (for Claude)
185
+ codexia mcp-server --port 3000 # Start HTTP server
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Installation
191
+
192
+ ```bash
193
+ npm install -g codexia
194
+ ```
195
+
196
+ Or use directly with npx:
197
+
198
+ ```bash
199
+ npx codexia scan
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Project Memory
205
+
206
+ Codexia uses a `.codexia/` directory in your repository to store architectural knowledge:
207
+
208
+ ```text
209
+ .codexia/
210
+ ├── architecture.md # System design and module boundaries
211
+ ├── conventions.md # Coding standards and patterns
212
+ ├── invariants.md # Rules that must never be broken
213
+ └── adrs/ # Architecture Decision Records
214
+ ├── ADR-0001.md
215
+ └── ADR-0002.md
216
+ ```
217
+
218
+ This "memory" is:
219
+
220
+ - **Human-readable** — Plain Markdown files
221
+ - **Version-controlled** — Part of your repo
222
+ - **AI-consumable** — Structured for tooling
223
+
224
+ ---
225
+
226
+ ## Invariants Configuration
227
+
228
+ Define architectural rules in `codexia.invariants.yaml`:
229
+
230
+ ```yaml
231
+ rules:
232
+ - name: no-ui-in-core
233
+ description: "Core modules should not import from UI layer"
234
+ type: no-import
235
+ from: "src/core/**"
236
+ target: "src/ui/**"
237
+ severity: error
238
+
239
+ - name: max-dependencies
240
+ description: "No file should have more than 15 imports"
241
+ type: max-dependencies
242
+ max: 15
243
+ scope: "src/**"
244
+ severity: warning
245
+ ```
246
+
247
+ Supported rule types:
248
+ - `no-import` — Prevent imports between modules
249
+ - `require-import` — Require certain dependencies
250
+ - `layer-boundary` — Enforce architectural layers
251
+ - `naming-pattern` — Enforce naming conventions
252
+ - `max-dependencies` — Limit import count
253
+ - `annotation-required` — Require JSDoc annotations
254
+
255
+ ---
256
+
257
+ ## MCP Integration
258
+
259
+ Codexia exposes a Model Context Protocol server for AI assistants:
260
+
261
+ ```bash
262
+ # For Claude Desktop, add to claude_desktop_config.json:
263
+ {
264
+ "mcpServers": {
265
+ "codexia": {
266
+ "command": "npx",
267
+ "args": ["codexia", "mcp-server"]
268
+ }
269
+ }
270
+ }
271
+ ```
272
+
273
+ ### Available MCP Tools
274
+
275
+ | Tool | Description |
276
+ |------|-------------|
277
+ | `codexia_scan` | Scan and index repository |
278
+ | `codexia_impact` | Analyze change impact |
279
+ | `codexia_context` | Get intelligent file context |
280
+ | `codexia_validate` | Check conventions |
281
+ | `codexia_signals` | Detect code signals |
282
+ | `codexia_tests` | Suggest affected tests |
283
+ | `codexia_dependencies` | Get dependency info |
284
+ | `codexia_hotpaths` | Analyze critical paths |
285
+ | `codexia_complexity` | Get complexity metrics |
286
+ | `codexia_memory` | Access project memory |
287
+
288
+ ---
289
+
290
+ ## Output Formats
291
+
292
+ All commands support JSON output for integration with other tools:
293
+
294
+ ```bash
295
+ codexia scan --json
296
+ codexia impact --staged --json
297
+ codexia check --json
298
+ codexia complexity --json
299
+ codexia history --json
300
+ ```
301
+
302
+ ---
303
+
304
+ ## Philosophy
305
+
306
+ | Principle | Description |
307
+ | -------- | ------------- |
308
+ | **Evidence-based** | Every insight has a traceable source |
309
+ | **Deterministic** | Same input, same output—no randomness |
310
+ | **Transparent** | You can see exactly how conclusions are reached |
311
+ | **Composable** | Works with your existing tools, not against them |
312
+
313
+ ---
314
+
315
+ ## CLI Reference
316
+
317
+ ```text
318
+ Usage: codexia [options] [command]
319
+
320
+ Interactive Mode:
321
+ codexia Launch interactive wizard (no arguments)
322
+
323
+ Commands:
324
+ init Initialize .codexia directory
325
+ scan Scan and index repository
326
+ impact Analyze change impact
327
+ check Check conventions
328
+ tests Suggest affected tests
329
+ signals Detect code signals
330
+ pr-report Generate PR analysis report
331
+ watch Watch mode with live analysis
332
+ graph Visualize dependency graph
333
+ complexity Analyze code complexity
334
+ history Analyze git history patterns
335
+ invariants Check architectural invariants
336
+ hotpaths Detect critical code paths
337
+ changelog Generate semantic changelog
338
+ monorepo Analyze monorepo structure
339
+ mcp-server Start MCP server for AI tools
340
+
341
+ Options:
342
+ --json Output as JSON
343
+ --format <format> Output format (text, json, markdown)
344
+ -v, --verbose Verbose output
345
+ -h, --help Display help
346
+ ```
347
+
348
+ ---
349
+
350
+ ## When to Use Codexia
351
+
352
+ ✅ **Use Codexia when:**
353
+
354
+ - You want to understand impact before merging
355
+ - You need to enforce architectural boundaries
356
+ - You want evidence-based PR reviews
357
+ - You're onboarding to a new codebase
358
+ - You need complexity and maintainability metrics
359
+ - You want to understand code ownership and bus factor
360
+ - You need to generate changelogs automatically
361
+ - You're working with monorepos
362
+
363
+ ❌ **Don't use Codexia when:**
364
+
365
+ - You need code generation (use Copilot, Cursor, etc.)
366
+ - You want autocomplete suggestions
367
+ - You need natural language explanations (pair with an LLM)
368
+
369
+ ---
370
+
371
+ ## Integration with AI Tools
372
+
373
+ Codexia is designed to complement AI coding assistants:
374
+
375
+ - **GitHub Copilot** — You write code, Codexia analyzes impact
376
+ - **Cursor** — AI suggests changes, Codexia validates them
377
+ - **Claude/ChatGPT** — LLM explains, Codexia provides evidence
378
+ - **Claude Desktop** — Use MCP server for deep integration
379
+
380
+ ```bash
381
+ # Feed Codexia output to your AI tool
382
+ codexia impact --staged --json | your-ai-tool --context
383
+
384
+ # Or use the MCP server directly
385
+ codexia mcp-server
386
+ ```
387
+
388
+ ---
389
+
390
+ ## License
391
+
392
+ AGPL-3.0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * GitHub Adapter
3
+ *
4
+ * Integration with GitHub APIs for PR analysis.
5
+ */
6
+ export interface GitHubPullRequest {
7
+ number: number;
8
+ title: string;
9
+ body: string;
10
+ base: {
11
+ ref: string;
12
+ sha: string;
13
+ };
14
+ head: {
15
+ ref: string;
16
+ sha: string;
17
+ };
18
+ user: {
19
+ login: string;
20
+ };
21
+ files?: GitHubFile[];
22
+ }
23
+ export interface GitHubFile {
24
+ filename: string;
25
+ status: 'added' | 'removed' | 'modified' | 'renamed';
26
+ additions: number;
27
+ deletions: number;
28
+ patch?: string;
29
+ }
30
+ export interface GitHubComment {
31
+ id: number;
32
+ body: string;
33
+ user: {
34
+ login: string;
35
+ };
36
+ path?: string;
37
+ line?: number;
38
+ }
39
+ export declare class GitHubAdapter {
40
+ private token?;
41
+ private owner;
42
+ private repo;
43
+ constructor(options: {
44
+ owner: string;
45
+ repo: string;
46
+ token?: string;
47
+ });
48
+ /**
49
+ * Get pull request details
50
+ */
51
+ getPullRequest(prNumber: number): Promise<GitHubPullRequest>;
52
+ /**
53
+ * Get files changed in a pull request
54
+ */
55
+ getPullRequestFiles(prNumber: number): Promise<GitHubFile[]>;
56
+ /**
57
+ * Post a comment on a pull request
58
+ */
59
+ postComment(prNumber: number, body: string): Promise<void>;
60
+ /**
61
+ * Post a review comment on a specific line
62
+ */
63
+ postReviewComment(prNumber: number, commitSha: string, path: string, line: number, body: string): Promise<void>;
64
+ private getHeaders;
65
+ }
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/github/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,C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,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC;IAkBhB,OAAO,CAAC,UAAU;CAWnB"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * GitHub Adapter
3
+ *
4
+ * Integration with GitHub APIs for PR analysis.
5
+ */
6
+ export class GitHubAdapter {
7
+ token;
8
+ owner;
9
+ repo;
10
+ constructor(options) {
11
+ this.owner = options.owner;
12
+ this.repo = options.repo;
13
+ this.token = options.token || process.env.GITHUB_TOKEN;
14
+ }
15
+ /**
16
+ * Get pull request details
17
+ */
18
+ async getPullRequest(prNumber) {
19
+ const url = `https://api.github.com/repos/${this.owner}/${this.repo}/pulls/${prNumber}`;
20
+ const response = await fetch(url, {
21
+ headers: this.getHeaders(),
22
+ });
23
+ if (!response.ok) {
24
+ throw new Error(`Failed to fetch PR: ${response.statusText}`);
25
+ }
26
+ return response.json();
27
+ }
28
+ /**
29
+ * Get files changed in a pull request
30
+ */
31
+ async getPullRequestFiles(prNumber) {
32
+ const url = `https://api.github.com/repos/${this.owner}/${this.repo}/pulls/${prNumber}/files`;
33
+ const response = await fetch(url, {
34
+ headers: this.getHeaders(),
35
+ });
36
+ if (!response.ok) {
37
+ throw new Error(`Failed to fetch PR files: ${response.statusText}`);
38
+ }
39
+ return response.json();
40
+ }
41
+ /**
42
+ * Post a comment on a pull request
43
+ */
44
+ async postComment(prNumber, body) {
45
+ const url = `https://api.github.com/repos/${this.owner}/${this.repo}/issues/${prNumber}/comments`;
46
+ const response = await fetch(url, {
47
+ method: 'POST',
48
+ headers: this.getHeaders(),
49
+ body: JSON.stringify({ body }),
50
+ });
51
+ if (!response.ok) {
52
+ throw new Error(`Failed to post comment: ${response.statusText}`);
53
+ }
54
+ }
55
+ /**
56
+ * Post a review comment on a specific line
57
+ */
58
+ async postReviewComment(prNumber, commitSha, path, line, body) {
59
+ const url = `https://api.github.com/repos/${this.owner}/${this.repo}/pulls/${prNumber}/comments`;
60
+ const response = await fetch(url, {
61
+ method: 'POST',
62
+ headers: this.getHeaders(),
63
+ body: JSON.stringify({
64
+ body,
65
+ commit_id: commitSha,
66
+ path,
67
+ line,
68
+ }),
69
+ });
70
+ if (!response.ok) {
71
+ throw new Error(`Failed to post review comment: ${response.statusText}`);
72
+ }
73
+ }
74
+ getHeaders() {
75
+ const headers = {
76
+ 'Accept': 'application/vnd.github.v3+json',
77
+ };
78
+ if (this.token) {
79
+ headers['Authorization'] = `token ${this.token}`;
80
+ }
81
+ return headers;
82
+ }
83
+ }
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/github/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsCH,MAAM,OAAO,aAAa;IAChB,KAAK,CAAU;IACf,KAAK,CAAS;IACd,IAAI,CAAS;IAErB,YAAY,OAAwD;QAClE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,QAAgB;QACnC,MAAM,GAAG,GAAG,gCAAgC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,UAAU,QAAQ,EAAE,CAAC;QACxF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAgC,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CA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AE,IAAI,CAAC,UAAU,EAAE;YAC1B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,IAAI;gBACJ,SAAS,EAAE,SAAS;gBACpB,IAAI;gBACJ,IAAI;aACL,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAEO,UAAU;QAChB,MAAM,OAAO,GAA2B;YACtC,QAAQ,EAAE,gCAAgC;SAC3C,CAAC;QAEF,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC;QACnD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Adapters Exports
3
+ */
4
+ export * from './github/index.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Adapters Exports
3
+ */
4
+ export * from './github/index.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const changelogCommand: Command;
3
+ //# sourceMappingURL=changelog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,gBAAgB,SA2EzB,CAAC"}