Update Docs Command banner
ruvnet ruvnet

Update Docs Command

Development community intermediate

Description

When the user runs `/update-docs [module] [doc_type] [include_examples]`, execute the following:

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for ruvnet/QuDAG, shared by 10 entries in this directory. It describes the repository, not this entry specifically.

Update Docs Command

When the user runs `/update-docs [module] [doc_type] [include_examples]`, execute the following:

Parameters

  • module: Module to update documentation for (crypto, dag, network, protocol) - REQUIRED
  • doc_type: Type of documentation (api, architecture, security, deployment) - Optional, default: api
  • include_examples: Include usage examples - Optional, default: true

Execution Steps

Step 1: Analyze Module and Documentation Needs

  1. Scan the module source code to identify:

    • Public APIs and their signatures
    • Key types and data structures
    • Error types and handling patterns
    • Performance characteristics
    • Security considerations
  2. Check existing documentation:

    • Look for outdated information
    • Identify missing documentation
    • Find broken examples

Step 2: Generate Documentation Based on Type

For API Documentation:

Create or update `docs/${module}/api.md`:

# ${module_name} API Documentation

## Overview
${module_description}

## Core Types

### Primary Structures
```rust
// Document main types with their purposes
pub struct ${TypeName} {
    // Document each field's purpose and constraints
}

impl ${TypeName} {
    // Document key methods
}

Traits and Interfaces

pub trait ${TraitName} {
    // Document trait purpose and implementors
}

Public API Reference

Initialization Functions

/// Creates a new instance of ${module}
/// 
/// # Arguments
/// * `config` - Configuration parameters for initialization
/// 
/// # Returns
/// * `Result<${Module}, ${Error}>` - Initialized module or error
/// 
/// # Example
/// ```rust
/// let config = Config::default();
/// let module = ${Module}::new(config)?;
/// ```
pub fn new(config: Config) -> Result<${Module}, ${Error}>

Core Operations

[Document each public function with rustdoc format]

Usage Examples

Basic Usage

use qudag_${module}::*;

// Example: ${common_use_case}
fn example_basic_usage() -> Result<(), Error> {
    let module = ${Module}::new(Config::default())?;
    
    // Perform operations
    let result = module.operation()?;
    
    Ok(())
}

Advanced Patterns

// Example: ${advanced_use_case}
async fn example_advanced_usage() -> Result<(), Error> {
    // Show complex integration patterns
}

Error Handling

Error Types

  • ${Error}::InvalidInput - Input validation failed
  • ${Error}::OperationFailed - Core operation error
  • ${Error}::ConfigError - Configuration issues

Recovery Strategies

match module.operation() {
    Ok(result) => process_result(result),
    Err(${Error}::InvalidInput(e)) => {
        // Handle validation errors
    },
    Err(${Error}::OperationFailed(e)) => {
        // Retry or fallback logic
    },
    Err(e) => {
        // Generic error handling
    }
}

Performance Considerations

Time Complexity

  • operation(): O(n) where n is input size
  • batch_operation(): O(n log