| name | outfitter-documentation |
| description | Documentation structure and templates for READMEs, API docs, guides, and CLI references. Use when creating docs, writing READMEs, or structuring a docs/ directory. |
| metadata | {"version":"2.0.1","author":"outfitter","category":"documentation"} |
Documentation Standards
Structure and templates for project documentation โ the human-facing docs that help developers understand and use your project.
This skill covers what to include and where it goes. For how to write it:
- Load the
outfitter-styleguide skill for sentence rhythm, metaphors, structural moves
- Load the
outfitter-voice skill for philosophical foundation (apply as review pass)
For agent-specific documentation (CLAUDE.md, AGENTS.md), load the outfitter-agents-setup skill.
Documentation Hierarchy
Documentation is prioritized in this order:
- Types โ Self-documenting code through TypeScript types
- Inline comments โ TSDoc/JSDoc for non-obvious decisions
docs/ โ Broader architectural and reference material
All three levels matter. Types express intent through code, comments explain why, and docs provide context.
Project Directory Structure
Standardized directory layout for documentation across repositories.
Root-Level Files
| File | Purpose |
|---|
README.md | Entry point for humans โ quick start, links to docs |
CONTRIBUTING.md | Contribution guidelines (if applicable) |
CHANGELOG.md | Version history (auto-generated preferred) |
Standard Directories
project/
โโโ docs/
โโโ architecture/ # System design, ADRs
โโโ api/ # API reference (if applicable)
โโโ cli/ # CLI command reference
โโโ guides/ # How-to guides, tutorials
โโโ development/ # Dev setup, workflows
Directory Purpose
| Directory | Content |
|---|
architecture/ | System design docs, Architecture Decision Records (ADRs), diagrams |
api/ | API reference, endpoint documentation, type definitions |
cli/ | Command reference, flags, usage examples, exit codes |
guides/ | How-to tutorials, walkthroughs, use-case guides |
development/ | Contributing setup, local dev, testing, release process |
Source of Truth Principle
Each type of documentation should have one canonical location:
- API reference โ Generated from code or
docs/api/
- CLI reference โ
docs/cli/ or generated from help text
- Architecture decisions โ
docs/architecture/ or ADRs
Avoid duplicating content across locations. Link instead of copy.
README Standards
READMEs are the entry point for new contributors. Keep them focused and scannable.
Structure Template
See templates/README.md for the full template.
Length Guidelines
- Target: 150-250 lines
- Maximum: 400 lines (beyond this, extract to
docs/)
- Minimum: 50 lines (needs at least: description, install, usage)
- Flexible: As long as needed for pain, value prop, quick starts, doc pointers
What Belongs in README vs docs/
| README | docs/ |
|---|
| Quick start (5-10 steps max) | Full tutorials |
| Feature list (bullet points) | Feature deep-dives |
| Installation options | Configuration reference |
| Links to detailed docs | The detailed docs themselves |
Leading Section Pattern
Choose based on project type:
- Libraries/Tools: Lead with "Quick Start" โ users want to try it immediately
- Frameworks/Platforms: Lead with "Why X?" โ users need to understand the value proposition
- Internal Tools: Lead with "Usage" โ users already know why, they need how
Stability Tier Labels
When documenting packages or components with different maturity levels, use these labels:
| Label | Meaning | Guidance |
|---|
| Stable | APIs locked, breaking changes rare | Safe to depend on |
| Active | APIs evolving based on usage | Watch for updates |
| Early | APIs will change, not production-ready | Use with caution |
Avoid metaphorical labels (Cold/Warm/Hot, etc.) โ literal labels require no interpretation.
Quick Start Best Practices
-
Make it copy-paste runnable. Use heredoc format when showing file creation:
cat > example.ts << 'EOF'
import { ok, err } from '@org/contracts';
// ... code
EOF
bun run example.ts
-
Show output, including errors. Demonstrate both success and failure:
$ my-tool search --query "test"
Found: [ "result-1", "result-2" ]
$ my-tool search
Error [validation]: Query is required
Showing error output proves your error handling works.
-
End with a memorable closer. After the output block, add a confident one-liner:
**Output:**
```
Found: [ "result-1", "result-2" ]
```
Done. You're building type-safe infrastructure.
-
Use domain-relevant examples. Avoid generic "Hello, World!" โ use examples that demonstrate actual value.
CLI Documentation
For projects with CLIs, document commands in docs/cli/.
Command Reference Template
See templates/COMMAND-REFERENCE.md for the full template.
Document Structure
Every technical document should follow the structure in templates/DOCUMENT.md.
Heading Hierarchy
- H1 (#): Document title only
- H2 (##): Major sections
- H3 (###): Subsections
- H4 (####): Specific topics within subsections
- Avoid deeper nesting than H4
Code Examples
Requirements
- Include all necessary imports
- Show both definition and usage
- Add brief comments for complex logic
- Ensure examples are runnable
- Test examples before documenting
Good Example
interface UserConfig {
timeout: number;
retries: number;
}
function configureUser(options: UserConfig): void {
if (options.timeout <= 0) {
throw new Error("Timeout must be positive");
}
applyConfig(options);
}
configureUser({ timeout: 5000, retries: 3 });
Bad Example
function configure(opts) {
}
API Documentation
Function Documentation
function processUser(userData: UserData, rules: ProcessRules): ProcessedUser;
Parameter Documentation
Always document:
- Type: Explicit TypeScript types
- Purpose: What the parameter controls
- Constraints: Valid ranges, formats, or values
- Defaults: If applicable
- Examples: For complex types
Configuration Tables
| Option | Type | Default | Description |
| --------- | --------- | ------- | ------------------------------- |
| `port` | `number` | `3000` | Server port |
| `timeout` | `number` | `30000` | Request timeout in milliseconds |
| `debug` | `boolean` | `false` | Enable debug logging |
Maintenance
- Update with code: Documentation changes must accompany code changes
- Review regularly: Audit documentation quarterly for accuracy
- Remove outdated content: Delete obsolete information rather than marking as deprecated
- Version appropriately: Clearly document breaking changes and migration paths
- Test examples: Verify all code examples work with current versions
Review Checklist
Before finalizing documentation: