技能 api-documentation-generator
📚

api-documentation-generator

安全

生成專業 API 文件

也可從以下取得: CrazyDubya

不再手動撰寫過時的 API 文件。此技能可自動從您的程式碼庫產生全面、對開發者友善的文件,並附有可運作的範例。

支援: Claude Codex Code(CC)
🥉 74 青銅
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「api-documentation-generator」。 Document a POST /users endpoint that creates user accounts

預期結果:

  • ## Create User
  • Creates a new user account.
  • Endpoint: POST /api/v1/users
  • Authentication: Required (Bearer token)
  • Request Body: email (required), password (required, min 8 chars), name (required)
  • Success Response: 201 Created with user object including id, email, name, createdAt
  • Error Responses: 400 Validation Error, 409 Email Exists, 401 Unauthorized
  • Examples provided in cURL, JavaScript fetch, and Python requests

正在使用「api-documentation-generator」。 Document GraphQL GetUser query with ID parameter

預期結果:

  • ## User Query
  • Fetch user information by ID.
  • Query: GetUser($id: ID!) returns user object with id, email, name, role, posts
  • Variables: id (required, ID type)
  • Response: Data object containing user with nested posts array
  • Errors: USER_NOT_FOUND with extension code and userId

安全審計

安全
v1 • 2/24/2026

This skill is a documentation generator that produces API documentation from codebases. Static analysis flagged 65 external_commands and 12 network patterns, but all are FALSE POSITIVES. The SKILL.md file contains only instructional markdown with code examples formatted using markdown backticks (not shell execution). URLs are documentation examples (api.example.com), not actual network calls. No executable code, no cryptographic implementations, and no system commands exist. Safe for publication.

1
已掃描檔案
487
分析行數
0
發現項
1
審計總數
未發現安全問題
審計者: claude

品質評分

38
架構
100
可維護性
87
內容
50
社群
100
安全
91
規範符合性

你能建構什麼

REST API 文件

為 REST API 產生完整的端點文件,包含要求/回應範例、驗證詳細資料和錯誤碼

GraphQL 結構描述文件

建立查詢和變異文件,包含變數規格、回應結構和錯誤格式

開發者入口網站內容

產生全面的 API 參考文件,包含快速入門指南、驗證設定和使用規範

試試這些提示

基本端點文件
Document this API endpoint: [paste code]. Include the HTTP method, URL path, request parameters, response format, and one code example.
完整 API 參考
Generate complete API documentation for this codebase: [paste files]. Include all endpoints, authentication requirements, request/response schemas, error codes, and code examples in cURL, JavaScript, and Python.
OpenAPI 規格產生
Convert this API code into an OpenAPI 3.0 specification: [paste code]. Include all paths, components, security schemes, and example values.
根據程式碼變更更新文件
Update the API documentation based on these code changes: [show diff]. Identify new endpoints, modified parameters, and changed response formats. Provide updated documentation sections.

最佳實務

  • 使用註解或註釋將文件放在程式碼附近,以確保兩者保持同步
  • 包含在沙盒或預備環境中測試過的可運作程式碼範例
  • 記錄所有錯誤碼和邊界情況,而不僅僅是成功的情境

避免

  • 使用 foo 和 bar 等佔位符資料撰寫文件範例,而不是真實的值
  • 只記錄快樂路徑情境,而不涵蓋錯誤處理
  • 將文件建立為單獨的成品,導致程式碼變更時被遺忘

常見問題

此技能支援哪些程式語言?
此技能可以為任何語言編寫的 API 建立文件。它會根據需要以 cURL、JavaScript、Python 和其他語言產生文件範例。
此技能可以產生 OpenAPI/Swagger 規格嗎?
可以。提供您的 API 程式碼,此技能會產生可與 Swagger UI 或類似工具搭配使用的有效 OpenAPI 3.0 規格檔案。
此技能會測試所記錄的端點嗎?
不會。此技能透過程式碼分析產生文件,但不會執行或驗證端點。請在您的預備環境中測試範例。
此技能可以記錄 GraphQL API 嗎?
可以。此技能會記錄 GraphQL 查詢、變異和訂閱,包含變數規格、回應結構和錯誤格式。
當我的 API 變更時,如何保持文件更新?
使用更新的程式碼再次執行此技能。為獲得最佳結果,請將文件產生整合到您的 CI/CD 流程中。
此技能可以建立 Postman 集合嗎?
可以。此技能可以產生包含所有已記錄端點和範例請求的 Postman 集合 JSON 檔案。

開發者詳情

檔案結構

📄 SKILL.md