Community程式設計與開發github.com

code-documentation

當使用者要求為程式碼、API、函式庫、儲存庫或軟體專案產生、建立或改善文件時使用此技能。支援 README 產生、API 參考文件、內嵌程式碼註解、架構文件、變更日誌產生和開發者指南。

code-documentation 是什麼?

此技能旨在自動化生成專業且全面的軟體文件,遵循 React、Django、Stripe 和 Kubernetes 等知名專案的最佳實務。它能從單一檔案 README 到多份文件的開發者指南,根據專案的複雜度和使用者需求調整輸出。支援多種平台(如 Claude Code、Cursor、Codex)和多種語言與文件格式(JSDoc、Google 風格的 Docstrings、GoDoc、Rustdoc 等)。其工作流程包含三個階段:首先分析程式碼庫結構以確定文件範圍;接著根據範本生成 README、API 參考、架構文件和內嵌註解;最後進行品質保證,確保文件準確、完整且一致。此技能能有效減少人工撰寫文件的時間,並確保文件維持高標準。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bytedance/deer-flow/tree/main/skills/public/code-documentation

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

預覽

來自技能 README

徽章

說明文件

程式碼文件技能

概述

此技能能為軟體專案、程式碼庫、函式庫和 API 產生專業、全面的文件。它遵循 React、Django、Stripe 和 Kubernetes 等專案的業界最佳實務,產出準確、結構良好且對新進貢獻者和經驗豐富的開發者都有幫助的文件。

輸出範圍從單一檔案 README 到多份文件的開發者指南,始終與專案的複雜度和使用者的需求相匹配。

核心能力

  • 產生包含徽章、安裝說明、使用方式和 API 參考的完整 README.md 檔案
  • 從原始碼分析建立 API 參考文件
  • 產出包含圖表的架構與設計文件
  • 撰寫開發者入門與貢獻指南
  • 從提交記錄或發行說明產生變更日誌
  • 根據語言慣例建立內嵌程式碼文件
  • 支援 JSDoc、Docstrings、GoDoc、Javadoc 和 Rustdoc 格式
  • 根據專案的語言和生態系統調整文件風格

何時使用此技能

請務必在以下情況載入此技能:

  • 使用者要求為任何程式碼「建立文件」、「產生文件」或「撰寫文件」
  • 使用者要求提供 README、API 參考或開發者指南
  • 使用者分享程式碼庫或儲存庫,並希望產生文件
  • 使用者要求改進或更新現有文件
  • 使用者需要架構文件(包含圖表)
  • 使用者要求變更日誌或遷移指南

文件工作流程

階段 1:程式碼庫分析

在撰寫任何文件之前,徹底了解程式碼庫。

步驟 1.1:專案探索

辨識專案的基本資訊:

欄位如何判斷
語言檢查副檔名、package.json、pyproject.toml、go.mod、Cargo.toml 等。
框架檢視相依項目中已知的框架(React、Django、Express、Spring 等)
建置系統檢查 Makefile、CMakeLists.txt、webpack.config.js、build.gradle 等。
套件管理器npm/yarn/pnpm、pip/uv/poetry、cargo、go modules 等。
專案結構繪製目錄樹以了解架構
進入點找到主要檔案、CLI 進入點、匯出的模組
現有文件檢查現有的 README、docs/、wiki 或內嵌文件

步驟 1.2:程式碼結構分析

使用沙盒工具探索程式碼庫:

# 取得目錄結構
ls /mnt/user-data/uploads/project-dir/

# 讀取關鍵檔案
read_file /mnt/user-data/uploads/project-dir/package.json
read_file /mnt/user-data/uploads/project-dir/pyproject.toml

# 搜尋公開 API 表面
grep -r "export " /mnt/user-data/uploads/project-dir/src/
grep -r "def " /mnt/user-data/uploads/project-dir/src/ --include="*.py"
grep -r "func " /mnt/user-data/uploads/project-dir/ --include="*.go"

步驟 1.3:辨識文件範圍

根據分析,決定要產生的文件:

專案大小建議的文件
單一檔案 / 腳本內嵌註解 + 使用方式標頭
小型函式庫包含 API 參考的 README
中型專案README + API 文件 + 範例
大型專案README + 架構 + API + 貢獻 + 變更日誌

階段 2:文件產生

步驟 2.1:產生 README

每個專案都需要 README。遵循以下結構:

# 專案名稱

[一行專案描述 — 它做什麼以及為什麼重要]

[![徽章](https://raw.githubusercontent.com/bytedance/deer-flow/main/link)](#) [![徽章](https://raw.githubusercontent.com/bytedance/deer-flow/main/link)](#)

## 功能

- [關鍵功能 1 — 簡短描述]
- [關鍵功能 2 — 簡短描述]
- [關鍵功能 3 — 簡短描述]

## 快速開始

### 先決條件

- [先決條件 1 及版本要求]
- [先決條件 2 及版本要求]

### 安裝

[可直接複製貼上的安裝指令區塊]

### 基本使用方式

[示範核心功能的最小可行範例]

## 文件

- [若另有完整 API 參考,請連結]
- [若另有架構文件,請連結]
- [若有的話,連結到範例目錄]

## API 參考

[小型專案的內嵌 API 參考 OR 連結至產生的文件]

## 設定

[環境變數、設定檔或執行時期選項]

## 範例

[2-3 個涵蓋常見使用案例的實用範例]

## 開發

### 設定

[如何設定開發環境]

### 測試

[如何執行測試]

### 建置

[如何建置專案]

## 貢獻

[貢獻指南或連結至 CONTRIBUTING.md]

## 授權

[授權資訊]

步驟 2.2:產生 API 參考

針對每個公開 API 表面,記錄:

函式 / 方法文件:

### `functionName(param1, param2, options?)`

此函式的簡短描述。

**參數:**

| 參數 | 型別 | 必要 | 預設值 | 描述 |
|-----------|------|----------|---------|-------------|
| `param1` | `string` | 是 | — | param1 的描述 |
| `param2` | `number` | 是 | — | param2 的描述 |
| `options` | `Object` | 否 | `{}` | 設定選項 |
| `options.timeout` | `number` | 否 | `5000` | 逾時時間(毫秒) |

**回傳值:** `Promise<Result>` — 回傳值的描述

**拋出例外:**
- `ValidationError` — 當 param1 為空時
- `TimeoutError` — 當操作超過逾時時間時

**範例:**

```javascript
const result = await functionName("hello", 42, { timeout: 10000 });
console.log(result.data);

**類別文件**:

```markdown
### `ClassName`

類別及其用途的簡短描述。

**建構子:**

```javascript
new ClassName(config)
參數型別描述
config.option1string描述
config.option2boolean描述

方法:

屬性:

屬性型別描述
property1string描述
property2number唯讀。描述

#### 步驟 2.3:架構文件

針對中型到大型專案,包含架構文件:

```markdown
# 架構概述

## 系統圖表

[包含一個展示高階架構的 Mermaid 圖表]

```mermaid
graph TD
    A[客戶端] --> B[API 閘道]
    B --> C[服務 A]
    B --> D[服務 B]
    C --> E[(資料庫)]
    D --> E

元件概覽

元件名稱

  • 用途:此元件的功能
  • 位置:src/components/name/
  • 相依性:它依賴的項目
  • 公開 API:關鍵的匯出或介面

資料流程

[描述關鍵操作的資料如何在系統中流動]

設計決策

決策標題

  • 情境:什麼情況導致了此決策
  • 決策:決定了什麼
  • 理由:為什麼選擇此方法
  • 權衡:犧牲了什麼

#### 步驟 2.4:內嵌程式碼文件

產生語言適用的內嵌文件:

**Python(Docstrings — Google 風格)**:
```python
def process_data(input_path: str, options: dict | None = None) -> ProcessResult:
    """處理來自指定檔案路徑的資料。

    讀取輸入檔案,根據提供的選項套用轉換,
    並回傳一個結構化的結果物件。

    Args:
        input_path: 輸入資料檔案的絕對路徑。
            支援 CSV、JSON 和 Parquet 格式。
        options: 可選的設定字典。
            - "validate" (bool): 啟用輸入驗證。預設為 True。
            - "format" (str): 輸出格式 ("json" 或 "csv")。預設為 "json"。

    Returns:
        一個包含轉換後資料和元資料的 ProcessResult。

    Raises:
        FileNotFoundError: 如果 input_path 不存在。
        ValidationError: 如果啟用驗證且資料格式錯誤。

    Example:
        >>> result = process_data("/data/input.csv", {"validate": True})
        >>> print(result.row_count)
        1500
    """

TypeScript(JSDoc / TSDoc):

/**
 * 從 API 擷取使用者資料並轉換以供顯示。
 *
 * @param userId - 使用者的唯一識別碼
 * @param options - 擷取操作的設定選項
 * @param options.includeProfile - 是否包含完整個人資料。預設為 `false`。
 * @param options.cache - 快取持續時間(秒)。設為 `0` 以停用。
 * @returns 轉換後的使用者資料,準備好進行渲染
 * @throws {NotFoundError} 當使用者 ID 不存在時
 * @throws {NetworkError} 當 API 無法連線時
 *
 * @example
 * ```ts
 * const user = await fetchUser("usr_123", { includeProfile: true });
 * console.log(user.displayName);
 * ```
 */

Go(GoDoc):

// ProcessData 讀取指定路徑的輸入檔案,套用指定的轉換,
// 並回傳處理後的結果。
//
// 輸入路徑必須是 CSV 或 JSON 檔案的絕對路徑。
// 如果 options 為 nil,則使用預設選項。
//
// 如果檔案不存在或無法解析,ProcessData 會回傳錯誤。
func ProcessData(inputPath string, options *ProcessOptions) (*Result, error) {

階段 3:品質保證

步驟 3.1:文件完整性檢查

確認文件涵蓋:

  • 它是什麼 — 新手能理解的清晰專案描述
  • 它為什麼存在 — 它解決的問題和價值主張
  • 如何安裝 — 可直接複製貼上的安裝指令
  • 如何使用 — 至少一個最小可行範例
  • API 表面 — 所有公開函式、類別和型別都已記錄
  • 設定 — 所有環境變數、設定檔和選項
  • 錯誤處理 — 常見錯誤及其解決方法
  • 貢獻 — 如何設定開發環境並提交變更

步驟 3.2:品質標準

標準檢查項目
準確性每個程式碼範例必須確實能與描述的 API 一起運作
完整性沒有任何公開 API 表面未被記錄
一致性整個文件使用相同的格式和結構
新鮮度文件必須與當前程式碼相符,而非舊版本
可及性沒有未經解釋的術語,首次使用時定義縮寫
範例每個複雜概念至少有一個實用範例

步驟 3.3:交叉引用驗證

確保:

  • 所有提及的檔案路徑都存在於專案中
  • 所有被引用的函式和類別都存在於程式碼中
  • 所有程式碼範例都使用正確的函式簽章
  • 版本號碼與專案的實際版本相符
  • 所有連結(內部與外部)都是有效的

文件風格指南

寫作原則

  1. 先說明「為什麼」 — 在解釋如何運作之前,先說明它為什麼存在
  2. 漸進式揭露 — 從簡單開始,逐步增加複雜度
  3. 展示,而非告知 — 偏好使用程式碼範例而非冗長的說明
  4. 主動語態 — 「該函式回傳 X」而非「X 由該函式回傳」
  5. 現在式 — 「伺服器在連接埠 8080 上啟動」而非「伺服器將會在連接埠 8080 上啟動」
  6. 第二人稱 — 「你可以設定...」而非「使用者可以設定...」

格式化規則

  • 使用 ATX 樣式的標頭(#、##、###)
  • 使用帶有語言標示的圍欄式程式碼區塊(python、bash)
  • 對結構化資訊(參數、選項、設定)使用表格
  • 對重要的注意事項、警告和提示使用提示區塊
  • 保持行長度可讀(在原始碼中,將散文包裹在大約 80-100 個字元)
  • 對函式名稱、檔案路徑、變數名稱和 CLI 指令使用 程式碼格式化

語言特定慣例

語言文件格式風格指南
PythonGoogle 風格 DocstringsPEP 257
TypeScript/JavaScriptTSDoc / JSDocTypeDoc 慣例
GoGoDoc 註解Effective Go
RustRustdoc (///)Rust API 指南
JavaJavadocOracle Javadoc 指南
C/C++DoxygenDoxygen 手冊

輸出處理

產生後:

  • 將文件檔案儲存至 /mnt/user-data/outputs/
  • 對於多檔案文件,維持專案目錄結構
  • 使用 present_files 工具向使用者呈現產生的檔案
  • 提供針對特定區塊進行疊代或調整詳細程度的選項
  • 建議可能對使用者有價值的其他文件

備註

  • 在撰寫文件之前,務必先分析實際程式碼 — 切勿猜測 API 簽章或行為
  • 當現有文件存在時,保留其結構,除非使用者明確要求重寫
  • 對於大型程式碼庫,優先記錄公開 API 表面和關鍵抽象
  • 文件應使用專案現有文件所用的語言撰寫;如果沒有現有文件,預設為英文
  • 在產生變更日誌時,使用 Keep a Changelog 格式
  • 此技能非常適合與 deep-research 技能搭配使用,用於記錄第三方整合或相依項目

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bootstrap

Generate a personalized SOUL.md through a warm, adaptive onboarding conversation. Trigger when the user wants to create, set up, or initialize their AI partner's identity — e.g., "create my SOUL.md", "bootstrap my agent", "set up my AI partner", "define who you are", "let's do onboarding", "personalize this AI", "make you mine", or when a SOUL.md is missing. Also trigger for updates: "update my SOUL.md", "change my AI's personality", "tweak the soul".

bytedance/academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bytedance/chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

bytedance/claude-to-deerflow

Interact with DeerFlow AI agent platform via its HTTP API. Use this skill when the user wants to send messages or questions to DeerFlow for research/analysis, start a DeerFlow conversation thread, check DeerFlow status or health, list available models/skills/agents in DeerFlow, manage DeerFlow memory, upload files to DeerFlow threads, or delegate complex research tasks to DeerFlow. Also use when the user mentions deerflow, deer flow, or wants to run a deep research task that DeerFlow can handle.

bytedance/consulting-analysis

Use this skill when the user requests to generate, create, or write professional research reports including but not limited to market analysis, consumer insights, brand analysis, financial analysis, industry research, competitive intelligence, investment due diligence, or any consulting-grade analytical report. This skill operates in two phases — (1) generating a structured analysis framework with chapter skeleton, data query requirements, and analysis logic, and (2) after data collection by other skills, producing the final consulting-grade report with structured narratives, embedded charts, and strategic insights.

bytedance/data-analysis

Use this skill when the user uploads Excel (.xlsx/.xls) or CSV files and wants to perform data analysis, generate statistics, create summaries, pivot tables, SQL queries, or any form of structured data exploration. Supports multi-sheet Excel workbooks, aggregation, filtering, joins, and exporting results to CSV/JSON/Markdown.

bytedance/deep-research

Use this skill instead of WebSearch for ANY question requiring web research. Trigger on queries like "what is X", "explain X", "compare X and Y", "research X", or before content generation tasks. Provides systematic multi-angle research methodology instead of single superficial searches. Use this proactively when the user's question needs online information.

bytedance/find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

bytedance/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

bytedance/github-deep-research

Conduct multi-round deep research on any GitHub Repo. Use when users request comprehensive analysis, timeline reconstruction, competitive analysis, or in-depth investigation of GitHub. Produces structured markdown reports with executive summaries, chronological timelines, metrics analysis, and Mermaid diagrams. Triggers on Github repository URL or open source projects.

bytedance/image-generation

Use this skill when the user requests to generate, create, imagine, or visualize images including characters, scenes, products, or any visual content. Supports structured prompts and reference images for guided generation.

bytedance/podcast-generation

Use this skill when the user requests to generate, create, or produce podcasts from text content. Converts written content into a two-host conversational podcast audio format with natural dialogue.

bytedance/ppt-generation

Use this skill when the user requests to generate, create, or make presentations (PPT/PPTX). Creates visually rich slides by generating images for each slide and composing them into a PowerPoint file.

bytedance/skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

bytedance/surprise-me

Create a delightful, unexpected "wow" experience for the user by dynamically discovering and creatively combining other enabled skills. Triggers when the user says "surprise me" or any request expressing a desire for an unexpected creative showcase. Also triggers when the user is bored, wants inspiration, or asks for "something interesting".

bytedance/vercel-deploy

Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Create a preview deployment", "Deploy and give me the link", or "Push this live". No authentication required - returns preview URL and claimable deployment link.

bytedance/video-generation

Use this skill when the user requests to generate, create, or imagine videos. Supports structured prompts and reference image for guided generation.

bytedance/web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

相關技能