← Back to Skills Marketplace
hhngdcz

Generate project documentation

by hhngdcz · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
100
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hhngdcz-b
Description
分析当前项目代码库,自动生成全面的技术文档(项目概览、架构设计、模块说明、API 文档、数据模型、依赖关系、部署说明),输出到 docs/ 目录。通过 subagent 并行分析,适用于任意规模的项目。
README (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 图表
  • 合并的小模块仍各自生成独立文档
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hhngdcz-b
  3. After installation, invoke the skill by name or use /hhngdcz-b
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug hhngdcz-b
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Generate project documentation?

分析当前项目代码库,自动生成全面的技术文档(项目概览、架构设计、模块说明、API 文档、数据模型、依赖关系、部署说明),输出到 docs/ 目录。通过 subagent 并行分析,适用于任意规模的项目。 It is an AI Agent Skill for Claude Code / OpenClaw, with 100 downloads so far.

How do I install Generate project documentation?

Run "/install hhngdcz-b" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Generate project documentation free?

Yes, Generate project documentation is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Generate project documentation support?

Generate project documentation is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Generate project documentation?

It is built and maintained by hhngdcz (@hhngdcz); the current version is v1.0.0.

💬 Comments