zebbern/claude-code-guide / skills/code-documenter
code-documenter
UnverifiedUse when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| references/api-docs-fastapi-django.md | markdown | 4.2 KB |
| references/api-docs-nestjs-express.md | markdown | 5.0 KB |
| references/coverage-reports.md | markdown | 3.2 KB |
| references/documentation-systems.md | markdown | 6.2 KB |
| references/interactive-api-docs.md | markdown | 10.1 KB |
| references/python-docstrings.md | markdown | 3.1 KB |
| references/typescript-jsdoc.md | markdown | 3.3 KB |
| references/user-guides-tutorials.md | markdown | 11.0 KB |
references/api-docs-nestjs-express.md
View on GitHub# API Documentation: NestJS & Express
## NestJS (@nestjs/swagger)
NestJS requires explicit decorators for OpenAPI documentation.
### Controller Documentation
```typescript
import { Controller, Post, Body, Get, Param } from "@nestjs/common"
import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBearerAuth } from "@nestjs/swagger"
@ApiTags("Users")
@ApiBearerAuth()
@Controller("users")
export class UsersController {
@Post()
@ApiOperation({ summary: "Create a new user" })
@ApiResponse({
status: 201,
description: "User created successfully",
type: UserDto,
})
@ApiResponse({
status: 400,
description: "Invalid input data",
})
async create(@Body() dto: CreateUserDto): Promise<UserDto> {
return this.usersService.create(dto)
}
@Get(":id")
@ApiOperation({ summary: "Get user by ID" })
@ApiParam({
name: "id",
description: "User unique identifier",
example: "123",
})
@ApiResponse({ status: 200, type: UserDto })
@ApiResponse({ status: 404, description: "User not found" })
async findOne(@Param("id") id: string): Promise<UserDto> {
return this.usersService.findOne(id)
}
}
```
### DTO Documentation
```typescript
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"
import { IsEmail, IsString, MinLength } from "class-validator"
export class CreateUserDto {
@ApiProperty({
description: "User's display name",
example: "John Doe",
minLength: 1,
maxLength: 100,
})
@IsString()
@MinLength(1)
name: string
@ApiProperty({
description: "User's email address",
example: "john@example.com",
})
@IsEmail()
email: string
@ApiPropertyOptional({
description: "Profile picture URL",
example: "https://example.com/avatar.jpg",
})
avatarUrl?: string
}
```
## Express (swagger-jsdoc)
Express uses JSDoc comments with swagger annotations.
### Setup
```javascript
const swaggerJsdoc = require("swagger-jsdoc")
const swaggerUi = require("swagger-ui-express")
const options = {
definition: {
openapi: "3.0.0",
info: {
title: "API Documentation",
version: "1.0.0",
},
},
apis: ["./routes/*.js"],
}
const specs = swaggerJsdoc(options)
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(specs))
```
### Route Documentation
```javascript
/**
* @swagger
* /users:
* post:
* summary: Create a new user
* tags: [Users]
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/CreateUser'
* responses:
* 201:
* description: User created successfully
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/User'
* 400:
* description: Invalid input
*/
router.post("/users", createUser)
/**
* @swagger
* /users/{id}:
* get:
* summary: Get user by ID
* tags: [Users]
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: string
* description: User ID
* responses:
* 200:
* description: User found
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/User'
* 404:
* description: User not found
*/
router.get("/users/:id", getUser)
```
### Schema Documentation
```javascript
/**
* @swagger
* components:
* schemas:
* CreateUser:
* type: object
* required:
* - name
* - email
* properties:
* name:
* type: string
* description: User's display name
* example: John Doe
* email:
* type: string
* format: email
* description: User's email address
* example: john@example.com
* User:
* allOf:
* - $ref: '#/components/schemas/CreateUser'
* - type: object
* properties:
* id:
* type: string
* description: Unique identifier
* createdAt:
* type: string
* format: date-time
*/
```
## Quick Reference
| NestJS Decorator | Purpose |
| ------------------ | ---------------------- |
| `@ApiTags()` | Group endpoints |
| `@ApiOperation()` | Endpoint summary |
| `@ApiResponse()` | Response documentation |
| `@ApiParam()` | Path parameter |
| `@ApiQuery()` | Query parameter |
| `@ApiBody()` | Request body |
| `@ApiBearerAuth()` | Auth requirement |
| `@ApiProperty()` | DTO property |
| Express swagger-jsdoc | Purpose |
| --------------------- | ------------------- |
| `@swagger` | Start swagger block |
| `tags` | Group endpoints |
| `summary` | Short description |
| `parameters` | Path/query params |
| `requestBody` | Request body schema |
| `responses` | Response schemas |
| `$ref` | Reference schema |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 463k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 195k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |