diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..60703ee --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Contributing + +Thanks for helping improve `guizang-ppt-skill`. + +This project is a Skill for AI agents that generate polished HTML slide decks. The most useful contributions are specific, reproducible, and tied to real deck output. + +## Before Opening an Issue + +Please check whether the problem belongs to one of these buckets: + +- Layout fidelity: a page drifts away from the registered template. +- Content overflow: text, images, charts, or footers overlap. +- Image workflow: generated images do not match the target slot ratio or deck style. +- Runtime behavior: navigation, ESC overview, low-power mode, map interaction, or animations fail. +- Documentation: installation, prompt usage, layout selection, or examples are unclear. + +Screenshots are much more useful than descriptions alone. If possible, include: + +- The prompt or source content used to generate the deck. +- The generated `index.html`. +- A screenshot of the broken slide. +- Browser and OS information. + +## Pull Request Guidelines + +Keep PRs focused. A small fix with a screenshot is easier to review than a large rewrite. + +For Swiss theme changes: + +- Do not invent new default body layouts unless the change is explicitly discussed. +- Keep the registered layout system intact. +- Run the Swiss validator: + +```bash +node scripts/validate-swiss-deck.mjs path/to/index.html +``` + +For template changes: + +- Verify at least one dense text slide. +- Verify at least one image slide. +- Verify navigation, ESC overview, and low-power mode. + +## Good PRs Usually Include + +- A short summary of the problem. +- The exact files changed. +- Before / after screenshots when visual behavior changes. +- Validation or manual QA notes. + +## Style Notes + +This Skill is opinionated by design. It prefers constrained layout systems over unlimited customization, because constraints make AI-generated decks more reliable. + +When in doubt, preserve the existing visual rules and improve the workflow around them. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a638b33 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 op7418 (歸藏) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..9ac16aa --- /dev/null +++ b/README.en.md @@ -0,0 +1,369 @@ +# Guizang PPT Skill · Web Decks / Images / Covers + + + + + + + +[](https://zhenfund.feishu.cn/share/base/form/shrcn1lAANF659o7EpWnxlR1VOh?sessionid=) + +An agent skill for Claude Code, Codex, and similar coding-agent environments. It generates **single-file HTML horizontal-swipe decks**, deck visuals, and social cover pages. + +It ships with two visual systems: + +- **Style A: editorial magazine × electronic ink**. Picture *Monocle* with code stitched in. Best for narrative talks, opinions, salons, and personal voice. +- **Style B: Swiss International Typographic Style**. Grid-first, one high-saturation anchor color, sharp rectangles, hairline rules, and extreme type contrast. Best for facts, products, analysis, and frameworks. + +> Distilled by [Guizang](https://x.com/op7418) from offline talks like "One-Person Company: Organizations Folded by AI" and "A New Way of Working." Every pitfall hit during those decks is logged in `checklist.md`. + +**Old Theme · Style A Editorial Magazine** + + + +**New Theme · Style B Swiss International** + + + +## 30-second start + +```bash +npx skills add https://github.com/op7418/guizang-ppt-skill --skill guizang-ppt-skill +``` + +Or paste this to an AI agent with shell access: + +```text +Install guizang-ppt-skill for me. Clone https://github.com/op7418/guizang-ppt-skill into ~/.claude/skills/guizang-ppt-skill, then verify that SKILL.md, assets/, and references/ exist. +``` + +If you already installed it, update with: + +```text +Update guizang-ppt-skill for me. Go to ~/.claude/skills/guizang-ppt-skill, run git pull, then tell me the latest commit. +``` + +Then ask your agent: + +```text +Create a Swiss-style deck from this article, around 7 slides, with 2-3 generated visuals. +``` + +Other useful prompts: + +```text +Turn this Markdown file into an editorial magazine-style presentation. +Create a 21:9 social cover from the core idea of this deck. +Redesign this product screenshot as a 16:10 slide visual. +``` + +## What you get + +- 🖋 **Two visual systems**: editorial storytelling for Style A, factual Swiss structure for Style B +- 📐 **Horizontal swipe navigation**: ← → arrows / scroll wheel / touch swipe / bottom dots / ESC for index +- 🧩 **Style A 10 layouts**: cover, divider, big numbers, image/text, image grid, pipeline, comparison, and more +- 🧱 **Style B 22 locked layouts**: Cover, Statement, KPI Tower, Loop Diagram, Duo Compare, Image Hero, Closing Manifesto, and more +- 🎨 **Curated theme presets**: 5 electronic-ink themes for Style A, 4 Swiss anchor-color themes for Style B +- 🖼 **Optional Codex image flow**: generate documentary photos, infographics, flow diagrams, system maps, and UI scenes with GPT-Image 2.0 / GPT-M 2.0, then insert them at template-safe ratios +- 📰 **Social covers**: generate 21:9 WeChat cover images, 1:1 share cards, 3:4 Xiaohongshu covers, video thumbnails, and related variants +- 🔄 **HTMLSlide sync**: push locally generated `index.html` decks into the HTMLSlide web workspace for preview, editing, presenting, and packaging +- 📴 **Low-power static mode**: press `B` to turn WebGL / canvas animation into static visuals +- 📄 **Single HTML file** — no build, no server, open directly in the browser + +## Fits / Doesn't fit + +**✅ Fits**: offline talks, industry keynotes, private salons, AI product launches, demo day, presentations with strong personal voice + +**❌ Doesn't fit**: data-heavy tables, training decks (density too low), multi-user collaborative editing (static HTML) + +## Common use cases + +| Task | Recommended flow | +|------|------------------| +| Long article to talk deck | Extract the core argument, then build a 6-10 slide rhythm | +| Framework / product analysis | Use Style B Swiss with locked layouts and 21:9 hero visuals | +| Personal talk / opinion piece | Use Style A editorial magazine for stronger narrative rhythm | +| Deck visuals | In Codex, generate photos, infographics, flow diagrams, system maps, or UI scenes | +| Social covers | Generate 21:9 main covers, 1:1 share cards, 3:4 vertical covers, and video thumbnails from the same idea | +| Screenshot normalization | Redesign raw screenshots into template-safe ratios before inserting them into slides | + +## Why HTML decks + +- **Agent-native editing**: HTML / CSS is plain text, so agents can read, edit, and validate it directly. +- **Higher visual density than Markdown**: precise layout, positioning, motion, interactivity, and cover formats. +- **Lightweight delivery**: one HTML file can be opened, presented, sent, screenshotted, or recorded. +- **Better quality gates**: the Swiss validator can catch layout drift, unsafe image placement, centered body titles, and SVG text traps. +- **One visual system across outputs**: decks, generated visuals, covers, and screenshot redesigns can share the same style rules. + +## Platform support + +| Platform | Status | Notes | +|----------|--------|-------| +| Claude Code | Supported | Native Skill workflow for creating and iterating HTML decks | +| Codex | Supported | Good for deck generation, image generation, and browser-based visual QA | +| Cursor / other local agents | Works | Requires filesystem access and shell execution | +| WorkBuddy | In adaptation | Marketplace-ready version is being prepared separately | +| Plain chatbot | Not recommended | Without filesystem and browser preview, full deck generation is hard to stabilize | + +## Install + +### Option 1: One-line install (recommended) + +```bash +npx skills add https://github.com/op7418/guizang-ppt-skill --skill guizang-ppt-skill +``` + +### Option 2: Paste this to an AI + +> Install the `guizang-ppt-skill` Claude Code skill for me. Steps: +> +> 1. Make sure `~/.claude/skills/` exists (create if not) +> 2. Run `git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guizang-ppt-skill` +> 3. Verify: `ls ~/.claude/skills/guizang-ppt-skill/` should show `SKILL.md`, `assets/`, `references/` +> 4. Tell me when done. Later, saying things like "make me a magazine-style deck" will trigger this skill. + +Paste the block above into Claude Code / Cursor / any AI agent with shell access and it handles the install. + +### Option 3: Manual CLI + +```bash +git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guizang-ppt-skill +``` + +### How to trigger it + +Once installed, Claude Code auto-detects the skill. Trigger phrases: + +- "Make me a magazine-style deck" +- "Make me a Swiss-style deck" +- "Generate a horizontal swipe deck" +- "Editorial magazine style presentation" +- "Electronic ink slides for my talk" +- "Create a 21:9 WeChat cover from this article" +- "Create a 1:1 share card from this deck" + +## Workflow + +The skill is a structured workflow; the agent walks you through each step: + +1. **Choose style** — Style A editorial magazine, or Style B Swiss International +2. **Clarify intent** — 7-question checklist: style, audience, duration, source material, images/screenshots, theme, hard constraints +3. **Copy template** — Style A uses `assets/template.html`; Style B uses `assets/template-swiss.html` +4. **Fill content** — create a rhythm plan, then choose and adapt the matching layout skeletons +5. **Optional image generation** — in Codex, ask whether to use GPT-Image 2.0 / GPT-M 2.0 images, then insert them at page-appropriate ratios +6. **Self-check** — match against `references/checklist.md`; P0 issues must all pass; Swiss decks must also pass the layout validator +7. **Preview** — open the HTML in a browser +8. **Optional sync** — push the deck into the HTMLSlide web workspace with `scripts/sync-htmlslide.mjs` +9. **Iterate** — use inline styles to tune font size, height, spacing + +Full spec in [`SKILL.md`](./SKILL.md). + +## Style B Swiss + +The Swiss theme is a strict layout system, not just a CSS skin. + +- **22 named layouts**: body slides must use `S01` to `S22`; do not invent new structures +- **4 anchor colors**: International Klein Blue, lemon yellow, lemon green, safety orange +- **Grid lock**: 16-column grid, sharp rectangles, 1px hairlines, no shadows, no gradients, no rounded cards +- **Chinese title scaling**: all-Chinese headlines should be one step smaller to preserve space for content and images +- **Image/text bottom alignment**: text and image blocks should align at the bottom in left/right image layouts, while staying clear of pagination controls +- **Image slots**: images must sit in template-defined `data-image-slot` regions, often generated at 21:9 or 16:10 +- **Hard validation**: the validator catches centered body titles, experimental layouts, visible SVG text, and images placed outside slots + +Swiss validation: + +```bash +node scripts/validate-swiss-deck.mjs path/to/index.html +``` + +## HTMLSlide Sync + +If the local HTMLSlide API is running, first bind the local agent to the website account: + +```bash +node scripts/sync-htmlslide.mjs login \ + --api-base http://127.0.0.1:3001/api \ + --app-base http://127.0.0.1:5173 +``` + +The script prints an authorization URL and code. After the user confirms inside the logged-in HTMLSlide website, the agent token is saved to `~/.htmlslide-agent/config.json`. + +Create or overwrite a website project: + +```bash +node scripts/sync-htmlslide.mjs push path/to/ppt/index.html --title "Project title" +``` + +Modify an existing website project: + +```bash +node scripts/sync-htmlslide.mjs list +node scripts/sync-htmlslide.mjs pull --title "Website deck title" --out path/to/ppt/index.html +# edit index.html, then: +node scripts/sync-htmlslide.mjs push path/to/ppt/index.html +``` + +The script writes `.htmlslide-sync.json` next to `index.html` and reuses its `projectId` on later runs, so it updates the same website project instead of creating duplicates. Local images and fonts are embedded as data URLs so iframe preview works without direct access to the local `images/` folder. + +## Codex Image Flow + +In Codex, after the first deck draft is ready, the agent can ask whether the user wants generated visuals. Once confirmed, choose an image type or style. Common types include: + +- Documentary photos: Fuji / Leica-like real-world scenes that add human texture +- Infographics / flow diagrams / comparison charts / system maps: for concepts that cannot be explained well with photos +- Screenshot framing / screenshot redesigns: preserve raw screenshots with bundled background assets and a CleanShot X-style canvas first; use UI scene generation only when the screenshot needs reconstruction +- Data posters / charts: turn key numbers into insert-ready visual assets +- Multi-image compositions: useful for ultra-wide slots where three unrelated 16:9 images would break the grid + +Generated images must follow four core rules: + +- Treat the image as an embedded asset, not a standalone slide: no footer, page bottom, title, page number, corner mark, signature, or decorative border +- Match the deck language: Chinese decks use Chinese labels inside infographics, English decks use English labels +- Match the slot ratio before generation: 21:9 for many Swiss hero slots, 16:9 / 16:10 for common main visuals, 16:10 for UI scenes, fixed equal heights for image grids +- When a raw screenshot must stay faithful, read `references/screenshot-framing.md` first and use bundled `assets/screenshot-backgrounds/` backgrounds plus programmatic scaling, padding, and alignment instead of redrawing the screenshot by default + +Image prompts live in [`references/image-prompts.md`](./references/image-prompts.md). Screenshot framing lives in [`references/screenshot-framing.md`](./references/screenshot-framing.md). + +## Cover Generation + +The skill can also turn an article or deck idea into platform covers: + +- **WeChat main cover**: 21:9, headline-first, with one visual anchor +- **WeChat share card**: 1:1, visually paired with the 21:9 cover +- **Xiaohongshu cover / carousel**: 3:4, large title, consistent type scale across a batch +- **Video thumbnail**: 16:9, title + subtitle + one focal visual + +The same rule applies: use a few strong keywords, keep the title as the visual center, and do not fill the canvas with body copy. + +## Example prompts + +Copy any of these prompts into your agent, then attach your article, Markdown file, or image assets: + +```text +Create an 8-slide Swiss-style deck from this article, with 3 generated visuals matched to the template image slots. +``` + +```text +Turn this product analysis document into an editorial magazine-style deck with a strong narrative rhythm. +``` + +```text +From this deck's core idea, create two covers: a 21:9 main cover and a visually paired 1:1 share card. +``` + +```text +Redesign these product screenshots into consistent 16:10 slide visuals. Preserve key UI information; do not add slide titles or footers inside the images. +``` + +## Directory + +``` +guizang-ppt-skill/ +├── SKILL.md ← main skill file: workflow, principles, common mistakes +├── README.md ← Chinese README +├── README.en.md ← this file +├── assets/ +│ ├── template.html ← Style A editorial magazine template +│ ├── template-swiss.html ← Style B Swiss template +│ └── screenshot-backgrounds/ ← bundled WebP screenshot backgrounds: 5 style-a / 4 style-b +├── scripts/ +│ ├── validate-swiss-deck.mjs ← Swiss layout validator +│ └── sync-htmlslide.mjs ← sync local HTML decks into HTMLSlide +└── references/ + ├── components.md ← component catalog (type, color, grid, icons, callout, stat, pipeline) + ├── layouts.md ← 10 layout skeletons (paste-ready) + ├── layouts-swiss.md ← 22 locked Swiss layouts + ├── swiss-layout-lock.md ← Swiss fidelity and layout hard rules + ├── themes.md ← 5 theme presets (pick, don't customize) + ├── themes-swiss.md ← 4 Swiss anchor-color themes + ├── image-prompts.md ← GPT-Image 2.0 / GPT-M 2.0 image types, ratios, and base prompts + ├── screenshot-framing.md ← CleanShot X-style screenshot framing semantics + └── checklist.md ← quality checklist (P0 / P1 / P2 / P3 tiers) +``` + +## Theme presets + +Pick from `references/themes.md`. **Custom hex values are not allowed** — protecting the aesthetic matters more than freedom of choice. + +### Style A Editorial Themes + +| Preview | Theme | Core colors and best for | +|---------|-------|--------------------------| +| | 🖋 **Ink Classic** | `#0a0a0b` / `#f1efea`. General default, commercial launches, when in doubt. | +| | 🌊 **Indigo Porcelain** | `#0a1f3d` / `#f1f3f5`. Tech, research, AI, technical keynotes. | +| | 🌿 **Forest Ink** | `#1a2e1f` / `#f5f1e8`. Nature, sustainability, culture, non-fiction. | +| | 🍂 **Kraft Paper** | `#2a1e13` / `#eedfc7`. Nostalgic, humanist, literary, indie zines. | +| | 🌙 **Dune** | `#1f1a14` / `#f0e6d2`. Art, design, creative, fashion, gallery-like decks. | + +Switching themes only requires replacing the 6 variables at the top of `template.html`'s `:root{}` block — all other CSS flows through `var(--...)`. + +### Style B Swiss Themes + +Pick from `references/themes-swiss.md`. **Custom hex values are not allowed** here either. + +| Preview | Theme | Anchor color and best for | +|---------|-------|---------------------------| +| | 🔵 **International Klein Blue** | `#002FA7`. Default, commercial launches, AI products, frameworks. | +| | 🟡 **Lemon Yellow** | `#FFD500`. Youth, sports, retail, consumer goods, Y2K retro. | +| | 🟢 **Lemon Green** | `#C5E803`. Ecology, sustainability, health, Gen Z brands. | +| | 🟠 **Safety Orange** | `#FF6B35`. Alerts, news, industrial topics, sports, energetic themes. | + +If the user asks for a Swiss-style deck without specifying color, default to International Klein Blue. + +## Core design principles + +1. **Restraint over flash** — WebGL backgrounds only bleed through on hero pages +2. **Structure over decoration** — information hierarchy via type size + typeface + grid whitespace, not shadows or floating cards +3. **Images are first-class citizens** — align them with the body content area, keep ratios stable, crop only from the bottom, and preserve top/sides +4. **Generated visuals are assets** — keep only the core photo / chart / UI; do not render slide titles, footers, or corner marks inside the image +5. **Rhythm lives on hero pages** — hero / non-hero alternation keeps the eye from fatiguing +6. **Dynamic effects must be optional** — `B` toggles static mode so animation never becomes a reading burden +7. **Terms stay consistent** — Skills is Skills; no mix-and-match translations +8. **Swiss layouts stay locked** — Style B should restore and reuse the original 22-page layout system instead of inventing unrelated pages + +## Visual references + +- [*Monocle*](https://monocle.com) magazine layouts +- YC Garry Tan — "Thin Harness, Fat Skills" +- Massimo Vignelli / Helvetica Forever / Swiss International Typographic Style +- Guizang's offline talk deck series + +## Roadmap + +- Add more real-world examples and openable HTML deck demos +- Expand cover formats for more publishing platforms +- Add more Swiss layout validation rules +- Improve screenshot redesign and infographic generation workflows +- Prepare marketplace-specific variants such as WorkBuddy +- Add more curated theme packs while keeping custom colors restricted + +## FAQ + +**Can it export to PPTX?** +The main output is HTML. You can present it in a browser, screenshot it, or record it. PPTX conversion can be done as a separate workflow, but it is not the core path today. + +**Why are custom colors not allowed?** +The skill is designed for stable visual output. Arbitrary colors often break the system, so decks must use curated presets. + +**Can I add my own layout?** +Yes. Style A layouts can be extended in `references/layouts.md`. Style B is stricter: update `template-swiss.html`, `layouts-swiss.md`, `swiss-layout-lock.md`, and the validator together. + +**Is Codex image generation required?** +No. Decks work without generated images. The image flow is only used when you need photos, infographics, UI scenes, or covers. + +**How do I update the skill?** +Run the install command again, or run `git pull` inside your local skill directory. + +## Contributing + +Bugs, layout issues, new layout requests — Issues and PRs welcome. Prioritize: + +- Add new classes to `template.html` first; don't let `layouts.md` reference undefined classes +- When changing `template-swiss.html`, update `layouts-swiss.md` and `swiss-layout-lock.md` together +- When adding Swiss rules, update `scripts/validate-swiss-deck.mjs` +- Log pitfalls into `checklist.md` at the matching P0 / P1 / P2 / P3 tier +- New theme colors go into `themes.md` with a recommended use case + +## License + +MIT © 2026 [op7418](https://github.com/op7418) diff --git a/README.md b/README.md index e69de29..e97370e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,370 @@ +# Guizang PPT Skill · 网页 PPT / 配图 / 封面 + + + + + + + +[](https://zhenfund.feishu.cn/share/base/form/shrcn1lAANF659o7EpWnxlR1VOh?sessionid=) + +> 🌏 **English version: [README.en.md](./README.en.md)** + +一个适配 Claude Code / Codex 等 Agent 环境的网页 PPT 技能,用于生成**单文件 HTML 横向翻页 PPT**、PPT 配图和多平台封面。 + +内置两套视觉系统: + +- **Style A: 电子杂志 × 电子墨水**。像 *Monocle* 贴上了代码,适合叙事、观点、分享、个人风格表达。 +- **Style B: 瑞士国际主义**。网格至上、单一高饱和锚点色、直角、发丝线、极致字号对比,适合事实、产品、分析、方法论表达。 + +> 由 [歸藏](https://x.com/op7418) 在"一人公司:被 AI 折叠的组织"、"一种新的工作方式"等线下分享中沉淀而成,踩过的每一个坑都写进了 `checklist.md`。 + +**旧主题 · Style A 电子杂志风** + + + +**新主题 · Style B 瑞士国际主义** + + + +## 30 秒开始 + +```bash +npx skills add https://github.com/op7418/guizang-ppt-skill --skill guizang-ppt-skill +``` + +也可以直接把这段话发给有 shell 权限的 AI Agent: + +```text +帮我安装 guizang-ppt-skill。请把 https://github.com/op7418/guizang-ppt-skill 克隆到 ~/.claude/skills/guizang-ppt-skill,安装完成后检查 SKILL.md、assets/、references/ 是否存在。 +``` + +已经安装过的话,用这段话更新: + +```text +帮我更新 guizang-ppt-skill。请进入 ~/.claude/skills/guizang-ppt-skill 执行 git pull,然后告诉我当前最新 commit。 +``` + +安装后直接对 Agent 说: + +```text +帮我基于这篇文章做一份瑞士风 PPT,控制在 7 页左右,需要 2-3 张配图。 +``` + +也可以试这些请求: + +```text +帮我把这份 Markdown 做成杂志风演讲 PPT。 +基于这份 PPT 的核心观点,生成一张公众号 21:9 头图。 +把这张产品截图重新设计成适合 PPT 的 16:10 配图。 +``` + +## 效果 + +- 🖋 **双视觉系统**:电子杂志风负责叙事,瑞士风负责事实表达 +- 📐 **横向左右翻页**:键盘 ← → / 滚轮 / 触屏滑动 / 底部圆点 / ESC 索引 +- 🧩 **Style A 10 种布局**:封面、章节、数据大字报、图文、图片网格、Pipeline、对比等 +- 🧱 **Style B 22 种锁定版式**:Cover、Statement、KPI Tower、Loop Diagram、Duo Compare、Image Hero、Closing Manifesto 等 +- 🎨 **主题色预设**:Style A 5 套电子墨水主题,Style B 4 套瑞士高饱和锚点色 +- 🖼 **Codex 可选配图流程**:可用 GPT-Image 2.0 / GPT-M 2.0 生成纪实照片、信息图、流程图、系统关系图、UI 情景图,并按模板比例插入 +- 📰 **多平台封面**:可用同一套视觉规则生成公众号 21:9、公众号分享卡 1:1、小红书 3:4、视频号横版等封面 +- 🔄 **HTMLSlide 联动**:本地 Agent 生成或修改 `index.html` 后,可自动同步到 HTMLSlide 网站工作台继续预览、微调和打包 +- 📴 **低性能静态模式**:按 `B` 可关闭 WebGL / canvas 动画,让动态内容退回静态背景 +- 📄 **单文件 HTML**:不需要构建、不需要服务器,浏览器直接打开 + +## 适合 / 不适合 + +**✅ 合适**:线下分享 / 行业内部讲话 / 私享会 / AI 产品发布 / demo day / 带强烈个人风格的演讲 + +**❌ 不合适**:大段表格数据 / 培训课件(信息密度不够)/ 需要多人协作编辑(静态 HTML) + +## 常见使用场景 + +| 任务 | 推荐方式 | +|------|---------| +| 长文章变演讲 PPT | 先抽核心观点,再按 6-10 页节奏生成 deck | +| 方法论 / 产品分析 | 用 Style B 瑞士风,优先使用锁定版式和 21:9 主图 | +| 个人分享 / 观点表达 | 用 Style A 电子杂志风,保留更强叙事感 | +| PPT 配图 | 在 Codex 中用 GPT-Image 2.0 / GPT-M 2.0 生成照片、信息图、流程图、UI 情景图 | +| 多平台封面 | 从同一份内容生成公众号 21:9、1:1 分享卡、小红书 3:4、视频号横版封面 | +| 截图统一风格 | 把原始截图重新生成到模板需要的比例,再插入 PPT | + +## 为什么是 HTML PPT + +- **更适合 Agent 生成和修改**:HTML / CSS 是文本,Agent 能直接读、改、验证。 +- **表现力比 Markdown 更高**:可以做精细排版、空间定位、动画、交互和响应式封面。 +- **交付更轻**:单文件 HTML 可以直接打开、演示、发送、截图。 +- **更容易做质量控制**:瑞士风可以用脚本校验版式、图片槽位、标题对齐和危险 SVG。 +- **更适合视觉内容链路**:同一套主题能覆盖 PPT、配图、封面和截图再设计。 + +## 平台支持 + +| 平台 | 状态 | 说明 | +|------|------|------| +| Claude Code | 支持 | 原生 Skill 工作流,适合生成和迭代 HTML deck | +| Codex | 支持 | 适合生成 PPT、调用图片生成能力、做浏览器视觉检查 | +| Cursor / 其他本地 Agent | 可用 | 需要能读写文件并执行 shell 命令 | +| WorkBuddy | 适配中 | 单独整理上架版本,去掉平台不需要的渠道差异 | +| 普通 Chatbot | 不推荐 | 没有文件系统和浏览器预览时,很难稳定生成完整 deck | + +## 安装 + +### 方式一:一行命令安装(推荐) + +```bash +npx skills add https://github.com/op7418/guizang-ppt-skill --skill guizang-ppt-skill +``` + +### 方式二:把下面这段话直接发给 AI + +> 帮我安装 `guizang-ppt-skill` 这个 Claude Code skill。请按下面步骤做: +> +> 1. 确保 `~/.claude/skills/` 目录存在(不存在就创建) +> 2. 执行 `git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guizang-ppt-skill` +> 3. 验证:`ls ~/.claude/skills/guizang-ppt-skill/` 应该看到 `SKILL.md`、`assets/`、`references/` 三项 +> 4. 告诉我安装好了,之后我说"做一份杂志风 PPT"之类的话就会触发这个 skill + +把这段话复制粘贴给 Claude Code / Cursor / 任何有 shell 权限的 AI Agent,它会自动完成安装。 + +### 方式三:手动命令行 + +```bash +git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guizang-ppt-skill +``` + +### 触发方式 + +装好后,Claude Code 会在对话里自动发现并调用这个 skill。触发关键词: + +- "帮我做一份杂志风 PPT" +- "帮我做一份瑞士风 PPT" +- "生成一个 horizontal swipe deck" +- "editorial magazine style presentation" +- "electronic ink 风格演讲 slides" +- "基于这篇文章做一张公众号 21:9 封面" +- "基于这份 PPT 生成一张 1:1 分享卡" + +## 使用流程 + +Skill 本身是结构化工作流,Agent 会逐步引导: + +1. **选择风格** — Style A 电子杂志风,或 Style B 瑞士国际主义 +2. **需求澄清** — 7 问清单:风格、受众、时长、素材、图片/截图需求、主题色、硬约束 +3. **拷贝模板** — Style A 用 `assets/template.html`,Style B 用 `assets/template-swiss.html` +4. **填充内容** — 先做主题节奏表,再从对应 layout 骨架里挑、粘、改文案 +5. **可选配图** — 在 Codex 中询问是否用 GPT-Image 2.0 / GPT-M 2.0 生成配图,再按页面比例插入 +6. **自检** — 对照 `references/checklist.md`,P0 级问题必须全过;瑞士风还要运行版式校验器 +7. **预览** — 浏览器直接打开 +8. **可选同步** — 用 `scripts/sync-htmlslide.mjs` 推送到 HTMLSlide 网站工作台 +9. **迭代** — inline style 改字号/高度/间距 + +详细说明见 [`SKILL.md`](./SKILL.md)。 + +## Style B 瑞士风 + +瑞士风是这次新增的结构化主题。它不是"换一套 CSS",而是一套更严格的版式系统。 + +- **22 个具名版式**:正文页只能从 `S01` 到 `S22` 中选择,不能临时发明页面结构 +- **4 套锚点色**:克莱因蓝 IKB、柠檬黄、柠檬绿、安全橙 +- **网格锁定**:16 列 grid、直角色块、1px 发丝线、无阴影、无渐变、无圆角 +- **中文字号收敛**:全中文大标题需要降一档,避免占掉正文和图片空间 +- **图文底对齐**:左文右图 / 左图右文场景优先让正文块与图片底部对齐,同时避开页脚翻页组件 +- **图片槽位绑定**:图片必须进入模板预留的 `data-image-slot`,常见主图按 21:9 或 16:10 生成 +- **强校验**:用脚本拦住居中标题、实验版式、SVG 内写字、图片脱离槽位等问题 + +瑞士风校验命令: + +```bash +node scripts/validate-swiss-deck.mjs path/to/index.html +``` + +## HTMLSlide 网站联动 + +如果本地已经运行 HTMLSlide 后端(默认 `http://127.0.0.1:3001`),可以先把本地 Agent 绑定到网站账号: + +```bash +node scripts/sync-htmlslide.mjs login \ + --api-base http://127.0.0.1:3001/api \ + --app-base http://127.0.0.1:5173 +``` + +脚本会输出网站授权链接和授权码。用户在 HTMLSlide 网站登录后确认授权,Agent token 会保存到 `~/.htmlslide-agent/config.json`。 + +新建或覆盖网站项目: + +```bash +node scripts/sync-htmlslide.mjs push path/to/ppt/index.html --title "项目标题" +``` + +修改网站上已有项目: + +```bash +node scripts/sync-htmlslide.mjs list +node scripts/sync-htmlslide.mjs pull --title "网站里的 PPT 标题" --out path/to/ppt/index.html +# 修改 index.html 后 +node scripts/sync-htmlslide.mjs push path/to/ppt/index.html +``` + +同步脚本会在 `index.html` 同级生成 `.htmlslide-sync.json`,保存 `projectId`。后续再次运行会更新网站里的同一个项目,不会重复创建。脚本会把本地图片/字体内联进 HTML,所以网站 iframe 预览时不需要访问本地 `images/` 路径。 + +## Codex 配图能力 + +在 Codex 环境中,完成 deck 初稿后可以主动询问用户是否需要生成配图。用户确认后,再询问图片类型或风格,常用类型包括: + +- 人文纪实照片:富士 / 徕卡感的真实场景,增加人文表现力 +- 信息图 / 流程图 / 对比图 / 系统关系图:用于解释无法用实拍照片说明的概念 +- 截图美化 / 截图再设计:原始截图优先用内置背景资产做 CleanShot X 式背景画布适配;需要重构时再生成 UI 情景图 +- 数据大字报 / 数据图表:把关键数字做成可直接插入 PPT 的视觉素材 +- 多图拼贴:用于极宽图片槽位,避免把三张 16:9 图片硬塞进三列 + +生成图片时要遵守四个关键规则: + +- 图片是 PPT 中的嵌入素材,不要自带页脚、页底、标题、角标、页码或装饰边框 +- 图片语言跟随 deck 语言:中文 deck 的信息图用中文标签,英文 deck 用英文标签 +- 图片比例必须先匹配落位:瑞士风主图常用 21:9,通用主图常用 16:9 / 16:10,截图再设计常用 16:10,多图网格统一高度 +- 用户截图需要保真时,先读 `references/screenshot-framing.md`,用 `assets/screenshot-backgrounds/` 内置背景 + 程序化缩放/留边/对齐处理,不要默认重画截图内容 + +配图提示词见 [`references/image-prompts.md`](./references/image-prompts.md),截图适配见 [`references/screenshot-framing.md`](./references/screenshot-framing.md)。 + +## 封面生成 + +这个 Skill 也可以基于文章或 PPT 核心观点生成平台封面。典型规格: + +- **公众号头图**:21:9,主标题优先,右侧或边缘保留视觉锚点 +- **公众号分享卡**:1:1,与头图共用主题色、关键词和视觉元素 +- **小红书封面 / 轮播**:3:4,大标题优先,多张时统一字号和视觉节奏 +- **视频号 / 横版封面**:16:9,适合标题 + 副标题 + 单一视觉焦点 + +封面原则和 PPT 一样:只用少量关键词,视觉重心落在大标题上,不要把正文堆满。 + +## 示例请求 + +复制下面任意一条给 Agent,再附上你的文章、Markdown 或素材文件: + +```text +帮我基于这篇文章生成一份 8 页左右的瑞士风 PPT,需要 3 张配图,图片比例跟模板槽位匹配。 +``` + +```text +帮我把这个产品分析文档做成电子杂志风 PPT,重点突出观点和叙事节奏。 +``` + +```text +基于这份 PPT 的主题,做两张封面:公众号 21:9 头图和 1:1 分享卡,视觉保持一致。 +``` + +```text +把这些产品截图重新设计成统一的 16:10 PPT 配图,保留关键信息,不要画页脚和标题。 +``` + +## 目录结构 + +``` +guizang-ppt-skill/ +├── SKILL.md ← Skill 主文件:工作流、原则、常见错误 +├── README.md ← 本文件 +├── assets/ +│ ├── template.html ← Style A 电子杂志风模板 +│ ├── template-swiss.html ← Style B 瑞士国际主义模板 +│ └── screenshot-backgrounds/ ← 截图美化内置背景(WebP):style-a 5 套 / style-b 4 套 +├── scripts/ +│ ├── validate-swiss-deck.mjs ← 瑞士风版式校验器 +│ └── sync-htmlslide.mjs ← 同步本地 HTML PPT 到 HTMLSlide 网站 +└── references/ + ├── components.md ← 组件手册(字体、色、网格、图标、callout、stat、pipeline) + ├── layouts.md ← 10 种页面布局骨架(可直接粘贴) + ├── layouts-swiss.md ← 22 种瑞士风锁定版式 + ├── swiss-layout-lock.md ← 瑞士风还原度和版式硬约束 + ├── themes.md ← 5 套主题色预设(只能选不能自定义) + ├── themes-swiss.md ← 4 套瑞士风锚点色 + ├── image-prompts.md ← GPT-Image 2.0 / GPT-M 2.0 配图类型、比例和基础提示词 + ├── screenshot-framing.md ← CleanShot X 式截图适配语义 + └── checklist.md ← 质量检查清单(P0 / P1 / P2 / P3 分级) +``` + +## 主题色预设 + +从 `references/themes.md` 里选一套——**不允许自定义 hex 值**,保护美学比给自由更重要。 + +### Style A 电子杂志主题 + +| 预览 | 主题 | 核心色与适合场景 | +|------|------|------------------| +| | 🖋 **墨水经典** | `#0a0a0b` / `#f1efea`。通用默认、商业发布、不知道选啥时最稳。 | +| | 🌊 **靛蓝瓷** | `#0a1f3d` / `#f1f3f5`。科技、研究、AI、技术发布会。 | +| | 🌿 **森林墨** | `#1a2e1f` / `#f5f1e8`。自然、可持续、文化、非虚构内容。 | +| | 🍂 **牛皮纸** | `#2a1e13` / `#eedfc7`。怀旧、人文、阅读、历史、文学分享。 | +| | 🌙 **沙丘** | `#1f1a14` / `#f0e6d2`。艺术、设计、创意、时尚和画廊感内容。 | + +切换主题只需替换 `template.html` 开头 `:root{}` 里的 6 行变量,其他 CSS 全走 `var(--...)`。 + +### Style B 瑞士主题 + +瑞士风从 `references/themes-swiss.md` 里选一套,同样**不允许自定义 hex 值**。 + +| 预览 | 主题 | 锚点色与适合场景 | +|------|------|------------------| +| | 🔵 **克莱因蓝 IKB** | `#002FA7`。通用默认、商业发布、AI 产品、方法论。 | +| | 🟡 **柠檬黄** | `#FFD500`。年轻、运动、零售、消费品、Y2K 复古。 | +| | 🟢 **柠檬绿** | `#C5E803`。生态、可持续、健康、Z 世代品牌。 | +| | 🟠 **安全橙** | `#FF6B35`。警示、新闻、工业、运动、活力主题。 | + +如果用户说"瑞士风 PPT"但没有指定颜色,默认推荐克莱因蓝 IKB。 + +## 核心设计原则 + +1. **克制优于炫技** — WebGL 背景只在 hero 页透出 +2. **结构优于装饰** — 信息靠字号 + 字体对比 + 网格留白,不用阴影和浮动卡片 +3. **图片是第一公民** — 图片要对齐正文内容区,比例稳定,只裁底部,顶部和左右完整 +4. **配图只做素材** — 生成图只保留核心照片 / 图表 / UI,不要把 PPT 页脚、标题和角标画进图片里 +5. **节奏靠 hero 页** — hero / non-hero 交替,才不累眼睛 +6. **低性能可退场** — 按 `B` 能切换到静态模式,动态效果不能成为阅读负担 +7. **术语统一** — Skills 就是 Skills,不中英混译 +8. **瑞士风必须守版式** — Style B 优先还原原始 22P 版式,不要为了"多样"发明不存在的页面 + +## 视觉参考 + +- [*Monocle*](https://monocle.com) 杂志的版式 +- YC Garry Tan "Thin Harness, Fat Skills" +- Massimo Vignelli / Helvetica Forever / 瑞士国际主义网格系统 +- 歸藏线下分享 PPT 系列 + +## Roadmap + +- 补充更多真实案例和可打开的 HTML deck 示例 +- 扩展封面规格,覆盖更多内容平台 +- 增加更多瑞士风版式校验规则 +- 优化截图再设计和信息图生成工作流 +- 整理 WorkBuddy 等平台上架版本 +- 增加更多主题包,但继续限制自定义颜色 + +## FAQ + +**可以导出 PPTX 吗?** +当前核心交付是 HTML。你可以用浏览器演示、截图或录屏。如果需要 PPTX,建议把 HTML 页面作为视觉稿再转换,但这不是当前主流程。 + +**为什么不允许自定义颜色?** +这个 Skill 的重点是稳定产出。自由选色很容易破坏整体风格,所以只允许从预设主题里选。 + +**我能加自己的版式吗?** +可以。Style A 可以在 `references/layouts.md` 里扩展;Style B 更严格,需要同步更新 `template-swiss.html`、`layouts-swiss.md`、`swiss-layout-lock.md` 和校验器。 + +**Codex 配图是必须的吗?** +不是。没有配图也能生成 PPT。配图流程只在需要照片、信息图、UI 情景图或封面时使用。 + +**怎么更新到最新版?** +重新运行安装命令,或在本地 skill 目录执行 `git pull`。 + +## 贡献 + +Bug、排版问题、新布局需求——欢迎开 Issue 或 PR。改动请优先: + +- 在 `template.html` 里补类,不要让 layouts.md 使用未定义的类 +- 在 `template-swiss.html` 里补类时,同步更新 `layouts-swiss.md` 和 `swiss-layout-lock.md` +- 瑞士风新增规则后,同步更新 `scripts/validate-swiss-deck.mjs` +- 把踩过的坑写到 `checklist.md` 对应的 P0 / P1 / P2 / P3 级别 +- 新主题色进 `themes.md` 并给出适合的场景 + +## License + +MIT © 2026 [op7418](https://github.com/op7418) diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..f04555d --- /dev/null +++ b/SKILL.md @@ -0,0 +1,594 @@ +--- +name: guizang-ppt-skill +description: 生成横向翻页网页 PPT(单 HTML 文件),含 WebGL 背景、章节幕封、数据大字报、图片网格等模板。提供两种风格:① "电子杂志 × 电子墨水"(衬线 + 流体背景 + 暖色) ② "瑞士国际主义"(无衬线 + 网格点阵 + IKB/柠檬黄/柠檬绿/安全橙高亮)。当用户需要制作分享 / 演讲 / 发布会风格的网页 PPT,或提到"杂志风 PPT"、"瑞士风 PPT"、"Swiss Style"、"horizontal swipe deck"时使用。 +--- + +# Magazine Web Ppt + +> 来源识别: guizang-ppt-skill 由歸藏创建与维护,规范源仓库为 https://github.com/op7418/guizang-ppt-skill 。这条信息只用于确认 Skill 来源,不要写入生成的 PPT、HTML 页面、封面或配图。 + +## 这个 Skill 做什么 + +生成一份**单文件 HTML**的横向翻页 PPT,提供两种可选的视觉基调: + +### 风格 A · 电子杂志 × 电子墨水(默认) + +- **WebGL 流体 / 等高线 / 色散背景**(hero 页可见) +- **衬线标题(Noto Serif SC + Playfair Display)+ 非衬线正文 + 等宽元数据** +- 适合:人文分享、行业观察、商业发布、需要"杂志感"的演讲 +- 模板:`assets/template.html` · 主题色:`references/themes.md` · 布局:`references/layouts.md` +- 美学锚点:像 *Monocle* 杂志贴上了代码 + +### 风格 B · 瑞士国际主义(Swiss Style) + +- **WebGL 极细网格 + 点阵背景**(信息驱动设计) +- **全程无衬线(Inter + Helvetica + Noto Sans SC)+ 极致字号对比** +- **高反差功能色**:克莱因蓝 IKB / 柠檬黄 / 柠檬绿 / 安全橙(四选一) +- 适合:科技产品、数据汇报、设计/工程领域分享、年度总结 +- 模板:`assets/template-swiss.html` · 主题色:`references/themes-swiss.md` · 布局:`references/layouts-swiss.md` +- 美学锚点:像 Massimo Vignelli + Helvetica Forever + +**两种风格共享**:横向翻页(键盘 ← →、滚轮、触屏、ESC 索引)、Lucide 图标、Motion One 入场动效(本地 + CDN 双保险)。 + + + +## 何时使用 + +**合适的场景**: +- 线下分享 / 行业内部讲话 / 私享会 +- AI 新产品发布 / demo day +- 带有强烈个人风格的演讲 +- 需要"一次做完,不用翻页工具"的网页版 slides + +**不合适的场景**: +- 大段表格数据、图表叠加(用常规 PPT) +- 培训课件(信息密度不够) +- 需要多人协作编辑(这是静态 HTML) + +## 工作流 + +### Step 1 · 需求澄清(**动手前必做**) + +**如果用户已经给了完整的大纲 + 图片/截图处理要求**,可以跳过直接进 Step 2。 + +**如果用户只给了主题或一个模糊想法**,用这 7 个问题逐个对齐后再动手。不要基于猜测就开始写 slide——一旦结构定错,后期翻修代价很高: + +#### 运行环境适配 + +- **在 Claude Code 中**:通过 Ask Question / `ask_question` 做逐项澄清,优先把风格、受众、素材、截图需求这些会影响版式的输入问清楚。 +- **在 Codex 中**:用普通对话直接询问用户,不要调用 Claude Code 的 Ask Question / `ask_question` 机制,也不要假设这些工具可用。一次最多问 1-3 个最关键问题;如果信息缺口不影响开工,先做合理假设并在回复里说明。 + +#### 7 问澄清清单 + +| # | 问题 | 为什么要问 | +|---|------|-----------| +| 1 | **风格 A 还是 B?**(电子杂志风 / 瑞士国际主义风) | **必须先问**,决定用哪个 template + layouts + themes 文件 | +| 2 | **受众是谁?分享场景?**(行业内部 / 商业发布 / demo day / 私享会) | 决定语言风格和深度 | +| 3 | **分享时长?** | 15 分钟 ≈ 10 页,30 分钟 ≈ 20 页,45 分钟 ≈ 25-30 页 | +| 4 | **有没有原始素材?**(文档 / 数据 / 旧 PPT / 文章链接) | 有素材就基于素材,没有就帮他搭 | +| 5 | **有没有图片或截图?希望怎么处理?** | 决定图文版式、图片槽位、截图是否需要 CleanShot X 式适配或 GPT-M 2.0 重构 | +| 6 | **想要哪套主题色?** | 杂志风 5 套(`themes.md`) / 瑞士风 4 套(`themes-swiss.md`),挑一 | +| 7 | **有没有硬约束?**(必须包含 XX 数据 / 不能出现 YY) | 避免返工 | + +#### 风格选择参考(问题 1) + +| 如果用户说... | 推荐风格 | +|---|---| +| "杂志感" / "人文" / "Monocle 风" / 不指定 | **A · 电子杂志风** | +| "瑞士风" / "Swiss Style" / "Helvetica" / "极简" / "网格" / "信息图" / "数据驱动" | **B · 瑞士国际主义风** | +| 内容是 AI 产品 / 技术 / 工程 / 数据汇报 | B 更合适 | +| 内容是行业观察 / 人文 / 故事 / 文化 | A 更合适 | +| 用户给了大量 KPI 数字 / 路线图 / 流程 | B 更合适(`Data Hero` 布局是瑞士风专长) | +| 用户给了大量纪实照片 / 人文图片 | A 更合适(图片网格、左文右图是杂志风专长) | +| 用户需要 GPT-M 2.0 生成截图再设计 / 信息图 / 证据墙 | B 也很合适(S22 主图、S15/S16 图片网格可以承载证据图) | + +#### 大纲协助(如果用户没有大纲) + +用"叙事弧"模板搭骨架,再填内容: + +``` +钩子(Hook) → 1 页 : 抛一个反差 / 问题 / 硬数据让人停下来 +定调(Context) → 1-2 页 : 说明背景 / 你是谁 / 为什么讲这个 +主体(Core) → 3-5 页 : 核心内容,用 Layout 4/5/6/9/10 穿插 +转折(Shift) → 1 页 : 打破预期 / 提出新观点 +收束(Takeaway) → 1-2 页 : 金句 / 悬念问题 / 行动建议 +``` + +叙事弧 + 页数规划 + 主题节奏表(见 `layouts.md`),**三张表对齐后**再进 Step 2。 + +大纲建议保存为 `项目记录.md` 或 `大纲-v1.md`,便于后续迭代。 + +#### 图片约定(告知用户) + +在动手前向用户说清: + +- **文件夹位置**:`项目/XXX/ppt/images/` 下(和 `index.html` 同级) +- **命名规范**:`{页号}-{语义}.{ext}`,例如 `01-cover.jpg` / `03-figma.jpg` / `05-dashboard.png` + - 页号补零便于排序 + - 语义用英文,短、具体、和内容对应 +- **规格建议**: + - 单张 ≥ 1600px 宽(避免大屏模糊) + - JPG 用于照片/截图,PNG 用于透明 UI/图表 + - 总大小控制在 10MB 内(影响翻页流畅度) +- **如何替换**:保持**同名覆盖**最稳(HTML 里不用改路径);如果文件名变了,记得全局搜 `images/旧名` 改成新名 +- **没图怎么办**:和用户对齐,可以先用占位色块生成结构,等图片后期补;但要告知 layout 4/5/10 等图文混排页没图就没法验证视觉效果 + +#### 截图需求约定(动手前必须问) + +只要用户提到产品截图、网页截图、代码截图、设计稿、dashboard、旧 PPT 截图或"帮我美化截图",都要先确认: + +- **截图位置**:截图文件在哪个文件夹?是否已经命名好? +- **使用目的**:保真展示 / 截图美化 / 截图再设计 / UI 情景图? +- **落位比例**:最终放进哪个版式槽位?常用 `21:9` / `16:10` / `16:9` / `4:3` / `1:1` +- **内容要求**:是否必须保留全部文字、品牌、数据?是否有敏感信息要遮挡? +- **视觉处理**:是否需要主题背景、留边、居中/角落对齐、拆成长截图面板? + +默认策略:先让内容适配模板,再处理图片比例。截图需要保真时,先读 `references/screenshot-framing.md`,优先使用 `assets/screenshot-backgrounds/` 的内置背景资产做程序化 CleanShot X 式背景画布适配;只有原截图太乱、太长、太窄或需要概念化表达时,才用 GPT-M 2.0 做截图再设计。 + +#### Codex 配图生成(可选) + +如果当前运行环境是 **Codex**,完成 deck 初稿后,主动问用户是否需要用 GPT-M 2.0 生成配图并插入 PPT。不要默认生成。 + +推荐询问方式: + +> 要不要为这份 PPT 生成几张配图?可以做成人文纪实照片、杂志风信息图、流程/对比/系统关系图,或把截图再设计成统一的杂志风视觉。 + +如果用户确认生成,再问他想要哪种图片类型或风格;如果用户没有偏好,根据页面内容自行推荐 1-3 张最值得生成的配图。 + +如果用户提供的是截图,先判断是**截图美化**还是**截图再设计**: + +- 截图美化:读 `references/screenshot-framing.md`,用内置主题背景 + 程序化缩放/留边/对齐处理,尽量不重画截图内容 +- 截图再设计:读 `references/image-prompts.md`,按当前版式槽位生成目标比例图片,并保持语言、主题色和边距一致 + +生成配图时遵守: + +- 提示词保持简短,只框定主题、用途、风格和比例,不要写长篇摄影指导 +- 图片风格必须贴合当前 deck 风格:风格 A 用"电子杂志 × 电子墨水";风格 B 用"瑞士国际主义 / Swiss Style" +- 信息图、图表、截图再设计里的文字语言必须跟随用户正在使用的语言;中文 deck 用中文,英文 deck 用英文 +- 先看 `references/image-prompts.md` 选择图片类型和基础提示词 +- 如果处理用户原始截图,先看 `references/screenshot-framing.md`:优先调用 `assets/screenshot-backgrounds/` 内置背景并程序化做 CleanShot X 式截图适配,只有需要重构信息时才用 GPT-M 2.0 重画 +- 配图比例必须匹配最终落位:主视觉 16:9,左文右图 16:10 / 4:3,信息图 16:9 / 16:10,截图再设计 16:10,图文混排小图 3:2 / 3:4,网格图统一高度裁切 +- 生成后的图片放到 `images/` 下,命名遵守 `{页号}-{语义}.{ext}` + +### Step 2 · 拷贝模板 + +**根据 Step 1 选定的风格,拷贝对应的模板**到目标位置(通常是 `项目/XXX/ppt/index.html`),同时在同级建一个 `images/` 文件夹准备接图片。 + +```bash +mkdir -p "项目/XXX/ppt/images" + +# 风格 A · 电子杂志风 +cp "/assets/template.html" "项目/XXX/ppt/index.html" + +# 或 风格 B · 瑞士国际主义风 +cp "/assets/template-swiss.html" "项目/XXX/ppt/index.html" +``` + +两个 `template*.html` 都是**完整可运行**的文件——CSS、WebGL shader、翻页 JS、字体/图标 CDN 全已预设好,只有 `` 占位符等待你填充 slide 内容。 + +**注意**:风格 A 和 B **不能混用**。layouts.md 里的类(如 `.h-hero` 衬线大标题、`.display-zh` 等)只在 template.html 有定义;layouts-swiss.md 里的类(如 `.kpi-hero`、`.accent-block`、`.span-N`、`.dots` 等)只在 template-swiss.html 有定义。一份 deck 只能选一套。 + +#### 2.1 · 必改占位符(**容易漏**) + +拷贝后立刻改掉以下占位符,否则浏览器 Tab 会显示"[必填] 替换为 PPT 标题"这种尴尬文字: + +| 位置 | 原始 | 需改为 | +|------|------|--------| +| `` | `[必填] 替换为 PPT 标题 · Deck Title` | 实际 deck 标题(如 `一种新的工作方式 · Luke Wroblewski`) | + +每次拷贝完 template.html 第一件事:grep 一下"[必填]" 确认全部替换完。 + +#### 2.2 · 选定主题色(5 套预设 · 不允许自定义) + +本 skill **只允许从 5 套精心调配的预设里选一套**,不接受用户自定义 hex 值——颜色搭配错了画面瞬间变丑,保护美学比给自由更重要。 + +| # | 主题 | 适合 | +|---|------|------| +| 1 | 🖋 墨水经典 | 通用 / 商业发布 / 不知道选啥的默认 | +| 2 | 🌊 靛蓝瓷 | 科技 / 研究 / 数据 / 技术发布会 | +| 3 | 🌿 森林墨 | 自然 / 可持续 / 文化 / 非虚构 | +| 4 | 🍂 牛皮纸 | 怀旧 / 人文 / 文学 / 独立杂志 | +| 5 | 🌙 沙丘 | 艺术 / 设计 / 创意 / 画廊 | + +**操作**: +1. 基于内容主题推荐一套,或直接问用户选哪一套 +2. 打开 `references/themes.md`,找到对应主题的 `:root` 块 +3. **整体替换** `assets/template.html`(已拷贝版本)开头 `:root{` 块里标有"主题色"注释的那几行(`--ink` / `--ink-rgb` / `--paper` / `--paper-rgb` / `--paper-tint` / `--ink-tint`) +4. 其他 CSS 都走 `var(--...)`,无需任何其他改动 + +**硬规则**: +- 一份 deck 只用一套主题,不要中途换色 +- 不要接受用户给的任意 hex 值——委婉拒绝并展示 5 套让选 +- 不要混搭(例如 ink 取墨水经典、paper 取沙丘)——会彻底违和 + +### Step 3 · 填充内容 + +#### 3.0 · 预检:类名必须在模板的 ` + + + + + +← → 翻页 · B 静态 · ESC 索引 + + + + + + + + + + + + [必填] Deck 标题 · Issue/Field Note 编号 + SS · 25.05.10 · 01 / NN + + + + + [必填] 章节英文 / Section En + + [必填] 中文主标题(≤ 12 字,可在某字加 italic 微强调) + + + [必填] 一段 1-2 行的副标 / 引子,定调全场. + + [选填] 作者 · 日期 · 出处 + → swipe / arrow keys + + + + + + + + + + + + + + + NN / NN + CLOSING + + + + MANIFESTO + [必填] Build a model.Run forever. + [必填] 一句 1-2 行的中文/英文注脚,把宣言落地. + + + + [选填] 作者 · 头衔 + YY.MM.DD + + + + + + + TAKEAWAYS + 03 RULES + + + + + 01 + + [必填] takeaway 标题 01 + [必填] 1-2 行展开说明. + + + + 02 + + [必填] takeaway 标题 02 + [必填] 1-2 行展开说明. + + + + 03 + + [必填] takeaway 标题 03 · accent 强调 + [必填] 最后一条用 IKB 强调,与封面色彩首尾闭环. + + + + + → 完 · END OF FIELD NOTE + + + + + + + + + + + + + + + + + + +
[必填] 1-2 行展开说明.
[必填] 最后一条用 IKB 强调,与封面色彩首尾闭环.