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

social-reddit-card

Realistic Reddit post card with up/down voting and comment count, suitable for video overlays and story sharing

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-a-template" structure: SKILL.md uses YAML frontmatter for selectors, and the body contains layout instructions for the agent; the repository writes no code for individual templates, where adding a new template equals 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 via in-process regular expressions (no YAML dependencies), and the body is extracted verbatim as the prompt body and not sent 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 this template body between shared design directives and user content to assemble a prompt—the template's "intelligence" resides entirely within this natural language, without any executable code.

next/src/lib/templates/shared.ts
return `${SHARED_DESIGN_DIRECTIVES} ${opts.body.trim()}
assemblePrompt returns "shared design directives + template body + [input format] + [user content]". The shared section (SHARED_DESIGN_DIRECTIVES in the same file) enforces hard requirements such as single-file HTML, Tailwind/font CDNs, content-driven quantity, and a ban on filesystem tools; these are consistent 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 and retrieves stdout as an HTML stream; the template itself initiates no network requests, reads no credentials, and writes no files.

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

The accompanying example.html is a "pre-rendered example" served as-is by the preview endpoint into the selector and gallery iframes—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, not controlled by this template).

Fields in the frontmatter are mapped one-by-one into selector metadata (featured determines overall sorting, recommended places it in the top "★ Recommended" group, example_* generates example card copy) and decide where it appears 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.

All generation capabilities of this template are fulfilled by its own body: social-reddit-card/SKILL.md describes only layout, color palettes, fonts, and content discipline, without a single instruction telling the agent to run tools, call APIs, or read external data.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
【模板: Reddit 帖子卡】
The skill directory contains a total of 2–3 files (SKILL.md + example.html [+ example.md]), with no scripts, references, or data files; example.html is merely a manual example artifact of the template (see internal_assets).

The intent is to render a story, question, or joke into a Reddit post card for video overlays or social media sharing, noted as inspired by hyperframes' reddit-post.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
【意图】把一段故事 / 提问 / 段子, 渲染成 Reddit 帖子卡片, 用于视频叠加、社媒故事分享。Inspired by hyperframes reddit-post。

The card structure is anchored by the left vote rail (40-56px wide), which is the core of Reddit's visual identity.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
- 左侧 **vote rail** (40-56px 宽):

Vote count colors are specified as a three-tier gradient: positive orange, negative blue, and neutral gray, requiring large numbers to be formatted as 12.3k.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
- 票数 (Inter, 17px, weight 700, 居中, 颜色: 0 灰 / 正橙 / 负蓝); 大数字用 `12.3k` 格式。

Content discipline: User-provided content must be used; only reasonable subreddit names, usernames, and vote counts may be generated automatically.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
- 必须用用户提供的内容; 自动生成合理的 subreddit / username / 票数。

Asset constraints: External image links are strictly prohibited; image placeholders must use CSS gradients with descriptions.

next/src/lib/templates/skills/social-reddit-card/SKILL.md
- 严禁外链图片; 图片占位用 CSS 渐变 + 描述。

The example artifact demonstrates dark mode + 12.3k upvotes + 1.2k comments + r/programming color scheme.

next/src/lib/templates/skills/social-reddit-card/example.html
<span class="font-bold text-[15px]" style="color:#ff4500">12.3k</span>

2Core Capabilities

01Voting rail (▲ / score / ▼ with positive orange, negative blue, and neutral gray colors)
02Post body (subreddit icon badge + r/subreddit + author/timestamp + title + body/quote/image placeholder)
03Bottom action row (comment count / Awards / Share / ⋯)
04Dual light/dark mode color schemes (dark mode recommended for video overlays)
05Fully inline SVG icons (Snoo logo, up/down arrows, comment bubble, trophy); no external image links
06Example output: r/programming dark mode card + 12.3k upvotes / 1.2k comments

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 (<script src> in example.html, requested by the browser during selector preview or local viewing)
Audit Notes: Target evaluated: this skill directory (SKILL.md + example.html [+ example.md]): no bundled scripts, no credential access, no disk write instructions, and no external runtime endpoints required—the body text specifies only layout, palette, font family names, and content discipline, where font names do not trigger requests. All external links present in the directory are purely illustrative artifact examples, itemized for verification: cdn.tailwindcss.com (example.html line 6 <script src>), fonts.googleapis.com (example.html line 7 <link>, IBM Plex Sans + Noto Sans SC), hyperframes.heygen.com (only in frontmatter as example_source_url attribution). Under Batch 4 criteria (endpoints appearing only in artifact examples or attribution links → green), the rating tier is unaffected. Host-side behaviors (loader.ts disk reads, assemblePrompt prompt assembly, agents/invoke.ts invoking the local CLI, preview iframe sandbox="allow-scripts allow-same-origin") are documented in verdict.risks and do not affect the rating tier.

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 的一致性 — vote rail 三色、r/subreddit 元数据行、评论数 action row 均在示例实现(#ff4500 票数 12.3k / r/programming / 1.2k Comments);配色与正文 dark 模式给定值一致。
  • [ok] 「严禁外链图片」自证 — example.html 除 Tailwind 与 Google Fonts 两个资源端点外没有任何图片 URL;票数、图标全为文本 + 内联 SVG,符合正文禁止条款。
  • [ok] 端点扫描(目录内) — 3 处:cdn.tailwindcss.com 与 fonts.googleapis.com 在 example.html,hyperframes.heygen.com 仅在 frontmatter 出处标注;SKILL.md 正文与 example.md 无其它 URL。

6Verdict & Scenarios

  • High fidelity enforced via concrete color values, font sizes, and font weights rather than vague adjectives
  • Complete voting semantics (dual arrows + score + three-tier color scale), a unique component among similar "social media card" templates
  • Strict content discipline: Must use user-provided content; only subreddit names, usernames, and vote counts may be generated
  • Self-contained output: External image links are strictly prohibited, icons are fully inline SVG, and image slots use CSS gradients
  • Includes example.md demonstrating minimal input format to lower the barrier to entry
  • Best for: Ideal for turning a story, question, or joke into a realistic Reddit card for video overlays or social media sharing; also suitable for narrative content requiring a visual "voting" motif (including Chinese adaptation scenarios).
    Not for: Not suitable for scenarios requiring live Reddit data integration (the template does not scrape or connect to Reddit; the README recommends delegating scraping to external tools while this template handles rendering only), official brand marketing assets (realistic social media cards carry trademark and misleading risks), or multi-image, long-form articles (designed strictly as a single-card format).
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload social-reddit-card.tar.gz
    sha256: 13bf26ccd190a3b6…
    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.