opencodekit 0.9.2 → 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 (62) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +116 -47
  3. package/dist/template/.opencode/agent/build.md +16 -48
  4. package/dist/template/.opencode/agent/explore.md +13 -34
  5. package/dist/template/.opencode/agent/planner.md +41 -11
  6. package/dist/template/.opencode/agent/review.md +2 -23
  7. package/dist/template/.opencode/agent/rush.md +24 -65
  8. package/dist/template/.opencode/agent/scout.md +5 -21
  9. package/dist/template/.opencode/agent/vision.md +0 -14
  10. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  11. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  12. package/dist/template/.opencode/command/analyze-project.md +439 -30
  13. package/dist/template/.opencode/command/brainstorm.md +288 -5
  14. package/dist/template/.opencode/command/commit.md +226 -17
  15. package/dist/template/.opencode/command/create.md +138 -35
  16. package/dist/template/.opencode/command/design-audit.md +477 -29
  17. package/dist/template/.opencode/command/design.md +609 -6
  18. package/dist/template/.opencode/command/edit-image.md +223 -20
  19. package/dist/template/.opencode/command/finish.md +162 -71
  20. package/dist/template/.opencode/command/fix-ci.md +296 -24
  21. package/dist/template/.opencode/command/fix-types.md +345 -13
  22. package/dist/template/.opencode/command/fix-ui.md +293 -13
  23. package/dist/template/.opencode/command/fix.md +256 -9
  24. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  25. package/dist/template/.opencode/command/generate-icon.md +266 -22
  26. package/dist/template/.opencode/command/generate-image.md +232 -12
  27. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  28. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  29. package/dist/template/.opencode/command/handoff.md +202 -30
  30. package/dist/template/.opencode/command/implement.md +162 -50
  31. package/dist/template/.opencode/command/import-plan.md +247 -51
  32. package/dist/template/.opencode/command/init.md +154 -35
  33. package/dist/template/.opencode/command/integration-test.md +405 -24
  34. package/dist/template/.opencode/command/issue.md +171 -21
  35. package/dist/template/.opencode/command/new-feature.md +382 -54
  36. package/dist/template/.opencode/command/plan.md +144 -118
  37. package/dist/template/.opencode/command/pr.md +229 -28
  38. package/dist/template/.opencode/command/quick-build.md +234 -5
  39. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  40. package/dist/template/.opencode/command/research-ui.md +444 -34
  41. package/dist/template/.opencode/command/research.md +173 -45
  42. package/dist/template/.opencode/command/restore-image.md +416 -22
  43. package/dist/template/.opencode/command/resume.md +439 -63
  44. package/dist/template/.opencode/command/revert-feature.md +341 -64
  45. package/dist/template/.opencode/command/review-codebase.md +193 -4
  46. package/dist/template/.opencode/command/skill-create.md +506 -14
  47. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  48. package/dist/template/.opencode/command/status.md +320 -60
  49. package/dist/template/.opencode/command/summarize.md +374 -33
  50. package/dist/template/.opencode/command/triage.md +355 -0
  51. package/dist/template/.opencode/command/ui-review.md +292 -25
  52. package/dist/template/.opencode/plugin/README.md +110 -98
  53. package/dist/template/.opencode/plugin/compactor.ts +95 -171
  54. package/dist/template/.opencode/plugin/enforcer.ts +177 -127
  55. package/dist/template/.opencode/plugin/injector.ts +150 -0
  56. package/dist/template/.opencode/plugin/lib/notify.ts +86 -0
  57. package/dist/template/.opencode/plugin/notification.ts +57 -123
  58. package/dist/template/.opencode/plugin/truncator.ts +60 -166
  59. package/dist/template/.opencode/skill/mqdh/SKILL.md +161 -0
  60. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  61. package/dist/template/.opencode/skill/v0/SKILL.md +154 -0
  62. package/package.json +1 -1
@@ -1,39 +1,433 @@
1
1
  ---
2
- description: Restore, enhance, or upscale images
3
- argument-hint: "<image-path> [mode: enhance|upscale|restore|denoise]"
2
+ description: Restore, enhance, upscale, or improve image quality using AI
3
+ argument-hint: "<image-path> [mode: enhance|upscale|restore|denoise|colorize]"
4
4
  agent: vision
5
5
  model: proxypal/gemini-3-pro-image-preview
6
6
  ---
7
7
 
8
8
  # Restore Image: $ARGUMENTS
9
9
 
10
- Restore, enhance, or improve image quality.
10
+ Use AI to restore, enhance, or improve image quality.
11
11
 
12
- ## Instructions
12
+ ## Phase 1: Parse Input
13
13
 
14
- Parse from `$ARGUMENTS`:
14
+ ```typescript
15
+ const input = "$ARGUMENTS";
15
16
 
16
- - Image path
17
- - Mode (default: enhance)
17
+ const parseInput = (input: string) => {
18
+ const parts = input.split(" ");
19
+ const imagePath = parts[0];
20
+ const mode = parts[1] || "enhance";
18
21
 
19
- ## Modes
22
+ const validModes = [
23
+ "enhance",
24
+ "upscale",
25
+ "restore",
26
+ "denoise",
27
+ "colorize",
28
+ "sharpen",
29
+ "deblur",
30
+ ];
20
31
 
21
- - **enhance**: Improve overall quality, colors, sharpness
22
- - **upscale**: Increase resolution
23
- - **restore**: Fix artifacts, compression, damage
24
- - **denoise**: Remove noise while preserving detail
32
+ if (!validModes.includes(mode)) {
33
+ console.warn(`Unknown mode: ${mode}. Using 'enhance' as default.`);
34
+ return { imagePath, mode: "enhance" };
35
+ }
25
36
 
26
- ## Process
37
+ return { imagePath, mode };
38
+ };
39
+ ```
27
40
 
28
- 1. Analyze image quality issues
29
- 2. Apply appropriate restoration
30
- 3. Save to `.opencode/memory/design/restored/`
41
+ ## Phase 2: Analyze Source Image
31
42
 
32
- ## Output
43
+ ### Load and Examine
33
44
 
34
- Report:
45
+ ```typescript
46
+ read({ filePath: imagePath }); // Load image for analysis
47
+ ```
35
48
 
36
- - Issues detected
37
- - Improvements applied
38
- - Before/after comparison notes
39
- - Output path
49
+ ### Quality Assessment
50
+
51
+ ```
52
+ IMAGE ANALYSIS: [filename]
53
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━
54
+
55
+ Format: [PNG/JPG/WEBP/etc.]
56
+ Dimensions: [width] × [height] px
57
+ File Size: [size] KB
58
+ Color Depth: [8/16/24/32] bit
59
+ Color Space: [sRGB/Adobe RGB/etc.]
60
+
61
+ QUALITY METRICS
62
+ ───────────────
63
+ Overall Quality: [1-10 score]
64
+ Sharpness: [Low/Medium/High]
65
+ Noise Level: [None/Low/Medium/High]
66
+ Compression: [None/Low/Medium/Heavy]
67
+ Dynamic Range: [Narrow/Normal/Wide]
68
+
69
+ DETECTED ISSUES
70
+ ───────────────
71
+ [✓/✗] JPEG artifacts
72
+ [✓/✗] Noise (ISO grain)
73
+ [✓/✗] Motion blur
74
+ [✓/✗] Low resolution
75
+ [✓/✗] Color degradation
76
+ [✓/✗] Overexposure/Underexposure
77
+ [✓/✗] Scratches/Damage (for old photos)
78
+ ```
79
+
80
+ ## Phase 3: Select Restoration Mode
81
+
82
+ ### Mode Capabilities
83
+
84
+ ```
85
+ ┌─────────────────────────────────────────────────────────────────────────┐
86
+ │ RESTORATION MODES │
87
+ ├─────────────────────────────────────────────────────────────────────────┤
88
+ │ │
89
+ │ ENHANCE │
90
+ │ ├── Improves overall quality │
91
+ │ ├── Adjusts brightness, contrast, saturation │
92
+ │ ├── Sharpens details │
93
+ │ └── Best for: Photos that need general improvement │
94
+ │ │
95
+ │ UPSCALE │
96
+ │ ├── Increases resolution (2x or 4x) │
97
+ │ ├── Preserves details using AI │
98
+ │ ├── Adds realistic detail in enlargement │
99
+ │ └── Best for: Small images that need to be larger │
100
+ │ │
101
+ │ RESTORE │
102
+ │ ├── Removes artifacts and damage │
103
+ │ ├── Fixes compression issues │
104
+ │ ├── Repairs scratches and tears │
105
+ │ └── Best for: Old or damaged photos │
106
+ │ │
107
+ │ DENOISE │
108
+ │ ├── Removes noise while preserving detail │
109
+ │ ├── Handles ISO grain and sensor noise │
110
+ │ ├── Smooths backgrounds while keeping edges │
111
+ │ └── Best for: Low-light or high-ISO photos │
112
+ │ │
113
+ │ COLORIZE │
114
+ │ ├── Adds realistic color to B&W images │
115
+ │ ├── Uses AI to predict appropriate colors │
116
+ │ ├── Preserves original detail and texture │
117
+ │ └── Best for: Historical or B&W photos │
118
+ │ │
119
+ │ SHARPEN │
120
+ │ ├── Enhances edge definition │
121
+ │ ├── Brings out fine details │
122
+ │ ├── Avoids over-sharpening halos │
123
+ │ └── Best for: Slightly soft images │
124
+ │ │
125
+ │ DEBLUR │
126
+ │ ├── Removes motion blur │
127
+ │ ├── Corrects camera shake │
128
+ │ ├── Recovers lost detail │
129
+ │ └── Best for: Blurry photos from movement │
130
+ │ │
131
+ └─────────────────────────────────────────────────────────────────────────┘
132
+ ```
133
+
134
+ ### Auto-Mode Selection
135
+
136
+ If mode not specified or set to "auto":
137
+
138
+ ```typescript
139
+ const suggestMode = (analysis: ImageAnalysis) => {
140
+ if (analysis.hasJpegArtifacts || analysis.hasDamage) return "restore";
141
+ if (analysis.noiseLevel === "high") return "denoise";
142
+ if (analysis.isBlurry) return "deblur";
143
+ if (analysis.isSmall && analysis.needsEnlargement) return "upscale";
144
+ if (analysis.isBlackAndWhite) return "colorize";
145
+ if (analysis.isSoft) return "sharpen";
146
+ return "enhance"; // Default
147
+ };
148
+ ```
149
+
150
+ ## Phase 4: Apply Restoration
151
+
152
+ ### Restoration Parameters
153
+
154
+ ```typescript
155
+ const restorationParams = {
156
+ enhance: {
157
+ sharpness: 1.2, // Slight sharpening
158
+ contrast: 1.1, // Slight contrast boost
159
+ saturation: 1.05, // Subtle saturation
160
+ clarity: 1.15, // Midtone contrast
161
+ },
162
+ upscale: {
163
+ factor: 2, // 2x or 4x
164
+ model: "real-esrgan", // AI upscaling model
165
+ denoise: 0.3, // Light denoising
166
+ },
167
+ restore: {
168
+ removeArtifacts: true,
169
+ repairDamage: true,
170
+ enhanceColors: true,
171
+ },
172
+ denoise: {
173
+ strength: 0.5, // 0-1, higher = more aggressive
174
+ preserveDetail: true,
175
+ },
176
+ colorize: {
177
+ saturation: 0.8, // Avoid over-saturation
178
+ style: "natural", // natural, vivid, vintage
179
+ },
180
+ };
181
+ ```
182
+
183
+ ### Execute Restoration
184
+
185
+ ```
186
+ APPLYING RESTORATION
187
+ ━━━━━━━━━━━━━━━━━━━━
188
+
189
+ Mode: [selected mode]
190
+ Input: [original filename]
191
+
192
+ Processing Steps:
193
+ [1/4] Analyzing image content...
194
+ [2/4] Applying AI restoration...
195
+ [3/4] Optimizing output...
196
+ [4/4] Saving result...
197
+
198
+ ⏳ Estimated time: [X seconds]
199
+ ```
200
+
201
+ ## Phase 5: Output and Comparison
202
+
203
+ ### Save Restored Image
204
+
205
+ ```typescript
206
+ const outputPath = `.opencode/memory/design/restored/${filename}-${mode}-${timestamp}.png`;
207
+
208
+ write({
209
+ filePath: outputPath,
210
+ content: restoredImageData,
211
+ });
212
+ ```
213
+
214
+ ### Generate Comparison
215
+
216
+ ```
217
+ RESTORATION COMPLETE
218
+ ━━━━━━━━━━━━━━━━━━━━
219
+
220
+ Before After
221
+ ────────────────────────────────────────────
222
+ Dimensions 800×600 1600×1200
223
+ File Size 45 KB 189 KB
224
+ Sharpness Low High
225
+ Noise Level High Low
226
+ Quality Score 4/10 8/10
227
+
228
+
229
+ CHANGES APPLIED
230
+ ───────────────
231
+ ✓ Resolution increased 2x
232
+ ✓ Noise reduced by ~70%
233
+ ✓ Sharpness enhanced
234
+ ✓ JPEG artifacts removed
235
+ ✓ Color vibrancy improved
236
+
237
+ OUTPUT
238
+ ──────
239
+ Path: [outputPath]
240
+ Format: PNG (lossless)
241
+
242
+ Preview: [Image displayed if in vision-capable context]
243
+ ```
244
+
245
+ ## Phase 6: Version Management
246
+
247
+ ### Track Restoration History
248
+
249
+ ```typescript
250
+ const historyEntry = {
251
+ original: imagePath,
252
+ restored: outputPath,
253
+ mode: mode,
254
+ timestamp: new Date().toISOString(),
255
+ parameters: restorationParams[mode],
256
+ qualityBefore: analysis.overallScore,
257
+ qualityAfter: restoredAnalysis.overallScore,
258
+ };
259
+
260
+ // Append to history
261
+ const historyPath = `.opencode/memory/design/restored/history.json`;
262
+ ```
263
+
264
+ ### History Format
265
+
266
+ ```json
267
+ {
268
+ "restorations": [
269
+ {
270
+ "id": "restore-001",
271
+ "original": "photos/old-family.jpg",
272
+ "outputs": [
273
+ {
274
+ "mode": "restore",
275
+ "path": "restored/old-family-restore-1.png",
276
+ "timestamp": "2024-01-15T10:30:00Z"
277
+ },
278
+ {
279
+ "mode": "colorize",
280
+ "path": "restored/old-family-colorize-1.png",
281
+ "timestamp": "2024-01-15T10:35:00Z"
282
+ }
283
+ ]
284
+ }
285
+ ]
286
+ }
287
+ ```
288
+
289
+ ## Examples
290
+
291
+ ```bash
292
+ /restore-image photo.jpg # Auto-detect best mode
293
+ /restore-image photo.jpg enhance # General enhancement
294
+ /restore-image photo.jpg upscale # 2x resolution increase
295
+ /restore-image old-photo.jpg restore # Fix damage and artifacts
296
+ /restore-image noisy.jpg denoise # Remove noise
297
+ /restore-image bw-photo.jpg colorize # Add color to B&W
298
+ /restore-image soft.jpg sharpen # Increase sharpness
299
+ /restore-image blurry.jpg deblur # Remove motion blur
300
+ ```
301
+
302
+ ## Batch Processing
303
+
304
+ For multiple images:
305
+
306
+ ```bash
307
+ /restore-image "photos/*.jpg" enhance
308
+ ```
309
+
310
+ ```
311
+ BATCH RESTORATION
312
+ ━━━━━━━━━━━━━━━━━
313
+
314
+ Found: 12 images
315
+ Mode: enhance
316
+
317
+ Progress:
318
+ [████████░░░░░░░░░░░░] 8/12
319
+
320
+ Results:
321
+ ✓ photo-001.jpg → enhanced (6/10 → 8/10)
322
+ ✓ photo-002.jpg → enhanced (5/10 → 7/10)
323
+ ✓ photo-003.jpg → enhanced (4/10 → 8/10)
324
+ ⚠ photo-004.jpg → skipped (already high quality)
325
+ ...
326
+
327
+ Summary:
328
+ - Processed: 11/12
329
+ - Skipped: 1 (already optimized)
330
+ - Avg improvement: +2.3 quality points
331
+ ```
332
+
333
+ ## Quality Presets
334
+
335
+ ### Conservative (preserve original character)
336
+
337
+ ```typescript
338
+ {
339
+ sharpness: 1.05,
340
+ denoise: 0.2,
341
+ preserveGrain: true
342
+ }
343
+ ```
344
+
345
+ ### Balanced (recommended default)
346
+
347
+ ```typescript
348
+ {
349
+ sharpness: 1.2,
350
+ denoise: 0.4,
351
+ preserveGrain: false
352
+ }
353
+ ```
354
+
355
+ ### Aggressive (maximum enhancement)
356
+
357
+ ```typescript
358
+ {
359
+ sharpness: 1.5,
360
+ denoise: 0.7,
361
+ contrast: 1.2
362
+ }
363
+ ```
364
+
365
+ ## Error Handling
366
+
367
+ ```
368
+ [If unsupported format:]
369
+ ERROR: Format not supported: .tiff
370
+
371
+ Supported formats:
372
+ - JPEG (.jpg, .jpeg)
373
+ - PNG (.png)
374
+ - WebP (.webp)
375
+ - BMP (.bmp)
376
+
377
+ Convert first: /edit-image photo.tiff --convert png
378
+
379
+
380
+ [If image too large:]
381
+ WARNING: Image is very large (8000×6000)
382
+
383
+ Options:
384
+ 1. Process at reduced size (faster, ~30 sec)
385
+ 2. Process at full size (slower, ~2 min)
386
+ 3. Cancel
387
+
388
+ [If restoration fails:]
389
+ ERROR: Restoration failed
390
+
391
+ Possible causes:
392
+ - Image is corrupted
393
+ - Insufficient contrast for analysis
394
+ - Format incompatibility
395
+
396
+ Try:
397
+ - Different mode: /restore-image photo.jpg restore
398
+ - Manual enhancement: /edit-image photo.jpg
399
+ ```
400
+
401
+ ## Output Options
402
+
403
+ ### Format Selection
404
+
405
+ ```bash
406
+ /restore-image photo.jpg enhance --format webp # Output as WebP
407
+ /restore-image photo.jpg upscale --format png # Output as PNG (lossless)
408
+ ```
409
+
410
+ ### Quality Settings
411
+
412
+ ```bash
413
+ /restore-image photo.jpg enhance --quality 90 # JPEG quality 90%
414
+ /restore-image photo.jpg upscale --factor 4 # 4x upscale
415
+ ```
416
+
417
+ ## Limitations
418
+
419
+ ```
420
+ CURRENT LIMITATIONS
421
+ ━━━━━━━━━━━━━━━━━━━
422
+
423
+ - Maximum input size: 4096×4096 px
424
+ - Maximum upscale: 4x
425
+ - Colorization may not match historical accuracy
426
+ - Heavy blur may not be fully recoverable
427
+ - Severely damaged images may need manual editing
428
+
429
+ For best results:
430
+ - Start with highest quality source available
431
+ - Use mode matching the specific issue
432
+ - Review output and iterate if needed
433
+ ```