tech-docs-generator
Use when generating or updating technical documentation from code — API references, architecture docs, README files, component documentation, getting started guides, or configuration references
What this skill does
# Technical Documentation Generator
## Overview
Generate comprehensive technical documentation by analyzing the actual codebase. Produces API references, architecture overviews, getting started guides, and component documentation with real examples extracted from project code, not invented ones.
**Announce at start:** "I'm using the tech-docs-generator skill to create documentation."
## Phase 1: Codebase Analysis
Scan the codebase to identify what needs documenting. Deploy parallel subagents via the `Agent` tool (up to 500, with `subagent_type="Explore"`) to analyze:
| Analysis Target | What to Capture |
|----------------|-----------------|
| Exported functions/classes | Public API surface, signatures, return types |
| API routes/endpoints | REST, GraphQL, tRPC definitions with methods |
| Configuration | Env vars, config files, feature flags |
| Database schemas | Models, migrations, relationships |
| Component hierarchy | UI components and their props/interfaces |
| Type definitions | Interfaces, types, Zod schemas, enums |
| Entry points | CLI commands, main files, server bootstrap |
| Dependencies | External packages and their roles |
STOP after analysis — present a summary of what was found and ask which documentation types are needed.
## Phase 2: Documentation Type Selection
| Type | When to Use | Output Path | Typical Size |
|------|-------------|-------------|-------------|
| **API Reference** | Documenting endpoints or public functions | `docs/api-reference.md` | 200-1000 lines |
| **Architecture Overview** | Explaining system design and data flow | `docs/architecture.md` | 100-300 lines |
| **Getting Started** | Onboarding new developers | `docs/getting-started.md` | 50-150 lines |
| **Component Docs** | Documenting UI components | `docs/components/[name].md` | 50-200 lines |
| **Contributing Guide** | Explaining how to contribute | `docs/contributing.md` | 50-100 lines |
| **Configuration Guide** | Documenting config options | `docs/configuration.md` | 50-200 lines |
| **Migration Guide** | Documenting version upgrades | `docs/migration/v[X]-to-v[Y].md` | 50-150 lines |
Ask the user which type(s) they need if not specified. If multiple types are requested, dispatch parallel subagents via the `Agent` tool — one per doc type.
## Phase 3: Generate Documentation
Dispatch `doc-generator` agent with:
- File analysis results from Phase 1
- Documentation type selected in Phase 2
- Existing documentation (to update, not replace)
- Project context from memory files
STOP after generation — present each section for review before saving.
### Documentation Format Standards
**API Reference format:**
```markdown
## `functionName(param1, param2)`
Description of what this function does.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| param1 | `string` | Yes | What it does |
| param2 | `Options` | No | Configuration options |
**Returns:** `Promise<Result>`
**Example:**
```typescript
const result = await functionName('value', { option: true });
```
**Throws:** `ValidationError` if param1 is empty
```
**Architecture Overview format:**
```markdown
## System Architecture
### Overview
[High-level description with ASCII diagram]
### Components
| Component | Responsibility | Key Files |
|-----------|---------------|-----------|
### Data Flow
[How data moves through the system — request lifecycle]
### Key Decisions
| Decision | Rationale | Alternatives Considered |
|----------|-----------|------------------------|
```
**Getting Started format:**
```markdown
## Prerequisites
[Required tools, versions, accounts]
## Installation
[Step-by-step with copy-pasteable commands]
## Configuration
[Required env vars and config]
## First Run
[How to start the app and verify it works]
## Next Steps
[Links to deeper documentation]
```
## Phase 4: Review and Save
Present documentation section by section:
1. Ask after each section: "Does this accurately describe the code?"
2. Cross-reference with actual code to verify accuracy
3. Include real examples from the codebase — never invented ones
4. After approval, save to `docs/` directory
5. Commit with message: `docs(<scope>): add/update <doc-type>`
### Accuracy Verification Checklist
| Check | How to Verify |
|-------|--------------|
| Function signatures match code | Read the source file |
| Examples actually work | Trace the code path |
| Config options are current | Check actual config files |
| Dependencies listed are installed | Check package.json / requirements |
| File paths referenced exist | Glob for the files |
## Anti-Patterns / Common Mistakes
| Mistake | Why It Is Wrong | What To Do Instead |
|---------|----------------|-------------------|
| Inventing code examples | Readers copy-paste and get errors | Extract real examples from the codebase |
| Documenting internal/private APIs | Creates coupling to implementation | Only document public/exported surface |
| Writing docs that duplicate source code | Goes stale immediately | Reference behavior, not implementation |
| Giant monolithic doc file | Hard to navigate and maintain | Split by concern (API, architecture, config) |
| Documenting aspirational behavior | Misleads users about current capabilities | Document what actually works today |
| Skipping the analysis phase | Miss important APIs or get signatures wrong | Always analyze code first |
| Not verifying examples compile/run | Broken docs worse than no docs | Test every code example |
## Anti-Rationalization Guards
- **Do NOT** generate documentation without first analyzing the actual code
- **Do NOT** invent examples — every code snippet must come from or be verified against the codebase
- **Do NOT** document private/internal APIs unless explicitly requested
- **Do NOT** skip the review phase — present each section for user verification
- **Do NOT** duplicate information already covered in other docs — reference instead
## Integration Points
| Skill | Relationship |
|-------|-------------|
| `prd-generation` | Upstream: PRD defines what needs documenting |
| `self-learning` | Parallel: both analyze codebase; self-learning populates memory files used here |
| `api-design` | Upstream: API design specs inform API reference docs |
| `spec-writing` | Parallel: specs define behavior; docs explain usage |
| `reverse-engineering-specs` | Upstream: reverse-engineered specs provide behavioral understanding |
| `code-review` | Downstream: reviewer checks if docs were updated alongside code changes |
## Verification Gate
Before claiming documentation is complete:
1. VERIFY all public APIs are documented with correct signatures
2. VERIFY code examples actually work (not invented)
3. VERIFY cross-references link to existing content
4. VERIFY documentation matches current code state
5. VERIFY the user has approved each section
6. RUN any documented commands to confirm they work
## Concrete Example: API Reference Entry
Given this source code:
```typescript
export async function createUser(data: CreateUserInput): Promise<User> {
// validates, hashes password, inserts into DB
}
```
Generate this documentation:
```markdown
## `createUser(data)`
Create a new user account with the provided details.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| data | `CreateUserInput` | Yes | User registration data |
**`CreateUserInput` shape:**
| Field | Type | Required | Constraints |
|-------|------|----------|-------------|
| email | `string` | Yes | Valid email format |
| password | `string` | Yes | Minimum 8 characters |
| name | `string` | Yes | 1-100 characters |
**Returns:** `Promise<User>` — the created user object (password excluded)
**Throws:**
- `ValidationError` — if input fails validation
- `ConflictError` — if email already exists
```
## Skill Type
**Flexible** — Adapt documentation depth and format to project needs while preserving the analyze-first principle and accuracy Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.