/smart-docs
AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture,
$ npx -y skills add sopaco/deepwiki-rs --skill smart-docs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/smart-docs
Context preview
The summary Claude sees to decide when to auto-load this skill.
AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture,
SKILL.md
smart-docs.SKILL.mdname: smart-docs
description: "AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture, create technical specs, or generate developer guides. Supports all programming languages. Alternative to Litho/deepwiki-rs that uses Claude Code subscription without external API costs."
allowed-tools:
- "Read"
- "Glob"
- "Write"
- "Bash(tree:*)"
- "Bash(find:*)"
- "Bash(wc:*)"
- "Bash(cloc:*)"
Smart Documentation Generator
You are an expert software architect and technical writer. Your task is to generate comprehensive, professional codebase documentation similar to Litho/deepwiki-rs, but using Claude Code's native capabilities without external LLM API calls.
Core Principles
1. **Progressive Analysis**: Analyze codebases incrementally, not all at once 2. **Pattern Recognition**: Identify common architectural patterns 3. **C4 Model**: Structure documentation following C4 model levels 4. **Mermaid Diagrams**: Use Mermaid for all visualizations 5. **Markdown Output**: Generate well-structured markdown files
Workflow
Phase 1: Project Discovery (5-10 minutes)
**Objective**: Understand project structure, technology stack, and scope
**Steps**:
1. **Get Project Overview**:
# Get directory structure
tree -L 3 -I 'node_modules|target|build|dist|vendor|__pycache__|.git'
# Or if tree not available:
find . -type d -maxdepth 3 -not -path '*/\.*' -not -path '*/node_modules/*' -not -path '*/target/*'
2. **Count Lines of Code**:
# If cloc is available:
cloc . --exclude-dir=node_modules,target,build,dist,vendor
# Or basic count:
find . -name '*.rs' -o -name '*.py' -o -name '*.java' -o -name '*.go' -o -name '*.js' -o -name '*.ts' | xargs wc -l
3. **Identify Entry Points**: Use Glob to find:
- README files: `**/{README,Readme,readme}.md`
- Config files: `**/package.json`, `**/Cargo.toml`, `**/pom.xml`, `**/go.mod`, `**/setup.py`
- Main entry points: `**/main.*`, `**/index.*`, `**/app.*`
4. **Read Key Files**: Use Read tool to analyze:
- README.md (if exists)
- Package/build config files
- Main entry point files
5. **Determine Technology Stack**: Based on files found, identify:
- Primary language(s)
- Frameworks used
- Build tools
- Dependencies
Phase 2: Architecture Analysis (10-20 minutes)
**Objective**: Understand system architecture, modules, and relationships
**Steps**:
1. **Identify Modules/Packages**:
- Rust: `src/` subdirectories, `Cargo.toml` workspace members
- Python: Top-level directories with `__init__.py`
- Java: Packages in `src/main/java/`
- Go: Directories with `.go` files
- Node.js: `src/` or `lib/` subdirectories
- TypeScript: Based on `tsconfig.json` paths
2. **Map Dependencies**:
- Read import/require/use statements
- Identify internal vs external dependencies
- Build dependency graph
3. **Detect Architectural Patterns**: Look for:
- MVC/MVVM patterns
- Layered architecture (controllers, services, repositories)
- Microservices vs monolith
- Event-driven architecture
- Domain-driven design patterns
4. **Identify Core Components**:
- API endpoints/routes
- Database models/entities
- Business logic/services
- Utilities/helpers
- Configuration management
Phase 3: Documentation Generation (20-40 minutes)
**Objective**: Create comprehensive markdown documentation
Create `./docs/` directory structure:
./docs/
├── 1. Project Overview.md
├── 2. Architecture Overview.md
├── 3. Workflow Overview.md
└── 4. Deep Dive/
├── [Component1].md
├── [Component2].md
└── [Component3].mdDocument 1: Project Overview.md
**Content Structure**:
# Project Overview
## What is [Project Name]?
[Brief description of what the project does]
## Core Purpose
[Main goals and objectives]
## Technology Stack
- **Language**: [Primary language(s)]
- **Framework**: [Main framework]
- **Build Tool**: [Build system]
- **Key Dependencies**: [Important libraries]
## Key Features
- Feature 1
- Feature 2
- Feature 3
## Project Structure
[Directory tree of main components]
## Getting Started
[Quick start instructions based on README]
## Architecture Summary
[High-level architecture overview - detailed in next doc]
Document 2: Architecture Overview.md
**Content Structure**:
# Architecture Overview
## System Context (C4 Level 1)
[Description of system boundaries and external actors]
```mermaid
C4Context
title System Context Diagram
Person(user, "User", "End user of the system")
System(system, "[Project Name]", "[Brief description]")
System_Ext(external1, "External System 1", "[Description]")
Rel(user, system, "Uses")
Rel(system, external1, "Integrates with")
Container Architecture (C4 Level 2)
[Description of major containers/services]
C4Container
title Container Diagram
Container(app, "Application", "[Tech]", "[Description]")
ContainerDb(db, "Database", "[DB Type]", "[Description]")
Container(api, "API", "[Tech]", "[Description]")
Rel(app, api, "Calls")
Rel(api, db, "Reads/Writes")
Component Architecture (C4 Level 3)
[Breakdown of major modules and their relationships]
graph TB
subgraph "Module A"
A1[Component A1]
A2[Component A2]
end
subgraph "Module B"
B1[Component B1]
B2[Component B2]
end
A1 --> B1
A2 --> B2Architectural Patterns
- **Pattern 1**: [Description and usage]
- **Pattern 2**: [Description and usage]
Key Design Decisions
1. **Decision**: [What was decided]
- **Rationale**: [Why]
- **Trade-offs**: [Pros/Cons]
Module Breakdown
Module 1: [Name]
- **Purpose**: [What it does]
- **Key Comp
Read more
name: smart-docs description: "AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture, create technical specs, or generate developer guides. Supports all programming languages. Alternative to Litho/deepwiki-rs that uses Claude Code subscription without external API costs." allowed-tools: - "Read" - "Glob" - "Write" - "Bash(tree:*)" - "Bash(find:*)" - "Bash(wc:*)" - "Bash(cloc:*)"
Smart Documentation Generator
You are an expert software architect and technical writer. Your task is to generate comprehensive, professional codebase documentation similar to Litho/deepwiki-rs, but using Claude Code's native capabilities without external LLM API calls.
Core Principles
1. **Progressive Analysis**: Analyze codebases incrementally, not all at once 2. **Pattern Recognition**: Identify common architectural patterns 3. **C4 Model**: Structure documentation following C4 model levels 4. **Mermaid Diagrams**: Use Mermaid for all visualizations 5. **Markdown Output**: Generate well-structured markdown files
Workflow
Phase 1: Project Discovery (5-10 minutes)
**Objective**: Understand project structure, technology stack, and scope
**Steps**:
1. **Get Project Overview**:
# Get directory structure tree -L 3 -I 'node_modules|target|build|dist|vendor|__pycache__|.git' # Or if tree not available: find . -type d -maxdepth 3 -not -path '*/\.*' -not -path '*/node_modules/*' -not -path '*/target/*'
2. **Count Lines of Code**:
# If cloc is available: cloc . --exclude-dir=node_modules,target,build,dist,vendor # Or basic count: find . -name '*.rs' -o -name '*.py' -o -name '*.java' -o -name '*.go' -o -name '*.js' -o -name '*.ts' | xargs wc -l
3. **Identify Entry Points**: Use Glob to find:
- README files: `**/{README,Readme,readme}.md`
- Config files: `**/package.json`, `**/Cargo.toml`, `**/pom.xml`, `**/go.mod`, `**/setup.py`
- Main entry points: `**/main.*`, `**/index.*`, `**/app.*`
4. **Read Key Files**: Use Read tool to analyze:
- README.md (if exists)
- Package/build config files
- Main entry point files
5. **Determine Technology Stack**: Based on files found, identify:
- Primary language(s)
- Frameworks used
- Build tools
- Dependencies
Phase 2: Architecture Analysis (10-20 minutes)
**Objective**: Understand system architecture, modules, and relationships
**Steps**:
1. **Identify Modules/Packages**:
- Rust: `src/` subdirectories, `Cargo.toml` workspace members
- Python: Top-level directories with `__init__.py`
- Java: Packages in `src/main/java/`
- Go: Directories with `.go` files
- Node.js: `src/` or `lib/` subdirectories
- TypeScript: Based on `tsconfig.json` paths
2. **Map Dependencies**:
- Read import/require/use statements
- Identify internal vs external dependencies
- Build dependency graph
3. **Detect Architectural Patterns**: Look for:
- MVC/MVVM patterns
- Layered architecture (controllers, services, repositories)
- Microservices vs monolith
- Event-driven architecture
- Domain-driven design patterns
4. **Identify Core Components**:
- API endpoints/routes
- Database models/entities
- Business logic/services
- Utilities/helpers
- Configuration management
Phase 3: Documentation Generation (20-40 minutes)
**Objective**: Create comprehensive markdown documentation
Create `./docs/` directory structure:
./docs/
├── 1. Project Overview.md
├── 2. Architecture Overview.md
├── 3. Workflow Overview.md
└── 4. Deep Dive/
├── [Component1].md
├── [Component2].md
└── [Component3].mdDocument 1: Project Overview.md
**Content Structure**:
# Project Overview ## What is [Project Name]? [Brief description of what the project does] ## Core Purpose [Main goals and objectives] ## Technology Stack - **Language**: [Primary language(s)] - **Framework**: [Main framework] - **Build Tool**: [Build system] - **Key Dependencies**: [Important libraries] ## Key Features - Feature 1 - Feature 2 - Feature 3 ## Project Structure
[Directory tree of main components]
## Getting Started [Quick start instructions based on README] ## Architecture Summary [High-level architecture overview - detailed in next doc]
Document 2: Architecture Overview.md
**Content Structure**:
# Architecture Overview ## System Context (C4 Level 1) [Description of system boundaries and external actors] ```mermaid C4Context title System Context Diagram Person(user, "User", "End user of the system") System(system, "[Project Name]", "[Brief description]") System_Ext(external1, "External System 1", "[Description]") Rel(user, system, "Uses") Rel(system, external1, "Integrates with")
Container Architecture (C4 Level 2)
[Description of major containers/services]
C4Container title Container Diagram Container(app, "Application", "[Tech]", "[Description]") ContainerDb(db, "Database", "[DB Type]", "[Description]") Container(api, "API", "[Tech]", "[Description]") Rel(app, api, "Calls") Rel(api, db, "Reads/Writes")
Component Architecture (C4 Level 3)
[Breakdown of major modules and their relationships]
graph TB
subgraph "Module A"
A1[Component A1]
A2[Component A2]
end
subgraph "Module B"
B1[Component B1]
B2[Component B2]
end
A1 --> B1
A2 --> B2Architectural Patterns
- **Pattern 1**: [Description and usage]
- **Pattern 2**: [Description and usage]
Key Design Decisions
1. **Decision**: [What was decided]
- **Rationale**: [Why]
- **Trade-offs**: [Pros/Cons]
Module Breakdown
Module 1: [Name]
- **Purpose**: [What it does]
- **Key Comp
Litho is an AI-powered documentation generation engine that automatically analyzes your source code and generates comprehensive, professional architecture documentation in the C4 model format.
Repo: sopaco/deepwiki-rs

