Docs Refresh
Purpose
Keep generated documentation in sync with source files. Manages skill reference documentation, project-level Claude instructions, and validates human-written documentation.
When to Use
- •After modifying skill configurations
- •When adding or removing skills
- •Before creating PRs that change documentation sources
- •When CI reports documentation is out of sync
Quick Reference
- •Setup:
/docs-refresh configure(run once during framework setup) - •Config:
.claude/skills/docs-refresh.yaml - •Stop hook:
task -t .claude/Taskfile.skills.yaml validate-skill -- --skill docs-refresh
Configure Mode
Configure documentation settings during framework setup:
/docs-refresh configure
Discovers:
- •Documentation directory (
docs/,documentation/,wiki/) - •Documentation format (markdown, rst, mdx)
- •CLAUDE.md location
- •Generated vs human-written documentation
Outputs: .claude/skills/docs-refresh.yaml
# Documentation configuration
# Generated by: /docs-refresh configure
paths:
docs_directory: "docs/"
claude_md: "CLAUDE.md"
format: markdown
generated_docs:
- path: "docs/api/"
source: "src/"
generator: "task docs:generate-api"
human_docs:
- "README.md"
- "CONTRIBUTING.md"
- "docs/guides/"
Discovery Procedure
- •Detect docs directory by checking common locations
- •Detect format from file extensions (.md, .rst, .mdx)
- •Find CLAUDE.md in project root
- •Identify generated docs by looking for generator configs
- •Propose configuration to user for approval
- •Save to
.claude/skills/docs-refresh.yaml
Commands
# Generate skills reference documentation (outputs: docs/skills/REFERENCE.md) task -t .claude/Taskfile.skills.yaml skills-reference
Project-specific documentation commands are configured in the project's Taskfile:
# Regenerate all documentation (project-specific) task docs:refresh # Check if docs are in sync (CI mode) task docs:check
What It Manages
| Type | Description |
|---|---|
| Generated docs | API references, schema docs, auto-generated from source |
| CLAUDE.md | Project instructions for Claude (includes skills table) |
| README.md | Validates consistency with source of truth |
Documentation Sources
Documentation sources are configured per-project in skill.yaml:
documentation_sources:
api_docs:
sources:
- path: "${DOCS_PATH}/api/"
update_trigger: "When API endpoints change"
guides:
sources:
- path: "${DOCS_PATH}/"
update_trigger: "When workflows change"
CLAUDE.md Skills Table
The skills table in CLAUDE.md lists all skills and when to use them:
| Skill | When to Use | |-------|-------------| | `setup` | Setting up a new development environment | | `commit` | Creating conventional commits |
When adding/removing skills:
- •Update the skills table in
CLAUDE.md - •Run documentation refresh command
- •Commit both files together
Patterns
Never Edit Generated Docs
Generated documentation should never be manually edited:
BAD: vim docs/api/generated.md GOOD: Update source code, then regenerate docs
Docs With Code
Update documentation when changing related code:
- •Implement the feature
- •Update relevant documentation
- •Regenerate any generated docs
- •Commit code and docs together
When It Fails
- •Documentation out of sync: Run refresh command to regenerate
- •Source files invalid: Fix syntax errors in source files
- •Missing CLAUDE.md: Create project instructions file
Configuration
Config Location
Config path depends on how the plugin was installed:
| Plugin Scope | Config File | Git |
|---|---|---|
| project | .claude/skills/docs-refresh.yaml | Committed (shared) |
| local | .claude/skills/docs-refresh.local.yaml | Ignored (personal) |
| user | .claude/skills/docs-refresh.local.yaml | Ignored (personal) |
Precedence when reading (first found wins):
- •
.claude/skills/docs-refresh.local.yaml - •
.claude/skills/docs-refresh.yaml - •Skill defaults
Config Fields
Set via /docs-refresh configure:
| Field | Description | Example |
|---|---|---|
paths.docs_directory | Documentation directory | docs/ |
paths.claude_md | CLAUDE.md location | CLAUDE.md |
format | Format (markdown, rst, mdx) | markdown |
generated_docs | Auto-generated documentation | API docs, schema docs |
human_docs | Human-written documentation | README, guides |
Automation
See skill.yaml for the full procedure and customization guide.
See sharp-edges.yaml for common failure modes.