← 返回 Skills 市场
hhngdcz

Generate project documentation

作者 hhngdcz · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
100
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hhngdcz-b
功能描述
分析当前项目代码库,自动生成全面的技术文档(项目概览、架构设计、模块说明、API 文档、数据模型、依赖关系、部署说明),输出到 docs/ 目录。通过 subagent 并行分析,适用于任意规模的项目。
使用说明 (SKILL.md)

分析当前项目代码,生成全面的技术文档到 docs/ 目录。通过 general-purpose subagent 并行分析代码库并用 Write 工具写入文件,返回值只含摘要。

输入:空(整个项目)| 子目录路径 | 逗号分隔的模块名称列表

输出docs/ 目录下的 README.md、architecture.md、modules/*.md、api.md、data-model.md、dependencies.md、deployment.md


核心架构

主 agent(协调者,不读源码、不读文档内容)
  ├── 步骤 1: 预检 + 顶层扫描 + 智能分组 + 用户确认
  ├── 步骤 2: general-purpose subagent 并行(模块文档 + 依赖/部署文档,每批最多 5 个)
  ├── 步骤 3: general-purpose subagent 并行(架构 + API/数据模型文档)
  └── 步骤 4: 主 agent 写 README.md + Glob 验证 + 总结

关键原则

  1. subagent 统一用 general-purpose 类型,通过 Write 工具写入文件
  2. subagent 返回值只含一行摘要,绝不回传文档全文
  3. 主 agent 绝不读源码,也绝不读 subagent 生成的文档内容
  4. 小模块合并、大模块裁剪,subagent 总数控制在 5-8 个

步骤 1:预检、扫描、分组与用户确认

1a. 预检:检查 docs/ 是否存在。已有文档时用 AskUserQuestion 让用户选择:覆盖重写(推荐)/ 仅补充 / 取消。

1b. 读取项目元数据:查找 pyproject.tomlpackage.jsonCargo.tomlgo.modpom.xmlbuild.gradle*.csprojCMakeLists.txt。读取 README.mdCLAUDE.md(如有)。

1c. 顶层结构扫描(仅 Glob,不读文件内容):

  • 列出所有源码文件路径
  • 排除:.git.venv.env.claude.idea.vscodenode_modulesvendortargetbuilddist__pycache__docs/
  • 按目录结构划分模块分组,记录文件路径和数量

1d. 智能分组合并(目标 5-8 个 subagent):

规模 文件数 策略
≤ 5 合并 2-3 个到同一 subagent
6-20 单独一个 subagent
> 20 单独一个 subagent,裁剪:优先入口/API/类型文件,跳过测试/mock/迁移

1e. 用户确认:AskUserQuestion 展示分组结果,用户可增删改。

1f. 创建目录mkdir -p docs/modules

如果输入是路径则仅扫描该路径;如果输入是模块名列表则跳过 1c/1d/1e。


步骤 2:并行生成模块文档 + 依赖/部署文档

用 TaskCreate 跟踪进度。每批最多 5 个 general-purpose subagent 并行启动:

  • 模块文档 subagent × N — prompt 模板见 prompts/module-doc.md
  • 依赖+部署文档 subagent × 1 — prompt 模板见 prompts/deps-deploy.md

每批完成后用 Glob 确认文件写入。


步骤 3:并行生成全局文档

模块文档全部完成后,最多 2 个 general-purpose subagent 并行:

  • 架构文档 subagent — prompt 模板见 prompts/architecture.md
  • API+数据模型文档 subagent — prompt 模板见 prompts/api-datamodel.md

步骤 4:验证与生成入口文档

a. Glob 确认 docs/**/*.md 全部写入 b. 主 agent 直接写 docs/README.md(项目名称、技术栈、文档导航目录、生成时间) c. 展示结果:文档列表、状态、失败项提示


护栏

  • subagent 通过 Write 工具写文件,返回值只含摘要,绝不回传文档全文
  • 主 agent 绝不读源码,也绝不读文档内容到上下文
  • 绝不编造未实现的功能
  • 绝不修改源码
  • subagent 失败则记录并继续,最终汇报失败项
  • "仅补充"模式下已有文档的模块跳过
  • 中文编写,术语保留英文,大量使用 ASCII 图表
  • 合并的小模块仍各自生成独立文档
安全使用建议
This skill appears coherent and appropriate for auto-generating project docs: it will scan repo structure, read project metadata and source (via subagents), and write files under docs/. Before running it: (1) back up your existing docs/ if you care about current content—the skill will offer an overwrite/append/ cancel choice but still writes files; (2) confirm your agent runtime enforces the guardrails claimed (that subagents only return a one-line summary and that .env/.venv are excluded); (3) ensure you trust the execution environment to handle the stated Bash/write operations (some platforms may not support arbitrary shell commands or may elevate risk if they do); (4) review the generated docs for accuracy — the skill states it will not fabricate behaviour, but automated summarization can still misinterpret code. If any of these platform guarantees (enforced summary-only returns, exclusion of sensitive files, safe file-write APIs) are absent, consider running the skill on a copy of the repo first.
功能分析
Type: OpenClaw Skill Name: hhngdcz-b Version: 1.0.0 The skill is a project documentation generator that analyzes source code to produce Markdown files in a 'docs/' directory. It includes safety guardrails such as explicitly excluding sensitive directories (e.g., .env, .git, .ssh) from scanning and requiring user confirmation before proceeding with the analysis. The logic uses subagents for parallel processing and standard tools (Write, Bash, Glob) in a manner consistent with its stated purpose, with no evidence of data exfiltration or malicious intent.
能力评估
Purpose & Capability
Name/description match what the SKILL.md and prompt templates do: scan repository structure, read project metadata and source (via subagents), and write docs/*.md. No unrelated credentials, binaries, or install steps are requested.
Instruction Scope
Instructions carefully separate roles: main agent does top-level scanning (glob only) and coordination, subagents read source/config files and write docs. The skill explicitly excludes sensitive paths (e.g., .env) and promises subagents only return one-line summaries. Two small points to note: (1) some subagent prompts instruct running a Bash mkdir command (mkdir -p docs/modules) — this is a filesystem write operation rather than pure prompt work and assumes the runtime allows shell operations; (2) the safety of 'never return document content' depends on the platform enforcing that constraint for subagents. Both are operational considerations rather than conceptual mismatches.
Install Mechanism
Instruction-only skill with no install spec and no code files to be written by an installer. Lowest install risk.
Credentials
No environment variables, credentials, or config paths are requested. Files read (package.json, pyproject.toml, Dockerfile, source files, README) are appropriate and necessary for documentation generation.
Persistence & Privilege
always:false and user-invocable:true. The skill writes into docs/ but does not request persistent elevated privileges or modify other skills' configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hhngdcz-b
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hhngdcz-b 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
New technical documentation generation skill for any project codebase. - Automatically analyzes your project and generates complete technical documentation (overview, architecture, modules, API, data model, dependencies, deployment) in `docs/`. - Uses parallel subagents for efficient processing of modules and document types, supporting projects of any size. - Outputs modular markdown files: `docs/README.md`, `architecture.md`, `modules/*.md`, `api.md`, `data-model.md`, `dependencies.md`, `deployment.md`. - Does not read or modify source code contents directly; never returns documentation text inline—files only. - Added: new prompt files for subagent tasks; removed legacy README and outdated reference. This release replaces previous configuration-generation features with powerful, automated project documentation.
元数据
Slug hhngdcz-b
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Generate project documentation 是什么?

分析当前项目代码库,自动生成全面的技术文档(项目概览、架构设计、模块说明、API 文档、数据模型、依赖关系、部署说明),输出到 docs/ 目录。通过 subagent 并行分析,适用于任意规模的项目。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。

如何安装 Generate project documentation?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hhngdcz-b」即可一键安装,无需额外配置。

Generate project documentation 是免费的吗?

是的,Generate project documentation 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Generate project documentation 支持哪些平台?

Generate project documentation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Generate project documentation?

由 hhngdcz(@hhngdcz)开发并维护,当前版本 v1.0.0。

💬 留言讨论