html-to-docx

html-to-docx is a skill for Claude Code from rojim666/SztuCode. It costs 109 tokens per session (4,397 once invoked), scanned A, original, MIT.

A converter that turns HTML into an editable Microsoft Word document (.docx). It maps common HTML structure and styles, and can include images, tables, a table of contents, headers, and footers.

In plain words
What is it for?
Use it when an HTML document needs to be delivered as a Word file that people can edit. It supports elements such as headings, paragraphs, lists, tables, quotations, images, and document decorations.
Why use it?
It lets a document produced for the web become an editable Word file without rebuilding the layout manually. It also handles CSS variables and several document-specific layout details.

Skill for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: agent in frontmatter.

Good fit Use it when an HTML document needs to be delivered as a Word file that people can edit. It supports elements such as headings, paragraphs, lists, tables, quotations, images, and document decorations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rojim666/sztucode/html-to-docx
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.

Any agent
npx skills add rojim666/SztuCode --skill html-to-docx
Clone the repo
git clone --depth 1 https://github.com/rojim666/SztuCode

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-to-docx

README.md
[![agentmods](https://agentmods.dev/badge/skills/rojim666/sztucode/html-to-docx/github.svg)](https://agentmods.dev/skills/rojim666/sztucode/html-to-docx)
Your own site
<a href="https://agentmods.dev/skills/rojim666/sztucode/html-to-docx"><img src="https://agentmods.dev/badge/skills/rojim666/sztucode/html-to-docx/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-to-docx

Your own site · 80×15
<a href="https://agentmods.dev/skills/rojim666/sztucode/html-to-docx"><img src="https://agentmods.dev/badge/skills/rojim666/sztucode/html-to-docx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00109 $0.04397
Opus 5 $0.00055 $0.02198
Sonnet 5 $0.00022 $0.00879
Haiku 4.5 $0.00011 $0.00440

Measured today against content hash 3a0001bf341c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

html-to-docx scanned grade A with 1 finding 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

> # uv 本身请预先由运维分发到 $HOME/.local/bin/uv,脚本探测到已装则跳过 curl 安装
packages/runtime-ts/prompts/workbuddy/skills/_builtin-plugins/tencent-docx/skills/html-to-docx/SKILL.md · 328 lines

How it starts

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

html-to-docx Skill

概述

html-to-docx 是一个 Python 转换引擎,支持:

  • CSS 变量(var(--x))预处理
  • 10+ 种 HTML 元素精确映射(标题/段落/表格/列表/图片/blockquote 等)
  • 14 种 CSS 属性映射(字体/颜色/缩进/行距/对齐等)
  • 中文字体支持(宋体/黑体/仿宋/楷体,含 rFonts.eastAsia 设置)
  • 4 种装饰组件(callout / divider / section-marker / data-card)+ data-card-grid
  • 语义 <section role> 分节 + CSS @page 页眉页脚 + 动态域(PAGE/NUMPAGES/STYLEREF)
  • TOC 目录渲染(3 级)
  • 页眉/页脚渲染
  • 图片嵌入(base64 / 本地路径 / 远程 URL)
  • CLI 和 Python API 双模式调用

调用方式

前置条件:Python 环境与依赖安装

本 Skill 使用 托管 venv(默认 $HOME/.venv-html-to-docx)运行,避免污染系统 Python,也绕开 IDE safe-delete 拦截与跨机器 venv 二进制损坏。环境准备已封装为幂等脚本,首次 ~30s、之后 ~0.5s,agent 无需自行 python -m venv / pip install

⚠️ 首次调用需要外网(幂等脚本首跑会连以下三处公网):

  • https://astral.sh/uv/install.sh — 装 uv(若本机未装)
  • astral-sh/python-build-standalone GitHub Releases — 拉 Python 3.12 独立发行版(uv 托管)
  • https://pypi.org/simple — 下载 python-docx / lxml / Pillow 等 wheel

私有化 / 无外网环境:请在首次调用前导出以下环境变量指向内网镜像(uv 与 pip 均遵循):

export UV_INDEX_URL="https://<内网 PyPI 镜像>/simple"
export UV_PYTHON_INSTALL_MIRROR="https://<内网 python-build-standalone 镜像>"
# uv 本身请预先由运维分发到 $HOME/.local/bin/uv,脚本探测到已装则跳过 curl 安装

未配置镜像且无外网时,setup-html-to-docx.sh 首跑必然失败——这是已知交付前置条件,非 skill 缺陷。Agent 在私有化交付场景下调用本 skill 前,应先确认 IOA/运维已完成上述环境变量或离线 wheel 分发,否则应转 Markdown 降级(见"错误处理与降级")而非重试。

统一入口(推荐,workbuddy / local 通道一键装齐)

bash <plugin_root>/scripts/wb/local/setup.sh

单独准备本 Skill 的环境

bash <plugin_root>/scripts/wb/local/setup-html-to-docx.sh

说明:环境安装脚本位于 plugin 根的 scripts/wb/local/setup-html-to-docx.sh(workbuddy 本地通道专属)。

脚本输出末尾会打印 Python runner: <venv>/bin/python,可直接 export HTML_TO_DOCX_PY=<那个路径> 供后续调用。

调用(首选:环境变量方式)

bash <plugin_root>/scripts/wb/local/setup-html-to-docx.sh   # 幂等,已就绪则秒退
export HTML_TO_DOCX_PY="${HTML_TO_DOCX_VENV:-$HOME/.venv-html-to-docx}/bin/python"
cd <plugin_root>/skills/html-to-docx/scripts
"$HTML_TO_DOCX_PY" -m html_to_docx convert input.html -o output.docx [OPTIONS]

Read the full file on GitHub · 328 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. today First seen · 328 lines · 109 tokens per session scan A 3a0001bf341c

Subscribe to this mod's changes

html-to-docx is a skill published in the GitHub repository rojim666/SztuCode (64 stars, last pushed today), licensed MIT. It adds 109 tokens to every session and 4,397 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-12.

Related

Other skills, from other repositories

docx

Read, create, and convert Microsoft Word (.docx) documents — extract text and tables, build reports from markdown/JSON, and export to PDF.

zhixuli0406/DuDuClaw · 34 tokens

docx-draft

Convert Word documents to structured markdown for LLM-assisted editing, then convert back to Word with preserved formatting. Make sure to use this whenever the user wants to work on, revise, draft, fill in, or collaboratively edit a .docx and then produce a final .docx again. Prefer this over markitdown or…

valtterimelkko/agent-workflow-skills · 82 tokens

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when…

zebbern/termstack · 168 tokens

upload-artifact

Upload a file as a ClosedLoop document (PRD, implementation plan, feature, or template). Reads file content and uploads via MCP without consuming conversation context. Also supports creating new versions of existing documents. Triggers on: "upload artifact", "upload PRD", "upload implementation plan", "upload…

closedloop-ai/claude-plugins · 103 tokens

writer-documents

Create, open or edit Writer documents: ODT default; DOCX for Word compatibility.

agent0ai/agent-zero · 22 tokens

document-processing

Use when the deliverable is a document's bytes or its literal content — text/tables out of PDFs, AcroForm fill and flatten, page merge/split, PDF/DOCX from templates, OCR of image-only scans. NOT schema-typed fields pulled from text (that is structured-extraction), NOT signature routing (e-signature) or spreadsheet…

ericrisco/rsc-harness · 84 tokens