@boshu2/vibe-check 1.6.2 → 1.7.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/.agents/bundles/automatic-learning-cadence-plan-2025-12-02.md +1297 -0
- package/.agents/bundles/automatic-learning-cadence-research-2025-12-02.md +481 -0
- package/.agents/bundles/dashboard-data-quality-plan.md +458 -0
- package/.agents/bundles/rating-scoring-alignment-plan.md +427 -0
- package/.agents/bundles/rpi-session-capture-plan-2025-12-02.md +693 -0
- package/.agents/bundles/rpi-session-capture-research-2025-12-02.md +433 -0
- package/.agents/bundles/session-integration-plan-2025-12-02.md +144 -0
- package/CHANGELOG.md +17 -0
- package/CLAUDE.md +74 -2
- package/Makefile +173 -0
- package/README.md +33 -0
- package/claude-progress.json +34 -5
- package/claude-progress.txt +66 -0
- package/dashboard/app.js +699 -66
- package/dashboard/chart.min.js +20 -0
- package/dashboard/dashboard-data.js +764 -0
- package/dashboard/dashboard-data.json +182 -71
- package/dashboard/index.html +139 -14
- package/dashboard/styles.css +579 -4
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +38 -2
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/dashboard.js +4 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/learn.d.ts +3 -0
- package/dist/commands/learn.d.ts.map +1 -0
- package/dist/commands/learn.js +161 -0
- package/dist/commands/learn.js.map +1 -0
- package/dist/commands/lesson.d.ts +8 -0
- package/dist/commands/lesson.d.ts.map +1 -0
- package/dist/commands/lesson.js +206 -0
- package/dist/commands/lesson.js.map +1 -0
- package/dist/commands/profile.d.ts.map +1 -1
- package/dist/commands/profile.js +3 -202
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/session.d.ts +51 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +561 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/gamification/index.d.ts +1 -3
- package/dist/gamification/index.d.ts.map +1 -1
- package/dist/gamification/index.js +2 -5
- package/dist/gamification/index.js.map +1 -1
- package/dist/gamification/pattern-memory.d.ts +1 -1
- package/dist/gamification/pattern-memory.d.ts.map +1 -1
- package/dist/gamification/pattern-memory.js.map +1 -1
- package/dist/gamification/profile.d.ts +2 -2
- package/dist/gamification/profile.d.ts.map +1 -1
- package/dist/gamification/profile.js +2 -15
- package/dist/gamification/profile.js.map +1 -1
- package/dist/gamification/types.d.ts +8 -2
- package/dist/gamification/types.d.ts.map +1 -1
- package/dist/gamification/types.js.map +1 -1
- package/dist/insights/index.d.ts.map +1 -1
- package/dist/insights/index.js +16 -4
- package/dist/insights/index.js.map +1 -1
- package/dist/insights/types.d.ts +14 -0
- package/dist/insights/types.d.ts.map +1 -1
- package/dist/learning/cadence.d.ts +15 -0
- package/dist/learning/cadence.d.ts.map +1 -0
- package/dist/learning/cadence.js +130 -0
- package/dist/learning/cadence.js.map +1 -0
- package/dist/learning/index.d.ts +19 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +35 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/lessons-storage.d.ts +48 -0
- package/dist/learning/lessons-storage.d.ts.map +1 -0
- package/dist/learning/lessons-storage.js +266 -0
- package/dist/learning/lessons-storage.js.map +1 -0
- package/dist/learning/lessons-types.d.ts +83 -0
- package/dist/learning/lessons-types.d.ts.map +1 -0
- package/dist/learning/lessons-types.js +15 -0
- package/dist/learning/lessons-types.js.map +1 -0
- package/dist/learning/nudges.d.ts +20 -0
- package/dist/learning/nudges.d.ts.map +1 -0
- package/dist/learning/nudges.js +68 -0
- package/dist/learning/nudges.js.map +1 -0
- package/dist/learning/retrospective.d.ts +27 -0
- package/dist/learning/retrospective.d.ts.map +1 -0
- package/dist/learning/retrospective.js +184 -0
- package/dist/learning/retrospective.js.map +1 -0
- package/dist/learning/storage.d.ts +44 -0
- package/dist/learning/storage.d.ts.map +1 -0
- package/dist/learning/storage.js +194 -0
- package/dist/learning/storage.js.map +1 -0
- package/dist/learning/surfacing.d.ts +36 -0
- package/dist/learning/surfacing.d.ts.map +1 -0
- package/dist/learning/surfacing.js +255 -0
- package/dist/learning/surfacing.js.map +1 -0
- package/dist/learning/synthesis.d.ts +17 -0
- package/dist/learning/synthesis.d.ts.map +1 -0
- package/dist/learning/synthesis.js +293 -0
- package/dist/learning/synthesis.js.map +1 -0
- package/dist/learning/types.d.ts +60 -0
- package/dist/learning/types.d.ts.map +1 -0
- package/dist/learning/types.js +17 -0
- package/dist/learning/types.js.map +1 -0
- package/docs/METRICS.md +528 -0
- package/feature-list.json +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
# RPI Session Capture - Research
|
|
2
|
+
|
|
3
|
+
**Type:** Research
|
|
4
|
+
**Created:** 2025-12-02
|
|
5
|
+
**Goal:** Capture meta-learnings from Research→Plan→Implement sessions
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Problem Statement
|
|
10
|
+
|
|
11
|
+
The current learning system captures **code-level** patterns:
|
|
12
|
+
- Spiral patterns (SSL_TLS, API_MISMATCH)
|
|
13
|
+
- Interventions that break spirals
|
|
14
|
+
- Time wasted per pattern
|
|
15
|
+
|
|
16
|
+
But it doesn't capture **process-level** learnings from RPI sessions:
|
|
17
|
+
- Was the plan accurate?
|
|
18
|
+
- How many build errors during implementation?
|
|
19
|
+
- How many test failures?
|
|
20
|
+
- What deviations from the plan?
|
|
21
|
+
- What would make the next RPI better?
|
|
22
|
+
|
|
23
|
+
## Use Cases
|
|
24
|
+
|
|
25
|
+
### 1. Plan Accuracy Tracking
|
|
26
|
+
```
|
|
27
|
+
Plan said: Create 6 files, modify 4
|
|
28
|
+
Reality: Created 8 files, modified 5, deleted 1
|
|
29
|
+
Lesson: Plans underestimate scope by ~25%
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Implementation Friction
|
|
33
|
+
```
|
|
34
|
+
Build errors: 3 (TypeScript type mismatches)
|
|
35
|
+
Test failures: 2 (missing mocks)
|
|
36
|
+
Lesson: Check type signatures before implementing
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Spec Quality
|
|
40
|
+
```
|
|
41
|
+
Spec gaps found during implementation:
|
|
42
|
+
- Didn't specify error handling
|
|
43
|
+
- Missing edge case for empty input
|
|
44
|
+
Lesson: Always include error cases in spec
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 4. Cross-Session Patterns
|
|
48
|
+
```
|
|
49
|
+
Last 5 RPI sessions:
|
|
50
|
+
- 4/5 had TypeScript errors on new files
|
|
51
|
+
- 3/5 required test fixes
|
|
52
|
+
- Average plan deviation: +30% files
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Data Model
|
|
58
|
+
|
|
59
|
+
### RPISession
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
interface RPISession {
|
|
63
|
+
// Identity
|
|
64
|
+
id: string; // "rpi-2025-12-02-001"
|
|
65
|
+
startedAt: string; // ISO datetime
|
|
66
|
+
endedAt: string;
|
|
67
|
+
durationMinutes: number;
|
|
68
|
+
|
|
69
|
+
// Context
|
|
70
|
+
repository: string; // Repo name
|
|
71
|
+
feature: string; // What was being built
|
|
72
|
+
vibeLevel: number; // 0-5
|
|
73
|
+
|
|
74
|
+
// The Plan
|
|
75
|
+
plan: {
|
|
76
|
+
bundlePath: string; // Path to plan bundle
|
|
77
|
+
plannedFiles: PlannedFile[];
|
|
78
|
+
plannedSteps: number;
|
|
79
|
+
estimatedComplexity: 'simple' | 'medium' | 'complex';
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// Execution
|
|
83
|
+
execution: {
|
|
84
|
+
actualFiles: ActualFile[];
|
|
85
|
+
stepsCompleted: number;
|
|
86
|
+
stepsSkipped: number;
|
|
87
|
+
stepsAdded: number; // Not in original plan
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Friction Points
|
|
91
|
+
friction: {
|
|
92
|
+
buildErrors: BuildError[];
|
|
93
|
+
testFailures: TestFailure[];
|
|
94
|
+
planDeviations: PlanDeviation[];
|
|
95
|
+
blockers: string[];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Outcomes
|
|
99
|
+
outcome: {
|
|
100
|
+
status: 'completed' | 'partial' | 'abandoned';
|
|
101
|
+
commits: string[];
|
|
102
|
+
linesAdded: number;
|
|
103
|
+
linesRemoved: number;
|
|
104
|
+
testsAdded: number;
|
|
105
|
+
testsPassing: boolean;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Retrospective (user or AI generated)
|
|
109
|
+
retro: {
|
|
110
|
+
whatWorked: string[];
|
|
111
|
+
whatDidntWork: string[];
|
|
112
|
+
surprises: string[]; // Unexpected things
|
|
113
|
+
lessonsLearned: string[];
|
|
114
|
+
suggestionsForNextTime: string[];
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface PlannedFile {
|
|
119
|
+
path: string;
|
|
120
|
+
action: 'create' | 'modify' | 'delete';
|
|
121
|
+
description: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface ActualFile {
|
|
125
|
+
path: string;
|
|
126
|
+
action: 'create' | 'modify' | 'delete';
|
|
127
|
+
wasPlanned: boolean; // Was this in the plan?
|
|
128
|
+
linesChanged: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface BuildError {
|
|
132
|
+
timestamp: string;
|
|
133
|
+
file: string;
|
|
134
|
+
error: string; // Truncated error message
|
|
135
|
+
resolution: string; // How it was fixed
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface TestFailure {
|
|
139
|
+
timestamp: string;
|
|
140
|
+
testFile: string;
|
|
141
|
+
failureCount: number;
|
|
142
|
+
resolution: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface PlanDeviation {
|
|
146
|
+
type: 'added_file' | 'skipped_file' | 'changed_approach' | 'scope_change';
|
|
147
|
+
description: string;
|
|
148
|
+
reason: string;
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### RPILearning (Synthesized from Sessions)
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
interface RPILearning {
|
|
156
|
+
id: string;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
updatedAt: string;
|
|
159
|
+
|
|
160
|
+
// The pattern
|
|
161
|
+
pattern: string; // "typescript-type-errors", "test-mock-missing"
|
|
162
|
+
description: string;
|
|
163
|
+
|
|
164
|
+
// Evidence
|
|
165
|
+
occurrences: number;
|
|
166
|
+
sessionIds: string[];
|
|
167
|
+
|
|
168
|
+
// Prevention
|
|
169
|
+
prevention: string[]; // How to avoid this
|
|
170
|
+
detection: string[]; // How to catch early
|
|
171
|
+
|
|
172
|
+
// Impact
|
|
173
|
+
avgTimeWasted: number; // Minutes
|
|
174
|
+
frequency: number; // Per session
|
|
175
|
+
|
|
176
|
+
// Confidence
|
|
177
|
+
confidence: number; // 0-100
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Storage
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
~/.vibe-check/
|
|
187
|
+
├── rpi-sessions.json # All RPI session records
|
|
188
|
+
├── rpi-learnings.json # Synthesized learnings
|
|
189
|
+
└── lessons.json # Existing code-level lessons
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Or integrate into existing:
|
|
193
|
+
```
|
|
194
|
+
~/.vibe-check/
|
|
195
|
+
├── learning-state.json # Add rpiSessions array
|
|
196
|
+
└── lessons.json # Add rpiLearnings alongside code lessons
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Capture Points
|
|
202
|
+
|
|
203
|
+
### 1. Session Start (Manual or Auto)
|
|
204
|
+
- `/implement` command starts RPI session
|
|
205
|
+
- Reads plan bundle, extracts planned files/steps
|
|
206
|
+
- Records start time, vibe level
|
|
207
|
+
|
|
208
|
+
### 2. During Implementation (Auto)
|
|
209
|
+
- Hook into build commands → capture errors
|
|
210
|
+
- Hook into test commands → capture failures
|
|
211
|
+
- Track file creates/modifies (git status)
|
|
212
|
+
|
|
213
|
+
### 3. Session End (Manual or Auto)
|
|
214
|
+
- Commit triggers end
|
|
215
|
+
- Or explicit `/session-end`
|
|
216
|
+
- Calculates deviations from plan
|
|
217
|
+
- Prompts for retro input
|
|
218
|
+
|
|
219
|
+
### 4. Synthesis (Auto)
|
|
220
|
+
- After N sessions, synthesize patterns
|
|
221
|
+
- "You always have TypeScript errors on step 3"
|
|
222
|
+
- "Plans underestimate by 30% on average"
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Integration Points
|
|
227
|
+
|
|
228
|
+
### With Existing Systems
|
|
229
|
+
|
|
230
|
+
1. **Plan bundles** (.agents/bundles/*.md)
|
|
231
|
+
- Parse to extract planned files/steps
|
|
232
|
+
- Compare against actual execution
|
|
233
|
+
|
|
234
|
+
2. **Git history**
|
|
235
|
+
- Track commits during session
|
|
236
|
+
- Calculate lines changed
|
|
237
|
+
- Detect file operations
|
|
238
|
+
|
|
239
|
+
3. **Build/test output**
|
|
240
|
+
- Capture npm run build errors
|
|
241
|
+
- Capture npm test failures
|
|
242
|
+
|
|
243
|
+
4. **Learning system**
|
|
244
|
+
- RPI learnings alongside code lessons
|
|
245
|
+
- Surface during next RPI session
|
|
246
|
+
|
|
247
|
+
### CLI Integration
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Start RPI session explicitly
|
|
251
|
+
vibe-check rpi start --plan bundles/my-plan.md
|
|
252
|
+
|
|
253
|
+
# End session with retro
|
|
254
|
+
vibe-check rpi end
|
|
255
|
+
|
|
256
|
+
# View RPI history
|
|
257
|
+
vibe-check rpi history
|
|
258
|
+
|
|
259
|
+
# View RPI learnings
|
|
260
|
+
vibe-check rpi learnings
|
|
261
|
+
|
|
262
|
+
# Or integrate with existing commands
|
|
263
|
+
vibe-check learn --rpi # Show RPI learnings
|
|
264
|
+
vibe-check lesson --rpi # Show RPI-specific lessons
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Minimum Viable Implementation
|
|
270
|
+
|
|
271
|
+
### Phase 1: Manual Capture
|
|
272
|
+
1. New `rpi` command with `start`, `end`, `history`
|
|
273
|
+
2. User manually marks session start/end
|
|
274
|
+
3. Auto-capture: git commits, file changes
|
|
275
|
+
4. Manual retro input at end
|
|
276
|
+
|
|
277
|
+
### Phase 2: Auto-Detection
|
|
278
|
+
1. Detect plan execution (file patterns match plan)
|
|
279
|
+
2. Hook build/test commands (wrapper or shell integration)
|
|
280
|
+
3. Auto-generate retro suggestions
|
|
281
|
+
|
|
282
|
+
### Phase 3: Synthesis
|
|
283
|
+
1. Pattern detection across sessions
|
|
284
|
+
2. Learning generation from patterns
|
|
285
|
+
3. Surface learnings during next RPI
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Example Session Capture
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"id": "rpi-2025-12-02-001",
|
|
294
|
+
"startedAt": "2025-12-02T12:00:00Z",
|
|
295
|
+
"endedAt": "2025-12-02T13:30:00Z",
|
|
296
|
+
"durationMinutes": 90,
|
|
297
|
+
"repository": "vibe-check",
|
|
298
|
+
"feature": "Automatic Learning Cadence",
|
|
299
|
+
"vibeLevel": 3,
|
|
300
|
+
|
|
301
|
+
"plan": {
|
|
302
|
+
"bundlePath": ".agents/bundles/automatic-learning-cadence-plan.md",
|
|
303
|
+
"plannedFiles": [
|
|
304
|
+
{ "path": "src/learning/types.ts", "action": "create" },
|
|
305
|
+
{ "path": "src/learning/storage.ts", "action": "create" },
|
|
306
|
+
{ "path": "src/learning/cadence.ts", "action": "create" },
|
|
307
|
+
{ "path": "src/learning/nudges.ts", "action": "create" },
|
|
308
|
+
{ "path": "src/learning/retrospective.ts", "action": "create" },
|
|
309
|
+
{ "path": "src/learning/index.ts", "action": "create" }
|
|
310
|
+
],
|
|
311
|
+
"plannedSteps": 13,
|
|
312
|
+
"estimatedComplexity": "medium"
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
"execution": {
|
|
316
|
+
"actualFiles": [
|
|
317
|
+
{ "path": "src/learning/types.ts", "action": "create", "wasPlanned": true },
|
|
318
|
+
{ "path": "src/learning/storage.ts", "action": "create", "wasPlanned": true },
|
|
319
|
+
// ... etc
|
|
320
|
+
{ "path": "src/gamification/pattern-memory.ts", "action": "modify", "wasPlanned": false }
|
|
321
|
+
],
|
|
322
|
+
"stepsCompleted": 13,
|
|
323
|
+
"stepsSkipped": 0,
|
|
324
|
+
"stepsAdded": 1
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
"friction": {
|
|
328
|
+
"buildErrors": [
|
|
329
|
+
{
|
|
330
|
+
"timestamp": "2025-12-02T12:30:00Z",
|
|
331
|
+
"file": "src/learning/cadence.ts",
|
|
332
|
+
"error": "Type 'PatternMemory | undefined' not assignable to 'PatternMemory'",
|
|
333
|
+
"resolution": "Updated formatPatternMemory signature to accept undefined"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"testFailures": [],
|
|
337
|
+
"planDeviations": [
|
|
338
|
+
{
|
|
339
|
+
"type": "added_file",
|
|
340
|
+
"description": "Modified pattern-memory.ts type signature",
|
|
341
|
+
"reason": "Function didn't handle undefined, but callers pass undefined"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"blockers": []
|
|
345
|
+
},
|
|
346
|
+
|
|
347
|
+
"outcome": {
|
|
348
|
+
"status": "completed",
|
|
349
|
+
"commits": ["bd3e7df", "87a1c09"],
|
|
350
|
+
"linesAdded": 910,
|
|
351
|
+
"linesRemoved": 4,
|
|
352
|
+
"testsAdded": 0,
|
|
353
|
+
"testsPassing": true
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
"retro": {
|
|
357
|
+
"whatWorked": [
|
|
358
|
+
"Detailed plan with exact file contents",
|
|
359
|
+
"Step-by-step implementation order",
|
|
360
|
+
"Validation commands after each step"
|
|
361
|
+
],
|
|
362
|
+
"whatDidntWork": [
|
|
363
|
+
"Plan didn't account for type signature mismatches"
|
|
364
|
+
],
|
|
365
|
+
"surprises": [
|
|
366
|
+
"formatPatternMemory already handled undefined internally but type said otherwise"
|
|
367
|
+
],
|
|
368
|
+
"lessonsLearned": [
|
|
369
|
+
"Check existing function signatures before writing callers",
|
|
370
|
+
"TypeScript strictness catches real bugs"
|
|
371
|
+
],
|
|
372
|
+
"suggestionsForNextTime": [
|
|
373
|
+
"Include type signature verification in plan",
|
|
374
|
+
"Run build after each file, not just at checkpoints"
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## Synthesized Learning Example
|
|
383
|
+
|
|
384
|
+
After 5 sessions with TypeScript errors:
|
|
385
|
+
|
|
386
|
+
```json
|
|
387
|
+
{
|
|
388
|
+
"id": "rpi-learning-typescript-signatures",
|
|
389
|
+
"pattern": "typescript-signature-mismatch",
|
|
390
|
+
"description": "Functions called with arguments that don't match existing signatures",
|
|
391
|
+
"occurrences": 4,
|
|
392
|
+
"sessionIds": ["rpi-001", "rpi-003", "rpi-004", "rpi-007"],
|
|
393
|
+
"prevention": [
|
|
394
|
+
"Read existing function signatures before writing callers",
|
|
395
|
+
"Run `npm run build` after each new file, not just checkpoints",
|
|
396
|
+
"Include type verification step in plan"
|
|
397
|
+
],
|
|
398
|
+
"detection": [
|
|
399
|
+
"First build error after writing caller code",
|
|
400
|
+
"Error message contains 'not assignable to'"
|
|
401
|
+
],
|
|
402
|
+
"avgTimeWasted": 5,
|
|
403
|
+
"frequency": 0.8,
|
|
404
|
+
"confidence": 85
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## Questions to Resolve
|
|
411
|
+
|
|
412
|
+
1. **Capture granularity**: Every build error, or just summary?
|
|
413
|
+
2. **Retro input**: AI-generated suggestions, user confirms?
|
|
414
|
+
3. **Storage**: Separate file or integrate with learning-state.json?
|
|
415
|
+
4. **Plan parsing**: How to extract files/steps from markdown plan?
|
|
416
|
+
5. **Session boundaries**: Manual start/end or auto-detect?
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Recommendation
|
|
421
|
+
|
|
422
|
+
Start with **Phase 1: Manual Capture** because:
|
|
423
|
+
- Lowest friction to implement
|
|
424
|
+
- Gets data flowing immediately
|
|
425
|
+
- User feedback shapes automation
|
|
426
|
+
|
|
427
|
+
MVP scope:
|
|
428
|
+
- `vibe-check rpi start --plan <path>` - start session
|
|
429
|
+
- `vibe-check rpi end` - end session with git-based metrics + manual retro
|
|
430
|
+
- `vibe-check rpi history` - view past sessions
|
|
431
|
+
- Store in `~/.vibe-check/rpi-sessions.json`
|
|
432
|
+
|
|
433
|
+
Then iterate based on real usage.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Session Metrics Integration Plan
|
|
2
|
+
|
|
3
|
+
**Created:** 2025-12-02
|
|
4
|
+
**Type:** Plan
|
|
5
|
+
**Status:** Ready for implementation
|
|
6
|
+
**Repo:** vibe-check
|
|
7
|
+
**Parent Plan:** workflow-improvements-plan-2025-12-02.md
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Integrate vibe-check metrics into the session lifecycle so that every session automatically captures:
|
|
14
|
+
- Vibe level declared
|
|
15
|
+
- Trust pass rate achieved
|
|
16
|
+
- Rework ratio
|
|
17
|
+
- Spiral occurrences
|
|
18
|
+
- Failure patterns hit
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Current State
|
|
23
|
+
|
|
24
|
+
vibe-check already tracks:
|
|
25
|
+
- ✅ 5 core metrics (iteration velocity, rework ratio, trust pass rate, debug spiral duration, flow efficiency)
|
|
26
|
+
- ✅ Pattern detection (flow state, spirals, late-night work)
|
|
27
|
+
- ✅ StoredInsight system (compounding at 3+ occurrences)
|
|
28
|
+
- ✅ Profile with historical patterns
|
|
29
|
+
|
|
30
|
+
Missing:
|
|
31
|
+
- ❌ Session start/end hooks
|
|
32
|
+
- ❌ Metrics export to claude-progress.json format
|
|
33
|
+
- ❌ Automatic baseline comparison per session
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Implementation
|
|
38
|
+
|
|
39
|
+
### Task 1: Session Metrics Schema (30 min)
|
|
40
|
+
|
|
41
|
+
Add to session record in claude-progress.json:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"session_id": "2025-12-02-001",
|
|
46
|
+
"vibe_level": 3,
|
|
47
|
+
"metrics": {
|
|
48
|
+
"trust_pass_rate": 92,
|
|
49
|
+
"rework_ratio": 11,
|
|
50
|
+
"iteration_velocity": 4.2,
|
|
51
|
+
"debug_spiral_duration_min": 0,
|
|
52
|
+
"flow_efficiency": 85
|
|
53
|
+
},
|
|
54
|
+
"retro": {
|
|
55
|
+
"failure_patterns_hit": [],
|
|
56
|
+
"failure_patterns_avoided": ["Debug Spiral", "Context Amnesia"],
|
|
57
|
+
"learnings": ["Test-first prevented spirals"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Task 2: Session Start Hook (1 hour)
|
|
63
|
+
|
|
64
|
+
Create `/session-start` integration:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# At session start, capture baseline
|
|
68
|
+
vibe-check --since "1 week" --format json > /tmp/vibe-baseline.json
|
|
69
|
+
|
|
70
|
+
# Store baseline metrics for comparison
|
|
71
|
+
baseline_trust=$(jq '.metrics.trust_pass_rate' /tmp/vibe-baseline.json)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Task 3: Session End Hook (1 hour)
|
|
75
|
+
|
|
76
|
+
Create `/session-end` integration:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# At session end, capture session metrics
|
|
80
|
+
vibe-check --since "$SESSION_START" --format json > /tmp/vibe-session.json
|
|
81
|
+
|
|
82
|
+
# Compare to baseline
|
|
83
|
+
session_trust=$(jq '.metrics.trust_pass_rate' /tmp/vibe-session.json)
|
|
84
|
+
delta=$((session_trust - baseline_trust))
|
|
85
|
+
|
|
86
|
+
# Add to claude-progress.json
|
|
87
|
+
# Update session record with metrics
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Task 4: Automatic Retro Generation (30 min)
|
|
91
|
+
|
|
92
|
+
After vibe-check runs at session end:
|
|
93
|
+
- Detect failure patterns from metrics
|
|
94
|
+
- Generate retro.failure_patterns_hit array
|
|
95
|
+
- Suggest learnings based on patterns avoided
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Files to Modify
|
|
100
|
+
|
|
101
|
+
| File | Change |
|
|
102
|
+
|------|--------|
|
|
103
|
+
| src/index.ts | Add --session-start and --session-end flags |
|
|
104
|
+
| src/metrics.ts | Export metrics in session-compatible format |
|
|
105
|
+
| src/patterns.ts | Add failure pattern detection for retro |
|
|
106
|
+
| README.md | Document session integration |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Validation
|
|
111
|
+
|
|
112
|
+
- [ ] `vibe-check --session-start` captures baseline
|
|
113
|
+
- [ ] `vibe-check --session-end` outputs session metrics JSON
|
|
114
|
+
- [ ] Metrics can be appended to claude-progress.json
|
|
115
|
+
- [ ] Failure patterns correctly detected
|
|
116
|
+
- [ ] Delta from baseline calculated and displayed
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Success Metrics
|
|
121
|
+
|
|
122
|
+
After implementation:
|
|
123
|
+
- Every vibe-check session in workspace captures metrics
|
|
124
|
+
- Trust pass rate tracked per session (not just aggregate)
|
|
125
|
+
- Failure patterns documented in retro
|
|
126
|
+
- Patterns compound via StoredInsight system
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Next Steps
|
|
131
|
+
|
|
132
|
+
1. Implement Task 1 (schema)
|
|
133
|
+
2. Implement Task 2 (start hook)
|
|
134
|
+
3. Implement Task 3 (end hook)
|
|
135
|
+
4. Test with real session
|
|
136
|
+
5. Document in README
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Resume Command
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
/session-resume "session integration"
|
|
144
|
+
```
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Session Integration** - New `vibe-check session` command suite for Claude Code integration
|
|
12
|
+
- `session start` - Capture baseline metrics at session start
|
|
13
|
+
- `session end` - Get session metrics with failure pattern detection
|
|
14
|
+
- `session status` - Show active session info
|
|
15
|
+
- JSON output compatible with `claude-progress.json` format
|
|
16
|
+
- Automatic failure pattern detection (Debug Spiral, Context Amnesia, Velocity Crash, Trust Erosion, Flow Disruption)
|
|
17
|
+
- Auto-generated learnings based on metrics and patterns
|
|
18
|
+
- Baseline comparison with last 7 days
|
|
19
|
+
- **Learning System** - New learning and lessons database
|
|
20
|
+
- `learn` command - Extract patterns from sessions
|
|
21
|
+
- `lesson` command - Manage synthesized lessons with `--list`, `--stats`, `--apply`, `--dismiss`
|
|
22
|
+
- Automatic synthesis from pattern + intervention memory
|
|
23
|
+
- Lessons surface during analyze when relevant spirals detected
|
|
24
|
+
|
|
8
25
|
## [1.6.0] - 2025-11-30
|
|
9
26
|
|
|
10
27
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -72,7 +72,37 @@ Most users have `^` (caret) in their package.json, meaning they'll auto-update t
|
|
|
72
72
|
|
|
73
73
|
## Development Workflow
|
|
74
74
|
|
|
75
|
-
###
|
|
75
|
+
### Makefile Commands
|
|
76
|
+
|
|
77
|
+
All commands are available via `make`. Run `make help` for full list.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Build & Run
|
|
81
|
+
make build # Compile TypeScript
|
|
82
|
+
make dev # Run with ts-node
|
|
83
|
+
make test # Run all tests
|
|
84
|
+
make test-coverage # Tests with coverage
|
|
85
|
+
|
|
86
|
+
# Vibe-Check
|
|
87
|
+
make dashboard # Open visual dashboard
|
|
88
|
+
make analyze # Analyze last week
|
|
89
|
+
make profile # Show XP, streaks, achievements
|
|
90
|
+
make watch # Real-time spiral detection
|
|
91
|
+
|
|
92
|
+
# Session Integration
|
|
93
|
+
make session-start # Start session (prompts for level)
|
|
94
|
+
make session-end # End session and get metrics
|
|
95
|
+
make session-status # Show active session info
|
|
96
|
+
|
|
97
|
+
# Publishing
|
|
98
|
+
make publish # Build, test, publish to npm
|
|
99
|
+
make version-patch # Bump patch version
|
|
100
|
+
make version-minor # Bump minor version
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See [Makefile](./Makefile) for all available targets.
|
|
104
|
+
|
|
105
|
+
### Running Locally (npm)
|
|
76
106
|
|
|
77
107
|
```bash
|
|
78
108
|
npm run dev # Run with ts-node
|
|
@@ -110,7 +140,10 @@ src/
|
|
|
110
140
|
├── commands/
|
|
111
141
|
│ ├── index.ts # Command exports
|
|
112
142
|
│ ├── analyze.ts # Main analyze command
|
|
113
|
-
│ ├──
|
|
143
|
+
│ ├── session.ts # Session start/end/status commands
|
|
144
|
+
│ ├── dashboard.ts # Visual dashboard command
|
|
145
|
+
│ ├── learn.ts # Learning extraction command
|
|
146
|
+
│ ├── lesson.ts # Lessons database command
|
|
114
147
|
│ └── profile.ts # Profile/stats command
|
|
115
148
|
├── metrics/
|
|
116
149
|
│ ├── index.ts # Orchestrates all metrics
|
|
@@ -129,7 +162,19 @@ src/
|
|
|
129
162
|
│ ├── xp.ts # XP calculation and levels
|
|
130
163
|
│ ├── streaks.ts # Daily/weekly streak tracking
|
|
131
164
|
│ ├── achievements.ts # Achievement definitions and checks
|
|
165
|
+
│ ├── pattern-memory.ts # Track spiral triggers over time
|
|
166
|
+
│ ├── intervention-memory.ts # Track what breaks spirals
|
|
132
167
|
│ └── profile.ts # Profile persistence (.vibe-check/)
|
|
168
|
+
├── learning/
|
|
169
|
+
│ ├── index.ts # Learning system exports
|
|
170
|
+
│ ├── types.ts # Learning/lesson types
|
|
171
|
+
│ ├── storage.ts # Learnings persistence
|
|
172
|
+
│ ├── cadence.ts # Automatic learning cadence
|
|
173
|
+
│ ├── synthesis.ts # Lesson synthesis from patterns
|
|
174
|
+
│ ├── surfacing.ts # Surface lessons during analyze
|
|
175
|
+
│ └── lessons-storage.ts # Lessons database
|
|
176
|
+
├── sessions/
|
|
177
|
+
│ └── index.ts # Session tracking and baseline comparison
|
|
133
178
|
├── calibration/
|
|
134
179
|
│ ├── index.ts # Calibration orchestration
|
|
135
180
|
│ ├── ece.ts # Expected calibration error
|
|
@@ -180,6 +225,33 @@ vibe-check level # Get level recommendation
|
|
|
180
225
|
vibe-check level --calibrate 3 # Record calibration sample
|
|
181
226
|
```
|
|
182
227
|
|
|
228
|
+
### Session Commands (AgentOps Integration)
|
|
229
|
+
```bash
|
|
230
|
+
vibe-check session start --level 3 # Start session, capture baseline
|
|
231
|
+
vibe-check session status # Show active session
|
|
232
|
+
vibe-check session end --format json # End session, get metrics + patterns
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Output includes failure pattern detection for `/session-end` integration:
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"metrics": { "trust_pass_rate": 92, "rework_ratio": 11, ... },
|
|
239
|
+
"retro": {
|
|
240
|
+
"failure_patterns_hit": [],
|
|
241
|
+
"failure_patterns_avoided": ["Debug Spiral", "Context Amnesia"],
|
|
242
|
+
"learnings": ["Test-first approach prevented spirals"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Learning Commands
|
|
248
|
+
```bash
|
|
249
|
+
vibe-check learn # Extract patterns from sessions
|
|
250
|
+
vibe-check lesson --list # List synthesized lessons
|
|
251
|
+
vibe-check lesson --stats # Lesson statistics
|
|
252
|
+
vibe-check lesson --apply <id> # Apply a lesson
|
|
253
|
+
```
|
|
254
|
+
|
|
183
255
|
## The 5 Metrics
|
|
184
256
|
|
|
185
257
|
| Metric | Measures | Threshold |
|