doc-claude-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Claude 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:
  1. Analyze codebase (detect project type, extract info)
  2. Generate directory tree (using cli-tree skill)
  3. Create CLAUDE.md (pointer file)
  4. Create AGENTS.md (full documentation with frontmatter)
对于没有CLAUDE.md/AGENTS.md的项目:
bash
scripts/init_docs.py [--path <project>]
该脚本将执行以下操作:
  1. 分析代码库(检测项目类型,提取信息)
  2. 生成目录树(使用cli-tree skill)
  3. 创建CLAUDE.md(指针文件)
  4. 创建AGENTS.md(包含前置元数据的完整文档)

Validating/Updating Existing Docs

验证/更新已有文档

For projects with existing documentation:
bash
scripts/validate_docs.py [--path <project>] [--fix]
This will:
  1. Check structure (required sections present)
  2. Verify codebase consistency (paths exist, commands valid)
  3. Detect staleness (files changed since last validation)
  4. Apply fixes if
    --fix
    flag provided
  5. Update
    last_validated
    timestamp
对于已有文档的项目:
bash
scripts/validate_docs.py [--path <project>] [--fix]
该脚本将执行以下操作:
  1. 检查结构(确认必填章节存在)
  2. 验证代码库一致性(路径存在、命令有效)
  3. 检测过期内容(自上次验证后文件是否有变更)
  4. 如果指定了
    --fix
    参数则自动修复问题
  5. 更新
    last_validated
    时间戳

Project Type Detection

项目类型检测

The init script auto-detects project type:
Files PresentDetected Type
package.json
with react/next
nodejs-react
package.json
with express
nodejs-api
package.json
(other)
nodejs-library
pyproject.toml
/
setup.py
python
Cargo.toml
rust
go.mod
go
Multiple
package.json
monorepo
.claude/skills/
present
Adds skills framework section
初始化脚本会自动检测项目类型:
存在的文件检测到的类型
包含react/next的
package.json
nodejs-react
包含express的
package.json
nodejs-api
其他
package.json
nodejs-library
pyproject.toml
/
setup.py
python
Cargo.toml
rust
go.mod
go
多个
package.json
monorepo
存在
.claude/skills/
目录
额外添加技能框架章节

Generated Files

生成的文件

CLAUDE.md:
markdown
undefined
CLAUDE.md:
markdown
undefined

Claude 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]
undefined

Validation Checks

验证检查项

  1. Structure: Required sections exist
  2. Content: No TODO placeholders, valid links
  3. Consistency: Paths in docs exist, commands in package.json/pyproject.toml
  4. Freshness: Compares file modification dates vs last_validated
  1. 结构: 存在必填章节
  2. 内容: 无TODO占位符,链接有效
  3. 一致性: 文档中的路径真实存在,命令存在于package.json/pyproject.toml中
  4. 时效性: 对比文件修改时间与last_validated时间

Template

模板

See
references/template.md
for the AGENTS.md template structure.
AGENTS.md的模板结构请参考
references/template.md