html-preview

A guidance skill for adding small, static HTML/CSS visual previews to Markdown when a diagram, comparison, timeline, metric display, or layout sketch would be clearer than text. It does not use JavaScript.

In plain words
What is it for?
Use it for compact visual explanations of data, hierarchy, process, timing, or page layout—not when someone needs reusable HTML source code.
Why use it?
It makes certain relationships and visual arrangements easier to understand while keeping the main answer readable.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xerrors/yuxi/html-preview
Any agent
npx skills add xerrors/Yuxi --skill html-preview
Clone the repo
git clone --depth 1 https://github.com/xerrors/Yuxi

Made for: Claude Code, Codex.

Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 782 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00086 $0.00782
Opus 5 $0.00043 $0.00391
Sonnet 5 $0.00017 $0.00156
Haiku 4.5 $0.00009 $0.00078

Measured yesterday against content hash b481d22101eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

html-preview scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

backend/package/yuxi/agents/skills/buildin/html-preview/SKILL.md · 41 lines

What it actually says

HTML Preview

将 Markdown 作为回答主体。只有可视化能明显降低理解成本时,才补充一个 html:preview 静态组件;标题、列表、表格或代码块已经足够清楚时,继续使用普通 Markdown。

按以下顺序输出:

  1. 先用普通 Markdown 写结论和必要解释。
  2. 顶格写开始围栏 ```html:preview。围栏最多只能有 3 个前导空格,否则前端会把它当作源码。
  3. 在围栏内写自包含的静态 <style> 和语义化 HTML。
  4. 顶格写结束围栏 ```
  5. 在围栏后用普通 Markdown 补充背景、风险、完整明细和来源。

内容边界

  • 只输出静态 HTML/CSS,不编写 JavaScript,不使用表单、iframe、object 或 embed。
  • 可以引用公开、稳定、无需登录的 HTTPS 图片或字体,但核心信息必须在外链失败时仍然可读。
  • 不引用内网、临时地址、鉴权资源或包含用户凭证的链接。
  • 不把组件当成完整网页或正文容器;不要制作导航栏、页脚、登录态、复杂按钮、营销页 Hero 或多屏页面。
  • 不在组件中放长段叙事、完整报告、长表格或长列表。背景、推理、风险、明细和来源放在普通 Markdown 中。
  • 用户询问 HTML 源码、教程示例或需要复制代码时,使用普通 html 代码块,不使用 html:preview

布局约束

  • 面向默认 800px × 360px 尺寸设计,并允许容器宽度变化;前端最高显示到 700px,超出后在预览内部滚动。
  • 使用 max-width: 100%box-sizing: border-box、弹性网格、换行和适度间距保持响应式。
  • 不写死整体画布高度。核心信息应在默认尺寸内无需滚动即可读;放不下时减少内容。
  • 最多展示 1 个短标题、3–5 个关键指标或一组简短对比。数据超过 6 项时,汇总为趋势、区间、异常点或 Top 3。
  • 文字以短标签、数字、单位、状态词和极短备注为主;单条说明尽量不超过 20 个中文字符。
  • 外层已经提供圆角、边框和裁切。不要再给最外层添加卡片壳、页面背景、大圆角、阴影、厚边框或额外外边距。
  • 保持克制和可读,优先使用紧凑指标组、摘要表、对比条、状态标签、时间轴或简单关系图。

失败处理

如果内容无法在上述静态、安全和篇幅边界内表达,改用普通 Markdown,并明确说明限制。不要输出残缺围栏、不可访问资源或依赖脚本才能理解的预览。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 41 lines · 86 tokens per session scan A b481d22101eb

Subscribe to this mod's changes

html-preview is a skill published in the GitHub repository xerrors/Yuxi (6,591 stars, last pushed yesterday), licensed MIT. It adds 86 tokens to every session and 782 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

background-task

Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.

vstorm-co/full-stack-ai-agent-template · 62 tokens

agent-tool

Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.

vstorm-co/full-stack-ai-agent-template · 66 tokens

frontend-feature

Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.

vstorm-co/full-stack-ai-agent-template · 64 tokens

rag-knowledge

Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…

vstorm-co/full-stack-ai-agent-template · 76 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

channel-bot

Work with messaging-channel bots (Telegram / Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery.

vstorm-co/full-stack-ai-agent-template · 53 tokens