sprite-animation
Pixel art + kinetic typography explainer frame with pure CSS loops, ready for video recording
1How It Works & Mechanism
This template is purely data within a 'folder-as-a-template' architecture: SKILL.md uses YAML frontmatter for selectors, and its body serves as layout instructions for the agent; the repository contains no template-specific code—adding a template means adding a folder.
SKILL.md — frontmatter (id, scenario, tags, …) + prompt body
At runtime, the host stitches this template body between shared design directives and user content to assemble a single prompt—the template's 'intelligence' resides entirely in this natural language, with zero executable code.
return `${SHARED_DESIGN_DIRECTIVES} ${opts.body.trim()}
After loading the template, the host's /api/convert sends these prompts to a locally logged-in coding-agent CLI, streaming only stdout back as HTML; the template itself performs no network requests, credential access, or file writes.
prompt = assemblePrompt({ body: skill.body, content, format });
The bundled example.html is a 'pre-rendered example' output directly by the preview endpoint into the iframe of selectors and galleries—it determines whether a template card displays a visual preview and does not participate in content generation.
Returns the skill's `example.html` verbatim so it can be loaded into an
Frontmatter fields are mapped one-to-one into selector metadata (featured determines overall sorting, recommended places it in the top '★ Recommended' section, and example_* generates sample card copy), controlling where it appears in category/scenario filters.
if (typeof fm.featured === "number") meta.featured = fm.featured;
The generation capability of this template is executed entirely through its own body: sprite-animation/SKILL.md defines layout, color palette, typography, and content discipline, without any instruction commanding the agent to run tools, fetch endpoints, or read external data.
【模板: 像素 / 8-bit 动画解说】
The goal is a 'single-frame poster' for educational animations, explicitly utilizing pure CSS keyframes loops without JS.
【意图】教育型动画的单帧海报, 纯 CSS keyframes 循环, 不用 JS。
The visual composition is strictly listed: full-bleed cream stage, oversized year/number text, central pixel mascot, kinetic Chinese/Japanese display typography, and a bottom timeline ribbon.
【意图】教育型动画的单帧海报, 纯 CSS keyframes 循环, 不用 JS。 【布局】 - Full-bleed cream stage
The absence of JS is a hard constraint; animations must rely strictly on @keyframes—enabling the output to be opened offline via double-click or recorded directly as screen capture.
- 动画用 @keyframes, 不依赖 JS
The color palette is restricted to a retro three-color scheme (red, beige, dark green) to ensure consistent '8-bit retro' aesthetics.
- 复古调色板: 红 / 米 / 墨绿
The sample output uses the --pixel variable to specify the Press Start 2P pixel font and applies 5 @keyframes definitions for looping animations.
--pixel: 'Press Start 2P', monospace;
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 (<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] 「不依赖 JS」自证 — example.html 内 <script> 零命中;动效由 5 处 @keyframes(blink/glitch/bob/kana-in 等)与 .ribbon 轨道动画实现,与正文 "- 动画用 @keyframes, 不依赖 JS" 一致。
- [ok] 端点扫描(目录内) — 仅 1 个网络端点:fonts.googleapis.com(example.html 第 9 行);另出现 http://www.w3.org/2000/svg 仅为 SVG 命名空间字符串,不是可请求端点。
- [ok] example.html 与 SKILL.md 的一致性 — 正文五条布局要素均可在示例定位:cream 舞台(--paper 变量)、大字(DM Serif Display 标题)、像素 mascot(内联 SVG 花札 sprite + Press Start 2P)、kinetic 字(kana-in 动画)、ribbon 走马灯。
6Verdict & Scenarios
64e3233e393eadf6…