Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
3154dd6
feat(skills): brief-first picker flow, verbalized sampling, procedura…
vanceingalls May 13, 2026
53bf8e7
feat(skills): structural diversity, contextual canvas backgrounds, st…
vanceingalls May 13, 2026
6c00cbd
feat(skills): strip prescriptive density rules, allow restraint
vanceingalls May 13, 2026
c67aed9
feat(skills): video design.md output, lettered brief, strip canvas ba…
vanceingalls May 14, 2026
feab9dc
feat(skills): showcase preview, composition skill guidance for frames
vanceingalls May 14, 2026
88e7673
feat(skills): mandatory token usage, composition skill guidance for f…
vanceingalls May 14, 2026
e9612dd
feat(skills): hard-gate creative process before data generation
vanceingalls May 14, 2026
1f2a81a
feat(skills): showcase polish — section order, motion reverse, radius…
vanceingalls May 14, 2026
661c845
feat(skills): three.js shader gradient backgrounds, custom ease edito…
vanceingalls May 14, 2026
647a677
fix(skills): escape backslashes and dollar signs in exported GLSL tem…
vanceingalls May 14, 2026
04abaf6
fix(skills): use hf-seek adapter contract in design picker Three.js o…
vanceingalls May 15, 2026
451d3ce
docs: add template picker skill integration plan
vanceingalls May 15, 2026
63f7f1e
feat(skills): add template-picker.html with data placeholders
vanceingalls May 15, 2026
9a8f2f2
feat(skills): add template-picker.html with data placeholders
vanceingalls May 15, 2026
5fb3450
feat(skills): add build-template-picker.py generation script
vanceingalls May 15, 2026
bdfd5d9
docs(skills): add template-based picker flow to design-picker.md
vanceingalls May 15, 2026
adba427
fix(skills): handle all three slide systems in template picker
vanceingalls May 15, 2026
dd29b62
fix(skills): reset animation start states after removing template scr…
vanceingalls May 15, 2026
4e97f17
fix(skills): support deck-stage web component templates in picker
vanceingalls May 15, 2026
d5e3d65
fix(skills): add element guards and template-picker bridge to design-…
vanceingalls May 15, 2026
f24812f
feat(skills): inject selected template iframe into fine-tune scene grid
vanceingalls May 15, 2026
41edf7d
fix(skills): rewire Phase 1 tab to link back to template picker
vanceingalls May 15, 2026
48a34f4
feat(skills): embed template picker as Phase 1 in design-picker.html
vanceingalls May 15, 2026
356096c
fix(skills): back button switches to Phase 1 instead of navigating away
vanceingalls May 15, 2026
ea92082
perf(skills): remove 300ms delay on template selection
vanceingalls May 15, 2026
a065528
feat(skills): add transition animation between template and fine-tune
vanceingalls May 15, 2026
30ee4d2
feat(skills): dramatic zoom transition on template selection
vanceingalls May 15, 2026
d95291b
fix(skills): single continuous zoom animation, no two-stage freeze
vanceingalls May 15, 2026
74dfc1b
fix(skills): scale and fade run simultaneously in card zoom
vanceingalls May 15, 2026
a459408
fix(skills): phase 2 fires at 500ms for tighter transition overlap
vanceingalls May 15, 2026
9be255f
feat(skills): dynamic transform-origin scales card toward viewport ce…
vanceingalls May 15, 2026
3e673b8
fix(skills): flip transform-origin direction for card zoom
vanceingalls May 15, 2026
bb863db
fix(skills): correct transform-origin to pull card zoom toward center
vanceingalls May 15, 2026
36c7440
feat(skills): staggered fade with subtle card lift on template select
vanceingalls May 15, 2026
e912936
feat(skills): slower card lift and fade, 1.6s total animation
vanceingalls May 15, 2026
c230d71
fix(skills): correct template iframe path to ../templates/ from .hype…
vanceingalls May 15, 2026
985c0bf
feat(skills): inject contextual text into fine-tune scene grid iframe
vanceingalls May 15, 2026
1a57ba3
fix(skills): inject text into deck-stage templates with section-only …
vanceingalls May 15, 2026
f8fdd7c
feat(skills): match replacement text word count to original
vanceingalls May 15, 2026
48a0651
docs(skills): document word-count variance requirement for text pools
vanceingalls May 15, 2026
28207e6
feat(skills): add motion template row above presentation templates
vanceingalls May 15, 2026
1ffe474
feat(skills): playable video card using hyperframes-player component
vanceingalls May 15, 2026
15f0297
fix(skills): reset child opacity when cycling to a slide
vanceingalls May 15, 2026
ad41d75
fix(skills): use scrollIntoView for all slide navigation
vanceingalls May 15, 2026
f447b9b
fix(skills): preserve template iframe when palette/options change
vanceingalls May 15, 2026
0b6c293
docs(skills): add Template Original palette guidance for fine-tune re…
vanceingalls May 15, 2026
6daa121
feat(skills): apply palette changes to template iframe in fine-tune
vanceingalls May 15, 2026
d1a279f
feat(skills): wire all fine-tune options to template iframe
vanceingalls May 15, 2026
a3948bc
fix(skills): target all deck-stage sections, not just section.slide
vanceingalls May 15, 2026
39aad53
fix(skills): use scrollTop/scrollLeft instead of scrollIntoView
vanceingalls May 15, 2026
13d6b22
fix(skills): split slide navigation into scroll vs visibility modes
vanceingalls May 15, 2026
6852f72
fix(skills): use translateY on container for scroll-mode slide naviga…
vanceingalls May 15, 2026
a754d71
feat(skills): show only first slide per template, remove cycling arrows
vanceingalls May 15, 2026
71d24b7
feat(skills): specimen grid shows template's own slides as component …
vanceingalls May 15, 2026
6553f1a
fix(skills): clear transition overlay when navigating back to templat…
vanceingalls May 15, 2026
5efe9e1
fix(skills): stable template overrides with original-value caching
vanceingalls May 15, 2026
52c840c
fix(skills): stable template overrides — cache by slug, filter overri…
vanceingalls May 15, 2026
bb0a6cf
feat(skills): react template picker with all configuration options
vanceingalls May 15, 2026
946c82a
fix(skills): restore corners, elevation, and motion preview sections
vanceingalls May 15, 2026
74cf395
fix(skills): remove broken specimen grid, keep hero card only for now
vanceingalls May 15, 2026
5d59539
feat(skills): add Template Default palette that clears all overrides
vanceingalls May 15, 2026
cf95015
feat(skills): name-aware CSS variable mapping for palette overrides
vanceingalls May 15, 2026
88162af
feat(skills): tokenized presentation templates with --tp-* variable c…
vanceingalls May 16, 2026
0293876
feat(skills): inline template rendering replaces iframes
vanceingalls May 16, 2026
3ad5495
feat(skills): inline template rendering replaces iframes
vanceingalls May 16, 2026
1afe6a8
feat(skills): inline template rendering, tokenized presentations
vanceingalls May 16, 2026
cc69c98
fix(skills): remove manual escape that double-escaped preview_html
vanceingalls May 16, 2026
c84dc5b
fix(skills): make template picker iframe fill phase container and scr…
vanceingalls May 16, 2026
0cf7859
fix(skills): change .phase overflow from hidden to auto for scrolling
vanceingalls May 16, 2026
b902f6f
docs: add template picker status and handoff document
vanceingalls May 16, 2026
d121361
feat(skills): embed template picker, restore originals with tp tokens
vanceingalls May 16, 2026
985eacc
chore(skills): add vendored deck-stage.js for deck-stage templates
vanceingalls May 16, 2026
0a85dbd
feat(skills): wire fine-tune controls to template iframes
vanceingalls May 16, 2026
a547c7e
feat(skills): live motion preview with GSAP in template iframes
vanceingalls May 16, 2026
22523fc
fix(skills): correct palette swatch ordering to primary/secondary/ter…
vanceingalls May 16, 2026
34d8b3d
feat(skills): fine-tune UI improvements and template-aware defaults
vanceingalls May 16, 2026
dc82145
fix(skills): slide switching, animation, and template overrides
vanceingalls May 16, 2026
2efc789
fix(skills): shader bg, density, animation, typography, and slide fixes
vanceingalls May 16, 2026
713d466
feat(skills): design.html output with template structure + ui refinem…
vanceingalls May 16, 2026
a457f35
fix(skills): clean design.html output — fetch original template via XHR
vanceingalls May 16, 2026
16853a2
fix(skills): update modal title and subtitle text
vanceingalls May 16, 2026
92ce483
feat(skills): add halftone grain post-processing + third-party attrib…
vanceingalls May 17, 2026
f5751c7
feat(skills): shader grain, rendering controls, design.html output up…
vanceingalls May 17, 2026
e747925
fix(skills): guard against webgl context loss in shader renderer
vanceingalls May 17, 2026
f8c7d69
fix(skills): shader bg stability and palette/shader interaction
vanceingalls May 17, 2026
8666e53
feat(skills): template summaries and DESIGN.html output as rendered d…
vanceingalls May 17, 2026
1d8ace2
feat(skills): per-template DESIGN.html with token replacement
vanceingalls May 17, 2026
f56d232
feat(skills): live shader preview in DESIGN.html background section
vanceingalls May 17, 2026
28de14d
feat(skills): mechanical design.html generation for all 34 templates
vanceingalls May 17, 2026
9015007
feat(skills): v2 design picker — page IS the design document
vanceingalls May 17, 2026
959d5f7
docs: add v2 design picker handoff document
vanceingalls May 17, 2026
e71e685
feat(skills): v2 picker with sidebar controls + iframe preview
vanceingalls May 17, 2026
47ed0a7
feat(skills): design.html live preview in original picker sidebar
vanceingalls May 17, 2026
ce6c1a8
fix(skills): wire shader GLSL + renderer into design.html iframe preview
vanceingalls May 17, 2026
1ee518e
feat(skills): 6 hand-crafted design.html templates with tokenized pal…
vanceingalls May 17, 2026
cd7cc64
feat(skills): 5 more hand-crafted design.html templates
vanceingalls May 17, 2026
559ff53
feat(skills): fully tokenize 7 hand-crafted design.html templates
vanceingalls May 17, 2026
b94d288
feat(skills): add background sections to remaining 4 hand-crafted des…
vanceingalls May 17, 2026
024361e
feat(skills): 5 more hand-crafted design.html templates (18 total)
vanceingalls May 17, 2026
ba10bab
feat(skills): 10 more hand-crafted design.html templates (28 total)
vanceingalls May 17, 2026
fefeb37
feat(skills): hand-crafted raw-grid design.html (29 / 34)
vanceingalls May 17, 2026
93248da
fix(skills): tokenize retro-windows, fix block-frame surface tokens
vanceingalls May 17, 2026
a029fd4
feat(skills): final 4 hand-crafted design.html templates (34 / 34)
vanceingalls May 17, 2026
af4803f
fix(skills): shader sliders, grain, and color changes update design i…
vanceingalls May 17, 2026
3d32bac
fix(skills): grain toggle and slider values flow to design iframe
vanceingalls May 17, 2026
e91bcfe
fix(skills): ensure bg._render initialized before grain slider reads
vanceingalls May 17, 2026
67cfc6d
perf(skills): blob URL for iframe updates, increase debounce to 500ms
vanceingalls May 17, 2026
b8902ad
fix(skills): replace {{placeholder}} tokens with sample text in slide…
vanceingalls May 17, 2026
b675340
fix(skills): hide design iframe when navigating back to template page
vanceingalls May 17, 2026
9d45fef
feat(skills): add back button to sidebar top in fine-tune phase
vanceingalls May 17, 2026
4586e6a
fix(skills): disable fine-tune tab when no template selected
vanceingalls May 17, 2026
0ce3bff
fix(skills): remove duplicate back button from sidebar
vanceingalls May 17, 2026
1666397
fix(skills): preserve scroll position on config changes
vanceingalls May 17, 2026
f3ec992
perf(skills): remove preview canvas drawImage, drop preserveDrawingBu…
vanceingalls May 17, 2026
94666ae
fix(skills): restore shader preview as single snapshot, not continuou…
vanceingalls May 17, 2026
9454968
fix(skills): restore continuous shader animation in preview canvas
vanceingalls May 17, 2026
3b6f232
docs(skills): add DESIGN.html parsing guide for composition agents
vanceingalls May 17, 2026
096b9ee
docs(skills): add design showcase authoring guide
vanceingalls May 17, 2026
48d8b7b
docs(skills): update design-showcase.md with revised guide
vanceingalls May 18, 2026
43bbfe0
feat(skills): design.html-first workflow with design.md conversion pr…
vanceingalls May 18, 2026
13b95ce
feat(skills): replace placeholder tokens with original text in all su…
vanceingalls May 18, 2026
790aac5
fix(skills): add flex-direction:column to forced slide display, clean…
vanceingalls May 18, 2026
30f2e6b
fix(skills): reduce peoples-platform cover headline to prevent overflow
vanceingalls May 18, 2026
3ac90ef
fix(skills): peoples-platform palette swatch overflow
vanceingalls May 18, 2026
f913c6c
feat(skills): universal palette override injected into every design i…
vanceingalls May 18, 2026
c38842a
fix(skills): remove alias forcing from palette override, keep core to…
vanceingalls May 18, 2026
a994e50
fix(skills): link 3 template aliases to core tokens via var()
vanceingalls May 18, 2026
4f4730a
feat(skills): rewire 73 color aliases to var() refs across 24 templates
vanceingalls May 18, 2026
39ed174
fix(skills): force --ink and derived aliases to var() in 7 templates
vanceingalls May 18, 2026
c62ea02
fix(skills): force swatch backgrounds to core palette colors via nth-…
vanceingalls May 18, 2026
ecb508f
fix(skills): read native palette from template.html for Template Default
vanceingalls May 18, 2026
fe32cbc
fix(skills): swap primary/secondary when template uses inverted conve…
vanceingalls May 18, 2026
b1939b8
fix(skills): use authored native palettes for template default
vanceingalls May 18, 2026
8a6a886
fix(skills): prevent updateDefaultPaletteFromIframe from overwriting …
vanceingalls May 18, 2026
011e4fc
fix(skills): inject template font links into design iframe for slide …
vanceingalls May 18, 2026
a02a2ec
fix(skills): force picker font choices onto slide gallery thumbnails
vanceingalls May 18, 2026
fde8a09
fix(skills): override font CSS vars in picker-override block
vanceingalls May 18, 2026
8cf6a6b
feat(skills): native font defaults per template, same pattern as pale…
vanceingalls May 18, 2026
d5bd20e
feat(skills): shader background shows through cover section
vanceingalls May 18, 2026
f362de0
feat(skills): design picker CSS token contract and design.md pipeline
vanceingalls May 18, 2026
aa04f2e
feat(skills): anti-convergence cover design, font resolution
vanceingalls May 18, 2026
7a052b3
feat(skills): template extraction guide for DESIGN.html
vanceingalls May 18, 2026
58f5c76
fix(skills): don't overwrite crafted design/summary.html, load DESIGN…
vanceingalls May 19, 2026
f4bfadf
feat(skills): figma to design.html extraction guide
vanceingalls May 19, 2026
bc1a5da
feat(skills): svg export + component reference slides in figma guide
vanceingalls May 19, 2026
5650d47
feat(skills): prioritize visual assets over UI components in figma guide
vanceingalls May 19, 2026
d922d53
fix(skills): lint catches hardcoded SVG fill/stroke and inline colors
vanceingalls May 19, 2026
6cc4ad0
refactor(skills): simplify shadow ternaries, pre-compile lint regex
vanceingalls May 19, 2026
f221a28
fix(skills): force overflow-y:auto on design iframe, cleanup
vanceingalls May 19, 2026
d1e3db7
fix(skills): update NATIVE_PALETTES from actual template.html --tp-* …
vanceingalls May 19, 2026
00be0d1
feat(skills): merge template extraction + shader porting into design-…
vanceingalls May 19, 2026
feebb0b
feat(skills): prompt template picker on init, hero entrance animation
vanceingalls May 19, 2026
e8c0a29
fix(skills): correct primary/secondary alias direction in 16 design.h…
vanceingalls May 19, 2026
e2732fa
feat(skills): picker UX — reset on template change, animation polish
vanceingalls May 19, 2026
0bffa80
Revert "fix(skills): correct primary/secondary alias direction in 16 …
vanceingalls May 19, 2026
63c797f
fix(skills): restore original NATIVE_PALETTES for design.html convention
vanceingalls May 19, 2026
4513453
feat(skills): design picker color theming + nav arrows
vanceingalls May 19, 2026
2a7eb96
feat(skills): design picker palette + slide refinements
vanceingalls May 19, 2026
aa9f263
feat(skills): picker UX + shader/palette/config refinements
vanceingalls May 19, 2026
2019859
feat(cli): hyperframes pick — open the design picker in browser
vanceingalls May 19, 2026
09304b8
chore: gitignore hyperframes pick output dirs
vanceingalls May 19, 2026
89dbd60
feat(skills): editorial-catalog Phase 1 redesign + design picker behi…
vanceingalls May 19, 2026
edbeb3b
fix(skills): scope surface overrides to .demo-card; retain palette ac…
vanceingalls May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ claude-design-hyperframes-video/
.claude/worktrees/
.claude/
docs/superpowers/

# hyperframes pick — generated picker + per-project picker data
.hyperframes/

# hyperframes pick — generated user-design template (created when DESIGN.html exists)
/templates/

1 change: 1 addition & 0 deletions .oxfmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skills/**/deck-stage.js
1 change: 1 addition & 0 deletions .oxlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skills/hyperframes/templates/presentations/*/deck-stage.js
2 changes: 1 addition & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"correctness": "error"
},
"plugins": ["react", "typescript"],
"ignorePatterns": ["dist/", "coverage/", "node_modules/"]
"ignorePatterns": ["dist/", "coverage/", "node_modules/", "skills/**/deck-stage.js"]
}
87 changes: 87 additions & 0 deletions docs/DESIGN-PICKER-V2-HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Design Picker V2 — Handoff

## What's Done

### Per-template DESIGN.html generation
- `build-design-templates.py` generates `design.html` for all 34 templates mechanically
- Reads each template's CSS tokens (fonts, colors, borders, shadows, radius) from `summary.html`
- Classifies by scheme (dark/light), border style (heavy/hairline/subtle), radius
- Dark templates → dark canvas, accent cover, hairline borders, lowercase
- Heavy border templates → 4px solid, hard shadows, uppercase, tilted swatches
- Each template's own fonts flow through to page design
- Hand-crafted designs for block-frame + broadside preserved (skipped by generator)
- All 34 templates now export bespoke DESIGN.html

### Template summaries (`build-summaries.py`)
- CSS tokens + unique slide skeletons with `{{placeholders}}`
- Handles external CSS files (pin-and-paper)
- Universal slide extraction across all template patterns
- 15-79% compression vs full template HTML

### Token system
`__PRIMARY__`, `__SECONDARY__`, `__TERTIARY__`, `__ACCENT__`, `__NAME__`,
`__SHADER_VERTEX__`, `__SHADER_FRAGMENT__`, `__SHADER_CONFIG__`, `__SHADER_SCRIPT__`,
`__TEMPLATE_CSS__`, `__SLIDE_CARDS__`, `__DOS__`, `__DONTS__`,
`__EASING_NAME__`, `__EASING_VALUE__`, `__CORNER_RADIUS__`, `__PADDING__`, `__GAP__`,
`__ELEVATION__`, `__DENSITY__`, `__BG_HEADLINE__`, `__BG_TYPE__`, etc.

### V2 picker scaffold (`design-picker-v2.html`)
- Template grid overlay → select template
- Loads design.html + applies tokens with current state
- Click palette/motion/background sections to cycle options
- Export button downloads resolved HTML
- Nav rail with Template + Export buttons

## What's Next

### Phase 2: Better edit affordances
- Replace click-to-cycle with dropdown/popup pickers per section
- Palette section: swatch popup showing all palette options
- Typography: font pair selector
- Surface: corner radius / density / depth controls
- Motion: easing curve picker (reuse existing custom easing UI)
- Background: shader preset grid with live preview thumbnails

### Shader integration
- The v2 picker doesn't yet run the shader renderer in the loaded design page
- Need to wire up `_sgShaders` (vertex/fragment GLSL) and the Three.js pipeline
- The `__SHADER_SCRIPT__` token is currently empty — needs the full renderer script
- The shader preview canvas (`#bg-preview-canvas`) needs the drawImage approach

### CSS collision hardening
- Use `#hf-` prefix for all picker chrome
- Picker toolbar needs `!important` on critical properties
- Clean up injected styles when switching templates
- Destroy Three.js renderers on template switch to prevent GPU leaks

### Font loading
- Template fonts loaded via `<link>` injection into `<head>`
- May need preloading strategy for smoother transitions

## Architecture

```
design-picker-v2.html (shell)
├── #tmpl-overlay (template grid, z-index: 1000)
├── #design-page (receives resolved design.html content)
│ ├── <style> blocks from design.html
│ ├── <canvas id="design-bg"> (shader background)
│ ├── .rail (nav rail + edit buttons)
│ ├── sections: #palette, #type, #surface, #motion, #background, #guidelines, #templates
│ ├── <template id="tmpl-source"> (slide cards)
│ └── <script type="module"> (shader renderer)
└── #export-overlay (export textarea + download)

State: { template, palette, type, easing, corners, density, depth, bg }
Token resolution: applyTokens(rawHtml, slug, summary) → resolved HTML string
Export: snapshot of resolved HTML (not live DOM serialization)
```

## Key Files
- `skills/hyperframes/templates/design-picker-v2.html` — new picker
- `skills/hyperframes/templates/design-picker.html` — old picker (keep for now)
- `skills/hyperframes/templates/presentations/*/design.html` — 34 design templates
- `skills/hyperframes/templates/presentations/*/summary.html` — CSS + skeletons
- `skills/hyperframes/scripts/build-design-templates.py` — design.html generator
- `skills/hyperframes/scripts/build-summaries.py` — summary.html generator
- `skills/hyperframes/templates/index.json` — template metadata
179 changes: 179 additions & 0 deletions docs/TEMPLATE-PICKER-STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Template Picker — Current Status & Handoff

## What This Is

A visual design picker that lets users browse 34 HTML presentation templates, apply color palettes, typography, and other design tokens, then export a design.md. It replaces the original moodboard-based design picker with a template-first approach.

## Architecture

```
skills/hyperframes/
├── templates/
│ ├── design-picker.html ← Main picker page (Phase 1 + Phase 2)
│ ├── template-picker.html ← Phase 1: template grid (embedded in design-picker via iframe)
│ └── presentations/ ← 34 tokenized HTML templates (from beautiful-html-templates)
│ ├── 8-bit-orbit/
│ ├── biennale-yellow/
│ ├── studio/
│ └── ... (34 total)
├── scripts/
│ ├── build-template-picker.py ← Generates template-picker.html with injected data
│ └── tokenize-templates.py ← Converts templates to use --tp-* CSS variable contract
└── references/
└── design-picker.md ← Skill reference (updated with template-based flow docs)
```

## How It Works

### Data Flow

1. **Agent generates prompt-specific data** (palettes, text pools, prompt description)
2. **`build-template-picker.py`** reads template index, extracts CSS color vars and `preview_html` from each template, injects data into `template-picker.html`
3. **`design-picker.html`** embeds `template-picker.html` as Phase 1 iframe, has Phase 2 fine-tune controls
4. Served via `python3 -m http.server`

### Two Phases

- **Phase 1 (Template tab)**: Grid of 34 templates. Each shows first slide as inline HTML preview. Palette bar at top re-themes all templates live. Click a template → transition animation → Phase 2.
- **Phase 2 (Fine-tune tab)**: Selected template preview + config options (theme, palette, typography, corners, density, depth, easing, background shader) + design sections (palette swatches, type specimens, corner radius, elevation, motion).

### CSS Variable Contract (`--tp-*`)

All 34 templates have been tokenized with `tokenize-templates.py`. Each template's `:root` block now has:

```css
:root {
--tp-bg: #E9E5DB; /* background */
--tp-fg: #1B2566; /* foreground/text */
--tp-ac: #F1EE2E; /* accent */
--tp-mt: #888888; /* muted */
--tp-surface: #E9E5DB; /* card/panel bg */
--tp-border: #1B2566; /* borders */
--tp-hf: "Archivo"; /* headline font */
--tp-bf: "Instrument Serif"; /* body font */
--tp-mf: "monospace"; /* mono font */
--tp-bg-layer: none; /* shader background slot */
}
```

Original template variables reference these tokens:
```css
--paper: var(--tp-bg, #E9E5DB);
--sun: var(--tp-ac, #F1EE2E);
--ink: var(--tp-fg, #1B2566);
```

Hardcoded hex values throughout the CSS were also replaced with `var(--tp-*)` references (1240 total replacements across 34 templates).

## What Works

- [x] Template grid with 34 templates rendering inline (extracted first-slide HTML)
- [x] Palette bar with mini type specimen chips
- [x] Contextual text injection (prompt-specific headlines, body, stats, labels replace template placeholder text)
- [x] Word-length matching (replacement text matches original word count)
- [x] Phase 1 → Phase 2 transition animation (fade to black, card lift, phase slide-in)
- [x] Phase 2 fine-tune panel with all config options (theme, palette, type, corners, density, depth, easing, background)
- [x] Phase 2 shows palette swatches, typography specimens, corner radius, elevation, motion sections
- [x] Back navigation (← Template tab returns to grid)
- [x] Template Default palette clears overrides, restoring original template colors
- [x] `--tp-*` CSS variable contract on all 34 templates
- [x] Name-aware color role detection (variables named "sun" map to accent, "paper" to bg, etc.)
- [x] Build script (`build-template-picker.py`) extracts preview_html with scoped CSS
- [x] Skill reference updated (`design-picker.md`) with full template-based flow documentation

## Known Bugs / Incomplete

### Critical — Must Fix

1. **Page won't scroll in Phase 1**. The `.phase` container has `overflow: auto` but the template-picker iframe with `position: absolute; inset: 0` creates a non-scrolling layer. The iframe content (template grid) scrolls internally but the parent page doesn't respond to scroll events. Need to either:
- Remove the iframe and embed the picker content directly in the DOM
- Or fix the iframe sizing so it doesn't need `position: absolute`

2. **Some template preview cards render as black rectangles**. The `extract_preview()` function in `build-template-picker.py` uses regex to find the first slide — works for most templates but fails silently for some (returns empty/minimal HTML). Templates with unusual structure (no `.slide` class, deck-stage only, complex nesting) may not extract correctly.

3. **Fine-tune palette/theme changes don't visually update the template preview**. The override code sets `--tp-*` variables on the inline template container via `style.setProperty()`, but the scoped CSS uses `.tp-{slug}` class prefix which may not inherit `:root` variables from the parent. The cascade path: `renderPreview()` → `querySelector("[class^='tp-']")` → `setProperty("--tp-bg", ...)` — this should work but hasn't been verified end-to-end since the inline rendering change.

4. **Background shader options have no effect on template preview**. The Three.js shader canvas renders in the design-picker page behind the scene grid. With iframe-based templates, the canvas was invisible behind the opaque iframe. With inline templates, it SHOULD show through if the template's background is transparent — but the templates still have opaque backgrounds. Need to:
- Set `--tp-bg-layer` to control the background
- Or make template background transparent when a shader is selected, letting the canvas show through

### Medium Priority

5. **Producer dist files fail format checks**. `packages/producer/dist/index.js` and `public-server.js` were modified somewhere and now fail `oxfmt --check`. These are build artifacts — should be in `.gitignore` or reset.

6. **Text injection doesn't work on all templates**. Templates using `<deck-stage>` with sections that don't have `.slide` class need the query `deck-stage > section, section[class]` to find text elements. Some templates still show original placeholder text.

7. **React app (`template-picker-app/`) exists but is incomplete**. Started a React rewrite, reverted to vanilla. The app scaffolding is in the repo at `skills/hyperframes/template-picker-app/` with working components but missing features. Should either complete or delete.

### Low Priority

8. **Component extraction below hero card** not implemented. User wants actual buttons, cards, headings, tags from the selected template displayed as a specimen sheet below the main preview. This requires parsing the template DOM to identify distinct component patterns — deferred.

9. **Motion templates (HyperFrames compositions)** partially built. Created restyled versions of launch video compositions (thesis × biennale-yellow, end card × biennale-yellow, save-time × bold-poster). The `<hyperframes-player>` integration for hover-to-play video cards works. Feature is disabled (empty `motion_templates` array) pending further design.

## How to Test

```bash
cd /Users/vanceingalls/src/wt/hyperframes/one

# Ensure templates have files (git checkout if empty)
ls skills/hyperframes/templates/presentations/8-bit-orbit/template.html || \
(cd /tmp/beautiful-html-templates && git checkout -- templates/)

# Generate picker for a prompt
cat > /tmp/test-data.json << 'EOF'
{
"palettes": [
{"name":"Default", "bg":"__DEFAULT__"},
{"name":"Brand Purple", "bg":"#0F0A1A", "fg":"#FFFFFF", "ac":"#7C3AED", "mt":"#9CA3AF"}
],
"prompt_text": {
"headline": "MYAPP",
"sub": "Your Product Tagline",
"taglines": {"bold":"BUILD SOMETHING","editorial":"The Future","playful":"Let's go.","dark":"SHIP IT.","technical":"FROM CODE TO PROD","warm":"Made With Care"},
"headlines": ["Feature One","Feature Two"],
"body": ["Description of the product."],
"stats": ["10M+","99%"],
"statLabels": ["Users","Uptime"],
"labels": ["FEATURE","API"],
"smalls": ["Try Free","Learn More"]
},
"prompt_desc": "Product launch video",
"motion_templates": []
}
EOF

# Build picker
cat /tmp/test-data.json | python3 skills/hyperframes/scripts/build-template-picker.py \
--template skills/hyperframes/templates/template-picker.html \
--templates-dir skills/hyperframes/templates/presentations \
--output /tmp/test-project/.hyperframes/template-picker.html

# Copy templates for serving
cp -r skills/hyperframes/templates/presentations /tmp/test-project/templates

# Generate pick-design.html (use Python — see previous session's generation script pattern)
# ... inject ARCHITECTURES/PALETTES/TYPEPAIRS/MOODBOARDS/PROMPT into design-picker.html template

# Serve
cd /tmp/test-project && python3 -m http.server 8724
# Open http://localhost:8724/.hyperframes/pick-design.html
```

## Key Files to Read

| File | Purpose |
|------|---------|
| `skills/hyperframes/templates/design-picker.html` | Main picker — Phase 1 iframe + Phase 2 fine-tune. Contains `handleTemplatePick()`, `applyOverrideToIframe()`, `renderPreview()`, shader background module. ~2700 lines. |
| `skills/hyperframes/templates/template-picker.html` | Template grid — palette bar, card rendering, text injection, transition animation. ~720 lines. Placeholders: `__PALETTES_JSON__`, `__PROMPT_TEXT_JSON__`, `__TEMPLATES_JSON__`, `__PROMPT_DESC__`. |
| `skills/hyperframes/scripts/build-template-picker.py` | Build script — reads template index, extracts CSS vars + preview HTML, injects data. |
| `skills/hyperframes/scripts/tokenize-templates.py` | Converts templates to `--tp-*` contract. Run once to tokenize; templates are already tokenized in repo. |
| `skills/hyperframes/references/design-picker.md` | Skill reference — includes "Alternative: Template-based picker" section with full flow docs. |

## Recommended Next Steps (Priority Order)

1. **Fix scrolling** — The #1 blocker. Either embed picker content directly (no iframe) or fix iframe height calculation.
2. **Verify end-to-end palette override** — After scroll fix, test that selecting a palette in Phase 2 actually changes the template preview's colors via `--tp-*` tokens.
3. **Fix blank template cards** — Improve `extract_preview()` regex to handle all 34 template structures.
4. **Wire shader backgrounds** — When a shader preset is selected, set the template's `--tp-bg` to `transparent` so the canvas shows through.
5. **Clean up** — Delete `template-picker-app/` React scaffold if not continuing that path. Fix producer dist format issues.
23 changes: 23 additions & 0 deletions docs/packages/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,29 @@ This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_

</Tab>
<Tab title="Preview">
### `pick`

<Note>
Experimental. Hidden behind a feature flag. Set `HYPERFRAMES_DESIGN_PICKER=1` (or `true` / `on` / `yes`) to enable. Always enabled when running from the monorepo for contributors.
</Note>

Open the design picker in your browser to choose a template and create a `design.md`:

```bash
HYPERFRAMES_DESIGN_PICKER=1 npx hyperframes pick
HYPERFRAMES_DESIGN_PICKER=1 npx hyperframes pick --port 8723
HYPERFRAMES_DESIGN_PICKER=1 npx hyperframes pick --build-only
```

| Flag | Description |
|------|-------------|
| `--port` | Port to serve the picker on (default: 8723) |
| `--build-only` | Build the picker HTML without serving it |

Builds `.hyperframes/pick-design.html` from the installed skill template, starts a local HTTP server, and opens the picker. Requires the HyperFrames skills (`npx hyperframes skills`) and `python3` installed.

The picker walks you through palette, typography, corners, density, depth, motion, and an optional shader background. Export the resulting `design.md` and paste it into your project root.

### `preview`

Start a live preview server with hot reload:
Expand Down
Loading