Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

api-docs-generatorAPI 文档生成器

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

392

周安装

16

GitHub Stars

217

下载量

127
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:api-docs-generator(API 文档生成器)
来源仓库:https://github.com/mathews-tom/praxis-skills
仓库路径:skills/api-docs-generator
安装命令:
npx skills add https://github.com/mathews-tom/praxis-skills --skill api-docs-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mathews-tom/praxis-skills --skill api-docs-generator

简介

api-docs-generator 用于辅助 API 设计、接口文档和请求响应结构梳理。

  • 适合生成 OpenAPI 草稿、检查字段命名或整理错误码。
  • 适用于 Codex、Claude、Cursor、Gemini CLI 中的前后端联调场景。
  • 通过 npx 安装,需确认真实业务语义和鉴权方式。
  • 生成接口文档时应避免凭空补字段,最好从现有代码中提取事实。

SKILL.md

API Docs Generator

Audits API endpoint documentation for completeness, generates enhanced docstrings with proper parameter descriptions and examples, documents all response codes, and produces Pydantic model examples — bridging the gap between auto-generated OpenAPI specs and genuinely useful API documentation.

Reference Files

FileContentsLoad When
references/fastapi-patterns.mdFastAPI-specific documentation patterns, Path/Query/Body parameter docsFastAPI endpoint
references/example-generation.mdCreating realistic field examples, model_config patternsExample values needed
references/response-codes.mdStandard HTTP response documentation, error response schemasResponse documentation needed
references/openapi-enhancement.mdOpenAPI spec enrichment, tag organization, schema documentationOpenAPI spec review

Prerequisites

  • Access to the API source code (route definitions, models)
  • Framework identification (FastAPI, Flask, Django REST, Express)

Workflow

Phase 1: Analyze Endpoints

  1. Inventory endpoints — List all routes with HTTP method, path, handler function.
  2. Identify models — Request bodies (Pydantic models, dataclasses), response models, query parameters, path parameters.
  3. Map dependencies — Authentication requirements, middleware, shared dependencies.
  4. Read existing docs — Current docstrings, OpenAPI metadata, inline documentation.

Phase 2: Audit Documentation

For each endpoint, check:

CheckWhat to VerifyCommon Gap
Endpoint descriptionHandler has a docstringMissing or "TODO"
Parameter descriptionsEach param has description=Path params undocumented
Request exampleBody model has example= or json_schema_extraNo request example
Response modelresponse_model= specifiedReturns raw dict
Error responses4xx/5xx documented with responses=Only 200 documented
TagsEndpoint assigned to a tag groupUntagged endpoints

Phase 3: Generate Enhancements

  1. Docstrings — Write clear endpoint descriptions that explain purpose, not implementation. Include Raises section for documented errors.
  2. Parameter metadata — Add description, example, ge/le/regex to Path, Query, Body parameters.
  3. Model examples — Add Field(example=...) and model_config with json_schema_extra.
  4. Error responses — Document every possible error status code with response schema.
  5. Tags — Group endpoints by resource or feature area.

Phase 4: Output

Produce a coverage report and enhanced code.

Output Format

## API Documentation Audit

### Coverage Summary
| Metric | Count | Documented | Coverage |
|--------|-------|------------|----------|
| Endpoints | {N} | {M} | {%} |
| Parameters | {N} | {M} | {%} |
| Response codes | {N} | {M} | {%} |
| Models with examples | {N} | {M} | {%} |

### Gaps Identified

| # | Endpoint | Issue | Severity |
|---|----------|-------|----------|
| 1 | `{METHOD} {path}` | {issue} | {High/Medium/Low} |

### Enhanced Code

#### `{METHOD} {path}`

@router.{method}( "{path}", response_model={ResponseModel}, summary="{Short summary}", responses={{ 404: {{"description": "{Not found description}"}}, 422: {{"description": "Validation error"}}, }}, tags=["{tag}"], ) async def {handler}( {param}: {type} = Path(..., description="{description}", example={example}), ) -> {ResponseModel}: """ {Full description of what this endpoint does.}

{Additional context about behavior, side effects, or important notes.}

Raises: 404: {Entity} not found 403: Insufficient permissions """


#### Model: `{ModelName}`

class {ModelName}(BaseModel): {field}: {type} = Field(..., description="{description}", example={example})

model_config = ConfigDict( json_schema_extra={{ "example": {{ "{field}": {example_value}, }} }} )

Calibration Rules

  1. Describe behavior, not implementation. "Retrieves the user's profile" is good.

"Calls db.query(User).filter_by(id=id).first()" is implementation leakage.

  1. Realistic examples. "alice@example.com" not "string". 42 not 0.

Examples serve as documentation — they should look like real data.

  1. Document every error code. If the endpoint can return 404, document it. Users

should never encounter an undocumented error response.

  1. Consistent style. All endpoints in the same API should use the same documentation

patterns — same tag naming, same description style, same example format.

  1. Don't duplicate the type system. If the parameter type is int, don't write

"An integer" as the description. Write what the integer represents: "Unique user identifier."

Error Handling

ProblemResolution
Non-FastAPI frameworkAdapt patterns. Document the HTTP contract regardless of framework.
No type hints on handlersInfer types from usage, document uncertainty, suggest adding type hints.
Massive API (50+ endpoints)Prioritize undocumented and public endpoints. Batch output by resource.
Generated API (OpenAPI → code)Document at the spec level, not the generated code level.
Authentication varies by endpointDocument auth requirements per endpoint group.

When NOT to Generate

Push back if:

  • The API design itself is wrong (bad URL patterns, wrong HTTP methods) — fix the API first
  • The user wants SDK generation from OpenAPI — different tool
  • The code is a prototype that will change significantly — document after stabilization

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.22%
按下载量换算41

Claude

31.08%
按下载量换算39

Cursor

20.23%
按下载量换算26

Gemini CLI

9.54%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills