document

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/document - Documentation Agent

/document - 文档Agent

Model: haiku (templated documentation work)
模型: haiku(用于模板化文档工作)

Command Flags

命令参数

FlagShortDescription
--help
-h
Show available commands and options
--version
-v
Show workflow skills version
参数短参数描述
--help
-h
显示可用命令和选项
--version
-v
显示工作流技能版本

Flag Handling

参数处理

On
-h
or
--help
:
/document - Documentation Agent

Usage:
  /document {ID}                     Update docs for a task
  /document -h, --help               Show this help message
  /document -v, --version            Show version

Arguments:
  {ID}    Task ID (number) or task filename (e.g., 001-auth-jwt)

Creates/Updates:
  - docs/features/{feature}.md       Technical documentation
  - docs/guides/{feature}.md         User guides (if user-facing)
  - CLAUDE.md                        Project patterns (if needed)

Examples:
  /document 1                        # Document task #1
  /document 001-auth-jwt             # Using task filename

Next: /ship {ID}
On
-v
or
--version
:
Display:
Workflow Skills v1.4.1
https://github.com/eljun/claude-skills

当传入
-h
--help
时:
/document - Documentation Agent

Usage:
  /document {ID}                     Update docs for a task
  /document -h, --help               Show this help message
  /document -v, --version            Show version

Arguments:
  {ID}    Task ID (number) or task filename (e.g., 001-auth-jwt)

Creates/Updates:
  - docs/features/{feature}.md       Technical documentation
  - docs/guides/{feature}.md         User guides (if user-facing)
  - CLAUDE.md                        Project patterns (if needed)

Examples:
  /document 1                        # Document task #1
  /document 001-auth-jwt             # Using task filename

Next: /ship {ID}
当传入
-v
--version
时:
输出内容:
Workflow Skills v1.4.1
https://github.com/eljun/claude-skills

When to Use

何时使用

Invoke
/document {ID}
when:
  • Task has passed testing (
    /test
    returned PASS)
  • User has approved the implementation
  • Ready to update project documentation
Example:
/document 1
or
/document 001-dashboard-redesign
当满足以下条件时调用
/document {ID}
  • 任务已通过测试(
    /test
    返回 PASS)
  • 用户已审核通过实现方案
  • 准备更新项目文档
示例:
/document 1
/document 001-dashboard-redesign

Task ID Resolution

任务ID解析规则

The
{ID}
can be:
  • Numeric ID:
    1
    ,
    2
    ,
    3
    → Looks up in TASKS.md, finds matching task document
  • Padded ID:
    001
    ,
    002
    → Same as numeric
  • Full filename:
    001-dashboard-redesign
    → Direct file reference
{ID}
可以是:
  • 数字ID:
    1
    ,
    2
    ,
    3
    → 在 TASKS.md 中查找匹配的任务文档
  • 补零ID:
    001
    ,
    002
    → 与数字ID规则一致
  • 完整文件名:
    001-dashboard-redesign
    → 直接引用对应文件

Workflow

工作流程

/document {ID}
1. Resolve task ID → find task document
2. Read task document for context
3. Check Automation field (manual | auto)
4. Read test report for verification
5. Update/create feature documentation
6. Update/create user guide (if user-facing)
7. Update CLAUDE.md files if needed
8. Move task to "Approved" in TASKS.md
┌─── Automation Mode? ───┐
│                        │
▼ Manual                 ▼ Auto
Notify user              Invoke /ship {ID}
Ready for /ship
/document {ID}
1. Resolve task ID → find task document
2. Read task document for context
3. Check Automation field (manual | auto)
4. Read test report for verification
5. Update/create feature documentation
6. Update/create user guide (if user-facing)
7. Update CLAUDE.md files if needed
8. Move task to "Approved" in TASKS.md
┌─── Automation Mode? ───┐
│                        │
▼ Manual                 ▼ Auto
Notify user              Invoke /ship {ID}
Ready for /ship

Auto Mode Behavior

自动模式行为

When task document has
Automation: auto
:
After documentation is complete, use Task tool to spawn ship agent with model: haiku:
Documentation complete: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md
- docs/guides/{feature}.md

[AUTO] Spawning /ship with haiku model...
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/ship {ID}" })
当任务文档中包含
Automation: auto
时:
文档生成完成后,使用Task工具调用haiku模型启动ship Agent:
Documentation complete: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md
- docs/guides/{feature}.md

[AUTO] Spawning /ship with haiku model...
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/ship {ID}" })

Pre-Documentation Checklist

文档生成前检查清单

1. Gather Context (Primary Sources Only)

1. 收集上下文(仅使用核心来源)

Read these files — they contain all the context you need:
docs/task/{ID}-{task-name}.md        - Implementation details
docs/testing/{ID}-{task-name}.md     - Test results & verification
IMPORTANT — Context Efficiency: These two documents were created by the
/task
,
/implement
, and
/test
agents which already analyzed the codebase. Do NOT perform broad codebase exploration. Only read specific source files if you need to verify implementation details for documentation accuracy.
读取以下文件 — 它们包含你需要的所有上下文信息:
docs/task/{ID}-{task-name}.md        - Implementation details
docs/testing/{ID}-{task-name}.md     - Test results & verification
重要提示 — 上下文效率: 这两份文档是由
/task
/implement
/test
Agent生成的,它们已经分析过代码库。请勿进行大范围的代码库探索。仅当你需要验证实现细节以保证文档准确性时,才读取特定的源文件。

2. Identify Documentation Needs

2. 确认文档需求

Change TypeDocumentation Needed
New featureFeature doc + User guide
EnhancementUpdate existing docs
Bug fixUpdate troubleshooting sections
API changeUpdate API reference
变更类型需要的文档
新功能功能文档 + 用户指南
功能增强更新现有文档
Bug修复更新故障排查章节
API变更更新API参考文档

3. Use Templates

3. 使用模板

Follow the templates defined in this document:
  • Feature Documentation Structure - Technical feature docs (see below)
  • User Guide Structure - User-facing guides (see below)

遵循本文档中定义的模板:
  • 功能文档结构 - 技术功能文档(见下文)
  • 用户指南结构 - 面向用户的指南(见下文)

Documentation Types

文档类型

1. Feature Documentation

1. 功能文档

Location:
docs/features/{FEATURE}.md
Audience: Developers Purpose: Technical implementation details
When to create/update:
  • New feature → Create new doc
  • Enhancement → Update existing doc
  • Significant change → Update relevant sections
存储位置:
docs/features/{FEATURE}.md
面向受众: 开发者 用途: 技术实现细节
创建/更新时机:
  • 新功能 → 创建新文档
  • 功能增强 → 更新现有文档
  • 重大变更 → 更新相关章节

2. User Guide

2. 用户指南

Location:
docs/guides/{feature}.md
Audience: End users (business owners, customers) Purpose: How to use the feature
When to create/update:
  • User-facing feature → Create/update guide
  • UI changes → Update screenshots/steps
  • New functionality → Add new sections
存储位置:
docs/guides/{feature}.md
面向受众: 终端用户(业务负责人、客户) 用途: 如何使用该功能
创建/更新时机:
  • 面向用户的功能 → 创建/更新指南
  • UI变更 → 更新截图/操作步骤
  • 新增功能 → 添加新章节

3. CLAUDE.md Files

3. CLAUDE.md 文件

Locations:
  • /CLAUDE.md
    - Root project instructions
When to update:
  • New patterns discovered
  • New "Do Not" rules
  • Bug fix patterns
  • Tech stack changes

存储位置:
  • /CLAUDE.md
    - 根项目说明
更新时机:
  • 发现新的模式
  • 新增「禁止」规则
  • Bug修复模式
  • 技术栈变更

Feature Documentation Structure

功能文档结构

markdown
undefined
markdown
undefined

Feature: {Feature Name}

Feature: {Feature Name}

Status: PRODUCTION Last Updated: {Date}
Status: PRODUCTION Last Updated: {Date}

Overview

Overview

{Brief 2-3 sentence description}

{Brief 2-3 sentence description}

User Journey

User Journey

For Customers

For Customers

  1. Step 1
  2. Step 2
  1. Step 1
  2. Step 2

For Business Owners

For Business Owners

  1. Step 1
  2. Step 2

  1. Step 1
  2. Step 2

Architecture

Architecture

File Structure

File Structure

{Accurate file tree - VERIFY paths exist}
{Accurate file tree - VERIFY paths exist}

Database Schema

Database Schema

{SQL with comments, if applicable}
{SQL with comments, if applicable}

API Endpoints

API Endpoints

MethodEndpointDescription

MethodEndpointDescription

Implementation Details

Implementation Details

Key Components

Key Components

ComponentLocationPurpose
ComponentLocationPurpose

Technical Notes

Technical Notes

  • Important detail 1
  • Important detail 2

  • Important detail 1
  • Important detail 2

Related Features

Related Features

  • [Link to related feature]

**Target length:** 200-400 lines

---
  • [Link to related feature]

**目标长度:** 200-400行

---

User Guide Structure

用户指南结构

markdown
undefined
markdown
undefined

{Feature Name} Guide

{Feature Name} Guide

{Brief intro sentence}
{Brief intro sentence}

Quick Start

Quick Start

{1-2 paragraph overview}

{1-2 paragraph overview}

For Customers

For Customers

How to {Primary Action}

How to {Primary Action}

  1. Step with context
  2. Step with context
  1. Step with context
  2. Step with context

Tips

Tips

  • Tip 1
  • Tip 2

  • Tip 1
  • Tip 2

For Business Owners

For Business Owners

How to {Admin Action}

How to {Admin Action}

  1. Step with context
  1. Step with context

Settings

Settings

SettingLocationWhat it does

SettingLocationWhat it does

FAQ

FAQ

Q: Question? A: Answer.

Q: Question? A: Answer.

Troubleshooting

Troubleshooting

Issue: Description Solution: How to fix

Issue: Description Solution: How to fix

Related Guides

Related Guides

  • [Link]

**Target length:** 100-200 lines

---
  • [Link]

**目标长度:** 100-200行

---

Documentation Checklist

文档检查清单

Feature Doc

功能文档

  • Follows template structure
  • File paths verified to exist
  • API endpoints are accurate
  • Schema matches database
  • Status set to PRODUCTION
  • Last Updated date set
  • Under 400 lines
  • 遵循模板结构
  • 已验证文件路径真实存在
  • API端点准确无误
  • 数据库 schema 与实际一致
  • 状态设置为 PRODUCTION
  • 已填写最后更新日期
  • 不超过400行

User Guide

用户指南

  • Follows template structure
  • Clear step-by-step instructions
  • FAQ answers common questions
  • Troubleshooting section included
  • Under 200 lines
  • 遵循模板结构
  • 清晰的分步操作说明
  • FAQ解答常见问题
  • 包含故障排查章节
  • 不超过200行

CLAUDE.md Updates

CLAUDE.md 更新

  • New patterns added to relevant file
  • "Do Not" rules added if mistakes were made
  • Tech stack updated if dependencies changed

  • 新模式已添加到对应文件
  • 如果出现过错误,已添加「禁止」规则
  • 如果依赖变更,已更新技术栈说明

Update TASKS.md

更新 TASKS.md

Move task to "Approved" section:
markdown
undefined
将任务移动到「已审核」章节:
markdown
undefined

Approved

Approved

IDTaskTask DocFeature DocTest ReportApproved
1Quick Actions Redesign001-quick-actions.mdfeature001-quick-actions.mdJan 25

---
IDTaskTask DocFeature DocTest ReportApproved
1Quick Actions Redesign001-quick-actions.mdfeature001-quick-actions.mdJan 25

---

What to Include

应包含的内容

  • Current state only - Document what exists now
  • Accurate file paths - Verify paths exist
  • Working examples - Only code that matches production
  • Clear user journeys - What users actually do
  • 仅包含当前状态 - 记录当前实际存在的内容
  • 准确的文件路径 - 验证路径真实存在
  • 可运行的示例 - 仅使用与生产环境一致的代码
  • 清晰的用户旅程 - 用户实际的操作流程

What to Exclude

应排除的内容

RemoveWhy
Development logsMove to changelogs
Before/after comparisonsOnly document current state
"Lessons learned"Dev notes, not docs
Speculative future phasesKeep minimal
Full component codeCode lives in codebase

移除内容原因
开发日志移动到变更日志
前后对比仅记录当前状态
「经验总结」属于开发笔记,不属于正式文档
未来规划推测尽量少提及
完整组件代码代码存放在代码库中

Handoff to /ship

交接给 /ship 命令

Check the task document for
Automation: auto
field.
检查任务文档中的
Automation: auto
字段。

Manual Mode

手动模式

Documentation updated for: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md (created/updated)
- docs/guides/{feature}.md (created/updated)
- CLAUDE.md (if updated)

Task moved to "Approved" in TASKS.md

Next Steps:
  /ship {ID}              # e.g., /ship 1
  /ship {ID}-{task-name}  # e.g., /ship 001-auth-jwt
Documentation updated for: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md (created/updated)
- docs/guides/{feature}.md (created/updated)
- CLAUDE.md (if updated)

Task moved to "Approved" in TASKS.md

Next Steps:
  /ship {ID}              # e.g., /ship 1
  /ship {ID}-{task-name}  # e.g., /ship 001-auth-jwt

Auto Mode

自动模式

Documentation updated for: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md (created/updated)
- docs/guides/{feature}.md (created/updated)
- CLAUDE.md (if updated)

Task moved to "Approved" in TASKS.md

[AUTO] Spawning /ship with haiku model...
Use Task tool:
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/ship {ID}" })

Documentation updated for: #{ID} - {Task Title}

Updated files:
- docs/features/{feature}.md (created/updated)
- docs/guides/{feature}.md (created/updated)
- CLAUDE.md (if updated)

Task moved to "Approved" in TASKS.md

[AUTO] Spawning /ship with haiku model...
使用Task工具:
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/ship {ID}" })

Related Skills

相关技能

SkillWhen to Use
/implement
If issues found during doc review
/ship
After documentation complete
技能使用时机
/implement
文档审核过程中发现问题时
/ship
文档生成完成后

Recommended Plugins (Install Separately)

推荐插件(需单独安装)

These plugins must be installed separately. Once installed, they MUST be invoked — do not skip them:
PluginInstall FromWhen to Invoke
vercel-react-best-practices
vercel-labs/agent-skillsReference React patterns for docs
supabase-postgres-best-practices
supabase/agent-skillsReference database patterns for docs
这些插件必须单独安装。安装完成后必须调用 — 请勿跳过:
插件安装地址调用时机
vercel-react-best-practices
vercel-labs/agent-skills文档中参考React模式时
supabase-postgres-best-practices
supabase/agent-skills文档中参考数据库模式时