Files
Luong NGUYEN 232591b2a8 docs: sync to Claude Code v2.1.302 (#194)
* docs: sync to Claude Code v2.1.302

Release changes (v2.1.301-2.1.302): fork subagents on by default in claude -p, the Agent SDK, desktop and VS Code (CLAUDE_CODE_FORK_SUBAGENT=0 turns them off); claude -p / SDK sessions with no permission mode start in default on third-party providers, with telemetry off or on a fresh install; at most 12 prompt/agent hooks of one event run at once; new CLAUDE_CODE_AUTO_MODE_MODEL and CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS; /config Idle compaction row; vim % motion; tool_decision OTel attributes; fable/best fallback; 64-argument limit; hook ask prompts name their plugin or skill; PowerShell finds plugin bin/; mod Input rows. Also: standalone Claude Design closes Dec 14, 2026; Sonnet 4.5 retires Nov 30, 2026; managed Code Review GA; npm install marked deprecated per the official README.

Verified drift fixes (each checked against code.claude.com): hook handler JSON shapes, prompt-hook response schema, exec/HTTP/mcp_tool hook fields; GitHub MCP URL (api.githubcopilot.com) and token; nonexistent @modelcontextprotocol/server-database; plugin layout, marketplace, userConfig, strictKnownMarketplaces, blockedMarketplaces and enabledPlugins shapes; nonexistent deniedPlugins, autoCheckpoint, planning.*/extendedThinking.* keys; invented 09 settings schema; claude -p JSON output jq paths; subagent forks via subagent_type "fork" not context: fork; --agents priority; MCP default scope; command descriptions; rewind menu has six options; broken nested code fence in 07-plugins. Shipped hook scripts: pre-commit.sh reads stdin and only gates git commit; validate-prompt.sh uses hookSpecificOutput; session-end.sh no longer reads /dev/tty. Fixes mirrored into vi/ja/zh/uk where the same claim existed.

Learning skills: quiz Lesson 05 Q2 option B (GitHub MCP URL; Correct letter unchanged), explanations for L02 Q2, L04 Q6/Q9, L09 Q1, L07 Q2 wording; self-assessment wording in paired files; lesson-quiz 1.6.2, self-assessment 2.5.5.

* fix(hooks): parse pre-commit.sh hook input with sed instead of jq

* fix(mcp): restore DATABASE_URL expansion and align MCP env var setup

* fix(mcp): align QUICK_REFERENCE GitHub token and Example 2 DATABASE_URL setup
2026-10-19 09:56:39 +02:00
..

name, description, tags
name description tags
文档生成插件 为文档编写、同步和校验提供完整工作流 plugins, documentation, automation

文档生成插件

这个插件把文档相关的命令、subagents、模板和 MCP 服务器打包在一起,帮助你生成、同步和校验文档。

特性

✅ 生成 API 文档 ✅ 创建和更新 README ✅ 同步文档 ✅ 改进代码注释 ✅ 生成示例

包含内容

命令

Subagents

模板

MCP 服务器

  • GitHub 集成 - 用于文档同步

安装

claude --plugin-dir ./07-plugins/documentation

使用方式

生成 API 文档

/generate-api-docs

创建 README

/generate-readme

同步文档

/sync-docs

校验文档

/validate-docs

适用场景

  • 想标准化项目文档产出
  • 想自动生成 README、API 文档和示例
  • 想同步多个文档之间的一致性
  • 想维护代码注释和示例质量

需求

  • Claude Code 2.1+
  • GitHub 访问权限(可选)

示例工作流

用户:/generate-api-docs

Claude:
1. 扫描 /src/api/ 下的所有 API 端点
2. 委派给 api-documenter subagent
3. 提取函数签名和 JSDoc
4. 按模块 / 端点组织内容
5. 使用 api-endpoint.md 模板
6. 生成完整的 Markdown 文档
7. 包含 curl、JavaScript 和 Python 示例

结果:
✅ API 文档已生成
📄 已创建文件:
   - docs/api/users.md
   - docs/api/auth.md
   - docs/api/products.md
📊 覆盖率:23/23 个端点已文档化

模板用途

API 端点模板

用于编写带完整示例的 REST API 文档。

函数文档模板

用于编写单个函数或方法的说明文档。

ADR 模板

用于记录架构决策。

配置

为文档同步设置 GitHub token:

export GITHUB_TOKEN="your_github_token"

最佳实践

  • 文档尽量贴近代码
  • 随着代码变化同步更新文档
  • 提供可直接执行的示例
  • 定期校验文档有效性
  • 使用模板保持一致性

最后更新: 2026 年 10 月 18 日 Claude Code 版本: 2.1.302 来源: