From arc
Generates documentation for codebases—from file references and feature guides to full sites. Detects frameworks like Fumadocs, Nextra, Docusaurus for correct format. Activates on 'document this' or 'generate docs'.
npx claudepluginhub howells/arc --plugin arcThis skill uses the workspace's default tool permissions.
<tool_restrictions>
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
<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 — Preserve the one-question-at-a-time interaction pattern for every user question, including clarifying scope, choosing audience, and validating content. In Claude Code, use the tool. In Codex, ask one concise plain-text question at a time unless a structured question tool is actually available in the current mode. This prevents walls of text with multiple questions. If you need to provide context before asking, keep it to 2-3 sentences max, and do not narrate missing tools or fallbacks to the user.If you feel the urge to "plan before acting" — that urge is satisfied by following the <process> steps below. Execute them directly.
</tool_restrictions>
<arc_runtime>
This workflow requires the full Arc bundle, not a prompts-only install.
Resolve the Arc install root from this skill's location and refer to it as ${ARC_ROOT}.
Use ${ARC_ROOT}/... for Arc-owned files such as references/, disciplines/, agents/, templates/, and scripts/.
Use project-local paths such as .ruler/ or rules/ for the user's repository.
</arc_runtime>
<key_principles>
<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/arc/progress.md (first 50 lines)
Check for recent documentation work or related changes. </progress_context>
# 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.
${ARC_ROOT}/templates/doc-templates.mdSpawn docs-writer agents in batches following ${ARC_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"
## 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.
<arc_log>
After completing this skill, append to the activity log.
See: ${ARC_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: