Claude-skill-registry build-docs
Generate reference docs, build Sphinx documentation, and review all screenshots
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/build-docs" ~/.claude/skills/majiayu000-claude-skill-registry-build-docs && rm -rf "$T"
manifest:
skills/data/build-docs/SKILL.mdsource content
Build Documentation Skill
Generate all reference documentation from code, build Sphinx docs, capture tutorial screenshots, and review everything for issues.
When to Use
- After making changes to actions, mouse profiles, or UI
- Before committing documentation changes
- When preparing a release
- When asked to "build the docs" or "generate documentation"
Prerequisites
- Python environment with project dependencies (
)uv sync - For full generation: 3D Slicer installed with
inSLICER_PATH.env - For partial generation: Works without Slicer (mouse profiles only)
Quick Start
Minimal (No Slicer Required)
# Generate mouse profiles reference python MouseMaster/Testing/Python/test_generate_mouse_profiles.py # Build docs (will have placeholder for actions) pip install -r docs/requirements.txt sphinx-build -b html docs docs/_build/html
Full Generation (Requires Slicer)
# Set Slicer path export SLICER_PATH=/path/to/Slicer # Generate all reference docs python MouseMaster/Testing/Python/test_generate_mouse_profiles.py $SLICER_PATH --no-splash \ --python-script MouseMaster/Testing/Python/test_generate_actions_reference.py \ --additional-module-paths $(pwd)/MouseMaster # Generate tutorial screenshots $SLICER_PATH --no-splash \ --python-script MouseMaster/Testing/Python/test_tutorial_workflow.py \ --additional-module-paths $(pwd)/MouseMaster # Build docs sphinx-build -b html docs docs/_build/html
Step-by-Step Workflow
Step 1: Generate Mouse Profiles Reference
This can run standalone without Slicer:
python MouseMaster/Testing/Python/test_generate_mouse_profiles.py
Output:
docs/reference/_generated/mouse-profiles.rst
Verify:
cat docs/reference/_generated/mouse-profiles.rst | head -50
Should show all mouse profiles with button tables.
Step 2: Generate Actions Reference (Requires Slicer)
$SLICER_PATH --no-splash \ --python-script MouseMaster/Testing/Python/test_generate_actions_reference.py \ --additional-module-paths $(pwd)/MouseMaster
Output:
docs/reference/_generated/actions.rst
Verify:
cat docs/reference/_generated/actions.rst | head -50
Should show action categories with tables.
Step 3: Generate Tutorial Screenshots (Requires Slicer)
mkdir -p docs/user-guide/_generated $SLICER_PATH --no-splash \ --python-script MouseMaster/Testing/Python/test_tutorial_workflow.py \ --additional-module-paths $(pwd)/MouseMaster
Output:
- Tutorial screenshotsdocs/user-guide/_generated/*.png
- Screenshot metadatadocs/user-guide/_generated/manifest.json
- Generated tutorial RSTdocs/user-guide/tutorial.rst
Verify:
ls -la docs/user-guide/_generated/ cat docs/user-guide/_generated/manifest.json
Step 4: Build Sphinx Documentation
pip install -r docs/requirements.txt sphinx-build -b html docs docs/_build/html 2>&1 | tee sphinx-build.log
Check for errors:
grep -i "error\|warning" sphinx-build.log
Preview (if browser available):
python -m http.server 8000 -d docs/_build/html # Open http://localhost:8000
Step 5: Review Screenshots
Review each screenshot for issues:
# List all screenshots find docs -name "*.png" -o -name "manifest.json" # Read manifest for descriptions cat docs/user-guide/_generated/manifest.json
For each screenshot, check:
Layout Issues
- Widgets properly aligned
- Spacing consistent
- No overlapping elements
- Text not truncated
Content Issues
- Correct module/panel shown
- Dropdowns expanded where expected
- Button states correct (enabled/disabled)
- Data displayed correctly
Documentation Suitability
- Screenshot clearly shows the feature
- No personal data visible
- Resolution adequate
- Screenshot matches documentation text
Step 6: Fix Issues
If screenshots have problems:
- UI issues - Edit
widget codeMouseMaster/MouseMaster.py - Capture issues - Edit
capture sequencetest_tutorial_workflow.py - Missing screenshots - Add new capture calls
After fixes, re-run from Step 3.
Generated Files Summary
| File | Source | Requires Slicer |
|---|---|---|
| JSON files | No |
| ActionRegistry | Yes |
| Tutorial test | Yes |
| Tutorial test | Yes |
| Tutorial test | Yes |
Troubleshooting
Slicer not found
# Check path which Slicer || echo "Not in PATH" # Set explicitly export SLICER_PATH=/opt/Slicer/Slicer
Module not loading
# Verify module path ls MouseMaster/MouseMaster.py # Check for syntax errors python -m py_compile MouseMaster/MouseMaster.py
Screenshots blank or wrong
Check if virtual display is needed (CI/headless):
# Start Xvfb Xvfb :99 -screen 0 1920x1080x24 & export DISPLAY=:99 # Then run Slicer $SLICER_PATH --no-splash ...
Sphinx build errors
# Check for missing files grep "include" docs/reference/*.rst ls docs/reference/_generated/ # Create placeholder if needed echo ".. note:: Auto-generated content not available" > docs/reference/_generated/actions.rst
CI Integration
The CI workflow runs these steps automatically:
# From .github/workflows/tests.yml - name: Generate reference documentation run: | python MouseMaster/Testing/Python/test_generate_mouse_profiles.py $SLICER_HOME/Slicer --python-script MouseMaster/Testing/Python/test_generate_actions_reference.py ...
Related Skills
- Capture Extension Index screenshots/generate-screenshots
- Detailed UI review/review-ui-screenshots
- Run all tests including doc generators/run-tests
Verification Checklist
After building docs:
-
exists and has contentdocs/reference/_generated/mouse-profiles.rst -
exists (or placeholder)docs/reference/_generated/actions.rst -
has PNG filesdocs/user-guide/_generated/ -
completed without errorssphinx-build - Screenshots show correct UI states
- Generated tutorial matches expected workflow
- All internal links work