sc-document

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Documentation Generation Skill

文档生成Skill

Focused documentation for code, APIs, and features.
针对代码、API和功能的专属文档。

Quick Start

快速开始

bash
undefined
bash
undefined

Inline 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
undefined

Behavioral Flow

行为流程

  1. Analyze - Examine component structure and functionality
  2. Identify - Determine documentation requirements and audience
  3. Generate - Create appropriate documentation content
  4. Format - Apply consistent structure and patterns
  5. Integrate - Ensure compatibility with existing docs
  1. 分析 - 检查组件结构与功能
  2. 识别 - 确定文档需求与受众
  3. 生成 - 创建合适的文档内容
  4. 格式化 - 应用一致的结构与模式
  5. 集成 - 确保与现有文档兼容

Flags

标志

FlagTypeDefaultDescription
--type
stringinlineinline, external, api, guide
--style
stringdetailedbrief, detailed
标志类型默认值描述
--type
stringinlineinline, external, api, guide
--style
stringdetailedbrief, 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

  • JSDoc/docstring generation
  • Parameter and return descriptions
  • Function-level comments
  • JSDoc/文档字符串生成
  • 参数与返回值描述
  • 函数级注释

External (
--type external
)

外部文档(
--type external

  • Standalone documentation files
  • Component overviews
  • Integration guides
  • 独立文档文件
  • 组件概述
  • 集成指南

API (
--type api
)

API文档(
--type api

  • Endpoint documentation
  • Request/response schemas
  • Usage examples
  • 端点文档
  • 请求/响应 schema
  • 使用示例

Guide (
--type guide
)

用户指南(
--type guide

  • User-focused tutorials
  • Implementation patterns
  • Common use cases
  • 面向用户的教程
  • 实现模式
  • 常见用例

Style Options

风格选项

Brief (
--style brief
)

简洁风格(
--style brief

  • Concise descriptions
  • Essential information only
  • Quick reference format
  • 简洁描述
  • 仅包含必要信息
  • 快速参考格式

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 inline

JSDoc with @param, @returns, @throws

包含@param、@returns、@throws的JSDoc

undefined
undefined

API Reference

API参考

/sc:document src/api --type api --style detailed
/sc:document src/api --type api --style detailed

Full endpoint docs with examples

带示例的完整端点文档

undefined
undefined

User Guide

用户指南

/sc:document payment-module --type guide --style brief
/sc:document payment-module --type guide --style brief

Quick-start tutorial with common patterns

包含常见模式的快速入门教程

undefined
undefined

Component Docs

组件文档

/sc:document components/ --type external
/sc:document components/ --type external

README.md for component library

组件库的README.md

undefined
undefined

MCP Integration

MCP集成

PAL MCP (Quality & Research)

PAL MCP(质量与研究)

ToolWhen to UsePurpose
mcp__pal__codereview
API docsReview documentation accuracy
mcp__pal__apilookup
External APIsGet current API documentation
mcp__pal__chat
Writing assistanceGet help with complex explanations
mcp__pal__consensus
Style decisionsMulti-model validation of doc approach
工具适用场景用途
mcp__pal__codereview
API文档审核文档准确性
mcp__pal__apilookup
外部API获取当前API文档
mcp__pal__chat
写作辅助协助撰写复杂说明
mcp__pal__consensus
风格决策多模型验证文档方法

PAL Usage Patterns

PAL使用模式

bash
undefined
bash
undefined

Verify 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" )
undefined
mcp__pal__chat( prompt="Help me explain the OAuth2 authorization code flow clearly for developers", model="gpt-5.2" )
undefined

Rube MCP (Publishing & Collaboration)

Rube MCP(发布与协作)

ToolWhen to UsePurpose
mcp__rube__RUBE_SEARCH_TOOLS
Doc platformsFind Notion, Confluence, GitBook
mcp__rube__RUBE_MULTI_EXECUTE_TOOL
PublishingPush docs to platforms
mcp__rube__RUBE_REMOTE_WORKBENCH
Bulk docsGenerate docs for large codebases
工具适用场景用途
mcp__rube__RUBE_SEARCH_TOOLS
文档平台查找Notion、Confluence、GitBook
mcp__rube__RUBE_MULTI_EXECUTE_TOOL
发布将文档推送至平台
mcp__rube__RUBE_REMOTE_WORKBENCH
批量文档为大型代码库生成文档

Rube Usage Patterns

Rube使用模式

bash
undefined
bash
undefined

Publish 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
''' )
undefined

Flags (Extended)

扩展标志

FlagTypeDefaultDescription
--pal-review
boolfalseUse PAL to review doc accuracy
--publish
string-Publish via Rube (notion, confluence, gitbook)
--notify
string-Notify via Rube (slack, teams, email)
标志类型默认值描述
--pal-review
boolfalse使用PAL审核文档准确性
--publish
string-通过Rube发布至指定平台(notion, confluence, gitbook)
--notify
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 - 发布、通知、批量生成