API Documentation
Configures Swagger/OpenAPI documentation for Node.js API services.
Install
mkdir -p .claude/skills/api-documentation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13875" && unzip -o skill.zip -d .claude/skills/api-documentation && rm skill.zipInstalls to .claude/skills/api-documentation
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Swagger/OpenAPI setup and documentation patterns for SE104_VLEAGUEKey capabilities
- →Set up Swagger UI for API documentation
- →Define API titles and descriptions
- →Add bearer authentication to Swagger
- →Tag API endpoints for grouping
- →Document controller endpoints with summaries and responses
- →Document DTO properties with descriptions and examples
How it works
The skill configures Swagger UI in `main.ts` using `DocumentBuilder` to define API metadata, authentication, and tags, and uses decorators to document controllers and DTOs.
Inputs & outputs
When to use API Documentation
- →Setup Swagger UI for API
- →Document API endpoints
- →Define API response metadata
About this skill
API Documentation Skill
Swagger Setup
Swagger UI available at /api/docs (set up in main.ts).
const config = new DocumentBuilder()
.setTitle('VLeague API')
.setDescription('V-League Football Management System API')
.setVersion('1.0')
.addBearerAuth(
{
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
name: 'JWT',
description: 'Enter JWT access token',
in: 'header',
},
'access-token',
)
.addTag('Authentication', 'User authentication endpoints')
.addTag('Teams', 'Team management endpoints')
.addTag('Players', 'Player management endpoints')
.addTag('Matches', 'Match scheduling and management')
.addTag('Scheduling', 'Schedule generation and publishing')
.addTag('Seasons', 'Season management')
.addTag('Stadiums', 'Stadium management')
.addTag('Roster', 'Team roster management')
.addTag('Regulations', 'Season regulations')
.addTag('Standings', 'League standings & statistics')
.addTag('Users', 'User management (ADMIN)')
.addTag('Upload', 'File upload')
.addTag('Search', 'Global search')
.addTag('Health', 'Health check')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('docs', app, document);
Controller Documentation
@ApiTags('Teams')
@Controller('teams')
export class TeamsController {
@Get()
@ApiOperation({ summary: 'List all teams' })
@ApiResponse({ status: 200, description: 'Teams retrieved successfully' })
@Public()
findAll(@Query() query: PaginationQueryDto) {}
@Post()
@ApiOperation({ summary: 'Create a team' })
@ApiResponse({ status: 201, description: 'Team created' })
@ApiResponse({ status: 409, description: 'Team name already exists' })
@ApiBearerAuth()
@Roles(UserRole.ADMIN)
create(@Body() dto: CreateTeamDto) {}
}
DTO Documentation
export class CreateTeamDto {
@ApiProperty({ description: 'Team name', example: 'Hoàng Anh Gia Lai' })
@IsString()
@IsNotEmpty()
name: string;
@ApiPropertyOptional({ description: 'Short name', example: 'HAGL' })
@IsOptional()
@IsString()
shortName?: string;
@ApiPropertyOptional({ description: 'City', example: 'Pleiku' })
@IsOptional()
@IsString()
city?: string;
@ApiPropertyOptional({ enum: TeamStatus, default: TeamStatus.ACTIVE })
@IsOptional()
@IsEnum(TeamStatus)
status?: TeamStatus;
}
Error Response Shape
All API errors follow this schema:
{
"statusCode": 400,
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": ["field must be a string"],
"requestId": "uuid",
"timestamp": "2026-01-01T00:00:00.000Z"
}
Decorator Reference
| Decorator | Purpose |
|---|---|
@ApiTags('Tag') | Group endpoints by tag |
@ApiOperation({ summary }) | Endpoint description |
@ApiResponse({ status, description }) | Response documentation |
@ApiBearerAuth() | Mark as JWT-protected |
@ApiProperty({ description, example }) | Required field |
@ApiPropertyOptional({...}) | Optional field |
@ApiQuery({ name, required, enum }) | Query parameter |
@ApiParam({ name, description }) | Path parameter |
@ApiConsumes('multipart/form-data') | File upload endpoint |
When not to use it
- →When the project is not SE104_VLEAGUE
Limitations
- →Swagger UI is available at `/api/docs`.
- →The skill is specific to SE104_VLEAGUE.
- →All API errors follow a specific JSON schema.
How it compares
This skill provides a structured and decorator-based approach to API documentation with Swagger, ensuring consistency and discoverability, unlike manually maintaining API specifications.
Compared to similar skills
API Documentation side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| API Documentation (this skill) | 0 | 5mo | No flags | Intermediate |
| api-documenter | 0 | 8mo | Review | Beginner |
| openai-knowledge | 5 | 4mo | No flags | Intermediate |
| http-generate | 1 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by daithang-organization
View all by daithang-organization →You might also like
api-documenter
ovachiever
Auto-generate API documentation from code and comments. Use when API endpoints change, or user mentions API docs. Creates OpenAPI/Swagger specs from code. Triggers on API file changes, documentation requests, endpoint additions.
openai-knowledge
openai
Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.
http-generate
spring-ai-alibaba
Generates HTTP request examples for Spring Boot Web interfaces according to task specification and saves them as .http files in module-generate.md directories
ai-sdk-documentation
malob
This skill should be used when working with Vercel AI SDK, AI Gateway, streamText, generateText, generateObject, streamObject, tool calling, or AI SDK providers. Also relevant for "ai-sdk", "@ai-sdk/*" packages, or questions about AI SDK patterns, configuration, and best practices.
generating-api-contracts
jeremylongshore
Generate API contracts and OpenAPI specifications from code or design documents. Use when documenting API contracts and specifications. Trigger with phrases like "generate API contract", "create OpenAPI spec", or "document API contract".
writing-docs
remotion-dev
Guides for writing and editing Remotion documentation. Use when adding docs pages, editing MDX files in packages/docs, or writing documentation content.