sc-document
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocumentation Generation Skill
文档生成Skill
Focused documentation for code, APIs, and features.
针对代码、API和功能的专属文档。
Quick Start
快速开始
bash
undefinedbash
undefinedInline documentation
内联文档
/sc:document src/auth/login.js --type inline
/sc:document src/auth/login.js --type inline
API reference
API参考
/sc:document src/api --type api --style detailed
/sc:document src/api --type api --style detailed
User guide
用户指南
/sc:document payment-module --type guide
undefined/sc:document payment-module --type guide
undefinedBehavioral Flow
行为流程
- Analyze - Examine component structure and functionality
- Identify - Determine documentation requirements and audience
- Generate - Create appropriate documentation content
- Format - Apply consistent structure and patterns
- Integrate - Ensure compatibility with existing docs
- 分析 - 检查组件结构与功能
- 识别 - 确定文档需求与受众
- 生成 - 创建合适的文档内容
- 格式化 - 应用一致的结构与模式
- 集成 - 确保与现有文档兼容
Flags
标志
| Flag | Type | Default | Description |
|---|---|---|---|
| string | inline | inline, external, api, guide |
| string | detailed | brief, detailed |
| 标志 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | inline | inline, external, api, guide |
| string | detailed | brief, detailed |
Evidence Requirements
证据要求
This skill does NOT require hard evidence. Deliverables are:
- Generated documentation files
- Inline code comments
- API reference materials
本Skill无需硬性证据。交付成果包括:
- 生成的文档文件
- 内联代码注释
- API参考资料
Documentation Types
文档类型
Inline (--type inline
)
--type inline内联文档(--type inline
)
--type inline- JSDoc/docstring generation
- Parameter and return descriptions
- Function-level comments
- JSDoc/文档字符串生成
- 参数与返回值描述
- 函数级注释
External (--type external
)
--type external外部文档(--type external
)
--type external- Standalone documentation files
- Component overviews
- Integration guides
- 独立文档文件
- 组件概述
- 集成指南
API (--type api
)
--type apiAPI文档(--type api
)
--type api- Endpoint documentation
- Request/response schemas
- Usage examples
- 端点文档
- 请求/响应 schema
- 使用示例
Guide (--type guide
)
--type guide用户指南(--type guide
)
--type guide- User-focused tutorials
- Implementation patterns
- Common use cases
- 面向用户的教程
- 实现模式
- 常见用例
Style Options
风格选项
Brief (--style brief
)
--style brief简洁风格(--style brief
)
--style brief- Concise descriptions
- Essential information only
- Quick reference format
- 简洁描述
- 仅包含必要信息
- 快速参考格式
Detailed (--style detailed
)
--style detailed详细风格(--style detailed
)
--style detailed- Comprehensive explanations
- Extended examples
- Edge case coverage
- 全面解释
- 扩展示例
- 边缘场景覆盖
Examples
示例
Inline Code Docs
内联代码文档
/sc:document src/auth/login.js --type inline/sc:document src/auth/login.js --type inlineJSDoc with @param, @returns, @throws
包含@param、@returns、@throws的JSDoc
undefinedundefinedAPI Reference
API参考
/sc:document src/api --type api --style detailed/sc:document src/api --type api --style detailedFull endpoint docs with examples
带示例的完整端点文档
undefinedundefinedUser Guide
用户指南
/sc:document payment-module --type guide --style brief/sc:document payment-module --type guide --style briefQuick-start tutorial with common patterns
包含常见模式的快速入门教程
undefinedundefinedComponent Docs
组件文档
/sc:document components/ --type external/sc:document components/ --type externalREADME.md for component library
组件库的README.md
undefinedundefinedMCP Integration
MCP集成
PAL MCP (Quality & Research)
PAL MCP(质量与研究)
| Tool | When to Use | Purpose |
|---|---|---|
| API docs | Review documentation accuracy |
| External APIs | Get current API documentation |
| Writing assistance | Get help with complex explanations |
| Style decisions | Multi-model validation of doc approach |
| 工具 | 适用场景 | 用途 |
|---|---|---|
| API文档 | 审核文档准确性 |
| 外部API | 获取当前API文档 |
| 写作辅助 | 协助撰写复杂说明 |
| 风格决策 | 多模型验证文档方法 |
PAL Usage Patterns
PAL使用模式
bash
undefinedbash
undefinedVerify documentation accuracy
验证文档准确性
mcp__pal__codereview(
review_type="quick",
step="Reviewing API documentation for accuracy",
findings="Parameter descriptions, return types, examples",
relevant_files=["/docs/api/auth.md"]
)
mcp__pal__codereview(
review_type="quick",
step="Reviewing API documentation for accuracy",
findings="Parameter descriptions, return types, examples",
relevant_files=["/docs/api/auth.md"]
)
Get current API docs for external integration
获取外部集成的当前API文档
mcp__pal__apilookup(
prompt="Get current Stripe API documentation for payment intents"
)
mcp__pal__apilookup(
prompt="Get current Stripe API documentation for payment intents"
)
Writing assistance for complex topics
复杂主题的写作辅助
mcp__pal__chat(
prompt="Help me explain the OAuth2 authorization code flow clearly for developers",
model="gpt-5.2"
)
undefinedmcp__pal__chat(
prompt="Help me explain the OAuth2 authorization code flow clearly for developers",
model="gpt-5.2"
)
undefinedRube MCP (Publishing & Collaboration)
Rube MCP(发布与协作)
| Tool | When to Use | Purpose |
|---|---|---|
| Doc platforms | Find Notion, Confluence, GitBook |
| Publishing | Push docs to platforms |
| Bulk docs | Generate docs for large codebases |
| 工具 | 适用场景 | 用途 |
|---|---|---|
| 文档平台 | 查找Notion、Confluence、GitBook |
| 发布 | 将文档推送至平台 |
| 批量文档 | 为大型代码库生成文档 |
Rube Usage Patterns
Rube使用模式
bash
undefinedbash
undefinedPublish documentation
发布文档
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "NOTION_CREATE_PAGE", "arguments": {
"title": "API Reference: Authentication",
"content": "## Endpoints\n### POST /auth/login\n..."
}},
{"tool_slug": "CONFLUENCE_CREATE_PAGE", "arguments": {
"space": "DEV",
"title": "Auth API Documentation",
"content": "..."
}}
])
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "NOTION_CREATE_PAGE", "arguments": {
"title": "API Reference: Authentication",
"content": "## Endpoints\n### POST /auth/login\n..."
}},
{"tool_slug": "CONFLUENCE_CREATE_PAGE", "arguments": {
"space": "DEV",
"title": "Auth API Documentation",
"content": "..."
}}
])
Notify team of new docs
通知团队新文档发布
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
"channel": "#documentation",
"text": "New API docs published: Authentication endpoints"
}}
])
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
"channel": "#documentation",
"text": "New API docs published: Authentication endpoints"
}}
])
Bulk generate docs
批量生成文档
mcp__rube__RUBE_REMOTE_WORKBENCH(
thought="Generate JSDoc for all exported functions",
code_to_execute='''
import os
mcp__rube__RUBE_REMOTE_WORKBENCH(
thought="Generate JSDoc for all exported functions",
code_to_execute='''
import os
Process all JS files and generate documentation
Process all JS files and generate documentation
Use invoke_llm for each function
Use invoke_llm for each function
'''
)
undefined'''
)
undefinedFlags (Extended)
扩展标志
| Flag | Type | Default | Description |
|---|---|---|---|
| bool | false | Use PAL to review doc accuracy |
| string | - | Publish via Rube (notion, confluence, gitbook) |
| string | - | Notify via Rube (slack, teams, email) |
| 标志 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| bool | false | 使用PAL审核文档准确性 |
| string | - | 通过Rube发布至指定平台(notion, confluence, gitbook) |
| string | - | 通过Rube发送通知至指定渠道(slack, teams, email) |
Tool Coordination
工具协作
- Read - Component analysis
- Grep - Reference extraction
- Write - Documentation creation
- Glob - Multi-file documentation
- PAL MCP - Accuracy review, API lookup, writing assistance
- Rube MCP - Publishing, notifications, bulk generation
- 读取 - 组件分析
- Grep - 参考提取
- 写入 - 文档创建
- Glob - 多文件文档生成
- PAL MCP - 准确性审核、API查询、写作辅助
- Rube MCP - 发布、通知、批量生成