Documentation Skill
Generate and maintain documentation that meets or exceeds the standard set by the best open-source Rails/JS projects (Inertia Rails, Vite Ruby, Rails itself).
Before You Start
Read these reference files (located in the references/ subdirectory next to this SKILL.md file) before proceeding:
- Quality Standard —
references/quality-standard.md — tiered audit checklist (Must-Have / Expected / Differentiator)
- Documentation Templates —
references/templates.md — structural skeletons for each doc type
- Competitive Landscape —
references/competitive-landscape.md — benchmarks against peer projects
Workflow
Step 1: Assess the current state
- Scan the repo for existing docs:
docs/, README.md, CHANGELOG.md, CONTRIBUTING.md, inline code comments, Wiki, and any hosted doc site config (VitePress, Docusaurus, Jekyll, etc.)
- Identify what exists, what is outdated, and what is missing
- Compare against the Quality Standard reference above
Step 2: Determine scope
If the user gave a specific target (e.g., /docs $ARGUMENTS), focus there. Otherwise, present a prioritized gap analysis:
- Critical gaps - Missing README sections, no quick start, no API reference
- High-value improvements - Outdated guides, missing migration/upgrade docs, no troubleshooting
- Polish - LLMs.txt, cookbook/recipes, configuration reference, contributor guide improvements
Ask the user which items to tackle (or do all if they say so).
Step 3: Generate or rewrite documentation
Follow these principles for ALL documentation:
Voice and Style
- Direct and concise. Lead with what the reader needs. No filler.
- Show, don't tell. Every concept gets a code example. Prefer real-world examples over contrived ones.
- Progressive disclosure. Quick start first, then deeper guides, then API reference. Layer complexity.
- Avoid em dashes (use commas, parentheses, or separate sentences instead).
- Use second person ("you") for guides and tutorials. Use third person for API references.
- Prefer active voice. "Run
bundle install" not "The bundle should be installed."
Structure by Doc Type
README.md (the front door):
- One-liner description + badges
- "What is this?" in 2-3 sentences
- Quick install (copy-paste ready)
- Minimal "Hello World" example that works
- Link table to deeper docs
- Requirements / compatibility matrix
- Community links (Slack, Discussions, Stack Overflow)
- Contributing pointer
- License
Quick Start Guide (< 15 minutes):
- Prerequisites with exact version requirements
- Step-by-step, numbered instructions
- Every command is copy-paste ready
- "You should see..." verification checkpoints after key steps
- Link to "next steps" at the end
Conceptual Guides (explain "why" and "how"):
- Start with a one-paragraph summary of what the reader will learn
- Use diagrams (Mermaid or ASCII) for architecture and data flow
- Break into logical sections with clear headings
- End each guide with "Related" links
API / Helper Reference:
- One page per module or helper group
- Signature, parameters table, return value, exceptions
- At least one usage example per method
- For Ruby: follow YARD conventions (
@param, @return, @example)
- For TypeScript: follow TSDoc conventions (
@param, @returns, @example)
Configuration Reference:
- Table format: option name, type, default, description
- Group by category
- Include example config file (annotated with comments)
Migration / Upgrade Guide:
- Version-to-version, with exact steps
- "Breaking changes" section at top
- "Deprecations" section
- Automated migration commands if available
- Before/after code comparisons
Troubleshooting / FAQ:
- Problem statement as the heading (what the user sees or encounters)
- Cause explanation (1-2 sentences)
- Solution with exact commands or code
- "Still stuck?" pointer to community support
LLMs.txt (AI-friendly docs):
/llms.txt with a structured overview and links to key pages
/llms-full.txt with complete documentation in a single Markdown file
- Follow the llms.txt specification: title, description, sections with URLs
- Include on every docs page: "Are you an LLM? View /llms.txt for optimized documentation"
Step 4: Cross-reference and link
- Every guide should link to related guides
- Every API method mentioned in a guide should link to its reference page
- Add a "See also" or "Related" section at the bottom of each page
- Verify no dead links (check file paths exist)
Step 5: Review with the user
Present the generated docs and ask:
- "Does this match how your project actually works?"
- "Any terminology or naming I got wrong?"
- "Anything missing for your users?"
Targeting Specific Files
When invoked as /docs <target>:
- If
<target> is a file path: generate/update docs FOR that code file (inline comments, module-level docs, method docs)
- If
<target> is a directory: generate/update docs for the entire module
- If
<target> is a doc type keyword (e.g., "readme", "api", "quickstart", "migration", "troubleshooting", "llms.txt", "audit"): generate that specific doc type
- If
<target> is "audit": run a full gap analysis against the Quality Standard reference above and report findings
Language-Specific Conventions
Ruby
- Use YARD doc format for all public methods and classes
@param name [Type] description
@return [Type] description
@raise [ExceptionClass] when condition
@example with realistic usage
@see for cross-references
- Document
@option for hash parameters
TypeScript / JavaScript
- Use TSDoc for TypeScript, JSDoc for JavaScript
@param name - description
@returns description
@throws {ErrorType} description
@example blocks with realistic usage
- Export documentation: what is public API vs. internal
- Document generic type parameters
Markdown Docs
- Use ATX headings (
#, ##, ###) not Setext
- Fenced code blocks with language identifiers (
ruby, typescript, ```bash)
- Use reference-style links for repeated URLs
- Tables for configuration options and API parameter lists
- Admonitions for warnings and tips (use blockquote style:
> **Note:** ... or > **Warning:** ...)
1---2name: docs-23description: Generate, audit, or update project documentation to a professional open-source standard. Use this skill whenever the user mentions docs, documentation, README, API reference, guides, migration guides, troubleshooting, llms.txt, doc audit, or wants to improve any written developer-facing content in a repository. Also trigger when the user says things like "document this", "write docs for", "update the docs", "our docs need work", or compares documentation quality to other projects. Covers Ruby (YARD), TypeScript (TSDoc/JSDoc), Markdown guides, configuration references, and doc site structure.4---56# Documentation Skill78Generate and maintain documentation that meets or exceeds the standard set by the best open-source Rails/JS projects (Inertia Rails, Vite Ruby, Rails itself).910## Before You Start1112Read these reference files (located in the `references/` subdirectory next to this SKILL.md file) before proceeding:13141. **Quality Standard** — `references/quality-standard.md` — tiered audit checklist (Must-Have / Expected / Differentiator)152. **Documentation Templates** — `references/templates.md` — structural skeletons for each doc type163. **Competitive Landscape** — `references/competitive-landscape.md` — benchmarks against peer projects1718## Workflow1920### Step 1: Assess the current state2122- Scan the repo for existing docs: `docs/`, `README.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, inline code comments, Wiki, and any hosted doc site config (VitePress, Docusaurus, Jekyll, etc.)23- Identify what exists, what is outdated, and what is missing24- Compare against the Quality Standard reference above2526### Step 2: Determine scope2728If the user gave a specific target (e.g., `/docs $ARGUMENTS`), focus there. Otherwise, present a prioritized gap analysis:29301. **Critical gaps** - Missing README sections, no quick start, no API reference312. **High-value improvements** - Outdated guides, missing migration/upgrade docs, no troubleshooting323. **Polish** - LLMs.txt, cookbook/recipes, configuration reference, contributor guide improvements3334Ask the user which items to tackle (or do all if they say so).3536### Step 3: Generate or rewrite documentation3738Follow these principles for ALL documentation:3940#### Voice and Style41- **Direct and concise.** Lead with what the reader needs. No filler.42- **Show, don't tell.** Every concept gets a code example. Prefer real-world examples over contrived ones.43- **Progressive disclosure.** Quick start first, then deeper guides, then API reference. Layer complexity.44- **Avoid em dashes** (use commas, parentheses, or separate sentences instead).45- **Use second person** ("you") for guides and tutorials. Use third person for API references.46- **Prefer active voice.** "Run `bundle install`" not "The bundle should be installed."4748#### Structure by Doc Type4950**README.md** (the front door):51- One-liner description + badges52- "What is this?" in 2-3 sentences53- Quick install (copy-paste ready)54- Minimal "Hello World" example that works55- Link table to deeper docs56- Requirements / compatibility matrix57- Community links (Slack, Discussions, Stack Overflow)58- Contributing pointer59- License6061**Quick Start Guide** (< 15 minutes):62- Prerequisites with exact version requirements63- Step-by-step, numbered instructions64- Every command is copy-paste ready65- "You should see..." verification checkpoints after key steps66- Link to "next steps" at the end6768**Conceptual Guides** (explain "why" and "how"):69- Start with a one-paragraph summary of what the reader will learn70- Use diagrams (Mermaid or ASCII) for architecture and data flow71- Break into logical sections with clear headings72- End each guide with "Related" links7374**API / Helper Reference**:75- One page per module or helper group76- Signature, parameters table, return value, exceptions77- At least one usage example per method78- For Ruby: follow YARD conventions (`@param`, `@return`, `@example`)79- For TypeScript: follow TSDoc conventions (`@param`, `@returns`, `@example`)8081**Configuration Reference**:82- Table format: option name, type, default, description83- Group by category84- Include example config file (annotated with comments)8586**Migration / Upgrade Guide**:87- Version-to-version, with exact steps88- "Breaking changes" section at top89- "Deprecations" section90- Automated migration commands if available91- Before/after code comparisons9293**Troubleshooting / FAQ**:94- Problem statement as the heading (what the user sees or encounters)95- Cause explanation (1-2 sentences)96- Solution with exact commands or code97- "Still stuck?" pointer to community support9899**LLMs.txt** (AI-friendly docs):100- `/llms.txt` with a structured overview and links to key pages101- `/llms-full.txt` with complete documentation in a single Markdown file102- Follow the llms.txt specification: title, description, sections with URLs103- Include on every docs page: "Are you an LLM? View /llms.txt for optimized documentation"104105### Step 4: Cross-reference and link106107- Every guide should link to related guides108- Every API method mentioned in a guide should link to its reference page109- Add a "See also" or "Related" section at the bottom of each page110- Verify no dead links (check file paths exist)111112### Step 5: Review with the user113114Present the generated docs and ask:115- "Does this match how your project actually works?"116- "Any terminology or naming I got wrong?"117- "Anything missing for your users?"118119## Targeting Specific Files120121When invoked as `/docs <target>`:122- If `<target>` is a file path: generate/update docs FOR that code file (inline comments, module-level docs, method docs)123- If `<target>` is a directory: generate/update docs for the entire module124- If `<target>` is a doc type keyword (e.g., "readme", "api", "quickstart", "migration", "troubleshooting", "llms.txt", "audit"): generate that specific doc type125- If `<target>` is "audit": run a full gap analysis against the Quality Standard reference above and report findings126127## Language-Specific Conventions128129### Ruby130- Use YARD doc format for all public methods and classes131- `@param name [Type] description`132- `@return [Type] description`133- `@raise [ExceptionClass] when condition`134- `@example` with realistic usage135- `@see` for cross-references136- Document `@option` for hash parameters137138### TypeScript / JavaScript139- Use TSDoc for TypeScript, JSDoc for JavaScript140- `@param name - description`141- `@returns description`142- `@throws {ErrorType} description`143- `@example` blocks with realistic usage144- Export documentation: what is public API vs. internal145- Document generic type parameters146147### Markdown Docs148- Use ATX headings (`#`, `##`, `###`) not Setext149- Fenced code blocks with language identifiers (```ruby, ```typescript, ```bash)150- Use reference-style links for repeated URLs151- Tables for configuration options and API parameter lists152- Admonitions for warnings and tips (use blockquote style: `> **Note:** ...` or `> **Warning:** ...`)