ai-gains 1.5.1 → 1.5.3

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
@@ -40,14 +40,18 @@ After completing a meaningful piece of work — a feature, a bug fix, a refactor
40
40
  /ai-gains
41
41
  ```
42
42
 
43
- Claude will reflect on what was done, estimate how long it would have taken a human, and write the achievement to the session log. Run it as many times as you like within a session to capture checkpoints, or once at the end to log everything in one go. The hooks handle start and end time automatically `/ai-gains` is purely for recording what was accomplished.
43
+ Claude will reflect on what was done, capture git output signals (lines added/removed, commits), estimate how long the work would have taken a competent mid-level developer without AI, and write the achievement to the session log. Estimates deliberately err conservativecredible numbers matter more than impressive ones.
44
+
45
+ Run it as many times as you like within a session to capture checkpoints, or once at the end to log everything in one go. The hooks handle start and end time automatically — `/ai-gains` is purely for recording what was accomplished.
44
46
 
45
47
  ## Dashboard features
46
48
 
47
- - **Stats** — total sessions, achievements, time saved, average speedup
48
- - **Chart** — AI time vs estimated human time per session
49
+ - **Stats** — total time saved (hero metric), sessions, achievements, weighted average speedup
50
+ - **Chart** — time saved per session as a bar chart, with a 5-session rolling average line showing whether AI is becoming more or less useful over time. Sessions with suspiciously high speedup estimates (>15×) are highlighted amber.
51
+ - **Category breakdown** — donut chart showing which types of work account for most time saved
52
+ - **Where AI helps most** — per-category table of average speedup, total time saved, and session count
49
53
  - **Filters** — filter by author and time period
50
- - **Session detail** — per-session breakdown of achievements and files touched
54
+ - **Session detail** — per-session breakdown of achievements, categories, and files touched
51
55
 
52
56
  ## What gets tracked
53
57
 
@@ -60,16 +64,25 @@ Each session file (`.ai-gains/<session-id>.json`) contains:
60
64
  "end_time": "2026-01-15T09:45:00Z",
61
65
  "author": "you@example.com",
62
66
  "duration_minutes": 45,
67
+ "output": {
68
+ "files_changed": 4,
69
+ "lines_added": 120,
70
+ "lines_removed": 35,
71
+ "commits": 2
72
+ },
63
73
  "achievements": [
64
74
  {
65
75
  "description": "Implemented user authentication with JWT",
66
- "estimated_human_time_minutes": 180
76
+ "estimated_human_time_minutes": 180,
77
+ "category": "enhancement"
67
78
  }
68
79
  ],
69
80
  "ai_speedup": "4× faster — 3h of work done in 45 minutes"
70
81
  }
71
82
  ```
72
83
 
84
+ The `output` field is auto-captured from git and provides an objective cross-check on estimates. It is omitted if git is unavailable.
85
+
73
86
  ## Committing session logs
74
87
 
75
88
  Add `.ai-gains/` to your repository to share gains across your team. Each file is named `<timestamp>_<session-id>.json` so files sort chronologically and concurrent sessions never conflict.
package/bin/ai-gains.js CHANGED
@@ -10,11 +10,24 @@ if (command === 'init') {
10
10
  initProject(process.cwd());
11
11
  } else if (!command || command === 'dashboard') {
12
12
  const { startServer } = require('../src/server');
13
- startServer(path.join(process.cwd(), '.ai-gains'));
13
+ startServer(process.cwd());
14
+ } else if (command === 'github') {
15
+ const target = process.argv[3];
16
+ if (!target) {
17
+ console.error('\n Usage:');
18
+ console.error(' npx ai-gains github <owner/repo> — single repo dashboard');
19
+ console.error(' npx ai-gains github <owner> — all repos of a user/org\n');
20
+ process.exit(1);
21
+ }
22
+ const verbose = process.argv.slice(4).includes('--verbose') || process.argv.slice(4).includes('-v');
23
+ const { startGitHubServer } = require('../src/server');
24
+ startGitHubServer(target, { verbose });
14
25
  } else {
15
26
  console.error(`\n Unknown command: ${command}`);
16
27
  console.error(' Usage:');
17
- console.error(' npx ai-gains — start the dashboard');
18
- console.error(' npx ai-gains init — set up .claude hooks in this project\n');
28
+ console.error(' npx ai-gains — start the dashboard');
29
+ console.error(' npx ai-gains init — set up .claude hooks in this project');
30
+ console.error(' npx ai-gains github <owner/repo> — dashboard from a GitHub repo');
31
+ console.error(' npx ai-gains github <owner> — dashboard from all repos of a user/org\n');
19
32
  process.exit(1);
20
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-gains",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Interactive browser dashboard for AI development session tracking",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -26,6 +26,6 @@
26
26
  ],
27
27
  "license": "MIT",
28
28
  "engines": {
29
- "node": ">=16.0.0"
29
+ "node": ">=18.0.0"
30
30
  }
31
31
  }