ipollowork-template-generation ยท diff
git:20260729.7369a76 to git:20260802.38f8eda
28 added, 89 removed. Audit A to A.
---
name: ipollowork-template-generation
- description: Generate new iPolloWork HTML templates for web pages, PPT/slides, and HyperFrames video that are compatible with the project's design-system theme switching and variable-control UI from the start. Use when AI creates bundled templates, batch-generates template HTML, writes template prompts/specs, or updates template-generation rules so produced HTML consumes --ipw-* tokens without breaking layout, slide structure, animation, timing, icons, or media geometry.
+ description: Create or update reusable iPolloWork templates through conversation for Design, Slides/native editable PPT, and HyperFrames Video. Use when planning, generating, repairing, validating, or saving a template package, manifest, reusable variables, cover, slide/PPT markers, video composition, or design-system token integration.
---
# iPolloWork Template Generation
- Generate templates that are theme-ready on first output. Treat the design system as a stable token layer that can change colors, typography, spacing, radii, and shadows without rewriting the DOM or changing geometry.
-
- ## Required References
-
- - Read [references/template-generation-contract.md](references/template-generation-contract.md) before creating or updating a template.
- - Run `node scripts/audit-template.mjs <template-directory>` after generating or changing a template.
- - For converting or auditing an existing template, also use `$ipollowork-themeable-template` and run its audit workflow.
-
- ## Generation Workflow
+ Create a reusable template, not a one-off artifact. The product-selected category and server validator are authoritative.
- 1. Classify the requested template as `web`, `slides`, or `video`.
- 2. Create the normal template package:
- - `manifest.json`
- - `entry.html` or `index.html`
- - `design-tokens.css`
- - local assets only when needed
- 3. Put exactly one marked stylesheet link after all inline `<style>` blocks and before `</head>`:
+ ## Route The Work
- ```html
- <link rel="stylesheet" href="design-tokens.css" data-ipw-design-tokens>
- ```
+ 1. Read [references/template-generation-contract.md](references/template-generation-contract.md).
+ 2. Read exactly one surface reference:
+ - Design: [references/design.md](references/design.md)
+ - Slides or native editable PPT: [references/slides-ppt.md](references/slides-ppt.md)
+ - HyperFrames Video: [references/video.md](references/video.md)
+ 3. When converting an existing project, preserve its category, surface, structure, and source files. Saving creates a new personal template; it never updates the source template.
- 4. Add `designSystem` metadata to `manifest.json`:
+ ## Conversational Authoring
- ```json
- {
- "designSystem": {
- "tokenVersion": 1,
- "tokens": "design-tokens.css",
- "editableGroups": ["theme", "background", "typography", "components"]
- }
- }
- ```
+ Guide the user in this order: purpose and audience, content structure, reusable variables, visual/design system, surface-specific constraints, generation and validation.
- 5. Define stable semantic `--ipw-*` variables in `design-tokens.css`. Put selected theme values inside the managed block:
+ - Ask one consequential question at a time.
+ - Do not ask for information the user already supplied.
+ - Once the project is sufficiently specified, edit the project and show the result instead of extending the interview.
+ - Keep the package manifest, variable declarations, cover, and validation checklist current after every structural change.
+ - Treat the selected design system as optional context. Load only its manifest, usage guide, and design rules; never load every installed system.
+ - Use local assets or stable user-provided asset URLs. Do not invent dependencies.
- ```css
- /* ipw-theme:start */
- /* ipw-design-system: default */
- :root {
- --ipw-color-bg: #ffffff;
- --ipw-color-surface: #f8fafc;
- --ipw-color-text: #111827;
- --ipw-color-muted: #64748b;
- --ipw-color-border: #e2e8f0;
- --ipw-color-primary: #2563eb;
- --ipw-color-secondary: #0f766e;
- --ipw-color-accent: #7c3aed;
- --ipw-color-on-primary: #ffffff;
- --ipw-font-display: Inter, ui-sans-serif, system-ui, sans-serif;
- --ipw-font-body: Inter, ui-sans-serif, system-ui, sans-serif;
- --ipw-type-scale: 1;
- --ipw-body-line-height: 1.55;
- --ipw-content-width: 1080px;
- --ipw-page-padding: 32px;
- --ipw-section-space: 80px;
- --ipw-button-radius: 8px;
- --ipw-card-bg: var(--ipw-color-surface);
- --ipw-card-border: var(--ipw-color-border);
- --ipw-card-radius: 14px;
- --ipw-card-shadow: 0 12px 32px rgb(15 23 42 / 10%);
- }
- /* ipw-theme:end */
- ```
+ ## Package Loop
- 6. Write component CSS so visual style consumes tokens directly:
- - backgrounds: `--ipw-color-bg`, `--ipw-color-surface`, `--ipw-card-bg`
- - text: `--ipw-color-text`, `--ipw-color-muted`, `--ipw-color-on-primary`
- - accents/actions: `--ipw-color-primary`, `--ipw-color-secondary`, `--ipw-color-accent`
- - borders/shadows: `--ipw-color-border`, `--ipw-card-shadow`
- - typography: `--ipw-font-display`, `--ipw-font-body`, `--ipw-type-scale`, `--ipw-body-line-height`
- - adjustable details: `--ipw-page-padding`, `--ipw-section-space`, `--ipw-button-radius`, `--ipw-card-radius`
- 7. Preserve layout with template-owned CSS outside the managed theme block. Theme switching must not resize logos, icons, images, stages, clips, slides, or composition roots.
- 8. Do not expose hardcoded variable-control options. The control UI must derive editable variables from the selected design system's real token source.
- 9. Run the audit script:
+ 1. Maintain `manifest.json`, the surface entry, `design-tokens.css`, local assets when needed, and a 960 x 540 cover.
+ 2. Put reusable content in typed manifest/HyperFrames variables and reusable visual choices in `--ipw-*` tokens. Do not mix content variables with design tokens.
+ 3. Preserve structural invariants while applying themes: DOM meaning, responsive layout, slide geometry/PPT markers, or video timing/tracks/compositions.
+ 4. Run the product validator before saving:
```powershell
node .codex/skills/ipollowork-template-generation/scripts/audit-template.mjs <template-directory>
```
- Pass `--surface web`, `--surface slides`, or `--surface video` when the manifest does not identify the surface clearly.
- 10. Validate by switching at least background, primary color, text color, radius, and spacing tokens mentally or with the app. The result must visibly change style while preserving skeleton and media geometry.
-
- ## Hard Rules
-
- - Never use broad theme selectors that target `img`, `svg`, `button`, `[class*="icon"]`, `[data-ipw-slide]`, `[data-composition-id]`, or all cards in a way that changes dimensions.
- - Never put themeable colors, fonts, radii, shadows, or spacing in inline `style` attributes.
- - Never define `--ipw-*` variables in a later stylesheet or later `<style>` block after the token link.
- - Never replace the whole `design-tokens.css` during theme application; replace only the managed block and preserve structural CSS.
- - Never change slide count, PPT export markers, HyperFrames timing, tracks, clips, `data-duration`, animation keyframes, canvas dimensions, or fixed stage dimensions for theme reasons.
- - Keep data visualization series colors fixed only when the color carries semantic meaning; otherwise map accents to tokens.
- - Keep brand logos and raster assets content-owned. Do not recolor or resize them through the design-system layer.
-
- ## Surface Rules
-
- **Web:** Use semantic HTML, responsive behavior, and tokenized visual CSS. Keep hover/focus states tokenized.
+ 5. Repair every error. Warnings must be resolved or deliberately accepted.
+ 6. Re-instantiate the staged package and verify that the correct right-side editor opens, variables remain editable, theme switching preserves structure, and the source project is unchanged.
- **Slides/PPT:** Keep fixed stage dimensions and all `data-ipw-slide`, `data-pptx-text`, `data-pptx-shape`, and `data-pptx-image` markers. Theme fills, text, borders, and shadows without moving objects.
+ ## Hard Boundary
- **Video/HyperFrames:** Preserve composition IDs, `data-duration`, clip windows, tracks, variables, and deterministic animation. Theme scene visuals only; avoid CSS transitions or ambient infinite animation that changes rendered frames.
+ This Skill is guidance for repository agents. Product runtime behavior does not depend on Skill discovery. Authoring System Context and the shared server validator provide the same category rules to every user.
- ## Completion Standard
+ ## Completion
- Report the surface, template files created or changed, token coverage, preserved structural constraints, audit command/result, and validation performed. If an existing artifact was converted, include the `$ipollowork-themeable-template` audit result.
+ Report the selected surface/category, files changed, reusable variables, design-system coverage, preserved surface invariants, validator result, re-instantiation result, and any remaining warning.