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
命令参数
| Flag | Short | Description |
|---|---|---|
| | Show available commands and options |
| | Show workflow skills version |
| 参数 | 短参数 | 描述 |
|---|---|---|
| | 显示可用命令和选项 |
| | 显示工作流技能版本 |
Flag Handling
参数处理
On or :
-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}On or :
Display:
-v--versionWorkflow 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--versionWorkflow Skills v1.4.1
https://github.com/eljun/claude-skillsWhen to Use
何时使用
Invoke when:
/document {ID}- Task has passed testing (returned PASS)
/test - User has approved the implementation
- Ready to update project documentation
Example: or
/document 1/document 001-dashboard-redesign当满足以下条件时调用 :
/document {ID}- 任务已通过测试(返回 PASS)
/test - 用户已审核通过实现方案
- 准备更新项目文档
示例: 或
/document 1/document 001-dashboard-redesignTask ID Resolution
任务ID解析规则
The can be:
{ID}- Numeric ID: ,
1,2→ Looks up in TASKS.md, finds matching task document3 - Padded ID: ,
001→ Same as numeric002 - Full filename: → Direct file reference
001-dashboard-redesign
{ID}- 数字ID: ,
1,2→ 在 TASKS.md 中查找匹配的任务文档3 - 补零ID: ,
001→ 与数字ID规则一致002 - 完整文件名: → 直接引用对应文件
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 /shipAuto Mode Behavior
自动模式行为
When task document has :
Automation: autoAfter 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 & verificationIMPORTANT — Context Efficiency:
These two documents were created by the , , and 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.
/task/implement/test读取以下文件 — 它们包含你需要的所有上下文信息:
docs/task/{ID}-{task-name}.md - Implementation details
docs/testing/{ID}-{task-name}.md - Test results & verification重要提示 — 上下文效率:
这两份文档是由 、 和 Agent生成的,它们已经分析过代码库。请勿进行大范围的代码库探索。仅当你需要验证实现细节以保证文档准确性时,才读取特定的源文件。
/task/implement/test2. Identify Documentation Needs
2. 确认文档需求
| Change Type | Documentation Needed |
|---|---|
| New feature | Feature doc + User guide |
| Enhancement | Update existing docs |
| Bug fix | Update troubleshooting sections |
| API change | Update 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:
Audience: Developers
Purpose: Technical implementation details
docs/features/{FEATURE}.mdWhen 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:
Audience: End users (business owners, customers)
Purpose: How to use the feature
docs/guides/{feature}.mdWhen 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:
- - Root project instructions
/CLAUDE.md
When to update:
- New patterns discovered
- New "Do Not" rules
- Bug fix patterns
- Tech stack changes
存储位置:
- - 根项目说明
/CLAUDE.md
更新时机:
- 发现新的模式
- 新增「禁止」规则
- Bug修复模式
- 技术栈变更
Feature Documentation Structure
功能文档结构
markdown
undefinedmarkdown
undefinedFeature: {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
- Step 1
- Step 2
- Step 1
- Step 2
For Business Owners
For Business Owners
- Step 1
- Step 2
- Step 1
- 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
| Method | Endpoint | Description |
|---|
| Method | Endpoint | Description |
|---|
Implementation Details
Implementation Details
Key Components
Key Components
| Component | Location | Purpose |
|---|
| Component | Location | Purpose |
|---|
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
undefinedmarkdown
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}
- Step with context
- Step with context
- Step with context
- 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}
- Step with context
- Step with context
Settings
Settings
| Setting | Location | What it does |
|---|
| Setting | Location | What 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
undefinedApproved
Approved
| ID | Task | Task Doc | Feature Doc | Test Report | Approved |
|---|---|---|---|---|---|
| 1 | Quick Actions Redesign | 001-quick-actions.md | feature | 001-quick-actions.md | Jan 25 |
---| ID | Task | Task Doc | Feature Doc | Test Report | Approved |
|---|---|---|---|---|---|
| 1 | Quick Actions Redesign | 001-quick-actions.md | feature | 001-quick-actions.md | Jan 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
应排除的内容
| Remove | Why |
|---|---|
| Development logs | Move to changelogs |
| Before/after comparisons | Only document current state |
| "Lessons learned" | Dev notes, not docs |
| Speculative future phases | Keep minimal |
| Full component code | Code lives in codebase |
| 移除内容 | 原因 |
|---|---|
| 开发日志 | 移动到变更日志 |
| 前后对比 | 仅记录当前状态 |
| 「经验总结」 | 属于开发笔记,不属于正式文档 |
| 未来规划推测 | 尽量少提及 |
| 完整组件代码 | 代码存放在代码库中 |
Handoff to /ship
交接给 /ship 命令
Check the task document for field.
Automation: auto检查任务文档中的 字段。
Automation: autoManual 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-jwtDocumentation 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-jwtAuto 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
相关技能
| Skill | When to Use |
|---|---|
| If issues found during doc review |
| After documentation complete |
| 技能 | 使用时机 |
|---|---|
| 文档审核过程中发现问题时 |
| 文档生成完成后 |
Recommended Plugins (Install Separately)
推荐插件(需单独安装)
These plugins must be installed separately. Once installed, they MUST be invoked — do not skip them:
| Plugin | Install From | When to Invoke |
|---|---|---|
| vercel-labs/agent-skills | Reference React patterns for docs |
| supabase/agent-skills | Reference database patterns for docs |
这些插件必须单独安装。安装完成后必须调用 — 请勿跳过:
| 插件 | 安装地址 | 调用时机 |
|---|---|---|
| vercel-labs/agent-skills | 文档中参考React模式时 |
| supabase/agent-skills | 文档中参考数据库模式时 |