codeimpact 0.2.0 → 0.3.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.
- package/README.md +129 -50
- package/dist/index.js +5222 -99
- package/dist/index.js.map +4 -4
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
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. It also includes
|
|
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 a **Super Agent System** — a self-improving multi-agent architecture that detects features, generates knowledge artifacts, learns from mistakes, and continuously improves code quality using the [agentskills.io](https://agentskills.io) open standard.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
@@ -21,11 +21,15 @@ 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
|
+
- **Super Agent System** - Self-improving multi-agent architecture with feature detection, research distillation, and outcome-driven learning
|
|
24
25
|
- **AI Knowledge System** - AI assistants create reusable SKILL.md files that persist across sessions
|
|
25
26
|
- **Dead code detection** - Finds unused exports and orphan files with confidence scoring
|
|
26
27
|
- **Test impact analysis** - Shows which tests to run when you change a file
|
|
27
28
|
- **Blast radius analysis** - Risk scoring and critical path detection for any file change
|
|
28
29
|
- **Knowledge gap detection** - Identifies uncovered technologies and high-risk areas
|
|
30
|
+
- **Self-learning loop** - Records outcomes, diagnoses failures, promotes confirmed patterns to rules
|
|
31
|
+
- **Agent lifecycle management** - Proposes merge/split/prune of feature agents based on git history
|
|
32
|
+
- **Research distillation** - Fetches and distills technology documentation with trust scoring
|
|
29
33
|
- **Cost tracking** - Monitors token usage and costs for CodeImpact queries
|
|
30
34
|
- **Detects circular dependencies** - Finds import cycles in your codebase
|
|
31
35
|
- **Records decisions** - Stores architectural decisions that persist across sessions
|
|
@@ -55,16 +59,65 @@ This registers your project and configures Claude Desktop, Claude Code, OpenCode
|
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
58
|
-
##
|
|
62
|
+
## Super Agent System
|
|
59
63
|
|
|
60
|
-
CodeImpact includes a
|
|
64
|
+
CodeImpact includes a production-grade multi-agent system that automatically detects project features, generates knowledge artifacts, learns from mistakes, and continuously improves. The system generates **SKILL.md** and **AGENT.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
65
|
|
|
62
66
|
### How It Works
|
|
63
67
|
|
|
64
|
-
1. **
|
|
65
|
-
2. **
|
|
66
|
-
3. **
|
|
67
|
-
4. **
|
|
68
|
+
1. **Technology detection** — scans lockfiles, manifests, and configs to identify your stack
|
|
69
|
+
2. **Feature detection** — clusters source files into cohesive features using directory structure, import graphs, and CODEOWNERS
|
|
70
|
+
3. **Research distillation** — fetches and distills technology documentation with trust scoring
|
|
71
|
+
4. **Agent generation** — creates feature-scoped agents with scope boundaries, allowed tools, and success criteria
|
|
72
|
+
5. **Self-learning loop** — records outcomes, diagnoses failures using a 15-rule decision table, and promotes confirmed patterns to rules
|
|
73
|
+
6. **Lifecycle management** — proposes merge/split/prune of agents based on git co-change analysis
|
|
74
|
+
|
|
75
|
+
### Self-Learning Pipeline
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Outcome recorded → Diagnose (15-rule decision table)
|
|
79
|
+
→ wrong-assumption + fix → Patch SKILL.md immediately
|
|
80
|
+
→ outdated-research → Flag for re-research
|
|
81
|
+
→ 2+ similar failures → Write lesson to AGENT.md (quarantine)
|
|
82
|
+
→ 3+ confirmations → Promote lesson to SKILL.md Rules
|
|
83
|
+
→ 90 days unconfirmed → Decay lesson
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Agent Workspace Structure
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
your-project/
|
|
90
|
+
├── .code-impact/ # Agent workspace (auto-generated)
|
|
91
|
+
│ ├── config.yaml # Configuration
|
|
92
|
+
│ ├── index.json # Manifest with tech, features, outcomes
|
|
93
|
+
│ ├── project/ # Project-wide knowledge
|
|
94
|
+
│ │ ├── SKILL.md # Technology stack + conventions
|
|
95
|
+
│ │ ├── CONVENTIONS.md # Coding standards
|
|
96
|
+
│ │ ├── ARCHITECTURE.md # System architecture
|
|
97
|
+
│ │ └── AGENT.md # Super agent (coordinator)
|
|
98
|
+
│ ├── research/ # Distilled tech documentation
|
|
99
|
+
│ │ └── express@4.21.0.md # With trust scores + structured sections
|
|
100
|
+
│ └── features/ # Feature-specific knowledge
|
|
101
|
+
│ └── auth/
|
|
102
|
+
│ ├── SKILL.md # Feature rules, pitfalls, research refs
|
|
103
|
+
│ └── AGENT.md # Scope, tools, lessons learned
|
|
104
|
+
├── AGENTS.md # Top-level agent directory (auto-generated)
|
|
105
|
+
├── knowledge/ # Legacy knowledge workspace
|
|
106
|
+
│ └── skills/ # AI-created SKILL.md files
|
|
107
|
+
├── .codeimpact/
|
|
108
|
+
│ └── codeimpact.db # SQLite database
|
|
109
|
+
└── src/
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### CLI Commands for Agents
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
codeimpact agents init # Initialize agent workspace
|
|
116
|
+
codeimpact agents generate # Run full pipeline (detect → research → generate)
|
|
117
|
+
codeimpact agents status # Show agent system health + lifecycle proposals
|
|
118
|
+
codeimpact agents research # Refresh technology research
|
|
119
|
+
codeimpact agents migrate # Migrate knowledge/ → .code-impact/
|
|
120
|
+
```
|
|
68
121
|
|
|
69
122
|
### Skill Format (agentskills.io SKILL.md)
|
|
70
123
|
|
|
@@ -96,40 +149,17 @@ that imports from src/storage/database.ts.
|
|
|
96
149
|
- npx tsc --noEmit passes with no type errors on database code.
|
|
97
150
|
```
|
|
98
151
|
|
|
99
|
-
###
|
|
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
|
|
152
|
+
### MCP Tools
|
|
125
153
|
|
|
126
154
|
| Tool | What It Does |
|
|
127
155
|
|------|-------------|
|
|
128
|
-
| `memory_status` | Project overview +
|
|
156
|
+
| `memory_status` | Project overview + knowledge gaps + lifecycle proposals |
|
|
157
|
+
| `memory_agents` | List/get agents, skills, research; validate scope; record outcomes; telemetry dashboard |
|
|
129
158
|
| `memory_evolve` | Create/improve skills, report outcomes, list signals |
|
|
130
159
|
| `memory_query` | Semantic search across code and knowledge |
|
|
131
160
|
| `memory_review` | Check code against learned patterns and skill rules |
|
|
132
161
|
| `memory_verify` | Pre-commit quality checks using skill verification rules |
|
|
162
|
+
| `memory_ghost` | Proactive intelligence — conflict detection, deja vu, session resurrection |
|
|
133
163
|
| `memory_blast_radius` | Impact analysis with skill-aware recommendations |
|
|
134
164
|
|
|
135
165
|
---
|
|
@@ -251,6 +281,14 @@ Once CodeImpact is running, your AI assistant can:
|
|
|
251
281
|
"What skills exist for the database layer?"
|
|
252
282
|
```
|
|
253
283
|
|
|
284
|
+
**Agent system:**
|
|
285
|
+
```
|
|
286
|
+
"List all agents and their scopes"
|
|
287
|
+
"Validate if auth-agent can modify src/billing/pay.ts"
|
|
288
|
+
"Show the telemetry dashboard for this week"
|
|
289
|
+
"What lifecycle proposals exist?"
|
|
290
|
+
```
|
|
291
|
+
|
|
254
292
|
**Find dead code:**
|
|
255
293
|
```
|
|
256
294
|
"Are there any unused exports in this project?"
|
|
@@ -275,15 +313,18 @@ Once CodeImpact is running, your AI assistant can:
|
|
|
275
313
|
|
|
276
314
|
CodeImpact watches your project and maintains:
|
|
277
315
|
|
|
278
|
-
1. **Symbol index** - Functions, classes, imports, exports
|
|
279
|
-
2. **Dependency graph** - File-to-file import relationships
|
|
280
|
-
3. **
|
|
281
|
-
4. **
|
|
282
|
-
5. **
|
|
283
|
-
6. **
|
|
284
|
-
7. **
|
|
316
|
+
1. **Symbol index** - Functions, classes, imports, exports via Tree-sitter AST
|
|
317
|
+
2. **Dependency graph** - File-to-file import relationships (transitive)
|
|
318
|
+
3. **Agent workspace** - Auto-generated SKILL.md, AGENT.md, and research files
|
|
319
|
+
4. **Self-learning loop** - Outcome recording, diagnosis, lesson writing, and promotion
|
|
320
|
+
5. **Research cache** - Distilled technology docs with trust scoring and staleness tracking
|
|
321
|
+
6. **Decision log** - Architectural decisions that persist across sessions
|
|
322
|
+
7. **Embeddings** - Semantic search using MiniLM-L6 locally
|
|
323
|
+
8. **Telemetry** - Generation, learning, and research event tracking (local SQLite)
|
|
324
|
+
9. **Lifecycle proposals** - Merge/split/prune suggestions from git co-change analysis
|
|
325
|
+
10. **Token usage** - Query tracking for cost analysis
|
|
285
326
|
|
|
286
|
-
When your AI assistant asks a question, CodeImpact provides the relevant context. When the AI completes work,
|
|
327
|
+
When your AI assistant asks a question, CodeImpact provides the relevant context. When the AI completes work, the self-learning loop captures what happened — successes confirm existing knowledge, failures trigger diagnosis and improvement.
|
|
287
328
|
|
|
288
329
|
---
|
|
289
330
|
|
|
@@ -313,6 +354,14 @@ codeimpact deadcode # Find unused exports and dead code
|
|
|
313
354
|
codeimpact test-impact # Find which tests to run for changes
|
|
314
355
|
codeimpact impact <file> # Analyze blast radius of a file
|
|
315
356
|
codeimpact stats # Show token usage and costs
|
|
357
|
+
codeimpact reindex # Force reindex after git operations
|
|
358
|
+
|
|
359
|
+
# Agent System
|
|
360
|
+
codeimpact agents init # Initialize agent workspace
|
|
361
|
+
codeimpact agents generate # Detect → research → generate → learn
|
|
362
|
+
codeimpact agents status # Health, outcomes, lifecycle proposals
|
|
363
|
+
codeimpact agents research # Refresh technology research
|
|
364
|
+
codeimpact agents migrate # Migrate knowledge/ → .code-impact/
|
|
316
365
|
|
|
317
366
|
# Project Management
|
|
318
367
|
codeimpact projects list # List registered projects
|
|
@@ -394,18 +443,24 @@ Project data is stored locally in each project:
|
|
|
394
443
|
```
|
|
395
444
|
your-project/
|
|
396
445
|
├── .codeimpact/
|
|
397
|
-
│ ├── codeimpact.db
|
|
398
|
-
│ ├── tier1.json
|
|
446
|
+
│ ├── codeimpact.db # SQLite database (index, outcomes, telemetry)
|
|
447
|
+
│ ├── tier1.json # Hot context cache
|
|
399
448
|
│ └── feature-context.json # Session tracking
|
|
400
|
-
├──
|
|
401
|
-
│ ├──
|
|
402
|
-
│ ├──
|
|
403
|
-
│
|
|
449
|
+
├── .code-impact/ # Agent workspace (auto-generated)
|
|
450
|
+
│ ├── config.yaml # Agent system configuration
|
|
451
|
+
│ ├── index.json # Technologies, features, outcomes, lifecycle
|
|
452
|
+
│ ├── project/ # Project-wide SKILL/CONVENTIONS/ARCHITECTURE/AGENT
|
|
453
|
+
│ ├── research/ # Distilled tech docs with trust scores
|
|
454
|
+
│ └── features/ # Per-feature SKILL + AGENT files
|
|
455
|
+
├── knowledge/ # Legacy knowledge workspace
|
|
456
|
+
│ ├── skills/ # AI-created SKILL.md files
|
|
457
|
+
│ ├── docs/ # Generated documentation
|
|
458
|
+
│ └── index.json # Knowledge manifest
|
|
404
459
|
├── src/
|
|
405
460
|
└── ...
|
|
406
461
|
```
|
|
407
462
|
|
|
408
|
-
Each project has its own isolated `.
|
|
463
|
+
Each project has its own isolated data — no cross-contamination between projects. The `.code-impact/` agent workspace is the primary knowledge store; `knowledge/` is supported for backward compatibility and can be migrated via `codeimpact agents migrate`.
|
|
409
464
|
|
|
410
465
|
Global registry for project listing:
|
|
411
466
|
```
|
|
@@ -431,7 +486,31 @@ git clone https://github.com/abhisavakar/codeimpact.git
|
|
|
431
486
|
cd codeimpact
|
|
432
487
|
npm install
|
|
433
488
|
npm run build
|
|
434
|
-
npm test
|
|
489
|
+
npm test # 120+ tests including 10 eval scenarios
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Architecture
|
|
493
|
+
|
|
494
|
+
```
|
|
495
|
+
src/core/agents/ # Super Agent System (12 modules)
|
|
496
|
+
├── orchestrator.ts # Pipeline: init → detect → research → generate → learn
|
|
497
|
+
├── tech-detector.ts # Lockfile + manifest scanning
|
|
498
|
+
├── feature-detector.ts # Cohesion clustering + CODEOWNERS
|
|
499
|
+
├── research-engine.ts # Fetch + distill + trust scoring
|
|
500
|
+
├── generator.ts # SKILL.md / CONVENTIONS.md / ARCHITECTURE.md
|
|
501
|
+
├── agent-generator.ts # AGENT.md + AGENTS.md shim
|
|
502
|
+
├── improvement-engine.ts # Self-learning: diagnose → learn → promote → decay
|
|
503
|
+
├── diagnosis-table.ts # 15-rule declarative error classification
|
|
504
|
+
├── outcome-storage.ts # SQLite agent_outcomes table
|
|
505
|
+
├── lifecycle.ts # Merge/split/prune proposals
|
|
506
|
+
├── telemetry.ts # Event emission + dashboard queries
|
|
507
|
+
├── marker-writer.ts # Content-hash dedup + token budgets
|
|
508
|
+
├── token-budget.ts # Section-priority truncation
|
|
509
|
+
├── migration.ts # knowledge/ → .code-impact/ migration
|
|
510
|
+
├── research-trust.ts # 7-signal trust scoring
|
|
511
|
+
├── remote-provider.ts # GitHub/GitLab/Bitbucket abstraction
|
|
512
|
+
├── co-change-analyzer.ts # Git log analysis for feature coupling
|
|
513
|
+
└── workspace.ts # Directory management + config
|
|
435
514
|
```
|
|
436
515
|
|
|
437
516
|
---
|