ValorVie

docs-generator

0
0
# Install this skill:
npx skills add ValorVie/custom-skills --skill "docs-generator"

Install specific skill from multi-skill repository

# Description

|

# SKILL.md


name: docs-generator
scope: uds-specific
description: |
Generate usage documentation from project sources.
Use when: "generate docs", "create cheatsheet", "usage guide", "feature reference", "list all features"
Keywords: documentation, usage, reference, cheatsheet, features, ๅŠŸ่ƒฝๆ–‡ไปถ, ้€ŸๆŸฅ่กจ, ไฝฟ็”จ่ชชๆ˜Ž


Documentation Generator Skill

Language: English | ็น้ซ”ไธญๆ–‡

Version: 1.0.0
Last Updated: 2026-01-26
Applicability: Claude Code Skills


Purpose

Automatically generate comprehensive usage documentation from project source files. This skill creates:

  1. FEATURE-REFERENCE.md: Complete feature documentation with all details
  2. CHEATSHEET.md: Single-page quick reference table

Supports multiple languages (English, Traditional Chinese, Simplified Chinese) and scans various sources:
- CLI commands
- Slash commands
- Skills
- Agents
- Workflows
- Core standards
- Scripts

Quick Reference

Generate All Documentation

node scripts/generate-usage-docs.mjs

Generate Specific Language

node scripts/generate-usage-docs.mjs --lang=en       # English only
node scripts/generate-usage-docs.mjs --lang=zh-TW    # Traditional Chinese
node scripts/generate-usage-docs.mjs --lang=zh-CN    # Simplified Chinese

Generate Specific Format

node scripts/generate-usage-docs.mjs --cheatsheet    # Cheatsheet only
node scripts/generate-usage-docs.mjs --reference     # Reference only

Check Sync Status

# Check if docs need update
node scripts/generate-usage-docs.mjs --check

# Or use sync check script
./scripts/check-usage-docs-sync.sh         # Check
./scripts/check-usage-docs-sync.sh --fix   # Fix if needed

Configuration

The generator uses .usage-docs.yaml in project root to define:

  • Output paths: Where to generate documents
  • Languages: Which languages to generate
  • Sources: What to scan (CLI, skills, commands, etc.)
  • Templates: Document structure templates

Configuration Example (Multi-language)

# .usage-docs.yaml - Full UDS configuration
version: "1.0"
output:
  directory: "docs/"
  formats: [reference, cheatsheet]
  languages: [en, zh-TW, zh-CN]
  paths:
    en: "docs/"
    zh-TW: "locales/zh-TW/docs/"
    zh-CN: "locales/zh-CN/docs/"

sources:
  cli:
    enabled: true
    entry: "cli/bin/uds.js"
  skills:
    enabled: true
    directory: "skills/claude-code/"
    pattern: "**/SKILL.md"

Single-Language Project

For projects that only need English documentation:

# .usage-docs.yaml - English only
version: "1.0"
output:
  directory: "docs/"
  formats: [reference, cheatsheet]
  languages:
    - en
  paths:
    en: "docs/"

sources:
  cli:
    enabled: true
    entry: "src/cli.js"

Custom Language Configuration

For projects with different language requirements (e.g., English + Japanese):

# .usage-docs.yaml - English + Japanese
version: "1.0"
output:
  directory: "docs/"
  formats: [reference, cheatsheet]
  languages:
    - en
    - ja
  paths:
    en: "docs/"
    ja: "docs/ja/"

templates:
  reference:
    title:
      en: "My Project Reference"
      ja: "ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใƒชใƒ•ใ‚กใƒฌใƒณใ‚น"
  cheatsheet:
    title:
      en: "My Project Cheatsheet"
      ja: "ใƒใƒผใƒˆใ‚ทใƒผใƒˆ"

Configuration Fallback Behavior

The generator implements smart fallback for titles and paths:

Priority Source Description
1 config[lang] Configured value for specific language
2 config.en English fallback from config
3 Built-in default Hardcoded default for supported languages

Supported built-in languages: en, zh-TW, zh-CN

For unsupported languages, you must provide custom titles in the templates section.

Output Files

Language FEATURE-REFERENCE CHEATSHEET
English docs/FEATURE-REFERENCE.md docs/CHEATSHEET.md
็น้ซ”ไธญๆ–‡ locales/zh-TW/docs/FEATURE-REFERENCE.md locales/zh-TW/docs/CHEATSHEET.md
็ฎ€ไฝ“ไธญๆ–‡ locales/zh-CN/docs/FEATURE-REFERENCE.md locales/zh-CN/docs/CHEATSHEET.md

Integration with Pre-Release Check

Add usage docs sync check to pre-release-check.sh:

# Check usage docs sync
echo "Checking usage documentation sync..."
./scripts/check-usage-docs-sync.sh

Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Documentation Generator               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                          โ”‚
โ”‚  1. Load Configuration (.usage-docs.yaml)               โ”‚
โ”‚           โ”‚                                              โ”‚
โ”‚           โ–ผ                                              โ”‚
โ”‚  2. Scan Sources                                         โ”‚
โ”‚     โ”œโ”€ CLI commands (uds.js)                            โ”‚
โ”‚     โ”œโ”€ Skills (SKILL.md files)                          โ”‚
โ”‚     โ”œโ”€ Commands (slash commands)                        โ”‚
โ”‚     โ”œโ”€ Agents (agent definitions)                       โ”‚
โ”‚     โ”œโ”€ Workflows (workflow files)                       โ”‚
โ”‚     โ”œโ”€ Core standards (core/*.md)                       โ”‚
โ”‚     โ””โ”€ Scripts (scripts/*.sh)                           โ”‚
โ”‚           โ”‚                                              โ”‚
โ”‚           โ–ผ                                              โ”‚
โ”‚  3. Generate Documents                                   โ”‚
โ”‚     โ”œโ”€ FEATURE-REFERENCE.md (detailed)                  โ”‚
โ”‚     โ””โ”€ CHEATSHEET.md (quick reference)                  โ”‚
โ”‚           โ”‚                                              โ”‚
โ”‚           โ–ผ                                              โ”‚
โ”‚  4. Output for Each Language                             โ”‚
โ”‚     โ”œโ”€ English (docs/)                                   โ”‚
โ”‚     โ”œโ”€ zh-TW (locales/zh-TW/docs/)                      โ”‚
โ”‚     โ””โ”€ zh-CN (locales/zh-CN/docs/)                      โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Extending for Other Projects

This skill is designed to be reusable. To use in your project:

  1. Copy the configuration template:
    bash cp .usage-docs.yaml your-project/.usage-docs.yaml

  2. Modify for your project structure:

  3. Update source directories
  4. Adjust patterns for your file naming
  5. Configure output paths

  6. Copy the generator script:
    bash cp scripts/generate-usage-docs.mjs your-project/scripts/

  7. Run the generator:
    bash node scripts/generate-usage-docs.mjs

Version History

Version Date Changes
1.0.0 2026-01-26 Initial release with multi-language support

License

This skill is released under CC BY 4.0.

Source: universal-dev-standards

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.