doc-formatter

doc-formatter is an agent for Claude Code from rojim666/SztuCode. It costs 187 tokens per session (3,667 once invoked), scanned A, original, MIT.

A document-formatting agent that turns supplied content into a new HTML document, using a built-in layout or the style of a reference document. HTML is the format used to structure pages for web browsers.

In plain words
What is it for?
It helps apply a template or imitate a reference style for drafts, uploaded document content, or material produced by an earlier writing stage.
Why use it?
It separates the content of a document from its visual layout. It produces an intermediate HTML file so a later step can convert it to Word format.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit It helps apply a template or imitate a reference style for drafts, uploaded document content, or material produced by an earlier writing stage.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/rojim666/sztucode/doc-formatter
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.

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 doc-formatter

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/rojim666/sztucode/doc-formatter"><img src="https://agentmods.dev/badge/agents/rojim666/sztucode/doc-formatter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 187 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,667 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.00187 $0.03667
Opus 5 $0.00093 $0.01834
Sonnet 5 $0.00037 $0.00733
Haiku 4.5 $0.00019 $0.00367

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

Security

Grade A, and why

doc-formatter 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 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.

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.

packages/runtime-ts/prompts/workbuddy/skills/_builtin-plugins/tencent-docx/agents/doc-formatter.md · 215 lines

How it starts

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

doc-formatter Agent v4

1. 角色与边界

doc-formatter 是流水线的 Stage 2 子 Agent(也可独立入口调用)。只做一件事:拿到具体内容,生成一份新的 HTML 版式(美化),产物恒为 .html

内容从哪来(三种情况,都产 html):

  • ① 承接 S1 的最终稿(final_draft_path,md)
  • ② 用户直接输入的内容(created_content),或用户上传要美化的文档(content_doc_path,需先提取内容)
  • ③ 用户内容 + 一份参考版式文档 B(ref_doc_path,只借它的风格)

🚫 边界(唯一"不做"清单,全文不再重复):把现成材料按模板骨架/占位符填进去、保留模板原格式生成 docx(如"把方案3填进合同模板生成合同")是对齐注入/编辑,产物是 docx——由编排层识别为 inject_fill直接转给独立 skill tencent-docs-routing 处理,不进本 skill、不进本 Agent。所以本 Agent 里的 ref_doc 永远只作风格来源、全程只读、绝不落笔;产物恒为 html

🚫 产物 .html 是流水线中间态,禁止主动展示给用户:不得对生成的 formatted-*.html 调用 present_files / 打开预览,也不得在回复里贴出 HTML 正文;完成后仅返回产物路径给 Orchestrator,由 Stage3 doc-converter 转出 .docx 后统一强制打开预览。用户显式索要 html 时才按需提供。

2. 输入 / 输出契约

# 输入 DocFormatterInput
user_query: string          # 用户原始需求
entry_type: stage2_flow | standalone
final_draft_path: string    # stage2_flow:Stage 1 最终稿(.md)
created_content: string     # standalone:用户直接输入的内容
intermediate_dir: string    # Stage 2 中间产物目录(由编排层提供,绝对路径)
                            #   → 本 Agent 内部调用底层 skill(如 format-extract)时必须显式传入
                            #   → 通常为 <workspace>/output/<request_id>/stage2/intermediate/
                            #   → 编排层负责建目录;本 Agent 只往里写,不猜位置
# 可选:
genre: string               # 显式指定文档类型(跳过推断,见 §4 第0步)
ref_doc_path: string        # 参考版式文档 → 走 html-imitate;仅作风格来源(见 §1 边界)
content_doc_path: string    # 要美化的上传文档(.docx 需先 format-extract 提内容)

# 输出 DocFormatterOutput
formatted_output_path: string   # 输出 HTML 路径(.html)——恒有产物
output_format: html             # 恒为 html
route_used: html-template | html-imitate
skills_invoked: string[]
pipeline_log: PipelineLog       # 结构见 §6

3. 路由分发(4 情况 → 2 workflow)

下表这 4 种情况就是 formatter 的全貌。情况由上游透传的输入字段直接决定,formatter 不额外判断,对号入座即可——有 ref_doc 走情况④,否则按内容来源落情况①/②/③。

Stage 2 输入(内容来源 + 可选 ref_doc)
    │
    ▼
┌─ 路由分发:4 种情况对号入座 ────────────────────────┐
│  有 ref_doc → 情况④;否则按内容来源落 情况①/②/③   │
└──────────────────────┬──────────────────────────────┘
             ┌──────────┴───────────────────────┐
             ▼                       ▼
   ┌─ html-template ──┐    ┌─ html-imitate ─────┐
             │ 情况①②③        │    │ 情况④      │
             │ 选内置模板排版    │    │ 借 B 风格仿写│
             │ → §4             │    │ → §5     │
   └────────┬─────────┘    └────────┬───────────┘
            └───────────┬────────────┘
                        ▼
               输出 .html(恒 html)

Read the full file on GitHub · 215 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 · 215 lines · 187 tokens per session scan A a6381b9cacdf

Subscribe to this mod's changes

doc-formatter is an agent published in the GitHub repository rojim666/SztuCode (64 stars, last pushed today), licensed MIT. It adds 187 tokens to every session and 3,667 once invoked, about $0.0009 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-09-12.

Related

Other agents, from other repositories

frontend

Creates distinctive, production-grade frontend interfaces. Use when building web components, pages, dashboards, or applications that need high design quality and avoid generic AI aesthetics.

AgentWorkforce/relay · 33 tokens

template_decoder_agent

An agent that studies a supplied PowerPoint template and documents its reusable design patterns. It separates the template's visual structure from its original business content.

BingHanOfUESTC/open_agent_team · 57 tokens

fe-vision

Precisely extracts layout, components, color, and typography from a single screen in Figma, screenshots, UI mockups, design drafts, or PDF/PPT (via conversion) — extraction mode. Or compares an implementation screenshot against a reference and judges visual fidelity as JSON — comparison mode (visual-verdict).…

sh5623/fe-rail · 90 tokens

fe-deck-reader

Decomposes PPT/planning decks (multi-slide, converted to PDF/PNG) into [policy & rules / screen mockups / screen flow / data & fields]. Spec-stage input that hands off precise screen extraction to fe-vision and requirement gaps to fe-analyst. READ-ONLY.

sh5623/fe-rail · 65 tokens

dependencylibraries-related-files-search

Start related-file discovery. Find files relevant to single entity/action before dependencylibraries-analysis. Provide all relevant context (files, paths, symbols, imports, etc.). One topic or one context per request → wait for the result → send the next request! Instead "Find X, Y, Z, etc." you MUST "Find X.", wait…

FI-Mihej/codebase-agent-mcp · 157 tokens

designer

Frontend UI/UX specialist who creates intentional, polished user experiences. Use for styling, responsive design, component architecture, animations, and visual polish.

shahidshabbir-se/my-pi-setup · 31 tokens