Communitygithub.com

PPT Skill

Design-locked HTML slide decks with deterministic PPTX export — an agent skill for Claude Code / 锁定设计系统的网页 PPT,可确定性导出可编辑 PPTX

What is PPT Skill?

This skill enables an AI agent to produce polished, design-constrained HTML slide decks from a strictly defined component library, with a deterministic one-click export to editable PPTX format. It enforces a professional visual system through 13 registered layouts (L01–L13), a fixed CSS class taxonomy, and a token-based color/typography palette—no raw values or ad-hoc styling are permitted. The workflow proceeds through eight steps: clarifying requirements with up to five questions, fact-checking for data honesty, deck scaffolding from a seed template, a two-page sample review for approval, batch slide assembly, automated validation, visual self-inspection, and final delivery with optional PDF/PPTX export. Supported platforms include Claude Code and any environment where Node.js scripts can execute; the skill relies on reference documents for layouts, narrative templates, themes, and visual checklists to ensure consistency across all deliverables.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add ye4wzp/zifeiyu-ppt-skill

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does PPT Skill do?

Put content into the 13 registered layouts to produce a single-directory web-based slide deck; HTML is the single source of truth, PPTX/PNG are one-click derivatives.

Hard Constraints (violate any one and rework)

  1. Never write HTML from scratch. A deck can only be created by copying templates/seed.html; slides can only copy registered skeletons from references/layouts.md and replace text content.
  2. No inventing class names. Only use classes already defined in base.css; the validator rejects any class outside the whitelist.
  3. No raw color values or font declarations. Colors must come from tokens; inline style is only allowed for parameterized values of top/left/width/height/font-size/line-height.
  4. Every page must declare data-layout="Lxx" (L01–L13).
  5. Text only goes inside h1/h2/h3/p; decorative elements use div[data-shape="rect|ellipse"]; images use <img>, do not use background-image for content images.
  6. Data honesty: Data-driven layouts like L07/L11 must use real user-provided values; never fabricate data. If no real data is available, switch to a conceptual layout.
  7. Per-page density discipline: 1 core message + no more than 4 supporting points; if it overflows, split the page; adjacent pages should not repeat the same layout.
  8. Use a theme as a whole: one deck uses one theme file; do not mix themes across pages.

Workflow

Step 1 · Clarification & Scoping (one-shot questioning, no more than 5 questions)

  • Q1 Delivery format (mandatory sets the track; cannot switch later): Web presentation only → Web track; editable .pptx needed → Office track.
  • Q2 Audience & occasion → Recommend 2–3 themes based on the mapping table in references/themes.md.
  • Q3 Page count or duration.
  • Q4 Existing materials (outline / documents / data / images / logo).
  • Q5 Hard constraints. Brand colors are accepted only when the user has explicit brand guidelines; otherwise, use a preset theme.

Step 2 · Assets & Fact-checking (mandatory when real organizations, products, or data are involved)

  • Facts first: Every external claim—numbers, dates, names—must have a source: either first-party user-provided material or verified official publications cross-referenced via web search; each must be traceable; KPI pages must footnote the source. Hard-to-find data should be replaced with a conceptual layout; never fabricate.
  • Photo selection: When there are more than 10 candidate photos, first create a contact-sheet (a grid preview image), then select; do not read each photo individually.
  • Avoiding text over image subjects: For image-inclusive layouts (L09/L14/L01), after selecting an image, read it to identify the subject position (logo, face, product); titles and overlays must land on quiet areas of the frame; if the subject is cropped, change the image, do not force it.

Step 3 · Scaffold the deck

mkdir -p <deck-dir>/assets && cp templates/seed.html <deck-dir>/index.html
cp -r assets/base.css assets/runtime.js assets/themes <deck-dir>/assets/

Modify <link id="theme"> according to the chosen theme; replace <title>. The deck is self-contained and can be distributed as a whole directory.

Step 4 · Sample Gate (mandatory when deck ≥ 5 pages)

Produce only two pages first: the cover (L01) + the most representative content page. Render screenshots and show them to the user for confirmation before entering bulk production. Correct directional issues on 2 pages, not after 13.

Step 5 · Batch Fill

First, choose a narrative template from references/narratives.md (pitch/report/promotion) to determine page order; then for each page: copy the skeleton from references/layouts.md → replace only text/images → self-check density. Store images in <deck-dir>/assets/img/, named {page-number}-{semantic}.{ext}.

Step 6 · Machine Validation (First Gate)

node scripts/validate.mjs <deck-dir>          # Web track
node scripts/validate.mjs <deck-dir> --office # Office track

All errors must be cleared. Overflow handling order: trim copy → adjust parameterized inline styles → switch layouts; never reduce font-size below 16px.

Step 7 · Visual Self-check (Second Gate)

node scripts/render-png.mjs <deck-dir>

Review each page's rendered image against the P0–P3 tiered checklist in references/checklist.md; P0/P1 items must be fixed.

Step 8 · Delivery

For Web track, deliver the deck directory (open index.html in a browser, navigate with arrow keys, F for fullscreen, S opens the speaker console—dual-window sync, next-slide preview, timer, speaker notes). Notes format: at the end of each page add <aside class="notes"><p>cue</p></aside>; only visible to the speaker, never rendered or exported; write "cue signals" (≤3 short sentences per page), not word-for-word scripts. Add as needed:

node scripts/export-pdf.mjs <deck-dir>                            # Vector PDF (both tracks)
node scripts/export-pptx.mjs <deck-dir> --cjk-font "Microsoft YaHei"  # Office track

After export, a third gate is mandatory: open the .pptx in presentation software and compare page-by-page with the HTML renders (see references/pptx-export.md for details).

Layout Quick Reference

IDLayoutPurpose
L01CoverOpening: kicker + main title + subtitle + meta
L02Table of Contents3–5 agenda items
L03Section DividerLarge number + section name, pace-changing
L04StatementOne sentence in large font, single-point emphasis
L05Two-column ComparisonTwo options / before-after, two panels
L06Three-point ArgumentThree parallel arguments
L07KPI Big Numbers2–3 real data metrics
L08Timeline4-node horizontal progression
L09Image HeroFull-bleed image + overlay title
L10Body Text + BulletsLeft long text, right three bullets, regular content page
L11Data Rows4 rows of label–value–note structured info
L12Process Steps4-step process
L13EndClosing statement + meta

Themes

paper (default, warm paper white) · graphite (dark) · forest (cool paper green). Selection criteria in references/themes.md.

Reference Documents (read on demand, do not load all at once)

  • references/layouts.md — Full copyable skeletons for 14 layouts + accent decoration usage
  • references/narratives.md — Three narrative page-order templates: pitch/report/promotion
  • references/themes.md — Theme catalog and audience mapping
  • references/authoring.md — Copy density, Chinese typography rules
  • references/pptx-export.md — Office track constraints, font strategy, export troubleshooting
  • references/checklist.md — P0–P3 visual self-inspection checklist
  • references/animations.md — Semantic animation recipes for presentation mode (auto-applied, export unaffected)

Related Skills