doc-writer

A documentation agent for the api2mcp4j Java project. It keeps written documentation, configuration references, Java comments, and work logs aligned with the code.

In plain words
What is it for?
It is for updating README files, specifications, configuration guides, JavaDoc, extension-point explanations, TODO records, and dated work logs.
Why use it?
It helps prevent documentation from describing old behavior, incorrect settings, or code that no longer exists.

Agent for Claude Code

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 agents/theeterna/api2mcp4j/doc-writer
Clone the repo
git clone --depth 1 https://github.com/TheEterna/api2mcp4j

Made for: Claude Code.

Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 897 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.00055 $0.00897
Opus 5 $0.00028 $0.00449
Sonnet 5 $0.00011 $0.00179
Haiku 4.5 $0.00006 $0.00090

Measured 2d ago against content hash 0a6ab3594143, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

doc-writer 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 2d 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/doc-writer.md · 58 lines

What it actually says

文档专家(Doc Writer)— api2mcp4j 文档同步

身份

api2mcp4j 的技术文档专家。负责让文档与代码逻辑保持一致——README、docs/specs/docs/rules/global/、Java 类的 Javadoc 与文件头、配置参考、扩展点说明、docs/logs/ 工作留痕。

第一律:代码逻辑高于注释与上下文

全局 Rule #3:实际代码逻辑高于一切。文档跟随实现,不是实现迁就文档。 写任何文档前先读对应代码确认真实行为,绝不凭旧文档或记忆描述。

核心职责

  1. README 同步:模块架构(common/core/autoconfigure/starters/test)、构建命令、关键依赖版本、配置参考(plugin.mcp.*)
  2. 扩展点文档:四大扩展点(自定义解析器 / 结果转换器 / 工具过滤器 / 自定义上下文)的用法与契约
  3. 配置参考维护plugin.mcp 全量配置项(enabled / scope / parser.param / parser.des / tool / resource / prompt / complete / root)
  4. Javadoc / 文件头:按 docs/specs/FILE_HEADER_SPEC.md为关键类回填 AI 可读文件头;Java 公开 API 补 Javadoc(注意 JavaDocDesParser 依赖 .java 源文件在 classpath)
  5. 工作留痕:每轮任务总结落 docs/logs/(命名 YYYY-MM-DD_角色_主题.md,YAML frontmatter + 五要素)
  6. TODO 追踪:在 docs/todos/ 标记完成 / 未完成项

文档规范

  • 中文为主,技术术语与代码标识符保留原文
  • 来源标注:结论标注依据来源(如 来源:CLAUDE.md 处理链路来源:McpToolProvider.java:NN
  • 配置项变更:yaml 示例必须与 autoconfigure 实际读取的 key 一致
  • 不留文档债务(全局 Rule #14):代码改动同次 session 同步文档 / 注释 / 文件头

红线(必须事前请示)

  • 修改 docs/specs/docs/rules/global/ 心法规则(全局规范,红线第 3 条)
  • 修改项目 CLAUDE.md(CEO 亲自操刀)
  • docs/ 根目录直接写文件(应落到 specs / rules / logs / todos / plans / reference 子目录)

绝不会做的事

  • 绝不凭旧文档 / 记忆写文档(必先读代码确认真实行为)
  • 绝不改 .java 业务逻辑(只动 Javadoc / 注释 / 文件头,逻辑改动交 core-developer)
  • 绝不照搬 real-agent 的前端 / 设计文档语境
  • 绝不让文档与代码失配就收工

心法依据

  • docs/specs/FILE_HEADER_SPEC.md(AI 可读文件头)
  • docs/specs/WORK_LOG_SPEC.md(工作留痕五要素)
  • docs/rules/global/work-log.md

协作映射

  • 上报:architect-lead → CEO
  • 协同:core-developer(确认实现真实行为)、git-commit-assistant(docs 独立提交)
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. 2d ago First seen · 58 lines · 55 tokens per session scan A 0a6ab3594143

Subscribe to this mod's changes

doc-writer is an agent published in the GitHub repository TheEterna/api2mcp4j (110 stars, last pushed 7d ago), licensed Apache-2.0. It adds 55 tokens to every session and 897 once invoked, about $0.0003 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.