This skill should be used when writing documentation for codebases, including README files, architecture documentation, code comments, and API documentation. Use this skill when users request help documenting their code, creating getting-started guides, explaining project structure, or making codebases more accessible to new developers. The skill provides templates, best practices, and structured approaches for creating clear, beginner-friendly documentation.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install codebase-documenter或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install codebase-documenter⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/codebase-documenter/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: codebase-documenter description: This skill should be used when writing documentation for codebases, including README files, architecture documentation, code comments, and API documentation. Use this skill when users request help documenting their code, creating getting-started guides, explaining project structure, or making codebases more accessible to new developers. The skill provides templates, best practices, and structured approaches for creating clear, beginner-friendly documentation. ---
This skill enables creating comprehensive, beginner-friendly documentation for codebases. It provides structured templates and best practices for writing READMEs, architecture guides, code comments, and API documentation that help new users quickly understand and contribute to projects.
When documenting code for new users, follow these fundamental principles:
When to create: For project root directories, major feature modules, or standalone components.
Structure to follow:
# Project Name
## What This Does
[1-2 sentence plain-English explanation]
## Quick Start
[Get users running the project in < 5 minutes]
## Project Structure
[Visual file tree with explanations]
## Key Concepts
[Core concepts users need to understand]
## Common Tasks
[Step-by-step guides for frequent operations]
## Troubleshooting
[Common issues and solutions]
Best practices:
When to create: For projects with multiple modules, complex data flows, or non-obvious design decisions.
Structure to follow:
# Architecture Overview
## System Design
[High-level diagram and explanation]
## Directory Structure
[Detailed breakdown with purpose of each directory]
## Data Flow
[How data moves through the system]
## Key Design Decisions
[Why certain architectural choices were made]
## Module Dependencies
[How different parts interact]
## Extension Points
[Where and how to add new features]
Best practices:
When to create: For complex logic, non-obvious algorithms, or code that requires context.
Annotation patterns:
Function/Method Documentation:
/**
* Calculates the prorated subscription cost for a partial billing period.
*
* Why this exists: Users can subscribe mid-month, so we need to charge
* them only for the days remaining in the current billing cycle.
*
* @param {number} fullPrice - The normal monthly subscription price
* @param {Date} startDate - When the user's subscription begins
* @param {Date} periodEnd - End of the current billing period
* @returns {number} The prorated amount to charge
*
* @example
* // User subscribes on Jan 15, period ends Jan 31
* calculateProratedCost(30, new Date('2024-01-15'), new Date('2024-01-31'))
* // Returns: 16.13 (17 days out of 31 days)
*/
Complex Logic Documentation:
# Why this check exists: The API returns null for deleted users,
# but empty string for users who never set a name. We need to
# distinguish between these cases for the audit log.
if user_name is None:
# User was deleted - log this as a security event
log_deletion_event(user_id)
elif user_name == "":
# User never completed onboarding - safe to skip
continue
Best practices:
When to create: For any HTTP endpoints, SDK methods, or public interfaces.
Structure to follow:
## Endpoint Name
### What It Does
[Plain-English explanation of the endpoint's purpose]
### Endpoint
`POST /api/v1/resource`
### Authentication
[What auth is required and how to provide it]
### Request Format
[JSON schema or example request]
### Response Format
[JSON schema or example response]
### Example Usage
[Concrete example with curl/code]
### Common Errors
[Error codes and what they mean]
### Related Endpoints
[Links to related operations]
Best practices:
Before writing documentation:
Based on user request and codebase analysis:
Use the templates from assets/templates/ as starting points:
assets/templates/README.template.md - For project READMEsassets/templates/ARCHITECTURE.template.md - For architecture docsassets/templates/API.template.md - For API documentationCustomize templates based on the specific codebase:
Before finalizing documentation:
This skill includes several templates in assets/templates/ that provide starting structures:
...
安装 Codebase Documenter 后,可以对 AI 说这些话来触发它
Help me get started with Codebase Documenter
Explains what Codebase Documenter does, walks through the setup, and runs a quick demo based on your current project
Use Codebase Documenter to this skill should be used when writing documentation for codebases,...
Invokes Codebase Documenter with the right parameters and returns the result directly in the conversation
What can I do with Codebase Documenter in my documents & notes workflow?
Lists the top use cases for Codebase Documenter, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/codebase-documenter/ 目录(个人级,所有项目可用),或 .claude/skills/codebase-documenter/(项目级)。重启 AI 客户端后,用 /codebase-documenter 主动调用,或让 AI 根据上下文自动发现并使用。
Codebase Documenter 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Codebase Documenter 可免费安装使用。请查阅仓库了解许可证信息。
This skill should be used when writing documentation for codebases, including README files, architecture documentation, code comments, and API documentation. Use this skill when users request help documenting their code, creating getting-started guides, explaining project structure, or making codebases more accessible to new developers. The skill provides templates, best practices, and structured approaches for creating clear, beginner-friendly documentation.
Automate my documents & notes tasks using Codebase Documenter
Identifies repetitive steps in your workflow and sets up Codebase Documenter to handle them automatically
Codebase Documenter 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。