Home / All Skills / Docs & Knowledge / social-media-matrix
Docs & Knowledge · nexu-io/html-anything

social-media-matrix

Cinematic multi-platform social media analytics: interactive charts, hover insights, range comparisons, and dark/light themes

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandDual-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 selectors, and its body contains layout instructions for the agent; the repository contains no code for individual templates, meaning adding a template simply equals adding a 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 an in-process regex (no YAML dependencies), and the body is extracted as-is as the prompt body without exposing it 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's body between shared design directives and user content to compose a prompt — the template's "intelligence" resides entirely within this natural language, with zero executable code.

next/src/lib/templates/shared.ts
return `${SHARED_DESIGN_DIRECTIVES} ${opts.body.trim()}
The return value 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 like single-file HTML, Tailwind/font CDNs, content-driven quantities, and a ban on filesystem tools; these are uniform across all templates and not specific to this template.

The host's /api/convert loads this template and hands these texts to a locally authenticated coding-agent CLI, streaming back stdout purely as HTML; 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 invokes invokeAgent({ … }) to spawn a CLI (claude / codex / cursor-agent, detected via host PATH); its accompanying shared directives also explicitly state: "**DO NOT use Write / Edit / MultiEdit / Bash / Create / any filesystem tools**".

The example.html bundled with the template is a "pre-rendered example" served as-is by the preview endpoint into the iframe of selectors and galleries — it determines whether the template card displays 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 adds sandbox="allow-scripts allow-same-origin" to the iframe in the preview panel (a host-side implementation beyond this template's control).

Frontmatter fields are mapped one-by-one into selector metadata (featured determines overall sorting, recommended pushes it to the top "★ Recommended" group, example_* generates copy for example cards) and determine 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.

The generation capabilities of this template are fulfilled entirely by its own body text: social-media-matrix/SKILL.md only describes layout, color palette, typography, and content guidelines, without a single command instructing the agent to run tools, fetch APIs, or read external data.

next/src/lib/templates/skills/social-media-matrix/SKILL.md
【模板: 社媒矩阵追踪 (Social Matrix Tracker)】
The skill directory contains a total of 2–3 files (SKILL.md + example.html[+ example.md]), with no scripts/references/data files; example.html is merely a manually crafted sample artifact of this template (see internal_assets).

The goal is to turn social media data into a cinematic, data-dense multi-platform dashboard.

next/src/lib/templates/skills/social-media-matrix/SKILL.md
【意图】电影感、数据密集的多平台社媒看板。

The core is a platform × metric KPI matrix rather than single-platform metric cards.

next/src/lib/templates/skills/social-media-matrix/SKILL.md
- Multi-platform KPI matrix (横 platform × 纵 metric)

Charts require interactivity: hover tooltips and range comparisons.

next/src/lib/templates/skills/social-media-matrix/SKILL.md
- 交互式 charts (hover tooltip + range compare)

Theme and fallback data handling are also embedded in the body: dark / light switching, with data backed by seed fallbacks.

next/src/lib/templates/skills/social-media-matrix/SKILL.md
- dark / light 切换; 数据用 seed 兜底

The example uses canvas + inline JS to implement interactive charts (tooltips, pinning, drag-to-range, Shift+Drag to save multiple ranges, double-click to reset).

next/src/lib/templates/skills/social-media-matrix/example.html
<div class="sub">Hover: details · Click: pin point · Drag: interval stats · Shift+Drag: save multi ranges · Double click: reset</div>

2Core Capabilities

01Multi-platform KPI matrix (platform × metric)
02Interactive charts: hover tooltip / click to pin / drag-to-select range statistics
03Real-time writeback insights panel (focus / pin / range / A-B comparison)
04Dark / light theme switching (html[data-theme] driving the entire token set)
05Multi-network rotation (example cycles through platforms every 3.6 seconds)
06Canvas chart layer (line / stacked / donut / geographic distribution)
07Top posts grid and insights

3External Dependencies

KindDependency / Endpoint
cli本地 coding-agent CLI(宿主提供,模板自身不调用)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Executes local scripts or commands: example.html inline <script> (browser-side: canvas line/stacked/donut rendering, hover tooltips, click pinning, drag-to-select range statistics, S
Audit Notes: Evaluation target = this skill directory (SKILL.md + example.html[+ example.md]): contains no built-in scripts, credential reading, or disk-write commands, and requires no external endpoints at runtime — the body only provides layout/color/font family names and content disciplines; font family names do not trigger network requests. External links present in the directory are purely for "sample artifact" purposes, verified line by line: zero hits — zero http(s) literal matches in the social-media-matrix directory; fonts only declare family names (Inter / "Cormorant Garamond", etc.) without generating requests, CDN, or external image links. Under Batch 4 criteria (endpoints appearing only in artifact examples/citations → green), rating tier is unaffected. Host-side behaviors (loader.ts disk read, assemblePrompt prompt composition, agents/invoke.ts spawning 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 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] 端点扫描(目录内) — social-media-matrix 目录 2 个文件中无任何 http(s) 字面量:无 CDN、无 Google Fonts、无外链图片;字体仅以字族名声明。
  • [ok] example.html 与 SKILL.md 的一致性 — 正文五条要求均有对应实现:data-theme + setTheme()(主题切换)、.platforms 矩阵、canvas 图表 + .chart-tooltip(交互图表)、.insights-panel(洞察抽屉)、Top posts 卡片。
  • [unlocatable] 「数据用 seed 兜底」 — 正文写 '- dark / light 切换; 数据用 seed 兜底',但在 SKILL.md 与 example.html 中都找不到任何确定性随机种子机制:示例是写死的静态数据字面量(data = { x:{…}, linkedin:{…} … }),只有装饰性 sparkline 用 Math.random()。该措辞更像是「缺数据时自造合理数据」的要求,无代码级对应物,故不写成能力。

6Verdict & Scenarios

  • Treats the "multi-platform × multi-metric" matrix as a first-class citizen, ideal for cross-comparison rather than isolated single-platform reporting
  • Exceptional depth of interactivity: hover tooltips, click pinning, drag-to-select range statistics, Shift+Drag to save multiple ranges
  • Insights panel writes interactive results into text in real time (A/B comparison, MoM/YoY), making it far more than just charts
  • Dual dark/light themes implemented symmetrically, suitable for both screen casting and night viewing
  • Zero external links; requires no third-party requests during preview or offline browsing
  • Best for: Ideal for content teams or individuals needing horizontal cross-comparisons across multiple platforms/metrics, especially those valuing interactive analysis (range comparison, A/B) and light/dark theme toggles; also serves well as a visual reference for high-density data dashboards.
    Not for: Not suitable for single-platform weekly reports (social-media-dashboard is more lightweight), mobile browsing, or scenarios requiring live data source integrations or structured report exports — it does not fetch or export data, relying entirely on user input or model hallucination.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload social-media-matrix.tar.gz
    sha256: 64db2953e2b6de77…
    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.