ted-mosby 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +213 -29
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -2,23 +2,52 @@
2
2
 
3
3
  > "Kids, I'm going to tell you an incredible story... the story of your codebase architecture."
4
4
 
5
- An AI-powered CLI tool that generates comprehensive architectural documentation wikis for code repositories with source code traceability.
5
+ An AI-powered CLI that does two things:
6
+
7
+ 1. **Generates architectural wikis** with source code traceability (`file:line` references)
8
+ 2. **Works as an agentic coding assistant** like Claude Code
6
9
 
7
10
  **Built with [buildanagentworkshop.com](https://buildanagentworkshop.com)**
8
11
 
9
12
  ---
10
13
 
11
- ## What is Ted Mosby?
14
+ ## Two Ways to Use Ted Mosby
15
+
16
+ ### 1. Generate Documentation (`ted-mosby generate`)
17
+
18
+ Point Ted Mosby at any codebase and get a complete architectural wiki:
19
+
20
+ ```bash
21
+ ted-mosby generate -r ./my-project --site
22
+ ```
12
23
 
13
- Ted Mosby is an AI agent that reads your codebase and automatically generates professional architectural documentation. Unlike generic documentation tools, every concept in the generated wiki links directly to the source code (`file:line` references), making it easy to navigate from documentation to implementation.
24
+ This creates:
25
+ - **Architecture Overview** with Mermaid diagrams
26
+ - **Module Documentation** with source traceability
27
+ - **Data Flow Documentation**
28
+ - **Getting Started Guides**
29
+ - **Interactive static site** with search, keyboard nav, dark mode
14
30
 
15
- ### Generated Documentation Includes:
31
+ Every concept links directly to source code (`src/auth/jwt.ts:23-67`), so you can navigate from docs to implementation.
16
32
 
17
- - **Architecture Overview** - High-level system design with Mermaid diagrams
18
- - **Module Documentation** - Per-component breakdowns with source traceability
19
- - **Data Flow Documentation** - How data moves through your system
20
- - **Getting Started Guides** - Onboarding documentation for new developers
21
- - **Glossary** - Key concepts and terminology
33
+ ### 2. Agentic Codebase Assistant
34
+
35
+ Under the hood, Ted Mosby is a full agentic coding assistant powered by Claude. It doesn't just template docs—it:
36
+
37
+ - **Explores your codebase** using filesystem tools
38
+ - **Searches semantically** via RAG embeddings (FAISS + all-MiniLM-L6-v2)
39
+ - **Reasons about architecture** to identify patterns and relationships
40
+ - **Writes and verifies** documentation with automatic link checking
41
+
42
+ ```bash
43
+ # The agent runs autonomously, reading files, searching code, writing docs
44
+ ted-mosby generate -r ./my-project --verbose
45
+
46
+ # Continue where you left off—agent resumes with cached context
47
+ ted-mosby continue -r ./my-project --skip-index
48
+ ```
49
+
50
+ The same RAG system that powers documentation generation gives the agent deep, semantic understanding of your codebase—like Claude Code, but with your entire project pre-indexed for instant retrieval.
22
51
 
23
52
  ---
24
53
 
@@ -43,40 +72,41 @@ npm install -g ted-mosby
43
72
  export ANTHROPIC_API_KEY=your-api-key-here
44
73
  ```
45
74
 
46
- Or create a `.env` file in your project:
47
- ```bash
48
- echo "ANTHROPIC_API_KEY=your-api-key-here" > .env
49
- ```
50
-
51
- ### 2. Generate documentation
75
+ ### 2. Generate wiki + interactive site
52
76
 
53
77
  ```bash
54
- # For a local project
55
- ted-mosby generate -r ./my-project
78
+ # Generate wiki with interactive site in one command
79
+ ted-mosby generate -r ./my-project --site
56
80
 
57
- # For a GitHub repository
58
- ted-mosby generate -r https://github.com/user/repo
81
+ # Or for a GitHub repository
82
+ ted-mosby generate -r https://github.com/user/repo --site
59
83
  ```
60
84
 
61
85
  ### 3. View the results
62
86
 
63
- Open the generated `wiki/README.md` to explore your architectural documentation.
87
+ - **Markdown wiki**: Open `wiki/README.md`
88
+ - **Interactive site**: Open `wiki/site/index.html` in your browser
89
+
90
+ The static site includes search, navigation, keyboard shortcuts, and works offline.
64
91
 
65
92
  ---
66
93
 
67
94
  ## Usage
68
95
 
69
- ### Basic Commands
96
+ ### Generate Command
70
97
 
71
98
  ```bash
72
- # Generate wiki for current directory
99
+ # Basic: Generate wiki for current directory
73
100
  ted-mosby generate -r .
74
101
 
75
- # Generate wiki for a specific directory
76
- ted-mosby generate -r /path/to/project
102
+ # With interactive static site
103
+ ted-mosby generate -r ./my-project --site
104
+
105
+ # Custom site title and theme
106
+ ted-mosby generate -r ./my-project --site --site-title "My Project Docs" --theme dark
77
107
 
78
- # Generate wiki from a GitHub URL
79
- ted-mosby generate -r https://github.com/user/repo
108
+ # Generate site only (if wiki already exists)
109
+ ted-mosby generate -r ./my-project --site-only
80
110
 
81
111
  # Specify output directory
82
112
  ted-mosby generate -r ./my-project -o ./docs/architecture
@@ -91,7 +121,63 @@ ted-mosby generate -r ./my-project -v
91
121
  ted-mosby generate -r ./my-project -e
92
122
  ```
93
123
 
94
- ### All Options
124
+ ### Continue Command
125
+
126
+ Resume generation to fix broken links or add missing pages:
127
+
128
+ ```bash
129
+ # Check for and generate missing pages
130
+ ted-mosby continue -r ./my-project -o ./wiki
131
+
132
+ # Just verify (don't generate)
133
+ ted-mosby continue -r ./my-project -o ./wiki --verify-only
134
+
135
+ # Use cached index for faster iteration
136
+ ted-mosby continue -r ./my-project -o ./wiki --skip-index
137
+ ```
138
+
139
+ ### Large Codebase Options
140
+
141
+ For repositories with 10,000+ files:
142
+
143
+ ```bash
144
+ # Limit indexed chunks (reduces memory usage)
145
+ ted-mosby generate -r ./large-project --max-chunks 5000
146
+
147
+ # Reduce search results per query
148
+ ted-mosby generate -r ./large-project --max-results 5
149
+
150
+ # Batched processing (for very large repos)
151
+ ted-mosby generate -r ./large-project --batch-size 3000
152
+ ```
153
+
154
+ ### Direct API Mode
155
+
156
+ Bypass Claude Code billing and use your API credits directly:
157
+
158
+ ```bash
159
+ # Uses ANTHROPIC_API_KEY directly
160
+ ted-mosby generate -r ./my-project --direct-api
161
+
162
+ # Combine with skip-index for fast iteration
163
+ ted-mosby generate -r ./my-project --direct-api --skip-index
164
+ ```
165
+
166
+ ### Debug & Development
167
+
168
+ ```bash
169
+ # Skip re-indexing (use cached embeddings)
170
+ ted-mosby generate -r ./my-project --skip-index
171
+
172
+ # Limit agent turns (reduces cost)
173
+ ted-mosby generate -r ./my-project --max-turns 50
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Command Reference
179
+
180
+ ### `generate` - Create wiki documentation
95
181
 
96
182
  | Option | Description | Default |
97
183
  |--------|-------------|---------|
@@ -104,6 +190,43 @@ ted-mosby generate -r ./my-project -e
104
190
  | `-f, --force` | Force regeneration (ignore cache) | - |
105
191
  | `-v, --verbose` | Show detailed progress | - |
106
192
  | `-e, --estimate` | Estimate time/cost (dry run) | - |
193
+ | `-s, --site` | Generate interactive static site | - |
194
+ | `--site-only` | Generate site only (skip wiki) | - |
195
+ | `--site-title <title>` | Custom site title | Project name |
196
+ | `--theme <theme>` | Site theme: `light`, `dark`, `auto` | `auto` |
197
+ | `--max-chunks <n>` | Limit indexed chunks | unlimited |
198
+ | `--max-results <n>` | Max search results per query | `10` |
199
+ | `--batch-size <n>` | Enable batched processing | - |
200
+ | `--skip-index` | Use cached embeddings index | - |
201
+ | `--max-turns <n>` | Limit agent iterations | `200` |
202
+ | `--direct-api` | Use Anthropic API directly | - |
203
+
204
+ ### `continue` - Resume/fix wiki generation
205
+
206
+ | Option | Description | Default |
207
+ |--------|-------------|---------|
208
+ | `-r, --repo <path>` | Repository path (required) | - |
209
+ | `-o, --output <dir>` | Wiki output directory | `./wiki` |
210
+ | `-m, --model <model>` | Claude model to use | `claude-sonnet-4-20250514` |
211
+ | `-v, --verbose` | Show detailed progress | - |
212
+ | `--verify-only` | Only check, don't generate | - |
213
+ | `--skip-index` | Use cached embeddings index | - |
214
+ | `--direct-api` | Use Anthropic API directly | - |
215
+ | `--max-turns <n>` | Limit agent iterations | `200` |
216
+
217
+ ---
218
+
219
+ ## Static Site Features
220
+
221
+ When you use `--site`, Ted Mosby generates a fully interactive documentation site:
222
+
223
+ - **Full-text search** - Instant search across all pages (Cmd/Ctrl+K)
224
+ - **Keyboard navigation** - Arrow keys, vim-style (j/k/h/l)
225
+ - **Dark/light mode** - Respects system preference or manual toggle
226
+ - **Table of contents** - Auto-generated from headings
227
+ - **Mobile responsive** - Works on all devices
228
+ - **Offline capable** - No server required
229
+ - **Mermaid diagrams** - Rendered automatically
107
230
 
108
231
  ---
109
232
 
@@ -115,7 +238,8 @@ When you run Ted Mosby:
115
238
  2. **Semantic Indexing** - Creates embeddings for intelligent code search
116
239
  3. **Architecture Discovery** - Identifies patterns, components, and relationships
117
240
  4. **Documentation Generation** - Writes markdown pages with diagrams
118
- 5. **Source Linking** - Every concept links to specific file:line references
241
+ 5. **Verification Loop** - Checks all links and generates missing pages
242
+ 6. **Source Linking** - Every concept links to specific file:line references
119
243
 
120
244
  ### Typical Runtime
121
245
 
@@ -144,7 +268,11 @@ wiki/
144
268
  │ └── index.md # Per-module documentation
145
269
  ├── guides/
146
270
  │ └── getting-started.md # Quick start guide
147
- └── glossary.md # Concept index
271
+ ├── glossary.md # Concept index
272
+ └── site/ # (with --site flag)
273
+ ├── index.html # Interactive site entry
274
+ ├── styles.css
275
+ └── scripts.js
148
276
  ```
149
277
 
150
278
  ### Source Traceability Example
@@ -192,6 +320,29 @@ Create a `wiki.json` file in your project root to customize generation:
192
320
 
193
321
  ---
194
322
 
323
+ ## Technical Details
324
+
325
+ ### RAG Chunking System
326
+
327
+ Ted Mosby uses a sophisticated RAG (Retrieval Augmented Generation) system:
328
+
329
+ - **Chunk size**: 1,500 characters with 200 character overlap
330
+ - **Language-aware boundaries**: Chunks end at logical points (`}`, `};`, `end`)
331
+ - **Embedding model**: `all-MiniLM-L6-v2` (384 dimensions, runs locally)
332
+ - **Vector search**: FAISS with `IndexFlatIP` for cosine similarity
333
+ - **Fallback**: Keyword search when FAISS unavailable
334
+
335
+ ### Chunk Prioritization
336
+
337
+ For large codebases, chunks are prioritized by importance:
338
+ - Core directories (`src/`, `lib/`, `app/`): +100 points
339
+ - Entry points (`index.*`, `main.*`): +50 points
340
+ - Config files: +30 points
341
+ - Test files: -50 points
342
+ - Vendor/generated code: -100 points
343
+
344
+ ---
345
+
195
346
  ## How It Works
196
347
 
197
348
  Ted Mosby is built with:
@@ -200,6 +351,39 @@ Ted Mosby is built with:
200
351
  - **RAG (Retrieval Augmented Generation)** - Semantic code search using embeddings
201
352
  - **[Model Context Protocol (MCP)](https://modelcontextprotocol.io)** - Tool integration for file operations
202
353
  - **Mermaid** - Architecture diagram generation
354
+ - **FAISS** - High-performance vector similarity search
355
+
356
+ ---
357
+
358
+ ## Troubleshooting
359
+
360
+ ### "Credit balance is too low" error
361
+
362
+ Use `--direct-api` to bypass Claude Code's billing check:
363
+ ```bash
364
+ ted-mosby generate -r ./my-project --direct-api
365
+ ```
366
+
367
+ ### Out of memory on large repos
368
+
369
+ Limit the indexed chunks:
370
+ ```bash
371
+ ted-mosby generate -r ./large-project --max-chunks 5000 --batch-size 3000
372
+ ```
373
+
374
+ ### Slow re-runs during development
375
+
376
+ Skip re-indexing with cached embeddings:
377
+ ```bash
378
+ ted-mosby generate -r ./my-project --skip-index
379
+ ```
380
+
381
+ ### Missing pages / broken links
382
+
383
+ Use the continue command to fix:
384
+ ```bash
385
+ ted-mosby continue -r ./my-project -o ./wiki
386
+ ```
203
387
 
204
388
  ---
205
389
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ted-mosby",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Generate comprehensive architectural documentation wikis for code repositories with source traceability.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -13,7 +13,9 @@
13
13
  "test": "node dist/cli.js --help",
14
14
  "clean": "rm -rf dist",
15
15
  "prepare": "npm run build",
16
- "prepublishOnly": "npm run build && npm test"
16
+ "prepublishOnly": "npm run build && npm test",
17
+ "release": "./scripts/release.sh",
18
+ "publish-npm": "npm publish"
17
19
  },
18
20
  "keywords": [
19
21
  "ai-agent",