ted-mosby
Generate architectural wikis with source code traceability. Creates comprehensive documentation including architecture overviews, module docs, data flow diagrams, and interactive static sites. Use when asked to document a codebase, generate architecture docs, create a wiki, or explain how a project is structured.
What this skill does
# Ted Mosby - Architecture Wiki Generator
Generate comprehensive architectural documentation for any codebase with source code traceability (file:line references).
## Overview
Ted Mosby creates architectural wikis that help developers understand codebases. Every concept links directly to source code, so you can navigate from documentation to implementation.
**Output includes:**
- Architecture overview with Mermaid diagrams
- Module documentation with source traceability
- Data flow documentation
- Getting started guides
- Interactive static site with search, keyboard nav, dark mode
## When to Use This Skill
Use this skill when the user wants to:
- Document a codebase or project architecture
- Generate a wiki or documentation site
- Create architecture diagrams with source references
- Understand and document how a project is structured
- Produce navigable documentation with file:line traceability
**Trigger phrases:**
- "Generate docs for this project"
- "Create architecture documentation"
- "Document this codebase"
- "Make a wiki for this repo"
- "Help me understand this project's structure"
## Prerequisites
### Required
- Node.js >= 18.0.0
- Anthropic API key (`ANTHROPIC_API_KEY` environment variable)
### Check Prerequisites
```bash
# Verify Node.js version
node --version # Should be >= 18.0.0
# Verify API key is set
echo $ANTHROPIC_API_KEY # Should show your key
```
### Install Ted Mosby
```bash
npm install -g ted-mosby
```
## Quick Start Commands
### Basic Wiki Generation
```bash
# Generate wiki for current directory
ted-mosby generate -r .
# Generate wiki for a specific project
ted-mosby generate -r ./my-project
# Generate wiki for a GitHub repository
ted-mosby generate -r https://github.com/user/repo
```
### With Interactive Site
```bash
# Generate wiki + interactive static site
ted-mosby generate -r ./my-project --site
# Custom title and theme
ted-mosby generate -r ./my-project --site --site-title "My Project Docs" --theme dark
# Generate site only (if wiki already exists)
ted-mosby generate -r ./my-project --site-only
```
### Other Useful Options
```bash
# Focus on specific subdirectory
ted-mosby generate -r ./my-project -p src/core
# Custom output directory
ted-mosby generate -r ./my-project -o ./docs/architecture
# Verbose output (see agent progress)
ted-mosby generate -r ./my-project -v
# Estimate time/cost before running (dry run)
ted-mosby generate -r ./my-project -e
```
## Workflow
### Step 1: Gather Requirements
Before running Ted Mosby, clarify with the user:
1. **Target path** - What directory or repo to document?
2. **Output location** - Where should the wiki go? (default: `./wiki`)
3. **Site generation** - Do they want an interactive static site?
4. **Focus area** - Any specific subdirectory to focus on?
5. **Theme preference** - Light, dark, or auto?
### Step 2: Pre-flight Checks
Verify the environment is ready:
```bash
# Check Node.js version
node --version
# Verify ted-mosby is installed
which ted-mosby || echo "Run: npm install -g ted-mosby"
# Check API key
[ -z "$ANTHROPIC_API_KEY" ] && echo "Set ANTHROPIC_API_KEY environment variable"
```
### Step 3: Run Generation
Choose the appropriate command based on user needs:
| User Wants | Command |
|------------|---------|
| Basic wiki only | `ted-mosby generate -r ./project` |
| Wiki + interactive site | `ted-mosby generate -r ./project --site` |
| Site with custom title | `ted-mosby generate -r ./project --site --site-title "Docs"` |
| Dark theme site | `ted-mosby generate -r ./project --site --theme dark` |
| Focus on subdirectory | `ted-mosby generate -r ./project -p src/core` |
| Large codebase | `ted-mosby generate -r ./project --max-chunks 5000` |
| Quick iteration | `ted-mosby generate -r ./project --skip-index` |
### Step 4: Review Output
After generation completes:
1. **Wiki location:** `./wiki/README.md` (or custom output dir)
2. **Site location:** `./wiki/site/index.html` (if `--site` used)
3. **Open site:** Open `index.html` in browser
### Step 5: Fix Issues (if needed)
If there are broken links or missing pages:
```bash
# Check for and generate missing pages
ted-mosby continue -r ./my-project -o ./wiki
# Verify only (don't generate)
ted-mosby continue -r ./my-project -o ./wiki --verify-only
```
## Output Structure
```
wiki/
├── README.md # Navigation entry point
├── architecture/
│ ├── overview.md # System architecture + Mermaid diagrams
│ └── data-flow.md # Data flow documentation
├── components/
│ └── {module}/
│ └── index.md # Per-module documentation
├── guides/
│ └── getting-started.md # Quick start guide
├── glossary.md # Concept index
└── site/ # (with --site flag)
├── index.html # Interactive site entry
├── styles.css
└── scripts.js
```
## Source Traceability
Every architectural concept includes clickable source references:
```markdown
## Authentication Flow
The authentication system uses JWT tokens for stateless auth.
**Source:** [`src/auth/jwt-provider.ts:23-67`](../../../src/auth/jwt-provider.ts#L23-L67)
```
This allows developers to navigate directly from documentation to implementation.
## Interactive Site Features
When `--site` is used, the generated site includes:
| Feature | Description |
|---------|-------------|
| Full-text search | Instant search across all pages (Cmd/Ctrl+K) |
| Keyboard navigation | Arrow keys, vim-style (j/k/h/l) |
| Dark/light mode | Respects system preference or manual toggle |
| Table of contents | Auto-generated from headings |
| Mobile responsive | Works on all devices |
| Offline capable | No server required |
| Mermaid diagrams | Rendered automatically |
## Command Reference
### `generate` - Create wiki documentation
| Option | Description | Default |
|--------|-------------|---------|
| `-r, --repo <path/url>` | Repository path or GitHub URL (required) | - |
| `-o, --output <dir>` | Output directory for wiki | `./wiki` |
| `-p, --path <path>` | Focus on specific directory | - |
| `-s, --site` | Generate interactive static site | - |
| `--site-only` | Generate site only (skip wiki) | - |
| `--site-title <title>` | Custom site title | Project name |
| `--theme <theme>` | Site theme: light, dark, auto | `auto` |
| `-v, --verbose` | Show detailed progress | - |
| `-e, --estimate` | Estimate time/cost (dry run) | - |
| `--max-chunks <n>` | Limit indexed chunks (for large repos) | unlimited |
| `--skip-index` | Use cached embeddings index | - |
| `--direct-api` | Use Anthropic API directly | - |
| `-m, --model <model>` | Claude model to use | `claude-sonnet-4-20250514` |
| `--max-turns <n>` | Limit agent iterations | 200 |
### `continue` - Resume/fix wiki generation
| Option | Description | Default |
|--------|-------------|---------|
| `-r, --repo <path>` | Repository path (required) | - |
| `-o, --output <dir>` | Wiki output directory | `./wiki` |
| `--verify-only` | Only check, don't generate | - |
| `--skip-index` | Use cached embeddings index | - |
| `-v, --verbose` | Show detailed progress | - |
## Large Codebase Options
For repositories with 10,000+ files:
```bash
# Limit indexed chunks (reduces memory usage)
ted-mosby generate -r ./large-project --max-chunks 5000
# Reduce search results per query
ted-mosby generate -r ./large-project --max-results 5
# Batched processing (for very large repos)
ted-mosby generate -r ./large-project --batch-size 3000
```
## Typical Runtime
| Codebase Size | Approximate Time |
|---------------|------------------|
| Small (<50 files) | 1-2 minutes |
| Medium (50-200 files) | 2-5 minutes |
| Large (200+ files) | 5-10 minutes |
Use `--estimate` to get a cost/time estimate before running.
## Troubleshooting
### "Credit balance is too low" error
Use direct API mode:
```bash
ted-mosby generate -r ./my-project --direct-api
```
### Out of memory on large repos
Limit indexed chunks:
```bashRelated 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.