draft-docs
Generate first-draft technical documentation from code analysis
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/draft-docsDraft Docs
Generate Reference or How-To documentation drafts to docs/drafts/ for review before publishing.
Arguments
- Topic prompt: Description of what to document (e.g., "Document the WebSocket API")
- --publish [file]: Move reviewed draft to final location and update navigation
Mode 1: Generate Draft
/beagle-docs:draft-docs "Document the authentication middleware"
Step 0: Gather Context
Before parsing input, gather project context:
# Check for existing docs structure
ls -la docs/ 2>/dev/null || echo "No docs/ directory found"
# Identify documentation framework
ls docs/navigation.json docs/mint.json docs/docusaurus.config.js docs/mkdocs.yml 2>/dev/null | head -1
# Check for existing drafts
ls docs/drafts/*.md 2>/dev/null || echo "No existing drafts"
# Get recent code changes for context
git diff --name-only $(git merge-base HEAD main)..HEAD 2>/dev/null | head -20
Capture:
- Docs structure:
docs/subdirectories present - Navigation system:
navigation.json,mint.json, or other config - Tech stack hints: from file extensions and imports in changed files
- Existing drafts: to avoid duplicates
Step 1: Parse Input
Extract from the prompt:
- Topic: What to document (e.g., "authentication middleware")
- Content type: Detect from keywords:
| Keywords | Type | Skill |
|---|---|---|
| "how to", "guide", "steps", "configure", "set up" | How-To | howto-docs |
| "API", "reference", "parameters", "function", "endpoint" | Reference | reference-docs |
If ambiguous, ask: "Should this be a Reference doc (technical lookup) or How-To guide (task completion)?"
Step 2: Load Skills
Always load both:
beagle-docs:docs-style- Core writing principles- Detected type skill:
beagle-docs:reference-docsfor Referencebeagle-docs:howto-docsfor How-To
Step 3: Analyze Code
Search the codebase for relevant code:
- Symbol search: Find functions, classes, types matching the topic
- File search: Locate related files by name patterns
- Reference search: Find usage examples
Gather:
- Function/method signatures
- Type definitions
- Existing comments/docstrings
- Usage patterns in tests or examples
Step 4: Generate Draft
Apply the loaded skills to generate documentation:
For Reference docs:
- Follow
reference-docstemplate structure - Document all parameters with types
- Include complete, runnable examples from actual code
- Add Related section linking to connected symbols
For How-To docs:
- Follow
howto-docstemplate structure - Start title with "How to"
- List concrete prerequisites
- Break into single-action steps
- Include verification section
Step 5: Write Draft
-
Create output path:
docs/drafts/{slug}.md- Slug from topic: "WebSocket API" →
websocket-api.md
-
Ensure directory exists:
mkdir -p docs/drafts
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-draft-docs": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do