@sashabogi/foundation 0.1.0 → 0.1.1

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.
package/docs/PRD.md ADDED
@@ -0,0 +1,255 @@
1
+ # Foundation MCP Server - Product Requirements Document
2
+
3
+ ## Executive Summary
4
+
5
+ **Foundation** is a unified MCP server that consolidates three specialized tools into a single, cohesive platform for AI-assisted development, themed around Asimov's Foundation universe:
6
+
7
+ 1. **Demerzel** - Codebase intelligence beyond context limits (R. Daneel Olivaw)
8
+ 2. **Seldon** - Multi-agent orchestration with provider routing (Hari Seldon)
9
+ 3. **Gaia** - Session management and collective learning (The Collective Consciousness)
10
+
11
+ The result is a comprehensive toolkit that any Claude Code user (CLI or GUI) can leverage, while visual frontends like Ludicrous Ralphy become thin clients that consume Foundation's capabilities via MCP.
12
+
13
+ ---
14
+
15
+ ## Problem Statement
16
+
17
+ Currently, developers using Claude Code must:
18
+ - Install and configure 3+ separate MCP servers
19
+ - Deal with overlapping functionality (worktrees in 2 places, reviews in 2 places)
20
+ - Manage separate configuration files for each tool
21
+ - Hope that tools don't conflict with each other
22
+
23
+ Ludicrous Ralphy has internal implementations (ArgusManager, AgentRouter) that duplicate MCP server functionality, creating maintenance burden and feature drift.
24
+
25
+ ---
26
+
27
+ ## Solution
28
+
29
+ **One MCP server. One configuration. Complete AI development toolkit.**
30
+
31
+ ```
32
+ ┌──────────────────────────────────────────────────────────────────┐
33
+ │ FOUNDATION │
34
+ │ │
35
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
36
+ │ │ DEMERZEL │ │ SELDON │ │ GAIA │ │
37
+ │ │ (Codebase) │ │ (Agents) │ │ (Workflow) │ │
38
+ │ └─────────────┘ └─────────────┘ └─────────────┘ │
39
+ │ │ │ │ │
40
+ │ └────────────────┼────────────────┘ │
41
+ │ ▼ │
42
+ │ ┌──────────────────────────────────────────────────────────┐ │
43
+ │ │ SHARED SERVICES │ │
44
+ │ │ • StorageService (unified JSON persistence) │ │
45
+ │ │ • GitService (worktrees, branches, diffs) │ │
46
+ │ │ • ProviderService (13+ AI providers with failover) │ │
47
+ │ │ • ConfigService (single ~/.foundation/config.yaml) │ │
48
+ │ └──────────────────────────────────────────────────────────┘ │
49
+ │ │ │
50
+ │ ▼ │
51
+ │ MCP STDIO TRANSPORT │
52
+ └──────────────────────────────────────────────────────────────────┘
53
+
54
+ ┌──────────────┼──────────────┐
55
+ ▼ ▼ ▼
56
+ Claude Code Ludicrous Other MCP
57
+ (CLI) Ralphy (GUI) Clients
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Modules
63
+
64
+ ### Module 1: Demerzel (Codebase Intelligence)
65
+
66
+ **Source:** `@sashabogi/argus-mcp`
67
+ **Character:** R. Daneel Olivaw/Demerzel - 20,000 years of perfect memory, observing silently
68
+
69
+ **Purpose:** Understand codebases that exceed LLM context limits through intelligent snapshots and progressive disclosure.
70
+
71
+ **Tools (9):**
72
+
73
+ | Tool | Description | Token Cost |
74
+ |------|-------------|------------|
75
+ | `demerzel_snapshot` | Create codebase snapshot | 0 |
76
+ | `demerzel_search` | Regex search across codebase | 0 |
77
+ | `demerzel_find_files` | Glob pattern file matching | 0 |
78
+ | `demerzel_find_symbol` | Locate function/class definitions | 0 |
79
+ | `demerzel_find_importers` | Find files that import a module | 0 |
80
+ | `demerzel_get_deps` | Get file dependencies | 0 |
81
+ | `demerzel_get_context` | Get lines around a location | 0 |
82
+ | `demerzel_analyze` | AI-powered deep analysis | ~500 |
83
+ | `demerzel_semantic_search` | Natural language code search | ~100 |
84
+
85
+ **Key Features:**
86
+ - Enhanced snapshots with import graph and export index
87
+ - Zero-cost tools for 90% of queries
88
+ - Configurable AI provider for deep analysis
89
+ - Snapshot staleness detection
90
+
91
+ ---
92
+
93
+ ### Module 2: Seldon (Multi-Agent Orchestration)
94
+
95
+ **Source:** `hari-seldon`
96
+ **Character:** Hari Seldon - Created psychohistory, the Plan guides humanity's future
97
+
98
+ **Purpose:** Route tasks to specialized AI agents across 13+ providers with intelligent failover. Includes verification loop for automated plan → execute → verify → fix cycles.
99
+
100
+ **Tools (19):**
101
+
102
+ | Tool | Description |
103
+ |------|-------------|
104
+ | **Agent Invocation** | |
105
+ | `seldon_invoke` | Invoke a single agent by role |
106
+ | `seldon_compare` | Run same task through multiple agents |
107
+ | `seldon_critique` | Get adversarial plan critique |
108
+ | `seldon_review` | Get code review feedback |
109
+ | `seldon_design` | Get UI/UX design feedback |
110
+ | **Planning** | |
111
+ | `seldon_plan` | Generate detailed implementation plan from intent |
112
+ | `seldon_phase_create` | Break work into sequential, verifiable phases |
113
+ | `seldon_phase_list` | View all phases and their status |
114
+ | **Verification Loop** | |
115
+ | `seldon_verify` | Verify implementation against plan (critical/major/minor) |
116
+ | `seldon_fix` | Generate fixes for verification issues |
117
+ | `seldon_execute_verified` | YOLO Mode - execute with auto verify/fix loop |
118
+ | `seldon_execute_parallel` | Execute phases in parallel worktrees |
119
+ | **Pipelines** | |
120
+ | `seldon_pipeline_create` | Create multi-step DAG workflow |
121
+ | `seldon_pipeline_execute` | Execute a pipeline |
122
+ | `seldon_pipeline_status` | Get pipeline execution status |
123
+ | **Tasks** | |
124
+ | `seldon_task_execute` | Execute task in isolated worktree |
125
+ | `seldon_task_claim` | Claim next available task (worker pattern) |
126
+ | **Providers** | |
127
+ | `seldon_providers_list` | List available providers and health |
128
+ | `seldon_providers_test` | Test provider connectivity |
129
+
130
+ **Agent Roles:**
131
+ - `orchestrator` - Task synthesis, planning
132
+ - `coder` - Code generation (uses worktrees)
133
+ - `critic` - Adversarial plan review
134
+ - `reviewer` - Code review
135
+ - `designer` - UI/UX feedback
136
+ - `researcher` - Information gathering
137
+ - `verifier` - Implementation verification against plans
138
+
139
+ **Key Features:**
140
+ - 13+ AI providers (OpenAI, Anthropic, Gemini, DeepSeek, Ollama, etc.)
141
+ - Intelligent failover with health tracking and circuit breakers
142
+ - Cost-aware routing
143
+ - Session delegation mode for Claude Code (zero-cost Anthropic calls)
144
+ - DAG pipeline execution with dependency resolution
145
+ - **Verification Loop:** Plan → Execute → Verify → Fix → Re-verify (automatic)
146
+ - **Severity Thresholds:** Critical, Major, Minor issue categorization
147
+ - **Parallel Execution:** Multiple phases in separate worktrees simultaneously
148
+
149
+ ---
150
+
151
+ ### Module 3: Gaia (Workflow Patterns)
152
+
153
+ **Source:** `claude-workflow-orchestrator`
154
+ **Character:** Gaia - The collective consciousness, "We are all one, and one is all"
155
+
156
+ **Purpose:** Implement proven workflow patterns from the Claude Code team. Collective learning and memory.
157
+
158
+ **Tools (13):**
159
+
160
+ | Tool | Description |
161
+ |------|-------------|
162
+ | `gaia_worktree_create` | Create git worktree with session |
163
+ | `gaia_worktree_list` | List active worktrees |
164
+ | `gaia_worktree_switch` | Navigate between worktrees |
165
+ | `gaia_worktree_cleanup` | Remove stale worktrees |
166
+ | `gaia_session_register` | Track Claude session purpose |
167
+ | `gaia_session_status` | View active sessions |
168
+ | `gaia_session_handoff` | Prepare context for handoff |
169
+ | `gaia_session_complete` | Mark session as done |
170
+ | `gaia_learn` | Record correction for CLAUDE.md |
171
+ | `gaia_apply` | Write learnings to CLAUDE.md |
172
+ | `gaia_review` | Review accumulated learnings |
173
+ | `gaia_remember` | Save context state |
174
+ | `gaia_recall` | Restore previous context |
175
+
176
+ **Key Features:**
177
+ - Self-learning CLAUDE.md (capture mistakes, apply fixes)
178
+ - Session handoff documents with git status, changes, next steps
179
+ - Context memories for project state preservation
180
+ - Shell alias generation for quick worktree navigation
181
+
182
+ ---
183
+
184
+ ## Tool Naming Convention
185
+
186
+ All tools are prefixed by module for clarity:
187
+
188
+ - `demerzel_*` - Codebase intelligence (The Observer)
189
+ - `seldon_*` - Agent orchestration (The Planner)
190
+ - `gaia_*` - Workflow patterns (The Memory)
191
+
192
+ This prevents conflicts and makes tool discovery intuitive.
193
+
194
+ ---
195
+
196
+ ## Migration Plan
197
+
198
+ ### Phase 1: Foundation Core (Week 1)
199
+ - [x] Project setup (TypeScript, MCP SDK, Zod)
200
+ - [x] ConfigService with YAML parsing
201
+ - [x] StorageService with JSON persistence
202
+ - [x] GitService with worktree operations
203
+ - [x] Basic MCP server with stdio transport
204
+
205
+ ### Phase 2: Demerzel Module (Week 2)
206
+ - [ ] Port snapshot creation (basic + enhanced)
207
+ - [ ] Port search tools (regex, glob, symbol, importers)
208
+ - [ ] Port context tools (get_context, get_deps)
209
+ - [ ] Port AI analysis (with provider abstraction)
210
+ - [ ] Add semantic search
211
+
212
+ ### Phase 3: Seldon Module (Week 3)
213
+ - [ ] Port ProviderService with all 13+ providers
214
+ - [ ] Port failover system (health, circuit breakers)
215
+ - [ ] Port agent invocation tools
216
+ - [ ] Port pipeline execution (DAG)
217
+ - [ ] Port task execution with worktree isolation
218
+
219
+ ### Phase 4: Gaia Module (Week 4)
220
+ - [ ] Port worktree tools (unified with GitService)
221
+ - [ ] Port session management
222
+ - [ ] Port learning capture/apply
223
+ - [ ] Port context memories
224
+ - [ ] Add shell alias generation
225
+
226
+ ### Phase 5: Integration & Polish (Week 5)
227
+ - [ ] CLI interface
228
+ - [ ] Setup wizard
229
+ - [ ] Documentation
230
+ - [ ] Testing
231
+ - [ ] Ludicrous Ralphy integration guide
232
+
233
+ ---
234
+
235
+ ## Success Metrics
236
+
237
+ 1. **Single Install:** One `npm install` provides all capabilities
238
+ 2. **Single Config:** One `~/.foundation/config.yaml` for everything
239
+ 3. **No Duplication:** Each feature exists in exactly one place
240
+ 4. **Full Coverage:** All features from all 3 projects are preserved
241
+ 5. **Clean API:** Intuitive tool naming and consistent patterns
242
+ 6. **Backward Compat:** Existing Argus/Hari Seldon users can migrate easily
243
+
244
+ ---
245
+
246
+ ## Appendix: Tool Count Summary
247
+
248
+ | Module | Tools | From | Character |
249
+ |--------|-------|------|-----------|
250
+ | Demerzel | 9 | argus-mcp | R. Daneel Olivaw |
251
+ | Seldon | 19 | hari-seldon | Hari Seldon |
252
+ | Gaia | 13 | workflow-orchestrator | The Collective |
253
+ | **Total** | **41** | | |
254
+
255
+ **Final Count: 41 unique tools** (after adding verification loop)
@@ -0,0 +1,608 @@
1
+ # Foundation User Guide
2
+
3
+ A practical guide to using Foundation's 41 tools for AI-assisted development.
4
+
5
+ ---
6
+
7
+ ## Quick Start
8
+
9
+ After installing Foundation, these three commands get you started:
10
+
11
+ ```
12
+ Create a snapshot of this codebase
13
+ ```
14
+
15
+ ```
16
+ What's the architecture of this project?
17
+ ```
18
+
19
+ ```
20
+ Plan how to add [your feature here]
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Demerzel: Codebase Intelligence
26
+
27
+ *"I have been watching for 20,000 years."*
28
+
29
+ Demerzel gives you instant, token-efficient codebase understanding.
30
+
31
+ ### Creating Snapshots
32
+
33
+ **First time setup (do this once per project):**
34
+ ```
35
+ Create a Foundation snapshot of this project
36
+ ```
37
+
38
+ **With enhanced metadata (imports, exports, dependencies):**
39
+ ```
40
+ Create an enhanced snapshot of this codebase
41
+ ```
42
+
43
+ **Refresh stale snapshot:**
44
+ ```
45
+ Refresh the codebase snapshot - it's out of date
46
+ ```
47
+
48
+ ### Searching (Zero AI Cost)
49
+
50
+ **Find patterns:**
51
+ ```
52
+ Search the codebase for TODO comments
53
+ ```
54
+
55
+ ```
56
+ Search for all uses of useState in this project
57
+ ```
58
+
59
+ ```
60
+ Find all files that import the auth module
61
+ ```
62
+
63
+ **Find definitions:**
64
+ ```
65
+ Where is AuthProvider defined?
66
+ ```
67
+
68
+ ```
69
+ Find the symbol handlePayment
70
+ ```
71
+
72
+ **Find dependencies:**
73
+ ```
74
+ What files depend on the user service?
75
+ ```
76
+
77
+ ```
78
+ What does src/api/routes.ts import?
79
+ ```
80
+
81
+ ### Understanding (AI-Powered)
82
+
83
+ **Architecture questions:**
84
+ ```
85
+ How is this codebase organized? What are the main modules?
86
+ ```
87
+
88
+ ```
89
+ Explain the data flow from API request to database
90
+ ```
91
+
92
+ **Specific flows:**
93
+ ```
94
+ How does authentication work in this project?
95
+ ```
96
+
97
+ ```
98
+ Trace how a payment gets processed from checkout to confirmation
99
+ ```
100
+
101
+ **Pattern discovery:**
102
+ ```
103
+ What patterns are used for error handling?
104
+ ```
105
+
106
+ ```
107
+ How are API responses structured across the codebase?
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Seldon: Multi-Agent Orchestration
113
+
114
+ *"The future is not set, but it can be guided."*
115
+
116
+ Seldon coordinates multiple AI agents to plan, execute, and verify your work.
117
+
118
+ ### Agent Invocation
119
+
120
+ **Get a code review:**
121
+ ```
122
+ Review this code for security and performance issues
123
+ ```
124
+
125
+ ```
126
+ Review the auth middleware for potential vulnerabilities
127
+ ```
128
+
129
+ **Get design feedback:**
130
+ ```
131
+ Review this component design for accessibility
132
+ ```
133
+
134
+ ```
135
+ Critique the UX of this checkout flow
136
+ ```
137
+
138
+ **Get critical analysis:**
139
+ ```
140
+ Critique this architectural decision - what could go wrong?
141
+ ```
142
+
143
+ ```
144
+ What are the risks of using MongoDB for this use case?
145
+ ```
146
+
147
+ **Compare perspectives:**
148
+ ```
149
+ Compare what a critic and a coder think about this approach
150
+ ```
151
+
152
+ ```
153
+ Get opinions from reviewer and designer on this PR
154
+ ```
155
+
156
+ ### Planning
157
+
158
+ **Generate implementation plan:**
159
+ ```
160
+ Plan how to add user authentication with OAuth2
161
+ ```
162
+
163
+ ```
164
+ Plan the migration from REST to GraphQL
165
+ ```
166
+
167
+ ```
168
+ Plan how to add real-time notifications
169
+ ```
170
+
171
+ **Break into phases:**
172
+ ```
173
+ Create implementation phases for adding Stripe payments
174
+ ```
175
+
176
+ ```
177
+ Break down the dashboard redesign into manageable phases
178
+ ```
179
+
180
+ **View phases:**
181
+ ```
182
+ Show me all phases for the current plan
183
+ ```
184
+
185
+ ```
186
+ What's the status of each implementation phase?
187
+ ```
188
+
189
+ ### Verification Loop
190
+
191
+ **Verify implementation:**
192
+ ```
193
+ Verify the current implementation against our plan
194
+ ```
195
+
196
+ ```
197
+ Run tests and check if phase 2 meets the requirements
198
+ ```
199
+
200
+ **Fix issues:**
201
+ ```
202
+ Fix the issues found in verification - apply automatically
203
+ ```
204
+
205
+ ```
206
+ Generate fixes for major issues only
207
+ ```
208
+
209
+ **Execute with auto-verification (YOLO mode):**
210
+ ```
211
+ Execute phase 1 with verification - fix any issues automatically
212
+ ```
213
+
214
+ ```
215
+ Execute the auth implementation, verify, and fix up to 3 times
216
+ ```
217
+
218
+ **Execute with quality gates:**
219
+ ```
220
+ Execute phase 2 but stop on any major issues - I want to review those
221
+ ```
222
+
223
+ ```
224
+ Execute with strict verification - fail on warnings too
225
+ ```
226
+
227
+ ### Parallel Execution
228
+
229
+ **Run independent phases together:**
230
+ ```
231
+ Execute phases 2, 3, and 4 in parallel - they're independent
232
+ ```
233
+
234
+ ```
235
+ Run the API and frontend phases simultaneously in separate worktrees
236
+ ```
237
+
238
+ **With merge strategy:**
239
+ ```
240
+ Execute phases in parallel, then merge sequentially
241
+ ```
242
+
243
+ ```
244
+ Run parallel phases and merge in dependency order
245
+ ```
246
+
247
+ ### Pipelines
248
+
249
+ **Create reusable pipeline:**
250
+ ```
251
+ Create a pipeline for our standard feature development flow
252
+ ```
253
+
254
+ **Execute pipeline:**
255
+ ```
256
+ Run the feature-dev pipeline for the notifications feature
257
+ ```
258
+
259
+ **Check pipeline status:**
260
+ ```
261
+ What's the status of the running pipeline?
262
+ ```
263
+
264
+ ### Provider Management
265
+
266
+ **Check provider health:**
267
+ ```
268
+ Test all AI providers and show their status
269
+ ```
270
+
271
+ ```
272
+ Which providers are currently available?
273
+ ```
274
+
275
+ **List configurations:**
276
+ ```
277
+ Show me all configured agent roles and their providers
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Gaia: Workflow Patterns
283
+
284
+ *"We are all one, and one is all."*
285
+
286
+ Gaia manages parallel work, session continuity, and collective learning.
287
+
288
+ ### Worktrees (Parallel Development)
289
+
290
+ **Create worktree for a feature:**
291
+ ```
292
+ Create a worktree for the auth feature
293
+ ```
294
+
295
+ ```
296
+ Create a worktree called "payments" for the Stripe integration
297
+ ```
298
+
299
+ **Create multiple worktrees:**
300
+ ```
301
+ Create worktrees for auth, dashboard, and api-refactor
302
+ ```
303
+
304
+ **List active worktrees:**
305
+ ```
306
+ Show me all active worktrees
307
+ ```
308
+
309
+ ```
310
+ What worktrees are currently active and what are they for?
311
+ ```
312
+
313
+ **Switch context:**
314
+ ```
315
+ Switch to the payments worktree
316
+ ```
317
+
318
+ **Clean up:**
319
+ ```
320
+ Clean up worktrees for merged branches
321
+ ```
322
+
323
+ ```
324
+ Remove the auth worktree - that feature is done
325
+ ```
326
+
327
+ ### Session Management
328
+
329
+ **Register a session:**
330
+ ```
331
+ Register this session - I'm working on the OAuth2 integration
332
+ ```
333
+
334
+ ```
335
+ Start a new session for debugging the payment bug
336
+ ```
337
+
338
+ **Check session status:**
339
+ ```
340
+ What's the current session status?
341
+ ```
342
+
343
+ ```
344
+ Show me active sessions across all worktrees
345
+ ```
346
+
347
+ **Create handoff:**
348
+ ```
349
+ Create a handoff document - I need to continue tomorrow
350
+ ```
351
+
352
+ ```
353
+ Generate a handoff with git status and recent changes
354
+ ```
355
+
356
+ **Complete session:**
357
+ ```
358
+ Mark this session complete - the feature is done
359
+ ```
360
+
361
+ ### Collective Learning
362
+
363
+ **Capture a code style correction:**
364
+ ```
365
+ Learn this: never use any type - always use explicit types
366
+ ```
367
+
368
+ ```
369
+ Learn: we use early returns instead of nested if statements
370
+ ```
371
+
372
+ **Capture architectural decisions:**
373
+ ```
374
+ Learn: we use the repository pattern for all database access
375
+ ```
376
+
377
+ ```
378
+ Learn: API responses always use the standard envelope format
379
+ ```
380
+
381
+ **Capture project conventions:**
382
+ ```
383
+ Learn: test files go in __tests__ folders next to the source
384
+ ```
385
+
386
+ ```
387
+ Learn: we prefix private methods with underscore
388
+ ```
389
+
390
+ **Apply learnings:**
391
+ ```
392
+ Apply all learnings to CLAUDE.md
393
+ ```
394
+
395
+ ```
396
+ Apply pending learnings to the project configuration
397
+ ```
398
+
399
+ **Review learnings:**
400
+ ```
401
+ Show me all learnings for this project
402
+ ```
403
+
404
+ ```
405
+ What have we learned about error handling?
406
+ ```
407
+
408
+ ### Context Memory
409
+
410
+ **Save a checkpoint:**
411
+ ```
412
+ Remember this as "pre-refactor" - I might need to come back
413
+ ```
414
+
415
+ ```
416
+ Save current state as "working-auth" before I experiment
417
+ ```
418
+
419
+ **Recall checkpoint:**
420
+ ```
421
+ Recall the pre-refactor state
422
+ ```
423
+
424
+ ```
425
+ What was the context when I saved "working-auth"?
426
+ ```
427
+
428
+ ---
429
+
430
+ ## Complete Workflow Examples
431
+
432
+ ### Example 1: New Feature Development
433
+
434
+ ```
435
+ 1. Create a Foundation snapshot of this project
436
+
437
+ 2. How does the current user system work?
438
+
439
+ 3. Plan how to add user roles and permissions
440
+
441
+ 4. Critique this plan - what am I missing?
442
+
443
+ 5. Create implementation phases for user roles
444
+
445
+ 6. Create a worktree for the roles feature
446
+
447
+ 7. Register this session - implementing user roles
448
+
449
+ 8. Execute phase 1 (database schema) with verification
450
+
451
+ 9. Execute phase 2 (role service) with verification
452
+
453
+ 10. Review the roles code for security issues
454
+
455
+ 11. Learn: role checks should happen in middleware, not controllers
456
+
457
+ 12. Create a handoff document - continuing tomorrow
458
+ ```
459
+
460
+ ### Example 2: Bug Investigation & Fix
461
+
462
+ ```
463
+ 1. Search the codebase for payment processing
464
+
465
+ 2. How does the checkout flow work?
466
+
467
+ 3. What files depend on the payment service?
468
+
469
+ 4. Register this session - debugging payment timeout
470
+
471
+ 5. Plan how to fix the payment timeout issue
472
+
473
+ 6. Execute the fix with verification
474
+
475
+ 7. Learn: always set explicit timeouts for external API calls
476
+ ```
477
+
478
+ ### Example 3: Parallel Feature Development
479
+
480
+ ```
481
+ 1. Create worktrees for auth-upgrade and dashboard-v2
482
+
483
+ 2. In auth worktree: Execute the OAuth migration phases
484
+
485
+ 3. In dashboard worktree: Execute the redesign phases
486
+
487
+ 4. Run both feature branches in parallel with separate verification
488
+
489
+ 5. Review both features for consistency
490
+
491
+ 6. Clean up worktrees after merge
492
+ ```
493
+
494
+ ### Example 4: Code Review & Learning
495
+
496
+ ```
497
+ 1. Review the PR changes for security issues
498
+
499
+ 2. Compare critic and reviewer perspectives on this approach
500
+
501
+ 3. What patterns should we avoid based on this review?
502
+
503
+ 4. Learn: validate all user input at API boundaries
504
+
505
+ 5. Apply learnings to project CLAUDE.md
506
+ ```
507
+
508
+ ### Example 5: Onboarding to New Codebase
509
+
510
+ ```
511
+ 1. Create an enhanced snapshot of this project
512
+
513
+ 2. What's the architecture? Main technologies?
514
+
515
+ 3. How is the code organized? Key directories?
516
+
517
+ 4. How does authentication work?
518
+
519
+ 5. What are the main API endpoints?
520
+
521
+ 6. What testing patterns are used?
522
+
523
+ 7. What should I know before making changes?
524
+ ```
525
+
526
+ ---
527
+
528
+ ## Tips & Best Practices
529
+
530
+ ### Demerzel Tips
531
+ - Create enhanced snapshots for better import/export tracking
532
+ - Use zero-cost searches before AI analysis to save tokens
533
+ - Refresh snapshots when you've made significant changes
534
+
535
+ ### Seldon Tips
536
+ - Always get a critique before executing a big plan
537
+ - Use verification loops for anything touching critical paths
538
+ - Run independent phases in parallel to save time
539
+ - Set severity thresholds appropriate to the task
540
+
541
+ ### Gaia Tips
542
+ - Use worktrees for any work that might take multiple sessions
543
+ - Register sessions to track what you're doing
544
+ - Capture learnings immediately when you discover patterns
545
+ - Create handoffs before ending sessions on incomplete work
546
+
547
+ ### General Tips
548
+ - Start every project with a snapshot
549
+ - Use phases for any feature taking more than an hour
550
+ - Let verification catch issues before they become problems
551
+ - Build up project learnings over time - they compound
552
+
553
+ ---
554
+
555
+ ## Command Reference
556
+
557
+ ### Demerzel Commands
558
+ | Command | Purpose |
559
+ |---------|---------|
560
+ | `demerzel_snapshot` | Create codebase snapshot |
561
+ | `demerzel_search` | Regex search (free) |
562
+ | `demerzel_find_files` | Glob pattern search (free) |
563
+ | `demerzel_find_symbol` | Find where symbol is defined (free) |
564
+ | `demerzel_find_importers` | Find files that import a module (free) |
565
+ | `demerzel_get_deps` | Get file dependencies (free) |
566
+ | `demerzel_get_context` | Get code around a location (free) |
567
+ | `demerzel_analyze` | AI-powered analysis (~500 tokens) |
568
+ | `demerzel_semantic_search` | Natural language search |
569
+
570
+ ### Seldon Commands
571
+ | Command | Purpose |
572
+ |---------|---------|
573
+ | `seldon_invoke` | Invoke an agent role |
574
+ | `seldon_compare` | Compare multiple agents |
575
+ | `seldon_critique` | Get critical review |
576
+ | `seldon_review` | Code review |
577
+ | `seldon_design` | Design feedback |
578
+ | `seldon_plan` | Generate implementation plan |
579
+ | `seldon_phase_create` | Break plan into phases |
580
+ | `seldon_phase_list` | View all phases |
581
+ | `seldon_verify` | Verify implementation |
582
+ | `seldon_fix` | Generate fixes for issues |
583
+ | `seldon_execute_verified` | Execute with verification loop |
584
+ | `seldon_execute_parallel` | Execute phases in parallel |
585
+ | `seldon_pipeline_create` | Create reusable pipeline |
586
+ | `seldon_pipeline_execute` | Run a pipeline |
587
+ | `seldon_pipeline_status` | Check pipeline status |
588
+ | `seldon_task_execute` | Execute a task |
589
+ | `seldon_task_claim` | Claim a task |
590
+ | `seldon_providers_list` | List providers |
591
+ | `seldon_providers_test` | Test provider health |
592
+
593
+ ### Gaia Commands
594
+ | Command | Purpose |
595
+ |---------|---------|
596
+ | `gaia_worktree_create` | Create a worktree |
597
+ | `gaia_worktree_list` | List worktrees |
598
+ | `gaia_worktree_switch` | Switch to worktree |
599
+ | `gaia_worktree_cleanup` | Clean up worktrees |
600
+ | `gaia_session_register` | Register a session |
601
+ | `gaia_session_status` | Check session status |
602
+ | `gaia_session_handoff` | Create handoff document |
603
+ | `gaia_session_complete` | Mark session complete |
604
+ | `gaia_learn` | Capture a learning |
605
+ | `gaia_apply` | Apply learnings |
606
+ | `gaia_review` | Review learnings |
607
+ | `gaia_remember` | Save context snapshot |
608
+ | `gaia_recall` | Recall saved context |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sashabogi/foundation",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Unified MCP server for AI-assisted development: codebase intelligence, multi-agent orchestration, and workflow patterns",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -79,6 +79,7 @@
79
79
  },
80
80
  "files": [
81
81
  "dist",
82
+ "docs",
82
83
  "README.md",
83
84
  "LICENSE"
84
85
  ]