| name | cui-documentation |
| description | General documentation standards for README, AsciiDoc, and technical documentation |
| allowed-tools | ["Read","Edit","Write","Bash","Grep","Glob"] |
CUI Documentation Skill
Standards for writing clear, maintainable technical documentation in CUI projects.
Note: This skill covers general documentation. For code documentation, use:
cui-javadoc for Java code documentation
cui-frontend-development/jsdoc-standards.md for JavaScript documentation
Workflow
Step 1: Load Applicable Documentation Standards
CRITICAL: Load current documentation standards based on context.
-
Always load core documentation standards:
Read: standards/documentation-core.md
-
Conditional loading based on context:
-
If creating or editing README files:
Read: standards/readme-structure.md
-
If working with AsciiDoc files:
Read: standards/asciidoc-formatting.md
-
If reviewing tone, style, or language (or comprehensive reviews):
Read: standards/tone-and-style.md
-
If organizing, restructuring, or reviewing documentation structure:
Read: standards/organization-standards.md
-
Extract key requirements from all loaded standards
-
Store in working memory for use during task execution
Step 2: Analyze Existing Documentation
When to Execute: After loading standards
What to Analyze:
-
General Documentation Quality:
- Check tone and style (see documentation-core.md for requirements)
- Verify no marketing language or promotional wording
- Validate factual descriptions with sources
- Review technical precision
- Check for conciseness and clarity
-
Tone and Style (if tone-and-style.md loaded):
- Identify marketing language and subjective claims
- Check for qualification patterns ("production-proven", "extensively tested")
- Verify no transitional markers (status indicators, TODO items)
- Ensure objective vs subjective language compliance
- Review for promotional wording and self-praise
- Validate all claims are verifiable or attributed
-
Organization and Structure (if organization-standards.md loaded):
- Verify document follows single-aspect principle
- Check document size (50-400 lines)
- Validate file naming (kebab-case)
- Identify duplicate content across documents
- Check for transitional/status markers
- Assess cross-reference integrity
- Review logical document organization
-
AsciiDoc Format (if .adoc files):
- Verify document header with required attributes
- Check cross-reference syntax (
xref: format)
- CRITICAL: Validate blank lines before all lists
- Review code block formatting with language specification
- Check section hierarchy and numbering
-
README Structure (if README files):
- Verify title and description
- Check Maven coordinates placement
- Review core concepts section
- Validate usage examples completeness
- Check configuration documentation
- Review best practices section
-
Content Quality:
- Only existing code/features documented
- All references verified to exist
- RFC references must be relevant (see documentation-core.md for verification requirements)
- Consistent terminology used
- Code examples from unit tests
- All public APIs documented
Step 3: Apply Documentation Standards
When to Execute: During documentation creation or review
What to Apply:
-
Core Documentation Principles:
- Professional, neutral, objective tone
- No marketing or promotional language
- Technical precision with verifiable sources
- Concise, clear language
- Document only existing features
- Use linking instead of duplication
-
AsciiDoc Formatting (if .adoc files):
README Files (README.adoc, */README.adoc):
General Documentation Files (not READMEs):
All AsciiDoc Files:
- Use
xref:path/to/file.adoc[Link Text] for cross-references
- ALWAYS add blank line before lists
- Specify language in code blocks
- Follow proper section hierarchy
-
README Structure (if README files):
- Title and brief description
- Maven coordinates immediately after description
- Core Concepts section
- Detailed Component Documentation with links to source
- Usage Examples (complete, working code)
- Configuration section
- Best Practices
- Technical Details
- Related Documentation
-
Code Examples:
- Must be complete and compilable (see documentation-core.md for requirements)
- Include all necessary imports
- Show proper error handling
- Follow project coding standards
- Be verified by unit tests
- Use clear variable names
- Include comments for complex steps
- Configuration placeholders must be clearly identified
Step 4: Verify Documentation Quality
When to Execute: After creating or updating documentation
Quality Checks:
-
Tone and Style Verification:
-
AsciiDoc Format Verification (if .adoc):
-
README Structure Verification (if README):
-
Content Quality Verification:
-
Build Verification (if applicable):
mvn clean install -DskipTests
Step 5: Automated Validation (AsciiDoc)
When to Execute: After creating or updating AsciiDoc files
Available Validation Scripts:
This skill includes two validation scripts in the scripts/ directory:
-
asciidoc-validator.sh - Format validation script
- Validates AsciiDoc format compliance
- Checks for blank lines before lists
- Verifies section header formatting
- Detects list syntax issues
Usage:
scripts/asciidoc-validator.sh path/to/file.adoc
scripts/asciidoc-validator.sh directory/
-
verify-adoc-links.py - Link verification script
- Validates cross-reference links
- Checks for broken file references
- Verifies anchor existence
- Detects deprecated syntax
Usage:
python3 scripts/verify-adoc-links.py --file path/to/file.adoc --report target/links.md
python3 scripts/verify-adoc-links.py --directory directory/ --report target/links.md
python3 scripts/verify-adoc-links.py --directory directory/ --recursive --report target/links.md
Validation Workflow:
-
Run format validation:
scripts/asciidoc-validator.sh target_file_or_directory 2>&1
-
Run link verification:
mkdir -p target/asciidoc-reviewer
python3 scripts/verify-adoc-links.py --file target.adoc --report target/asciidoc-reviewer/links.md 2>&1
-
Distinguish link validation results:
- Syntax Valid + Target Exists: ✅ Link is correct
- Syntax Valid + Target Missing: ❌ Reference to non-existent file
- Common cause: Documentation for planned/future features
- Action: Either create the target document or remove the reference
- Do NOT leave references to non-existent files
- Syntax Invalid: ❌ Malformed cross-reference
- Fix syntax to use proper
xref:path[text] format
-
Review validation output and fix issues
-
Re-run validation to confirm fixes
Script Paths:
- Scripts are located in the skill directory at:
scripts/asciidoc-validator.sh and scripts/verify-adoc-links.py
- When running from project root, use relative path from current working directory
- Scripts require execution from a location where relative paths to AsciiDoc files are correct
Step 6: Document Changes and Commit
When to Execute: After verification passes
Commit Standards:
- Follow standard commit message format
- Reference related issues
- Document significant documentation changes
- Add co-authored-by line for Claude Code
Common Documentation Patterns
AsciiDoc Document Header
= Document Title
:toc: left
:toclevels: 3
:toc-title: Table of Contents
:sectnums:
:source-highlighter: highlight.js
== Purpose
Brief description of the document's purpose.
== Related Documentation
* xref:other-document.adoc[Other Document]
* xref:../category/document.adoc[Category Document]
README Structure Example
= Module Name
Concise description of the module's purpose and key features.
== Maven Coordinates
[source, xml]
----
<dependency>
<groupId>group.id</groupId>
<artifactId>artifact-id</artifactId>
</dependency>
----
== Core Concepts
=== Feature One
* Capability details
* Integration points
* Key benefits
== Usage Examples
=== Basic Usage
[source,java]
----
// Complete code example
----
== Configuration
=== Property Configuration
[source,properties]
----
# Configuration examples
----
Code Block with Language
[source,java]
----
@Test
void shouldValidateToken() {
// Test implementation
}
----
Error Prevention
Common Documentation Issues
- Missing Blank Line Before List: AsciiDoc grammar requires blank line
- Wrong Cross-Reference Syntax: Use
xref: not link:
- Missing Language Specification: Always specify language in code blocks
- Marketing Language: Use neutral, factual descriptions
- Incomplete Code Examples: Provide complete, compilable examples
Quality Violations
- Promotional Tone: "Our amazing feature" → "Feature X provides..."
- Incomplete Header: Missing required document attributes
- Invalid References: Links to non-existent files
- Speculative Documentation: Documenting planned features
- Duplicate Content: Copy-paste instead of cross-reference
Quality Verification
All documentation must pass:
References
All documentation standards are located in the standards/ directory: