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.
Best use case
api-generation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using api-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-generation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-generation Compares
| Feature / Agent | api-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 TypeScript API client from Swagger/Go comments. Use when updating API endpoints, adding new routes, or regenerating the frontend API client after backend changes.
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 Generation
Generate typed TypeScript API client from Go Swagger comments using swag + Orval.
## Workflow
```
Go Handler → swag init → swagger.json → Orval → TypeScript Hooks
```
## One Command for Everything
```bash
make api
```
This executes:
1. `swag init` → Generates `backend/docs/swagger.json` from Go comments
2. `orval` → Generates TypeScript Hooks in `frontend/src/shared/api/`
## Adding a New Endpoint
### Step 1: Go Handler with Swagger Comments
```go
// internal/handler/product.go
// GetProducts godoc
// @Summary List all products
// @Description Get all products for the authenticated user
// @Tags products
// @Accept json
// @Produce json
// @Success 200 {array} ProductResponse
// @Failure 401 {object} ErrorResponse
// @Security BearerAuth
// @Router /products [get]
func (h *ProductHandler) GetProducts(w http.ResponseWriter, r *http.Request) {
// Implementation
}
// CreateProduct godoc
// @Summary Create a product
// @Description Create a new product
// @Tags products
// @Accept json
// @Produce json
// @Param request body CreateProductRequest true "Product data"
// @Success 201 {object} ProductResponse
// @Failure 400 {object} ErrorResponse
// @Failure 401 {object} ErrorResponse
// @Security BearerAuth
// @Router /products [post]
func (h *ProductHandler) CreateProduct(w http.ResponseWriter, r *http.Request) {
// Implementation
}
```
### Step 2: Define Response/Request Types
```go
// In handler or separate types.go
type ProductResponse struct {
ID string `json:"id" example:"prod_123"`
Name string `json:"name" example:"Widget"`
Price float64 `json:"price" example:"29.99"`
}
type CreateProductRequest struct {
Name string `json:"name" example:"Widget"`
Price float64 `json:"price" example:"29.99"`
}
```
### Step 3: Generate API Client
```bash
make api
```
### Step 4: Use in Frontend
```tsx
import { useGetProducts, usePostProducts } from "@/api/endpoints/products/products"
function ProductsPage() {
const { data, isLoading } = useGetProducts()
const createProduct = usePostProducts()
const handleCreate = () => {
createProduct.mutate({ data: { name: "New", price: 10 } })
}
return (...)
}
```
## Swagger Annotation Reference
| Annotation | Description |
|------------|-------------|
| `@Summary` | Short description |
| `@Description` | Detailed description |
| `@Tags` | Grouping (becomes folder in endpoints/) |
| `@Accept` | Request Content-Type |
| `@Produce` | Response Content-Type |
| `@Param` | Parameter (body, query, path) |
| `@Success` | Success response |
| `@Failure` | Error response |
| `@Security` | Auth requirement |
| `@Router` | HTTP path and method |
## Generated Files
```
frontend/src/shared/api/
├── endpoints/
│ ├── products/ # Grouped by @Tags
│ │ └── products.ts # useGetProducts, usePostProducts, etc.
│ └── users/
│ └── users.ts
├── models/ # TypeScript Types
└── custom-fetch.ts # Fetch Wrapper with Auth
```
## Important Rules
- **Never** manually edit generated files
- **Always** run `make api` after handler changes
- Tags become folder names → `@Tags products` → `endpoints/products/`
- operationId is automatically generated from Router pathRelated 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-doc-generation
Generate and update API documentation from NestJS controllers. Use when modifying controllers, adding endpoints, or when the user asks about API documentation.
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.