Load when working on documentation systems, README files, API docs, or implementing documentation workflows. Contains best practices for treating documentation as code with version control, automation, and CI/CD integration.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
"Documentation should be treated like code: version-controlled, reviewed, tested, and continuously deployed."
Docs-as-Code means writing documentation with the same tools and workflows as software development.
# Preferred formats:
- Markdown (.md) - Most common, widely supported
- reStructuredText (.rst) - Python ecosystem standard
- AsciiDoc (.adoc) - Technical documentation
# Avoid:
- Word documents
- Google Docs (for primary source)
- PDFs as source (OK as output)
Structure documentation from simple to complex:
1. Code itself (good naming = self-documenting)
↓
2. Inline comments (explain "why")
↓
3. Docstrings (API contracts)
↓
4. README.md (entry point, quick start)
↓
5. docs/ directory (detailed guides)
↓
6. External docs site (comprehensive reference)
# Project Name
One-sentence description of what this project does.
## Quick Start
```bash
pip install project-name
from project import main_function
result = main_function(data)
pyproject.tomlpip install project-name
# Or with uv (faster)
uv pip install project-name
git clone https://github.com/org/project.git
cd project
uv sync # Install dependencies
cd project
pip install -e .
[Simple use case with code]
[More complex use case]
Full documentation available at: docs.project.com
See CONTRIBUTING.md for guidelines.
## Docs Directory Structure
docs/ ├── index.md # Documentation home ├── getting-started/ │ ├── installation.md │ ├── quickstart.md │ └── configuration.md ├── guides/ │ ├── basic-usage.md │ ├── advanced-topics.md │ └── best-practices.md ├── reference/ │ ├── api.md # Auto-generated from docstrings │ ├── cli.md │ └── configuration.md ├── tutorials/ │ ├── tutorial-1.md │ └── tutorial-2.md ├── contributing/ │ ├── development.md │ ├── testing.md │ └── releasing.md └── changelog.md
## Documentation Tools
### Python Ecosystem
```yaml
# mkdocs.yml for MkDocs
site_name: Project Name
theme:
name: material
plugins:
- search
- mkdocstrings:
handlers:
python:
selection:
docstring_style: google
nav:
- Home: index.md
- Getting Started: getting-started/
- API Reference: reference/api.md
# conf.py
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]
# .github/workflows/docs.yml
name: Documentation
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'src/**/*.py'
pull_request:
paths:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[docs]"
- name: Build docs
run: mkdocs build --strict
- name: Check links
run: |
pip install linkchecker
linkchecker site/
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
Delete documentation that is:
"Fresh, accurate documentation beats extensive outdated materials."
---
last_updated: 2024-01-15
status: current # or: needs-review, deprecated
applies_to: v2.0+
---
# Check for broken links
linkchecker docs/
# Or use markdown-link-check
find docs -name "*.md" | xargs markdown-link-check
# .github/workflows/spellcheck.yml
- name: Spell check
uses: rojopolis/spellcheck-github-actions@v0
with:
config_path: .spellcheck.yml
# Vale for prose linting
vale docs/
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).
## [Unreleased]
### Added
- New feature description
### Changed
- Change description
### Fixed
- Bug fix description
## [1.0.0] - 2024-01-15
### Added
- Initial release with core functionality