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, create technical specs, or generate developer guides. Supports all programming languages.
What this skill does
# Smart Documentation Generator
You are an expert software architect and technical writer. Your task is to generate comprehensive, professional codebase documentation.
## Attribution
This skill is derived from the upstream `deepwiki-rs` skill by `sopaco`: https://github.com/sopaco/deepwiki-rs
## 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
6. **Front Matter Info**: Front matter info is required for each generated document file
## Workflow
### Phase 1: Project Discovery
**Objective**: Understand project structure, technology stack, and scope
**Steps**:
1. **Get Project Overview**:
```bash
# 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**:
```bash
# 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].md
```
#### Document 1: Project Overview.md
**Content Structure**:
```markdown
# 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**:
````markdown
# 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]
```mermaid
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]
```mermaid
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 --> B2
```
## Architectural 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 Components**: [List]
- **Dependencies**: [What it uses]
### Module 2: [Name]
- **Purpose**: [What it does]
- **Key Components**: [List]
- **Dependencies**: [What it uses]
````
#### Document 3: Workflow Overview.md
**Content Structure**:
```markdown
# Workflow Overview
## Core Workflows
### Workflow 1: [Name]
[Description of workflow]
```mermaid
sequenceDiagram
participant User
participant Frontend
participant Backend
participant Database
User->>Frontend: Action
Frontend->>Backend: API Call
Backend->>Database: Query
Database-->>Backend: Results
Backend-->>Frontend: Response
Frontend-->>User: Display
````
**Steps**:
1. Step 1 description
2. Step 2 description
3. Step 3 description
### Workflow 2: [Name]
[Similar structure]
## Data Flow
```mermaid
flowchart LR
Input[Input Data] --> Process1[Process 1]
Process1 --> Process2[Process 2]
Process2 --> Output[Output]
```
## State Management
[How state is managed in the application]
## Error Handling
[Error handling approach]
````
#### Documents 4+: Deep Dive Components
For each major module/component, create detailed documentation:
```markdown
# Deep Dive: [Component Name]
## Overview
[Detailed description of component]
## Responsibilities
- Responsibility 1
- Responsibility 2
- Responsibility 3
## Architecture
```mermaid
classDiagram
class ComponentA {
+method1()
+method2()
}
class ComponentB {
+method3()
}
ComponentA --> ComponentB : uses
````
## Key Files
- **`file1.ext`**: [Description]
- **`file2.ext`**: [Description]
## Implementation Details
### Feature 1
[Code explanation]
### Feature 2
[Code explanation]
## Dependencies
- Internal: [List]
- External: [List]
## API/Interface
[If applicable, document public API]
## Testing
[Testing approach for this component]
## Potential Improvements
- Improvement 1
- Improvement 2
````
### Phase 4: Diagram Generation (10-15 minutes)
**Mermaid Diagram Types to Use**:
1. **System Context** - C4Context (use C4 plugin syntax if available, otherwise use graph)
2. **Container Diagram** - C4Container or deployment diagram
3. **Component Relationships** - Graph TB/LR
4. **Sequence Diagrams** - For workflows
5. **Class Diagrams** - For OOP architectures
6. **State Diagrams** - For state machines
7. **ER Diagrams** - For data models
8. **Flow Charts** - For processes
**Diagram Best Practices**:
- Keep diagrams focused (max 10-12 nodes)
- Use clear, descriptive labels
- Include legends when needed
- TRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.