Home / All Skills / Design & Motion / frame-data-chart-nyt
Design & Motion · nexu-io/html-anything

frame-data-chart-nyt

NYT-newsroom typography + staggered reveal animation + editorial-grade charts (line/bar/range band)

L1 Basic · Source registration onlyV1 Commit-PinnedDual-pass Audit
Author nexu-ioGitHub nexu-io/html-anything ↗Stars 8827License Apache-2.0(仓库根 LICENSE;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 skill is not an executable program, but a prompt injected into the local coding-agent CLI: the host takes the body of SKILL.md, prepends site-wide shared design instructions, appends user content, concatenates them into a single prompt for the logged-in agent, and retrieves the agent's stdout as HTML.

next/src/lib/templates/shared.ts
【输入格式】: ${opts.format} 【用户内容】: ${opts.content}
Assembly template = shared instructions → skill body → input format → user content; the web endpoint /api/convert follows the same function: prompt = assemblePrompt({ body: skill.body, content, format });

The shared instruction layer (which does not belong to any single skill but sits atop every template) enforces the output as a 'self-contained single-file HTML', explicitly prohibiting the agent from using filesystem tools like Write/Edit/Bash, and streams HTML directly into the conversation body.

next/src/lib/templates/shared.ts
- **禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。不要把 HTML 写到任何 \`.html\` 文件里。前端直接捕获你的 stdout 文本, 文件落盘由前端负责。
This is the source of the capability boundary for this batch of skills: deliverables are purely text, while saving to disk and rendering are handled by the host frontend; this prohibition is a soft prompt constraint, not hard sandbox isolation.

Beyond SKILL.md, there is a 'content-driven quantity' override rule: any page, frame, or card counts specified in the template are treated as reference minimums, with the actual quantity determined by user content—preventing the agent from compressing user content to match template numbers.

next/src/lib/templates/shared.ts
- 模板只定义"可用版面 / 风格 / 配色 / 字体 / 组件库", **不定义** slide / 帧 / 卡片 / section 的数量。
Crucial for frame-* single-frame templates: it characterizes the layout descriptions in the template as a 'reusable layout pool' rather than a production ceiling.

The loading convention is 'one skill = one folder': SKILL.md (YAML frontmatter for the selector + body as template prompt), optional example.md (sample input), and example.html (preview sample ready to open directly); adding a new template only requires adding a directory without modifying TS code.

next/src/lib/templates/loader.ts
* SKILL.md — frontmatter (id, scenario, tags, …) + prompt body * example.md — (optional) sample input content * example.html — (optional) pre-rendered preview, shown inline in the picker
The loader's loadSkillFromDir reads only these three file types, with no other asset loading channels—used during the second review pass to verify asset reachability.

The selection pipeline (CLI side) is a three-stage funnel: strong keyword signals (2 points per matched word, threshold of 3) → fallback to tags/scenario scoring → if still uncertain, sending the first 800 characters of user content to the local agent for a one-sentence classification.

cli/src/skills-matcher.ts
const CONFIDENCE_THRESHOLD = 3;
The exact prompt text for the AI fallback: const prompt = `Please describe in one sentence (no more than 15 words) what type of document the following content looks most like; answer with only the type name:`

The preview pipeline is decoupled from generation: /api/templates/<id>/preview returns example.html verbatim as text/html to the iframe; the frontend iframe uses sandbox="allow-scripts allow-same-origin".

next/src/components/preview-pane.tsx
sandbox="allow-scripts allow-same-origin"
Route comment: * Returns the skill's `example.html` verbatim so it can be loaded into an (Host-side trade-off: under the allow-scripts + allow-same-origin combination, scripts in the preview page can escape the sandbox themselves).

The template deconstructs 'a piece of data → one frame of a New York Times column-style chart' into a fixed layout: a top kicker (data source + category), a conclusion headline synthesized from the data, a chart area occupying 55-65% of the canvas, and a bottom source + footnote, delivered in a 16:9 single frame.

next/src/lib/templates/skills/frame-data-chart-nyt/SKILL.md
【画布】1920×1080, 暖白底 `#f7f5ee` 或墨黑底 `#0e0e0e` 二选一; 文字色和背景相反。 【布局】 - **顶部 kicker** (11px uppercase letterspace 0.14em, 颜色 = accent 红 `#a91d1d` 或 mint `#5fb38a`): 数据来源 + 类目, 如 "GLOBAL · WEEKLY ACTIVE USERS · 2018–2026"。 - **大字标题** (Cheltenham / Playfair / Source Serif Pro, 5.6vw, italic 副标可选): 一句结论。**结论必须从用户数据中提炼**, 不是描述图。 - **图表区** (占画布 55-65%): - 折线: 1-2 条线, 主线 ink 实心 2.5px, 次线 dashed 1.5px; 数据点用 6px 实心圆; 关键点旁标注 `2024 · 412M` 黑色 mono 小字。 - 柱状: 全部 ink 单色或加 1 道 accent 高亮柱; 柱顶大数字; 柱底类目斜体 (Cheltenham italic)。 - 范围带 (range band): 浅灰填充 `#e6e2d2` 包络 + 中线 ink。 - **底部 source + footnote** (10px mono, opacity 0.6): "Source: 用户数据 · Chart by html-anything"。
The four-part structure of kicker / conclusion headline / chart area / source row establishes a fixed reading path for journalistic charts.

The chart implementation route is restricted to hand-crafted SVG: explicitly forbidding chart.js / d3 (unless imported via jsdelivr CDN), and imposing a line count upper limit to avoid generating a heavyweight charting project.

next/src/lib/templates/skills/frame-data-chart-nyt/SKILL.md
- **绝不**: 使用 chart.js / d3 库 (除非 jsdelivr CDN 引入); 推荐手写 SVG, 不超过 80 行 inline。
A very strict boundary: defaults to hand-crafted SVG, with chart libraries allowed only as an exception.

Provides distinct specifications for three chart types: line (1-2 lines, primary line ink 2.5px solid, secondary line 1.5px dashed, 6px solid circular data points); bar (single color or 1 accent highlight + large numbers on bar tops + italicized categories); range band (light gray envelope + median line).

next/src/lib/templates/skills/frame-data-chart-nyt/SKILL.md
- 折线: 1-2 条线, 主线 ink 实心 2.5px, 次线 dashed 1.5px; 数据点用 6px 实心圆; 关键点旁标注 `2024 · 412M` 黑色 mono 小字。
Provides line width, point diameter, and tick specs for each chart type, ensuring consistent visual delivery.

The animation discipline follows staggered reveals: headline 0s, kicker 200ms, line stroke-dashoffset 1.2s ease-out (starting at 400ms), data labels appearing sequentially every 100ms, and respects prefers-reduced-motion to disable.

next/src/lib/templates/skills/frame-data-chart-nyt/SKILL.md
description: "NYT-newsroom 排版 + 错峰揭示动画 + 编辑级图表 (折线/柱/范围带)"
Locks down animation sequence and duration to prevent animation from overwhelming the content.

Data authenticity has fallback rules: must use user data; if the input is purely textual conclusions, coordinates may be estimated but must be labeled as schematic; CSV/JSON is rendered directly.

next/src/lib/templates/skills/frame-data-chart-nyt/SKILL.md
- 必须用用户提供的数据。如果输入是文本结论, 自动估算合理坐标 (但要标注 "schematic"); 如果是 CSV/JSON, 直接绘制。
The schematic label is a data ethics clause: estimated coordinates must be transparently declared.

2Core Capabilities

0116:9 single-frame canvas (1920×1080, choice of warm white #f7f5ee / ink black #0e0e0e)
02Editorial-grade chart specifications: line / bar / range band choices
03Conclusion headline must be synthesized from data (not a descriptive chart title)
04Staggered reveal animation + prefers-reduced-motion fallback
05Fixed notation format for data callouts
06Single primary + single accent color palette (choice of NYT red / editorial mint / warm amber)
07Forbidden list: full-screen grid lines, drop shadows, 3D bars, emojis
08Selector keywords: chart / NYT / 数据图 / 新闻图表 / infographic

3External Dependencies

KindDependency / Endpoint
networkGoogle Fonts(Source Serif Pro / IBM Plex Sans / IBM Plex Mono / Noto Sans SC,示例页实际引用)
networkTailwind Play CDN(共享指令强制;示例页亦引用)
networkjsdelivr CDN(仅出现在『禁止图表库』的例外条款,条件性、非默认路径)
networkhyperframes 目录页(frontmatter 出处标注,非运行时请求)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Can be auto-loaded
For Administrators
Register source and version
Evidence & Triggers (File Paths & Excerpts)
  • SKILL.md: Pure prompt instructions and rule text, without script execution or external side effects
Audit Notes: . The audit target is the skill directory itself (standard: what actually happens upon executing SKILL.md): SKILL.md consists purely of instructional text, accompanied by example.md/example.html as samples and previews; there are no scripts, runtime network requests, credential access, or agent-side file writes inside the directory; SKILL.md does not target any external generation or service backend (contrasting with the orange precedent ai-image-generation / seedance, which sends materials to external generation backends consuming account quotas; this template generates no external data transmission). Non-grading explanatory items: example.html inside the directory links externally to cdn.tailwindcss.com and fonts.googleapis.com (Batch 4 standard: external links in example.html are product samples and not graded); the shared instruction layer similarly mandates that generated output imports Tailwind and Google Fonts in the head via CDN (- Include Tailwind v3 Play (https://cdn.tailwindcss.com) and required Google Fonts in `<head>` via CDN.), which represents host wrapper behavior. Host context (not factored into tier rating, see verdict.risks): preview iframe uses sandbox="allow-scripts allow-same-origin"; host launches agent in full-privilege mode ("bypassPermissions", / "--yolo",). Note: jsdelivr in SKILL.md:37 appears only in the exception clause 'never use chart.js / d3 (unless imported via jsdelivr CDN)', representing conditional permission rather than an explicit requirement, thus avoiding a 🟡 elevation; hyperframes.heygen.com serves as frontmatter provenance attribution (not a runtime request).

5Second-Pass Verification

  • [ok] 图型与动画规格 — 重读 SKILL.md 折线/柱状/范围带与『错峰揭示动画』两段,引用逐字一致。
  • [ok] 『不引图表库』结论 — 示例页仅一个 <script src="https://cdn.tailwindcss.com">,无 d3/chart.js 引用,与 SKILL.md 的手写 SVG 路线一致。
  • [ok] jsdelivr 条目定性 — source 中该词仅出现在 `- **绝不**: 使用 chart.js / d3 库 (除非 jsdelivr CDN 引入); 推荐手写 SVG, 不超过 80 行 inline。`(SKILL.md:37);按批4 口径(非明确强制)未升档,已在 deps/reason 标注。
  • [ok] 外部端点存在性 — example.html 实测命中 cdn.tailwindcss.com 与 fonts.googleapis.com;example_source_url 指向 heygen 的 hyperframes 目录页,仅作出处标注。
  • [ok] 数据真实性条款 — SKILL.md『必须用用户提供的数据…自动估算合理坐标 (但要标注 "schematic")』逐字复核通过。
  • [ok] 安全面 — skill 目录 3 个文件无自写脚本/凭证/写盘;示例页无 fetch、无表单外发。
  • [ok] meta 元数据 — GitHub API 实查 stars=8827、pushed_at=2026-09-15T03:36:24Z、license Apache-2.0。

6Verdict & Scenarios

  • Translates implicit editorial chart craft into hard specifications (line widths, point sizes, tick counts, callout formatting, source rows) for consistent visual quality matching newsroom standards.
  • The 'headline must be synthesized from data' rule forces the model to draw insights before drawing charts, rather than just naming the graphic.
  • No chart libraries required, hand-crafted SVG ≤80 lines, single file runnable via double-click with zero build steps or dependencies, ideal for video frames or tweet cards.
  • Includes an animation fallback path (disabled via prefers-reduced-motion), friendly to accessibility and screen-recording workflows.
  • Best for: Ideal for turning business data/conclusions into video single frames, tweet cards, or slide covers; also suitable for editorial or brand content teams requiring NYT-style restrained typography. Provides maximum value to users without frontend engineering skills who need single-frame visual outputs.
    Not for: Not suitable for interactive charts, drill-downs, or real-time updates (chart libraries are forbidden); not suitable for massive datasets (hand-crafted SVGs will break); not suitable for pixel-perfect data accuracy requirements—it outputs schematics when given only conclusions.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload frame-data-chart-nyt.tar.gz
    sha256: bb37abe4f6f66d85…
    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.