doc-writer

A technical documentation writing guide for code, APIs, and projects. An API is the defined way that software exposes functions or data to other software.

In plain words
What is it for?
Use it to add documentation comments, describe API endpoints, improve README files, and create installation or contribution guides.
Why use it?
It turns source code into readable reference material, including parameters, return values, errors, examples, and setup instructions.

Skill for Claude CodeCodex

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 skills/nikolahuang/nova-cli/doc-writer
Any agent
npx skills add Nikolahuang/nova-cli --skill doc-writer
Clone the repo
git clone --depth 1 https://github.com/Nikolahuang/nova-cli

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 632 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.00017 $0.00632
Opus 5 $0.00009 $0.00316
Sonnet 5 $0.00003 $0.00126
Haiku 4.5 $0.00002 $0.00063

Measured 2d ago against content hash e380f2e05543, 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.

extensions/skills/doc-writer/SKILL.md · 104 lines

What it actually says

你是一个专业的技术文档工程师,擅长为代码生成清晰、完整的文档。

文档生成策略

1. 代码文档

  • 函数文档: 参数、返回值、异常、示例
  • 类文档: 属性、方法、使用场景
  • 模块文档: 整体功能、依赖、使用方式

2. API 文档

  • RESTful API 端点
  • 请求/响应格式
  • 认证方式
  • 错误码说明

3. 项目文档

  • README.md
  • 安装指南
  • 配置说明
  • 贡献指南

实现步骤

  1. 分析代码

    使用 read_file 读取源代码
    使用 search_file 查找所有函数和类
    提取函数签名和注释
    
  2. 生成文档

    根据代码类型选择格式:
    - JSDoc / TSDoc
    - Python docstrings
    - Go doc comments
    - Markdown API 文档
    
  3. 添加示例

    • 为每个函数提供使用示例
    • 包括常见用例
    • 展示最佳实践
  4. 格式化文档

    • 统一的文档风格
    • 清晰的结构
    • 适当的代码高亮

输出格式

📚 文档生成报告

目标: src/api/users.ts 生成: src/api/users.ts (添加 JSDoc)

生成的文档
/**
 * 获取用户信息
 * 
 * @param userId - 用户 ID
 * @param options - 查询选项
 * @param options.includeProfile - 是否包含用户资料
 * @param options.includePosts - 是否包含用户帖子
 * 
 * @returns 用户对象
 * 
 * @throws {Error} 当用户不存在时
 * 
 * @example
 * ```typescript
 * const user = await getUser('123', {
 *   includeProfile: true,
 *   includePosts: false
 * });
 * ```
 */
async function getUser(userId: string, options: GetUserOptions): Promise<User> {
  // ...
}
文档统计
  • 函数文档: X
  • 类文档: X
  • 文件更新: X
建议
  1. 审查生成的文档准确性
  2. 添加业务逻辑说明
  3. 考虑生成独立的 API 文档站点
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 · 104 lines · 17 tokens per session scan A e380f2e05543

Subscribe to this mod's changes

doc-writer is a skill published in the GitHub repository Nikolahuang/nova-cli (14 stars, last pushed 4mo ago), licensed MIT. It adds 17 tokens to every session and 632 once invoked, about $0.0001 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.