mockup-device-3d
iPhone + MacBook pseudo-GLTF static display stand, embedded with real HTML screen content, glass lens refraction, 360° turntable composition
1How It Works & Mechanism
This skill is not an executable program, but a plain-text prompt template: the host parses the YAML frontmatter of SKILL.md via regex and loads the body as the core prompt.
const { fm, body } = parseFrontmatter(raw);
The template body is not executed in isolation; instead, it is concatenated into the "template section" of the final prompt: shared design directives + this template's body + user content.
prompt = assemblePrompt({ body: skill.body, content, format });
The global "content-driven quantity" rule overrides any numerical value in the template: the template only defines layout/style/palette/component library, not the output length.
数量**完全由【用户内容】的实际长度和信息结构决定**
The output format is subject to hard global constraints: single-file HTML, pure HTML without markdown code fences, the first character must be '<', and no file writing is permitted (stdout is captured by the frontend).
不要用 markdown 代码围栏包裹, 不要任何解释性文字
Metadata in the frontmatter drives selector presentation (Chinese name/English name/emoji/description/category/scenario/aspect ratio/tags/example metadata).
zhName: fm.zh_name ?? fm.name ?? id,
Bundled example assets are exposed to the frontend via two read-only APIs: example.html is returned as-is into an iframe, and example.md serves as the input content for the "Preview" button.
verbatim so it can be loaded into an
Execution chain (host behavior, not this template's code): The host spawns a locally logged-in agent CLI, pipes the assembled prompt via stdin, and streams back the HTML from stdout.
child.stdin.write(opts.prompt);
This is the most strictly specified template among the 9: executable parameters are provided for canvas, device placement, material color, reflections, flares, and animations, leaving almost no room for freeform model deviation.
- **画布**: 1920×1080, 暖灰渐变背景
Two screen content sources are routed conditionally in the template: text triggers 'auto-rendering a mock app interface', while HTML triggers 'embedding as-is', explicitly avoiding iframe/srcdoc in favor of div+Tailwind to prevent nested document issues.
用户提供的是 HTML → 原样嵌入屏幕 div 内
Animations are explicitly designed to be toggleable: @keyframes turntable performs an 8s back-and-forth swing between rotateY -12 ↔ 12, with support for disabling via prefers-reduced-motion.
@keyframes turntable
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Tailwind Play CDN(共享指令对产物的要求) |
| network | jsdelivr CDN(可选:图表/动画脚本) |
| network | Google Fonts(共享指令指定) |
| cli | 本机 coding-agent CLI(宿主检测 PATH 并 spawn) |
| network | 随包示例 example.html 的外链(产物示例) |
| network | 示例出处标注(frontmatter,非运行时请求) |
4Recommended Governance & Evidence
- 网络端点: Declared external network access: No network request code inside the directory; bundled example.html references https://cdn.tailwindcss.com in <head> (example artifact external link,
5Second-Pass Verification
- [ok] skill 目录资产面(脚本 / references / 数据 / 模板) — 目录实为 3 个文件:SKILL.md 与 example.html、example.md;无 scripts/、无 references 目录、无任何可执行文件(.sh/.py/.js/.mjs/.ts 零命中)。
- [ok] 「无脚本、无网络、无凭证、无写盘」的反例搜索 — 对目录递归 token 扫描(api[_-]?key|token|secret|\.env|process\.env|child_process|fetch\(|curl |wget |npm |npx |exec\(|subprocess|writeFile|fs\.):零命中;SKILL.md 另按 http|CDN|cdn|font|API|api|fetch|Google|script 扫描,仅命中 font-semibold / font-black 这类字重类名,无端点。
- [ok] 官方描述 vs 实际能力(有无夸大) — frontmatter description(iPhone + MacBook 仿 GLTF 静态展架, 屏幕内嵌真实 HTML 内容, 玻璃镜头折射, 360° 转盘构图)与正文一致:描述承诺的版式要素都能在正文找到对应条目,未见正文未支持的越界承诺。
- [ok] 外部资源/工具条目逐条回源 — external_deps 中的仓库级条目(Tailwind Play CDN / jsdelivr / Google Fonts / 本机 agent CLI)逐条回到 shared.ts 与 argv.ts 原文取证;本模板另有 example.html 的 cdn.tailwindcss.com 外链,已在该 example.html 原文中定位。
- [ok] 宿主执行链(供 security.reason / verdict.risks 使用,不参与判级) — prompt 经 stdin 送入被 spawn 的本机 CLI(invoke.ts),HTML 从 stdout 分流捕获;claude 参数含 --permission-mode bypassPermissions、envFor 透传 process.env;预览 iframe sandbox="allow-scripts allow-same-origin"(template-picker.tsx:544 / preview-pane.tsx:297)。
- [ok] 路径与 commit 一致性 — 工作副本 /var/ytdown/skills-portal/spy-repos/html-anything 的 git HEAD = 553ed98c283f9c0f489902d035416a972d6a9699(与任务表 pin 一致);skill.path=next/src/lib/templates/skills/mockup-device-3d 下确有 SKILL.md,全仓无第二份同名模板。
- [ok] "屏幕内嵌用户 HTML"是否等于外部内容注入 — SKILL.md 说的"原样嵌入屏幕 div 内"是把用户提供的 HTML 渲染进产物里的 <div class="screen">(同页同上下文),不是把远端页面抓进 skill;目录内无抓取代码。风险仍在产物侧(嵌入脚本与会话同域执行),已写入 verdict.risks。
- [ok] example_source_url 会不会被运行时请求 — loader.ts 仅把它当字符串放进 meta.example.source(fm.example_source_url ? {...} 分支),preview / example 两个路由只做 loadSkill + 返回 JSON 或 HTML;全仓未见对该 URL 的 fetch。
6Verdict & Scenarios
26cd54243c71eab9…