ai-dev-analytics 1.0.0-beta.11

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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +422 -0
  3. package/README.zh-CN.md +422 -0
  4. package/dist/cli/commands/dashboard.d.ts +2 -0
  5. package/dist/cli/commands/dashboard.d.ts.map +1 -0
  6. package/dist/cli/commands/dashboard.js +70 -0
  7. package/dist/cli/commands/dashboard.js.map +1 -0
  8. package/dist/cli/commands/init.d.ts +2 -0
  9. package/dist/cli/commands/init.d.ts.map +1 -0
  10. package/dist/cli/commands/init.js +367 -0
  11. package/dist/cli/commands/init.js.map +1 -0
  12. package/dist/cli/commands/log.d.ts +2 -0
  13. package/dist/cli/commands/log.d.ts.map +1 -0
  14. package/dist/cli/commands/log.js +438 -0
  15. package/dist/cli/commands/log.js.map +1 -0
  16. package/dist/cli/commands/migrate.d.ts +2 -0
  17. package/dist/cli/commands/migrate.d.ts.map +1 -0
  18. package/dist/cli/commands/migrate.js +300 -0
  19. package/dist/cli/commands/migrate.js.map +1 -0
  20. package/dist/cli/commands/reindex.d.ts +10 -0
  21. package/dist/cli/commands/reindex.d.ts.map +1 -0
  22. package/dist/cli/commands/reindex.js +94 -0
  23. package/dist/cli/commands/reindex.js.map +1 -0
  24. package/dist/cli/commands/report.d.ts +2 -0
  25. package/dist/cli/commands/report.d.ts.map +1 -0
  26. package/dist/cli/commands/report.js +219 -0
  27. package/dist/cli/commands/report.js.map +1 -0
  28. package/dist/cli/commands/rules.d.ts +2 -0
  29. package/dist/cli/commands/rules.d.ts.map +1 -0
  30. package/dist/cli/commands/rules.js +143 -0
  31. package/dist/cli/commands/rules.js.map +1 -0
  32. package/dist/cli/commands/start.d.ts +2 -0
  33. package/dist/cli/commands/start.d.ts.map +1 -0
  34. package/dist/cli/commands/start.js +173 -0
  35. package/dist/cli/commands/start.js.map +1 -0
  36. package/dist/cli/commands/status.d.ts +2 -0
  37. package/dist/cli/commands/status.d.ts.map +1 -0
  38. package/dist/cli/commands/status.js +74 -0
  39. package/dist/cli/commands/status.js.map +1 -0
  40. package/dist/cli/commands/update.d.ts +2 -0
  41. package/dist/cli/commands/update.d.ts.map +1 -0
  42. package/dist/cli/commands/update.js +146 -0
  43. package/dist/cli/commands/update.js.map +1 -0
  44. package/dist/cli/index.d.ts +3 -0
  45. package/dist/cli/index.d.ts.map +1 -0
  46. package/dist/cli/index.js +85 -0
  47. package/dist/cli/index.js.map +1 -0
  48. package/dist/mcp/server.d.ts +10 -0
  49. package/dist/mcp/server.d.ts.map +1 -0
  50. package/dist/mcp/server.js +704 -0
  51. package/dist/mcp/server.js.map +1 -0
  52. package/dist/schemas/run-json.d.ts +258 -0
  53. package/dist/schemas/run-json.d.ts.map +1 -0
  54. package/dist/schemas/run-json.js +22 -0
  55. package/dist/schemas/run-json.js.map +1 -0
  56. package/dist/server/api.d.ts +30 -0
  57. package/dist/server/api.d.ts.map +1 -0
  58. package/dist/server/api.js +239 -0
  59. package/dist/server/api.js.map +1 -0
  60. package/dist/server/index.d.ts +2 -0
  61. package/dist/server/index.d.ts.map +1 -0
  62. package/dist/server/index.js +228 -0
  63. package/dist/server/index.js.map +1 -0
  64. package/dist/utils/display.d.ts +12 -0
  65. package/dist/utils/display.d.ts.map +1 -0
  66. package/dist/utils/display.js +52 -0
  67. package/dist/utils/display.js.map +1 -0
  68. package/dist/utils/fs.d.ts +9 -0
  69. package/dist/utils/fs.d.ts.map +1 -0
  70. package/dist/utils/fs.js +43 -0
  71. package/dist/utils/fs.js.map +1 -0
  72. package/dist/utils/git.d.ts +4 -0
  73. package/dist/utils/git.d.ts.map +1 -0
  74. package/dist/utils/git.js +18 -0
  75. package/dist/utils/git.js.map +1 -0
  76. package/dist/utils/guide.d.ts +18 -0
  77. package/dist/utils/guide.d.ts.map +1 -0
  78. package/dist/utils/guide.js +172 -0
  79. package/dist/utils/guide.js.map +1 -0
  80. package/dist/utils/paths.d.ts +25 -0
  81. package/dist/utils/paths.d.ts.map +1 -0
  82. package/dist/utils/paths.js +45 -0
  83. package/dist/utils/paths.js.map +1 -0
  84. package/dist/utils/rules.d.ts +44 -0
  85. package/dist/utils/rules.d.ts.map +1 -0
  86. package/dist/utils/rules.js +208 -0
  87. package/dist/utils/rules.js.map +1 -0
  88. package/dist/utils/run-data.d.ts +37 -0
  89. package/dist/utils/run-data.d.ts.map +1 -0
  90. package/dist/utils/run-data.js +389 -0
  91. package/dist/utils/run-data.js.map +1 -0
  92. package/dist/utils/tokens.d.ts +26 -0
  93. package/dist/utils/tokens.d.ts.map +1 -0
  94. package/dist/utils/tokens.js +173 -0
  95. package/dist/utils/tokens.js.map +1 -0
  96. package/package.json +49 -0
  97. package/src/assets/skills/audit.md +98 -0
  98. package/src/assets/skills/bug-fixer.md +48 -0
  99. package/src/assets/skills/code-generator.md +82 -0
  100. package/src/assets/skills/commit-code.md +67 -0
  101. package/src/assets/skills/dashboard-generator.md +65 -0
  102. package/src/assets/skills/dev-flower.md +85 -0
  103. package/src/assets/skills/deviation-recorder.md +82 -0
  104. package/src/assets/skills/docx-to-markdown.md +69 -0
  105. package/src/assets/skills/mcp-reviewer.md +43 -0
  106. package/src/assets/skills/requirement-analyzer.md +103 -0
  107. package/src/assets/skills/rules-evolver.md +47 -0
  108. package/src/assets/skills/self-reviewer.md +53 -0
  109. package/src/assets/skills/task-splitter.md +58 -0
  110. package/src/assets/skills/workflow-orchestrator.md +209 -0
  111. package/src/assets/templates/demo-run.json +910 -0
  112. package/src/assets/templates/run.json +63 -0
  113. package/src/dashboard/assets/index-C-E7m3g4.css +1 -0
  114. package/src/dashboard/assets/index-CsU3dyCj.js +111 -0
  115. package/src/dashboard/demo/overview.json +71 -0
  116. package/src/dashboard/demo/run.json +2667 -0
  117. package/src/dashboard/demo/runs.json +19 -0
  118. package/src/dashboard/index.html +13 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wen Tao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,422 @@
1
+ <div align="center">
2
+
3
+ # AIDA
4
+
5
+ ### Make Vibe Coding Measurable.
6
+
7
+ Every vibe coding session generates massive insights — deviations, patterns, quality signals.<br>
8
+ *But you close the terminal, and all of it vanishes. Next session, you start blind again.*<br>
9
+ **AIDA captures structured data at every development checkpoint, visualizes it in a live dashboard, and distills deviation patterns into rules that make your AI write better code — every single run.**
10
+
11
+ One line to integrate. Zero workflow changes.
12
+
13
+ ```json
14
+ { "mcpServers": { "aida": { "command": "npx", "args": ["-y", "ai-dev-analytics", "mcp"] } } }
15
+ ```
16
+
17
+ [![npm version](https://img.shields.io/npm/v/ai-dev-analytics?color=%230066ff&label=npm)](https://www.npmjs.com/package/ai-dev-analytics)
18
+ [![license](https://img.shields.io/github/license/LWTlong/ai-dev-analytics?color=%23333)](./LICENSE)
19
+ [![node](https://img.shields.io/node/v/ai-dev-analytics?color=%23339933)](https://nodejs.org)
20
+ [![tests](https://img.shields.io/badge/tests-82%20passed-brightgreen)](#testing)
21
+ [![Live Demo](https://img.shields.io/badge/Live%20Demo-Interactive%20Dashboard-FF4B4B?style=for-the-badge&logo=react)](https://lwtlong.github.io/ai-dev-analytics/)
22
+
23
+ [One-Line Setup](#-30-second-setup) · [Data-Driven Loop](#-the-data-driven-loop) · [Dashboard](#-the-dashboard) · [SOP Workflow](#-standardized-ai-development-workflow) · [Data for Reports](#-data-sedimentation--performance-reports) · [中文文档](./README.zh-CN.md)
24
+
25
+ </div>
26
+
27
+ ---
28
+
29
+ ## The Insight
30
+
31
+ Vibe coding is powerful. But it's a black box.
32
+
33
+ You tell Claude to build a feature. It writes code. You ship it. But you have **zero visibility** into what actually happened:
34
+
35
+ - How many tasks did AI complete? How long did each take?
36
+ - Where did AI deviate from your project conventions? Why?
37
+ - Which deviations keep recurring? What rules would prevent them?
38
+ - What's the bug rate? Which phases produce the most bugs?
39
+
40
+ Without data, you can't improve. You're just vibing — over and over, with the same blind spots.
41
+
42
+ **AIDA makes the invisible visible.** It collects structured data from every vibe coding session, renders it in a real-time dashboard, and turns deviation patterns into project rules. Your AI doesn't just code — it **learns your project**.
43
+
44
+ ---
45
+
46
+ ## 🔄 The Data-Driven Loop
47
+
48
+ This is the core of AIDA — **data in, rules out, better code next time.**
49
+
50
+ ```
51
+ Vibe Coding Session
52
+
53
+ AIDA silently collects structured data
54
+ (tasks, deviations, bugs, reviews, files, timeline)
55
+
56
+ Dashboard visualizes patterns
57
+ "9 deviations → 56% hallucination, 44% rule-missing"
58
+
59
+ Deviation patterns identified → AI suggests rules → user confirms → sedimented
60
+ .aidevos/rules/ ← your AI's growing knowledge base
61
+
62
+ AI reads rules next session → same mistakes eliminated
63
+
64
+ Repeat — each cycle, AI output gets closer to your expectations
65
+ ```
66
+
67
+ **Real data from a production project:**
68
+
69
+ | Run | Deviations | What happened | Rules sedimented |
70
+ |-----|-----------|---------------|-----------------|
71
+ | #1 | 23 deviations across 47 tasks | AI misused components, wrong layouts, incorrect API patterns | 6 project-specific rules |
72
+ | #2 | **0 repeat deviations** | AI read the rules. Same patterns — zero errors. | — |
73
+
74
+ **Step 1: See *why* AI deviates** — Root cause breakdown reveals whether issues stem from hallucination, missing rules, or insufficient context.
75
+
76
+ <div align="center">
77
+ <img src="./docs/deviation-root-cause.png" alt="Deviation Root Cause" width="700" />
78
+ </div>
79
+
80
+ **Step 2: See *where* AI deviates** — Category distribution pinpoints the exact areas: UI spacing, layout, component usage, API patterns.
81
+
82
+ <div align="center">
83
+ <img src="./docs/deviation-category.png" alt="Deviation Category Distribution" width="700" />
84
+ </div>
85
+
86
+ **Step 3: Watch rules compound** — As rules accumulate (green line), the same deviation patterns stop recurring.
87
+
88
+ <div align="center">
89
+ <img src="./docs/deviation-rule-trend.png" alt="Deviation & Rule Trend" width="700" />
90
+ </div>
91
+
92
+ The `.aidevos/rules/` directory is your **project-specific AI knowledge base**. It grows with every run. The more you use AI, the smarter it gets at *your* project.
93
+
94
+ ---
95
+
96
+ ## 📊 The Dashboard
97
+
98
+ **Your entire vibe coding process — structured, visualized, actionable.**
99
+
100
+ <div align="center">
101
+ <a href="./docs/dashboard.png">
102
+ <img src="./docs/dashboard.png" alt="Dashboard" width="800" />
103
+ </a>
104
+ </div>
105
+
106
+ > **[Live Demo →](https://lwtlong.github.io/ai-dev-analytics/)** Real anonymized project data. No install needed.
107
+
108
+ AIDA captures every dimension of AI-assisted development and turns it into interactive charts:
109
+
110
+ | What you see | Why it matters |
111
+ |---|---|
112
+ | **Deviation root cause breakdown** | Know *why* AI fails — rule-missing? hallucination? context gap? |
113
+ | **Deviation category distribution** | Know *where* AI fails — layout? components? API? |
114
+ | **Deviation & rule trend over time** | Watch deviations drop as rules accumulate |
115
+ | **Bug severity distribution** | Track quality — which phases produce critical bugs? |
116
+ | **Self-review pass rate trend** | Is AI code getting better or worse over time? |
117
+ | **Task completion by phase** | See progress across the full development lifecycle |
118
+ | **File modification hotspots** | Which files keep getting changed? Where are the pain points? |
119
+ | **Rules table with source mapping** | Every rule links back to the deviation that created it |
120
+ | **Full development timeline** | Every task, bug, review, deviation — chronologically |
121
+ | **Project overview (team view)** | Cross-branch stats, developer comparison, requirement status |
122
+
123
+ Every KPI card is clickable — drill down into task details, deviation root causes, review reports, and file changes.
124
+
125
+ Run `npx ai-dev-analytics dashboard` to see **your own project's data** in seconds.
126
+
127
+ ### 🔒 100% Local. Zero External Requests.
128
+
129
+ AIDA writes JSON files to `.aidevos/` in your project directory. **The codebase contains zero HTTP calls to external services** — no telemetry, no cloud sync, no analytics, no tracking. Zero runtime dependencies. Your code and data never leave your machine. Period.
130
+
131
+ ---
132
+
133
+ ## ⚡ 30-Second Setup
134
+
135
+ ### One line in `.mcp.json` — that's the entire integration.
136
+
137
+ ```json
138
+ { "mcpServers": { "aida": { "command": "npx", "args": ["-y", "ai-dev-analytics", "mcp"] } } }
139
+ ```
140
+
141
+ No SDK. No wrapper. No code changes. Add this to your project root `.mcp.json`, and AIDA starts collecting data the next time your AI writes code. It works silently — zero workflow changes.
142
+
143
+ > *Tip: For faster startup, run `npm install -g ai-dev-analytics` and change the command to `"aida"`.*
144
+
145
+ <details>
146
+ <summary>Cursor / VS Code Copilot / Windsurf</summary>
147
+
148
+ **Cursor** `.cursor/mcp.json`:
149
+ ```json
150
+ {
151
+ "mcpServers": {
152
+ "aida": {
153
+ "command": "npx",
154
+ "args": ["-y", "ai-dev-analytics", "mcp"]
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ **VS Code Copilot** `.vscode/mcp.json`:
161
+ ```json
162
+ {
163
+ "servers": {
164
+ "aida": {
165
+ "command": "npx",
166
+ "args": ["-y", "ai-dev-analytics", "mcp"]
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ **Windsurf** `~/.codeium/windsurf/mcp_config.json`:
173
+ ```json
174
+ {
175
+ "mcpServers": {
176
+ "aida": {
177
+ "command": "npx",
178
+ "args": ["-y", "ai-dev-analytics", "mcp"]
179
+ }
180
+ }
181
+ }
182
+ ```
183
+ </details>
184
+
185
+ ### See your data
186
+
187
+ ```bash
188
+ npx ai-dev-analytics dashboard
189
+ ```
190
+
191
+ Open `http://localhost:2375` — real-time updates via SSE, Chinese/English toggle built in.
192
+
193
+ ---
194
+
195
+ ## 🤔 Why Data Changes Everything
196
+
197
+ **Without data, every vibe coding session starts from zero. With data, each one builds on the last.**
198
+
199
+ | Vibing blind | Vibing with data |
200
+ |---|---|
201
+ | "AI keeps getting layouts wrong" | Dashboard shows: 9 layout deviations, root cause 56% hallucination + 44% rule-missing. 4 rules sedimented → zero repeats next run |
202
+ | "I corrected this three times already" | AIDA recorded the deviation pattern. AI detected `rule-missing`, suggested a rule, you confirmed — AI reads it every session, you never correct it again |
203
+ | "That feature had a lot of bugs" | 5 bugs, 3 critical — all concentrated in one phase. Now you know where to add guardrails |
204
+ | "What did I even do this quarter?" | 47 tasks, 23 deviations fixed, 6 rules sedimented, 4064 lines. Export → H1 performance review done |
205
+
206
+ **Vibe coding without data is just vibing. Add data, and it becomes a compounding system.**
207
+
208
+ ---
209
+
210
+ ## 🎯 Use Cases
211
+
212
+ **Vibe Coder — "I want my AI to actually learn my project"**
213
+ > You've been using Claude Code for a week. AIDA's dashboard shows: 23 deviations, concentrated in `component-usage` and `layout` categories, root cause mostly `rule-missing`. AI detects the patterns and suggests rules — you confirm, 6 project rules sedimented. Next week, those categories show zero deviations. Your AI now knows your project conventions.
214
+
215
+ **Tech Lead — "I need to see what AI is actually doing across the team"**
216
+ > Team of 4 uses Claude Code daily. Open the project overview: Developer A has 2 deviations + 5 sedimented rules (AI is learning). Developer B has 15 deviations + 0 rules (AI is not learning). The data tells you exactly where to intervene.
217
+
218
+ **Senior Engineer — "Show me the data for my performance review"**
219
+ > End of H1. Open the dashboard: 150 tasks across 3 features, 89% first-pass review rate, 12 rules sedimented that now benefit the entire team. All structured data — export it, attach it to your review doc. Data beats "I think I did a lot."
220
+
221
+ **Team adopting vibe coding — "How do we go from chaotic to systematic?"**
222
+ > Start collecting data. After 2 weeks, the dashboard shows clear patterns: which types of tasks AI handles well, where it consistently deviates, what rules are needed. You go from "AI sometimes works" to "AI works predictably because we've taught it our conventions."
223
+
224
+ ---
225
+
226
+ ## 📁 Data Sedimentation & Performance Reports
227
+
228
+ AIDA doesn't just visualize — it **sediments**. Every run accumulates structured data that compounds over time.
229
+
230
+ ```
231
+ Week 1: 47 tasks, 23 deviations, 5 bugs, 6 rules, 4064 lines
232
+ Week 4: 180+ tasks, deviation rate dropping, 15 rules, full quality history
233
+ Quarter: Complete development record — exportable, analyzable, presentable
234
+ ```
235
+
236
+ **What you can do with sedimented data:**
237
+
238
+ | Scenario | What you get |
239
+ |----------|-------------|
240
+ | **H1 / H2 Performance Review** | Tasks completed, quality metrics (pass rate, bug rate), code volume, rules contributed — all with numbers, not feelings |
241
+ | **Annual Summary** | Cross-project trends, deviation patterns over time, rule growth curve, total output |
242
+ | **Sprint Retrospective** | What went wrong, what rules were added, which phases improved, measurable quality delta |
243
+ | **Team Leader Report** | Per-developer stats, deviation hotspots, which modules need better rules, team-wide AI maturity |
244
+ | **Project Handover** | Full development history — someone new can see exactly what happened, what rules exist, and why |
245
+
246
+ All data is structured JSON in `.aidevos/`. No vendor lock-in. Export it, query it, pipe it into any reporting tool. Run `aida report` to generate a summary at any time.
247
+
248
+ ---
249
+
250
+ ## ⚙️ How It Works
251
+
252
+ ```mermaid
253
+ flowchart LR
254
+ A["Your AI Tool\nClaude Code / Cursor"] -->|Vibe Coding| B{"AIDA MCP Server\n10 Tools"}
255
+ B -->|Silent Data Collection| C[".aidevos/run.json"]
256
+ C -->|Visualization| D["Dashboard\nlocalhost:2375"]
257
+ C -->|Pattern Analysis| E[".aidevos/rules/"]
258
+ E -->|AI Reads Rules| A
259
+ ```
260
+
261
+ Your AI tool calls AIDA's MCP tools automatically as it works. You don't invoke them manually. No prompts to write, no scripts to run — just vibe code as usual.
262
+
263
+ <details>
264
+ <summary>📋 10 MCP Tools (auto-collected)</summary>
265
+
266
+ | Tool | What it captures |
267
+ |------|-----------------|
268
+ | `aida_task_start` | Task begins — ID, title, stage, PRD phase |
269
+ | `aida_task_done` | Task completed — duration auto-calculated |
270
+ | `aida_log_bug` | Bug found — severity, title, related files |
271
+ | `aida_bug_fix` | Bug fixed — links fix to original bug |
272
+ | `aida_log_review` | Code self-review — pass/fail, issue list |
273
+ | `aida_log_deviation` | AI output ≠ expectation — root cause, category |
274
+ | `aida_log_files` | File changes — auto-scans `git diff`, zero args needed |
275
+ | `aida_highlight` | Notable achievement worth recording |
276
+ | `aida_status` | Current run status snapshot |
277
+ | `aida_log_rule` | Sediment project rule — user confirms, then AI calls this tool |
278
+
279
+ </details>
280
+
281
+ ### Data Model
282
+
283
+ All data is local JSON. No database, no cloud.
284
+
285
+ | Level | File | What it contains |
286
+ |-------|------|-----------------|
287
+ | **Run** | `.aidevos/runs/{branch}/{dev}/run.json` | Every task, bug, deviation, review, file change |
288
+ | **Branch** | `.aidevos/runs/{branch}/requirement.json` | Aggregated stats per requirement |
289
+ | **Project** | `.aidevos/index.json` | Cross-branch overview for team leads |
290
+ | **Rules** | `.aidevos/rules/` | Sedimented project rules — your AI's growing knowledge base |
291
+
292
+ All structured JSON — ready for export, analysis, or feeding into reports.
293
+
294
+ ---
295
+
296
+ ## 🚀 Standardized AI Development Workflow
297
+
298
+ Beyond data collection, AIDA provides a **complete SOP for AI-assisted development** — a standardized workflow that turns chaotic vibe coding into a repeatable, measurable process.
299
+
300
+ ```bash
301
+ aida init # Select "Full workflow"
302
+ aida start # Create a development run
303
+ ```
304
+
305
+ This enables **14 AI Skills** orchestrated as a full development pipeline:
306
+
307
+ ```
308
+ PRD Ingestion → Requirement Analysis → Task Decomposition
309
+
310
+ Code Generation → Self-Review → Bug Fix → Deviation Fix
311
+
312
+ Data Collection → Pattern Analysis → Rule Sedimentation
313
+
314
+ Next Run: AI reads rules → better output → fewer deviations
315
+ ```
316
+
317
+ | Phase | What AI does | What AIDA records |
318
+ |-------|-------------|-------------------|
319
+ | **Requirement** | Parses PRD, extracts modules and phases | PRD phases, scope |
320
+ | **Task Split** | Breaks requirements into atomic tasks | Task list, stages, estimates |
321
+ | **Code Gen** | Generates code per task | Files changed, lines added, duration |
322
+ | **Self-Review** | Reviews its own output against conventions | Pass/fail, issue list, quality score |
323
+ | **Bug Fix** | Fixes bugs found during review | Bug severity, fix details, related files |
324
+ | **Deviation Fix** | Corrects output that doesn't match expectations | Root cause, category, new rule (when root cause is rule-missing) |
325
+
326
+ Every step produces structured data. Every deviation can become a rule. The SOP ensures nothing falls through the cracks — and the data makes the whole process visible and improvable.
327
+
328
+ ---
329
+
330
+ <details>
331
+ <summary>🖥 CLI Reference</summary>
332
+
333
+ ```bash
334
+ aida init # Interactive project setup
335
+ aida start # Create a new development run
336
+ aida status # Show current run status
337
+ aida dashboard # Launch dashboard (default port 2375)
338
+ aida dashboard --port 3000 # Custom port
339
+ aida mcp # Start MCP server (for AI tool config)
340
+ aida log <subcommand> # Write structured data (task, bug, review, etc.)
341
+ aida reindex # Rebuild project-level index
342
+ aida report # Generate performance report
343
+ aida rules build # Generate rule view files from registry
344
+ aida rules dedupe # Find and remove near-duplicate rules
345
+ aida rules merge # Merge rules from parallel branches
346
+ aida update # Update skills to latest version
347
+ aida migrate # Migrate old data to current schema
348
+ ```
349
+
350
+ </details>
351
+
352
+ <details>
353
+ <summary>🔌 MCP Integration Details</summary>
354
+
355
+ AIDA uses [Model Context Protocol](https://modelcontextprotocol.io/) — the standard way for AI tools to interact with external systems. The MCP server runs over stdio with zero dependencies.
356
+
357
+ **What happens when you add the config:**
358
+
359
+ 1. Your AI tool discovers AIDA's 10 tools via MCP
360
+ 2. As the AI works, it naturally calls `aida_task_start`, `aida_log_files`, etc.
361
+ 3. Data flows into `run.json` silently
362
+ 4. Deviation patterns emerge → AI suggests rules → user confirms → sedimented
363
+ 5. AI reads rules next session → output quality improves
364
+
365
+ **No prompts to write. No scripts to run. No workflow to learn.**
366
+
367
+ </details>
368
+
369
+ ---
370
+
371
+ ## Roadmap
372
+
373
+ - [ ] Export reports as PDF / HTML (H1/H2 performance reviews)
374
+ - [ ] Historical trend analysis — deviation reduction curves over time
375
+ - [ ] Team dashboard with multi-project aggregation
376
+ - [ ] VS Code extension for inline deviation alerts
377
+ - [ ] Cross-project rule sharing — team-wide AI knowledge base
378
+
379
+ ---
380
+
381
+ ## Tech Stack
382
+
383
+ | | |
384
+ |---|---|
385
+ | **Runtime** | Node.js + TypeScript, zero dependencies |
386
+ | **Dashboard** | React 19 + ECharts + Tailwind CSS 4 |
387
+ | **Protocol** | MCP over stdio (JSON-RPC 2.0) |
388
+ | **Data** | Local JSON files, no database |
389
+ | **Real-time** | Server-Sent Events (SSE) |
390
+ | **i18n** | Chinese / English, switchable in dashboard |
391
+
392
+ ## Testing
393
+
394
+ ```bash
395
+ npm test # 82 tests across 29 suites
396
+ ```
397
+
398
+ ## Contributing
399
+
400
+ Issues, feature requests, and PRs are welcome.
401
+
402
+ ```bash
403
+ git clone https://github.com/LWTlong/ai-dev-analytics.git
404
+ cd ai-dev-analytics
405
+ npm install
406
+ npm test
407
+ ```
408
+
409
+ ## License
410
+
411
+ [MIT](./LICENSE)
412
+
413
+ ---
414
+
415
+ <div align="center">
416
+
417
+ **Vibe coding without data is just vibing.**<br>
418
+ **Add data, and your AI gets smarter every run.**
419
+
420
+ [Get Started in 30 Seconds →](#-30-second-setup)
421
+
422
+ </div>