docs-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedocs-workflow
文档工作流
Last Updated: 2026-01-11
Purpose: Manage project documentation throughout its lifecycle
最后更新时间:2026-01-11
用途:在项目全生命周期内管理文档
Overview
概述
This skill helps you:
- Initialize documentation for new projects (CLAUDE.md, README.md, docs/)
- Maintain CLAUDE.md to match actual project state
- Audit all docs for staleness, broken links, outdated versions
本技能可帮助您:
- 初始化新项目的文档(CLAUDE.md、README.md、docs/目录)
- 维护CLAUDE.md使其与项目实际状态保持一致
- 审核所有文档是否过时、存在无效链接或版本陈旧
Commands
命令说明
| Command | Purpose |
|---|---|
| Main entry - shows available subcommands |
| Create CLAUDE.md + README.md + docs/ structure |
| Audit and maintain all documentation |
| Smart CLAUDE.md maintenance only |
| 命令 | 用途 |
|---|---|
| 主入口 - 显示可用的子命令 |
| 创建CLAUDE.md + README.md + docs/目录结构 |
| 审核并维护所有文档 |
| 仅针对CLAUDE.md进行智能维护 |
Quick Start
快速开始
New Project
新项目
bash
undefinedbash
undefinedIn a new project directory
In a new project directory
/docs-init
This will:
1. Detect project type (Cloudflare Workers, Next.js, generic)
2. Create CLAUDE.md from appropriate template
3. Create README.md if missing
4. Optionally scaffold docs/ directory/docs-init
这将:
1. 检测项目类型(Cloudflare Workers、Next.js、通用型)
2. 从合适的模板创建CLAUDE.md
3. 若缺失则创建README.md
4. 可选地搭建docs/目录结构Existing Project
已有项目
bash
undefinedbash
undefinedAudit all documentation
审核所有文档
/docs-update
/docs-update
Or just maintain CLAUDE.md
或仅维护CLAUDE.md
/docs-claude
---/docs-claude
---What Gets Created
创建的内容
CLAUDE.md
CLAUDE.md
Project-specific context for Claude Code, including:
- Project overview and tech stack
- Development setup commands
- Architecture overview
- Key file locations
- Common tasks and workflows
Templates available:
- - Cloudflare Workers + Vite + D1 projects
CLAUDE-cloudflare.md - - Next.js App Router projects
CLAUDE-nextjs.md - - Any other project type
CLAUDE-generic.md
为Claude Code提供的项目专属上下文,包括:
- 项目概述与技术栈
- 开发环境搭建命令
- 架构概述
- 关键文件位置
- 常见任务与工作流
可用模板:
- - Cloudflare Workers + Vite + D1项目
CLAUDE-cloudflare.md - - Next.js App Router项目
CLAUDE-nextjs.md - - 其他类型项目
CLAUDE-generic.md
README.md
README.md
Standard README with:
- Project name and description
- Installation/setup instructions
- Usage examples
- Configuration
- Contributing guidelines
标准README包含:
- 项目名称与描述
- 安装/设置说明
- 使用示例
- 配置说明
- 贡献指南
docs/ Directory (Optional)
docs/目录(可选)
Scaffolded documentation structure:
- - System architecture
docs/ARCHITECTURE.md - - API documentation
docs/API.md - - Database schema
docs/DATABASE.md
预搭建的文档结构:
- - 系统架构文档
docs/ARCHITECTURE.md - - API文档
docs/API.md - - 数据库架构文档
docs/DATABASE.md
Smart Maintenance
智能维护
/docs-claude Features
/docs-claude功能
The CLAUDE.md maintenance command checks:
-
Tech Stack Match
- Does CLAUDE.md list technologies that match package.json?
- Are versions mentioned still accurate?
-
Referenced Files
- Do paths mentioned in CLAUDE.md still exist?
- Are there new important files not mentioned?
-
Section Freshness
- Is "Last Updated" date recent?
- Are there outdated patterns or commands?
-
Critical Rules
- For detected tech stack, are important rules present?
- E.g., Cloudflare project should mention wrangler.jsonc patterns
CLAUDE.md维护命令会检查以下内容:
-
技术栈匹配度
- CLAUDE.md中列出的技术是否与package.json一致?
- 提及的版本是否仍然准确?
-
文件引用情况
- CLAUDE.md中提及的路径是否仍然存在?
- 是否有未被提及的新关键文件?
-
内容时效性
- “最后更新时间”是否为近期?
- 是否存在过时的模式或命令?
-
关键规则检查
- 针对检测到的技术栈,是否包含重要规则?
- 例如:Cloudflare项目应提及wrangler.jsonc相关配置模式
/docs-update Features
/docs-update功能
Full documentation audit including:
-
Date Freshness
- Compare doc dates against git history
- Flag docs not updated in >30 days
-
Version References
- Check npm package versions mentioned
- Suggest updates for outdated versions
-
Broken Links
- Verify internal markdown links
- Check that referenced files exist
-
Redundancy
- Identify duplicate content across files
- Suggest consolidation
-
Orphaned Files
- Find docs not referenced anywhere
- Suggest archiving or deletion
完整的文档审核包括:
-
日期时效性
- 将文档日期与Git历史记录对比
- 标记超过30天未更新的文档
-
版本引用检查
- 检查文档中提及的npm包版本
- 建议更新过时的版本
-
无效链接检查
- 验证内部Markdown链接
- 检查引用的文件是否存在
-
内容冗余检查
- 识别跨文件的重复内容
- 建议合并内容
-
孤立文件检查
- 查找未被任何地方引用的文档
- 建议归档或删除
Project Type Detection
项目类型检测
The skill auto-detects project type by looking for:
| Indicator | Project Type |
|---|---|
| Cloudflare Workers |
| Next.js |
| Neither | Generic |
Additional indicators influence template content:
- dependencies (React, Vite, etc.)
package.json - Database config files (drizzle.config.ts, prisma/schema.prisma)
- Auth config (clerk, better-auth)
本技能通过以下标识自动检测项目类型:
| 检测标识 | 项目类型 |
|---|---|
| Cloudflare Workers |
| Next.js |
| 以上都不是 | 通用型 |
其他标识会影响模板内容:
- 中的依赖(React、Vite等)
package.json - 数据库配置文件(drizzle.config.ts、prisma/schema.prisma)
- 认证配置(clerk、better-auth)
Integration with Other Skills
与其他技能的集成
- project-workflow: Use after
/docs-initto add documentation/plan-project - project-planning: Generated referenced in CLAUDE.md
IMPLEMENTATION_PHASES.md - cloudflare-worker-base: Cloudflare template includes Workers-specific patterns
- project-workflow:在后使用
/plan-project添加文档/docs-init - project-planning:生成的会在CLAUDE.md中被引用
IMPLEMENTATION_PHASES.md - cloudflare-worker-base:Cloudflare模板包含Workers专属配置模式
Best Practices
最佳实践
When to Run Each Command
各命令的适用场景
| Situation | Command |
|---|---|
| New project | |
| After major changes | |
| Before release | |
| Monthly maintenance | |
| 场景 | 命令 |
|---|---|
| 新项目 | |
| 重大变更后 | |
| 发布前 | |
| 月度维护 | |
CLAUDE.md Guidelines
CLAUDE.md编写指南
- Keep it current - Update "Last Updated" when making changes
- Focus on project-specific - Don't duplicate generic tech docs
- Include common tasks - Commands you run frequently
- Reference, don't duplicate - Link to docs/ for detailed content
- 保持更新 - 进行修改时更新“最后更新时间”
- 聚焦项目专属内容 - 不要重复通用技术文档
- 包含常见任务 - 记录您频繁使用的命令
- 引用而非重复 - 链接到docs/目录查看详细内容
Templates
模板位置
Templates are located in within this skill:
templates/templates/
├── CLAUDE-cloudflare.md # Cloudflare Workers projects
├── CLAUDE-nextjs.md # Next.js projects
├── CLAUDE-generic.md # Generic projects
└── README-template.md # Standard READMETemplates use placeholders:
- - Detected from package.json or folder name
{{PROJECT_NAME}} - - Current date
{{DATE}} - - Detected technologies
{{TECH_STACK}}
模板位于本技能的目录下:
templates/templates/
├── CLAUDE-cloudflare.md # Cloudflare Workers项目
├── CLAUDE-nextjs.md # Next.js项目
├── CLAUDE-generic.md # 通用型项目
└── README-template.md # 标准README模板模板使用占位符:
- - 从package.json或文件夹名称中检测
{{PROJECT_NAME}} - - 当前日期
{{DATE}} - - 检测到的技术栈
{{TECH_STACK}}