api-doc-generation
Generate and update API documentation from NestJS controllers. Use when modifying controllers, adding endpoints, or when the user asks about API documentation.
Best use case
api-doc-generation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate and update API documentation from NestJS controllers. Use when modifying controllers, adding endpoints, or when the user asks about API documentation.
Teams using api-doc-generation should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-doc-generation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-doc-generation Compares
| Feature / Agent | api-doc-generation | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate and update API documentation from NestJS controllers. Use when modifying controllers, adding endpoints, or when the user asks about API documentation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# API Documentation Generation Skill
> **Purpose:** Generate and update API documentation from NestJS controllers. Keeps API docs in sync with implementation.
## Trigger
**When:** Controller files (`*.controller.ts`) are modified
**Context Needed:** Controller code, DTOs, existing API docs
**MCP Tools:** `grep_search`, `read_file`, `mcp_payment-syste_query_docs_by_type`
## Controller → Doc Mapping
Parse NestJS decorators to extract:
```typescript
@Controller('products') // Base path: /api/v1/products
@Get(':id') // GET /api/v1/products/:id
@Post() // POST /api/v1/products
@UseGuards(JwtAuthGuard) // Auth required
@ApiOperation({ summary: '...'}) // Description
```
## Extraction Rules
| Decorator | Extracted Info |
| :------------------------ | :------------- |
| `@Controller(path)` | Base path |
| `@Get/@Post/@Put/@Delete` | HTTP method |
| `@Param/@Query/@Body` | Parameters |
| `@UseGuards` | Authentication |
| `@ApiOperation` | Description |
| `@ApiResponse` | Response codes |
## API Doc Format
````markdown
### GET /api/v1/products/:id
**Description:** Get product by ID
**Authentication:** Required (JWT)
**Parameters:**
| Name | In | Type | Required | Description |
| :--- | :--- | :----- | :------- | :---------- |
| id | path | string | Yes | Product ID |
**Responses:**
| Code | Description | Schema |
| :--- | :---------- | :----------------- |
| 200 | Success | ProductResponseDto |
| 404 | Not found | ErrorDto |
**Example Request:**
```bash
curl -X GET /api/v1/products/abc123 \
-H "Authorization: Bearer {token}"
```
````
````
## Frontmatter Template
```yaml
---
document_type: "api-design"
module: "[module]"
status: "approved"
version: "1.0.0"
last_updated: "YYYY-MM-DD"
author: "@Backend"
keywords:
- "api"
- "rest"
- "[module]"
api_metadata:
base_path: "/api/v1/[resource]"
auth_required: true
rate_limited: true
---
````
## Workflow
1. **Detect changes** - Which controllers changed?
2. **Parse decorators** - Extract API metadata
3. **Load DTOs** - Get request/response types
4. **Find existing doc** - Match by module
5. **Update endpoints** - Add/modify/remove
6. **Bump version** - If endpoints changed
7. **Update date** - Set last_updated
## DTO Extraction
```typescript
// From DTO class
export class CreateProductDto {
@IsString()
@MinLength(1)
name: string;
@IsOptional()
@IsNumber()
price?: number;
}
// Generate table
| Field | Type | Required | Validation |
| name | string | Yes | MinLength(1) |
| price | number | No | - |
```
## Reference
- [04-API-DESIGN-TEMPLATE.md](/docs/templates/04-API-DESIGN-TEMPLATE.md)
- [backend.instructions.md](../instructions/backend.instructions.md)Related Skills
generational-agent-succession
Parallel agent swarms with generational succession. Combines agent-architect's multi-agent parallelism with automatic succession when agents degrade. Each parallel agent gets fresh context through controlled handoffs while maintaining accumulated wisdom.
media-generation
Generate images, videos, and audio using Google's Gemini APIs. Use for image generation/editing (Gemini 3 Pro Image), video generation (Veo 3), and speech (TBD). Trigger words - images: generate, create, draw, design, make, edit, modify image/picture. Video: generate video, create video, animate, make a video. Supports text-to-image, image-to-image editing, text-to-video, and image-to-video.
Image Generation
AI图像生成与编辑能力,基于 Nano Banana (Gemini Image) 实现文生图、图生图、图像编辑。适用于创意设计、营销素材、社交媒体内容、演示文稿配图等场景。支持多种风格、高分辨率输出(最高4K)、文字渲染、角色一致性保持。
ai-video-generation
Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative
ai-generation-client
External AI API integration with retry logic, rate limiting, content safety detection, and multi-turn conversation support for image generation.
podcast-generation
Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creatio...
Invoice Generation
This skill provides comprehensive patterns for generating invoices in billing systems. It covers invoice data structure, PDF generation using PDFKit and Puppeteer, invoice templates, line item calcula
apify-lead-generation
Generates B2B/B2C leads by scraping Google Maps, websites, Instagram, TikTok, Facebook, LinkedIn, YouTube, and Google Search. Use when user asks to find leads, prospects, businesses, build lead lis...
api-generation
Generate TypeScript API client from Swagger/Go comments. Use when updating API endpoints, adding new routes, or regenerating the frontend API client after backend changes.
prompt-generation-rules
General rules to generate prompt.
ai-content-generation
AI content generation with OpenAI and Claude, callAIWithPrompt usage, prompt storage in app_settings, structured outputs, response format validation, multi-criteria scoring, rate limiting, JSON schema, and AI API best practices. Use when generating content, creating prompts, scoring articles, or working with OpenAI/Claude APIs.
Agent Generation
This skill provides knowledge for generating effective Claude Code agents tailored to specific projects. It is used internally by the agent-team-creator plugin when analyzing codebases and creating specialized agent teams. Contains templates, best practices, and patterns for writing project-aware agents.