canghe-slide-deck
Generates professional slide deck images from content. Creates outlines with style instructions, then generates individual slide images. Use when user asks to "create slides", "make a presentation", "generate deck", "slide deck", or "PPT".
1How It Works & Mechanism
It is a phased pipeline: Content Analysis → (Mandatory) Confirmation → Outline Generation → Prompt Generation → Image Generation → PPTX/PDF Merging; all intermediate artifacts are saved to disk, supporting resumable execution via --outline-only/--prompts-only/--images-only.
Input → Preferences → Analyze → [Check Existing?] → Confirm (1-2 rounds) → Outline → [Review Outline?] → Prompts → [Review Prompts?] → Images → Merge → Complete
Style system = 16 presets × 4 dimensions (texture/mood/typography/density) freely combined, where each preset maps to a specific set of dimension values.
| `blueprint` (Default) | grid + cool + technical + balanced | Architecture, system design |
Automatically selects a style if content signals match the keyword mapping table; falls back to blueprint if no match is found.
| tutorial, learn, education, guide, beginner | `sketch-notes` |
Recommends slide counts based on content length: <1000 words 5-10 slides … >5000 words 20-30 slides (with split recommended).
| > 5000 words | 20-30 (consider splitting) |
Step 2 is a strict gate: confirmations for style, audience, slide count, outline review, and prompt review are all non-skippable.
**Step 2 confirmation required** - do not skip (style, audience, slides, outline review, prompt review)
Preferences are loaded from EXTEND.md, checking project-level first and then user-level ($HOME).
# Check project-level first
Fixed artifact directory structure: source files, outline.md, prompts/, NN-slide-*.png, pptx, pdf.
slide-deck/{topic-slug}/
Merging is handled by two local scripts: npx -y bun invoking merge-to-pptx.ts / merge-to-pdf.ts.
npx -y bun ${SKILL_DIR}/scripts/merge-to-pptx.ts <slide-deck-dir>
Image generation is not implemented in this repository; instead, the agent is instructed to "select an available image generation skill" to generate images sequentially under the same session ID.
1. Select available image generation skill
Modification discipline: modify the prompt file first, then run --regenerate for the designated slide.
**IMPORTANT**: When updating slides, ALWAYS update the prompt file (`prompts/NN-slide-{slug}.md`) FIRST before regenerating.
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| api | 运行时图像生成后端(由 agent 选择『可用的图像生成 skill』完成出图,用户内容/提示词由此出网) |
| cli | bun / npx -y bun(运行合并脚本) |
4Recommended Governance & Evidence
- scripts/: Executes local scripts or commands: npx -y bun ${SKILL_DIR}/scripts/merge-to-pptx.ts <slide-deck-dir> (local PPTX merge)
- 网络端点: Declares external network access: the skill's own scripts make zero network calls (the two merge scripts perform only local file I/O and library invocations)
- 本地工作目录: File I/O and artifact output: slide-deck/{topic-slug}/source-{slug}.{ext} and analysis.md
5Second-Pass Verification
- [ok] 自身脚本无网络、无环境变量、无 spawn — skills/canghe-slide-deck/scripts/ 只有 merge-to-pdf.ts 与 merge-to-pptx.ts;bundle 风险扫描『網路請求:無命中』『憑證/環境變數』仅命中 ${SKILL_DIR} 与 $HOME 路径。
- [ok] 出图是跨 skill 委派而非本仓实现 — Step 7『1. Select available image generation skill』;本仓无任何图像生成脚本或端点声明。档位按『把用户素材送外部生成后端』落 orange。
- [ok] 确认门禁措辞与位置 — Notes 与 Step 2 均标注 ⚠️ REQUIRED;Notes 重复『Step 2 confirmation required - do not skip』。
- [ok] 合并脚本行为 — 风险扫描『寫盤/產生檔案』命中 merge-to-pdf.ts 的 Bun.write 与 merge-to-pptx.ts 的 pptx.writeFile,均为本地输出。
- [ok] 风格/维度数量与文件结构 — §1 清单列出 16 个 references/styles/*.md、5 个 references/dimensions/*.md(含 presets.md),与 SKILL.md 表格一致。
- [ok] 未展开文件的处理 — bundle 只展开 12 个最相关文件;base-prompt.md、design-guidelines.md 等未展开,故未对其内容下结论,仅按 §1 清单列为内部资产。
- [ok] 档位复核 — 自身脚本面绿蓝级,但核心用途将用户内容送入运行时图像生成服务 → 按站内『生成後端類』先例判 orange;无 red 触发项(无逆向/冒充/绕过/安全降级/任意代码执行)。
- [ok] 元数据与 commit — skill.commit 与 audit.skill_commit = dd0bf355955b4c82b764740b4183c86a72ba0e0c;license=MIT(仓库根 LICENSE),installs=null。
6Verdict & Scenarios
5efda196172fff6e…