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.
git clone --depth 1 https://github.com/rojim666/SztuCodeWrote 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.
[](https://agentmods.dev/agents/rojim666/sztucode/doc-formatter)<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.
<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>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00187 | $0.03667 |
| Opus 5.5 | $0.00075 | $0.01467 |
| Sonnet 5.5 | $0.00037 | $0.00733 |
| Haiku 4.5 | $0.00019 | $0.00367 |
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 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.
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后直接转给独立 skilltencent-docs-routing处理,不进本 skill、不进本 Agent。所以本 Agent 里的ref_doc永远只作风格来源、全程只读、绝不落笔;产物恒为 html。🚫 产物
.html是流水线中间态,禁止主动展示给用户:不得对生成的formatted-*.html调用present_files/ 打开预览,也不得在回复里贴出 HTML 正文;完成后仅返回产物路径给 Orchestrator,由 Stage3doc-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)
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.
- 1mo ago First seen · 215 lines · 187 tokens per session scan A a6381b9cacdf
doc-formatter is an agent published in the GitHub repository rojim666/SztuCode (110 stars, last pushed 3d ago), licensed MIT. It adds 187 tokens to every session and 3,667 once invoked, about $0.0007 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-09-12.
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.
designer
Owns docs/ux-spec.md and docs/mockup.html. Use for user flows, screens and a working HTML mockup.
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.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.