Documentation Workflows Hub

Overview

This hub provides a central guide to all documentation automation systems, workflows, and tools in the Aitana Labs frontend project. It connects the technical implementation details with practical developer workflows and quality assurance processes.

System Architecture

The documentation system consists of three interconnected components:

1. Technical Implementation

  • Stub File Detection - Python script that intelligently detects documentation placeholders
  • GitHub Actions Workflows - Automated workflows that trigger documentation analysis
  • Quality Analysis Scripts - Shell scripts that analyze documentation gaps and quality

2. GitHub Integration

  • GitHub Documentation Workflow - Automated issue creation and management
  • Pull Request Analysis - Automatic documentation impact assessment
  • Issue Lifecycle Management - Automated creation, assignment, and resolution

3. Quality Management

  • Auto Documentation Workflows - Continuous quality monitoring
  • Evolution Tracking - Documentation freshness and improvement suggestions
  • Metrics and Reporting - Quality scores and coverage analysis

Quick Start Workflows

For Developers

1. Adding Documentation for New Features

# 1. Create a stub file in the appropriate location
mkdir -p docs/features
cat > docs/features/NEW_FEATURE_STUB.md << 'EOF'
# New Feature Documentation

STUB: This feature needs comprehensive documentation

## Overview
TODO: Add detailed feature description

## Usage Examples  
PLACEHOLDER: Include practical code examples

## Integration Guide
IMPORTANT: Document how this integrates with existing systems
EOF

# 2. The automation system will:
# - Detect the stub file within 24 hours (daily run)
# - Create a GitHub issue assigned to @claude
# - Provide detailed completion requirements
# - Track progress until completion

2. Updating Documentation After Code Changes

# 1. Make your code changes
git add src/components/NewComponent.tsx

# 2. Check if documentation exists
find docs/ -name "*.md" -exec grep -l "NewComponent" {} \;

# 3. If found, update the documentation
# If not found, create a stub or add to existing docs

# 4. Push changes - the system will:
# - Analyze impact of your changes
# - Suggest documentation updates if needed
# - Create issues for critical documentation gaps

3. Responding to Documentation Issues

When you receive a documentation issue from the automation system:

  1. Review the issue requirements and analysis
  2. Check linked code files for context
  3. Complete the documentation following the provided checklist
  4. The system will automatically close the issue when resolved

For Documentation Maintainers

1. Monitoring Documentation Quality

# Check daily quality reports (generated at 2 AM UTC)
# Reports include:
# - Documentation coverage metrics
# - Quality scores and trends
# - Priority recommendations
# - Stub file analysis

2. Managing Documentation Workflows

# Manual workflow triggers for testing:
gh workflow run documentation-check.yml --ref dev
gh workflow run documentation-evolution.yml --ref dev

# Check workflow status
gh run list --workflow=documentation-check.yml

Complete Developer Workflows

Workflow 1: Feature Documentation Lifecycle

graph TD
    A[New Feature Development] --> B[Create Stub File]
    B --> C[Automation Detects Stub]
    C --> D[GitHub Issue Created]
    D --> E[@claude Assigned]
    E --> F[Documentation Completed]
    F --> G[Issue Auto-Closed]
    G --> H[Quality Monitoring]

Steps:

  1. Development Phase: Create stub file with STUB: markers
  2. Detection Phase: Automation detects stub within 24 hours
  3. Assignment Phase: Issue created and assigned to @claude
  4. Completion Phase: Documentation written following requirements
  5. Resolution Phase: Issue automatically closed when complete
  6. Monitoring Phase: Ongoing quality monitoring and updates

Workflow 2: Documentation Impact Assessment

graph TD
    A[Code Changes] --> B[PR Created]
    B --> C[Automation Analyzes Changes]
    C --> D{Documentation Impact?}
    D -->|High Impact| E[Issue Created]
    D -->|Medium Impact| F[PR Comment Added]
    D -->|Low Impact| G[No Action]
    E --> H[Documentation Updated]
    F --> H
    H --> I[PR Approved]

Steps:

  1. Code Changes: Developer modifies code
  2. PR Analysis: Automation analyzes changed files
  3. Impact Assessment: Determines documentation requirements
  4. Notification: Creates issues or PR comments based on impact
  5. Resolution: Documentation updated as needed
  6. Completion: PR approved with documentation requirements met

Workflow 3: Quality Assurance Process

graph TD
    A[Daily Quality Check] --> B[Analyze Documentation]
    B --> C[Calculate Quality Score]
    C --> D{Score < 70?}
    D -->|Yes| E[Create High Priority Issue]
    D -->|No| F[Continue Monitoring]
    E --> G[Documentation Improved]
    G --> H[Score Recalculated]
    H --> I[Issue Closed]

Steps:

  1. Daily Analysis: Automated quality assessment
  2. Score Calculation: Quality metrics calculated
  3. Threshold Check: Issues created if score too low
  4. Improvement Process: Documentation enhanced
  5. Validation: Quality score recalculated
  6. Resolution: Issue closed when threshold met

Documentation Standards Integration

File Organization (from CLAUDE.md)

  • Development docsdocs/development/
  • Feature docsdocs/features/
  • Testing docsdocs/testing/
  • Troubleshooting docsdocs/troubleshooting/

Naming Conventions

  • Use CAPS_WITH_UNDERSCORES.md for new documentation
  • Stub files: FEATURE_NAME_STUB.md or TODO_FEATURE_NAME.md
  • Update docs/README.md when adding new documentation

Quality Markers

Use these markers in your documentation to help automation:

  • STUB: - Needs comprehensive documentation
  • TODO: - Specific tasks to complete
  • PLACEHOLDER: - Content to be filled in
  • CRITICAL: - Essential documentation
  • IMPROVEMENT: - Section needs enhancement
  • MISSING_EXAMPLE: - Needs code examples

Tool Integration

Frontend Components

  • Tool Confirmation Usage - How to document frontend components
  • Component Documentation Patterns - Standard patterns for React component docs
  • Integration Testing Documentation - How components work with backend

Backend Integration

  • API Documentation Standards - RESTful API documentation patterns
  • Tool Configuration Documentation - How to document tool configurations
  • Service Integration Patterns - Documentation for service integrations

Common Use Cases

1. Documenting a New React Component

// 1. Create the component with clear interfaces
export interface MyComponentProps {
  config: ToolConfiguration;
  onChange: (config: ToolConfiguration) => void;
}

// 2. Create documentation stub
// docs/features/MY_COMPONENT_USAGE.md

2. Documenting a New API Endpoint

# 1. Create the endpoint with docstrings
def new_endpoint(request: Request) -> Response:
    """
    New API endpoint for feature X.
    
    Args:
        request: HTTP request object
        
    Returns:
        Response with processed data
    """
    pass

# 2. Create API documentation
# docs/development/NEW_ENDPOINT_API.md

3. Documenting a Complex Workflow

# 1. Create workflow documentation
# docs/features/COMPLEX_WORKFLOW_GUIDE.md

# 2. Include cross-references to:
# - Related components
# - API endpoints
# - Configuration options
# - Testing procedures

Troubleshooting

Common Issues

Documentation Not Being Detected

  • Check file naming conventions
  • Ensure files are in correct docs/ subdirectories
  • Verify stub markers are outside code blocks
  • Check workflow permissions and execution

Quality Issues Not Flagged

  • Review quality threshold settings
  • Check if files are excluded from analysis
  • Verify automation workflows are running
  • Ensure quality markers are properly formatted

Integration Problems

  • Verify GitHub token permissions
  • Check workflow file locations
  • Ensure all scripts are executable
  • Review automation logs for errors

Debug Commands

# Test stub detection locally
python3 scripts/detect_stub_files.py

# Check documentation gaps
./scripts/analyze-documentation-gaps.sh

# Verify workflow configuration
gh workflow view documentation-check.yml

Performance Metrics

Quality Indicators

  • Documentation Coverage: Target >70% (excellent >90%)
  • Quality Score: Target >75 (excellent >90)
  • Stub Resolution Time: Target <7 days for critical, <14 days for moderate
  • Issue Resolution Rate: Target >80% within 30 days

Monitoring Dashboard

Access real-time metrics through:

  • GitHub Actions workflow summaries
  • Daily quality reports
  • Issue tracking and resolution rates
  • Documentation coverage badges

Future Enhancements

Planned Improvements

  1. AI-Powered Content Generation: Automated draft generation from code analysis
  2. Visual Documentation: Support for diagrams and flowcharts
  3. Multi-Repository Support: Extend workflows to multiple repositories
  4. Advanced Metrics: Detailed analytics and trend analysis
  5. Integration Improvements: Better integration with development tools

Contributing to Documentation Automation

  1. Improve Detection Scripts: Enhance pattern recognition
  2. Add Quality Checks: Develop new quality assessment criteria
  3. Enhance Workflow Logic: Improve automation decision-making
  4. Documentation Templates: Create reusable documentation templates

Core System Documentation

Development Guidelines

Feature-Specific Documentation

Support

For questions about documentation workflows:

  1. Check the troubleshooting section above
  2. Review related documentation links
  3. Check GitHub workflow logs for specific errors
  4. Create an issue with the documentation label for assistance

This hub connects all documentation automation processes and provides clear workflows for both developers and maintainers. It serves as the central entry point for understanding and using the documentation system effectively.