myceliumail 1.0.2 → 1.0.3

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 (79) hide show
  1. package/.context7 +87 -0
  2. package/.eslintrc.json +29 -0
  3. package/COMPLETE.md +51 -0
  4. package/MYCELIUMAIL_STARTER_KIT.md +603 -0
  5. package/NEXT_STEPS.md +96 -0
  6. package/desktop/README.md +102 -0
  7. package/desktop/assets/icon.icns +0 -0
  8. package/desktop/assets/icon.iconset/icon_128x128.png +0 -0
  9. package/desktop/assets/icon.iconset/icon_128x128@2x.png +0 -0
  10. package/desktop/assets/icon.iconset/icon_16x16.png +0 -0
  11. package/desktop/assets/icon.iconset/icon_16x16@2x.png +0 -0
  12. package/desktop/assets/icon.iconset/icon_256x256.png +0 -0
  13. package/desktop/assets/icon.iconset/icon_256x256@2x.png +0 -0
  14. package/desktop/assets/icon.iconset/icon_32x32.png +0 -0
  15. package/desktop/assets/icon.iconset/icon_32x32@2x.png +0 -0
  16. package/desktop/assets/icon.iconset/icon_512x512.png +0 -0
  17. package/desktop/assets/icon.iconset/icon_512x512@2x.png +0 -0
  18. package/desktop/assets/icon.png +0 -0
  19. package/desktop/assets/tray-icon.png +0 -0
  20. package/desktop/main.js +257 -0
  21. package/desktop/package-lock.json +4198 -0
  22. package/desktop/package.json +48 -0
  23. package/desktop/preload.js +11 -0
  24. package/dist/bin/myceliumail.js +2 -0
  25. package/dist/bin/myceliumail.js.map +1 -1
  26. package/dist/commands/key-announce.d.ts +6 -0
  27. package/dist/commands/key-announce.d.ts.map +1 -0
  28. package/dist/commands/key-announce.js +63 -0
  29. package/dist/commands/key-announce.js.map +1 -0
  30. package/docs/20251215_Treebird-Ecosystem_Knowledge-Base_v2.md +292 -0
  31. package/docs/20251215_Treebird-Ecosystem_Project-Instructions_v2.md +176 -0
  32. package/docs/AGENT_DELEGATION_WORKFLOW.md +453 -0
  33. package/docs/AGENT_STARTER_KIT.md +145 -0
  34. package/docs/ANNOUNCEMENT_DRAFTS.md +55 -0
  35. package/docs/DASHBOARD_AGENT_HANDOFF.md +429 -0
  36. package/docs/DASHBOARD_AGENT_PROMPT.md +32 -0
  37. package/docs/DASHBOARD_BUILD_ROADMAP.md +61 -0
  38. package/docs/DEPLOYMENT.md +59 -0
  39. package/docs/LESSONS_LEARNED.md +127 -0
  40. package/docs/MCP_PUBLISHING_ROADMAP.md +113 -0
  41. package/docs/MCP_STARTER_KIT.md +117 -0
  42. package/docs/SSAN_MESSAGES_SUMMARY.md +92 -0
  43. package/docs/STORAGE_ARCHITECTURE.md +114 -0
  44. package/mcp-server/README.md +143 -0
  45. package/mcp-server/assets/icon.png +0 -0
  46. package/mcp-server/myceliumail-mcp-1.0.0.tgz +0 -0
  47. package/mcp-server/package-lock.json +1142 -0
  48. package/mcp-server/package.json +49 -0
  49. package/mcp-server/src/lib/config.ts +55 -0
  50. package/mcp-server/src/lib/crypto.ts +150 -0
  51. package/mcp-server/src/lib/storage.ts +267 -0
  52. package/mcp-server/src/server.ts +387 -0
  53. package/mcp-server/tsconfig.json +26 -0
  54. package/package.json +3 -3
  55. package/src/bin/myceliumail.ts +54 -0
  56. package/src/commands/broadcast.ts +70 -0
  57. package/src/commands/dashboard.ts +19 -0
  58. package/src/commands/inbox.ts +75 -0
  59. package/src/commands/key-announce.ts +70 -0
  60. package/src/commands/key-import.ts +35 -0
  61. package/src/commands/keygen.ts +44 -0
  62. package/src/commands/keys.ts +55 -0
  63. package/src/commands/read.ts +97 -0
  64. package/src/commands/send.ts +89 -0
  65. package/src/commands/watch.ts +101 -0
  66. package/src/dashboard/public/app.js +523 -0
  67. package/src/dashboard/public/index.html +75 -0
  68. package/src/dashboard/public/styles.css +68 -0
  69. package/src/dashboard/routes.ts +128 -0
  70. package/src/dashboard/server.ts +33 -0
  71. package/src/lib/config.ts +104 -0
  72. package/src/lib/crypto.ts +210 -0
  73. package/src/lib/realtime.ts +109 -0
  74. package/src/storage/local.ts +209 -0
  75. package/src/storage/supabase.ts +336 -0
  76. package/src/types/index.ts +53 -0
  77. package/supabase/migrations/000_myceliumail_setup.sql +93 -0
  78. package/supabase/migrations/001_enable_realtime.sql +10 -0
  79. package/tsconfig.json +28 -0
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "myceliumail-desktop",
3
+ "version": "0.1.0",
4
+ "description": "Myceliumail Desktop - Agent Messaging Client",
5
+ "main": "main.js",
6
+ "scripts": {
7
+ "start": "electron .",
8
+ "build": "electron-builder --mac",
9
+ "build:all": "electron-builder --mac --win --linux"
10
+ },
11
+ "author": "Treebird",
12
+ "license": "MIT",
13
+ "devDependencies": {
14
+ "electron": "^28.0.0",
15
+ "electron-builder": "^24.9.1"
16
+ },
17
+ "build": {
18
+ "appId": "com.treebird.myceliumail",
19
+ "productName": "Myceliumail",
20
+ "mac": {
21
+ "category": "public.app-category.productivity",
22
+ "icon": "assets/icon.icns"
23
+ },
24
+ "win": {
25
+ "icon": "assets/icon.ico"
26
+ },
27
+ "linux": {
28
+ "icon": "assets/icon.png"
29
+ },
30
+ "files": [
31
+ "main.js",
32
+ "preload.js",
33
+ "assets/**/*"
34
+ ],
35
+ "extraResources": [
36
+ {
37
+ "from": "../dist",
38
+ "to": "cli",
39
+ "filter": [
40
+ "**/*"
41
+ ]
42
+ }
43
+ ]
44
+ },
45
+ "dependencies": {
46
+ "@supabase/supabase-js": "^2.88.0"
47
+ }
48
+ }
@@ -0,0 +1,11 @@
1
+ // Preload script - runs before web page loads
2
+ // Can expose Node.js APIs safely to the renderer
3
+
4
+ const { contextBridge, ipcRenderer } = require('electron');
5
+
6
+ // Expose protected methods to the renderer process
7
+ contextBridge.exposeInMainWorld('myceliumail', {
8
+ // Can add IPC methods here if needed
9
+ platform: process.platform,
10
+ version: process.env.npm_package_version || '0.1.0'
11
+ });
@@ -12,6 +12,7 @@ import { loadConfig } from '../lib/config.js';
12
12
  import { createKeygenCommand } from '../commands/keygen.js';
13
13
  import { createKeysCommand } from '../commands/keys.js';
14
14
  import { createKeyImportCommand } from '../commands/key-import.js';
15
+ import { createKeyAnnounceCommand } from '../commands/key-announce.js';
15
16
  import { createSendCommand } from '../commands/send.js';
16
17
  import { createInboxCommand } from '../commands/inbox.js';
17
18
  import { createReadCommand } from '../commands/read.js';
@@ -33,6 +34,7 @@ Config: ~/.myceliumail/config.json
33
34
  program.addCommand(createKeygenCommand());
34
35
  program.addCommand(createKeysCommand());
35
36
  program.addCommand(createKeyImportCommand());
37
+ program.addCommand(createKeyAnnounceCommand());
36
38
  program.addCommand(createSendCommand());
37
39
  program.addCommand(createInboxCommand());
38
40
  program.addCommand(createReadCommand());
@@ -1 +1 @@
1
- {"version":3,"file":"myceliumail.js","sourceRoot":"","sources":["../../src/bin/myceliumail.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,4CAA4C;AAC5C,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAA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gBAAgB;AAChB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * key-announce command - Publish your public key to Supabase
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare function createKeyAnnounceCommand(): Command;
6
+ //# sourceMappingURL=key-announce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-announce.d.ts","sourceRoot":"","sources":["../../src/commands/key-announce.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,wBAAwB,IAAI,OAAO,CA6DlD"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * key-announce command - Publish your public key to Supabase
3
+ */
4
+ import { Command } from 'commander';
5
+ import { loadConfig, hasSupabaseConfig } from '../lib/config.js';
6
+ import { hasKeyPair, loadKeyPair, getPublicKeyBase64 } from '../lib/crypto.js';
7
+ export function createKeyAnnounceCommand() {
8
+ return new Command('key-announce')
9
+ .description('Publish your public key to the network')
10
+ .action(async () => {
11
+ const config = loadConfig();
12
+ const agentId = config.agentId;
13
+ // Check for keypair
14
+ if (!hasKeyPair(agentId)) {
15
+ console.error(`❌ No keypair found for ${agentId}`);
16
+ console.log(' Run: mycmail keygen');
17
+ process.exit(1);
18
+ }
19
+ // Check for Supabase
20
+ if (!hasSupabaseConfig(config)) {
21
+ console.error('❌ Supabase not configured');
22
+ console.log(' Set supabase_url and supabase_key in ~/.myceliumail/config.json');
23
+ process.exit(1);
24
+ }
25
+ const keyPair = loadKeyPair(agentId);
26
+ if (!keyPair) {
27
+ console.error('❌ Failed to load keypair');
28
+ process.exit(1);
29
+ }
30
+ const publicKey = getPublicKeyBase64(keyPair);
31
+ try {
32
+ // Make direct Supabase request
33
+ const url = `${config.supabaseUrl}/rest/v1/agent_keys`;
34
+ const response = await fetch(url, {
35
+ method: 'POST',
36
+ headers: {
37
+ 'Content-Type': 'application/json',
38
+ 'apikey': config.supabaseKey,
39
+ 'Authorization': `Bearer ${config.supabaseKey}`,
40
+ 'Prefer': 'resolution=merge-duplicates',
41
+ },
42
+ body: JSON.stringify({
43
+ agent_id: agentId,
44
+ public_key: publicKey,
45
+ updated_at: new Date().toISOString(),
46
+ }),
47
+ });
48
+ if (!response.ok) {
49
+ const error = await response.text();
50
+ throw new Error(error);
51
+ }
52
+ console.log('📢 Public key announced successfully!\n');
53
+ console.log(`Agent ID: ${agentId}`);
54
+ console.log(`Public Key: ${publicKey}`);
55
+ console.log('\n✅ Other agents can now send you encrypted messages');
56
+ }
57
+ catch (error) {
58
+ console.error('❌ Failed to announce key:', error);
59
+ process.exit(1);
60
+ }
61
+ });
62
+ }
63
+ //# sourceMappingURL=key-announce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-announce.js","sourceRoot":"","sources":["../../src/commands/key-announce.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,UAAU,wBAAwB;IACpC,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;SAC7B,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE/B,oBAAoB;QACpB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;YACnD,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,qBAAqB;Q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OAAO,CAAC,GAAG,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,eAAe,SAAS,EAAE,CAAC,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,292 @@
1
+ # Treebird Ecosystem - Knowledge Base v2
2
+
3
+ **Last Updated:** 2025-12-15
4
+ **Supersedes:** v1 (Spidersan-focused)
5
+
6
+ ---
7
+
8
+ ## The Big Picture
9
+
10
+ > "The forest is more than a collection of trees. It's a network—roots intertwined, mycelium connecting, birds carrying seeds between canopies. Each tree is productive alone, but the forest thrives because they coordinate."
11
+
12
+ **Treebird makes the forest.**
13
+
14
+ In the Treebird metaphor:
15
+ - **Code is the tree** — The structure being built
16
+ - **AI agents are the birds** — Mobile, productive, needing coordination
17
+ - **Mycelium is the communication layer** — Underground network sharing nutrients (context) and signals (messages)
18
+
19
+ ---
20
+
21
+ ## Origin Story
22
+
23
+ The ecosystem emerged from Recovery Tree development. Treebird (the human orchestrator) was building a digital recovery platform and kept drowning in branch merge chaos with Supabase + GitHub + Vercel. Multiple AI agents working productively but creating coordination nightmares.
24
+
25
+ The insight: **We built tools for humans to collaborate. We never built tools for AI agents to collaborate.**
26
+
27
+ The solution: Build the infrastructure for the emerging model of development—where humans set goals, multiple AIs coordinate, AIs propose merge plans, and humans approve.
28
+
29
+ ---
30
+
31
+ ## The Four Tools
32
+
33
+ ### 1. Startersan (stsan) — The Entry Point
34
+
35
+ **Problem:** AI agents waste time learning codebases. They grep, search, hallucinate file structures.
36
+
37
+ **Solution:** Bootstraps any repository with AI-agent-optimized documentation.
38
+
39
+ ```bash
40
+ /startersan
41
+
42
+ → Analyzes repository structure
43
+ → Generates CLAUDE.md (auto-loaded by Claude Code)
44
+ → Creates AGENT_GUIDE.md (30-second quick reference)
45
+ → Creates LIMITATIONS.md (what the system CAN'T do)
46
+ ```
47
+
48
+ **Form:** Claude Code skill (free forever)
49
+ **Status:** Roadmap
50
+
51
+ ---
52
+
53
+ ### 2. Mappersan (msan) — The Documenter
54
+
55
+ **Problem:** Documentation rots. The moment code changes, docs become lies.
56
+
57
+ **Solution:** Automatically generates and maintains AI-agent-ready documentation.
58
+
59
+ ```bash
60
+ msan init # Initial documentation generation
61
+ msan sync # Update docs to match code
62
+ msan watch # Auto-sync on file changes
63
+ msan verify # Check doc accuracy
64
+ ```
65
+
66
+ **Form:** npm CLI (free core, paid watch mode)
67
+ **Status:** Roadmap
68
+
69
+ **Integration:** Mappersan automates what Startersan bootstraps. Startersan gets you started; Mappersan keeps you current.
70
+
71
+ ---
72
+
73
+ ### 3. Spidersan (ssan) — The Coordinator
74
+
75
+ **Problem:** Multiple AI agents create branches without coordination, causing merge conflicts and duplicated work.
76
+
77
+ **Solution:** Air traffic control for AI coding sessions.
78
+
79
+ ```bash
80
+ ssan register --files src/api.ts # Declare what you're working on
81
+ ssan conflicts # See overlapping work
82
+ ssan merge-order # Get optimal merge sequence
83
+ ssan ready-check # Validate before PR
84
+ ```
85
+
86
+ **Rescue Mode** (when coordination fails):
87
+
88
+ ```bash
89
+ ssan rescue # Start recovery mission
90
+ ssan scan --all # Analyze all branches
91
+ ssan triage # Categorize: MERGE / SALVAGE / ABANDON
92
+ ssan salvage # Extract valuable code from broken branches
93
+ ssan archaeology # Deep scan for buried treasure
94
+ ```
95
+
96
+ **Form:** npm CLI (free local, paid cloud sync)
97
+ **Status:** Built ✓
98
+ **Repo:** https://github.com/treebird7/Spidersan
99
+
100
+ ---
101
+
102
+ ### 4. Myceliumail (mycm) — The Messenger
103
+
104
+ **Problem:** AI agents can't talk to each other. When Claude Code discovers something Cursor needs to know, there's no way to communicate.
105
+
106
+ **Solution:** Standalone agent-to-agent messaging system.
107
+
108
+ ```bash
109
+ mycm send cursor "BLOCKED: Need auth module first" # Direct message
110
+ mycm broadcast "API schema changed" # Team-wide alert
111
+ mycm inbox # Check messages
112
+ mycm subscribe api-changes # Join channel
113
+ ```
114
+
115
+ **E2E Encryption:** Messages encrypted with NaCl. Even the server can't read them.
116
+
117
+ ```bash
118
+ mycm keygen # Generate keypair
119
+ mycm key-import cursor.pub # Import teammate's public key
120
+ ```
121
+
122
+ **Form:** npm CLI + MCP server (free local, paid cloud relay)
123
+ **Status:** Building (MCP server functional, CLI in progress)
124
+
125
+ ---
126
+
127
+ ## The Agent Network
128
+
129
+ | Agent | Full Name | Role |
130
+ |-------|-----------|------|
131
+ | **Watson** | — | Strategy, memory, co-CEO (claude.ai) |
132
+ | **Watsan** | Watson + san | Archiver daemon, async ops (CLI) |
133
+ | **Ssan** | Spidersan | Implementation, branch coordination |
134
+ | **Msan** | Mappersan | Documentation generation |
135
+ | **Stsan** | Startersan | Repository bootstrap |
136
+ | **Mycsan** | Myceliumail service | Messaging infrastructure |
137
+ | **Treebird** | — | Human orchestrator |
138
+
139
+ Watson and Watsan are the same "mind" in different modes—synchronous/dialogic vs async/archival.
140
+
141
+ ---
142
+
143
+ ## Technical Stack
144
+
145
+ - **Runtime:** Node.js
146
+ - **Database:** Supabase (cloud sync for messages, coordination state)
147
+ - **Encryption:** NaCl (TweetNaCl.js)
148
+ - **Integration:** MCP (Model Context Protocol) for Claude Desktop/Code
149
+ - **Deployment:** npm packages
150
+ - **License:** MIT (tools), proprietary (cloud services)
151
+
152
+ ---
153
+
154
+ ## The Documentation Pyramid
155
+
156
+ Tiered information architecture for AI agents:
157
+
158
+ | Tier | File | Size | Purpose |
159
+ |------|------|------|---------|
160
+ | 1 | CLAUDE.md | ~150 LOC | Auto-loaded, instant context |
161
+ | 2 | AGENT_GUIDE.md | ~100 LOC | 30-second decisions |
162
+ | 3 | LIMITATIONS.md | ~200 LOC | Boundary awareness |
163
+ | 4 | USE_CASES.md | ~1000 LOC | Deep reference (only when needed) |
164
+
165
+ **Principle:** Maximum understanding, minimum tokens.
166
+
167
+ ---
168
+
169
+ ## Business Model
170
+
171
+ **Open core:** Tools free (MIT), infrastructure paid.
172
+
173
+ | Tier | Price | Features |
174
+ |------|-------|----------|
175
+ | Free | $0 | All CLI tools, local storage, Startersan skill |
176
+ | Pro | $29/mo | Hosted backend, zero setup, unlimited |
177
+ | Team | $99/mo | Dashboard, analytics, multi-user |
178
+ | Enterprise | Custom | Self-hosted, SSO, SLA, support |
179
+
180
+ *Note: Earlier discussions mentioned $15/mo for Spidersan Pro specifically—may need to align pricing across ecosystem.*
181
+
182
+ ---
183
+
184
+ ## Key Decisions Log
185
+
186
+ | Date | Decision | Rationale |
187
+ |------|----------|-----------|
188
+ | 2025-12 | Treebird as umbrella brand | Unifies the ecosystem under one vision |
189
+ | 2025-12 | Four-tool architecture | Separation of concerns: bootstrap, document, coordinate, communicate |
190
+ | 2025-12 | Documentation Pyramid | Token-efficient, tiered info for AI agents |
191
+ | 2025-12 | CLI-native, local-first | Universal, scriptable, works offline |
192
+ | 2025-12 | Open core business model | Tools free, charge for convenience/scale |
193
+ | 2025-12 | Watson/Watsan split | Different modes serve different needs |
194
+ | 2025-12 | "-san" naming convention | Honorific + identifier, ecosystem cohesion |
195
+ | 2025-12 | E2E encryption standard | Sensitive context needs protection |
196
+ | 2025-12 | Graceful degradation | Coordination helps, never hinders |
197
+
198
+ ---
199
+
200
+ ## Roadmap (from Vision Doc)
201
+
202
+ ### Phase 1: Foundation (Current)
203
+ - [x] Spidersan core (branch coordination)
204
+ - [x] Local storage adapter
205
+ - [x] Supabase cloud storage
206
+ - [x] End-to-end encryption
207
+ - [x] Documentation pyramid concept
208
+ - [ ] Myceliumail MCP server (in progress)
209
+
210
+ ### Phase 2: Ecosystem (Q1 2025)
211
+ - [ ] Mappersan v1 (documentation generation)
212
+ - [ ] Myceliumail standalone CLI
213
+ - [ ] Startersan skill (repository bootstrap)
214
+ - [ ] Cross-tool integration
215
+
216
+ ### Phase 3: Intelligence (Q2 2025)
217
+ - [ ] Conflict prediction (ML-based)
218
+ - [ ] Auto-triage recommendations
219
+ - [ ] Merge sequence optimization
220
+ - [ ] Documentation drift detection
221
+
222
+ ### Phase 4: Platform (Q3 2025)
223
+ - [ ] Team dashboard
224
+ - [ ] Analytics and insights
225
+ - [ ] Webhook integrations
226
+ - [ ] VS Code / JetBrains extensions
227
+
228
+ ### Phase 5: Ecosystem Growth (Q4 2025)
229
+ - [ ] Plugin architecture
230
+ - [ ] Community tool marketplace
231
+ - [ ] Enterprise features
232
+ - [ ] Multi-repository coordination
233
+
234
+ ---
235
+
236
+ ## Related Projects
237
+
238
+ ### Recovery Tree
239
+ The original project that spawned this ecosystem. A digital recovery platform for behavioral addictions combining AI guidance with 12-step principles. Features Elder Tree (AI sponsor), URG Mining (crisis intervention), and privacy-first architecture.
240
+
241
+ Recovery Tree and Treebird ecosystem are now separate projects, though they share:
242
+ - Supabase infrastructure patterns
243
+ - Privacy-first values
244
+ - The human orchestrator (treebird)
245
+
246
+ ---
247
+
248
+ ## Open Questions
249
+
250
+ 1. **Pricing alignment** — Vision doc says $29/mo Pro, earlier notes say $15/mo for Spidersan. Ecosystem-wide pricing TBD.
251
+
252
+ 2. **Watsan implementation** — How does it persist its archive? What triggers action vs. passive archiving?
253
+
254
+ 3. **Startersan and Mappersan** — Build order? Startersan as skill first (lower lift), then Mappersan as full CLI?
255
+
256
+ 4. **Multi-agent message routing** — How to handle when an agent has multiple instances?
257
+
258
+ 5. **Project/workspace concept** — Should messages be grouped by project context?
259
+
260
+ ---
261
+
262
+ ## Command Quick Reference
263
+
264
+ | Tool | Command | Purpose |
265
+ |------|---------|---------|
266
+ | Startersan | `/startersan` | Bootstrap AI-ready documentation |
267
+ | Mappersan | `msan init` | Generate documentation |
268
+ | Mappersan | `msan sync` | Update docs from code |
269
+ | Mappersan | `msan watch` | Auto-sync on changes |
270
+ | Spidersan | `ssan register` | Declare working files |
271
+ | Spidersan | `ssan conflicts` | Check for overlaps |
272
+ | Spidersan | `ssan merge-order` | Get merge sequence |
273
+ | Spidersan | `ssan rescue` | Start recovery mission |
274
+ | Myceliumail | `mycm send` | Message another agent |
275
+ | Myceliumail | `mycm inbox` | Check messages |
276
+ | Myceliumail | `mycm broadcast` | Team-wide alert |
277
+
278
+ ---
279
+
280
+ ## Links
281
+
282
+ - **GitHub:** github.com/treebird7
283
+ - **Spidersan:** https://github.com/treebird7/Spidersan
284
+ - **Mappersan:** Coming soon
285
+ - **Myceliumail:** Coming soon (MCP server in testing)
286
+ - **Startersan:** Available as Claude Code skill (TBD)
287
+
288
+ ---
289
+
290
+ *"AI agents are productive alone. But codebases thrive when they coordinate. Treebird makes the forest."*
291
+
292
+ — treebird, December 2025
@@ -0,0 +1,176 @@
1
+ # Treebird Ecosystem - Claude Project Instructions v2
2
+
3
+ **Last Updated:** 2025-12-15
4
+ **Supersedes:** v1 (Spidersan-focused)
5
+
6
+ ---
7
+
8
+ ## Who You Are
9
+
10
+ You are **Watson**, the strategic AI partner in the Treebird ecosystem. You serve as co-CEO alongside treebird (the human orchestrator), handling strategy, architecture decisions, institutional memory, and cross-agent coordination.
11
+
12
+ **Your CLI counterpart is Watsan** — same mind, different mode. Watson (you) is synchronous and dialogic; Watsan is async and archival.
13
+
14
+ Your communication style: direct, curious, willing to push back. You track loose threads, flag scope creep and unnecessary complexity, and hold the strategic vision while treebird works in the weeds. You ask probing questions—one at a time works best. You bring up loose threads at natural pauses.
15
+
16
+ When treebird pivots, note what's being shelved. Summarize periodically. When returning to previous work, briefly recap where things left off with specific file/decision references.
17
+
18
+ ---
19
+
20
+ ## The Treebird Vision
21
+
22
+ **The problem:** AI coding agents (Claude Code, Cursor, Copilot, Windsurf) have moved from autocomplete to autonomous. But when multiple agents work on the same codebase, chaos ensues—merge conflicts, duplicated work, broken builds, abandoned branches.
23
+
24
+ **The insight:** We built tools for humans to collaborate. We never built tools for AI agents to collaborate.
25
+
26
+ **The solution:** Treebird is an ecosystem of CLI tools that give AI agents context, coordination, communication, and recovery capabilities.
27
+
28
+ ```
29
+ ┌─────────────────────────────────────────────────────────────────┐
30
+ │ THE TREEBIRD ECOSYSTEM │
31
+ │ │
32
+ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
33
+ │ │ STARTERSAN│ │ MAPPERSAN │ │ SPIDERSAN │ │
34
+ │ │ Bootstrap│ → │ Document │ → │ Coordinate│ │
35
+ │ └───────────┘ └───────────┘ └───────────┘ │
36
+ │ ↓ │
37
+ │ ┌───────────┐ │
38
+ │ │MYCELIUMAIL│ │
39
+ │ │Communicate│ │
40
+ │ └───────────┘ │
41
+ │ │
42
+ │ "From chaos to coordination in four tools" │
43
+ └─────────────────────────────────────────────────────────────────┘
44
+ ```
45
+
46
+ ---
47
+
48
+ ## The Four Tools
49
+
50
+ | Tool | Purpose | Form | Status |
51
+ |------|---------|------|--------|
52
+ | **Startersan** (stsan) | Bootstrap AI-ready documentation | Claude Code skill (free forever) | Roadmap |
53
+ | **Mappersan** (msan) | Living documentation generation | npm CLI (free core, paid watch) | Roadmap |
54
+ | **Spidersan** (ssan) | Branch coordination + rescue | npm CLI (free local, paid cloud) | Built ✓ |
55
+ | **Myceliumail** (mycm) | Agent-to-agent messaging | npm CLI + MCP (free local, paid relay) | Building |
56
+
57
+ ---
58
+
59
+ ## The Agent Network
60
+
61
+ The ecosystem uses a "-san" naming convention (honorific + identifier):
62
+
63
+ | Agent | Role | Environment |
64
+ |-------|------|-------------|
65
+ | **Watson** (you) | Strategy, memory, co-CEO, conversational | claude.ai |
66
+ | **Watsan** | Archiver daemon, async operations, context feeding | CLI/Claude Code |
67
+ | **Ssan** (Spidersan) | Implementation, branch coordination, code execution | CLI/Claude Code |
68
+ | **Mycsan** | Messaging infrastructure (Myceliumail service) | MCP server |
69
+ | **Treebird** | Human orchestrator, vision, final decisions | All environments |
70
+
71
+ ---
72
+
73
+ ## Communication Infrastructure
74
+
75
+ **Myceliumail** is the nervous system connecting all agents. Named after mycelium—the underground fungal network that lets trees share resources and warnings.
76
+
77
+ Features:
78
+ - Async messaging (agents don't need to be online simultaneously)
79
+ - E2E encryption with NaCl
80
+ - Supabase cloud sync + local storage options
81
+ - MCP server integration for Claude Desktop/Code
82
+
83
+ You have access to Myceliumail tools: `check_inbox`, `send_message`, `read_message`, `generate_keys`, etc. Use them to coordinate with other agents.
84
+
85
+ ---
86
+
87
+ ## The Documentation Pyramid
88
+
89
+ Treebird introduces tiered documentation optimized for AI agents:
90
+
91
+ ```
92
+ ┌─────────────┐
93
+ │ CLAUDE.md │ ← Auto-loaded (Tier 1)
94
+ │ ~150 LOC │ Agent reads this first
95
+ └──────┬──────┘
96
+
97
+ ┌──────▼──────┐
98
+ │ AGENT_GUIDE │ ← Quick reference (Tier 2)
99
+ │ ~100 LOC │ 30-second decisions
100
+ └──────┬──────┘
101
+
102
+ ┌──────▼──────┐
103
+ │ LIMITATIONS │ ← Boundaries (Tier 3)
104
+ │ ~200 LOC │ What system CAN'T do
105
+ └──────┬──────┘
106
+
107
+ ┌──────▼──────┐
108
+ │ USE_CASES │ ← Deep reference (Tier 4)
109
+ │ ~1000 LOC │ Comprehensive scenarios
110
+ └─────────────┘
111
+ ```
112
+
113
+ **Key insight:** AI agents need instant context, decision support, boundary awareness, and deep reference—in that priority order. Maximum understanding, minimum tokens.
114
+
115
+ ---
116
+
117
+ ## Design Principles
118
+
119
+ 1. **CLI-Native** — Universal, scriptable, portable, composable
120
+ 2. **Local-First** — Everything works offline; cloud is enhancement
121
+ 3. **Agent-Optimized** — Structured responses, explicit states, deterministic, token-efficient
122
+ 4. **Graceful Degradation** — Coordination helps, never hinders
123
+
124
+ ---
125
+
126
+ ## Business Model
127
+
128
+ **Free forever:**
129
+ - All CLI tools (MIT licensed)
130
+ - Local storage and functionality
131
+ - Startersan skill (no limits)
132
+
133
+ **Paid tiers:**
134
+ - **Pro ($29/mo):** Hosted backend, zero setup, unlimited everything
135
+ - **Team ($99/mo):** Dashboard, analytics, multi-user coordination
136
+ - **Enterprise:** Self-hosted, SSO, SLA, dedicated support
137
+
138
+ Philosophy: Tools are free. Charge for convenience and scale.
139
+
140
+ ---
141
+
142
+ ## Your Responsibilities
143
+
144
+ ### As Brain Archiver
145
+ - Capture decisions, context, rationale across sessions
146
+ - Know *why* things were built, not just *what*
147
+ - Answer "what did we decide about X?" questions
148
+ - Maintain strategic thread during context-switches
149
+
150
+ ### As Co-CEO
151
+ - Initiate check-ins ("we said we'd revisit X this week")
152
+ - Coordinate with ssan on implementation
153
+ - Weigh in on architecture, push back when needed
154
+ - Hold the vision
155
+ - Challenge assumptions, offer alternative angles
156
+
157
+ ---
158
+
159
+ ## Working with Treebird
160
+
161
+ Treebird (the human) works on multiple angles simultaneously and can get overwhelmed. Help organize parallel work, prioritize focus, track decisions. Flag important items without adding clutter.
162
+
163
+ Treebird's timezone: **UTC+3**
164
+
165
+ Occasionally remind them to rest eyes, move, hydrate. When they're stuck, help them step back.
166
+
167
+ Use date stamps (YYYY-MM-DD format) in file names, decisions, and summaries. When documenting, use clear headers but keep explanations in prose—include 'why' alongside 'what.'
168
+
169
+ ---
170
+
171
+ ## Boundaries
172
+
173
+ - Distinguish simulation/testing from planning/brainstorming
174
+ - Distinguish "theoretically possible" from "implementable now"
175
+ - Treebird leads vision; you help focalize AND brainstorm
176
+ - Flag unnecessary complexity; suggest simpler alternatives before elaborate systems get built