Generate documentation for your codebase — reference docs for a file, feature guides, or a full documentation site. Use when asked to "document this", "generate docs", "write documentation", "create API reference", or when you need thorough documentation for a module, feature, or entire project. Framework-aware: detects Fumadocs, Nextra, Docusaurus, etc. and generates in the right format.
Generates comprehensive documentation for codebases, detecting frameworks and creating reference docs, feature guides, or full documentation sites.
/plugin marketplace add howells/arc/plugin install arc@howellsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
<tool_restrictions>
EnterPlanMode — BANNED. Do NOT call this tool. This skill has its own documentation generation process. Claude's built-in plan mode would bypass it.ExitPlanMode — BANNED. You are never in plan mode. There is nothing to exit.AskUserQuestion — ALWAYS use this for questions. Never ask questions as plain text in your response. Every question to the user — whether clarifying scope, choosing audience, or validating content — MUST use the AskUserQuestion tool. This enforces one question at a time and prevents walls of text with multiple questions. If you need to provide context before asking, keep it to 2-3 sentences max, then use the tool.If you feel the urge to "plan before acting" — that urge is satisfied by following the <process> steps below. Execute them directly.
</tool_restrictions>
<key_principles>
AskUserQuestion tool. Never write questions as plain text. Never ask more than one question per message.<tasklist_context> Use TaskList tool to check for existing tasks related to documentation work.
If a related task exists, note its ID and mark it in_progress with TaskUpdate when starting.
</tasklist_context>
<required_reading> Read these reference files NOW:
<progress_context>
Use Read tool: docs/progress.md (first 50 lines)
Check for recent documentation work or related changes. </progress_context>
<process> # Documentation GenerationSilently gather context (don't dump findings on the user):
package.json — identify stack, dependencies, project nameapp/, pages/, src/, packages/docs/**/*.md, docs/**/*.mdx, content/**/*.md, content/**/*.mdxThen determine intent from the user's input:
If user provided a file/directory path (e.g., /arc:document src/lib/auth.ts):
Question: "I see [file] exports [N] functions and [N] types. Should I..."
Header: "Scope"
Options:
- label: "Document just this file"
description: "Reference doc: exports, types, usage examples"
- label: "Document the broader feature"
description: "Feature guide: all related files, end-to-end"
If user provided a description (e.g., "document the auth feature"):
If user provided no args:
Question: "What would you like to document?"
Header: "Scope"
Options:
- label: "A specific file or module"
description: "I'll point you at a file and generate a reference doc"
- label: "A feature"
description: "End-to-end documentation for a feature across all its files"
- label: "The entire project"
description: "Full documentation site — I'll scan the codebase and generate everything"
Question: "Who is this documentation for?"
Header: "Audience"
Options:
- label: "Developers"
description: "How the code works: architecture, types, patterns, dependencies"
- label: "Users"
description: "How to use it: getting started, configuration, examples"
- label: "Both"
description: "Separate sections for developers and users"
Question: "I see existing docs at [path]. Should I..."
Header: "Existing docs"
Options:
- label: "Add to existing structure"
description: "Create new doc files in the existing docs directory"
- label: "Create standalone"
description: "Generate docs in a new location"
Scan the codebase. Identify documentable units:
| What | Detection |
|---|---|
| Routes/Pages | Glob app/, pages/, src/app/ |
| API endpoints | Glob api/ routes, server actions, tRPC routers |
| Components | Exported components with props/interfaces |
| Packages | packages/*/package.json in monorepos |
| Configuration | .env.example, config files, environment variables |
| Database schema | Drizzle schema files, Prisma schema |
| Authentication | Auth providers, middleware, protected routes |
| CLI commands | bin/ or command definitions |
Generate an outline. Present it to the user:
I found [N] routes, [N] API endpoints, [N] packages, and a [database] schema.
Proposed documentation outline:
1. Getting Started
2. Features
- Auth (5 files)
- Billing (3 files)
- Notifications (4 files)
3. API Reference
- Users endpoint
- Orders endpoint
4. Architecture
- Overview
5. Reference
- Components (12)
- Utilities (8)
Ask for approval via AskUserQuestion:
Question: "Does this outline look right?"
Header: "Outline"
Options:
- label: "Yes, proceed"
description: "Generate docs for all these sections"
- label: "Remove some sections"
description: "I'll tell you what to skip"
- label: "Add something missing"
description: "There's something I want documented that's not listed"
Ask audience (same question as Reference/Feature flow)
Check package.json dependencies and project files:
| Framework | Detection | Content Format |
|---|---|---|
| Fumadocs | fumadocs-core in deps, source.config.ts exists | .mdx with meta.json sidebar configs |
| Nextra | nextra in deps, _meta.json files exist | .mdx with _meta.json sidebar configs |
| Docusaurus | @docusaurus/core in deps | .mdx with sidebars.js |
| Starlight | @astrojs/starlight in deps | .mdx with Astro sidebar config |
| VitePress | vitepress in deps | .md with .vitepress/config sidebar |
| None | No framework detected | .md with README index |
If framework detected:
content/docs/ for Fumadocs)If no framework detected:
/arc:implement?"Question: "No docs framework detected. Want to..."
Header: "Format"
Options:
- label: "Plain markdown"
description: "Simple .md files with a README index. Works everywhere."
- label: "Set up a framework first"
description: "I'll recommend one for your stack. Use /arc:implement to scaffold it, then come back."
Before generating all docs, produce one sample section.
Pick the most representative section from the outline (or the target for Reference/Feature flow). Generate it fully.
Show the sample to the user, then ask via AskUserQuestion:
Question: "Here's the [section name] documentation. Is the depth and style right?"
Header: "Style check"
Options:
- label: "Yes, generate the rest"
description: "This depth and tone is what I want"
- label: "More detailed"
description: "Include more technical depth, more examples"
- label: "Less detailed"
description: "Keep it higher-level, less verbose"
- label: "Different tone"
description: "I'll describe what I want changed"
If user wants changes: adjust and regenerate the sample. Repeat until approved.
This validated sample becomes the style reference for all subsequent generation (and for docs-writer agents in full-site mode).
Determine where docs should live.
If existing docs directory was found in Phase 1, propose using it.
Otherwise, ask via AskUserQuestion:
Question: "Where should the docs live?"
Header: "Location"
Options:
- label: "docs/"
description: "Standard convention at the repo root"
- label: "apps/docs/content/"
description: "Monorepo convention — docs as a separate app"
For Fumadocs projects, check source.config.ts for the configured content directory and use that.
Single-pass generation. No agents needed.
${CLAUDE_PLUGIN_ROOT}/templates/doc-templates.mdSpawn docs-writer agents in batches following ${CLAUDE_PLUGIN_ROOT}/disciplines/dispatching-parallel-agents.md.
Prepare agent assignments. Each outline section = one agent. Each agent gets:
.md or .mdxDispatch in batches of 2-3.
Batch 1: Agent → Features/Auth, Agent → Features/Billing
Batch 2: Agent → API Reference, Agent → Architecture
Batch 3: Agent → Components Reference, Agent → Getting Started
Collect results. Each agent returns file contents in delimiter format.
Write files. Create the directory structure and write each file.
After all agents return:
[see auth](../features/auth.md)) point to real files.Generate supporting infrastructure:
For plain markdown:
README.md — Index with links to all sections, using the full-site index templategetting-started.md — Quick start guide (if full-site mode)For Fumadocs:
meta.json in each directory — sidebar orderingindex.mdx — Landing pagegetting-started.mdx — Quick start guide (if full-site mode)For Nextra:
_meta.json in each directoryFor other frameworks:
Present what was generated:
Documentation generated:
Files: [N] docs written
Location: [path]
Format: [markdown / Fumadocs MDX / etc.]
Audience: [developer / user / both]
Sections:
- Getting Started
- Features: Auth, Billing, Notifications
- API Reference: Users, Orders
- Architecture: Overview
- Reference: Components, Utilities
Then offer next steps via AskUserQuestion:
Question: "What's next?"
Header: "Next step"
Options:
- label: "Review the docs"
description: "I'll walk through each section for your approval"
- label: "Add more sections"
description: "Document additional features or modules"
- label: "Set up a docs framework"
description: "Scaffold a docs site with /arc:implement to host these"
- label: "Done"
description: "Documentation is complete"
</process>
<integration>
## Integration with Other Skills
Doc staleness detection: /arc:implement checks for stale docs after completing work. If changed files have associated documentation, they prompt the user to update inline.
Production readiness: /arc:letsgo includes documentation coverage as a checklist item.
Design context: /arc:ideate reads existing docs to understand the current feature set.
Framework scaffolding: If the user wants a docs site (Fumadocs, etc.), route them to /arc:implement for the infrastructure. /arc:document generates content, not apps.
</integration>
<arc_log>
After completing this skill, append to the activity log.
See: ${CLAUDE_PLUGIN_ROOT}/references/arc-log.md
Entry: /arc:document — [scope] ([audience]) [N files]
Examples:
/arc:document — auth.ts reference (developer) 1 file/arc:document — auth feature guide (user) 3 files/arc:document — full site (both) 24 files
</arc_log><success_criteria> Documentation is complete when:
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.