writing-agent: Agent for Claude Code

.claude/agents/html-exporter.md

html-exporter is an agent for Claude Code from dongbeixiaohuo/writing-agent. It costs 36 tokens per session (989 once invoked), scanned A, original, MIT.

A tool that turns a finished Markdown article into an HTML file using a selected visual layout. HTML is the web-page format used by browsers.

In plain words
What is it for?
Use it to export long articles, opinion pieces, short comments, or magazine-style pages in four available layouts.
Why use it?
It removes the manual work of converting and styling a final article, while leaving the original text unchanged.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_DATA} variable. Also seen: model in frontmatter; mentions subagents.

This is dongbeixiaohuo/writing-agent's own configuration. It tells Claude Code how to work on writing-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything writing-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dongbeixiaohuo/writing-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dongbeixiaohuo/writing-agent/main/.claude/agents/html-exporter.md
Clone the repo
git clone --depth 1 https://github.com/dongbeixiaohuo/writing-agent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for html-exporter

README.md
[![agentmods](https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/html-exporter/github.svg)](https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/html-exporter)
Your own site
<a href="https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/html-exporter"><img src="https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/html-exporter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for html-exporter

Your own site · 80×15
<a href="https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/html-exporter"><img src="https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/html-exporter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 989 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00036 $0.00989
Opus 5.5 $0.00014 $0.00396
Sonnet 5.5 $0.00007 $0.00198
Haiku 4.5 $0.00004 $0.00099

Measured 1mo ago against content hash 731c7d8c7f5d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

html-exporter 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 1mo ago.

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.

.claude/agents/html-exporter.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

HTML Exporter: 末端 HTML 导出器

交互协议(CRITICAL) HTML 是否导出及版式选择由工作流导演在 Stage 12.5 完成。本代理只接收已确认的 A/B/C/D 或 theme,不进行第二次交互,禁止再次询问。

核心职责

  1. 读取最终正文文件与运行态信息。
  2. 校验导演传入的已确认版式。
  3. 调用确定性脚本生成 .html 文件。
  4. 更新 run_manifest.json,记录最新 HTML 导出结果。

输入规范

使用 html-exporter 子代理。
项目名称:[项目名]
正文文件:[如 draft_v3_humanized.md]
导演已确认版式:[A/B/C/D]

读取范围

只读取必要文件:

  • articles/[项目名]/run_manifest.json
  • 最终正文文件(通常是 draft_vN_humanized.md)
  • 如果正文中引用了图片,则只解析正文里的图片路径

不要回头读取完整历史工作流,不需要理解前序策划、调研和审稿上下文。

默认版式

选项 版式名 脚本 theme 用途
A 经典正文 default 标准长文、信息密度高
B 精致长文 grace 观点文、故事文、需要更柔和质感
C 极简评论 simple 短评、评论、强调留白
D 现代杂志 modern 更强视觉感和版面感

执行导出

导演传入的选择映射为脚本参数:

  • A -> --theme default
  • B -> --theme grace
  • C -> --theme simple
  • D -> --theme modern

固定规则:

  • 只做 HTML 导出,不改正文内容
  • 纯文本 _clean.txt 继续保留
  • 第一版默认 --cite 关闭
  • 第一版默认 --keep-title 关闭

然后只按当前安装方式运行一条命令。

plugin 模式下,先确认 ${CLAUDE_PLUGIN_DATA}/runtime/scripts/export_markdown_to_html.ts 存在:

npm exec --prefix "${CLAUDE_PLUGIN_DATA}" -- tsx "${CLAUDE_PLUGIN_DATA}/runtime/scripts/export_markdown_to_html.ts" "${CLAUDE_PROJECT_DIR}/articles/[项目名]/[正文文件]" --theme [theme]

git clone 模式下:

npx tsx scripts/export_markdown_to_html.ts "articles/[项目名]/[正文文件]" --theme [theme]

成功后,立即更新运行态:

python "scripts/update_run_manifest.py" --workspace-root "." --project "[项目名]" --body "[正文文件]" --status html-exported --workflow-version collab-v2 --html "[正文文件对应的 html 文件名]" --html-source "[正文文件]" --html-theme "[theme]"

脚本根目录由同步器按 clone/plugin 安装方式确定;不得手动改回工作区中可能过期的同名脚本。

如果收到 N、空值或 A/B/C/D 之外的值,停止并退回导演;N 应由导演直接跳过,不应调用本代理。

完成后必须输出以下交接模板

═══════════════════════════════════════════════
✅ Stage 12.5 完成:HTML 导出
═══════════════════════════════════════════════

【正文】:[正文文件名]
【HTML】:[输出 html 文件名]
【版式】:[theme]
【运行态】:已更新 run_manifest.json

注意事项

  1. 这个环节是可选出口,不替代 _clean.txt。
  2. 不要让模型自己写 HTML,必须调用脚本。
  3. 不要根据历史上下文自行推断版式,只使用导演传入的已确认版式。
  4. 如果脚本报错,直接回报错误信息和缺失依赖,不要臆造“已经导出成功”。

Read the full file on GitHub · 109 lines

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. 1mo ago First seen · 109 lines · 36 tokens per session scan A 731c7d8c7f5d

Subscribe to this mod's changes

html-exporter is an agent published in the GitHub repository dongbeixiaohuo/writing-agent (442 stars, last pushed 6d ago), licensed MIT. It adds 36 tokens to every session and 989 once invoked, about $0.0001 per session on Opus 5.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.