1实现原理 · 为什么它能做到
七步工作流:Intake(只问会改变结果的信息)→ 抽故事成页面计划 → 选风格模式与主题 → 排页 → 复制种子模板 → 渲染与检查 → 交付。产物是「一组卡片图」而非单张海报。
### 1. Intake Gather only the missing information that changes the output:
两套视觉系统互斥:Editorial Magazine × E-ink(衬线标题 + 纸墨质感 + 账本/边注/大图井)与 Swiss International(Inter、极细分隔线、单一高饱和强调色、卡片矩阵/KPI 塔/条形图),一份产出只用一套。
Pick one mode per package. **The two systems are not bound to specific content types** — what changes is the visual stance, not which topic you can talk about.
不手写 HTML:从两个种子模板复制起步(Editorial 用 template-editorial-card.html、Swiss 用 template-swiss-card.html),只改 `<!-- POSTERS_HERE -->` 区域,避免类系统混用。
- Editorial Magazine × E-ink → copy `assets/template-editorial-card.html` into the task folder as `index.html`.
渲染与导出是本地工具链:用 Playwright 或浏览器截图工具逐个导出 `.poster` / `.cover` 节点,并用仓库自带校验器做自动检查。
Use Playwright or a browser screenshot tool to export each `.poster` or `.cover` node.
九条可机检的质量规则(溢出自适应、页脚碰撞、Swiss 字重、最小字号、4 横带密度、标题行数上限、figure 默认外边距漂移、视觉边界/底部空白、标题与正文间距),FAIL 时退出码 1。
Keep `node validate-social-deck.mjs <task-dir>` available for auto-check passes. It checks overflow (R1), footer collision (R2), Swiss bold display (R3), minimum font size (R4), 4-band density (R5), `.h-xl` line caps (R6), browser-default figure margin drift (R7), visual bounds / bottom whitespace (R8), and title-to-content gaps (R9). Exit code 1 on any FAIL — fix before final delivery when auto-check is requested.
图源获取是「先抓后披露」:明确不按猜测的许可预先过滤来源,从五个免版税图库按序取图(Unsplash / Pexels / Flickr CC 池 / Wallhaven / 直接搜索),抓完把出处摆给用户决定是否标注。
Policy: **grab first, disclose after, let the user decide on attribution.**
抓图动作点名为 WebFetch 或 curl 下载到任务目录 assets/,并给出中文关键词优先走 Pexels 的选源顺序。
- Use WebFetch or `curl` to download the image into the task folder's `assets/` directory.
Live Photo 分支把静态卡变成「视频井」:先抽首帧当静态图预检,再按平台时长渲染成对 MOV(小红书 5s、公众号 3s),最后用 makelive 打成一个 .pvt 包以便 AirDrop 到 iPhone 测试。
Render the paired MOV at the platform duration: `5s` for Xiaohongshu, `3s` for WeChat Official Account.
交付节奏反过来:默认先给用户看图,只有用户要求才跑校验器(每跑一次要几分钟)。
**Show user first, validate on request.**
任务产物必须落在任务目录(默认 local-tests/<slug>/),禁止在 skill 根目录生成 social-card-*/livephoto-*/wechat-* 之类的散落文件。
Generated work must live in a task folder, not in the skill root.
风格与规则被固化成 16 份 references(平台规格、风格系统、主题预设、版式配方、组件规格、背景系统、竖版填充、内容规划、生产流程、实况照片、图上文字、截图处理、地图组件、标题缩短、分类手册、QA 清单),按需加载。
## Required References Read these files as needed: - `references/platform-specs.md` for exact ratios, output sizes, and naming. - `references/style-system.md` for Guizang editorial and Swiss visual rules. - `references/theme-presets.md` when choosing electronic-magazine palettes or Swiss accent palettes. - `references/layout-recipes.md` when selecting carousel/social-card/WeChat page structures. - `references/components.md` for the shared component spec: font stacks, type scale, minimum readable sizes, Chinese title length bands, Swiss card-fill mutual-exclusion rule, image-container ratio classes, spacing tokens, and Lucide icon rules. - `references/background-systems.md` when building electronic-magazine WebGL/ink/paper backgrounds. - `references/portrait-fill.md` when adapting layouts to 3:4 and avoiding under-filled vertical space. - `references/content-planning.md` for cover hooks, page breakdown, and copy compression. - `references/production-workflow.md` for HTML/CSS rendering and image handling. - `references/live-photo-production.md` when the user asks for Live Photo / 实况照片 / 三连实况拼图, supplies video assets for a social card, or wants Xiaohongshu / WeChat motion-card delivery. It covers information budget, single vs triple Live Photo, long-video intake, and platform publishing reminders. - `references/image-overlay.md` whenever text sits on top of a photo: photo qualification, localized tint fallback, and face / subject avoidance via multimodal subject mapping. - `references/screenshot-treatment.md` when the user supplies an app / web / code / dashboard screenshot — picks `.frame-shot` over `.frame-img`, sets corners/shadow/bg/inset, decides on `.device-browser` or `.device-phone` chrome. - `references/map-component.md` when the content has spatial relationships (travel route, store locations, walking tour) — real routes default to Mapbox Static or OSM static tiles; schematic SVG is only for conceptual / illustrative maps. Pins are HTML overlays; never use live JS maps. - `references/title-shortener.md` when the task is a WeChat 21:9+1:1 cover pair, or any cross-platform reuse — derives the 1:1 short title from the long one (5-step extraction, 4 patterns, anti-patterns, sizing on `.poster.square`). - `references/category-cookbook.md` to route a user-named Rednote category (旅行 / 职场 / 游戏 / 影视 / 彩妆 / 美食 / 穿搭 / 家居 / 健身 / 情感 / 推荐) to applicable recipes and to confirm scope. - `references/qa-checklist.md` before delivering final images.
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| network | 免版税图库检索与下载(Unsplash) |
| network | 免版税图库检索与下载(Pexels,支持中文关键词) |
| network | Flickr CC 授权池检索 |
| network | Wallhaven 壁纸检索 |
| api | Mapbox Static Images API(用户自备 access token) |
| package | playwright(npm,校验器与渲染依赖) |
| package | makelive(PyPI,经 uvx 运行,打包 .pvt) |
| cli | ffmpeg / ffprobe(抽帧、拼接、contact sheet) |
| cli | curl / WebFetch(下载图库图片) |
4风险提醒 风险提醒:黄色 · 留意使用
- 执行期会出网抓图,素材与关键词可被图库观测 — SKILL.md 指示用 WebFetch/curl 从 Unsplash/Pexels/Flickr/Wallhaven 检索并下载图片到本地;检索词与下载行为对第三方可见,且下载素材的版权状态未经预筛(「grab first, disclose after」),商用前必须自行核实许可。
- AGPL-3.0 的传染性与商业限制 — 仓库代码为 AGPL-3.0:把它并入对外提供的网络服务可能触发源码开放义务;作者另设 COMMERCIAL_LICENSING.md 提供商业合作路径。产品化前需法务确认。
- 依赖远程包与本地媒体工具链 — 校验器需 npm 安装 playwright(会下载浏览器内核),Live Photo 打包需 uvx 拉取 makelive==0.7.0,抽帧需 ffmpeg/ffprobe;缺依赖时校验与打包环节直接失败(SKILL.md 要求不要把未过的校验当通过)。
- 模板自带第三方脚本引用 — template-swiss-card.html 从 unpkg 加载 lucide.min.js(@latest,无版本锁定),打开/渲染产物时会拉取并执行该脚本;离线或不可信网络环境下建议固化版本或本地化该依赖。
- 默认不跑校验器,质量取决于用户是否要求 — SKILL.md 明确「show user first, validate on request」,默认交付前不做自动检查(每次要几分钟);若用户不喊「你查吧」,版面问题可能带进成品。
- 生成式配图分支未受本档约束 — 当用户选「C. 用 AI 生成」时,文案会送进宿主图像后端;SKILL.md 未点名后端故不据此抬档,但实际出网与额度消耗由宿主决定,用户应知情。
5第二遍独立确认
- [ok] 图库端点属执行期抓取(判黄依据) — SKILL.md「Web-Sourced Images (fallback when user has none)」段列出五个来源与 URL,并给出执行命令「Use WebFetch or `curl` to download the image into the task folder's `assets/` directory.」——是 agent 主动抓取,非仅产物引用。
- [ok] 模板 CDN 属产物期引用(不判级) — template-swiss-card.html 引用 https://fonts.googleapis.com/... 与 https://unpkg.com/lucide@latest/dist/umd/lucide.min.js,template-editorial-card.html 引用 fonts.googleapis.com/fonts.gstatic.com——均发生在浏览器渲染产物时,按批4 口径只写 reason/risks。
- [ok] Mapbox token 的性质 — map-component.md 中 URL 形如 `...&access_token=YOUR_TOKEN`,为使用者自备占位;skill 不读环境变量、不读配置文件,故不算凭证读取。
- [ok] 脚本依赖与外部命令 — package.json dependencies 仅 playwright ^1.60.0,scripts 定义 test:docs 与 validate;make-video-contact-sheet.py 用 subprocess 调 ffprobe/ffmpeg;package-live-photo.py 导入 makelive(文档要求 uvx --from 'makelive==0.7.0');validate-social-deck.mjs `import { chromium } from "playwright"`。
- [ok] references 完整性 — SKILL.md 列出的 16 份 references(platform-specs / style-system / theme-presets / layout-recipes / components / background-systems / portrait-fill / content-planning / production-workflow / live-photo-production / image-overlay / screenshot-treatment / map-component / title-shortener / category-cookbook / qa-checklist)在仓库中全部存在,无死引用。
- [ok] 校验器规则与 SKILL.md 描述一致 — validate-social-deck.mjs 头注释的 R1-R9 与 SKILL.md「It checks overflow (R1)…title-to-content gaps (R9). Exit code 1 on any FAIL」逐条对应。
- [ok] 产物放置纪律 — SKILL.md「Generated work must live in a task folder, not in the skill root.」+ AGENT.md「不要把一次性的生成案例、渲染输出、临时素材、调试脚本或下载图片直接放在 Skill 根目录。」两处一致,且 .gitignore 忽略 local-tests/。
- [ok] 版权处理流程 — 「Policy: grab first, disclose after, let the user decide on attribution.」+ 抓后模板「⚠️ 版权未经核实。请你判断是否可用。」+ SOURCES.md 溯源要求;SKILL.md 明确「we do not pull from paid stock sites(视觉中国 / Getty / 站酷海洛等)」。
6结论
e86ce5a878f51bd8…cf4b810fac