doc-claude-md
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClaude MD
Claude MD
Create and maintain CLAUDE.md and AGENTS.md documentation files.
创建并维护CLAUDE.md和AGENTS.md文档文件。
Workflow
工作流程
Creating New Docs
新建文档
For projects without CLAUDE.md/AGENTS.md:
bash
scripts/init_docs.py [--path <project>]This will:
- Analyze codebase (detect project type, extract info)
- Generate directory tree (using cli-tree skill)
- Create CLAUDE.md (pointer file)
- Create AGENTS.md (full documentation with frontmatter)
对于没有CLAUDE.md/AGENTS.md的项目:
bash
scripts/init_docs.py [--path <project>]该脚本将执行以下操作:
- 分析代码库(检测项目类型,提取信息)
- 生成目录树(使用cli-tree skill)
- 创建CLAUDE.md(指针文件)
- 创建AGENTS.md(包含前置元数据的完整文档)
Validating/Updating Existing Docs
验证/更新已有文档
For projects with existing documentation:
bash
scripts/validate_docs.py [--path <project>] [--fix]This will:
- Check structure (required sections present)
- Verify codebase consistency (paths exist, commands valid)
- Detect staleness (files changed since last validation)
- Apply fixes if flag provided
--fix - Update timestamp
last_validated
对于已有文档的项目:
bash
scripts/validate_docs.py [--path <project>] [--fix]该脚本将执行以下操作:
- 检查结构(确认必填章节存在)
- 验证代码库一致性(路径存在、命令有效)
- 检测过期内容(自上次验证后文件是否有变更)
- 如果指定了参数则自动修复问题
--fix - 更新时间戳
last_validated
Project Type Detection
项目类型检测
The init script auto-detects project type:
| Files Present | Detected Type |
|---|---|
| |
| |
| |
| |
| |
| |
Multiple | |
| Adds skills framework section |
初始化脚本会自动检测项目类型:
| 存在的文件 | 检测到的类型 |
|---|---|
包含react/next的 | |
包含express的 | |
其他 | |
| |
| |
| |
多个 | |
存在 | 额外添加技能框架章节 |
Generated Files
生成的文件
CLAUDE.md:
markdown
undefinedCLAUDE.md:
markdown
undefinedClaude Code Instructions
Claude Code Instructions
See @AGENTS.md for detailed instructions.
**AGENTS.md:**
```yaml
---
last_validated: 2026-01-21T12:00:00Z
project_type: nodejs-library
---See @AGENTS.md for detailed instructions.
**AGENTS.md:**
```yaml
---
last_validated: 2026-01-21T12:00:00Z
project_type: nodejs-library
---Agent Instructions: project-name
Agent Instructions: project-name
[Content based on template and codebase analysis]
undefined[Content based on template and codebase analysis]
undefinedValidation Checks
验证检查项
- Structure: Required sections exist
- Content: No TODO placeholders, valid links
- Consistency: Paths in docs exist, commands in package.json/pyproject.toml
- Freshness: Compares file modification dates vs last_validated
- 结构: 存在必填章节
- 内容: 无TODO占位符,链接有效
- 一致性: 文档中的路径真实存在,命令存在于package.json/pyproject.toml中
- 时效性: 对比文件修改时间与last_validated时间
Template
模板
See for the AGENTS.md template structure.
references/template.mdAGENTS.md的模板结构请参考。
references/template.md