social-carousel
3 square card carousel, connected headlines, brand mark + numbering
1How It Works & Mechanism
This template is purely data within a "folder-as-template" architecture: SKILL.md uses YAML frontmatter for selector indexing, and the body provides layout directives for the agent. The repository contains no custom code for individual templates; adding a template simply means adding a folder.
SKILL.md — frontmatter (id, scenario, tags, …) + prompt body
At runtime, the host sandwiches this template body between shared design directives and user content to compose a single prompt—the template's "intelligence" resides entirely within this natural language text, with no executable code.
return `${SHARED_DESIGN_DIRECTIVES} ${opts.body.trim()}
After loading the template, the host's /api/convert passes the assembled prompt to a locally authenticated coding-agent CLI and captures stdout as streamed HTML. The template itself performs no network requests, credential reads, or disk writes.
prompt = assemblePrompt({ body: skill.body, content, format });
The accompanying example.html serves as a "pre-rendered example" delivered directly by the preview API into iframes within selectors and galleries—it provides a visual preview for the template card without participating in content generation.
Returns the skill's `example.html` verbatim so it can be loaded into an
Frontmatter fields are mapped item-by-item into selector metadata (featured controls global sorting, recommended places items in the top "★ Recommended" group, and example_* generates example card copy), determining their placement across category/scenario filters.
if (typeof fm.featured === "number") meta.featured = fm.featured;
All generative capabilities of this template are fulfilled entirely by its own body: social-carousel/SKILL.md solely outlines layout, color palette, typography, and content discipline, containing no instructions for the agent to execute tools, fetch APIs, or read external data.
【模板: 三联社交轮播 / Social Carousel】
The template fixes the task into three 1080×1080 square cards, requiring a headline that connects continuously across the sequence.
【意图】3 张 1080×1080 方形卡片, headline 跨张串联。
Each of the three cards serves a distinct role: Card 1 handles the opening + brand mark + numbering; Card 2 provides the middle section + visual emphasis; Card 3 delivers the conclusion + CTA + loop icon.
- Card 1: display headline (开头) + 品牌 mark + 1/3
The headline connection is a hard constraint: concatenating the three headlines must form a complete sentence, dictating how the content is segmented.
- 三个 headline 拼起来是完整一句话
The color scheme requires "a unified color palette with progressive transitions between cards," ensuring the three cards read as a cohesive set when viewed together.
- 颜色统一一套调色板, 卡片之间渐进切换
The sample artifact validates this structure using three article.card elements (c1/c2/c3) alongside numbering 01/02/03.
<span class="badge">SERIES · 01 → 03</span>
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Google Fonts(仅出现在产物示例 example.html) |
| cli | 本地 coding-agent CLI(宿主提供,模板自身不调用) |
4Recommended Governance & Evidence
- 网络端点: Declared external network access: fonts.googleapis.com (via <link> in example.html, loaded by the browser during preview)
5Second-Pass Verification
- [ok] skill 目录的脚本 / 网络 / 凭证 / 写盘面 — 目录仅 SKILL.md / example.html 2 个文件,无 scripts/references/数据目录;token 扫描(curl / wget / fetch / exec / spawn / process.env / API_KEY / token / secret / write / save / delete)在该目录的 SKILL.md 中零命中;无自带可执行脚本。
- [ok] 运行时链路复核 — 重读 loader.ts / shared.ts / app/api/convert/route.ts / app/api/templates/[id]/preview/route.ts:模板正文只作为 prompt body 被 assemblePrompt 拼装,宿主 spawn 本地 CLI 并捕获 stdout;模板不参与任何执行。
- [ok] commit 与元数据 — 工作副本 git HEAD = 553ed98c283f9c0f489902d035416a972d6a9699(=任务表 pin 的 full 40 位);GitHub API nexu-io/html-anything:stars 8827、license spdx Apache-2.0、pushed_at 2026-09-15T03:36:24Z(与本地 HEAD 提交时间 2026-09-15 11:36:24 +0800 一致)。
- [discrepancy] README 与源码的 frontmatter schema 漂移(仓库级) — README 第 213 / 217 / 468 行称模板 frontmatter 必须含 mode · scenario · surface · preview · design_system;但在 next/src/lib/templates/skills/ 下 '^mode:'、'^surface:'、'^design_system:' 全部零命中,实际字段是 category / scenario / aspect_hint / featured / recommended + example_*(loader.ts 的 SkillFrontmatter)。文档滞后于代码,不影响本模板运行,但照 README 新写模板会踩空。
- [ok] frontmatter 元数据映射 — loader.ts fmToMeta 逐字段映射 zhName / enName / emoji / description / category / scenario / aspectHint / tags + featured / recommended + example 卡;本模板取自 SKILL.md 的实际取值与之相符。
- [ok] example.html 与 SKILL.md 的一致性 — 正文的三张卡 + 编号 + 调色板渐进都能在示例找到对应:三处 <article class="card cN">、.index 01/02/03、badge「SERIES · 01 → 03」;编号写法由「1/3」变为「01 · …」,属同义实现。
- [ok] 端点扫描(目录内) — social-carousel 目录仅 1 个外部端点:fonts.googleapis.com(example.html 第 9 行);<script> 零命中,动画/布局纯 CSS。
- [ok] 「1080×1080」是否真的落到画布 — 示例在 .card 上用 aspect-ratio: 1 / 1 固定成正方形(配合 max-width),并非只写在标题里。
6Verdict & Scenarios
285eb81de0f98ec8…