EmanuProds/dotfiles / skills/docs-generation
docs-generation"
UnverifiedGenerates and maintains documentation including API docs, READMEs, architecture decision records, and changelogs. Use when creating or updating project documentation.
Documentation Generation Skill
Documentation Types
1. README.md (Project Entry Point)
# Project Name
> One-line description of what this project does.
## Features
- Feature 1
- Feature 2
- Feature 3
## Quick Start
```bash
# Install
npm install
# Development
npm run dev
# Build
npm run build
# Test
npm test
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | Server port |
DATABASE_URL | Yes | - | PostgreSQL connection |
API Reference
Architecture
See Architecture Decision Records
Contributing
See CONTRIBUTING.md
License
MIT
### 2. API Documentation (OpenAPI/Swagger)
```yaml
# docs/api/openapi.yaml
openapi: 3.0.0
info:
title: User API
version: 1.0.0
description: User management endpoints
servers:
- url: https://api.example.com/v1
paths:
/users:
get:
summary: List users
parameters:
- name: page
in: query
schema: { type: integer, default: 1 }
- name: limit
in: query
schema: { type: integer, default: 20 }
responses:
'200':
description: Paginated user list
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedUsers'
/users/{id}:
get:
summary: Get user by ID
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
'200':
description: User found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
components:
schemas:
User:
type: object
properties:
id: { type: string, format: uuid }
email: { type: string, format: email }
name: { type: string }
createdAt: { type: string, format: date-time }
PaginatedUsers:
type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/User' }
page: { type: integer }
limit: { type: integer }
total: { type: integer }
3. Architecture Decision Records (ADR)
# docs/adr/001-use-postgresql.md
# ADR 001: Use PostgreSQL as Primary Database
## Status
Accepted
## Context
We need a relational database for:
- Complex queries with joins
- ACID transactions
- JSON support for flexible schemas
- Strong consistency requirements
## Decision
Use PostgreSQL 15+ as the primary database.
## Alternatives Considered
| Option | Pros | Cons |
|--------|------|------|
| MySQL | Widely known | Limited JSON, no CTEs |
| MongoDB | Flexible schema | No ACID, eventual consistency |
| SQLite | Zero config | Not for production scale |
## Consequences
- **Positive**: Mature ecosystem, great tooling, JSONB support
- **Negative**: Operational overhead (backups, replication)
- **Mitigation**: Use managed service (RDS, Cloud SQL)
## Implementation
- Connection pooling with PgBouncer
- Read replicas for scaling reads
- Automated backups with point-in-time recovery
4. Changelog (Keep a Changelog Format)
# CHANGELOG.md
## [1.2.0] - 2024-01-15
### Added
- User profile API endpoints (`GET/PUT /api/users/:id/profile`)
- Dark mode support in UI
- Export to CSV feature
### Changed
- **BREAKING**: User API now returns `createdAt` instead of `created_at`
- Improved login performance by 40%
- Updated dependencies to latest versions
### Deprecated
- `GET /api/users/:id/settings` (use `/profile` instead)
### Removed
- Legacy authentication endpoint `/api/auth/legacy`
### Fixed
- Race condition in order processing
- Memory leak in WebSocket connections
### Security
- Updated vulnerable dependency `lodash` from 4.17.20 to 4.17.21
5. Code Comments (JSDoc/TSDoc)
/**
* Calculates shipping cost for an order.
*
* @param order - The order to calculate shipping for
* @param options - Shipping calculation options
* @returns The shipping cost in cents
* @throws {ValidationError} If order is invalid
* @example
* const cost = calculateShipping(order, { method: 'express' });
*/
function calculateShipping(
order: Order,
options: ShippingOptions = { method: 'standard' }
): number {
// Implementation
}
Automation
Generate API Docs from Code
# TypeScript -> OpenAPI
npx tsoa spec-and-routes
# Python FastAPI -> OpenAPI
python -c "from app.main import app; print(app.openapi())" > openapi.json
# Generate client SDKs
npx openapi-generator-cli generate -i openapi.json -g typescript-axios -o ./client
Generate README from Package.json
npx readme-generator
Validate Links
npx markdown-link-check README.md
Templates Location
Store templates in .github/docs-templates/:
README.md.templateADR.md.templateCHANGELOG.md.templateCONTRIBUTING.md.template
When to Use
- Creating new project documentation
- Updating API documentation after changes
- Writing ADRs for architectural decisions
- Maintaining changelogs for releases
- Documenting complex business logic
- Onboarding new team members
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: 464k | 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: 196k | 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: 196k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |