Home / All Skills / Design & Motion / social-spotify-card
Design & Motion · nexu-io/html-anything

social-spotify-card

Spotify Now Playing style card: album art + progress bar + playback controls, adapted for video overlays and personal homepages.

L3 Networked · Declare domain & key scopeV1 Commit-PinnedNetwork AccessDual-pass Audit
Author nexu-ioGitHub nexu-io/html-anything ↗Stars 8827License Apache-2.0(仓库根 LICENSE = Apache License 2.0;GitHub API spdx_id=Apache-2.0)Commit 553ed98c28
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

This template is purely data within a "folder-as-template" architecture: SKILL.md uses YAML frontmatter for the picker, while the body text provides layout directives for the agent; the repository contains no specific code for individual templates, meaning adding a new template is simply adding a new folder.

next/src/lib/templates/loader.ts
SKILL.md — frontmatter (id, scenario, tags, …) + prompt body
loader.ts specifies directory conventions in its file header comments; frontmatter is parsed in-process via regex (no YAML dependencies), and the body text is extracted verbatim as the prompt body without being passed to the frontend ("Body is excluded so we can return the entire registry in one cheap fetch without shipping prompt text to the browser.").

At runtime, the host sandwiches the template body between shared design directives and user content to construct a single prompt—the template's "intelligence" resides entirely within this natural language text, with no executable code.

next/src/lib/templates/shared.ts
return `${SHARED_DESIGN_DIRECTIVES} ${opts.body.trim()}
The output of assemblePrompt is "shared design directives + template body + [Input Format] + [User Content]". The shared section (SHARED_DESIGN_DIRECTIVES in the same file) enforces hard constraints such as single-file HTML, Tailwind/font CDNs, content-driven quantity, and prohibiting filesystem tools; it is uniform across all templates and not intrinsic to this template.

After loading this template, the host's /api/convert passes the text to a locally authenticated coding-agent CLI, streaming stdout back as HTML; the template itself performs no network requests, credential reading, or file writes.

next/src/app/api/convert/route.ts
prompt = assemblePrompt({ body: skill.body, content, format });
The same route then invokes invokeAgent({ … }) to spawn a CLI (claude / codex / cursor-agent, etc., detected via host PATH); its accompanying shared directives explicitly state: "**Do NOT use Write / Edit / MultiEdit / Bash / Create / any filesystem tools**".

The bundled example.html is a "pre-rendered example" served as-is by the preview endpoint into the picker and gallery iframe—it determines whether the template card has a visual preview and does not participate in content generation.

next/src/app/api/templates/[id]/preview/route.ts
Returns the skill's `example.html` verbatim so it can be loaded into an
Previews are cached by skill id (Cache-Control: public, max-age=300); the frontend sets sandbox="allow-scripts allow-same-origin" on the iframe in the preview panel (a host-side implementation outside this template's control).

Frontmatter fields are mapped one-to-one into picker metadata (featured determines overall ranking, recommended routes to the top "★ Recommended" group, example_* generates sample card copy) and determine its placement in category/scenario filters.

next/src/lib/templates/loader.ts
if (typeof fm.featured === "number") meta.featured = fm.featured;
fmToMeta directly maps category/scenario/aspectHint/tags to SkillMeta; the example block is generated when example_id or example.{md,html} exists (id/name/format/tagline/desc + optional source). These fields only affect display and sorting, not generation behavior.

The generation capability of this template is delivered entirely by its own body text: social-spotify-card/SKILL.md describes only layout, color scheme, typography, and content guidelines, without instructing the agent to run tools, call endpoints, or read external data.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
【模板: Spotify Now-Playing 卡】
The skill directory contains 2–3 files in total (SKILL.md + example.html [+ example.md]), with no scripts, references, or data files; example.html is merely a manually authored artifact for the template (see internal_assets).

The intent is to render a song, a podcast excerpt, or a personal bio as a Spotify Now Playing card, noting inspiration from hyperframes' spotify-card.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
【意图】把一首歌、一段播客、或一段个人介绍渲染成 Spotify 正在播放卡, 适合 video overlay / 个人 about page / 创作者 hero。Inspired by hyperframes spotify-card。

The body text provides two canvas options: a 1280×720 horizontal video overlay slot and a 600×200 compact horizontal banner widget.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
- 紧凑横条 widget: 600×200, 可嵌入到任何 hero。

The card layout consists of a header label, track title, artist, progress bar, timestamps, and a playback control row; the progress bar requires timestamps at both ends.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
- 进度条: 4px 高, 圆角, 灰色背景 + 白色 fill (`width: 38%`); 两端时间戳 `1:24 / 3:42` (mono, 11px, 灰)。

Works with non-music input as well: treats "Title" as track name, "Subtitle/Author" as artist, defaulting duration to 3:42.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
- 若用户输入是文本/标题 → 把 "标题" 当歌名, "副标/作者" 当艺人, 估算"时长" 3:42 默认。

Demands restrained, toggleable motion effects: sound waves use @keyframes and can be disabled via prefers-reduced-motion.

next/src/lib/templates/skills/social-spotify-card/SKILL.md
- 微动效: 音波动效用 `@keyframes`, 可被 `prefers-reduced-motion` 关闭。

The example artifact reproduces sound waves using three bars + animation: wave, with timestamps 1:24 / 3:42 consistent with the body text.

next/src/lib/templates/skills/social-spotify-card/example.html
.wave i { display:inline-block; width:3px; margin-right:2px; background:#1DB954; transform-origin:bottom; animation: wave 1s ease-in-out infinite; }

2Core Capabilities

01Dual-canvas adaptation (1280×720 video overlay / 600×200 compact horizontal banner)
02Now Playing card structure (header label + track title + artist + progress bar + timestamps)
03Playback control row (⏮ ⏯ ⏭ inline SVG + shuffle/repeat)
04Album art rendered via CSS gradients + monogram/geometry, external images forbidden
05Arbitrary text to music semantic mapping (Title → track, Subtitle → artist, default duration 3:42)
06Accessible sound wave micro-animations (@keyframes + prefers-reduced-motion)
07Example artifact: Lo-Fi card + 1:24/3:42 progress + green sound wave

3External Dependencies

KindDependency / Endpoint
networkTailwind CDN(仅出现在产物示例 example.html,运行时不要求)
networkGoogle Fonts(仅出现在产物示例 example.html)
network灵感出处标注(frontmatter example_source_url,非运行时调用)
cli本地 coding-agent CLI(宿主提供,模板自身不调用)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Declare allowed domains and key scope
For Administrators
Least privilege keys, retain request logs
Evidence & Triggers (File Paths & Excerpts)
  • 网络端点: Declared external network access: cdn.tailwindcss.com (example.html <script src>, requested by the browser during picker preview/local inspection)
Audit Notes: . Evaluation target = this skill directory (SKILL.md + example.html [+ example.md]): no bundled scripts, no credential access, no file-write instructions, and no runtime requests to external endpoints required—the body text specifies only layout, palette, font family names, and content guidelines, where font family names do not constitute requests. All external links appearing in the directory are purely "sample artifact" assets, listed explicitly for auditing: cdn.tailwindcss.com (example.html line 6 <script src>), fonts.googleapis.com (example.html line 8 <link>, Inter + Noto Sans SC), and hyperframes.heygen.com (frontmatter provenance attribution). Under Batch 4 criteria (endpoints appearing only in sample artifacts/attribution annotations → green), this does not impact the tier. Host-side behaviors (loader.ts disk reads, assemblePrompt prompt composition, agents/invoke.ts launching local CLI, preview iframe sandbox="allow-scripts allow-same-origin") are documented in verdict.risks and do not serve as grounds for tier classification.

5Second-Pass Verification

  • [ok] skill 目录的脚本 / 网络 / 凭证 / 写盘面 — 目录仅 SKILL.md / example.html / example.md 3 个文件,无 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 的一致性 — 固定色 #1DB954、时间戳 1:24 / 3:42、音波动效(animation: wave)均在示例实现;专辑封面为 CSS 绘制,无外链图片,符合正文「不能外链图片」。
  • [ok] 端点扫描(目录内) — 3 处:cdn.tailwindcss.com、fonts.googleapis.com(均在 example.html)+ frontmatter 的 hyperframes.heygen.com 出处标注;SKILL.md 正文无 URL。
  • [discrepancy] 「prefers-reduced-motion 可关闭」核对 — 正文要求 "- 微动效: 音波动效用 `@keyframes`, 可被 `prefers-reduced-motion` 关闭",但 example.html 中只有 animation: wave 的定义,未找到 @media (prefers-reduced-motion: reduce) 规则——无障碍承诺在示例里没兑现(规格要求,示例未实现)。

6Verdict & Scenarios

  • Dual canvases (video overlay slot + 600×200 banner) allow the same visual style to serve both video editing and homepage embedding
  • Semantic mapping lowers the input threshold: any arbitrary text can be rendered as Now Playing
  • Brand visuals strictly defined down to hex color values (#121212 / #1DB954 / #b3b3b3)
  • The only template that explicitly accommodates motion accessibility preferences (@keyframes + prefers-reduced-motion)
  • External covers forbidden, using self-contained CSS gradients/monograms
  • Best for: Ideal for video overlays (podcasts, playlists, live-stream lower thirds) and "Now Playing" decorative slots in personal homepages or creator heroes; also suitable for fun scenarios like formatting a personal bio as a Now Playing card.
    Not for: Not suitable for real-time playback state tracking (does not integrate with Spotify API, reads no live data; progress bar is hardcoded), authentic brand assets (brand reproduction), or information-dense profiles—the card only accommodates track title, artist, and a single progress row.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload social-spotify-card.tar.gz
    sha256: 80174180f4c38b73…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 553ed98c28.