docs-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

docs-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

命令说明

CommandPurpose
/docs
Main entry - shows available subcommands
/docs-init
Create CLAUDE.md + README.md + docs/ structure
/docs-update
Audit and maintain all documentation
/docs-claude
Smart CLAUDE.md maintenance only
命令用途
/docs
主入口 - 显示可用的子命令
/docs-init
创建CLAUDE.md + README.md + docs/目录结构
/docs-update
审核并维护所有文档
/docs-claude
仅针对CLAUDE.md进行智能维护

Quick Start

快速开始

New Project

新项目

bash
undefined
bash
undefined

In 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
undefined
bash
undefined

Audit 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:
  • CLAUDE-cloudflare.md
    - Cloudflare Workers + Vite + D1 projects
  • CLAUDE-nextjs.md
    - Next.js App Router projects
  • CLAUDE-generic.md
    - Any other project type
为Claude Code提供的项目专属上下文,包括:
  • 项目概述与技术栈
  • 开发环境搭建命令
  • 架构概述
  • 关键文件位置
  • 常见任务与工作流
可用模板:
  • CLAUDE-cloudflare.md
    - Cloudflare Workers + Vite + D1项目
  • CLAUDE-nextjs.md
    - Next.js App Router项目
  • 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:
  • docs/ARCHITECTURE.md
    - System architecture
  • docs/API.md
    - API documentation
  • docs/DATABASE.md
    - Database schema

预搭建的文档结构:
  • docs/ARCHITECTURE.md
    - 系统架构文档
  • docs/API.md
    - API文档
  • docs/DATABASE.md
    - 数据库架构文档

Smart Maintenance

智能维护

/docs-claude Features

/docs-claude功能

The CLAUDE.md maintenance command checks:
  1. Tech Stack Match
    • Does CLAUDE.md list technologies that match package.json?
    • Are versions mentioned still accurate?
  2. Referenced Files
    • Do paths mentioned in CLAUDE.md still exist?
    • Are there new important files not mentioned?
  3. Section Freshness
    • Is "Last Updated" date recent?
    • Are there outdated patterns or commands?
  4. Critical Rules
    • For detected tech stack, are important rules present?
    • E.g., Cloudflare project should mention wrangler.jsonc patterns
CLAUDE.md维护命令会检查以下内容:
  1. 技术栈匹配度
    • CLAUDE.md中列出的技术是否与package.json一致?
    • 提及的版本是否仍然准确?
  2. 文件引用情况
    • CLAUDE.md中提及的路径是否仍然存在?
    • 是否有未被提及的新关键文件?
  3. 内容时效性
    • “最后更新时间”是否为近期?
    • 是否存在过时的模式或命令?
  4. 关键规则检查
    • 针对检测到的技术栈,是否包含重要规则?
    • 例如:Cloudflare项目应提及wrangler.jsonc相关配置模式

/docs-update Features

/docs-update功能

Full documentation audit including:
  1. Date Freshness
    • Compare doc dates against git history
    • Flag docs not updated in >30 days
  2. Version References
    • Check npm package versions mentioned
    • Suggest updates for outdated versions
  3. Broken Links
    • Verify internal markdown links
    • Check that referenced files exist
  4. Redundancy
    • Identify duplicate content across files
    • Suggest consolidation
  5. Orphaned Files
    • Find docs not referenced anywhere
    • Suggest archiving or deletion

完整的文档审核包括:
  1. 日期时效性
    • 将文档日期与Git历史记录对比
    • 标记超过30天未更新的文档
  2. 版本引用检查
    • 检查文档中提及的npm包版本
    • 建议更新过时的版本
  3. 无效链接检查
    • 验证内部Markdown链接
    • 检查引用的文件是否存在
  4. 内容冗余检查
    • 识别跨文件的重复内容
    • 建议合并内容
  5. 孤立文件检查
    • 查找未被任何地方引用的文档
    • 建议归档或删除

Project Type Detection

项目类型检测

The skill auto-detects project type by looking for:
IndicatorProject Type
wrangler.jsonc
or
wrangler.toml
Cloudflare Workers
next.config.js
or
next.config.ts
Next.js
NeitherGeneric
Additional indicators influence template content:
  • package.json
    dependencies (React, Vite, etc.)
  • Database config files (drizzle.config.ts, prisma/schema.prisma)
  • Auth config (clerk, better-auth)

本技能通过以下标识自动检测项目类型:
检测标识项目类型
wrangler.jsonc
wrangler.toml
Cloudflare Workers
next.config.js
next.config.ts
Next.js
以上都不是通用型
其他标识会影响模板内容:
  • package.json
    中的依赖(React、Vite等)
  • 数据库配置文件(drizzle.config.ts、prisma/schema.prisma)
  • 认证配置(clerk、better-auth)

Integration with Other Skills

与其他技能的集成

  • project-workflow: Use
    /docs-init
    after
    /plan-project
    to add documentation
  • project-planning: Generated
    IMPLEMENTATION_PHASES.md
    referenced in CLAUDE.md
  • cloudflare-worker-base: Cloudflare template includes Workers-specific patterns

  • project-workflow:在
    /plan-project
    后使用
    /docs-init
    添加文档
  • project-planning:生成的
    IMPLEMENTATION_PHASES.md
    会在CLAUDE.md中被引用
  • cloudflare-worker-base:Cloudflare模板包含Workers专属配置模式

Best Practices

最佳实践

When to Run Each Command

各命令的适用场景

SituationCommand
New project
/docs-init
After major changes
/docs-claude
Before release
/docs-update
Monthly maintenance
/docs-update
场景命令
新项目
/docs-init
重大变更后
/docs-claude
发布前
/docs-update
月度维护
/docs-update

CLAUDE.md Guidelines

CLAUDE.md编写指南

  1. Keep it current - Update "Last Updated" when making changes
  2. Focus on project-specific - Don't duplicate generic tech docs
  3. Include common tasks - Commands you run frequently
  4. Reference, don't duplicate - Link to docs/ for detailed content

  1. 保持更新 - 进行修改时更新“最后更新时间”
  2. 聚焦项目专属内容 - 不要重复通用技术文档
  3. 包含常见任务 - 记录您频繁使用的命令
  4. 引用而非重复 - 链接到docs/目录查看详细内容

Templates

模板位置

Templates are located in
templates/
within this skill:
templates/
├── CLAUDE-cloudflare.md    # Cloudflare Workers projects
├── CLAUDE-nextjs.md        # Next.js projects
├── CLAUDE-generic.md       # Generic projects
└── README-template.md      # Standard README
Templates use placeholders:
  • {{PROJECT_NAME}}
    - Detected from package.json or folder name
  • {{DATE}}
    - Current date
  • {{TECH_STACK}}
    - Detected technologies
模板位于本技能的
templates/
目录下:
templates/
├── CLAUDE-cloudflare.md    # Cloudflare Workers项目
├── CLAUDE-nextjs.md        # Next.js项目
├── CLAUDE-generic.md       # 通用型项目
└── README-template.md      # 标准README模板
模板使用占位符:
  • {{PROJECT_NAME}}
    - 从package.json或文件夹名称中检测
  • {{DATE}}
    - 当前日期
  • {{TECH_STACK}}
    - 检测到的技术栈