Generates README files, API documentation, changelogs, runbooks, and SDK code from project analysis. Use when creating documentation, generating changelogs, documenting APIs, creating runbooks, or generating client SDKs.
Generates comprehensive documentation including READMEs, API docs, changelogs, runbooks, and SDKs by analyzing your project structure, code, and git history. Use it when you need to create or update documentation for any part of your codebase.
/plugin marketplace add mgd34msu/goodvibes-plugin/plugin install goodvibes@goodvibes-marketThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/api-doc-patterns.mdreferences/changelog-conventions.mdreferences/readme-templates.mdreferences/runbook-patterns.mdtemplates/adr-template.mdAutomated documentation generation for READMEs, APIs, changelogs, runbooks, and SDK clients.
Generate README:
Generate a README for this project based on its structure and dependencies
Generate API docs:
Generate API documentation for the endpoints in src/routes/
Create changelog:
Generate a changelog from git commits since the last release tag
Generate runbook:
Create an operational runbook for deploying and monitoring this service
Generate comprehensive README files from project analysis.
1. Detect project type from config files
2. Extract name, description from package.json/pyproject.toml
3. Identify technologies and dependencies
4. Find existing documentation
5. Detect build/test commands
6. Generate structured README
# {Project Name}
{Brief description from package.json or generated}
## Features
- {Auto-detected from code structure}
- {Key exports and capabilities}
## Installation
```bash
{Detected package manager install command}
{Basic usage example from tests or docs}
{Clone, install, configure steps}
{Detected test command}
{Detected from LICENSE file or package.json}
See [references/readme-templates.md](references/readme-templates.md) for project-specific templates.
---
### 2. API Documentation
Generate comprehensive API documentation from code.
#### OpenAPI/Swagger Generation
**From Express routes:**
```javascript
/**
* @openapi
* /users/{id}:
* get:
* summary: Get user by ID
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: integer
* responses:
* 200:
* description: User found
*/
router.get('/users/:id', getUser);
Generation workflow:
# API Reference
## Base URL
`https://api.example.com/v1`
## Authentication
Authorization: Bearer <token>
## Endpoints
### Users
#### Get User
`GET /users/{id}`
**Parameters**
| Name | Type | In | Required | Description |
|------|------|-------|----------|-------------|
| id | integer | path | Yes | User ID |
**Response 200**
```json
{
"id": 1,
"email": "user@example.com",
"name": "John Doe"
}
See [references/api-doc-patterns.md](references/api-doc-patterns.md) for framework-specific patterns.
---
### 3. TypeDoc/JSDoc Generation
Generate documentation from TypeScript/JavaScript comments.
#### JSDoc Comment Patterns
```javascript
/**
* Creates a new user in the system.
*
* @param {Object} userData - The user data
* @param {string} userData.email - User's email address
* @param {string} userData.name - User's full name
* @param {string} [userData.role='user'] - User's role (optional)
* @returns {Promise<User>} The created user object
* @throws {ValidationError} If email is invalid
* @example
* const user = await createUser({
* email: 'john@example.com',
* name: 'John Doe'
* });
*/
async function createUser(userData) {
// ...
}
{
"entryPoints": ["src/index.ts"],
"out": "docs/api",
"excludePrivate": true,
"excludeInternal": true,
"readme": "README.md",
"plugin": ["typedoc-plugin-markdown"]
}
npx typedoc --options typedoc.json
Generate changelogs from git history following Keep a Changelog format.
# Get commits since last tag
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s"
# Get commits with conventional commit parsing
git log --pretty=format:"%s" | grep -E "^(feat|fix|docs):"
| Prefix | Changelog Section |
|---|---|
feat: | Added |
fix: | Fixed |
docs: | Documentation |
perf: | Performance |
BREAKING CHANGE: | Breaking Changes |
# Changelog
## [Unreleased]
### Added
- New user authentication flow (#123)
### Changed
- Updated dependencies to latest versions
### Fixed
- Fixed race condition in queue processing (#124)
## [1.2.0] - 2024-01-15
### Added
- Initial release features...
[Unreleased]: https://github.com/owner/repo/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/owner/repo/releases/tag/v1.2.0
Document database tables, relationships, and migrations.
# Database Schema
## Tables
### users
| Column | Type | Nullable | Default | Description |
|--------|------|----------|---------|-------------|
| id | uuid | No | gen_random_uuid() | Primary key |
| email | varchar(255) | No | | User's email |
| name | varchar(255) | Yes | | Display name |
| created_at | timestamp | No | now() | Creation time |
**Indexes:**
- `users_pkey` - PRIMARY KEY (id)
- `users_email_key` - UNIQUE (email)
**Foreign Keys:**
- None
### orders
| Column | Type | Nullable | Default | Description |
|--------|------|----------|---------|-------------|
| id | uuid | No | gen_random_uuid() | Primary key |
| user_id | uuid | No | | FK to users |
| total | decimal(10,2) | No | | Order total |
**Foreign Keys:**
- `orders_user_id_fkey` - REFERENCES users(id)
## Entity Relationship Diagram
┌─────────┐ ┌─────────┐ │ users │───<───│ orders │ └─────────┘ └─────────┘
# Prisma
npx prisma generate --generator erd
# TypeORM
npx typeorm-uml ormconfig.json
# Django
python manage.py graph_models -a -o schema.png
Create operational runbooks for deployment and incident response.
# {Service Name} Runbook
## Overview
- **Service:** {name}
- **Team:** {owning team}
- **On-call:** {PagerDuty/OpsGenie link}
- **Repository:** {git repo URL}
## Architecture
{Brief architecture description with diagram}
## Dependencies
| Service | Purpose | Criticality |
|---------|---------|-------------|
| PostgreSQL | Primary data store | Critical |
| Redis | Session cache | High |
| Stripe API | Payment processing | Critical |
## Deployment
### Prerequisites
- [ ] Access to {deployment system}
- [ ] VPN connected
- [ ] Latest code on main branch
### Standard Deployment
```bash
{deployment commands}
{rollback commands}
| Metric | Normal Range | Alert Threshold |
|---|---|---|
| Response time (p99) | < 200ms | > 500ms |
| Error rate | < 0.1% | > 1% |
| CPU usage | < 60% | > 80% |
Symptoms: p99 latency > 500ms Possible causes:
Resolution:
Symptoms: 401 errors increasing Resolution:
| Severity | Response Time | Contact |
|---|---|---|
| P1 - Critical | 15 min | On-call + Manager |
| P2 - High | 1 hour | On-call |
| P3 - Medium | 4 hours | Team queue |
See [references/runbook-patterns.md](references/runbook-patterns.md) for more templates.
---
### 7. API Client/SDK Generation
Generate client SDKs from OpenAPI specifications.
#### Generator Tools
```bash
# OpenAPI Generator (multi-language)
npx @openapitools/openapi-generator-cli generate \
-i openapi.yaml \
-g typescript-fetch \
-o src/api-client
# Available generators: typescript-fetch, python, go, java, ruby, etc.
# Orval (TypeScript focused)
npx orval --config orval.config.ts
# openapi-typescript (types only)
npx openapi-typescript openapi.yaml -o types.ts
// Generated from OpenAPI spec
export class UsersApi {
constructor(private config: Configuration) {}
async getUser(id: string): Promise<User> {
const response = await fetch(
`${this.config.basePath}/users/${id}`,
{
headers: this.config.headers,
}
);
return response.json();
}
async createUser(data: CreateUserRequest): Promise<User> {
const response = await fetch(
`${this.config.basePath}/users`,
{
method: 'POST',
headers: this.config.headers,
body: JSON.stringify(data),
}
);
return response.json();
}
}
Generate migration guides for breaking changes.
# Migration Guide: v1.x to v2.0
## Overview
This guide covers breaking changes in v2.0 and how to migrate your code.
## Breaking Changes
### 1. API Response Format Change
**Before (v1.x):**
```json
[
{"id": 1, "name": "Item 1"},
{"id": 2, "name": "Item 2"}
]
After (v2.0):
{
"data": [
{"id": 1, "name": "Item 1"},
{"id": 2, "name": "Item 2"}
],
"pagination": {
"page": 1,
"totalPages": 5
}
}
Migration:
// Before
const items = await api.getItems();
items.forEach(item => console.log(item.name));
// After
const response = await api.getItems();
response.data.forEach(item => console.log(item.name));
| Removed Method | Replacement |
|---|---|
getUser(id) | users.get(id) |
deleteUser(id) | users.delete(id) |
---
### 9. Troubleshooting Documentation
Generate troubleshooting guides from common issues.
#### Troubleshooting Template
```markdown
# Troubleshooting Guide
## Common Issues
### Connection refused errors
**Symptoms:**
- Error: `ECONNREFUSED 127.0.0.1:5432`
- Application fails to start
**Causes:**
1. Database not running
2. Wrong connection string
3. Firewall blocking connection
**Solutions:**
1. **Check database status:**
```bash
docker-compose ps
# or
systemctl status postgresql
Verify connection string:
echo $DATABASE_URL
# Should be: postgres://user:pass@localhost:5432/dbname
Test connection manually:
psql $DATABASE_URL -c "SELECT 1"
Symptoms:
JavaScript heap out of memorySolutions:
Increase Node.js memory:
NODE_OPTIONS="--max-old-space-size=4096" npm start
Check for memory leaks:
node --inspect app.js
# Use Chrome DevTools Memory tab
---
### 10. FAQ Generation
Generate FAQ from code comments, issues, and documentation.
#### FAQ Template
```markdown
# Frequently Asked Questions
## General
### What is {Project Name}?
{Brief description extracted from README}
### What are the system requirements?
- Node.js {version}+
- npm or yarn
- {Other requirements}
## Installation
### How do I install {Project Name}?
```bash
npm install {package-name}
npm cache clean --force{Configuration example}
{Compatibility information}
{Error explanation and solution}
---
## Environment Variable Documentation
Generate documentation for all environment variables.
```markdown
# Environment Variables
## Required
| Variable | Description | Example |
|----------|-------------|---------|
| `DATABASE_URL` | PostgreSQL connection string | `postgres://user:pass@host:5432/db` |
| `JWT_SECRET` | Secret for JWT signing | `your-256-bit-secret` |
## Optional
| Variable | Description | Default |
|----------|-------------|---------|
| `PORT` | Server port | `3000` |
| `LOG_LEVEL` | Logging verbosity | `info` |
# ADR-{number}: {Title}
**Date:** {YYYY-MM-DD}
**Status:** {Proposed | Accepted | Deprecated}
## Context
{Describe the issue motivating this decision}
## Decision
We will use **{chosen option}** because {justification}.
## Consequences
- {positive consequence}
- {negative consequence}
After code changes, suggest documentation updates:
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit",
"command": "check-doc-updates.sh"
}]
}
}
Script example:
#!/bin/bash
# check-doc-updates.sh
# Check if API routes changed
if echo "$CHANGED_FILES" | grep -q "routes/"; then
echo "SUGGEST: API routes changed - consider updating API docs"
fi
# Check if README needs update
if echo "$CHANGED_FILES" | grep -q "package.json"; then
echo "SUGGEST: Dependencies changed - consider updating README"
fi
# Check if environment variables added
if grep -r "process.env\." "$CHANGED_FILES" 2>/dev/null; then
echo "SUGGEST: New environment variables detected - update .env.example"
fi
Hook response pattern:
interface DocUpdateSuggestion {
type: 'readme' | 'api' | 'changelog' | 'env';
reason: string;
files: string[];
priority: 'high' | 'medium' | 'low';
}
At session end, summarize changes for changelog:
{
"hooks": {
"SessionEnd": [{
"matcher": "",
"command": "summarize-changes.sh"
}]
}
}
name: Documentation
on:
push:
branches: [main]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate API docs
run: |
npx typedoc --out docs/api src/
- name: Generate OpenAPI spec
run: |
npx swagger-jsdoc -d swaggerDef.js -o openapi.yaml src/routes/*.ts
- name: Update changelog
if: startsWith(github.ref, 'refs/tags/')
run: |
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
#!/bin/bash
# .git/hooks/pre-commit
# Check if .env.example is in sync
if [ -f ".env" ] && [ -f ".env.example" ]; then
env_vars=$(grep -E "^[A-Z_]+=" .env | cut -d= -f1 | sort)
example_vars=$(grep -E "^[A-Z_]+=" .env.example | cut -d= -f1 | sort)
if [ "$env_vars" != "$example_vars" ]; then
echo "Warning: .env and .env.example are out of sync"
diff <(echo "$env_vars") <(echo "$example_vars")
fi
fi
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.