一键导入
api-doc-gen
Generate or update OpenAPI specification from .NET controller attributes. Validate spec-to-code consistency. Use after adding or changing API endpoints.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate or update OpenAPI specification from .NET controller attributes. Validate spec-to-code consistency. Use after adding or changing API endpoints.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a comprehensive code review across architecture, security, testing, naming, and patterns. Invokes relevant reviewer agents in sequence. Use before merging features or at the end of a phase. With --quorum, dispatches multi-model analysis for higher confidence.
Run a comprehensive code review across architecture, security, testing, naming, and patterns. Invokes relevant reviewer agents in sequence. Use before merging features or at the end of a phase. With --quorum, dispatches multi-model analysis for higher confidence.
Guided end-to-end bug-fix workflow for Plan Forge tempering bugs — load → pre-fix review → write failing test → fix → validate → post-fix sweep → close. Composes /code-review, /clean-code-review, /forge-quench, and /test-sweep around the forge_bug_* tool surface so a fix never closes without a regression check.
Guided end-to-end bug-fix workflow for Plan Forge tempering bugs — load → pre-fix review → write failing test → fix → validate → post-fix sweep → close. Composes /code-review, /clean-code-review, /forge-quench, and /test-sweep around the forge_bug_* tool surface so a fix never closes without a regression check.
Plan-Forge-tuned comprehensive code review — runs public-surface diff, forge analysis, architecture / security / testing / patterns checks, plus Plan-Forge-specific gates (ACI compliance, dual-shell parity, branch model). Use before merging features or at the end of a phase. With --quorum, dispatches multi-model analysis.
Stack-agnostic Clean Code audit — module size, function-length/complexity (via your project's existing linter), long parameter lists, TODO/FIXME/HACK markers, commented-out code, debug-print leakage, and optional duplication detection. Produces a structured findings report with optional fix suggestions. Use before merges, at end of a feature, or as a regular hygiene pass.
| name | api-doc-gen |
| description | Generate or update OpenAPI specification from .NET controller attributes. Validate spec-to-code consistency. Use after adding or changing API endpoints. |
| argument-hint | [optional: specific controller to document] |
| tools | ["run_in_terminal","read_file","forge_analyze"] |
"Generate API docs" / "Update OpenAPI spec" / "Document this endpoint"
grep -rn "\[Http\(Get\|Post\|Put\|Delete\|Patch\)\]" --include="*.cs" src/
If this step fails (no matches): Try
grep -rn "\[Route\|MapGet\|MapPost\|MapPut\|MapDelete" --include="*.cs" src/for minimal API or attribute routing patterns.
*If no .cs files found: Stop and report "No .NET project found in this directory."
For each endpoint, document:
[HttpGet("route")] or [Route] attributes)[FromBody] attributes)[FromQuery] attributes)[FromRoute] attributes)[ProducesResponseType] attributes)[Authorize] attributes)openapi: 3.1.0
info:
title: (project name from .csproj)
version: (from VERSION file or AssemblyVersion)
paths:
/api/v1/resource:
get:
summary: Brief description
parameters: [...]
responses:
'200':
description: Success
content:
application/json:
schema: { $ref: '#/components/schemas/Resource' }
'401': { $ref: '#/components/responses/Unauthorized' }
'404': { $ref: '#/components/responses/NotFound' }
Use the forge_analyze MCP tool to verify spec-to-code consistency:
[ProducesResponseType] attributes[Authorize] / [AllowAnonymous] attributesAPI Documentation Status:
Endpoints in code: N
Endpoints in spec: N
Missing from spec: N (list them)
Ghost entries: N (in spec but not in code)
Schema mismatches: N
Overall: PASS / FAIL
dotnet build after any spec-related code changes| Shortcut | Why It Breaks |
|---|---|
| "The code is self-documenting" | Code shows implementation, not intent. API consumers need contracts, not source code. |
| "We'll add the OpenAPI spec later" | Specs drift from implementation immediately. Generate alongside code or they'll never match. |
| "Only internal consumers, no docs needed" | Internal APIs become external APIs. Undocumented internal APIs create onboarding bottlenecks. |
| "Examples aren't necessary" | Examples are the most-read section of any API doc. Abstract schemas don't show real usage. |
After completing this skill, confirm:
dotnet build --configuration Release succeeds after any spec-related code changessearch_thoughts("API design", project: "<YOUR PROJECT NAME>", created_by: "copilot-vscode", type: "convention") — load API naming conventions, pagination patterns, and error response standardscapture_thought("API doc: <endpoints added/changed summary>", project: "<YOUR PROJECT NAME>", created_by: "copilot-vscode", source: "skill-api-doc-gen") — persist API evolution for breaking change tracking