agentic-kdd 2.1.12 → 3.0.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.
Files changed (2) hide show
  1. package/bin/akdd.js +218 -78
  2. package/package.json +8 -3
package/bin/akdd.js CHANGED
@@ -1,113 +1,253 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- const { init } = require('../src/init');
5
- const { update } = require('../src/update');
6
- const { graph } = require('../src/graph');
4
+ const { init } = require('../src/init');
5
+ const { update } = require('../src/update');
6
+ const { graph } = require('../src/graph');
7
7
  const { dashboard } = require('../src/dashboard');
8
- const { analyze } = require('../src/analyze');
9
- const pkg = require('../package.json');
8
+ const { analyze } = require('../src/analyze');
9
+ const pkg = require('../package.json');
10
10
  const path = require('path');
11
+ const fs = require('fs');
11
12
  const { execSync } = require('child_process');
12
13
 
13
- const args = process.argv.slice(2);
14
+ const args = process.argv.slice(2);
14
15
  const command = args[0];
15
- const arg1 = args[1];
16
+ const arg1 = args[1];
17
+ const arg2 = args[2];
16
18
 
17
19
  const HELP = `
18
20
  Agentic KDD v${pkg.version}
19
- Autonomous development pipeline with Knowledge-Driven Development
20
-
21
- Usage:
22
- akdd init Install Agentic KDD in the current project
23
- akdd update Update agents (memory stays intact)
24
- akdd analyze Analyze project code and auto-build knowledge graph
25
- akdd graph Sync memory + show graph stats
26
- akdd sync Sync memory files to SQLite graph
27
- akdd stats Show graph stats and HIGH rules
28
- akdd coala Show CoALA memory stats (procedural + episodic + semantic)
29
- akdd metricas Show agent KPIs (Goal Attainment, Autonomy, etc.)
30
- akdd buscar Hybrid search across all 3 memory layers
31
- akdd impacto Show impact of touching a module/file
32
- akdd semantico Semantic search (needs API key)
33
- akdd decay Apply temporal decay to stale patterns
34
- akdd dashboard Open visual dashboard in browser
35
- akdd --version Show version
36
- akdd --help Show this help
37
-
38
- After init, open the project in Cursor or Claude Code and type:
39
- aa: [your task]
21
+ Autonomous development pipeline one developer, full-department output.
22
+
23
+ Setup:
24
+ akdd init Install Agentic KDD in the current project
25
+ akdd update Update agents + engine (memory stays intact)
26
+ akdd health System health check what's configured, what's missing
27
+ akdd health --fix Auto-fix common issues
28
+
29
+ Memory & Knowledge:
30
+ akdd sync Sync memory files to SQLite graph
31
+ akdd graph Sync + show graph stats
32
+ akdd stats Show graph stats and HIGH rules
33
+ akdd coala Show CoALA memory stats (4 layers)
34
+ akdd buscar Hybrid search across all memory layers
35
+ akdd impacto Semantic impact of a module/entity
36
+ akdd decay Apply temporal decay to stale patterns
37
+ akdd audit Memory audit — stale entries, contradictions, proposals
38
+ akdd forget <id> Forget a memory entry with documented reason
39
+
40
+ AST & Impact Analysis:
41
+ akdd ast Index project AST (symbols, imports, call graph, PageRank)
42
+ akdd ast stats Show AST index stats
43
+ akdd ast symbols <f> Show symbols in a file
44
+ akdd ast-impact <f> Full impact analysis of a file/module
45
+ akdd why <entity> Explain why something exists (causal chain)
46
+
47
+ Specs & Autonomy:
48
+ akdd spec list List all module specs
49
+ akdd spec <module> Show spec status + next wave
50
+ akdd spec create <m> Create feature spec for a module
51
+ akdd spec create <m> --bugfix Create bugfix spec
52
+
53
+ Knowledge Base:
54
+ akdd adr Ingest ADRs from docs/adr/
55
+ akdd knowledge Ingest gotchas/conventions from docs/
56
+
57
+ Metrics & Observability:
58
+ akdd metrics Project KPIs — success rate, rework, autonomy score
59
+ akdd metrics trend Show trend of last 10 cycles
60
+ akdd trail Recent decision trails (what changed and why)
61
+ akdd trail <ciclo_id> Full trail of a specific cycle
62
+ akdd trail why <f> Why does this file/entity exist?
63
+
64
+ Intelligence v2.2:
65
+ akdd git-context Analyze git diff + risk assessment
66
+ akdd predict Predictive risk patterns from episodic memory
67
+ akdd embed-status Local embeddings status
68
+ akdd embed-install Install local embeddings (~23MB, offline)
69
+ akdd jina-install Install jina-v2-code embeddings (~500MB, code-optimized)
70
+ akdd ci-install Install GitHub Actions CI/CD workflow
71
+ akdd ci-status Show last CI/CD reports
72
+
73
+ Dashboard:
74
+ akdd dashboard Open visual dashboard in browser
75
+
76
+ MCP Server (Cursor / Claude Code):
77
+ node .agentic/grafo/mcp-server.cjs
78
+ See: github.com/Adrianlpz211/Agentic-KDD-MCP
79
+
80
+ akdd --version / akdd --help
40
81
  `;
41
82
 
83
+ function findGrafo() {
84
+ const p = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
85
+ if (!fs.existsSync(p)) { console.log('\n grafo.cjs not found. Run: akdd update\n'); process.exit(1); }
86
+ return p;
87
+ }
88
+
42
89
  function runGrafo(cmd, extra) {
43
- const grafo = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
44
- const fs = require('fs');
45
- if (!fs.existsSync(grafo)) {
46
- console.log('\n grafo.cjs not found. Run akdd update first.\n');
47
- process.exit(1);
48
- }
49
- try {
50
- const out = execSync(`node "${grafo}" ${cmd}${extra?' '+extra:''}`, {
51
- stdio: 'inherit', cwd: process.cwd()
52
- });
53
- } catch(e) {
54
- process.exit(1);
55
- }
90
+ const grafo = findGrafo();
91
+ const fullCmd = extra ? `node "${grafo}" ${cmd} ${extra}` : `node "${grafo}" ${cmd}`;
92
+ try { execSync(fullCmd, { stdio: 'inherit', cwd: process.cwd() }); }
93
+ catch(e) { process.exit(e.status || 1); }
94
+ }
95
+
96
+ function runModule(name, cmd, extra) {
97
+ const p = path.join(process.cwd(), '.agentic', 'grafo', name);
98
+ if (!fs.existsSync(p)) { console.log(`\n ${name} not found. Run: akdd update\n`); process.exit(1); }
99
+ const fullCmd = [
100
+ `node "${p}"`,
101
+ cmd || '',
102
+ extra || ''
103
+ ].join(' ').trim().replace(/\s+/g,' ');
104
+ try { execSync(fullCmd, { stdio: 'inherit', cwd: process.cwd() }); }
105
+ catch(e) { process.exit(e.status || 1); }
56
106
  }
57
107
 
58
108
  switch (command) {
59
- case 'init':
60
- init();
109
+
110
+ case 'init': init(); break;
111
+ case 'update': update(); break;
112
+ case 'analyze': analyze(); break;
113
+
114
+ // ── v3.0: Health ────────────────────────────────────────────────────────
115
+ case 'health': {
116
+ const fixFlag = args.includes('--fix') ? '--fix' : '';
117
+ runModule('health-check.cjs', fixFlag);
61
118
  break;
62
- case 'update':
63
- update();
119
+ }
120
+
121
+ // ── Core memory ────────────────────────────────────────────────────────
122
+ case 'sync': runGrafo('sync'); break;
123
+ case 'graph': graph(); break;
124
+ case 'stats': runGrafo('stats'); break;
125
+ case 'coala': runGrafo('coala'); break;
126
+ case 'metricas': runGrafo('metricas'); break;
127
+ case 'decay': runGrafo('decay'); break;
128
+
129
+ case 'buscar':
130
+ if (!arg1) { console.log('\n Uso: akdd buscar "query" [area]\n'); break; }
131
+ runGrafo('buscar', `"${arg1}"${arg2 ? ' ' + arg2 : ''}`);
64
132
  break;
65
- case 'analyze':
66
- case 'analizar':
67
- analyze();
133
+
134
+ case 'impacto':
135
+ if (!arg1) { console.log('\n Uso: akdd impacto "NombreModulo"\n'); break; }
136
+ runGrafo('impacto', `"${arg1}"`);
68
137
  break;
69
- case 'graph':
70
- graph();
138
+
139
+ // ── v3.0: Memory Audit ─────────────────────────────────────────────────
140
+ case 'audit': runModule('memory-audit.cjs', 'report'); break;
141
+
142
+ case 'forget': {
143
+ if (!arg1) { console.log('\n Uso: akdd forget <id> "<razón>"\n'); break; }
144
+ const reason = args.slice(2).join(' ');
145
+ if (!reason) { console.log('\n Uso: akdd forget <id> "<razón>"\n'); break; }
146
+ runModule('memory-audit.cjs', 'forget', `${arg1} "${reason}"`);
71
147
  break;
72
- case 'sync':
73
- runGrafo('sync');
148
+ }
149
+
150
+ // ── v3.0: AST ──────────────────────────────────────────────────────────
151
+ case 'ast': {
152
+ const sub = arg1 || 'index';
153
+ const tgt = arg2 || '';
154
+ if (sub === 'stats') runModule('ast-indexer.cjs', 'stats');
155
+ else if (sub === 'symbols') {
156
+ if (!tgt) { console.log('\n Uso: akdd ast symbols <archivo>\n'); break; }
157
+ runModule('ast-indexer.cjs', 'symbols', `"${tgt}"`);
158
+ } else {
159
+ runModule('ast-indexer.cjs', 'index', tgt);
160
+ }
74
161
  break;
75
- case 'stats':
76
- runGrafo('stats');
162
+ }
163
+
164
+ case 'ast-impact':
165
+ if (!arg1) { console.log('\n Uso: akdd ast-impact <archivo_o_módulo>\n'); break; }
166
+ runModule('impact-analyzer.cjs', 'analyze', `"${arg1}"`);
77
167
  break;
78
- case 'coala':
79
- runGrafo('coala');
168
+
169
+ case 'why':
170
+ if (!arg1) { console.log('\n Uso: akdd why <archivo_o_entidad>\n'); break; }
171
+ runModule('decision-trail.cjs', 'why', `"${arg1}"`);
80
172
  break;
81
- case 'metricas':
82
- runGrafo('metricas');
173
+
174
+ // ── v3.0: Specs ────────────────────────────────────────────────────────
175
+ case 'spec': {
176
+ const sub = arg1;
177
+ const mod = arg2;
178
+ if (!sub || sub === 'list') runModule('spec-manager.cjs', 'list');
179
+ else if (sub === 'create') {
180
+ if (!mod) { console.log('\n Uso: akdd spec create <módulo> [--bugfix]\n'); break; }
181
+ runModule('spec-manager.cjs', 'create', `"${mod}"${args.includes('--bugfix') ? ' --bugfix' : ''}`);
182
+ }
183
+ else if (sub === 'waves') { if (!mod) { console.log('\n Uso: akdd spec waves <módulo>\n'); break; } runModule('spec-manager.cjs', 'waves', `"${mod}"`); }
184
+ else if (sub === 'validate') { if (!mod) { console.log('\n Uso: akdd spec validate <módulo>\n'); break; } runModule('spec-manager.cjs', 'validate', `"${mod}"`); }
185
+ else runModule('spec-manager.cjs', 'status', `"${sub}"`);
83
186
  break;
84
- case 'semantico':
85
- if (!arg1) { console.log('\n Uso: akdd semantico "tu query"\n'); break; }
86
- runGrafo('semantico', `"${arg1}"`);
187
+ }
188
+
189
+ case 'spec-create':
190
+ if (!arg1) { console.log('\n Uso: akdd spec-create <módulo> [--bugfix]\n'); break; }
191
+ runModule('spec-manager.cjs', 'create', `"${arg1}"${args.includes('--bugfix') ? ' --bugfix' : ''}`);
87
192
  break;
88
- case 'buscar':
89
- if (!arg1) { console.log('\n Uso: akdd buscar "query" [area]\n'); break; }
90
- runGrafo('buscar', `"${arg1}"${arg2 ? ' ' + arg2 : ''}`);
193
+
194
+ // ── v3.0: Knowledge ────────────────────────────────────────────────────
195
+ case 'adr':
196
+ runModule('adr-ingestor.cjs', 'ingest', arg1 || 'docs/adr');
91
197
  break;
92
- case 'impacto':
93
- if (!arg1) { console.log('\n Uso: akdd impacto "NombreModulo"\n'); break; }
94
- runGrafo('impacto', `"${arg1}"`);
198
+
199
+ case 'knowledge':
200
+ runModule('knowledge-ingestor.cjs', 'ingest', arg1 || '');
95
201
  break;
96
- case 'decay':
97
- runGrafo('decay');
202
+
203
+ // ── v3.0: Metrics ──────────────────────────────────────────────────────
204
+ case 'metrics':
205
+ runModule('metrics.cjs', arg1 || 'summary');
98
206
  break;
99
- case 'dashboard':
100
- dashboard();
207
+
208
+ // ── v3.0: Decision Trail ───────────────────────────────────────────────
209
+ case 'trail': {
210
+ if (!arg1) runModule('decision-trail.cjs', 'recent', '5');
211
+ else if (arg1 === 'why') { if (!arg2) { console.log('\n Uso: akdd trail why <entidad>\n'); break; } runModule('decision-trail.cjs', 'why', `"${arg2}"`); }
212
+ else if (arg1 === 'timeline'){ if (!arg2) { console.log('\n Uso: akdd trail timeline <módulo>\n'); break; } runModule('decision-trail.cjs', 'timeline', `"${arg2}"`); }
213
+ else runModule('decision-trail.cjs', 'ciclo', `"${arg1}"`);
101
214
  break;
102
- case '--version':
103
- case '-v':
104
- console.log(pkg.version);
215
+ }
216
+
217
+ // ── Dashboard ──────────────────────────────────────────────────────────
218
+ case 'dashboard': dashboard(); break;
219
+
220
+ // ── v2.2: Intelligence ─────────────────────────────────────────────────
221
+ case 'git-context': runGrafo('git-context', args.includes('--install-hook') ? '--install-hook' : ''); break;
222
+ case 'predict': runGrafo('predict'); break;
223
+ case 'embed-status': runGrafo('embed-status'); break;
224
+ case 'embed-install': runGrafo('embed-install'); break;
225
+
226
+ case 'jina-install':
227
+ runModule('embeddings.cjs', 'install-jina');
105
228
  break;
106
- case '--help':
107
- case '-h':
108
- case undefined:
109
- console.log(HELP);
229
+
230
+ case 'ci-install': runGrafo('ci-install'); break;
231
+ case 'ci-status': runGrafo('ci-status'); break;
232
+
233
+ case 'ci-report': {
234
+ const grafo = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
235
+ if (!fs.existsSync(grafo)) { process.exit(0); }
236
+ const esExito = args.includes('--success');
237
+ const outIdx = args.indexOf('--output');
238
+ const outFile = outIdx >= 0 ? args[outIdx + 1] : null;
239
+ const flags = [esExito ? '--success' : '', outFile ? `--output "${outFile}"` : ''].filter(Boolean).join(' ');
240
+ try { execSync(`node "${grafo}" ci-report ${flags}`, { stdio: 'inherit', cwd: process.cwd(), timeout: 60000 }); }
241
+ catch(e) { process.exit(0); }
110
242
  break;
243
+ }
244
+
245
+ case '--version': case '-v':
246
+ console.log(pkg.version); break;
247
+
248
+ case '--help': case '-h': case undefined:
249
+ console.log(HELP); break;
250
+
111
251
  default:
112
252
  console.log(`\n Unknown command: ${command}`);
113
253
  console.log(' Run akdd --help for usage\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentic-kdd",
3
- "version": "2.1.12",
4
- "description": "Autonomous development pipeline with KDD — aa: · ag: · audit: · Visual Dashboard. Works with Cursor and Claude Code.",
3
+ "version": "3.0.1",
4
+ "description": "Autonomous development pipeline — aa: · ag: · audit: · AST graph · Harness · Specs · Impact analysis · Decision trail · Metrics · MCP server. Works with Cursor and Claude Code.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
7
7
  "akdd": "bin/akdd.js"
@@ -21,7 +21,12 @@
21
21
  "knowledge-driven",
22
22
  "agentic",
23
23
  "sqlite",
24
- "dashboard"
24
+ "dashboard",
25
+ "mcp",
26
+ "ast",
27
+ "harness",
28
+ "specs",
29
+ "memory"
25
30
  ],
26
31
  "author": "Adrianlpz211",
27
32
  "license": "MIT",