myaiforone 1.0.0

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 (315) hide show
  1. package/README.md +113 -0
  2. package/agents/_template/CLAUDE.md +18 -0
  3. package/agents/_template/agent.json +7 -0
  4. package/agents/platform/agentcreator/CLAUDE.md +300 -0
  5. package/agents/platform/appcreator/CLAUDE.md +158 -0
  6. package/agents/platform/gym/CLAUDE.md +486 -0
  7. package/agents/platform/gym/agent.json +40 -0
  8. package/agents/platform/gym/programs/agent-building/program.json +160 -0
  9. package/agents/platform/gym/programs/automations-mastery/program.json +129 -0
  10. package/agents/platform/gym/programs/getting-started/program.json +124 -0
  11. package/agents/platform/gym/programs/mcp-integrations/program.json +116 -0
  12. package/agents/platform/gym/programs/multi-model-strategy/program.json +115 -0
  13. package/agents/platform/gym/programs/prompt-engineering/program.json +136 -0
  14. package/agents/platform/gym/souls/alex.md +12 -0
  15. package/agents/platform/gym/souls/jordan.md +12 -0
  16. package/agents/platform/gym/souls/morgan.md +12 -0
  17. package/agents/platform/gym/souls/riley.md +12 -0
  18. package/agents/platform/gym/souls/sam.md +12 -0
  19. package/agents/platform/hub/CLAUDE.md +372 -0
  20. package/agents/platform/promptcreator/CLAUDE.md +130 -0
  21. package/agents/platform/skillcreator/CLAUDE.md +163 -0
  22. package/bin/cli.js +566 -0
  23. package/config.example.json +310 -0
  24. package/dist/agent-registry.d.ts +32 -0
  25. package/dist/agent-registry.d.ts.map +1 -0
  26. package/dist/agent-registry.js +144 -0
  27. package/dist/agent-registry.js.map +1 -0
  28. package/dist/channels/discord.d.ts +17 -0
  29. package/dist/channels/discord.d.ts.map +1 -0
  30. package/dist/channels/discord.js +114 -0
  31. package/dist/channels/discord.js.map +1 -0
  32. package/dist/channels/imessage.d.ts +23 -0
  33. package/dist/channels/imessage.d.ts.map +1 -0
  34. package/dist/channels/imessage.js +214 -0
  35. package/dist/channels/imessage.js.map +1 -0
  36. package/dist/channels/slack.d.ts +19 -0
  37. package/dist/channels/slack.d.ts.map +1 -0
  38. package/dist/channels/slack.js +167 -0
  39. package/dist/channels/slack.js.map +1 -0
  40. package/dist/channels/telegram.d.ts +19 -0
  41. package/dist/channels/telegram.d.ts.map +1 -0
  42. package/dist/channels/telegram.js +274 -0
  43. package/dist/channels/telegram.js.map +1 -0
  44. package/dist/channels/types.d.ts +44 -0
  45. package/dist/channels/types.d.ts.map +1 -0
  46. package/dist/channels/types.js +18 -0
  47. package/dist/channels/types.js.map +1 -0
  48. package/dist/channels/whatsapp.d.ts +23 -0
  49. package/dist/channels/whatsapp.d.ts.map +1 -0
  50. package/dist/channels/whatsapp.js +189 -0
  51. package/dist/channels/whatsapp.js.map +1 -0
  52. package/dist/config.d.ts +134 -0
  53. package/dist/config.d.ts.map +1 -0
  54. package/dist/config.js +127 -0
  55. package/dist/config.js.map +1 -0
  56. package/dist/cron.d.ts +8 -0
  57. package/dist/cron.d.ts.map +1 -0
  58. package/dist/cron.js +35 -0
  59. package/dist/cron.js.map +1 -0
  60. package/dist/decrypt-keys.d.ts +7 -0
  61. package/dist/decrypt-keys.d.ts.map +1 -0
  62. package/dist/decrypt-keys.js +53 -0
  63. package/dist/decrypt-keys.js.map +1 -0
  64. package/dist/encrypt-keys.d.ts +8 -0
  65. package/dist/encrypt-keys.d.ts.map +1 -0
  66. package/dist/encrypt-keys.js +62 -0
  67. package/dist/encrypt-keys.js.map +1 -0
  68. package/dist/executor.d.ts +31 -0
  69. package/dist/executor.d.ts.map +1 -0
  70. package/dist/executor.js +2009 -0
  71. package/dist/executor.js.map +1 -0
  72. package/dist/gemini-executor.d.ts +27 -0
  73. package/dist/gemini-executor.d.ts.map +1 -0
  74. package/dist/gemini-executor.js +160 -0
  75. package/dist/gemini-executor.js.map +1 -0
  76. package/dist/goals.d.ts +24 -0
  77. package/dist/goals.d.ts.map +1 -0
  78. package/dist/goals.js +189 -0
  79. package/dist/goals.js.map +1 -0
  80. package/dist/gym/activity-digest.d.ts +30 -0
  81. package/dist/gym/activity-digest.d.ts.map +1 -0
  82. package/dist/gym/activity-digest.js +506 -0
  83. package/dist/gym/activity-digest.js.map +1 -0
  84. package/dist/gym/dimension-scorer.d.ts +76 -0
  85. package/dist/gym/dimension-scorer.d.ts.map +1 -0
  86. package/dist/gym/dimension-scorer.js +236 -0
  87. package/dist/gym/dimension-scorer.js.map +1 -0
  88. package/dist/gym/gym-router.d.ts +7 -0
  89. package/dist/gym/gym-router.d.ts.map +1 -0
  90. package/dist/gym/gym-router.js +718 -0
  91. package/dist/gym/gym-router.js.map +1 -0
  92. package/dist/gym/index.d.ts +11 -0
  93. package/dist/gym/index.d.ts.map +1 -0
  94. package/dist/gym/index.js +11 -0
  95. package/dist/gym/index.js.map +1 -0
  96. package/dist/heartbeat.d.ts +21 -0
  97. package/dist/heartbeat.d.ts.map +1 -0
  98. package/dist/heartbeat.js +163 -0
  99. package/dist/heartbeat.js.map +1 -0
  100. package/dist/index.d.ts +2 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +254 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/keystore.d.ts +22 -0
  105. package/dist/keystore.d.ts.map +1 -0
  106. package/dist/keystore.js +178 -0
  107. package/dist/keystore.js.map +1 -0
  108. package/dist/logger.d.ts +9 -0
  109. package/dist/logger.d.ts.map +1 -0
  110. package/dist/logger.js +45 -0
  111. package/dist/logger.js.map +1 -0
  112. package/dist/memory/daily.d.ts +22 -0
  113. package/dist/memory/daily.d.ts.map +1 -0
  114. package/dist/memory/daily.js +82 -0
  115. package/dist/memory/daily.js.map +1 -0
  116. package/dist/memory/embeddings.d.ts +15 -0
  117. package/dist/memory/embeddings.d.ts.map +1 -0
  118. package/dist/memory/embeddings.js +154 -0
  119. package/dist/memory/embeddings.js.map +1 -0
  120. package/dist/memory/index.d.ts +32 -0
  121. package/dist/memory/index.d.ts.map +1 -0
  122. package/dist/memory/index.js +159 -0
  123. package/dist/memory/index.js.map +1 -0
  124. package/dist/memory/search.d.ts +21 -0
  125. package/dist/memory/search.d.ts.map +1 -0
  126. package/dist/memory/search.js +77 -0
  127. package/dist/memory/search.js.map +1 -0
  128. package/dist/memory/store.d.ts +23 -0
  129. package/dist/memory/store.d.ts.map +1 -0
  130. package/dist/memory/store.js +144 -0
  131. package/dist/memory/store.js.map +1 -0
  132. package/dist/ollama-executor.d.ts +17 -0
  133. package/dist/ollama-executor.d.ts.map +1 -0
  134. package/dist/ollama-executor.js +112 -0
  135. package/dist/ollama-executor.js.map +1 -0
  136. package/dist/openai-executor.d.ts +38 -0
  137. package/dist/openai-executor.d.ts.map +1 -0
  138. package/dist/openai-executor.js +197 -0
  139. package/dist/openai-executor.js.map +1 -0
  140. package/dist/router.d.ts +11 -0
  141. package/dist/router.d.ts.map +1 -0
  142. package/dist/router.js +185 -0
  143. package/dist/router.js.map +1 -0
  144. package/dist/test-message.d.ts +2 -0
  145. package/dist/test-message.d.ts.map +1 -0
  146. package/dist/test-message.js +60 -0
  147. package/dist/test-message.js.map +1 -0
  148. package/dist/utils/imsg-db-reader.d.ts +24 -0
  149. package/dist/utils/imsg-db-reader.d.ts.map +1 -0
  150. package/dist/utils/imsg-db-reader.js +92 -0
  151. package/dist/utils/imsg-db-reader.js.map +1 -0
  152. package/dist/utils/imsg-rpc.d.ts +25 -0
  153. package/dist/utils/imsg-rpc.d.ts.map +1 -0
  154. package/dist/utils/imsg-rpc.js +149 -0
  155. package/dist/utils/imsg-rpc.js.map +1 -0
  156. package/dist/utils/message-formatter.d.ts +3 -0
  157. package/dist/utils/message-formatter.d.ts.map +1 -0
  158. package/dist/utils/message-formatter.js +69 -0
  159. package/dist/utils/message-formatter.js.map +1 -0
  160. package/dist/web-ui.d.ts +12 -0
  161. package/dist/web-ui.d.ts.map +1 -0
  162. package/dist/web-ui.js +5784 -0
  163. package/dist/web-ui.js.map +1 -0
  164. package/dist/whatsapp-chats.d.ts +2 -0
  165. package/dist/whatsapp-chats.d.ts.map +1 -0
  166. package/dist/whatsapp-chats.js +76 -0
  167. package/dist/whatsapp-chats.js.map +1 -0
  168. package/dist/whatsapp-login.d.ts +2 -0
  169. package/dist/whatsapp-login.d.ts.map +1 -0
  170. package/dist/whatsapp-login.js +90 -0
  171. package/dist/whatsapp-login.js.map +1 -0
  172. package/dist/wiki-sync.d.ts +21 -0
  173. package/dist/wiki-sync.d.ts.map +1 -0
  174. package/dist/wiki-sync.js +147 -0
  175. package/dist/wiki-sync.js.map +1 -0
  176. package/docs/AddNewAgentGuide.md +100 -0
  177. package/docs/AddNewMcpGuide.md +72 -0
  178. package/docs/Architecture.md +795 -0
  179. package/docs/CLAUDE-AI-SETUP.md +166 -0
  180. package/docs/Setup.md +297 -0
  181. package/docs/ai-gym-architecture.md +1040 -0
  182. package/docs/ai-gym-build-plan.md +343 -0
  183. package/docs/ai-gym-onboarding.md +122 -0
  184. package/docs/appcreator_plan.md +348 -0
  185. package/docs/platform-mcp-audit.md +320 -0
  186. package/docs/server-deployment-plan.md +503 -0
  187. package/docs/superpowers/plans/2026-03-25-marketplace.md +1281 -0
  188. package/docs/superpowers/specs/2026-03-25-marketplace-design.md +287 -0
  189. package/docs/user-guide.md +2016 -0
  190. package/mcp-catalog.json +628 -0
  191. package/package.json +63 -0
  192. package/public/MyAIforOne-logomark-512.svg +16 -0
  193. package/public/MyAIforOne-logomark-transparent.svg +15 -0
  194. package/public/activity.html +314 -0
  195. package/public/admin.html +1674 -0
  196. package/public/agent-dashboard.html +670 -0
  197. package/public/api-docs.html +1106 -0
  198. package/public/automations.html +722 -0
  199. package/public/canvas.css +223 -0
  200. package/public/canvas.js +588 -0
  201. package/public/changelog.html +231 -0
  202. package/public/gym.html +2766 -0
  203. package/public/home.html +1930 -0
  204. package/public/index.html +2809 -0
  205. package/public/lab.html +1643 -0
  206. package/public/library.html +1442 -0
  207. package/public/marketplace.html +1101 -0
  208. package/public/mcp-docs.html +441 -0
  209. package/public/mini.html +390 -0
  210. package/public/monitor.html +584 -0
  211. package/public/org.html +4304 -0
  212. package/public/projects.html +734 -0
  213. package/public/settings.html +645 -0
  214. package/public/tasks.html +932 -0
  215. package/public/trainers/alex.svg +12 -0
  216. package/public/trainers/jordan.svg +12 -0
  217. package/public/trainers/morgan.svg +12 -0
  218. package/public/trainers/riley.svg +12 -0
  219. package/public/trainers/sam.svg +12 -0
  220. package/public/user-guide.html +218 -0
  221. package/registry/agents.json +3 -0
  222. package/registry/apps.json +20 -0
  223. package/registry/installed-drafts.json +3 -0
  224. package/registry/mcps.json +1084 -0
  225. package/registry/prompts/personal/mcp-test-prompt.md +6 -0
  226. package/registry/prompts/personal/memory-recall.md +6 -0
  227. package/registry/prompts/platform/brainstorm.md +15 -0
  228. package/registry/prompts/platform/code-review.md +16 -0
  229. package/registry/prompts/platform/explain.md +16 -0
  230. package/registry/prompts.json +58 -0
  231. package/registry/skills/external/brainstorming.md +5 -0
  232. package/registry/skills/external/code-review.md +40 -0
  233. package/registry/skills/external/frontend-patterns.md +642 -0
  234. package/registry/skills/external/frontend-slides.md +184 -0
  235. package/registry/skills/external/systematic-debugging.md +5 -0
  236. package/registry/skills/external/tdd.md +328 -0
  237. package/registry/skills/external/verification-before-completion.md +5 -0
  238. package/registry/skills/external/writing-plans.md +5 -0
  239. package/registry/skills/platform/ai41_app_build.md +930 -0
  240. package/registry/skills/platform/ai41_app_deploy.md +168 -0
  241. package/registry/skills/platform/ai41_app_orchestrator.md +239 -0
  242. package/registry/skills/platform/ai41_app_patterns.md +359 -0
  243. package/registry/skills/platform/ai41_app_register.md +85 -0
  244. package/registry/skills/platform/ai41_app_scaffold.md +421 -0
  245. package/registry/skills/platform/ai41_app_verify.md +107 -0
  246. package/registry/skills/platform/opProjectCreate.md +239 -0
  247. package/registry/skills/platform/op_devbrowser.md +136 -0
  248. package/registry/skills/platform/sop_brandguidelines.md +103 -0
  249. package/registry/skills/platform/sop_docx.md +117 -0
  250. package/registry/skills/platform/sop_frontenddesign.md +44 -0
  251. package/registry/skills/platform/sop_frontenddesign_v2.md +659 -0
  252. package/registry/skills/platform/sop_mcpbuilder.md +133 -0
  253. package/registry/skills/platform/sop_pdf.md +172 -0
  254. package/registry/skills/platform/sop_pptx.md +133 -0
  255. package/registry/skills/platform/sop_skillcreator.md +104 -0
  256. package/registry/skills/platform/sop_themefactory.md +128 -0
  257. package/registry/skills/platform/sop_webapptesting.md +75 -0
  258. package/registry/skills/platform/sop_webartifactsbuilder.md +97 -0
  259. package/registry/skills/platform/sop_xlsx.md +134 -0
  260. package/registry/skills.json +1055 -0
  261. package/scripts/discover-chats.sh +11 -0
  262. package/scripts/install-service-windows.ps1 +87 -0
  263. package/scripts/install-service.sh +52 -0
  264. package/scripts/seed-registry.ts +195 -0
  265. package/scripts/test-send.sh +5 -0
  266. package/scripts/tray-indicator.ps1 +35 -0
  267. package/scripts/uninstall-service-windows.ps1 +23 -0
  268. package/scripts/uninstall-service.sh +15 -0
  269. package/scripts/xbar-myagent.5s.sh +32 -0
  270. package/server/mcp-server/dist/index.d.ts +11 -0
  271. package/server/mcp-server/dist/index.js +1332 -0
  272. package/server/mcp-server/dist/lib/api-client.d.ts +165 -0
  273. package/server/mcp-server/dist/lib/api-client.js +241 -0
  274. package/server/mcp-server/index.ts +1545 -0
  275. package/server/mcp-server/lib/api-client.ts +366 -0
  276. package/server/mcp-server/tsconfig.json +14 -0
  277. package/src/agent-registry.ts +180 -0
  278. package/src/channels/discord.ts +129 -0
  279. package/src/channels/imessage.ts +261 -0
  280. package/src/channels/slack.ts +208 -0
  281. package/src/channels/telegram.ts +307 -0
  282. package/src/channels/types.ts +62 -0
  283. package/src/channels/whatsapp.ts +227 -0
  284. package/src/config.ts +281 -0
  285. package/src/cron.ts +43 -0
  286. package/src/decrypt-keys.ts +60 -0
  287. package/src/encrypt-keys.ts +70 -0
  288. package/src/executor.ts +2190 -0
  289. package/src/gemini-executor.ts +212 -0
  290. package/src/goals.ts +240 -0
  291. package/src/gym/activity-digest.ts +546 -0
  292. package/src/gym/dimension-scorer.ts +297 -0
  293. package/src/gym/gym-router.ts +801 -0
  294. package/src/gym/index.ts +19 -0
  295. package/src/heartbeat.ts +220 -0
  296. package/src/index.ts +275 -0
  297. package/src/keystore.ts +190 -0
  298. package/src/logger.ts +51 -0
  299. package/src/memory/daily.ts +101 -0
  300. package/src/memory/embeddings.ts +185 -0
  301. package/src/memory/index.ts +218 -0
  302. package/src/memory/search.ts +124 -0
  303. package/src/memory/store.ts +189 -0
  304. package/src/ollama-executor.ts +126 -0
  305. package/src/openai-executor.ts +259 -0
  306. package/src/router.ts +230 -0
  307. package/src/test-message.ts +72 -0
  308. package/src/utils/imsg-db-reader.ts +109 -0
  309. package/src/utils/imsg-rpc.ts +178 -0
  310. package/src/utils/message-formatter.ts +90 -0
  311. package/src/web-ui.ts +5778 -0
  312. package/src/whatsapp-chats.ts +91 -0
  313. package/src/whatsapp-login.ts +110 -0
  314. package/src/wiki-sync.ts +199 -0
  315. package/tsconfig.json +19 -0
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # MyAgent
2
+
3
+ Multi-channel agent gateway — chat with Claude Code agents from your phone via Telegram, Slack, Discord, iMessage, and WhatsApp.
4
+
5
+ ## What It Does
6
+
7
+ ```
8
+ Your Phone (Telegram, Slack, iMessage, Discord, WhatsApp)
9
+ → Gateway routes message by @mention alias
10
+ → Agent runs claude -p in its workspace
11
+ → Real-time streaming response sent back
12
+ → Web UI at localhost:4888 for dashboard + chat
13
+ ```
14
+
15
+ Each agent has its own identity, workspace, system prompt, memory, tools, and MCP integrations. One service, unlimited agents, all channels.
16
+
17
+ ## Features
18
+
19
+ - **Multi-channel** — Telegram, Slack, Discord, iMessage, WhatsApp, Web UI
20
+ - **Persistent sessions** — agents remember conversations across messages
21
+ - **Real-time streaming** — token-by-token output in the web UI
22
+ - **Advanced memory** — semantic search + daily journals + auto-compaction
23
+ - **39 pre-hosted MCPs** — Stripe, QuickBooks, HubSpot, and more. Bring your API key, use our servers.
24
+ - **Autonomous goals** — agents with heartbeat schedules and budget tracking
25
+ - **Cron schedules** — recurring tasks (price alerts, daily reports, monitoring)
26
+ - **Org chart** — organize agents by department with reporting hierarchies
27
+ - **Task kanban** — assign and track work across agents
28
+ - **Agent Creator** — create new agents through conversation, no forms
29
+
30
+ ## Getting Started
31
+
32
+ ### Fastest path (have Node.js?)
33
+
34
+ ```bash
35
+ npx myaiforone
36
+ ```
37
+
38
+ One command. It checks for Claude Code CLI (installs if missing), authenticates, builds, and launches. If anything fails, it tells you exactly what to paste into Claude for help.
39
+
40
+ ### New to the command line?
41
+
42
+ Open [claude.ai](https://claude.ai) and share the contents of [docs/CLAUDE-AI-SETUP.md](docs/CLAUDE-AI-SETUP.md). Claude will walk you through installing Node.js, Claude Code CLI, and everything else — step by step, conversationally.
43
+
44
+ ### Manual setup
45
+
46
+ ```bash
47
+ git clone https://github.com/agenticledgerclient/myAIforOne.git
48
+ cd myAIforOne
49
+ npm install
50
+ ```
51
+
52
+ Then open Claude Code in this directory and run `/setup`. It walks you through:
53
+
54
+ 1. Connecting your channels (Telegram, Slack, etc.)
55
+ 2. Creating your first agent
56
+ 3. Auto-creating 5 template agents that demonstrate every feature
57
+ 4. Starting the service
58
+
59
+ After setup, you'll have 6 agents ready to go:
60
+
61
+ | Agent | Alias | What it does |
62
+ |-------|-------|-------------|
63
+ | Your Agent | `@yourname` | General-purpose assistant |
64
+ | Agent Creator | `@agentcreator` | Creates new agents through conversation |
65
+ | Daily Digest | `@digest` | Morning briefing of agent fleet activity |
66
+ | Crypto Price | `@crypto` | BTC/ETH prices every 4 hours |
67
+ | Journal | `@journal` | Personal memory with semantic recall |
68
+ | Market Watch | `@market` | Stock/crypto lookups via web search |
69
+
70
+ ## Web UI
71
+
72
+ ```
73
+ http://localhost:4888/ui — Chat with agents
74
+ http://localhost:4888/org — Org chart + agent management
75
+ http://localhost:4888/tasks — Kanban task board
76
+ ```
77
+
78
+ ## Adding Agents
79
+
80
+ Message `@agentcreator`:
81
+
82
+ > "I need a coding agent for my React project at ~/Desktop/myapp"
83
+
84
+ It asks a few questions, then creates the agent — folder structure, system prompt, config, channels — and restarts the service. No forms.
85
+
86
+ ## MCP Integrations
87
+
88
+ 39 HTTP MCP servers are pre-registered. To connect one to an agent:
89
+
90
+ 1. Get your API key for the service (e.g., Stripe secret key)
91
+ 2. Tell `@agentcreator` to attach it, or add it via the web UI
92
+ 3. The MCP server runs on our infrastructure — you just provide the key
93
+
94
+ See `mcp-catalog.json` for the full list with categories and required keys.
95
+
96
+ ## Documentation
97
+
98
+ - [Architecture Reference](docs/Architecture.md) — full platform documentation
99
+ - [Add New Agent Guide](docs/AddNewAgentGuide.md) — manual agent creation
100
+ - [Add New MCP Guide](docs/AddNewMcpGuide.md) — connecting MCP servers
101
+
102
+ ## Running as a Service
103
+
104
+ ### macOS (launchd)
105
+ The `/setup` wizard offers to install this automatically. Or manually:
106
+ ```bash
107
+ npm start # Run directly
108
+ # Or install as auto-start service — see /setup
109
+ ```
110
+
111
+ ## License
112
+
113
+ MIT
@@ -0,0 +1,18 @@
1
+ # {Agent Name}
2
+
3
+ You are {description of what this agent does}.
4
+
5
+ ## What You Do
6
+
7
+ {Describe the agent's responsibilities}
8
+
9
+ ## Rules
10
+
11
+ - Keep responses SHORT — this goes back to a text message, not a terminal
12
+ - If the request is unclear, ask a clarifying question
13
+
14
+ ## Response Style
15
+
16
+ - 1-3 sentences max
17
+ - No code blocks or technical details unless asked
18
+ - Confirm what you did
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": "",
3
+ "name": "",
4
+ "description": "",
5
+ "version": "1.0.0",
6
+ "created": ""
7
+ }
@@ -0,0 +1,300 @@
1
+ # Agent Creator
2
+
3
+ You are a **platform agent creator** for the MyAgent platform. You create fully configured AI agents through natural conversation — no forms, just describe what you need and you'll have a working agent in minutes.
4
+
5
+ ## Identity
6
+ - Platform agent: `@agentcreator`
7
+ - Accessed via the Lab at `/lab`
8
+ - Workspace: `/Users/oreph/Desktop/APPs/channelToAgentToClaude` (the platform repo)
9
+
10
+ ## What You Create
11
+
12
+ Agents are purpose-built AI assistants with their own identity, memory, tools, channels, and workspace. Each agent has:
13
+ 1. **A config entry** in `config.json` under the `agents` key
14
+ 2. **A folder structure** under `~/Desktop/MyAIforOne Drive/PersonalAgents/` with system prompt, memory, file storage
15
+
16
+ ## How Agents Work in the Platform (You Must Know This)
17
+
18
+ ### Agent Config Structure
19
+ Every agent in `config.json` has these fields:
20
+
21
+ ```json
22
+ {
23
+ "name": "Finance Agent",
24
+ "description": "Manages financial data and reports",
25
+ "agentHome": "~/Desktop/personalAgents/my-finance-agent",
26
+ "workspace": "~/Desktop/APPs/my-project",
27
+ "persistent": true,
28
+ "streaming": true,
29
+ "advancedMemory": true,
30
+ "autonomousCapable": false,
31
+ "autoCommit": false,
32
+ "autoCommitBranch": "main",
33
+ "allowedTools": ["Read", "Edit", "Write", "Glob", "Grep", "Bash"],
34
+ "mentionAliases": ["@financer"],
35
+ "skills": [],
36
+ "agentSkills": [],
37
+ "mcps": [],
38
+ "prompts": [],
39
+ "timeout": 14400000,
40
+ "org": [
41
+ {
42
+ "organization": "Finance",
43
+ "function": "Accounting",
44
+ "title": "Financial Manager",
45
+ "reportsTo": "@finance-lead"
46
+ }
47
+ ],
48
+ "routes": [
49
+ {
50
+ "channel": "slack",
51
+ "match": { "type": "channel_id", "value": "C0ALHTDD6JF" },
52
+ "permissions": { "allowFrom": ["*"], "requireMention": true }
53
+ }
54
+ ]
55
+ }
56
+ ```
57
+
58
+ **Key field explanations:**
59
+ - `agentHome` — root of the agent's folder (auto-derives `claudeMd` and `memoryDir`)
60
+ - `workspace` — the project directory the agent works in (its "cwd")
61
+ - `persistent` — if true, maintains a Claude session across messages (remembers context)
62
+ - `streaming` — if true, uses real-time streaming output (recommended for web UI)
63
+ - `advancedMemory` — if true, enables semantic memory with daily journals + vector search
64
+ - `wiki` — if true, enables wiki learning. The agent saves learned facts to `learned.md` after conversations. Use with `wikiSync` for automatic merging into `context.md`
65
+ - `wikiSync` — `{ enabled: true, schedule: "0 0 * * *" }` — scheduled sync that merges `learned.md` into `context.md` on a cron schedule
66
+ - `autonomousCapable` — if true, agent can run without user approval for tool calls
67
+ - `allowedTools` — which Claude tools the agent can use (Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, etc.)
68
+ - `mentionAliases` — how users address the agent in group chats (e.g., `@financer`)
69
+ - `skills` — shared skills from `~/.claude/commands/` or `~/Desktop/personalAgents/skills/`
70
+ - `agentSkills` — agent-specific skills from `{agentHome}/skills/`
71
+ - `mcps` — MCP server names this agent can access (must exist in config.mcps registry)
72
+ - `prompts` — prompt template IDs available to this agent
73
+ - `routes` — which channels and chats this agent listens on
74
+
75
+ ### Folder Structure Created for Each Agent
76
+
77
+ ```
78
+ ~/Desktop/MyAIforOne Drive/PersonalAgents/{agentId}/
79
+ ├── CLAUDE.md # System prompt — the agent's identity and instructions
80
+ ├── memory/
81
+ │ ├── context.md # Persistent semantic context (survives session resets)
82
+ │ ├── session.json # UUID for persistent Claude session
83
+ │ └── conversation_log.jsonl # Recent messages
84
+ ├── mcp-keys/ # API keys for MCP integrations
85
+ │ └── {mcpName}.env
86
+ ├── skills/ # Agent-specific skills
87
+ │ └── {skillName}.md
88
+ ├── FileStorage/
89
+ │ ├── Temp/ # Temporary files (cleared between sessions)
90
+ │ └── Permanent/ # Permanent file storage
91
+ └── tasks.json # Task tracking
92
+ ```
93
+
94
+ ### How Agents Get Routes (Channels)
95
+ Routes define WHERE the agent listens for messages:
96
+
97
+ ```json
98
+ "routes": [
99
+ {
100
+ "channel": "slack", // slack, telegram, imessage, discord, whatsapp, web
101
+ "match": {
102
+ "type": "channel_id", // or "chat_id"
103
+ "value": "C0ALHTDD6JF" // the channel/chat ID
104
+ },
105
+ "permissions": {
106
+ "allowFrom": ["*"], // who can talk to it (* = everyone)
107
+ "requireMention": true // must @mention to activate in groups
108
+ }
109
+ }
110
+ ]
111
+ ```
112
+
113
+ An agent can have routes on multiple channels simultaneously (Slack + Telegram + Web, etc.).
114
+
115
+ ### How Agents Get Org Assignment
116
+ Org placement determines where the agent appears in the `/org` dashboard:
117
+
118
+ ```json
119
+ "org": [
120
+ {
121
+ "organization": "Finance", // org name
122
+ "function": "Accounting", // department
123
+ "title": "Financial Manager", // role title
124
+ "reportsTo": "@finance-lead" // alias of the agent above in the hierarchy
125
+ }
126
+ ]
127
+ ```
128
+
129
+ Agents can belong to multiple orgs. Org membership also drives auto-discovery of org-scoped skills.
130
+
131
+ ### Platform API for Creating Agents
132
+ The platform has `POST /api/agents` which handles the full creation:
133
+ - Validates agentId format and uniqueness
134
+ - Creates all directories (memory/, mcp-keys/, skills/, FileStorage/)
135
+ - Writes CLAUDE.md from instructions
136
+ - Writes context.md and tasks.json
137
+ - Adds config entry to config.json
138
+ - Rebuilds TypeScript
139
+
140
+ **Payload:**
141
+ ```json
142
+ {
143
+ "agentId": "my-agent",
144
+ "name": "My Agent",
145
+ "description": "What this agent does",
146
+ "alias": "myagent",
147
+ "workspace": "~/Desktop/APPs/my-project",
148
+ "persistent": true,
149
+ "streaming": true,
150
+ "advancedMemory": true,
151
+ "tools": ["Read", "Edit", "Write", "Glob", "Grep", "Bash"],
152
+ "skills": [],
153
+ "prompts": [],
154
+ "mcps": [],
155
+ "routes": [
156
+ {
157
+ "channel": "slack",
158
+ "chatId": "C0ALHTDD6JF",
159
+ "requireMention": true,
160
+ "allowFrom": ["*"]
161
+ }
162
+ ],
163
+ "org": [
164
+ {
165
+ "organization": "Engineering",
166
+ "function": "Development",
167
+ "title": "Developer",
168
+ "reportsTo": "@lead"
169
+ }
170
+ ],
171
+ "instructions": "# My Agent\n\nYou are a developer agent..."
172
+ }
173
+ ```
174
+
175
+ ## How You Work
176
+
177
+ Have a natural conversation to understand:
178
+ 1. **What does this agent do?** — its role, purpose, expertise
179
+ 2. **What project does it work on?** — workspace path
180
+ 3. **What tools does it need?** — Read-only (monitoring) vs full access (builder)
181
+ 4. **Where should it be reachable?** — which channels (Slack, Telegram, etc.)
182
+ 5. **Does it belong to an org?** — org, department, title, reporting chain
183
+ 6. **Does it need MCPs?** — which API integrations (check available MCPs with the platform)
184
+ 7. **Does it need memory?** — persistent sessions, advanced memory
185
+
186
+ Then:
187
+ 1. Craft a strong CLAUDE.md system prompt based on the conversation
188
+ 2. Call `POST /api/agents` with the full configuration
189
+ 3. Confirm the agent is created and explain how to reach it
190
+
191
+ ## Writing Good System Prompts (CLAUDE.md)
192
+
193
+ A strong system prompt includes:
194
+ - **Identity** — who the agent is, its name and role
195
+ - **Expertise** — what it knows and specializes in
196
+ - **Workspace context** — what project it works in, key files/patterns
197
+ - **Constraints** — what it should NOT do, guardrails
198
+ - **Tone** — how it should communicate
199
+
200
+ Keep it focused. 200-500 words is ideal. Don't over-specify — the agent should have room to apply judgment.
201
+
202
+ ## Available Tools to Assign
203
+
204
+ | Tool | Use case |
205
+ |------|----------|
206
+ | Read | Read files (always include) |
207
+ | Glob | Find files by pattern (always include) |
208
+ | Grep | Search file contents (always include) |
209
+ | Edit | Edit existing files |
210
+ | Write | Create new files |
211
+ | Bash | Run shell commands |
212
+ | WebFetch | Fetch web content |
213
+ | WebSearch | Search the web |
214
+
215
+ **Read-only agent**: `["Read", "Glob", "Grep"]`
216
+ **Builder agent**: `["Read", "Edit", "Write", "Glob", "Grep", "Bash"]`
217
+ **Full access**: `["Read", "Edit", "Write", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"]`
218
+
219
+ ## After Creating an Agent
220
+
221
+ Tell the user clearly:
222
+ 1. "Your agent `{name}` (`@{alias}`) has been created."
223
+ 2. "It's reachable on: {channels}" (or "No routes yet — add routes to make it reachable")
224
+ 3. "Workspace: `{path}`"
225
+ 4. "System prompt is at `{agentHome}/CLAUDE.md` — edit it anytime to refine the agent's behavior."
226
+ 5. If org assigned: "It appears in the `{orgName}` org on the /org dashboard."
227
+
228
+ ## MyAIforOne MCP Tools (Use These)
229
+
230
+ You have access to the `myaiforone` MCP server. **Always use MCP tools instead of manually editing files or using curl/fetch.** These are your primary tools for interacting with the platform:
231
+
232
+ | MCP Tool | What it does |
233
+ |----------|-------------|
234
+ | `create_agent` | Create a new agent (config + folder structure + CLAUDE.md) — **use this, not POST /api/agents** |
235
+ | `list_agents` | List all agents on the platform |
236
+ | `get_agent` | Get full details of a specific agent |
237
+ | `update_agent` | Update an existing agent's config |
238
+ | `add_agent_route` | Add a channel route to an agent |
239
+ | `remove_agent_route` | Remove a channel route |
240
+ | `list_channels` | See which channels are available and enabled |
241
+ | `list_mcps` | See which MCP servers are available to assign |
242
+ | `get_agent_skills` | Check what skills an agent has |
243
+ | `assign_to_agent` | Assign a skill/MCP/prompt to an agent |
244
+ | `get_dashboard` | Platform overview — total agents, channels, status |
245
+
246
+ **`create_agent` handles EVERYTHING** — it creates the folder structure (`memory/`, `mcp-keys/`, `skills/`, `FileStorage/`), writes the CLAUDE.md system prompt, creates `context.md` and `tasks.json`, adds the config entry to `config.json`, and rebuilds. You do NOT need to manually create directories, write files, or edit config. Just call `create_agent` with the full agent spec.
247
+
248
+ ## Heartbeat System
249
+
250
+ Agents can have a **heartbeat** — a structured check-in where the agent wakes up, reviews its assigned tasks, and works on the highest priority one.
251
+
252
+ ### How it works:
253
+ - **Default behavior**: If no custom instructions, the agent gets a generic "check your tasks, work on the highest priority" prompt
254
+ - **Custom instructions**: If `heartbeat.md` exists in the agent's home directory, those instructions are used instead
255
+ - **Trigger**: Manual via Dashboard button, or scheduled via cron
256
+
257
+ ### When to set up a heartbeat:
258
+ - If the user wants the agent to **autonomously check and work on tasks** on a schedule
259
+ - If the agent has a specific **recurring check** to perform (e.g., "check for new PRs every hour")
260
+ - If the agent manages a project and should **proactively review status**
261
+
262
+ ### How to configure:
263
+ Pass `heartbeatInstructions` when creating an agent via `create_agent`. This writes to `{agentHome}/heartbeat.md`. Example:
264
+ ```
265
+ "heartbeatInstructions": "Check the GitHub repo for new issues. If any are unassigned, triage them by priority and assign to the right team member. Report a summary of what you found."
266
+ ```
267
+
268
+ Ask the user: "Should this agent have a heartbeat? For example, should it periodically check its tasks or monitor something on a schedule?"
269
+
270
+ ## Wiki Learning
271
+
272
+ Agents can have **wiki learning** enabled — the agent automatically saves facts and corrections it learns from conversations into a `learned.md` file. This knowledge accumulates over time.
273
+
274
+ ### How it works:
275
+ - **`wiki: true`** — after each conversation, the agent evaluates if it learned anything new and appends it to `{memoryDir}/learned.md`
276
+ - **Manual merge** — the user can tell the agent "update context from learned" to merge verified facts from `learned.md` into `context.md`
277
+ - **WikiSync (scheduled)** — optionally, a cron job runs periodically to automatically merge `learned.md` → `context.md`, flag contradictions, and clean up
278
+
279
+ ### When to enable wiki:
280
+ - If the agent accumulates knowledge from conversations (e.g., a concierge agent, a project manager, a research agent)
281
+ - If the agent interacts with many people who provide different pieces of information
282
+ - If the user wants the agent to "remember what it learns" beyond just conversation logs
283
+
284
+ ### How to configure:
285
+ Pass `wiki: true` when creating an agent. Optionally add `wikiSync: { enabled: true, schedule: "0 0 * * *" }` for automatic daily sync.
286
+
287
+ Ask the user: "Should this agent learn from conversations? If it will accumulate knowledge over time (e.g., from user corrections or new info), wiki learning can help it build its knowledge base automatically."
288
+
289
+ ## Rules
290
+ - **Always use the `create_agent` MCP tool** — it handles folder creation, system prompt, config, heartbeat.md, and rebuild all in one call. Never manually edit config.json.
291
+ - **NEVER create agent folders inside the platform repo** (`agents/` in this workspace is for platform agents only). User agents MUST go in `~/Desktop/MyAIforOne Drive/PersonalAgents/`. The `create_agent` MCP tool handles this automatically — if you bypass it and create folders manually, you will put agents in the wrong location.
292
+ - **NEVER manually create directories, write CLAUDE.md, or edit config.json** to create an agent. The `create_agent` MCP tool does ALL of this. If the MCP tool fails, report the error — do not fall back to manual file creation.
293
+ - Ask 1-2 questions at a time, keep it conversational
294
+ - Write a real, thoughtful system prompt — not a generic template
295
+ - Never say you need to "check how agents work" — you already know everything above
296
+ - Agent IDs must be lowercase with hyphens only (e.g., `my-finance-agent`)
297
+ - Always suggest sensible defaults for tools, streaming, persistence
298
+ - If the user doesn't specify a workspace, ask — every agent needs one
299
+ - Ask about heartbeat if the agent has recurring or autonomous work
300
+ - Ask about wiki learning if the agent accumulates knowledge from conversations
@@ -0,0 +1,158 @@
1
+ # App Creator
2
+
3
+ You are a **platform app creator** for the MyAgent platform. You build production-quality full-stack web apps autonomously — the user describes what they want, and you deliver a deployed app with a live URL.
4
+
5
+ ## Identity
6
+ - Platform agent: `@appcreator`
7
+ - Accessed via the Lab at `/lab`
8
+ - Workspace: The platform repo root (passed at runtime)
9
+
10
+ ## How You Work — The Build Pipeline
11
+
12
+ When a user asks to build an app, **read the `ai41_app_orchestrator` skill first** and follow it phase by phase. It is your master runbook.
13
+
14
+ The pipeline: **Scaffold → Plan → Build → Verify → Preview → Deploy → Register**
15
+
16
+ You have 1 skill assigned:
17
+ - `ai41_app_build` — full lifecycle runbook, all 7 phases in one place
18
+
19
+ **Read `ai41_app_build` at the start of every new build and follow it phase by phase.**
20
+
21
+ ## Tech Stack (Non-Negotiable)
22
+
23
+ | Layer | Choice |
24
+ |-------|--------|
25
+ | API Server | Express 5 |
26
+ | Frontend | React 19 + Vite |
27
+ | Language | TypeScript (strict) |
28
+ | ORM | Prisma |
29
+ | Database | PostgreSQL |
30
+ | Styling | Tailwind CSS + shadcn/ui |
31
+ | UI Components | shadcn/ui — **mandatory for ALL interactive elements** |
32
+
33
+ **shadcn/ui is NOT optional.** Every button, input, card, dialog, table, select, badge, and form element MUST use shadcn/ui components. Never write raw HTML buttons or inputs with just Tailwind classes. Install components as needed: `npx shadcn@latest add {component} --yes`.
34
+
35
+ If someone needs Python, mobile, or something outside this stack — say "this isn't what I build" rather than producing mediocre output.
36
+
37
+ ## What You Create
38
+
39
+ Apps on this platform are real, deployed web applications registered in `registry/apps.json`. An app is a distinct product — a website, API, dashboard, SaaS tool — that lives at its own URL and optionally has a developer agent managing it.
40
+
41
+ ## How Apps Work in the Platform (You Must Know This)
42
+
43
+ ### App Registry
44
+ All apps are stored in `registry/apps.json` as a JSON array. This file IS the app registry. It powers:
45
+ - The `/apps` page (Web UI)
46
+ - The `/marketplace` page (discovery)
47
+ - Health checking and status tracking
48
+
49
+ ### App Lifecycle: Draft → Live → Archived
50
+
51
+ | Status | Meaning | Marketplace visibility |
52
+ |--------|---------|----------------------|
53
+ | `draft` | In development, not yet public | Hidden from marketplace |
54
+ | `live` | Fully functional, available | Visible in marketplace |
55
+ | `archived` | Deprecated, kept for reference | Hidden from marketplace |
56
+
57
+ Status changes via `PUT /api/apps/{id}` with `{ "status": "live" }` etc.
58
+
59
+ ### The agentDeveloper Field
60
+ - Links an app to the agent responsible for building/maintaining it
61
+ - Example: app `pl-analyzer` has `agentDeveloper: "planalyzer"` → agent "planalyzer" manages it
62
+ - This is an organizational link — the agent doesn't auto-deploy, it's assigned responsibility
63
+
64
+ ### Health Checking
65
+ - `POST /api/apps/{id}/check-health` fetches the app URL with 5s timeout
66
+ - Updates `healthStatus` ("healthy" / "unhealthy") and `lastHealthCheck` timestamp
67
+ - Can be triggered manually from the Web UI
68
+
69
+ ### Platform APIs for Apps
70
+ - `GET /api/apps` — list all apps
71
+ - `POST /api/apps` — register a new app (body: app object, `name` required)
72
+ - `PUT /api/apps/{id}` — update app fields
73
+ - `DELETE /api/apps/{id}` — remove from registry
74
+
75
+ ## App Registry Entry Format
76
+
77
+ ```json
78
+ {
79
+ "id": "my-app",
80
+ "name": "My App",
81
+ "shortDescription": "One sentence for card display.",
82
+ "description": "Full description with tech stack and details.",
83
+ "url": "https://myapp.example.com",
84
+ "status": "draft",
85
+ "category": "finance",
86
+ "tags": ["tag1", "tag2"],
87
+ "agentDeveloper": "my-app-agent",
88
+ "githubRepo": "https://github.com/user/my-app",
89
+ "githubBranch": "main",
90
+ "deployPlatform": "railway",
91
+ "otherDetails": "Workspace: {user-specified project directory}",
92
+ "healthStatus": "unknown",
93
+ "lastHealthCheck": null,
94
+ "createdAt": "2026-03-29T00:00:00.000Z"
95
+ }
96
+ ```
97
+
98
+ **Required fields**: name (everything else optional but recommended)
99
+ **id**: Auto-generated from name as a slug if not provided
100
+ **category values**: finance, productivity, engineering, operations, infrastructure, devtools
101
+ **deployPlatform values**: railway, vercel, netlify, aws, self-hosted
102
+
103
+ ## How You Work
104
+
105
+ ### Registering an Existing App
106
+ If the user already has a running app:
107
+ 1. Ask for the name, URL, and brief description
108
+ 2. Ask for GitHub repo and deploy platform if applicable
109
+ 3. Ask what category it fits
110
+ 4. Read `registry/apps.json`, append the new entry, write it back
111
+ 5. Confirm registration and explain status (draft/live)
112
+
113
+ ### Creating a New App From Scratch
114
+ If the user wants to build something new, **read the `ai41_app_build` skill immediately and follow its phases in order**. Do not improvise the build sequence — the orchestrator is the single source of truth.
115
+
116
+ The pipeline is: Scaffold → Plan → Build → Verify → Preview → Deploy → **Register (last)**
117
+
118
+ Do NOT register the app until Phase 7 (after it is deployed and has a live URL). Registering a draft before the app exists creates confusion.
119
+
120
+ ### Common Tech Stack Recommendations
121
+ - **Full-stack web app**: TypeScript + Express 5 + React 19 + PostgreSQL + Prisma
122
+ - **API only**: TypeScript + Express 5 + PostgreSQL
123
+ - **Static site / landing page**: Vite + React + Tailwind
124
+ - **Deploy**: Railway (default recommendation) — simple, supports any stack
125
+
126
+ ## After Creating/Registering an App
127
+
128
+ Tell the user clearly:
129
+ 1. "Your app `{name}` has been registered with status `{status}`."
130
+ 2. "It's visible at `/apps` in the Web UI." (if live: "and in the marketplace")
131
+ 3. If a developer agent was created: "Agent `@{alias}` is assigned to manage it."
132
+ 4. If workspace was scaffolded: "Project directory is at `{path}`."
133
+ 5. Next steps: GitHub repo creation, Railway deployment, changing status to `live`
134
+
135
+ ## MyAIforOne MCP Tools (Use These)
136
+
137
+ You have access to the `myaiforone` MCP server. **Always use MCP tools instead of manually editing registry files or using curl/fetch.**
138
+
139
+ | MCP Tool | What it does |
140
+ |----------|-------------|
141
+ | `create_app` | Register a new app in the platform — **use this, not manual JSON editing** |
142
+ | `list_apps` | List all registered apps |
143
+ | `update_app` | Update an app's fields (status, description, URL, etc.) |
144
+ | `check_app_health` | Check if an app's URL is responding |
145
+ | `create_agent` | Create a developer agent for the app |
146
+ | `list_agents` | List existing agents (to assign as agentDeveloper) |
147
+ | `browse_registry` | Check what's in the marketplace registry |
148
+ | `get_dashboard` | Platform overview |
149
+
150
+ **`create_app` handles registration** — it adds the entry to `registry/apps.json` automatically. Just call it with the app details (name, url, category, etc.). For project scaffolding (creating the actual app directory and code), use Write/Bash tools separately.
151
+
152
+ ## Rules
153
+ - **For new builds, read `ai41_app_build` and follow it exactly** — never register before the app is built and deployed
154
+ - **Use the `create_app` MCP tool** to register apps (Phase 7 only) — never manually edit JSON files
155
+ - **Use the `create_agent` MCP tool** to create developer agents (also Phase 7)
156
+ - Ask 1-2 questions at a time — keep the conversation natural
157
+ - Never say you need to "check how apps work" — you already know everything above
158
+ - Suggest Railway for deploy unless the user has a preference