Skip to content

nexu-io/open-design / plugins/community/humanize-ppt

humanize-ppt

Verified

A presentation system for agent-made PPTs — born for the talk, not just the template. It turns raw material into an AST (audience-state-transfer) outline with per-page visual-enhancement decisions (image / SVG diagram / video), hands a production brief to a downstream renderer (HTML-PPT skills or native PPTX), then runs a capped 3-round presentation checkup (演讲体检) on the rendered deck. It never renders slides itself. Use before generating PPT/HTML slides from raw material, and after rendering when the user says things like "给这份 deck 做演讲体检" or "PPT 渲染质检". If all you want is one beautiful template page with no outline and no checkup, a rendering skill alone is enough.

FileKindSize
LICENSEother219 B
SKILL.mdskill md15.6 KB
SPEC.mdmarkdown13.1 KB
adapters/guizang-bridge-notes.mdmarkdown153 B
adapters/ppt-master-bridge-notes.mdmarkdown3.3 KB
adapters/presenter-adapter-spec.mdmarkdown458 B
adapters/zara-bridge-notes.mdmarkdown175 B
contracts/asset-manifest.template.mdmarkdown75 B
contracts/ast-outline.schema.mdmarkdown211 B
contracts/deck-brief.template.mdmarkdown114 B
contracts/router-plan.schema.jsonconfig1.2 KB
contracts/run-manifest.schema.jsonconfig608 B
contracts/slide-plan.schema.jsonconfig4.4 KB
contracts/speaker-intent.template.mdmarkdown61 B
contracts/video-slots.schema.jsonconfig528 B
docs/index.mdmarkdown9.2 KB
docs/local-demo.mdmarkdown3.2 KB
examples/01-ai-tool-update/source.mdmarkdown940 B
open-design.jsonconfig1.6 KB
references/agent-teams-public-preview.mdmarkdown2.9 KB
references/beautiful-preview-first-adapter.mdmarkdown2.7 KB
references/guizang-material-qa.mdmarkdown5.2 KB
references/guizang-presenter-deploy.mdmarkdown1.9 KB
references/guizang-production-brief-orchestrator.mdmarkdown5.9 KB
references/humanize-ppt-public-writing.mdmarkdown2.5 KB
references/presenter-export-adapter.mdmarkdown2.5 KB
references/preview-outline-spec.mdmarkdown7.3 KB
references/qa-failure-modes.en.mdmarkdown18.7 KB
references/qa-failure-modes.mdmarkdown16.6 KB
references/renderer-guidance.mdmarkdown2.1 KB
references/renderer-verification.mdmarkdown2.9 KB
references/selected-template-full-deck-adapter.mdmarkdown2.5 KB
references/style-gallery-spec.mdmarkdown5.1 KB
references/workbuddy-team-packaging-and-video-materials.mdmarkdown5.2 KB
registry/renderer_registry.jsonconfig11.4 KB
scripts/humanize_ppt.pyscript349 B
scripts/humanize_ppt_v1.pyexecutablescript11.0 KB
scripts/humanize_ppt_v2.pyexecutablescript174.5 KB
scripts/humanize_ppt_v3.pyscript331 B
scripts/humanize_ppt_v4.pyscript350 B
scripts/humanize_ppt_v5.pyscript354 B
scripts/pptx_qa.pyscript14.9 KB
scripts/preview_outline_html.pyscript9.6 KB
scripts/smoke_check.pyscript11.4 KB

scripts/humanize_ppt_v1.py

View on GitHub
#!/usr/bin/env python3
import argparse, json, html, shutil
from pathlib import Path
from datetime import datetime

ROLES = [
    ("hook", "AI 工具每天都在更新,但真正的问题不是功能有没有。", "抓住注意力:观众已经对功能清单疲劳。"),
    ("conflict", "如果直接把资料塞进 PPT,模型噪音会进入页面。", "制造张力:漂亮页面不等于可讲结构。"),
    ("method", "Humanize PPT 先用 AST 把资料变成观众路径。", "解释方法:Audience、State、Transfer。"),
    ("proof", "同一份资料可以走中文稳定、风格探索、演讲增强、上线交付。", "给出证据:工作流不是模板拼盘。"),
    ("takeaway", "先定内容,再定风格;先出 PPT,再加演讲。", "收束成可带走原则。"),
]

STYLES = {
    "guizang-stable": {
        "label": "中文稳定 / guizang-style",
        "bg": "#f6f1e8", "fg": "#171717", "accent": "#8b1e1e", "font": "-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif"
    },
    "zara-editorial": {
        "label": "风格探索 / Zara Editorial",
        "bg": "#111111", "fg": "#f7f1e8", "accent": "#d7b56d", "font": "Georgia,'Times New Roman','PingFang SC',serif"
    },
    "zara-contrast": {
        "label": "风格探索 / Zara Contrast",
        "bg": "#fafafa", "fg": "#111111", "accent": "#ff4d00", "font": "Inter,-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif"
    },
}

def read_source(path):
    text = Path(path).read_text(encoding='utf-8')
    lines = [l.strip() for l in text.splitlines() if l.strip() and not l.startswith('#')]
    return text, lines

def make_plan(title, lines):
    plan=[]
    for i,(role,msg,intent) in enumerate(ROLES,1):
        evidence = lines[min(i-1, len(lines)-1)] if lines else msg
        plan.append({
            "slide_id": f"S{i:02d}",
            "role": role,
            "title": title if i == 1 else msg.split('。')[0],
            "message": msg,
            "visible_content": [msg, evidence[:90]],
            "speaker_intent": intent,
            "asset_need": "可选截图 / 简单流程图" if i in (3,4) else "无",
            "recommended_renderer": "guizang-stable or zara-style"
        })
    return plan

def write_contracts(out, title, plan):
    out.mkdir(parents=True, exist_ok=True)
    (out/'deck_brief.md').write_text(f"""# Deck Brief\n\n## Deck Goal\n解释 Humanize PPT V0.1 如何把资料变成可讲、可生成、可上线的 PPT 工作流。\n\n## Audience\n对 AI 工具、PPT Agent、Skill 工作流感兴趣的内容创作者和独立开发者。\n\n## Initial State\n觉得 AI PPT 更新很多,但容易变成功能清单。\n\n## Desired State\n理解 Humanize PPT 的价值在于先做 AST 大纲导演,再交给下游 Skill。\n\n## Core Tension\n漂亮页面 vs 可讲结构。\n\n## Success Criteria\n观众能说出:先定内容,再定风格;先出 PPT,再加演讲;上线和演讲增强分开。\n""", encoding='utf-8')
    (out/'ast_outline.md').write_text(f"""# AST Outline\n\n## Audience\nAI 工具实测派、自媒体创作者、独立开发者。\n\n## State\n- Initial: 以为 PPT Agent 的差异主要是模板和视觉。\n- Desired: 意识到真正的前置差异是大纲导演层。\n\n## Transfer\n{chr(10).join([f"- {p['slide_id']} / {p['role']}: {p['speaker_intent']}" for p in plan])}\n""", encoding='utf-8')
    (out/'slide_plan.json').write_text(json.dumps(plan, ensure_ascii=False, indent=2), encoding='utf-8')
    (out/'speaker_intent.md').write_text('\n'.join([f"## {p['slide_id']} {p['title']}\n\n- Intent: {p['speaker_intent']}\n- Say: {p['message']}\n- Do not say: 不要展开成工具清单。\n" for p in plan]), encoding='utf-8')
    (out/'asset_manifest.md').write_text("# Asset Manifest\n\n| asset_id | type | purpose | status |\n|---|---|---|---|\n| flow-01 | diagram | OPC 工作流图 | generated by HTML/CSS |\n", encoding='utf-8')
    videos=[{"video_id":"V01","slide_id":"S04","purpose":"展示从 AST 大纲到风格探索的动态过程","duration_seconds":8,"aspect_ratio":"16:9","fallback_static":"flow-01"}]
    (out/'video_slots.json').write_text(json.dumps(videos, ensure_ascii=False, indent=2), encoding='utf-8')

def deck_html(title, plan, style_id, style):
    slides=[]
    for p in plan:
        bullets=''.join(f"<li>{html.escape(x)}</li>" for x in p['visible_content'])
        slides.append(f"""
<section class='slide' id='{p['slide_id']}'>
  <div class='kicker'>{html.escape(style['label'])} · {html.escape(p['role'])}</div>
  <h1>{html.escape(p['title'])}</h1>
  <p class='message'>{html.escape(p['message'])}</p>
  <ul>{bullets}</ul>
  <div class='footer'>{p['slide_id']} / Humanize PPT V0.1</div>
</section>""")
    return f"""<!doctype html><html lang='zh-CN'><head><meta charset='utf-8'><meta name='viewport' content='width=device-width,initial-scale=1'><title>{html.escape(title)} · {style_id}</title>
<style>
:root{{--bg:{style['bg']};--fg:{style['fg']};--accent:{style['accent']};--font:{style['font']};}}
*{{box-sizing:border-box}} body{{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font);overflow:hidden}} .slide{{display:none;width:100vw;height:100vh;padding:7vh 8vw;position:relative}} .slide.active{{display:block}} .kicker{{color:var(--accent);font-weight:700;letter-spacing:.08em;text-transform:uppercase}} h1{{font-size:clamp(42px,7vw,104px);line-height:1.02;margin:5vh 0 3vh;max-width:1100px}} .message{{font-size:clamp(22px,2.6vw,38px);line-height:1.35;max-width:980px}} ul{{font-size:clamp(18px,1.6vw,28px);line-height:1.6;max-width:1000px;margin-top:5vh}} .footer{{position:absolute;left:8vw;bottom:5vh;color:var(--accent)}} .nav{{position:fixed;right:24px;bottom:20px;font:16px system-ui;color:var(--fg);opacity:.7}}
</style></head><body>
{''.join(slides)}
<div class='nav'>← / → 翻页</div>
<script>
const slides=[...document.querySelectorAll('.slide')];let i=Number(new URLSearchParams(location.search).get('slide')||0);function show(n){{i=Math.max(0,Math.min(slides.length-1,n));slides.forEach((s,k)=>s.classList.toggle('active',k===i));location.hash='slide-'+(i+1);window.parent&&window.parent.postMessage({{type:'humanize-slide',index:i,total:slides.length}},'*')}}
document.addEventListener('keydown',e=>{{if(e.key==='ArrowRight'||e.key===' ')show(i+1);if(e.key==='ArrowLeft')show(i-1)}});show(i);
</script></body></html>"""

def write_styles(out, title, plan):
    styles_dir=out/'styles'; styles_dir.mkdir(exist_ok=True)
    cards=[]
    for sid,style in STYLES.items():
        (styles_dir/f'{sid}.html').write_text(deck_html(title, plan, sid, style), encoding='utf-8')
        cards.append(f"<a class='card' href='{sid}.html'><b>{style['label']}</b><span>{sid}</span></a>")
    index=f"""<!doctype html><html lang='zh-CN'><head><meta charset='utf-8'><title>Style Exploration</title><style>body{{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;margin:40px;background:#f6f3ee}}h1{{font-size:48px}}.grid{{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}}.card{{display:block;padding:28px;border:1px solid #ddd;border-radius:20px;background:white;color:#111;text-decoration:none}}.card b{{display:block;font-size:24px;margin-bottom:12px}}.card span{{color:#777}}</style></head><body><h1>Humanize PPT 风格探索</h1><p>先用 AST 大纲生成 3 个方向,确定后再进入 presenter / deploy。</p><div class='grid'>{''.join(cards)}</div></body></html>"""
    (styles_dir/'index.html').write_text(index, encoding='utf-8')

def write_presenter(out, title, plan, selected='zara-editorial'):
    pres=out/'presenter'; pres.mkdir(exist_ok=True)
    notes=[{"slide_id":p['slide_id'],"title":p['title'],"note":p['speaker_intent'],"say":p['message']} for p in plan]
    (pres/'notes.json').write_text(json.dumps(notes, ensure_ascii=False, indent=2), encoding='utf-8')
    deck_src=f"../styles/{selected}.html"
    next_src=f"../styles/{selected}.html?slide=1"
    html_doc=f"""<!doctype html><html lang='zh-CN'><head><meta charset='utf-8'><title>{html.escape(title)} · Presenter</title><style>body{{margin:0;background:#0d0d0d;color:#f8f8f8;font-family:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif}}.wrap{{display:grid;grid-template-columns:2fr 1fr;height:100vh;gap:16px;padding:16px}}iframe{{width:100%;height:100%;border:0;border-radius:16px;background:white}}.side{{display:grid;grid-template-rows:1fr 1fr 1fr;gap:16px}}.panel{{background:#1b1b1b;border:1px solid #333;border-radius:16px;padding:18px;overflow:auto}}h2{{margin:0 0 12px}}.note{{font-size:22px;line-height:1.45}}button{{font-size:18px;padding:10px 14px;margin-right:8px;border-radius:10px;border:0}}</style></head><body><div class='wrap'><iframe id='current' src='{deck_src}'></iframe><div class='side'><div class='panel'><h2>下一页</h2><iframe id='next' src='{next_src}'></iframe></div><div class='panel'><h2>Speaker Notes</h2><div id='note' class='note'></div></div><div class='panel'><h2>Controls</h2><p id='timer'>00:00</p><button onclick='go(-1)'>上一页</button><button onclick='go(1)'>下一页</button></div></div></div><script>const notes={json.dumps(notes, ensure_ascii=False)};let i=0,t=Date.now();function sync(){{document.getElementById('current').src='{deck_src}?slide='+i;document.getElementById('next').src='{deck_src}?slide='+Math.min(i+1,notes.length-1);document.getElementById('note').innerHTML='<b>'+notes[i].slide_id+' '+notes[i].title+'</b><br>'+notes[i].note+'<hr>'+notes[i].say}}function go(d){{i=Math.max(0,Math.min(notes.length-1,i+d));sync()}}document.addEventListener('keydown',e=>{{if(e.key==='ArrowRight'||e.key===' ')go(1);if(e.key==='ArrowLeft')go(-1)}});setInterval(()=>{{let s=Math.floor((Date.now()-t)/1000);document.getElementById('timer').textContent=String(Math.floor(s/60)).padStart(2,'0')+':'+String(s%60).padStart(2,'0')}},500);sync();</script></body></html>"""
    (pres/'index.html').write_text(html_doc, encoding='utf-8')

def write_deploy(out):
    dep=out/'deploy'; dep.mkdir(exist_ok=True)
    shutil.copytree(out/'styles', dep/'styles', dirs_exist_ok=True)
    shutil.copytree(out/'presenter', dep/'presenter', dirs_exist_ok=True)
    (dep/'index.html').write_text("<meta charset='utf-8'><h1>Humanize PPT Deploy Package</h1><ul><li><a href='styles/index.html'>风格探索</a></li><li><a href='presenter/index.html'>演讲者模式</a></li></ul>", encoding='utf-8')
    (dep/'presenter.html').write_text("<meta http-equiv='refresh' content='0; url=presenter/index.html'>", encoding='utf-8')

def main():
    ap=argparse.ArgumentParser()
    ap.add_argument('--source', required=True)
    ap.add_argument('--out', required=True)
    ap.add_argument('--title', default='Humanize PPT Demo')
    args=ap.parse_args()
    out=Path(args.out)
    text, lines=read_source(args.source)
    plan=make_plan(args.title, lines)
    write_contracts(out, args.title, plan)
    write_styles(out, args.title, plan)
    write_presenter(out, args.title, plan)
    write_deploy(out)
    print(json.dumps({"ok": True, "out": str(out), "style_index": str(out/'styles'/'index.html'), "presenter": str(out/'presenter'/'index.html'), "deploy": str(out/'deploy'/'index.html')}, ensure_ascii=False, indent=2))
if __name__ == '__main__': main()
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 195kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 195kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 195kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 195kUpdated Claude CodeCodexVerifiedInstall