opencodekit 0.10.0 → 0.11.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.
Files changed (46) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/planner.md +3 -2
  3. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  5. package/dist/template/.opencode/command/analyze-project.md +439 -30
  6. package/dist/template/.opencode/command/brainstorm.md +288 -5
  7. package/dist/template/.opencode/command/commit.md +226 -17
  8. package/dist/template/.opencode/command/create.md +138 -35
  9. package/dist/template/.opencode/command/design-audit.md +477 -29
  10. package/dist/template/.opencode/command/design.md +609 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +162 -71
  13. package/dist/template/.opencode/command/fix-ci.md +296 -24
  14. package/dist/template/.opencode/command/fix-types.md +345 -13
  15. package/dist/template/.opencode/command/fix-ui.md +293 -13
  16. package/dist/template/.opencode/command/fix.md +256 -9
  17. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  18. package/dist/template/.opencode/command/generate-icon.md +266 -22
  19. package/dist/template/.opencode/command/generate-image.md +232 -12
  20. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  21. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  22. package/dist/template/.opencode/command/handoff.md +202 -30
  23. package/dist/template/.opencode/command/implement.md +162 -50
  24. package/dist/template/.opencode/command/import-plan.md +247 -51
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +405 -24
  27. package/dist/template/.opencode/command/issue.md +171 -21
  28. package/dist/template/.opencode/command/new-feature.md +382 -54
  29. package/dist/template/.opencode/command/plan.md +144 -118
  30. package/dist/template/.opencode/command/pr.md +229 -28
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +173 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +439 -63
  37. package/dist/template/.opencode/command/revert-feature.md +341 -64
  38. package/dist/template/.opencode/command/review-codebase.md +193 -4
  39. package/dist/template/.opencode/command/skill-create.md +506 -14
  40. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  41. package/dist/template/.opencode/command/status.md +320 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +355 -0
  44. package/dist/template/.opencode/command/ui-review.md +292 -25
  45. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  46. package/package.json +1 -1
@@ -1,71 +1,412 @@
1
1
  ---
2
- description: Generate AI summary of a previous session for quick context
3
- argument-hint: "[session_reference]"
2
+ description: Generate AI summary of sessions for quick context recovery
3
+ argument-hint: "[session_reference] [--compare] [--focus=<topic>]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Summarize
8
8
 
9
- Generate an AI summary of a previous session to quickly understand what happened without loading full context.
9
+ Generate AI-powered summaries of previous sessions to quickly understand what happened without loading full context.
10
10
 
11
- ## Phase 1: Resolve Session
11
+ ## Phase 1: Resolve Session Reference
12
12
 
13
- If no argument provided, list recent sessions:
13
+ ### Parse Argument
14
14
 
15
+ ```typescript
16
+ const ref = "$ARGUMENTS" || "last";
17
+
18
+ const parseReference = (ref: string) => {
19
+ // Direct session ID
20
+ if (ref.startsWith("ses_")) return { type: "id", value: ref };
21
+
22
+ // Relative references
23
+ if (ref === "last") return { type: "relative", offset: 0 };
24
+ if (ref.match(/^\d+ ago$/))
25
+ return { type: "relative", offset: parseInt(ref) };
26
+
27
+ // Time-based
28
+ if (ref === "today") return { type: "time", period: "today" };
29
+ if (ref === "yesterday") return { type: "time", period: "yesterday" };
30
+ if (ref.match(/^\d{4}-\d{2}-\d{2}$/)) return { type: "date", value: ref };
31
+
32
+ // Bead-based
33
+ if (ref.startsWith("bd-")) return { type: "bead", id: ref };
34
+
35
+ return { type: "unknown", value: ref };
36
+ };
37
+ ```
38
+
39
+ ### List Available Sessions (if needed)
40
+
41
+ ```typescript
42
+ list_sessions({ project: "current", limit: 10, _: true });
43
+ ```
44
+
45
+ **If no argument provided, show picker:**
46
+
47
+ ```
48
+ RECENT SESSIONS
49
+ ━━━━━━━━━━━━━━━
50
+
51
+ # │ ID │ Time │ Messages │ Focus
52
+ ───┼─────────────┼──────────────┼──────────┼─────────────────────
53
+ 1 │ ses_abc123 │ Today 2:30pm │ 45 │ Auth implementation
54
+ 2 │ ses_def456 │ Today 11am │ 28 │ Dashboard setup
55
+ 3 │ ses_ghi789 │ Yesterday │ 62 │ Bug triage
56
+ 4 │ ses_jkl012 │ 2 days ago │ 34 │ API refactor
57
+ 5 │ ses_mno345 │ 3 days ago │ 19 │ Documentation
58
+
59
+ Select session (1-5) or enter session ID: _
15
60
  ```
16
- list_sessions(limit=5, project="current")
61
+
62
+ ## Phase 2: Generate AI Summary
63
+
64
+ ```typescript
65
+ summarize_session({ session_id: resolvedSessionId });
17
66
  ```
18
67
 
19
- Parse the session reference:
68
+ This triggers the compaction model to:
69
+
70
+ 1. Analyze all messages in the session
71
+ 2. Extract key actions, decisions, and outcomes
72
+ 3. Identify files modified and their changes
73
+ 4. Note blockers and unresolved items
74
+ 5. Generate structured summary
75
+
76
+ ## Phase 3: Display Summary
77
+
78
+ ### Summary Format
79
+
80
+ ```
81
+ ╔══════════════════════════════════════════════════════════════════════════╗
82
+ ║ SESSION SUMMARY ║
83
+ ╠══════════════════════════════════════════════════════════════════════════╣
84
+
85
+ SESSION INFO
86
+ ━━━━━━━━━━━━
87
+ ID: ses_abc123
88
+ Date: 2024-01-15 2:30 PM - 4:15 PM (1h 45m)
89
+ Messages: 45
90
+ Tokens: ~78,000
91
+ Project: my-project
92
+
93
+
94
+ FOCUS
95
+ ━━━━━
96
+ Primary: Implementing JWT authentication for API endpoints
97
+ Related Beads: bd-auth01, bd-api02
98
+
99
+
100
+ WHAT WAS ACCOMPLISHED
101
+ ━━━━━━━━━━━━━━━━━━━━━
102
+ ✓ Created AuthMiddleware class with token validation
103
+ ✓ Added JWT signing and verification utilities
104
+ ✓ Implemented login and logout endpoints
105
+ ✓ Set up refresh token rotation
106
+ ✗ Rate limiting (deferred to next session)
20
107
 
21
- - Empty or "last" resolves to most recent session
22
- - "2 ago" or "3 ago" resolves to nth most recent
23
- - "today" resolves to first session today
24
- - "ses\_..." uses the session ID directly
25
108
 
26
- ## Phase 2: Generate Summary
109
+ KEY DECISIONS
110
+ ━━━━━━━━━━━━━
111
+ 1. Used RS256 algorithm for JWT (asymmetric keys)
112
+ Reason: Allows token verification without sharing secret
27
113
 
28
- Trigger AI summarization using the configured compaction model:
114
+ 2. Refresh tokens stored in Redis with 7-day TTL
115
+ Reason: Balance between security and user convenience
29
116
 
117
+ 3. Access tokens expire in 15 minutes
118
+ Reason: Minimize window for stolen token abuse
119
+
120
+
121
+ FILES MODIFIED
122
+ ━━━━━━━━━━━━━━
123
+ src/
124
+ ├── auth/
125
+ │ ├── middleware.ts (+124/-0) NEW - Auth middleware
126
+ │ ├── jwt.ts (+89/-0) NEW - JWT utilities
127
+ │ └── types.ts (+34/-0) NEW - Auth types
128
+ ├── routes/
129
+ │ └── auth.ts (+67/-12) Added login/logout
130
+ └── config/
131
+ └── auth.ts (+23/-5) JWT configuration
132
+
133
+ Total: +337/-17 across 5 files
134
+
135
+
136
+ TESTS
137
+ ━━━━━
138
+ Added: 8 tests in auth.test.ts
139
+ Status: 7 passing, 1 skipped
140
+ Coverage: 84% for auth module
141
+
142
+
143
+ BLOCKERS ENCOUNTERED
144
+ ━━━━━━━━━━━━━━━━━━━━
145
+ 1. Redis connection timeout during testing
146
+ Resolution: Added retry logic with exponential backoff
147
+
148
+ 2. TypeScript error with jwt library types
149
+ Resolution: Added @types/jsonwebtoken
150
+
151
+
152
+ UNRESOLVED ITEMS
153
+ ━━━━━━━━━━━━━━━━
154
+ - Rate limiting not implemented (moved to bd-rate01)
155
+ - Need to add CORS configuration for refresh endpoint
156
+ - API documentation needs update
157
+
158
+
159
+ WHERE WORK STOPPED
160
+ ━━━━━━━━━━━━━━━━━━
161
+ File: src/auth/middleware.ts
162
+ Line: 45
163
+ Context: "Adding rate limiting check before token validation"
164
+
165
+ Handoff created: Yes
166
+ Branch: feature/auth
167
+ Last commit: abc1234 "feat: add JWT auth with refresh tokens"
168
+
169
+
170
+ CONTEXT FOR NEXT SESSION
171
+ ━━━━━━━━━━━━━━━━━━━━━━━━
172
+ To continue this work:
173
+ 1. Load handoff: /resume bd-auth01
174
+ 2. Focus on: Rate limiting implementation
175
+ 3. Read first: src/auth/middleware.ts:45
176
+
177
+ ╚══════════════════════════════════════════════════════════════════════════╝
30
178
  ```
31
- summarize_session(session_id)
179
+
180
+ ## Phase 4: Focus Mode (--focus)
181
+
182
+ If `--focus=<topic>` specified, filter summary:
183
+
184
+ ```bash
185
+ /summarize last --focus=decisions # Only decisions made
186
+ /summarize last --focus=files # Only file changes
187
+ /summarize last --focus=blockers # Only blockers
188
+ /summarize last --focus=code # Code snippets written
32
189
  ```
33
190
 
34
- The summary is generated asynchronously and stored with the session.
191
+ **Example: Focus on Decisions**
35
192
 
36
- ## Phase 3: Display Result
193
+ ```
194
+ DECISIONS FROM ses_abc123
195
+ ━━━━━━━━━━━━━━━━━━━━━━━━━
37
196
 
38
- Read the session with focus on the generated summary:
197
+ 1. JWT Algorithm: RS256
198
+ Context: Discussed HS256 vs RS256
199
+ Conclusion: RS256 for microservices (can verify without secret)
200
+ Files affected: src/auth/jwt.ts
39
201
 
202
+ 2. Token Expiry: 15 min access, 7 day refresh
203
+ Context: Security vs UX tradeoff
204
+ Conclusion: Short access + long refresh with rotation
205
+ Files affected: src/config/auth.ts
206
+
207
+ 3. Storage: Redis for refresh tokens
208
+ Context: Considered PostgreSQL, decided Redis for TTL support
209
+ Conclusion: Redis with automatic expiration
210
+ Files affected: src/auth/token-store.ts
40
211
  ```
41
- read_session(session_id, focus="summary")
212
+
213
+ ## Phase 5: Compare Mode (--compare)
214
+
215
+ Compare two sessions:
216
+
217
+ ```bash
218
+ /summarize ses_abc123 --compare ses_def456
42
219
  ```
43
220
 
44
- Present the summary in a clear, scannable format showing what was accomplished, key decisions made, and any blockers encountered.
221
+ **Comparison Output:**
45
222
 
46
- ## Output
223
+ ```
224
+ SESSION COMPARISON
225
+ ━━━━━━━━━━━━━━━━━━
47
226
 
48
- Report the session metadata (ID, timestamp, message count, token usage) followed by the AI-generated summary. Highlight key actions taken during the session.
227
+ ses_abc123 │ ses_def456
228
+ ────────────────────┼─────────────────┼─────────────────
229
+ Date │ Jan 15, 2:30pm │ Jan 14, 11:00am
230
+ Duration │ 1h 45m │ 2h 10m
231
+ Messages │ 45 │ 62
232
+ Files Modified │ 5 │ 8
233
+ Tests Added │ 8 │ 3
234
+ Decisions │ 3 │ 1
49
235
 
50
- End with actionable next steps:
51
236
 
52
- - How to load full context if needed
53
- - How to resume associated work
237
+ COMMON THREADS
238
+ ━━━━━━━━━━━━━━
239
+ - Both sessions worked on auth module
240
+ - ses_def456 laid groundwork that ses_abc123 built upon
241
+ - Same bead: bd-auth01
54
242
 
55
- ## Examples
56
243
 
244
+ PROGRESSION
245
+ ━━━━━━━━━━━
246
+ ses_def456 (earlier):
247
+ └── Set up auth module structure
248
+ └── Created base types and interfaces
249
+
250
+ ses_abc123 (later):
251
+ └── Implemented JWT logic on top of structure
252
+ └── Added endpoints and middleware
253
+ ```
254
+
255
+ ## Phase 6: Bead-Focused Summary
256
+
257
+ If argument is a bead ID, find all related sessions:
258
+
259
+ ```bash
260
+ /summarize bd-auth01
261
+ ```
262
+
263
+ **Output:**
264
+
265
+ ```
266
+ BEAD HISTORY: bd-auth01
267
+ ━━━━━━━━━━━━━━━━━━━━━━━
268
+
269
+ Title: Implement JWT Authentication
270
+ Status: In Progress
271
+ Created: 2024-01-12
272
+
273
+
274
+ RELATED SESSIONS
275
+ ━━━━━━━━━━━━━━━━
276
+
277
+ Session 1: ses_xyz789 (Jan 12)
278
+ ├── Duration: 30 min
279
+ ├── Focus: Initial planning and spec creation
280
+ └── Output: spec.md created
281
+
282
+ Session 2: ses_def456 (Jan 14)
283
+ ├── Duration: 2h 10m
284
+ ├── Focus: Research and architecture
285
+ └── Output: research.md, plan.md created
286
+
287
+ Session 3: ses_abc123 (Jan 15)
288
+ ├── Duration: 1h 45m
289
+ ├── Focus: Core implementation
290
+ └── Output: 5 files, 8 tests
291
+
292
+ Session 4: ses_ghi012 (Jan 16) ← LATEST
293
+ ├── Duration: 45 min
294
+ ├── Focus: Rate limiting (incomplete)
295
+ └── Output: Handoff created
296
+
297
+
298
+ TOTAL EFFORT
299
+ ━━━━━━━━━━━━
300
+ Sessions: 4
301
+ Total Time: 5h 10m
302
+ Messages: 156
303
+ Files Modified: 12
304
+ Tests: 11
305
+
306
+ Progress: 80% complete (per plan.md)
307
+
308
+
309
+ NEXT SESSION SHOULD
310
+ ━━━━━━━━━━━━━━━━━━━
311
+ 1. Resume from handoff
312
+ 2. Complete rate limiting
313
+ 3. Run full test suite
314
+ 4. Create PR
57
315
  ```
58
- /summarize # Summarize most recent session
59
- /summarize last # Same as above
60
- /summarize ses_abc123 # Summarize specific session
61
- /summarize 2 ago # Summarize 2nd most recent
62
- /summarize today # First session today
316
+
317
+ ## Examples
318
+
319
+ ```bash
320
+ /summarize # Summarize last session
321
+ /summarize last # Same as above
322
+ /summarize 2 ago # 2nd most recent session
323
+ /summarize ses_abc123 # Specific session
324
+ /summarize today # First session today
325
+ /summarize yesterday # Most recent yesterday
326
+ /summarize 2024-01-15 # Sessions from date
327
+ /summarize bd-auth01 # All sessions for bead
328
+ /summarize last --focus=decisions # Only decisions
329
+ /summarize last --focus=files # Only file changes
330
+ /summarize a --compare b # Compare two sessions
63
331
  ```
64
332
 
65
333
  ## When to Use
66
334
 
67
- Use this command before resuming work to get a quick overview without loading full context. Helpful during handoffs to understand previous session state, for context triage to decide if a session is worth loading, or when researching across multiple past sessions to find relevant work.
335
+ | Scenario | Command |
336
+ | -------------------------- | ---------------------------------- |
337
+ | Resuming after break | `/summarize last` then `/resume` |
338
+ | Understanding old work | `/summarize <session_id>` |
339
+ | Handoff to teammate | `/summarize --focus=decisions` |
340
+ | Finding where you left off | `/summarize <bead-id>` |
341
+ | Comparing approaches | `/summarize a --compare b` |
342
+ | Context triage | `/summarize` before `read_session` |
343
+
344
+ ## Integration with Other Commands
345
+
346
+ ```
347
+ Workflow: Efficient Context Loading
348
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
349
+
350
+ 1. List sessions
351
+ list_sessions(project="current", limit=5)
352
+
353
+ 2. Summarize promising ones (cheap)
354
+ /summarize ses_abc123
355
+ /summarize ses_def456
356
+
357
+ 3. Load full context only for the right one (expensive)
358
+ read_session("ses_abc123")
359
+
360
+ 4. Resume work
361
+ /resume bd-auth01
362
+
363
+ Result: Saved ~50k tokens by not loading wrong sessions
364
+ ```
365
+
366
+ ## Output Caching
367
+
368
+ Summaries are cached with the session:
369
+
370
+ ```typescript
371
+ // First call generates summary
372
+ summarize_session("ses_abc123"); // ~5 seconds, API call
373
+
374
+ // Subsequent calls use cached summary
375
+ summarize_session("ses_abc123"); // Instant, cached
376
+ ```
377
+
378
+ To regenerate:
379
+
380
+ ```bash
381
+ /summarize ses_abc123 --regenerate
382
+ ```
383
+
384
+ ## Error Handling
385
+
386
+ ```
387
+ [If session not found:]
388
+ ERROR: Session 'ses_xyz' not found
389
+
390
+ Recent sessions:
391
+ - ses_abc123 (today)
392
+ - ses_def456 (yesterday)
393
+
394
+ Check: list_sessions(limit=20)
68
395
 
69
- ## Integration
70
396
 
71
- This command works alongside other session tools. Start with `list_sessions` to discover available sessions, use `/summarize` to quickly understand promising candidates, then load full context with `read_session` only for the most relevant session. This workflow saves context space by avoiding unnecessary full session loads.
397
+ [If summary generation fails:]
398
+ WARNING: AI summary unavailable
399
+
400
+ Falling back to basic metadata:
401
+ - Messages: 45
402
+ - Duration: 1h 45m
403
+ - Files: 5 modified
404
+
405
+ Try: read_session("ses_abc123") for full context
406
+
407
+
408
+ [If no sessions exist:]
409
+ No sessions found for this project.
410
+
411
+ This may be a new project or sessions were cleared.
412
+ ```