codeimpact 0.1.0 → 0.2.1

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.
package/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  **Persistent codebase understanding for AI assistants.**
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/codeimpact.svg?style=flat-square)](https://www.npmjs.com/package/codeimpact)
6
- [![npm downloads](https://img.shields.io/npm/dm/codeimpact.svg?style=flat-square)](https://www.npmjs.com/package/codeimpact)
7
- [![npm total downloads](https://img.shields.io/npm/dt/codeimpact.svg?style=flat-square)](https://www.npmjs.com/package/codeimpact)
8
- [![license](https://img.shields.io/npm/l/codeimpact.svg?style=flat-square)](https://github.com/abhisavakar/codeimpact/blob/main/LICENSE)
9
- [![Node.js](https://img.shields.io/badge/Node.js-18+-339933.svg?style=flat-square)](https://nodejs.org/)
10
- [![MCP](https://img.shields.io/badge/MCP-Compatible-blue.svg?style=flat-square)](https://modelcontextprotocol.io/)
5
+ [![NPM Version](https://img.shields.io/npm/v/codeimpact?style=for-the-badge&logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/codeimpact)
6
+ [![Downloads](https://img.shields.io/npm/dm/codeimpact?style=for-the-badge&logo=npm&logoColor=white&label=downloads/month)](https://www.npmjs.com/package/codeimpact)
7
+ [![Total Downloads](https://img.shields.io/npm/dt/codeimpact?style=for-the-badge&logo=npm&logoColor=white&label=total%20downloads)](https://www.npmjs.com/package/codeimpact)
8
+ [![License](https://img.shields.io/npm/l/codeimpact?style=for-the-badge)](https://github.com/abhisavakar/codeimpact/blob/main/LICENSE)
9
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/)
10
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue?style=for-the-badge)](https://modelcontextprotocol.io/)
11
11
 
12
12
  ```bash
13
13
  npm i codeimpact
14
14
  ```
15
15
 
16
- CodeImpact is an MCP server that indexes your codebase and gives AI assistants like Claude the ability to understand your project's structure, dependencies, and history across sessions.
16
+ CodeImpact is an MCP server that indexes your codebase and gives AI assistants like Claude the ability to understand your project's structure, dependencies, and history across sessions. It also includes an **AI-driven knowledge system** where AI assistants create and maintain project-specific skills using the [agentskills.io](https://agentskills.io) open standard.
17
17
 
18
18
  ---
19
19
 
@@ -21,12 +21,13 @@ CodeImpact is an MCP server that indexes your codebase and gives AI assistants l
21
21
 
22
22
  - **Indexes your code** - Extracts functions, classes, imports, and exports using true Tree-sitter AST parsing
23
23
  - **Builds a dependency graph** - Tracks what files import what, transitively
24
+ - **AI Knowledge System** - AI assistants create reusable SKILL.md files that persist across sessions
24
25
  - **Dead code detection** - Finds unused exports and orphan files with confidence scoring
25
26
  - **Test impact analysis** - Shows which tests to run when you change a file
26
27
  - **Blast radius analysis** - Risk scoring and critical path detection for any file change
28
+ - **Knowledge gap detection** - Identifies uncovered technologies and high-risk areas
27
29
  - **Cost tracking** - Monitors token usage and costs for CodeImpact queries
28
30
  - **Detects circular dependencies** - Finds import cycles in your codebase
29
- - **Indexes tests** - Identifies test files and what source files they cover
30
31
  - **Records decisions** - Stores architectural decisions that persist across sessions
31
32
  - **Semantic search** - Find code by meaning using local embeddings
32
33
 
@@ -54,6 +55,85 @@ This registers your project and configures Claude Desktop, Claude Code, OpenCode
54
55
 
55
56
  ---
56
57
 
58
+ ## AI Knowledge System
59
+
60
+ CodeImpact includes a self-improving knowledge system where AI assistants create, maintain, and learn from project-specific skills. Skills are stored as **SKILL.md** files following the [agentskills.io](https://agentskills.io) open standard — compatible with Claude Code, Cursor, Codex, Gemini CLI, and 27+ other AI agents.
61
+
62
+ ### How It Works
63
+
64
+ 1. **Static analysis detects signals** — technologies, high-risk files, patterns
65
+ 2. **AI creates skills after real work** — not templates, real project knowledge
66
+ 3. **Skills persist across sessions** — future AI sessions benefit from past knowledge
67
+ 4. **Progressive disclosure** — only skill names load at startup; full content loads on demand
68
+
69
+ ### Skill Format (agentskills.io SKILL.md)
70
+
71
+ ```markdown
72
+ ---
73
+ name: better-sqlite3-patterns
74
+ description: Synchronous database patterns. Use when working with database queries.
75
+ version: 1.0
76
+ metadata:
77
+ scope: technology
78
+ created_by: ai
79
+ ---
80
+
81
+ # better-sqlite3 Patterns
82
+
83
+ ## When to Use
84
+ When modifying database queries, adding tables, or working with any file
85
+ that imports from src/storage/database.ts.
86
+
87
+ ## Rules
88
+ - ALL database access goes through database.ts — never import better-sqlite3 directly.
89
+ - Use db.prepare().all() for SELECT, db.prepare().run() for INSERT/UPDATE/DELETE.
90
+
91
+ ## Pitfalls
92
+ - db.exec() returns nothing. If you use it for SELECT, you get undefined.
93
+ - better-sqlite3 is synchronous. Do NOT wrap in async/await.
94
+
95
+ ## Verification
96
+ - npx tsc --noEmit passes with no type errors on database code.
97
+ ```
98
+
99
+ ### Knowledge Structure
100
+
101
+ ```
102
+ your-project/
103
+ ├── knowledge/
104
+ │ ├── skills/
105
+ │ │ ├── technology/
106
+ │ │ │ └── better-sqlite3-patterns/
107
+ │ │ │ └── SKILL.md
108
+ │ │ ├── features/
109
+ │ │ │ └── gateway-pattern/
110
+ │ │ │ └── SKILL.md
111
+ │ │ └── risk/
112
+ │ │ └── high-risk-files/
113
+ │ │ └── SKILL.md
114
+ │ ├── docs/
115
+ │ │ ├── architecture/
116
+ │ │ ├── features/
117
+ │ │ └── integrations/
118
+ │ └── index.json
119
+ ├── .codeimpact/
120
+ │ └── codeimpact.db
121
+ └── src/
122
+ ```
123
+
124
+ ### MCP Tools for Knowledge
125
+
126
+ | Tool | What It Does |
127
+ |------|-------------|
128
+ | `memory_status` | Project overview + `knowledge_gaps` showing uncovered technologies |
129
+ | `memory_evolve` | Create/improve skills, report outcomes, list signals |
130
+ | `memory_query` | Semantic search across code and knowledge |
131
+ | `memory_review` | Check code against learned patterns and skill rules |
132
+ | `memory_verify` | Pre-commit quality checks using skill verification rules |
133
+ | `memory_blast_radius` | Impact analysis with skill-aware recommendations |
134
+
135
+ ---
136
+
57
137
  ## Key Features
58
138
 
59
139
  ### Dead Code Detection
@@ -164,6 +244,13 @@ Once CodeImpact is running, your AI assistant can:
164
244
  "What tests cover this function?"
165
245
  ```
166
246
 
247
+ **Build knowledge:**
248
+ ```
249
+ "Check memory_status for knowledge gaps"
250
+ "Create a skill for the authentication patterns I just implemented"
251
+ "What skills exist for the database layer?"
252
+ ```
253
+
167
254
  **Find dead code:**
168
255
  ```
169
256
  "Are there any unused exports in this project?"
@@ -190,12 +277,13 @@ CodeImpact watches your project and maintains:
190
277
 
191
278
  1. **Symbol index** - Functions, classes, imports, exports
192
279
  2. **Dependency graph** - File-to-file import relationships
193
- 3. **Decision log** - Architectural decisions you've recorded
194
- 4. **Embeddings** - For semantic search (using MiniLM-L6 locally)
195
- 5. **Test index** - Test files and their coverage mappings
196
- 6. **Token usage** - Query tracking for cost analysis
280
+ 3. **Knowledge workspace** - AI-created SKILL.md files and documentation
281
+ 4. **Decision log** - Architectural decisions you've recorded
282
+ 5. **Embeddings** - For semantic search (using MiniLM-L6 locally)
283
+ 6. **Test index** - Test files and their coverage mappings
284
+ 7. **Token usage** - Query tracking for cost analysis
197
285
 
198
- When your AI assistant asks a question, CodeImpact provides the relevant context.
286
+ When your AI assistant asks a question, CodeImpact provides the relevant context. When the AI completes work, it captures what it learned as skills for future sessions.
199
287
 
200
288
  ---
201
289
 
@@ -309,11 +397,15 @@ your-project/
309
397
  │ ├── codeimpact.db # SQLite database
310
398
  │ ├── tier1.json # Hot context cache
311
399
  │ └── feature-context.json # Session tracking
400
+ ├── knowledge/
401
+ │ ├── skills/ # AI-created SKILL.md files
402
+ │ ├── docs/ # Generated documentation
403
+ │ └── index.json # Knowledge manifest
312
404
  ├── src/
313
405
  └── ...
314
406
  ```
315
407
 
316
- Each project has its own isolated `.codeimpact/` folder - no cross-contamination between projects.
408
+ Each project has its own isolated `.codeimpact/` folder and `knowledge/` workspace - no cross-contamination between projects.
317
409
 
318
410
  Global registry for project listing:
319
411
  ```
@@ -339,6 +431,7 @@ git clone https://github.com/abhisavakar/codeimpact.git
339
431
  cd codeimpact
340
432
  npm install
341
433
  npm run build
434
+ npm test
342
435
  ```
343
436
 
344
437
  ---