@deckio/deck-engine 1.7.6 → 1.7.8
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/components/BottomBar.jsx +9 -9
- package/components/BottomBar.module.css +17 -17
- package/components/Navigation.jsx +155 -106
- package/components/Navigation.module.css +154 -145
- package/components/Slide.jsx +15 -15
- package/components/exportDeckPdf.js +133 -0
- package/context/SlideContext.jsx +171 -171
- package/index.js +5 -5
- package/instructions/AGENTS.md +26 -26
- package/instructions/deck-config.instructions.md +34 -34
- package/instructions/deck-project.instructions.md +34 -34
- package/instructions/slide-css.instructions.md +91 -91
- package/instructions/slide-jsx.instructions.md +34 -34
- package/package.json +49 -45
- package/scripts/capture-screen.mjs +110 -110
- package/scripts/export-pdf.mjs +287 -287
- package/scripts/generate-image.mjs +110 -110
- package/scripts/init-project.mjs +214 -214
- package/skills/deck-add-slide/SKILL.md +217 -217
- package/skills/deck-delete-slide/SKILL.md +51 -51
- package/skills/deck-generate-image/SKILL.md +85 -85
- package/skills/deck-inspect/SKILL.md +60 -60
- package/skills/deck-sketch/SKILL.md +91 -91
- package/skills/deck-validate-project/SKILL.md +80 -80
- package/slides/GenericThankYouSlide.jsx +31 -31
- package/slides/ThankYouSlide.module.css +131 -131
- package/styles/global.css +191 -191
- package/vite.js +26 -26
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deck-generate-image
|
|
3
|
-
description: Generate images (icons, illustrations, diagrams) using chatgpt-image-latest for use in slide components. Use this when a slide needs a visual element too complex for pure HTML/CSS.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Generate Images for Slides
|
|
7
|
-
|
|
8
|
-
Generate images via the OpenAI **Image API** with `chatgpt-image-latest` for specific visual elements within slides.
|
|
9
|
-
|
|
10
|
-
> If `chatgpt-image-latest` returns a 403, pass `--model gpt-image-1.5` as a fallback.
|
|
11
|
-
|
|
12
|
-
## When to use
|
|
13
|
-
|
|
14
|
-
- A slide needs an **icon or illustration** that doesn't exist in the codebase.
|
|
15
|
-
- A sketch element is too detailed to reproduce with CSS.
|
|
16
|
-
- The user explicitly asks for a generated graphic.
|
|
17
|
-
|
|
18
|
-
## When NOT to use
|
|
19
|
-
|
|
20
|
-
- For entire slides — use **deck-add-slide** instead.
|
|
21
|
-
- For simple shapes — use CSS or inline SVG.
|
|
22
|
-
- For logos or photos — source them directly.
|
|
23
|
-
|
|
24
|
-
## Prerequisites
|
|
25
|
-
|
|
26
|
-
The `OPENAI_API_KEY` must be set. Create/edit `.env` in the project root:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
OPENAI_API_KEY=sk-proj-...
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Workflow
|
|
33
|
-
|
|
34
|
-
### Step 1 — Craft the prompt
|
|
35
|
-
|
|
36
|
-
Write a detailed prompt including:
|
|
37
|
-
|
|
38
|
-
- **Subject** — what the image depicts.
|
|
39
|
-
- **Style** — flat icon, line art, illustration, isometric, etc.
|
|
40
|
-
- **Colors** — match the design system: `#0d1117` (bg-deep), `#58a6ff` (accent), `#3fb950` (green), `#bc8cff` (purple).
|
|
41
|
-
- **Background** — almost always "transparent background".
|
|
42
|
-
- **Aspect ratio** — square (1024x1024) for icons, wide (1536x1024) for banners.
|
|
43
|
-
|
|
44
|
-
### Step 2 — Generate
|
|
45
|
-
|
|
46
|
-
Run from the project root:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
node node_modules/@deckio/deck-engine/scripts/generate-image.mjs --prompt "your prompt" --name my-icon
|
|
50
|
-
node node_modules/@deckio/deck-engine/scripts/generate-image.mjs --prompt "..." --name hero --size 1536x1024
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
| Flag | Description | Default |
|
|
54
|
-
|---|---|---|
|
|
55
|
-
| `--prompt` | Image description (required) | — |
|
|
56
|
-
| `--name` | Filename without extension (required) | — |
|
|
57
|
-
| `--size` | `1024x1024`, `1536x1024`, `1024x1536`, `auto` | `1024x1024` |
|
|
58
|
-
| `--quality` | `low`, `medium`, `high`, `auto` | `auto` |
|
|
59
|
-
| `--model` | OpenAI model | `chatgpt-image-latest` |
|
|
60
|
-
|
|
61
|
-
Images are saved to `src/data/generated/`.
|
|
62
|
-
|
|
63
|
-
### Step 3 — Use in a slide
|
|
64
|
-
|
|
65
|
-
```jsx
|
|
66
|
-
import myIcon from '../data/generated/my-icon.png'
|
|
67
|
-
|
|
68
|
-
<img src={myIcon} alt="Bridge icon" style={{ width: 120, height: 120 }} />
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Step 4 — Iterate
|
|
72
|
-
|
|
73
|
-
If the image doesn't match expectations, refine the prompt and re-run with the same `--name` to overwrite. Use **deck-eyes** to verify how it looks in the slide.
|
|
74
|
-
|
|
75
|
-
## SVG alternative
|
|
76
|
-
|
|
77
|
-
For simple icons, write SVG markup directly in JSX:
|
|
78
|
-
|
|
79
|
-
```jsx
|
|
80
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
81
|
-
<circle cx="24" cy="24" r="20" stroke="#58a6ff" strokeWidth="2" />
|
|
82
|
-
</svg>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Prefer inline SVG for geometric shapes. Use image generation for complex illustrations.
|
|
1
|
+
---
|
|
2
|
+
name: deck-generate-image
|
|
3
|
+
description: Generate images (icons, illustrations, diagrams) using chatgpt-image-latest for use in slide components. Use this when a slide needs a visual element too complex for pure HTML/CSS.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Generate Images for Slides
|
|
7
|
+
|
|
8
|
+
Generate images via the OpenAI **Image API** with `chatgpt-image-latest` for specific visual elements within slides.
|
|
9
|
+
|
|
10
|
+
> If `chatgpt-image-latest` returns a 403, pass `--model gpt-image-1.5` as a fallback.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- A slide needs an **icon or illustration** that doesn't exist in the codebase.
|
|
15
|
+
- A sketch element is too detailed to reproduce with CSS.
|
|
16
|
+
- The user explicitly asks for a generated graphic.
|
|
17
|
+
|
|
18
|
+
## When NOT to use
|
|
19
|
+
|
|
20
|
+
- For entire slides — use **deck-add-slide** instead.
|
|
21
|
+
- For simple shapes — use CSS or inline SVG.
|
|
22
|
+
- For logos or photos — source them directly.
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
The `OPENAI_API_KEY` must be set. Create/edit `.env` in the project root:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
OPENAI_API_KEY=sk-proj-...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Workflow
|
|
33
|
+
|
|
34
|
+
### Step 1 — Craft the prompt
|
|
35
|
+
|
|
36
|
+
Write a detailed prompt including:
|
|
37
|
+
|
|
38
|
+
- **Subject** — what the image depicts.
|
|
39
|
+
- **Style** — flat icon, line art, illustration, isometric, etc.
|
|
40
|
+
- **Colors** — match the design system: `#0d1117` (bg-deep), `#58a6ff` (accent), `#3fb950` (green), `#bc8cff` (purple).
|
|
41
|
+
- **Background** — almost always "transparent background".
|
|
42
|
+
- **Aspect ratio** — square (1024x1024) for icons, wide (1536x1024) for banners.
|
|
43
|
+
|
|
44
|
+
### Step 2 — Generate
|
|
45
|
+
|
|
46
|
+
Run from the project root:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
node node_modules/@deckio/deck-engine/scripts/generate-image.mjs --prompt "your prompt" --name my-icon
|
|
50
|
+
node node_modules/@deckio/deck-engine/scripts/generate-image.mjs --prompt "..." --name hero --size 1536x1024
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
| Flag | Description | Default |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `--prompt` | Image description (required) | — |
|
|
56
|
+
| `--name` | Filename without extension (required) | — |
|
|
57
|
+
| `--size` | `1024x1024`, `1536x1024`, `1024x1536`, `auto` | `1024x1024` |
|
|
58
|
+
| `--quality` | `low`, `medium`, `high`, `auto` | `auto` |
|
|
59
|
+
| `--model` | OpenAI model | `chatgpt-image-latest` |
|
|
60
|
+
|
|
61
|
+
Images are saved to `src/data/generated/`.
|
|
62
|
+
|
|
63
|
+
### Step 3 — Use in a slide
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
import myIcon from '../data/generated/my-icon.png'
|
|
67
|
+
|
|
68
|
+
<img src={myIcon} alt="Bridge icon" style={{ width: 120, height: 120 }} />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Step 4 — Iterate
|
|
72
|
+
|
|
73
|
+
If the image doesn't match expectations, refine the prompt and re-run with the same `--name` to overwrite. Use **deck-eyes** to verify how it looks in the slide.
|
|
74
|
+
|
|
75
|
+
## SVG alternative
|
|
76
|
+
|
|
77
|
+
For simple icons, write SVG markup directly in JSX:
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
81
|
+
<circle cx="24" cy="24" r="20" stroke="#58a6ff" strokeWidth="2" />
|
|
82
|
+
</svg>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Prefer inline SVG for geometric shapes. Use image generation for complex illustrations.
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deck-inspect
|
|
3
|
-
description: Capture a screenshot of the deck app to visually inspect slides. Use this when asked to look at, see, view, inspect, check visually, or preview a slide.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Visual Inspection — Capture a Slide Screenshot
|
|
7
|
-
|
|
8
|
-
Captures a screenshot of the running deck using VS Code browser tools (Edge "Sharing with Agent").
|
|
9
|
-
|
|
10
|
-
## Deciding what to capture
|
|
11
|
-
|
|
12
|
-
1. **Slide** — resolve in this order:
|
|
13
|
-
- If the user said "slide 3" or "the cover slide" → map to a 1-based number.
|
|
14
|
-
- If you just created or edited a specific slide → use that slide's array position + 1.
|
|
15
|
-
- If not specified → capture slide 1.
|
|
16
|
-
|
|
17
|
-
## Prerequisites
|
|
18
|
-
|
|
19
|
-
The dev server must be running. Check `.github/memory/state.md` for the port. Default is `5173`.
|
|
20
|
-
|
|
21
|
-
## Workflow
|
|
22
|
-
|
|
23
|
-
### Step 1 — Open or reuse a browser page
|
|
24
|
-
|
|
25
|
-
Check the attached browser pages for an existing deck tab. If none exists, open one:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
open_browser_page → http://localhost:<port>/#/<project-id>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Read `project` and `port` from `.github/memory/state.md` if not known.
|
|
32
|
-
|
|
33
|
-
### Step 2 — Navigate to the target slide
|
|
34
|
-
|
|
35
|
-
The deck opens on slide 1. To reach slide N, press `ArrowRight` (N − 1) times:
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
// run_playwright_code on the page
|
|
39
|
-
for (let i = 0; i < N - 1; i++) {
|
|
40
|
-
await page.keyboard.press('ArrowRight');
|
|
41
|
-
await page.waitForTimeout(300);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If the page is already on a different slide, navigate to slide 1 first by pressing `Home`, then advance forward.
|
|
46
|
-
|
|
47
|
-
### Step 3 — Take a screenshot
|
|
48
|
-
|
|
49
|
-
Use `screenshot_page` with the page ID to capture the current view. The screenshot is returned inline — no file path needed.
|
|
50
|
-
|
|
51
|
-
### Step 4 — Inspect and report
|
|
52
|
-
|
|
53
|
-
Study the screenshot and check for:
|
|
54
|
-
- Layout alignment and spacing
|
|
55
|
-
- Typography (size, weight, color)
|
|
56
|
-
- Missing or broken elements
|
|
57
|
-
- Color and contrast issues
|
|
58
|
-
- Overflow or clipping
|
|
59
|
-
|
|
60
|
-
Report any issues found to the user.
|
|
1
|
+
---
|
|
2
|
+
name: deck-inspect
|
|
3
|
+
description: Capture a screenshot of the deck app to visually inspect slides. Use this when asked to look at, see, view, inspect, check visually, or preview a slide.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Visual Inspection — Capture a Slide Screenshot
|
|
7
|
+
|
|
8
|
+
Captures a screenshot of the running deck using VS Code browser tools (Edge "Sharing with Agent").
|
|
9
|
+
|
|
10
|
+
## Deciding what to capture
|
|
11
|
+
|
|
12
|
+
1. **Slide** — resolve in this order:
|
|
13
|
+
- If the user said "slide 3" or "the cover slide" → map to a 1-based number.
|
|
14
|
+
- If you just created or edited a specific slide → use that slide's array position + 1.
|
|
15
|
+
- If not specified → capture slide 1.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
The dev server must be running. Check `.github/memory/state.md` for the port. Default is `5173`.
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Step 1 — Open or reuse a browser page
|
|
24
|
+
|
|
25
|
+
Check the attached browser pages for an existing deck tab. If none exists, open one:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
open_browser_page → http://localhost:<port>/#/<project-id>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Read `project` and `port` from `.github/memory/state.md` if not known.
|
|
32
|
+
|
|
33
|
+
### Step 2 — Navigate to the target slide
|
|
34
|
+
|
|
35
|
+
The deck opens on slide 1. To reach slide N, press `ArrowRight` (N − 1) times:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
// run_playwright_code on the page
|
|
39
|
+
for (let i = 0; i < N - 1; i++) {
|
|
40
|
+
await page.keyboard.press('ArrowRight');
|
|
41
|
+
await page.waitForTimeout(300);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If the page is already on a different slide, navigate to slide 1 first by pressing `Home`, then advance forward.
|
|
46
|
+
|
|
47
|
+
### Step 3 — Take a screenshot
|
|
48
|
+
|
|
49
|
+
Use `screenshot_page` with the page ID to capture the current view. The screenshot is returned inline — no file path needed.
|
|
50
|
+
|
|
51
|
+
### Step 4 — Inspect and report
|
|
52
|
+
|
|
53
|
+
Study the screenshot and check for:
|
|
54
|
+
- Layout alignment and spacing
|
|
55
|
+
- Typography (size, weight, color)
|
|
56
|
+
- Missing or broken elements
|
|
57
|
+
- Color and contrast issues
|
|
58
|
+
- Overflow or clipping
|
|
59
|
+
|
|
60
|
+
Report any issues found to the user.
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deck-sketch
|
|
3
|
-
description: Sketch a slide on Whiteboard, capture the sketch, and use it as inspiration to create a new slide. Use this when the user wants to draw, sketch, or wireframe a slide before building it.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Sketch a Slide
|
|
7
|
-
|
|
8
|
-
Use Whiteboard to sketch a slide layout, capture the result, and translate it into a real slide component.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
|
|
12
|
-
### Step 1 — Open Whiteboard
|
|
13
|
-
|
|
14
|
-
```powershell
|
|
15
|
-
Start-Process "ms-whiteboard-cmd:"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Tell the user:
|
|
19
|
-
|
|
20
|
-
> **Whiteboard is open. Sketch your slide layout. When you're done, use "Fit to screen" (Ctrl+Shift+F) so the entire sketch is visible, then tell me you're ready.**
|
|
21
|
-
|
|
22
|
-
**STOP here.** Do NOT proceed until the user explicitly says the sketch is ready.
|
|
23
|
-
|
|
24
|
-
### Step 2 — Capture the sketch
|
|
25
|
-
|
|
26
|
-
When the user says the sketch is ready:
|
|
27
|
-
|
|
28
|
-
```powershell
|
|
29
|
-
Add-Type @"
|
|
30
|
-
using System;
|
|
31
|
-
using System.Runtime.InteropServices;
|
|
32
|
-
using System.Drawing;
|
|
33
|
-
public class WinCapture {
|
|
34
|
-
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h);
|
|
35
|
-
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr h, out RECT r);
|
|
36
|
-
[DllImport("user32.dll")] public static extern bool SetProcessDPIAware();
|
|
37
|
-
[StructLayout(LayoutKind.Sequential)] public struct RECT { public int L, T, R, B; }
|
|
38
|
-
}
|
|
39
|
-
"@
|
|
40
|
-
[WinCapture]::SetProcessDPIAware() | Out-Null
|
|
41
|
-
Add-Type -AssemblyName System.Drawing
|
|
42
|
-
$h = (Get-Process | Where-Object { $_.MainWindowTitle -like '*Whiteboard*' } | Select-Object -First 1).MainWindowHandle
|
|
43
|
-
if (!$h -or $h -eq [IntPtr]::Zero) { Write-Error "Whiteboard window not found"; return }
|
|
44
|
-
[WinCapture]::SetForegroundWindow($h) | Out-Null
|
|
45
|
-
Start-Sleep -Milliseconds 500
|
|
46
|
-
$r = New-Object WinCapture+RECT
|
|
47
|
-
[WinCapture]::GetWindowRect($h, [ref]$r) | Out-Null
|
|
48
|
-
$w = $r.R - $r.L; $ht = $r.B - $r.T
|
|
49
|
-
$bmp = New-Object Drawing.Bitmap $w, $ht
|
|
50
|
-
$g = [Drawing.Graphics]::FromImage($bmp)
|
|
51
|
-
$g.CopyFromScreen($r.L, $r.T, 0, 0, (New-Object Drawing.Size $w, $ht))
|
|
52
|
-
$dir = ".github\eyes"
|
|
53
|
-
if (!(Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
|
|
54
|
-
$file = Join-Path $dir "sketch-$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss').png"
|
|
55
|
-
$bmp.Save($file)
|
|
56
|
-
$g.Dispose(); $bmp.Dispose()
|
|
57
|
-
Write-Host "Sketch saved: $file"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Step 3 — Analyze the sketch
|
|
61
|
-
|
|
62
|
-
Reference the saved screenshot image. Study it carefully and identify:
|
|
63
|
-
|
|
64
|
-
- **Layout structure** — columns/rows, content zones, header/footer areas.
|
|
65
|
-
- **Text elements** — headings, labels, bullet points, callouts.
|
|
66
|
-
- **Visual elements** — boxes, icons, images, dividers, backgrounds.
|
|
67
|
-
- **Data patterns** — tables, grids, lists, charts, metrics.
|
|
68
|
-
|
|
69
|
-
Describe what you see back to the user and confirm your interpretation.
|
|
70
|
-
|
|
71
|
-
### Step 4 — Create the slide
|
|
72
|
-
|
|
73
|
-
Use the **deck-add-slide** skill to build the slide, guided by the sketch:
|
|
74
|
-
|
|
75
|
-
1. Map sketch regions to CSS Grid or Flexbox layout.
|
|
76
|
-
2. Translate hand-drawn text into real content with proper typography.
|
|
77
|
-
3. Replace rough shapes with styled `<div>` containers using CSS Modules.
|
|
78
|
-
4. Follow all deck-add-slide conventions (accent-bar, content-frame, BottomBar, imports from `@deckio/deck-engine`).
|
|
79
|
-
5. Register the slide in `deck.config.js`.
|
|
80
|
-
|
|
81
|
-
### Step 5 — Visual verification
|
|
82
|
-
|
|
83
|
-
After creating the slide, use **deck-eyes** to capture a screenshot of the rendered result.
|
|
84
|
-
|
|
85
|
-
Compare the rendered slide against the original sketch. If the user is present, show both and ask if adjustments are needed.
|
|
86
|
-
|
|
87
|
-
## Notes
|
|
88
|
-
|
|
89
|
-
- Whiteboard sketches are rough — interpret intent, not exact pixels.
|
|
90
|
-
- If text is hard to read, ask the user to clarify.
|
|
91
|
-
- Screenshots are saved under `.github/eyes/` (gitignored) with a `sketch-` prefix.
|
|
1
|
+
---
|
|
2
|
+
name: deck-sketch
|
|
3
|
+
description: Sketch a slide on Whiteboard, capture the sketch, and use it as inspiration to create a new slide. Use this when the user wants to draw, sketch, or wireframe a slide before building it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sketch a Slide
|
|
7
|
+
|
|
8
|
+
Use Whiteboard to sketch a slide layout, capture the result, and translate it into a real slide component.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### Step 1 — Open Whiteboard
|
|
13
|
+
|
|
14
|
+
```powershell
|
|
15
|
+
Start-Process "ms-whiteboard-cmd:"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Tell the user:
|
|
19
|
+
|
|
20
|
+
> **Whiteboard is open. Sketch your slide layout. When you're done, use "Fit to screen" (Ctrl+Shift+F) so the entire sketch is visible, then tell me you're ready.**
|
|
21
|
+
|
|
22
|
+
**STOP here.** Do NOT proceed until the user explicitly says the sketch is ready.
|
|
23
|
+
|
|
24
|
+
### Step 2 — Capture the sketch
|
|
25
|
+
|
|
26
|
+
When the user says the sketch is ready:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
Add-Type @"
|
|
30
|
+
using System;
|
|
31
|
+
using System.Runtime.InteropServices;
|
|
32
|
+
using System.Drawing;
|
|
33
|
+
public class WinCapture {
|
|
34
|
+
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h);
|
|
35
|
+
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr h, out RECT r);
|
|
36
|
+
[DllImport("user32.dll")] public static extern bool SetProcessDPIAware();
|
|
37
|
+
[StructLayout(LayoutKind.Sequential)] public struct RECT { public int L, T, R, B; }
|
|
38
|
+
}
|
|
39
|
+
"@
|
|
40
|
+
[WinCapture]::SetProcessDPIAware() | Out-Null
|
|
41
|
+
Add-Type -AssemblyName System.Drawing
|
|
42
|
+
$h = (Get-Process | Where-Object { $_.MainWindowTitle -like '*Whiteboard*' } | Select-Object -First 1).MainWindowHandle
|
|
43
|
+
if (!$h -or $h -eq [IntPtr]::Zero) { Write-Error "Whiteboard window not found"; return }
|
|
44
|
+
[WinCapture]::SetForegroundWindow($h) | Out-Null
|
|
45
|
+
Start-Sleep -Milliseconds 500
|
|
46
|
+
$r = New-Object WinCapture+RECT
|
|
47
|
+
[WinCapture]::GetWindowRect($h, [ref]$r) | Out-Null
|
|
48
|
+
$w = $r.R - $r.L; $ht = $r.B - $r.T
|
|
49
|
+
$bmp = New-Object Drawing.Bitmap $w, $ht
|
|
50
|
+
$g = [Drawing.Graphics]::FromImage($bmp)
|
|
51
|
+
$g.CopyFromScreen($r.L, $r.T, 0, 0, (New-Object Drawing.Size $w, $ht))
|
|
52
|
+
$dir = ".github\eyes"
|
|
53
|
+
if (!(Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
|
|
54
|
+
$file = Join-Path $dir "sketch-$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss').png"
|
|
55
|
+
$bmp.Save($file)
|
|
56
|
+
$g.Dispose(); $bmp.Dispose()
|
|
57
|
+
Write-Host "Sketch saved: $file"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Step 3 — Analyze the sketch
|
|
61
|
+
|
|
62
|
+
Reference the saved screenshot image. Study it carefully and identify:
|
|
63
|
+
|
|
64
|
+
- **Layout structure** — columns/rows, content zones, header/footer areas.
|
|
65
|
+
- **Text elements** — headings, labels, bullet points, callouts.
|
|
66
|
+
- **Visual elements** — boxes, icons, images, dividers, backgrounds.
|
|
67
|
+
- **Data patterns** — tables, grids, lists, charts, metrics.
|
|
68
|
+
|
|
69
|
+
Describe what you see back to the user and confirm your interpretation.
|
|
70
|
+
|
|
71
|
+
### Step 4 — Create the slide
|
|
72
|
+
|
|
73
|
+
Use the **deck-add-slide** skill to build the slide, guided by the sketch:
|
|
74
|
+
|
|
75
|
+
1. Map sketch regions to CSS Grid or Flexbox layout.
|
|
76
|
+
2. Translate hand-drawn text into real content with proper typography.
|
|
77
|
+
3. Replace rough shapes with styled `<div>` containers using CSS Modules.
|
|
78
|
+
4. Follow all deck-add-slide conventions (accent-bar, content-frame, BottomBar, imports from `@deckio/deck-engine`).
|
|
79
|
+
5. Register the slide in `deck.config.js`.
|
|
80
|
+
|
|
81
|
+
### Step 5 — Visual verification
|
|
82
|
+
|
|
83
|
+
After creating the slide, use **deck-eyes** to capture a screenshot of the rendered result.
|
|
84
|
+
|
|
85
|
+
Compare the rendered slide against the original sketch. If the user is present, show both and ask if adjustments are needed.
|
|
86
|
+
|
|
87
|
+
## Notes
|
|
88
|
+
|
|
89
|
+
- Whiteboard sketches are rough — interpret intent, not exact pixels.
|
|
90
|
+
- If text is hard to read, ask the user to clarify.
|
|
91
|
+
- Screenshots are saved under `.github/eyes/` (gitignored) with a `sketch-` prefix.
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deck-validate-project
|
|
3
|
-
description: Validate and audit a deck project for correctness. Use this when asked to validate, audit, polish, review, check, or verify slides.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Validate & Audit a Deck Project
|
|
7
|
-
|
|
8
|
-
## Step 1: Audit deck.config.js
|
|
9
|
-
|
|
10
|
-
Open `deck.config.js` and verify:
|
|
11
|
-
|
|
12
|
-
### 1a. All imports resolve
|
|
13
|
-
|
|
14
|
-
For each slide import at the top of the file, verify the target file exists in `src/slides/`.
|
|
15
|
-
|
|
16
|
-
### 1b. slides array matches imports
|
|
17
|
-
|
|
18
|
-
- Every imported slide should appear in the `slides` array.
|
|
19
|
-
- No unused imports (imported but not in the array).
|
|
20
|
-
- No undefined entries in the array (in array but not imported).
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Step 2: Verify slide structure
|
|
25
|
-
|
|
26
|
-
For each slide `.jsx` file in `src/slides/`, verify:
|
|
27
|
-
|
|
28
|
-
- [ ] Imports `{ Slide }` and `{ BottomBar }` from `'@deckio/deck-engine'`
|
|
29
|
-
- [ ] Wrapped in `<Slide index={index} className={styles.xxx}>` (accepts `index` as prop)
|
|
30
|
-
- [ ] Contains `<div className="accent-bar" />` as first child
|
|
31
|
-
- [ ] Contains at least one decorative orb
|
|
32
|
-
- [ ] Content is inside `<div className="content-frame content-gutter">`
|
|
33
|
-
- [ ] `<BottomBar />` is the **last child** inside `<Slide>`
|
|
34
|
-
- [ ] `BottomBar text` is consistent across all slides in the project
|
|
35
|
-
|
|
36
|
-
For each `.module.css` file, verify the root class has:
|
|
37
|
-
- [ ] `background: var(--bg-deep)`
|
|
38
|
-
- [ ] `flex-direction: column`
|
|
39
|
-
- [ ] `padding: 0 0 44px 0`
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Step 3: Check companion files
|
|
44
|
-
|
|
45
|
-
- Every `.jsx` slide in `src/slides/` should have a matching `.module.css` file
|
|
46
|
-
- No orphaned `.module.css` files without a matching `.jsx`
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Step 4: Verify metadata
|
|
51
|
-
|
|
52
|
-
Check `deck.config.js` exports these fields:
|
|
53
|
-
- [ ] `id` — string, matches the project folder name convention
|
|
54
|
-
- [ ] `title` — display name
|
|
55
|
-
- [ ] `subtitle` — tagline
|
|
56
|
-
- [ ] `icon` — emoji
|
|
57
|
-
- [ ] `accent` — CSS color value
|
|
58
|
-
- [ ] `slides` — non-empty array
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Step 5: Report results
|
|
63
|
-
|
|
64
|
-
Summarize findings:
|
|
65
|
-
|
|
66
|
-
- Number of slides validated
|
|
67
|
-
- Any issues found and fixed (missing files, broken imports, structural issues)
|
|
68
|
-
- Overall project health: **pass** or **issues found**
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Quick checklist
|
|
73
|
-
|
|
74
|
-
- [ ] All imports in `deck.config.js` resolve to existing files
|
|
75
|
-
- [ ] `slides` array matches imports (no unused, no missing)
|
|
76
|
-
- [ ] Every `.jsx` slide has a companion `.module.css`
|
|
77
|
-
- [ ] All slides have accent-bar, content-frame, BottomBar
|
|
78
|
-
- [ ] BottomBar text is consistent across the project
|
|
79
|
-
- [ ] CSS root classes have required properties
|
|
80
|
-
- [ ] Project metadata (id, title, subtitle, icon, accent) is present
|
|
1
|
+
---
|
|
2
|
+
name: deck-validate-project
|
|
3
|
+
description: Validate and audit a deck project for correctness. Use this when asked to validate, audit, polish, review, check, or verify slides.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Validate & Audit a Deck Project
|
|
7
|
+
|
|
8
|
+
## Step 1: Audit deck.config.js
|
|
9
|
+
|
|
10
|
+
Open `deck.config.js` and verify:
|
|
11
|
+
|
|
12
|
+
### 1a. All imports resolve
|
|
13
|
+
|
|
14
|
+
For each slide import at the top of the file, verify the target file exists in `src/slides/`.
|
|
15
|
+
|
|
16
|
+
### 1b. slides array matches imports
|
|
17
|
+
|
|
18
|
+
- Every imported slide should appear in the `slides` array.
|
|
19
|
+
- No unused imports (imported but not in the array).
|
|
20
|
+
- No undefined entries in the array (in array but not imported).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 2: Verify slide structure
|
|
25
|
+
|
|
26
|
+
For each slide `.jsx` file in `src/slides/`, verify:
|
|
27
|
+
|
|
28
|
+
- [ ] Imports `{ Slide }` and `{ BottomBar }` from `'@deckio/deck-engine'`
|
|
29
|
+
- [ ] Wrapped in `<Slide index={index} className={styles.xxx}>` (accepts `index` as prop)
|
|
30
|
+
- [ ] Contains `<div className="accent-bar" />` as first child
|
|
31
|
+
- [ ] Contains at least one decorative orb
|
|
32
|
+
- [ ] Content is inside `<div className="content-frame content-gutter">`
|
|
33
|
+
- [ ] `<BottomBar />` is the **last child** inside `<Slide>`
|
|
34
|
+
- [ ] `BottomBar text` is consistent across all slides in the project
|
|
35
|
+
|
|
36
|
+
For each `.module.css` file, verify the root class has:
|
|
37
|
+
- [ ] `background: var(--bg-deep)`
|
|
38
|
+
- [ ] `flex-direction: column`
|
|
39
|
+
- [ ] `padding: 0 0 44px 0`
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 3: Check companion files
|
|
44
|
+
|
|
45
|
+
- Every `.jsx` slide in `src/slides/` should have a matching `.module.css` file
|
|
46
|
+
- No orphaned `.module.css` files without a matching `.jsx`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Step 4: Verify metadata
|
|
51
|
+
|
|
52
|
+
Check `deck.config.js` exports these fields:
|
|
53
|
+
- [ ] `id` — string, matches the project folder name convention
|
|
54
|
+
- [ ] `title` — display name
|
|
55
|
+
- [ ] `subtitle` — tagline
|
|
56
|
+
- [ ] `icon` — emoji
|
|
57
|
+
- [ ] `accent` — CSS color value
|
|
58
|
+
- [ ] `slides` — non-empty array
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 5: Report results
|
|
63
|
+
|
|
64
|
+
Summarize findings:
|
|
65
|
+
|
|
66
|
+
- Number of slides validated
|
|
67
|
+
- Any issues found and fixed (missing files, broken imports, structural issues)
|
|
68
|
+
- Overall project health: **pass** or **issues found**
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick checklist
|
|
73
|
+
|
|
74
|
+
- [ ] All imports in `deck.config.js` resolve to existing files
|
|
75
|
+
- [ ] `slides` array matches imports (no unused, no missing)
|
|
76
|
+
- [ ] Every `.jsx` slide has a companion `.module.css`
|
|
77
|
+
- [ ] All slides have accent-bar, content-frame, BottomBar
|
|
78
|
+
- [ ] BottomBar text is consistent across the project
|
|
79
|
+
- [ ] CSS root classes have required properties
|
|
80
|
+
- [ ] Project metadata (id, title, subtitle, icon, accent) is present
|