// Create comprehensive technical documentation for code systems including data flow diagrams, architecture overviews, algorithm documentation, cheat sheets, and multi-file documentation sets. Use when documenting pipelines, algorithms, system architecture, data flow, multi-stage processes, similarity algorithms, or creating developer onboarding materials. Covers Mermaid diagrams, progressive disclosure, critical patterns, JSON schemas, Pydantic models, and print-friendly reference materials.
| name | architecture-documentation-creator |
| description | Create comprehensive technical documentation for code systems including data flow diagrams, architecture overviews, algorithm documentation, cheat sheets, and multi-file documentation sets. Use when documenting pipelines, algorithms, system architecture, data flow, multi-stage processes, similarity algorithms, or creating developer onboarding materials. Covers Mermaid diagrams, progressive disclosure, critical patterns, JSON schemas, Pydantic models, and print-friendly reference materials. |
This skill provides a structured approach to creating comprehensive technical documentation for complex code systems, including data flow diagrams, algorithm documentation, architecture overviews, and quick reference materials. Based on proven patterns from successful documentation projects.
Use this skill when you need to:
Trigger Keywords: document architecture, create documentation, data flow diagram, document pipeline, document algorithm, architecture overview, technical documentation, developer documentation, onboarding docs, cheat sheet, mermaid diagram, document system
For comprehensive system documentation, create three complementary files:
1. README.md (Navigation Hub)
2. Detailed Technical Documentation (Deep Dive)
3. CHEAT-SHEET.md (Quick Reference)
docs/architecture/
โโโ README.md # Start here
โโโ {system-name}-data-flow.md # Detailed pipeline/flow docs
โโโ {algorithm-name}.md # Algorithm deep dives
โโโ CHEAT-SHEET.md # Print-friendly reference
โโโ diagrams/ # Optional: separate diagram files
1. Use Appropriate Diagram Types:
2. Progressive Detail Pattern:
## High-Level Overview
[Simple 5-10 node diagram showing major components]
## Component Breakdown
[Detailed diagrams for each component/stage]
## Complete Flow
[Comprehensive end-to-end diagram]
3. Mermaid Flowchart Example:
\`\`\`mermaid
flowchart TD
A[Stage 1: Input] --> B[Stage 2: Process]
B --> C{Decision}
C -->|Yes| D[Stage 3a: Path A]
C -->|No| E[Stage 3b: Path B]
D --> F[Stage 4: Output]
E --> F
\`\`\`
4. Labeling Best Practices:
For each stage/component document:
## Algorithm Name
### Overview
[1-2 paragraph high-level explanation]
### Architecture
[Describe phases, layers, or steps]
### Phase-by-Phase Breakdown
#### Phase 1: [Name]
**Purpose**: [What this phase does]
**Input**: [What it receives]
**Output**: [What it produces]
**Key Logic**: [Important details]
[Repeat for each phase]
### Implementation Examples
[4+ concrete examples showing edge cases]
### Performance Characteristics
| Metric | Value | Notes |
|--------|-------|-------|
### Accuracy Metrics
[If applicable: precision, recall, F1, etc.]
### Common Pitfalls
[โ
/โ patterns showing correct vs incorrect usage]
Always document critical patterns with:
Example:
### Pattern: Extract Before Normalize
**Why it matters**: Normalization removes formatting that contains semantic information. Extracting features first preserves original meaning.
\`\`\`python
# โ
CORRECT: Extract features BEFORE normalization
features = extract_semantic_features(code) # Phase 1
normalized = normalize_code(code) # Phase 2
penalty = calculate_penalty(features) # Phase 3
# โ WRONG: Normalizing first destroys semantic info
normalized = normalize_code(code)
features = extract_semantic_features(normalized) # Too late!
\`\`\`
**Location**: `lib/algorithm.py:45-67`
A print-friendly one-page reference should include:
1. Header:
# System Name - Quick Reference Cheat Sheet
**Version**: 1.0 | **Last Updated**: YYYY-MM-DD | **Print This Page**
2. Visual Overview:
3. Critical Patterns (โ ๏ธ Section):
4. Quick Reference Tables:
5. Troubleshooting Quick Reference:
| Issue | Cause | Solution |
|---|
6. Key Metrics (if applicable): | Metric | Value | Meaning |
Use tables for:
Keep tables concise (3-5 columns max for printability).
For each data structure, provide:
1. Schema Definition:
### DataStructureName
\`\`\`json
{
"field_name": "type", // Description
"required_field": "string", // What it contains
"optional_field?": "number" // When it's used
}
\`\`\`
2. Field Descriptions Table:
| Field | Type | Required | Description |
|---|
3. Example:
{
"field_name": "example_value",
"required_field": "actual data",
"optional_field": 42
}
### ModelName (Pydantic)
**Definition**:
\`\`\`python
class ModelName(BaseModel):
field_name: str
count: int = 0
tags: List[str] = []
\`\`\`
**Fields**:
- `field_name` (str): Description
- `count` (int): Description (default: 0)
- `tags` (List[str]): Description (default: empty list)
**Example**:
\`\`\`python
model = ModelName(
field_name="example",
count=5,
tags=["tag1", "tag2"]
)
\`\`\`
### Performance Benchmarks
| Operation | Small (<100) | Medium (100-1k) | Large (1k+) |
|-----------|--------------|-----------------|-------------|
| Scan | 50ms | 500ms | 5s |
| Process | 100ms | 1s | 10s |
| Total | 150ms | 1.5s | 15s |
**Bottlenecks**:
1. [Component name] - [Why it's slow]
2. [Component name] - [Why it's slow]
**Optimization Strategies**:
- Strategy 1: [Description]
- Strategy 2: [Description]
Create troubleshooting sections with:
1. Table Format (for cheat sheets):
| Issue | Cause | Solution |
|-------|-------|----------|
| Error message | Why it happens | How to fix |
2. Detailed Format (for full docs):
### Issue: [Problem Description]
**Symptoms**:
- Observable behavior 1
- Observable behavior 2
**Root Cause**:
[Explanation of why this happens]
**Solution**:
1. Step 1
2. Step 2
3. Step 3
**Verification**:
[How to confirm it's fixed]
**Related**: See [Component Name] documentation
Link related sections within documentation:
See [Component Interactions](#component-interactions) for details.
For algorithm specifics, see [similarity-algorithm.md](similarity-algorithm.md).
Always include file:line references:
**Location**: `lib/extractor.py:45-67`
**See**: `config/settings.json:12-15`
In README.md, provide clear navigation:
## Documentation Structure
- **[README.md](README.md)** - Start here
- **[pipeline-data-flow.md](pipeline-data-flow.md)** - Pipeline details
- **[algorithm.md](algorithm.md)** - Algorithm deep dive
- **[CHEAT-SHEET.md](CHEAT-SHEET.md)** - Quick reference
### Example: [What This Demonstrates]
\`\`\`python
# Setup
from module import Class
# The key pattern being demonstrated
result = Class.method(
param1="value", # โ This parameter is critical
param2=42
)
# Expected output
# {'status': 'success', 'count': 42}
\`\`\`
**Explanation**:
[What's happening and why it matters]
Add to every documentation file:
**Version**: 1.0
**Last Updated**: 2025-11-17
**Author**: [Name or "Auto-generated"]
**Related**: [Links to related docs]
For living documentation:
## Change Log
### 2025-11-17 - v1.0
- Initial documentation creation
- Added data flow diagrams
- Created cheat sheet
### 2025-11-18 - v1.1
- Updated algorithm section
- Fixed typos in examples
Before finalizing documentation, verify:
docs/
โโโ architecture/
โ โโโ README.md # Navigation hub
โ โโโ {system}-overview.md # High-level architecture
โ โโโ {system}-data-flow.md # Pipeline/data flow
โ โโโ {algorithm}.md # Algorithm details
โ โโโ CHEAT-SHEET.md # Quick reference
โ โโโ diagrams/ # Optional: separate diagrams
โ โโโ overview.mmd
โ โโโ data-flow.mmd
โโโ api/ # API documentation
โโโ guides/ # How-to guides
โโโ reference/ # Reference materials
Follow Anthropic's progressive disclosure pattern:
1. Start Simple (README.md):
2. Add Detail (Detailed docs):
3. Provide Reference (Cheat sheet):
See TEMPLATES.md for ready-to-use templates for:
Context: 7-stage code consolidation pipeline bridging JavaScript and Python
Documentation Created:
Key Features:
Context: Two-phase similarity algorithm with penalty system
Documentation Approach:
Skill Status: COMPLETE โ Version: 1.0 Last Updated: 2025-11-17