open-slide
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Use when creating, editing, or initializing PPT/presentation slides with the open-slide framework — an AI-agent-native slide generation framework for React. Triggers: "create slides", "make a presentation", "init open-slide", "edit slide", "tweak this page", "fix the layout", "change the palette", or any work under `slides/<id>/index.tsx`.
In this repository3 other files it gives its agents.
- docx-mcpSkill
- feishu-docSkill
- pptxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Every page renders into a fixed 1920×1080 canvas.
- Very specific: line 69
Use absolute pixel values for font-size, padding, positioning.
- Very specific: line 71
Prefer inline style={{ ...
- Distinctive: line 94
Element height = font_size × line_height × number_of_lines: Add gaps (32-64px) between elements.
- Distinctive: line 111
If you need to shrink type below the scale's lower bound or tighten line-height < 1.4 → split into two pages.
- Very specific: line 112
Never: use overflow: auto/scroll, negative margins, or transforms to hide overflow.
- Very specific: line 116
Every new slide MUST declare a top-level export const design: DesignSystem:
- Very specific: line 140
Only skip the design const for a one-off slide whose palette is intentionally locked.
- Very specific: line 154
Place under slides/<id>/assets/.
- Distinctive: line 164
Only when a page NEEDS a real user-provided image (product screenshot, team photo, chart from their data):
- Distinctive: line 170
Never use for decoration, stock photos, or filler.
- Distinctive: line 219
Always the first child inside the JSX element it refers to.
- Distinctive: line 225
Read file, find all markers, decode text
- Distinctive: line 228
Remove each marker line after applying edit
- Very specific: line 229
Verify zero remaining markers, run pnpm tsc --noEmit
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
open-slide — AI-Agent-Native Slide Framework
open-slide is a slide framework built for AI agents. Describe your deck in natural language, your agent writes React. open-slide handles canvas, scaling, navigation, hot reload, and present mode.
Project Initialization
npx @open-slide/cli init my-slide
cd my-slide
pnpm devThis scaffolds a minimal workspace:
my-slide/
├── slides/ # Your slides go here
├── themes/ # Optional theme definitions
├── open-slide.config.ts
├── package.json
└── pnpm-lock.yamlThe dev server runs at http://localhost:5173. Each slide is at http://localhost:5173/s/<slide-id>.
Hard Rules (NEVER VIOLATE)
- Only write
slides/<kebab-case-id>/index.tsx— a single file per deck. Assets go inslides/<id>/assets/. - Never touch
package.json,open-slide.config.ts, or other slides. - No dependencies — only React and standard web APIs are available.
- One
index.tsx+ assets — no sibling files (Card.tsx,components/,helpers.ts). Helper components/constants go insideindex.tsx. - No README.md or prose files inside slide folders.
File Contract
import type { DesignSystem, Page, SlideMeta } from '@open-slide/core';
export const design: DesignSystem = {
palette: { bg: '#0f172a', text: '#f8fafc', accent: '#fbbf24' },
fonts: {
display: 'system-ui, -apple-system, sans-serif',
body: 'system-ui, -apple-system, sans-serif',
},
typeScale: { hero: 180, body: 40 },
radius: 12,
};
const Cover: Page = () => <div>...</div>;
const Body: Page = () => <div>...</div>;
export const meta: SlideMeta = { title: 'My Slide' };
export default [Cover, Body] satisfies Page[];export default= non-empty array of zero-prop React components (one per page, in order).meta.title(optional) shows in the slide header.meta.theme(optional) back-links to a theme underthemes/<id>.md.- Slide id = kebab-case folder name, short and descriptive.
Canvas — 1920×1080 Fixed
Every page renders into a fixed 1920×1080 canvas. The framework scales it.
- Use absolute pixel values for
font-size, padding, positioning. Norem, novw/vh, no%. - Root element of each page:
width: '100%'; height: '100%'. - Prefer inline
style={{ ... }}. Global CSS is scoped — be careful. - Canvas does NOT scroll. Content below 1080px is silently cropped.
Type Scale
| Element | Size |
| Hero title | 140–200px |
| Section heading | 80–120px |
| Page heading | 56–80px |
| Body text | 32–44px |
| Caption / label | 22–28px |
Spacing
- Content padding: 100–160px from canvas edges. Never let text touch the edge.
- Line-height: 1.2 for headings, 1.5–1.7 for body.
- Breathing room between elements: 32–64px.
Vertical Budget (CRITICAL — #1 cause of broken slides)
Usable height = 1080 − 2×padding. With 120px: 840px. With 160px: 760px.
Element height = font_size × line_height × number_of_lines. Add gaps (32-64px) between elements. Verify every page fits BEFORE writing.
Worked example (120px padding, budget 840px):
| Element | Height |
| Heading: 80px × 1.2 × 1 line | 96px |
| Gap | 64px |
| Body: 40px × 1.6 × 3 lines | 192px |
| Gap | 48px |
| 5 bullets: 40px × 1.6 × 1 line each | 320px |
| 4 gaps between bullets: 24px each | 96px |
| Total | 816px ✓ fits |
Page-level rules:
- One heading + body OR one heading + ≤5 short bullets. Not both.
- Bullets fit on one line. If wrapping, shorten or split.
- Hero title pages (140-200px): title + 1 subtitle only.
- If you need to shrink type below the scale's lower bound or tighten line-height < 1.4 → split into two pages.
- Never use
overflow: auto/scroll, negative margins, or transforms to hide overflow.
Design System
Every new slide MUST declare a top-level export const design: DesignSystem:
export const design: DesignSystem = {
palette: { bg: '#f7f5f0', text: '#1a1814', accent: '#6d4cff' },
fonts: {
display: 'Georgia, "Times New Roman", serif',
body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
},
typeScale: { hero: 168, body: 36 },
radius: 12,
};Consumption:
var(--osd-X)for visual properties — instant updates while user drags Design panel sliders:--osd-bg,--osd-text,--osd-accent--osd-font-display,--osd-font-body--osd-size-hero,--osd-size-body--osd-radius
- Direct
design.Xreads — for JS arithmetic or UI labels (update via HMR on commit, not while dragging).
Format constraints: must be export const design: DesignSystem = { ... } at module top level with a literal object (no spreads, no helper calls).
Only skip the design const for a one-off slide whose palette is intentionally locked.
Visual Direction
Pick ONE coherent look across every page:
- Palette: 1 background, 1 primary text, 1 accent, 1 muted. Define as constants.
- Typography: 1 display font + 1 body font. Heavy headings (800-900), normal body (400-500).
- Layout: single content padding (e.g. 120px), consistent across pages.
- Aesthetic: pick ONE — minimal, maximalist, editorial, retro, brutalist, soft/pastel, neon, paper/print.
Consult the frontend-design skill for deeper aesthetic guidance.
Assets
Place under slides/<id>/assets/. Import as ES modules:
import hero from './assets/hero.jpg';
<img src={hero} style={{ width: '100%', height: '100%', objectFit: 'cover' }} />Skip assets/ for pure-text slides.
ImagePlaceholder
Only when a page NEEDS a real user-provided image (product screenshot, team photo, chart from their data):
import { ImagePlaceholder } from '@open-slide/core';
<ImagePlaceholder hint="Product hero screenshot" width={1280} height={720} />Never use for decoration, stock photos, or filler. If typography/layout can carry the page — do that.
Repeated Elements: Component, NOT map
// ✅ CORRECT — each card is its own JSX node (inspector edits one at a time)
const Card = ({ src, label }: { src: string; label: string }) => (
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
<img src={src} style={{ width: 320, height: 320, objectFit: 'cover' }} />
<p style={{ fontSize: 32 }}>{label}</p>
</div>
);
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 64 }}>
<Card src={alpha} label="Alpha" />
<Card src={beta} label="Beta" />
<Card src={gamma} label="Gamma" />
</div>
// ❌ WRONG — array.map body is ONE source location, inspector mutates all instances
items.map((item) => (<div><img src={item.src} /><p>{item.label}</p></div>));Pure-text <ul><li> lists are fine — each <li> is its own JSX node.
Creating a New Deck — Workflow
Step 1 — Pick a theme
List themes/. If any .md files exist (not README.md), offer theme selection + "no theme" option.
Step 2 — Ask 4 required questions
- Aesthetic direction — 3 tailored visual directions (vibe + concrete visual cue), mark best fit as "(Recommended)"
- Page count — 3-5 (short) / 6-10 (standard) / 11-20 (deep dive) / custom
- Text density — minimal / light / standard / dense
- Motion — static / subtle / rich
Step 3 — Pick slide id (kebab-case)
Step 4 — Plan page structure (roles: Cover, Agenda, Section divider, Content, Big number, Quote, Comparison, Closing)
Step 5 — Commit to visual direction (design: DesignSystem)
Step 6 — Write slides/<id>/index.tsx (consult slide-authoring rules above)
Step 7 — Self-review (checklist below)
Step 8 — Hand off to user
Applying Inspector Comments (@slide-comment)
Marker format:
{/* @slide-comment id="c-<8hex>" ts="<ISO>" text="<base64url(JSON)>" */}- Always the first child inside the JSX element it refers to.
textis base64url-encoded JSON:{"note": "...", "hint"?: "..."}.- Detection regex:
/\{\/\*\s*@slide-comment\s+id="(c-[a-f0-9]+)"\s+ts="([^"]+)"\s+text="([A-Za-z0-9_\-]+={0,2})"\s*\*\/\}/g
Procedure:
- Identify target slide(s)
- Read file, find all markers, decode text
- Understand each comment in context (enclosing element)
- Apply edits in reverse line order (bottom-up to preserve line numbers)
- Remove each marker line after applying edit
- Verify zero remaining markers, run
pnpm tsc --noEmit - Report: N applied, 0 remaining + description
Self-Review Checklist
slides/<id>/index.tsxexports a non-emptyPage[]- Every page's root fills
100% × 100% - Content lives inside padding (no text kisses the edge)
- Every page: sum(font_size × line_height × lines) + gaps + 2×padding ≤ 1080px
- No bullet wraps to a second line
- One coherent visual direction across all pages
- Top-level
export const design: DesignSystem = { ... }withvar(--osd-X)references - One idea per page
- Repeated elements are explicit
<Component />instances, notarray.map - All imported assets exist on disk
- ImagePlaceholders only for user-supplied images, not decoration
- Nothing outside
slides/<id>/was edited
Anti-Patterns
- ❌ Walls of text (>40 words/page → split)
- ❌ Body copy without padding (use 100-160px)
- ❌ Overflowing 1080px vertically (split the page)
- ❌
overflow: auto/scroll/hiddento hide too much content - ❌ Shrinking type below scale bounds or padding < 100px (split instead)
- ❌ Bullets that wrap to a second line
- ❌ Body type < 28px (unreadable on projector)
- ❌ Inconsistent palette across pages
- ❌ Installing packages
- ❌ CSS in shared files (inline styles only)
- ❌ Creating README.md or prose files in slide folder
- ❌ Editing package.json, open-slide.config.ts, or other slides
- ❌ ImagePlaceholder as decoration/stock-photo slot
- ❌ Using ImagePlaceholder for icons/decorative shapes (typography/SVG problem)
- ❌
array.mapfor repeated visual elements (inspector can't edit individually)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

