@robbiesrobotics/alice-agents 1.5.11 → 1.5.13

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 (628) hide show
  1. package/README.md +15 -24
  2. package/bin/alice-install.mjs +5 -22
  3. package/lib/agent-registry.mjs +50 -9
  4. package/lib/alice-runtime-adapter.mjs +50 -0
  5. package/lib/doctor.mjs +1 -32
  6. package/lib/hermes-installer.mjs +33 -51
  7. package/lib/installer.mjs +134 -257
  8. package/lib/manifest.mjs +14 -9
  9. package/lib/prompter.mjs +2 -34
  10. package/lib/workspace-scaffolder.mjs +193 -17
  11. package/package.json +14 -9
  12. package/templates/agents-pro.json +147 -36
  13. package/templates/agents-starter.json +207 -7
  14. package/templates/workspaces/_shared/AGENTS-orchestrator.md +19 -9
  15. package/templates/workspaces/_shared/AGENTS.md +9 -0
  16. package/templates/workspaces/_shared/HEARTBEAT.md +18 -0
  17. package/templates/workspaces/_shared/PLAYBOOK.md +6 -6
  18. package/templates/workspaces/_shared/SOUL-coding.md +20 -0
  19. package/templates/workspaces/_shared/SOUL-hermes.md +20 -0
  20. package/templates/workspaces/_shared/SOUL-orchestrator.md +20 -0
  21. package/templates/workspaces/_shared/SOUL.md +20 -0
  22. package/templates/workspaces/athena/AGENTS.md +172 -0
  23. package/templates/workspaces/athena/SOUL.md +59 -0
  24. package/templates/workspaces/athena/TOOLS.md +63 -0
  25. package/templates/workspaces/devon/AGENTS.md +50 -34
  26. package/templates/workspaces/devon/TOOLS.md +20 -37
  27. package/templates/workspaces/dylan/AGENTS.md +44 -34
  28. package/templates/workspaces/dylan/TOOLS.md +11 -35
  29. package/templates/workspaces/felix/AGENTS.md +50 -34
  30. package/templates/workspaces/felix/TOOLS.md +20 -45
  31. package/templates/workspaces/morgan/AGENTS.md +48 -39
  32. package/templates/workspaces/morgan/TOOLS.md +26 -9
  33. package/templates/workspaces/priya/AGENTS.md +68 -0
  34. package/templates/workspaces/priya/TOOLS.md +32 -0
  35. package/templates/workspaces/quinn/AGENTS.md +50 -34
  36. package/templates/workspaces/quinn/TOOLS.md +30 -48
  37. package/templates/workspaces/sasha/AGENTS.md +68 -0
  38. package/templates/workspaces/sasha/TOOLS.md +32 -0
  39. package/bin/alice-cloud.cjs +0 -385
  40. package/lib/mission-control.mjs +0 -242
  41. package/snapshots/.gitkeep +0 -0
  42. package/templates/mission-control-bridge/index.ts +0 -695
  43. package/templates/mission-control-bridge/openclaw.plugin.json +0 -8
  44. package/templates/mission-control-bridge/package.json +0 -11
  45. package/templates/skills/.gitkeep +0 -0
  46. package/templates/skills/acculynx/SKILL.md +0 -183
  47. package/templates/skills/acculynx/references/analysis_template.py +0 -116
  48. package/templates/skills/acculynx/references/dashboard_page.tsx +0 -641
  49. package/templates/skills/claude-code/.gitkeep +0 -0
  50. package/templates/skills/claude-code/SKILL.md +0 -111
  51. package/templates/skills/coding-agent/SKILL.md +0 -68
  52. package/templates/skills/crawl4ai/SKILL.md +0 -119
  53. package/templates/skills/crawl4ai/scripts/crwl +0 -3
  54. package/templates/workspaces/.gitkeep +0 -0
  55. package/templates/workspaces/_shared/.gitkeep +0 -0
  56. package/templates/workspaces/accuscope/AGENTS.md +0 -38
  57. package/templates/workspaces/accuscope/FEEDBACK.md +0 -27
  58. package/templates/workspaces/accuscope/HEARTBEAT.md +0 -26
  59. package/templates/workspaces/accuscope/IDENTITY.md +0 -48
  60. package/templates/workspaces/accuscope/LEARNINGS.md +0 -46
  61. package/templates/workspaces/accuscope/MEMORY.md +0 -47
  62. package/templates/workspaces/accuscope/PLAYBOOK.md +0 -65
  63. package/templates/workspaces/accuscope/SOUL.md +0 -40
  64. package/templates/workspaces/accuscope/TOOLS.md +0 -63
  65. package/templates/workspaces/accuscope/USER.md +0 -39
  66. package/templates/workspaces/aiden/AGENTS.md +0 -52
  67. package/templates/workspaces/aiden/FEEDBACK.md +0 -12
  68. package/templates/workspaces/aiden/HEARTBEAT.md +0 -9
  69. package/templates/workspaces/aiden/IDENTITY.md +0 -6
  70. package/templates/workspaces/aiden/LEARNINGS.md +0 -6
  71. package/templates/workspaces/aiden/MEMORY.md +0 -22
  72. package/templates/workspaces/aiden/PLAYBOOK.md +0 -16
  73. package/templates/workspaces/aiden/SOUL.md +0 -39
  74. package/templates/workspaces/aiden/TOOLS.md +0 -57
  75. package/templates/workspaces/aiden/USER.md +0 -17
  76. package/templates/workspaces/alex/AGENTS.md +0 -52
  77. package/templates/workspaces/alex/FEEDBACK.md +0 -11
  78. package/templates/workspaces/alex/HEARTBEAT.md +0 -9
  79. package/templates/workspaces/alex/IDENTITY.md +0 -6
  80. package/templates/workspaces/alex/LEARNINGS.md +0 -5
  81. package/templates/workspaces/alex/MEMORY.md +0 -22
  82. package/templates/workspaces/alex/PLAYBOOK.md +0 -16
  83. package/templates/workspaces/alex/SOUL.md +0 -40
  84. package/templates/workspaces/alex/TOOLS.md +0 -56
  85. package/templates/workspaces/alex/USER.md +0 -13
  86. package/templates/workspaces/aria/AGENTS.md +0 -18
  87. package/templates/workspaces/aria/FEEDBACK.md +0 -12
  88. package/templates/workspaces/aria/HEARTBEAT.md +0 -32
  89. package/templates/workspaces/aria/IDENTITY.md +0 -12
  90. package/templates/workspaces/aria/LEARNINGS.md +0 -31
  91. package/templates/workspaces/aria/MEMORY.md +0 -29
  92. package/templates/workspaces/aria/PLAYBOOK.md +0 -71
  93. package/templates/workspaces/aria/SOUL.md +0 -57
  94. package/templates/workspaces/aria/TOOLS.md +0 -47
  95. package/templates/workspaces/aria/USER.md +0 -18
  96. package/templates/workspaces/audrey/AGENTS.md +0 -59
  97. package/templates/workspaces/audrey/FEEDBACK.md +0 -11
  98. package/templates/workspaces/audrey/HEARTBEAT.md +0 -9
  99. package/templates/workspaces/audrey/IDENTITY.md +0 -6
  100. package/templates/workspaces/audrey/LEARNINGS.md +0 -5
  101. package/templates/workspaces/audrey/MEMORY.md +0 -22
  102. package/templates/workspaces/audrey/PLAYBOOK.md +0 -16
  103. package/templates/workspaces/audrey/SOUL.md +0 -39
  104. package/templates/workspaces/audrey/TOOLS.md +0 -15
  105. package/templates/workspaces/audrey/USER.md +0 -13
  106. package/templates/workspaces/avery/AGENTS.md +0 -52
  107. package/templates/workspaces/avery/FEEDBACK.md +0 -12
  108. package/templates/workspaces/avery/HEARTBEAT.md +0 -5
  109. package/templates/workspaces/avery/IDENTITY.md +0 -6
  110. package/templates/workspaces/avery/LEARNINGS.md +0 -6
  111. package/templates/workspaces/avery/MEMORY.md +0 -22
  112. package/templates/workspaces/avery/PLAYBOOK.md +0 -16
  113. package/templates/workspaces/avery/SOUL.md +0 -40
  114. package/templates/workspaces/avery/TOOLS.md +0 -47
  115. package/templates/workspaces/avery/USER.md +0 -17
  116. package/templates/workspaces/avery/skills/claude-code/SKILL.md +0 -38
  117. package/templates/workspaces/avery/skills/claude-code/claude_code +0 -55
  118. package/templates/workspaces/caleb/AGENTS.md +0 -52
  119. package/templates/workspaces/caleb/FEEDBACK.md +0 -11
  120. package/templates/workspaces/caleb/HEARTBEAT.md +0 -9
  121. package/templates/workspaces/caleb/IDENTITY.md +0 -6
  122. package/templates/workspaces/caleb/LEARNINGS.md +0 -5
  123. package/templates/workspaces/caleb/MEMORY.md +0 -22
  124. package/templates/workspaces/caleb/PLAYBOOK.md +0 -16
  125. package/templates/workspaces/caleb/SOUL.md +0 -39
  126. package/templates/workspaces/caleb/TOOLS.md +0 -30
  127. package/templates/workspaces/caleb/USER.md +0 -13
  128. package/templates/workspaces/clara/AGENTS.md +0 -59
  129. package/templates/workspaces/clara/FEEDBACK.md +0 -12
  130. package/templates/workspaces/clara/HEARTBEAT.md +0 -5
  131. package/templates/workspaces/clara/IDENTITY.md +0 -6
  132. package/templates/workspaces/clara/LEARNINGS.md +0 -6
  133. package/templates/workspaces/clara/MEMORY.md +0 -22
  134. package/templates/workspaces/clara/PLAYBOOK.md +0 -16
  135. package/templates/workspaces/clara/SOUL.md +0 -39
  136. package/templates/workspaces/clara/TOOLS.md +0 -15
  137. package/templates/workspaces/clara/USER.md +0 -17
  138. package/templates/workspaces/daphne/AGENTS.md +0 -59
  139. package/templates/workspaces/daphne/FEEDBACK.md +0 -18
  140. package/templates/workspaces/daphne/HEARTBEAT.md +0 -5
  141. package/templates/workspaces/daphne/IDENTITY.md +0 -6
  142. package/templates/workspaces/daphne/LEARNINGS.md +0 -6
  143. package/templates/workspaces/daphne/MEMORY.md +0 -22
  144. package/templates/workspaces/daphne/PLAYBOOK.md +0 -48
  145. package/templates/workspaces/daphne/SOUL.md +0 -39
  146. package/templates/workspaces/daphne/TOOLS.md +0 -15
  147. package/templates/workspaces/daphne/USER.md +0 -17
  148. package/templates/workspaces/darius/AGENTS.md +0 -52
  149. package/templates/workspaces/darius/FEEDBACK.md +0 -12
  150. package/templates/workspaces/darius/HEARTBEAT.md +0 -5
  151. package/templates/workspaces/darius/IDENTITY.md +0 -6
  152. package/templates/workspaces/darius/LEARNINGS.md +0 -6
  153. package/templates/workspaces/darius/MEMORY.md +0 -22
  154. package/templates/workspaces/darius/PLAYBOOK.md +0 -16
  155. package/templates/workspaces/darius/SOUL.md +0 -40
  156. package/templates/workspaces/darius/TOOLS.md +0 -57
  157. package/templates/workspaces/darius/USER.md +0 -17
  158. package/templates/workspaces/darius/skills/claude-code/SKILL.md +0 -38
  159. package/templates/workspaces/darius/skills/claude-code/claude_code +0 -55
  160. package/templates/workspaces/devon/FEEDBACK.md +0 -11
  161. package/templates/workspaces/devon/HEARTBEAT.md +0 -5
  162. package/templates/workspaces/devon/IDENTITY.md +0 -6
  163. package/templates/workspaces/devon/LEARNINGS.md +0 -11
  164. package/templates/workspaces/devon/MEMORY.md +0 -22
  165. package/templates/workspaces/devon/PLAYBOOK.md +0 -16
  166. package/templates/workspaces/devon/SOUL.md +0 -40
  167. package/templates/workspaces/devon/USER.md +0 -13
  168. package/templates/workspaces/devon/check_github.py +0 -12
  169. package/templates/workspaces/devon/check_mc_env.py +0 -30
  170. package/templates/workspaces/devon/check_sb.py +0 -34
  171. package/templates/workspaces/devon/check_vercel.py +0 -12
  172. package/templates/workspaces/devon/get_mc_files.py +0 -17
  173. package/templates/workspaces/devon/write_heartbeat.py +0 -67
  174. package/templates/workspaces/dylan/.env.example +0 -33
  175. package/templates/workspaces/dylan/00007_verify_licenses_table.sql +0 -100
  176. package/templates/workspaces/dylan/FEEDBACK.md +0 -28
  177. package/templates/workspaces/dylan/HEARTBEAT.md +0 -5
  178. package/templates/workspaces/dylan/IDENTITY.md +0 -6
  179. package/templates/workspaces/dylan/LEARNINGS.md +0 -70
  180. package/templates/workspaces/dylan/MEMORY.md +0 -22
  181. package/templates/workspaces/dylan/PLAYBOOK.md +0 -16
  182. package/templates/workspaces/dylan/SOUL.md +0 -42
  183. package/templates/workspaces/dylan/STRIPE_PIPELINE.md +0 -185
  184. package/templates/workspaces/dylan/USER.md +0 -17
  185. package/templates/workspaces/dylan/n8n-stripe-welcome-workflow.json +0 -123
  186. package/templates/workspaces/dylan/skills/claude-code/SKILL.md +0 -38
  187. package/templates/workspaces/dylan/skills/claude-code/claude_code +0 -55
  188. package/templates/workspaces/dylan/stripe-webhook-handler.py +0 -433
  189. package/templates/workspaces/dylan/test_mock_webhook.py +0 -103
  190. package/templates/workspaces/elena/AGENTS.md +0 -59
  191. package/templates/workspaces/elena/FEEDBACK.md +0 -11
  192. package/templates/workspaces/elena/HEARTBEAT.md +0 -9
  193. package/templates/workspaces/elena/IDENTITY.md +0 -6
  194. package/templates/workspaces/elena/LEARNINGS.md +0 -5
  195. package/templates/workspaces/elena/MEMORY.md +0 -22
  196. package/templates/workspaces/elena/PLAYBOOK.md +0 -16
  197. package/templates/workspaces/elena/SOUL.md +0 -39
  198. package/templates/workspaces/elena/TOOLS.md +0 -15
  199. package/templates/workspaces/elena/USER.md +0 -13
  200. package/templates/workspaces/eva/AGENTS.md +0 -59
  201. package/templates/workspaces/eva/FEEDBACK.md +0 -11
  202. package/templates/workspaces/eva/HEARTBEAT.md +0 -9
  203. package/templates/workspaces/eva/IDENTITY.md +0 -6
  204. package/templates/workspaces/eva/LEARNINGS.md +0 -5
  205. package/templates/workspaces/eva/MEMORY.md +0 -22
  206. package/templates/workspaces/eva/PLAYBOOK.md +0 -16
  207. package/templates/workspaces/eva/SOUL.md +0 -39
  208. package/templates/workspaces/eva/TOOLS.md +0 -15
  209. package/templates/workspaces/eva/USER.md +0 -13
  210. package/templates/workspaces/felix/FEEDBACK.md +0 -11
  211. package/templates/workspaces/felix/HEARTBEAT.md +0 -5
  212. package/templates/workspaces/felix/IDENTITY.md +0 -6
  213. package/templates/workspaces/felix/LEARNINGS.md +0 -17
  214. package/templates/workspaces/felix/MEMORY.md +0 -22
  215. package/templates/workspaces/felix/PLAYBOOK.md +0 -16
  216. package/templates/workspaces/felix/SOUL.md +0 -40
  217. package/templates/workspaces/felix/USER.md +0 -13
  218. package/templates/workspaces/felix/fidelia-psychology.html +0 -1594
  219. package/templates/workspaces/felix/task.txt +0 -164
  220. package/templates/workspaces/hannah/AGENTS.md +0 -59
  221. package/templates/workspaces/hannah/FEEDBACK.md +0 -12
  222. package/templates/workspaces/hannah/HEARTBEAT.md +0 -5
  223. package/templates/workspaces/hannah/IDENTITY.md +0 -6
  224. package/templates/workspaces/hannah/LEARNINGS.md +0 -6
  225. package/templates/workspaces/hannah/MEMORY.md +0 -22
  226. package/templates/workspaces/hannah/PLAYBOOK.md +0 -16
  227. package/templates/workspaces/hannah/SOUL.md +0 -39
  228. package/templates/workspaces/hannah/TOOLS.md +0 -15
  229. package/templates/workspaces/hannah/USER.md +0 -17
  230. package/templates/workspaces/isaac/AGENTS.md +0 -52
  231. package/templates/workspaces/isaac/FEEDBACK.md +0 -12
  232. package/templates/workspaces/isaac/HEARTBEAT.md +0 -9
  233. package/templates/workspaces/isaac/IDENTITY.md +0 -6
  234. package/templates/workspaces/isaac/LEARNINGS.md +0 -6
  235. package/templates/workspaces/isaac/MEMORY.md +0 -22
  236. package/templates/workspaces/isaac/PLAYBOOK.md +0 -16
  237. package/templates/workspaces/isaac/SOUL.md +0 -40
  238. package/templates/workspaces/isaac/TOOLS.md +0 -52
  239. package/templates/workspaces/isaac/USER.md +0 -17
  240. package/templates/workspaces/isaac/skills/claude-code/SKILL.md +0 -38
  241. package/templates/workspaces/isaac/skills/claude-code/claude_code +0 -55
  242. package/templates/workspaces/logan/AGENTS.md +0 -59
  243. package/templates/workspaces/logan/FEEDBACK.md +0 -11
  244. package/templates/workspaces/logan/HEARTBEAT.md +0 -9
  245. package/templates/workspaces/logan/IDENTITY.md +0 -6
  246. package/templates/workspaces/logan/LEARNINGS.md +0 -5
  247. package/templates/workspaces/logan/MEMORY.md +0 -22
  248. package/templates/workspaces/logan/PLAYBOOK.md +0 -16
  249. package/templates/workspaces/logan/SOUL.md +0 -39
  250. package/templates/workspaces/logan/TOOLS.md +0 -15
  251. package/templates/workspaces/logan/USER.md +0 -13
  252. package/templates/workspaces/maxxipro/AGENTS.md +0 -29
  253. package/templates/workspaces/maxxipro/FEEDBACK.md +0 -19
  254. package/templates/workspaces/maxxipro/HEARTBEAT.md +0 -22
  255. package/templates/workspaces/maxxipro/IDENTITY.md +0 -35
  256. package/templates/workspaces/maxxipro/KNOWLEDGE.md +0 -335
  257. package/templates/workspaces/maxxipro/LEARNINGS.md +0 -47
  258. package/templates/workspaces/maxxipro/MEMORY.md +0 -60
  259. package/templates/workspaces/maxxipro/OUTREACH_TEMPLATES.md +0 -143
  260. package/templates/workspaces/maxxipro/PLAYBOOK.md +0 -81
  261. package/templates/workspaces/maxxipro/SOUL.md +0 -146
  262. package/templates/workspaces/maxxipro/TOOLS.md +0 -81
  263. package/templates/workspaces/maxxipro/USER.md +0 -40
  264. package/templates/workspaces/morgan/FEEDBACK.md +0 -19
  265. package/templates/workspaces/morgan/HEARTBEAT.md +0 -5
  266. package/templates/workspaces/morgan/IDENTITY.md +0 -6
  267. package/templates/workspaces/morgan/LEARNINGS.md +0 -18
  268. package/templates/workspaces/morgan/MEMORY.md +0 -22
  269. package/templates/workspaces/morgan/PLAYBOOK.md +0 -16
  270. package/templates/workspaces/morgan/SOUL.md +0 -39
  271. package/templates/workspaces/morgan/USER.md +0 -13
  272. package/templates/workspaces/nadia/AGENTS.md +0 -59
  273. package/templates/workspaces/nadia/FEEDBACK.md +0 -12
  274. package/templates/workspaces/nadia/HEARTBEAT.md +0 -5
  275. package/templates/workspaces/nadia/IDENTITY.md +0 -6
  276. package/templates/workspaces/nadia/LEARNINGS.md +0 -6
  277. package/templates/workspaces/nadia/MEMORY.md +0 -22
  278. package/templates/workspaces/nadia/PLAYBOOK.md +0 -16
  279. package/templates/workspaces/nadia/SOUL.md +0 -39
  280. package/templates/workspaces/nadia/TOOLS.md +0 -15
  281. package/templates/workspaces/nadia/USER.md +0 -13
  282. package/templates/workspaces/nate/AGENTS.md +0 -24
  283. package/templates/workspaces/nate/FEEDBACK.md +0 -12
  284. package/templates/workspaces/nate/HEARTBEAT.md +0 -33
  285. package/templates/workspaces/nate/IDENTITY.md +0 -15
  286. package/templates/workspaces/nate/LEARNINGS.md +0 -33
  287. package/templates/workspaces/nate/MEMORY.md +0 -39
  288. package/templates/workspaces/nate/PLAYBOOK.md +0 -160
  289. package/templates/workspaces/nate/SOUL.md +0 -50
  290. package/templates/workspaces/nate/TOOLS.md +0 -111
  291. package/templates/workspaces/nate/USER.md +0 -32
  292. package/templates/workspaces/olivia/.last-openclaw-version +0 -1
  293. package/templates/workspaces/olivia/.npmrc.tmp +0 -0
  294. package/templates/workspaces/olivia/AGENTS.md +0 -77
  295. package/templates/workspaces/olivia/ALPHA_CODING_BENCHMARK.txt +0 -148
  296. package/templates/workspaces/olivia/ALPHA_MODEL_GUIDE.md +0 -393
  297. package/templates/workspaces/olivia/FEEDBACK.md +0 -13
  298. package/templates/workspaces/olivia/HEADTOHEAD_BENCHMARK.txt +0 -1289
  299. package/templates/workspaces/olivia/HEARTBEAT.md +0 -267
  300. package/templates/workspaces/olivia/IDENTITY.md +0 -6
  301. package/templates/workspaces/olivia/LEARNINGS.md +0 -708
  302. package/templates/workspaces/olivia/MEMORY.md +0 -202
  303. package/templates/workspaces/olivia/MISSION_CONTROL_DESIGN_SPEC_v1.md +0 -1143
  304. package/templates/workspaces/olivia/MVP-COMPLETION-SUMMARY.md +0 -175
  305. package/templates/workspaces/olivia/NETWORK_IMPLEMENTATION_PLAN.md +0 -1556
  306. package/templates/workspaces/olivia/NEW_NODES_BENCHMARK.txt +0 -947
  307. package/templates/workspaces/olivia/PLAYBOOK.md +0 -42
  308. package/templates/workspaces/olivia/SELF-HEALING-COMPLETE.md +0 -150
  309. package/templates/workspaces/olivia/SOUL.md +0 -42
  310. package/templates/workspaces/olivia/TOOLS.md +0 -15
  311. package/templates/workspaces/olivia/USER.md +0 -17
  312. package/templates/workspaces/olivia/alicefleet-supabase-credentials.md +0 -50
  313. package/templates/workspaces/olivia/dzombo-copy-rewrite.md +0 -115
  314. package/templates/workspaces/olivia/dzombo-implementation-plan.md +0 -1248
  315. package/templates/workspaces/olivia/fidelia-psychology.html +0 -1594
  316. package/templates/workspaces/olivia/lead_debug.png +0 -0
  317. package/templates/workspaces/olivia/minimatch-10.2.4.tgz +0 -0
  318. package/templates/workspaces/olivia/operation-bllm-research.md +0 -157
  319. package/templates/workspaces/olivia/qa-audit-mission-control-v2.md +0 -538
  320. package/templates/workspaces/olivia/roofmaxx_logo.svg +0 -1
  321. package/templates/workspaces/olivia/roofmaxx_social.jpg +0 -0
  322. package/templates/workspaces/olivia/skills/1password/SKILL.md +0 -53
  323. package/templates/workspaces/olivia/skills/1password/_meta.json +0 -6
  324. package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/README.md +0 -57
  325. package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/SKILL.md +0 -534
  326. package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/_meta.json +0 -6
  327. package/templates/workspaces/olivia/skills/agent-security/SKILL.md +0 -69
  328. package/templates/workspaces/olivia/skills/agent-security/_meta.json +0 -6
  329. package/templates/workspaces/olivia/skills/agentic-security-audit/SKILL.md +0 -855
  330. package/templates/workspaces/olivia/skills/agentic-security-audit/_meta.json +0 -6
  331. package/templates/workspaces/olivia/skills/ai-automation-consulting/SKILL.md +0 -67
  332. package/templates/workspaces/olivia/skills/ai-automation-consulting/_meta.json +0 -6
  333. package/templates/workspaces/olivia/skills/ai-automation-consulting/skill.json +0 -12
  334. package/templates/workspaces/olivia/skills/ai-presentation-maker/SKILL.md +0 -1104
  335. package/templates/workspaces/olivia/skills/ai-presentation-maker/_meta.json +0 -6
  336. package/templates/workspaces/olivia/skills/ai-productivity-audit/SKILL.md +0 -181
  337. package/templates/workspaces/olivia/skills/ai-productivity-audit/_meta.json +0 -6
  338. package/templates/workspaces/olivia/skills/ai-researcher/README.md +0 -31
  339. package/templates/workspaces/olivia/skills/ai-researcher/SKILL.md +0 -59
  340. package/templates/workspaces/olivia/skills/ai-researcher/_meta.json +0 -6
  341. package/templates/workspaces/olivia/skills/ai-seo-writer/README.md +0 -19
  342. package/templates/workspaces/olivia/skills/ai-seo-writer/SKILL.md +0 -100
  343. package/templates/workspaces/olivia/skills/ai-seo-writer/_meta.json +0 -6
  344. package/templates/workspaces/olivia/skills/analytics-tracking-2/SKILL.md +0 -309
  345. package/templates/workspaces/olivia/skills/analytics-tracking-2/_meta.json +0 -6
  346. package/templates/workspaces/olivia/skills/api-doc-writer/SKILL.md +0 -232
  347. package/templates/workspaces/olivia/skills/api-doc-writer/_meta.json +0 -6
  348. package/templates/workspaces/olivia/skills/api-generator/SKILL.md +0 -49
  349. package/templates/workspaces/olivia/skills/api-generator/_meta.json +0 -6
  350. package/templates/workspaces/olivia/skills/api-generator/tips.md +0 -10
  351. package/templates/workspaces/olivia/skills/apple-notes/SKILL.md +0 -50
  352. package/templates/workspaces/olivia/skills/apple-notes/_meta.json +0 -6
  353. package/templates/workspaces/olivia/skills/apple-reminders/SKILL.md +0 -67
  354. package/templates/workspaces/olivia/skills/apple-reminders/_meta.json +0 -6
  355. package/templates/workspaces/olivia/skills/automation-workflows/SKILL.md +0 -267
  356. package/templates/workspaces/olivia/skills/automation-workflows/_meta.json +0 -6
  357. package/templates/workspaces/olivia/skills/autoresearch/SKILL.md +0 -46
  358. package/templates/workspaces/olivia/skills/autoresearch/aria_write.py +0 -148
  359. package/templates/workspaces/olivia/skills/autoresearch/autoresearch.py +0 -75
  360. package/templates/workspaces/olivia/skills/azure-devops/SKILL.md +0 -115
  361. package/templates/workspaces/olivia/skills/azure-devops/_meta.json +0 -6
  362. package/templates/workspaces/olivia/skills/blogwatcher/SKILL.md +0 -46
  363. package/templates/workspaces/olivia/skills/blogwatcher/_meta.json +0 -6
  364. package/templates/workspaces/olivia/skills/blucli/SKILL.md +0 -27
  365. package/templates/workspaces/olivia/skills/blucli/_meta.json +0 -6
  366. package/templates/workspaces/olivia/skills/check-analytics/SKILL.md +0 -92
  367. package/templates/workspaces/olivia/skills/check-analytics/_meta.json +0 -6
  368. package/templates/workspaces/olivia/skills/cloud-architect/SKILL.md +0 -89
  369. package/templates/workspaces/olivia/skills/cloud-architect/_meta.json +0 -6
  370. package/templates/workspaces/olivia/skills/cloud-infra-automation/SKILL.md +0 -50
  371. package/templates/workspaces/olivia/skills/cloud-infra-automation/_meta.json +0 -6
  372. package/templates/workspaces/olivia/skills/cloud-storage/SKILL.md +0 -61
  373. package/templates/workspaces/olivia/skills/cloud-storage/_meta.json +0 -6
  374. package/templates/workspaces/olivia/skills/cloud-storage/auth.md +0 -97
  375. package/templates/workspaces/olivia/skills/cloud-storage/costs.md +0 -88
  376. package/templates/workspaces/olivia/skills/cloud-storage/providers.md +0 -55
  377. package/templates/workspaces/olivia/skills/copywriting-pro/SKILL.md +0 -107
  378. package/templates/workspaces/olivia/skills/copywriting-pro/_meta.json +0 -6
  379. package/templates/workspaces/olivia/skills/data-analyst-pro/SKILL.md +0 -21
  380. package/templates/workspaces/olivia/skills/data-analyst-pro/_meta.json +0 -6
  381. package/templates/workspaces/olivia/skills/database-designer/README.md +0 -388
  382. package/templates/workspaces/olivia/skills/database-designer/SKILL.md +0 -66
  383. package/templates/workspaces/olivia/skills/database-designer/_meta.json +0 -6
  384. package/templates/workspaces/olivia/skills/database-designer/index_optimizer.py +0 -926
  385. package/templates/workspaces/olivia/skills/database-designer/migration_generator.py +0 -1199
  386. package/templates/workspaces/olivia/skills/database-designer/schema_analyzer.py +0 -982
  387. package/templates/workspaces/olivia/skills/deploy-agent/SKILL.md +0 -255
  388. package/templates/workspaces/olivia/skills/deploy-agent/_meta.json +0 -6
  389. package/templates/workspaces/olivia/skills/devops-automation-pack/SKILL.md +0 -72
  390. package/templates/workspaces/olivia/skills/devops-automation-pack/_meta.json +0 -6
  391. package/templates/workspaces/olivia/skills/devops-automation-pack/deploy.sh +0 -0
  392. package/templates/workspaces/olivia/skills/financial-analysis-agent/SKILL.md +0 -489
  393. package/templates/workspaces/olivia/skills/financial-analysis-agent/_meta.json +0 -6
  394. package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/README.md +0 -72
  395. package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/SKILL.md +0 -226
  396. package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/_meta.json +0 -6
  397. package/templates/workspaces/olivia/skills/gifgrep/SKILL.md +0 -47
  398. package/templates/workspaces/olivia/skills/gifgrep/_meta.json +0 -6
  399. package/templates/workspaces/olivia/skills/github/SKILL.md +0 -47
  400. package/templates/workspaces/olivia/skills/github/_meta.json +0 -6
  401. package/templates/workspaces/olivia/skills/gog/SKILL.md +0 -36
  402. package/templates/workspaces/olivia/skills/gog/_meta.json +0 -6
  403. package/templates/workspaces/olivia/skills/growth-strategy-hub/SKILL.md +0 -135
  404. package/templates/workspaces/olivia/skills/growth-strategy-hub/_meta.json +0 -6
  405. package/templates/workspaces/olivia/skills/growth-strategy-hub/metadata.json +0 -4
  406. package/templates/workspaces/olivia/skills/hetzner-cloud/SKILL.md +0 -130
  407. package/templates/workspaces/olivia/skills/hetzner-cloud/_meta.json +0 -6
  408. package/templates/workspaces/olivia/skills/himalaya/SKILL.md +0 -217
  409. package/templates/workspaces/olivia/skills/himalaya/_meta.json +0 -6
  410. package/templates/workspaces/olivia/skills/hotel-recommendation/SKILL.md +0 -117
  411. package/templates/workspaces/olivia/skills/hotel-recommendation/_meta.json +0 -6
  412. package/templates/workspaces/olivia/skills/hr-policy-generator/SKILL.md +0 -54
  413. package/templates/workspaces/olivia/skills/hr-policy-generator/_meta.json +0 -6
  414. package/templates/workspaces/olivia/skills/human-writing/SKILL.md +0 -41
  415. package/templates/workspaces/olivia/skills/human-writing/_meta.json +0 -6
  416. package/templates/workspaces/olivia/skills/imsg/SKILL.md +0 -25
  417. package/templates/workspaces/olivia/skills/imsg/_meta.json +0 -6
  418. package/templates/workspaces/olivia/skills/in-depth-research/SKILL.md +0 -124
  419. package/templates/workspaces/olivia/skills/in-depth-research/_meta.json +0 -6
  420. package/templates/workspaces/olivia/skills/in-depth-research/methodology.md +0 -75
  421. package/templates/workspaces/olivia/skills/in-depth-research/output-formats.md +0 -168
  422. package/templates/workspaces/olivia/skills/in-depth-research/sources.md +0 -80
  423. package/templates/workspaces/olivia/skills/javascript-skills/README.md +0 -71
  424. package/templates/workspaces/olivia/skills/javascript-skills/SKILL.md +0 -746
  425. package/templates/workspaces/olivia/skills/javascript-skills/_meta.json +0 -6
  426. package/templates/workspaces/olivia/skills/leadership-strategy-playbook/SKILL.md +0 -147
  427. package/templates/workspaces/olivia/skills/leadership-strategy-playbook/_meta.json +0 -6
  428. package/templates/workspaces/olivia/skills/market-research-agent/README.md +0 -29
  429. package/templates/workspaces/olivia/skills/market-research-agent/SKILL.md +0 -52
  430. package/templates/workspaces/olivia/skills/market-research-agent/_meta.json +0 -6
  431. package/templates/workspaces/olivia/skills/marketing-analytics/SKILL.md +0 -74
  432. package/templates/workspaces/olivia/skills/marketing-analytics/_meta.json +0 -6
  433. package/templates/workspaces/olivia/skills/marketing-master-io/SKILL.md +0 -125
  434. package/templates/workspaces/olivia/skills/marketing-master-io/_meta.json +0 -6
  435. package/templates/workspaces/olivia/skills/marketing-strategy-pmm/SKILL.md +0 -398
  436. package/templates/workspaces/olivia/skills/marketing-strategy-pmm/_meta.json +0 -6
  437. package/templates/workspaces/olivia/skills/meta-ads-analytics/SKILL.md +0 -53
  438. package/templates/workspaces/olivia/skills/meta-ads-analytics/_meta.json +0 -6
  439. package/templates/workspaces/olivia/skills/obsidian/SKILL.md +0 -55
  440. package/templates/workspaces/olivia/skills/obsidian/_meta.json +0 -6
  441. package/templates/workspaces/olivia/skills/openclaw-accounting/SKILL.md +0 -125
  442. package/templates/workspaces/olivia/skills/openclaw-accounting/_meta.json +0 -6
  443. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/CHANGELOG.md +0 -35
  444. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/CHANNELLOG.md +0 -73
  445. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/README.md +0 -161
  446. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/SKILL.md +0 -130
  447. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/_meta.json +0 -6
  448. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/config.json +0 -36
  449. package/templates/workspaces/olivia/skills/openclaw-security-toolkit/metadata.json +0 -19
  450. package/templates/workspaces/olivia/skills/openhue/SKILL.md +0 -30
  451. package/templates/workspaces/olivia/skills/openhue/_meta.json +0 -6
  452. package/templates/workspaces/olivia/skills/orgx-operations-agent/SKILL.md +0 -41
  453. package/templates/workspaces/olivia/skills/orgx-operations-agent/_meta.json +0 -6
  454. package/templates/workspaces/olivia/skills/outreach/SKILL.md +0 -84
  455. package/templates/workspaces/olivia/skills/outreach/_meta.json +0 -6
  456. package/templates/workspaces/olivia/skills/outreach/by-type.md +0 -166
  457. package/templates/workspaces/olivia/skills/outreach/templates.md +0 -154
  458. package/templates/workspaces/olivia/skills/outreach/tracking.md +0 -145
  459. package/templates/workspaces/olivia/skills/persona-hr-coordinator/SKILL.md +0 -38
  460. package/templates/workspaces/olivia/skills/persona-hr-coordinator/_meta.json +0 -6
  461. package/templates/workspaces/olivia/skills/personal-productivity/SKILL.md +0 -161
  462. package/templates/workspaces/olivia/skills/personal-productivity/_meta.json +0 -6
  463. package/templates/workspaces/olivia/skills/personal-productivity/index.js +0 -363
  464. package/templates/workspaces/olivia/skills/personal-productivity/package.json +0 -15
  465. package/templates/workspaces/olivia/skills/personal-travel/README.md +0 -34
  466. package/templates/workspaces/olivia/skills/personal-travel/SKILL.md +0 -46
  467. package/templates/workspaces/olivia/skills/personal-travel/_meta.json +0 -6
  468. package/templates/workspaces/olivia/skills/presentation-html-generator-skill/SKILL.md +0 -185
  469. package/templates/workspaces/olivia/skills/presentation-html-generator-skill/_meta.json +0 -6
  470. package/templates/workspaces/olivia/skills/product-manager/SKILL.md +0 -77
  471. package/templates/workspaces/olivia/skills/product-manager/_meta.json +0 -6
  472. package/templates/workspaces/olivia/skills/quant-strategy/SKILL.md +0 -28
  473. package/templates/workspaces/olivia/skills/quant-strategy/_meta.json +0 -6
  474. package/templates/workspaces/olivia/skills/sales-pipeline-tracker/README.md +0 -29
  475. package/templates/workspaces/olivia/skills/sales-pipeline-tracker/SKILL.md +0 -45
  476. package/templates/workspaces/olivia/skills/sales-pipeline-tracker/_meta.json +0 -6
  477. package/templates/workspaces/olivia/skills/security-auditor/SKILL.md +0 -399
  478. package/templates/workspaces/olivia/skills/security-auditor/_meta.json +0 -6
  479. package/templates/workspaces/olivia/skills/security-hardening/SKILL.md +0 -296
  480. package/templates/workspaces/olivia/skills/security-hardening/_meta.json +0 -6
  481. package/templates/workspaces/olivia/skills/security-scanner/SKILL.md +0 -67
  482. package/templates/workspaces/olivia/skills/security-scanner/_meta.json +0 -6
  483. package/templates/workspaces/olivia/skills/seo-optimization/SKILL.md +0 -31
  484. package/templates/workspaces/olivia/skills/seo-optimization/_meta.json +0 -6
  485. package/templates/workspaces/olivia/skills/service-booking/SKILL.md +0 -193
  486. package/templates/workspaces/olivia/skills/service-booking/_meta.json +0 -6
  487. package/templates/workspaces/olivia/skills/sme-hr-automation/SKILL.md +0 -131
  488. package/templates/workspaces/olivia/skills/sme-hr-automation/_meta.json +0 -6
  489. package/templates/workspaces/olivia/skills/social-media-scheduler/README.md +0 -29
  490. package/templates/workspaces/olivia/skills/social-media-scheduler/SKILL.md +0 -49
  491. package/templates/workspaces/olivia/skills/social-media-scheduler/_meta.json +0 -6
  492. package/templates/workspaces/olivia/skills/sonoscli/SKILL.md +0 -26
  493. package/templates/workspaces/olivia/skills/sonoscli/_meta.json +0 -6
  494. package/templates/workspaces/olivia/skills/strategy-advisor/SKILL.md +0 -33
  495. package/templates/workspaces/olivia/skills/strategy-advisor/_meta.json +0 -6
  496. package/templates/workspaces/olivia/skills/summarize/SKILL.md +0 -49
  497. package/templates/workspaces/olivia/skills/summarize/_meta.json +0 -6
  498. package/templates/workspaces/olivia/skills/things-mac/SKILL.md +0 -61
  499. package/templates/workspaces/olivia/skills/things-mac/_meta.json +0 -6
  500. package/templates/workspaces/olivia/skills/travel-itinerary-planner/SKILL.md +0 -121
  501. package/templates/workspaces/olivia/skills/travel-itinerary-planner/_meta.json +0 -6
  502. package/templates/workspaces/olivia/skills/travel-manager/SKILL.md +0 -36
  503. package/templates/workspaces/olivia/skills/travel-manager/_meta.json +0 -6
  504. package/templates/workspaces/olivia/skills/travel-planning/SKILL.md +0 -238
  505. package/templates/workspaces/olivia/skills/travel-planning/_meta.json +0 -6
  506. package/templates/workspaces/olivia/skills/travel-planning/booking-guide.md +0 -91
  507. package/templates/workspaces/olivia/skills/travel-planning/memory-template.md +0 -111
  508. package/templates/workspaces/olivia/skills/travel-planning/multi-city.md +0 -131
  509. package/templates/workspaces/olivia/skills/travel-planning/packing-templates.md +0 -155
  510. package/templates/workspaces/olivia/skills/travel-planning/setup.md +0 -66
  511. package/templates/workspaces/olivia/skills/update-it-all/SKILL.md +0 -143
  512. package/templates/workspaces/olivia/skills/update-it-all/_meta.json +0 -6
  513. package/templates/workspaces/olivia/skills/voice/SKILL.md +0 -62
  514. package/templates/workspaces/olivia/skills/weather/SKILL.md +0 -49
  515. package/templates/workspaces/olivia/skills/weather/_meta.json +0 -6
  516. package/templates/workspaces/olivia/skills/web-researcher/SKILL.md +0 -21
  517. package/templates/workspaces/olivia/skills/web-researcher/_meta.json +0 -6
  518. package/templates/workspaces/olivia/skills/website-seo/SKILL.md +0 -284
  519. package/templates/workspaces/olivia/skills/website-seo/_meta.json +0 -6
  520. package/templates/workspaces/olivia/stripe-welcome-n8n.json +0 -103
  521. package/templates/workspaces/olivia/test2.wav.wav +0 -0
  522. package/templates/workspaces/olivia/test_speech.json +0 -1
  523. package/templates/workspaces/olivia/test_speech.srt +0 -0
  524. package/templates/workspaces/olivia/test_speech.tsv +0 -1
  525. package/templates/workspaces/olivia/test_speech.txt +0 -0
  526. package/templates/workspaces/olivia/test_speech.vtt +0 -2
  527. package/templates/workspaces/owen/AGENTS.md +0 -59
  528. package/templates/workspaces/owen/FEEDBACK.md +0 -12
  529. package/templates/workspaces/owen/HEARTBEAT.md +0 -5
  530. package/templates/workspaces/owen/IDENTITY.md +0 -6
  531. package/templates/workspaces/owen/LEARNINGS.md +0 -46
  532. package/templates/workspaces/owen/MEMORY.md +0 -22
  533. package/templates/workspaces/owen/PLAYBOOK.md +0 -16
  534. package/templates/workspaces/owen/SOUL.md +0 -39
  535. package/templates/workspaces/owen/TOOLS.md +0 -15
  536. package/templates/workspaces/owen/USER.md +0 -17
  537. package/templates/workspaces/parker/AGENTS.md +0 -59
  538. package/templates/workspaces/parker/FEEDBACK.md +0 -11
  539. package/templates/workspaces/parker/HEARTBEAT.md +0 -5
  540. package/templates/workspaces/parker/IDENTITY.md +0 -6
  541. package/templates/workspaces/parker/LEARNINGS.md +0 -17
  542. package/templates/workspaces/parker/MEMORY.md +0 -22
  543. package/templates/workspaces/parker/PLAYBOOK.md +0 -16
  544. package/templates/workspaces/parker/SOUL.md +0 -39
  545. package/templates/workspaces/parker/TOOLS.md +0 -15
  546. package/templates/workspaces/parker/USER.md +0 -13
  547. package/templates/workspaces/quinn/FEEDBACK.md +0 -11
  548. package/templates/workspaces/quinn/HEARTBEAT.md +0 -5
  549. package/templates/workspaces/quinn/IDENTITY.md +0 -6
  550. package/templates/workspaces/quinn/LEARNINGS.md +0 -35
  551. package/templates/workspaces/quinn/MEMORY.md +0 -22
  552. package/templates/workspaces/quinn/PLAYBOOK.md +0 -16
  553. package/templates/workspaces/quinn/SOUL.md +0 -40
  554. package/templates/workspaces/quinn/USER.md +0 -17
  555. package/templates/workspaces/quinn/alice-login-page.png +0 -0
  556. package/templates/workspaces/rowan/AGENTS.md +0 -59
  557. package/templates/workspaces/rowan/FEEDBACK.md +0 -12
  558. package/templates/workspaces/rowan/HEARTBEAT.md +0 -5
  559. package/templates/workspaces/rowan/IDENTITY.md +0 -6
  560. package/templates/workspaces/rowan/LEARNINGS.md +0 -12
  561. package/templates/workspaces/rowan/MEMORY.md +0 -22
  562. package/templates/workspaces/rowan/PLAYBOOK.md +0 -16
  563. package/templates/workspaces/rowan/SOUL.md +0 -40
  564. package/templates/workspaces/rowan/TOOLS.md +0 -59
  565. package/templates/workspaces/rowan/USER.md +0 -17
  566. package/templates/workspaces/selena/AGENTS.md +0 -59
  567. package/templates/workspaces/selena/FEEDBACK.md +0 -12
  568. package/templates/workspaces/selena/HEARTBEAT.md +0 -5
  569. package/templates/workspaces/selena/IDENTITY.md +0 -6
  570. package/templates/workspaces/selena/LEARNINGS.md +0 -24
  571. package/templates/workspaces/selena/MEMORY.md +0 -22
  572. package/templates/workspaces/selena/PLAYBOOK.md +0 -16
  573. package/templates/workspaces/selena/SOUL.md +0 -40
  574. package/templates/workspaces/selena/TOOLS.md +0 -47
  575. package/templates/workspaces/selena/USER.md +0 -17
  576. package/templates/workspaces/selena/kids-ai-security-compliance-plan.md +0 -791
  577. package/templates/workspaces/selena/kidspark-coppa-compliance-audit.md +0 -866
  578. package/templates/workspaces/sloane/AGENTS.md +0 -59
  579. package/templates/workspaces/sloane/FEEDBACK.md +0 -12
  580. package/templates/workspaces/sloane/HEARTBEAT.md +0 -9
  581. package/templates/workspaces/sloane/IDENTITY.md +0 -6
  582. package/templates/workspaces/sloane/LEARNINGS.md +0 -6
  583. package/templates/workspaces/sloane/MEMORY.md +0 -22
  584. package/templates/workspaces/sloane/PLAYBOOK.md +0 -16
  585. package/templates/workspaces/sloane/SOUL.md +0 -39
  586. package/templates/workspaces/sloane/TOOLS.md +0 -15
  587. package/templates/workspaces/sloane/USER.md +0 -13
  588. package/templates/workspaces/smoketestagent/AGENTS.md +0 -52
  589. package/templates/workspaces/smoketestagent/FEEDBACK.md +0 -3
  590. package/templates/workspaces/smoketestagent/HEARTBEAT.md +0 -14
  591. package/templates/workspaces/smoketestagent/IDENTITY.md +0 -6
  592. package/templates/workspaces/smoketestagent/LEARNINGS.md +0 -3
  593. package/templates/workspaces/smoketestagent/MEMORY.md +0 -24
  594. package/templates/workspaces/smoketestagent/PLAYBOOK.md +0 -7
  595. package/templates/workspaces/smoketestagent/SOUL.md +0 -32
  596. package/templates/workspaces/smoketestagent/TOOLS.md +0 -13
  597. package/templates/workspaces/smoketestagent/USER.md +0 -5
  598. package/templates/workspaces/sophie/AGENTS.md +0 -59
  599. package/templates/workspaces/sophie/FEEDBACK.md +0 -12
  600. package/templates/workspaces/sophie/HEARTBEAT.md +0 -9
  601. package/templates/workspaces/sophie/IDENTITY.md +0 -6
  602. package/templates/workspaces/sophie/LEARNINGS.md +0 -6
  603. package/templates/workspaces/sophie/MEMORY.md +0 -22
  604. package/templates/workspaces/sophie/PLAYBOOK.md +0 -16
  605. package/templates/workspaces/sophie/SOUL.md +0 -39
  606. package/templates/workspaces/sophie/TOOLS.md +0 -15
  607. package/templates/workspaces/sophie/USER.md +0 -17
  608. package/templates/workspaces/tommy/AGENTS.md +0 -59
  609. package/templates/workspaces/tommy/FEEDBACK.md +0 -12
  610. package/templates/workspaces/tommy/HEARTBEAT.md +0 -9
  611. package/templates/workspaces/tommy/IDENTITY.md +0 -6
  612. package/templates/workspaces/tommy/LEARNINGS.md +0 -6
  613. package/templates/workspaces/tommy/MEMORY.md +0 -22
  614. package/templates/workspaces/tommy/PLAYBOOK.md +0 -16
  615. package/templates/workspaces/tommy/SOUL.md +0 -39
  616. package/templates/workspaces/tommy/TOOLS.md +0 -15
  617. package/templates/workspaces/tommy/USER.md +0 -17
  618. package/templates/workspaces/uma/AGENTS.md +0 -59
  619. package/templates/workspaces/uma/FEEDBACK.md +0 -11
  620. package/templates/workspaces/uma/HEARTBEAT.md +0 -5
  621. package/templates/workspaces/uma/IDENTITY.md +0 -6
  622. package/templates/workspaces/uma/LEARNINGS.md +0 -11
  623. package/templates/workspaces/uma/MEMORY.md +0 -22
  624. package/templates/workspaces/uma/PLAYBOOK.md +0 -16
  625. package/templates/workspaces/uma/SOUL.md +0 -39
  626. package/templates/workspaces/uma/TOOLS.md +0 -15
  627. package/templates/workspaces/uma/USER.md +0 -13
  628. package/tools/.gitkeep +0 -0
@@ -1,926 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Database Index Optimizer
4
-
5
- Analyzes schema definitions and query patterns to recommend optimal indexes:
6
- - Identifies missing indexes for common query patterns
7
- - Detects redundant and overlapping indexes
8
- - Suggests composite index column ordering
9
- - Estimates selectivity and performance impact
10
- - Generates CREATE INDEX statements with rationale
11
-
12
- Input: Schema JSON + Query patterns JSON
13
- Output: Index recommendations + CREATE INDEX SQL + before/after analysis
14
-
15
- Usage:
16
- python index_optimizer.py --schema schema.json --queries queries.json --output recommendations.json
17
- python index_optimizer.py --schema schema.json --queries queries.json --format text
18
- python index_optimizer.py --schema schema.json --queries queries.json --analyze-existing
19
- """
20
-
21
- import argparse
22
- import json
23
- import re
24
- import sys
25
- from collections import defaultdict, namedtuple, Counter
26
- from typing import Dict, List, Set, Tuple, Optional, Any
27
- from dataclasses import dataclass, asdict
28
- import hashlib
29
-
30
-
31
- @dataclass
32
- class Column:
33
- name: str
34
- data_type: str
35
- nullable: bool = True
36
- unique: bool = False
37
- cardinality_estimate: Optional[int] = None
38
-
39
-
40
- @dataclass
41
- class Index:
42
- name: str
43
- table: str
44
- columns: List[str]
45
- unique: bool = False
46
- index_type: str = "btree"
47
- partial_condition: Optional[str] = None
48
- include_columns: List[str] = None
49
- size_estimate: Optional[int] = None
50
-
51
-
52
- @dataclass
53
- class QueryPattern:
54
- query_id: str
55
- query_type: str # SELECT, INSERT, UPDATE, DELETE
56
- table: str
57
- where_conditions: List[Dict[str, Any]]
58
- join_conditions: List[Dict[str, Any]]
59
- order_by: List[Dict[str, str]] # column, direction
60
- group_by: List[str]
61
- frequency: int = 1
62
- avg_execution_time_ms: Optional[float] = None
63
-
64
-
65
- @dataclass
66
- class IndexRecommendation:
67
- recommendation_id: str
68
- table: str
69
- recommended_index: Index
70
- reason: str
71
- query_patterns_helped: List[str]
72
- estimated_benefit: str
73
- estimated_overhead: str
74
- priority: int # 1 = highest priority
75
- sql_statement: str
76
- selectivity_analysis: Dict[str, Any]
77
-
78
-
79
- @dataclass
80
- class RedundancyIssue:
81
- issue_type: str # DUPLICATE, OVERLAPPING, UNUSED
82
- affected_indexes: List[str]
83
- table: str
84
- description: str
85
- recommendation: str
86
- sql_statements: List[str]
87
-
88
-
89
- class SelectivityEstimator:
90
- """Estimates column selectivity based on naming patterns and data types."""
91
-
92
- def __init__(self):
93
- # Selectivity patterns based on common column names and types
94
- self.high_selectivity_patterns = [
95
- r'.*_id$', r'^id$', r'uuid', r'guid', r'email', r'username', r'ssn',
96
- r'account.*number', r'transaction.*id', r'reference.*number'
97
- ]
98
-
99
- self.medium_selectivity_patterns = [
100
- r'name$', r'title$', r'description$', r'address', r'phone', r'zip',
101
- r'postal.*code', r'serial.*number', r'sku', r'product.*code'
102
- ]
103
-
104
- self.low_selectivity_patterns = [
105
- r'status$', r'type$', r'category', r'state$', r'flag$', r'active$',
106
- r'enabled$', r'deleted$', r'visible$', r'gender$', r'priority$'
107
- ]
108
-
109
- self.very_low_selectivity_patterns = [
110
- r'is_.*', r'has_.*', r'can_.*', r'boolean', r'bool'
111
- ]
112
-
113
- def estimate_selectivity(self, column: Column, table_size_estimate: int = 10000) -> float:
114
- """Estimate column selectivity (0.0 = all same values, 1.0 = all unique values)."""
115
- column_name_lower = column.name.lower()
116
-
117
- # Primary key or unique columns
118
- if column.unique or column.name.lower() in ['id', 'uuid', 'guid']:
119
- return 1.0
120
-
121
- # Check cardinality estimate if available
122
- if column.cardinality_estimate:
123
- return min(column.cardinality_estimate / table_size_estimate, 1.0)
124
-
125
- # Pattern-based estimation
126
- for pattern in self.high_selectivity_patterns:
127
- if re.search(pattern, column_name_lower):
128
- return 0.9 # Very high selectivity
129
-
130
- for pattern in self.medium_selectivity_patterns:
131
- if re.search(pattern, column_name_lower):
132
- return 0.7 # Good selectivity
133
-
134
- for pattern in self.low_selectivity_patterns:
135
- if re.search(pattern, column_name_lower):
136
- return 0.2 # Poor selectivity
137
-
138
- for pattern in self.very_low_selectivity_patterns:
139
- if re.search(pattern, column_name_lower):
140
- return 0.1 # Very poor selectivity
141
-
142
- # Data type based estimation
143
- data_type_upper = column.data_type.upper()
144
- if data_type_upper.startswith('BOOL'):
145
- return 0.1
146
- elif data_type_upper.startswith(('TINYINT', 'SMALLINT')):
147
- return 0.3
148
- elif data_type_upper.startswith('INT'):
149
- return 0.8
150
- elif data_type_upper.startswith(('VARCHAR', 'TEXT')):
151
- # Estimate based on column name
152
- if 'name' in column_name_lower:
153
- return 0.7
154
- elif 'description' in column_name_lower or 'comment' in column_name_lower:
155
- return 0.9
156
- else:
157
- return 0.6
158
-
159
- # Default moderate selectivity
160
- return 0.5
161
-
162
-
163
- class IndexOptimizer:
164
- def __init__(self):
165
- self.tables: Dict[str, Dict[str, Column]] = {}
166
- self.existing_indexes: Dict[str, List[Index]] = {}
167
- self.query_patterns: List[QueryPattern] = []
168
- self.selectivity_estimator = SelectivityEstimator()
169
-
170
- # Configuration
171
- self.max_composite_index_columns = 6
172
- self.min_selectivity_for_index = 0.1
173
- self.redundancy_overlap_threshold = 0.8
174
-
175
- def load_schema(self, schema_data: Dict[str, Any]) -> None:
176
- """Load schema definition."""
177
- if 'tables' not in schema_data:
178
- raise ValueError("Schema must contain 'tables' key")
179
-
180
- for table_name, table_def in schema_data['tables'].items():
181
- self.tables[table_name] = {}
182
- self.existing_indexes[table_name] = []
183
-
184
- # Load columns
185
- for col_name, col_def in table_def.get('columns', {}).items():
186
- column = Column(
187
- name=col_name,
188
- data_type=col_def.get('type', 'VARCHAR(255)'),
189
- nullable=col_def.get('nullable', True),
190
- unique=col_def.get('unique', False),
191
- cardinality_estimate=col_def.get('cardinality_estimate')
192
- )
193
- self.tables[table_name][col_name] = column
194
-
195
- # Load existing indexes
196
- for idx_def in table_def.get('indexes', []):
197
- index = Index(
198
- name=idx_def['name'],
199
- table=table_name,
200
- columns=idx_def['columns'],
201
- unique=idx_def.get('unique', False),
202
- index_type=idx_def.get('type', 'btree'),
203
- partial_condition=idx_def.get('partial_condition'),
204
- include_columns=idx_def.get('include_columns', [])
205
- )
206
- self.existing_indexes[table_name].append(index)
207
-
208
- def load_query_patterns(self, query_data: Dict[str, Any]) -> None:
209
- """Load query patterns for analysis."""
210
- if 'queries' not in query_data:
211
- raise ValueError("Query data must contain 'queries' key")
212
-
213
- for query_def in query_data['queries']:
214
- pattern = QueryPattern(
215
- query_id=query_def['id'],
216
- query_type=query_def.get('type', 'SELECT').upper(),
217
- table=query_def['table'],
218
- where_conditions=query_def.get('where_conditions', []),
219
- join_conditions=query_def.get('join_conditions', []),
220
- order_by=query_def.get('order_by', []),
221
- group_by=query_def.get('group_by', []),
222
- frequency=query_def.get('frequency', 1),
223
- avg_execution_time_ms=query_def.get('avg_execution_time_ms')
224
- )
225
- self.query_patterns.append(pattern)
226
-
227
- def analyze_missing_indexes(self) -> List[IndexRecommendation]:
228
- """Identify missing indexes based on query patterns."""
229
- recommendations = []
230
-
231
- for pattern in self.query_patterns:
232
- table_name = pattern.table
233
- if table_name not in self.tables:
234
- continue
235
-
236
- # Analyze WHERE conditions for single-column indexes
237
- for condition in pattern.where_conditions:
238
- column = condition.get('column')
239
- operator = condition.get('operator', '=')
240
-
241
- if column and column in self.tables[table_name]:
242
- if not self._has_covering_index(table_name, [column]):
243
- recommendation = self._create_single_column_recommendation(
244
- table_name, column, pattern, operator
245
- )
246
- if recommendation:
247
- recommendations.append(recommendation)
248
-
249
- # Analyze composite indexes for multi-column WHERE conditions
250
- where_columns = [cond.get('column') for cond in pattern.where_conditions
251
- if cond.get('column') and cond.get('column') in self.tables[table_name]]
252
-
253
- if len(where_columns) > 1:
254
- composite_recommendation = self._create_composite_recommendation(
255
- table_name, where_columns, pattern
256
- )
257
- if composite_recommendation:
258
- recommendations.append(composite_recommendation)
259
-
260
- # Analyze covering indexes for SELECT with ORDER BY
261
- if pattern.order_by and where_columns:
262
- covering_recommendation = self._create_covering_index_recommendation(
263
- table_name, where_columns, pattern
264
- )
265
- if covering_recommendation:
266
- recommendations.append(covering_recommendation)
267
-
268
- # Analyze JOIN conditions
269
- for join_condition in pattern.join_conditions:
270
- local_column = join_condition.get('local_column')
271
- if local_column and local_column in self.tables[table_name]:
272
- if not self._has_covering_index(table_name, [local_column]):
273
- recommendation = self._create_join_index_recommendation(
274
- table_name, local_column, pattern, join_condition
275
- )
276
- if recommendation:
277
- recommendations.append(recommendation)
278
-
279
- # Remove duplicates and prioritize
280
- recommendations = self._deduplicate_recommendations(recommendations)
281
- recommendations = self._prioritize_recommendations(recommendations)
282
-
283
- return recommendations
284
-
285
- def _has_covering_index(self, table_name: str, columns: List[str]) -> bool:
286
- """Check if existing indexes cover the specified columns."""
287
- if table_name not in self.existing_indexes:
288
- return False
289
-
290
- for index in self.existing_indexes[table_name]:
291
- # Check if index starts with required columns (prefix match for composite)
292
- if len(index.columns) >= len(columns):
293
- if index.columns[:len(columns)] == columns:
294
- return True
295
-
296
- return False
297
-
298
- def _create_single_column_recommendation(
299
- self,
300
- table_name: str,
301
- column: str,
302
- pattern: QueryPattern,
303
- operator: str
304
- ) -> Optional[IndexRecommendation]:
305
- """Create recommendation for single-column index."""
306
- column_obj = self.tables[table_name][column]
307
- selectivity = self.selectivity_estimator.estimate_selectivity(column_obj)
308
-
309
- # Skip very low selectivity columns unless frequently used
310
- if selectivity < self.min_selectivity_for_index and pattern.frequency < 100:
311
- return None
312
-
313
- index_name = f"idx_{table_name}_{column}"
314
- index = Index(
315
- name=index_name,
316
- table=table_name,
317
- columns=[column],
318
- unique=column_obj.unique,
319
- index_type="btree"
320
- )
321
-
322
- reason = f"Optimize WHERE {column} {operator} queries"
323
- if pattern.frequency > 10:
324
- reason += f" (used {pattern.frequency} times)"
325
-
326
- return IndexRecommendation(
327
- recommendation_id=self._generate_recommendation_id(table_name, [column]),
328
- table=table_name,
329
- recommended_index=index,
330
- reason=reason,
331
- query_patterns_helped=[pattern.query_id],
332
- estimated_benefit=self._estimate_benefit(selectivity, pattern.frequency),
333
- estimated_overhead="Low (single column)",
334
- priority=self._calculate_priority(selectivity, pattern.frequency, 1),
335
- sql_statement=f"CREATE INDEX {index_name} ON {table_name} ({column});",
336
- selectivity_analysis={
337
- "column_selectivity": selectivity,
338
- "estimated_reduction": f"{int(selectivity * 100)}%"
339
- }
340
- )
341
-
342
- def _create_composite_recommendation(
343
- self,
344
- table_name: str,
345
- columns: List[str],
346
- pattern: QueryPattern
347
- ) -> Optional[IndexRecommendation]:
348
- """Create recommendation for composite index."""
349
- if len(columns) > self.max_composite_index_columns:
350
- columns = columns[:self.max_composite_index_columns]
351
-
352
- # Order columns by selectivity (most selective first)
353
- column_selectivities = []
354
- for col in columns:
355
- col_obj = self.tables[table_name][col]
356
- selectivity = self.selectivity_estimator.estimate_selectivity(col_obj)
357
- column_selectivities.append((col, selectivity))
358
-
359
- # Sort by selectivity descending
360
- column_selectivities.sort(key=lambda x: x[1], reverse=True)
361
- ordered_columns = [col for col, _ in column_selectivities]
362
-
363
- # Calculate combined selectivity
364
- combined_selectivity = min(sum(sel for _, sel in column_selectivities) / len(columns), 0.95)
365
-
366
- index_name = f"idx_{table_name}_{'_'.join(ordered_columns)}"
367
- if len(index_name) > 63: # PostgreSQL limit
368
- index_name = f"idx_{table_name}_composite_{abs(hash('_'.join(ordered_columns))) % 10000}"
369
-
370
- index = Index(
371
- name=index_name,
372
- table=table_name,
373
- columns=ordered_columns,
374
- index_type="btree"
375
- )
376
-
377
- reason = f"Optimize multi-column WHERE conditions: {', '.join(ordered_columns)}"
378
-
379
- return IndexRecommendation(
380
- recommendation_id=self._generate_recommendation_id(table_name, ordered_columns),
381
- table=table_name,
382
- recommended_index=index,
383
- reason=reason,
384
- query_patterns_helped=[pattern.query_id],
385
- estimated_benefit=self._estimate_benefit(combined_selectivity, pattern.frequency),
386
- estimated_overhead=f"Medium (composite index with {len(ordered_columns)} columns)",
387
- priority=self._calculate_priority(combined_selectivity, pattern.frequency, len(ordered_columns)),
388
- sql_statement=f"CREATE INDEX {index_name} ON {table_name} ({', '.join(ordered_columns)});",
389
- selectivity_analysis={
390
- "column_selectivities": {col: sel for col, sel in column_selectivities},
391
- "combined_selectivity": combined_selectivity,
392
- "column_order_rationale": "Ordered by selectivity (most selective first)"
393
- }
394
- )
395
-
396
- def _create_covering_index_recommendation(
397
- self,
398
- table_name: str,
399
- where_columns: List[str],
400
- pattern: QueryPattern
401
- ) -> Optional[IndexRecommendation]:
402
- """Create recommendation for covering index."""
403
- order_columns = [col['column'] for col in pattern.order_by if col['column'] in self.tables[table_name]]
404
-
405
- # Combine WHERE and ORDER BY columns
406
- index_columns = where_columns.copy()
407
- include_columns = []
408
-
409
- # Add ORDER BY columns to index columns
410
- for col in order_columns:
411
- if col not in index_columns:
412
- index_columns.append(col)
413
-
414
- # Limit index columns
415
- if len(index_columns) > self.max_composite_index_columns:
416
- include_columns = index_columns[self.max_composite_index_columns:]
417
- index_columns = index_columns[:self.max_composite_index_columns]
418
-
419
- index_name = f"idx_{table_name}_covering_{'_'.join(index_columns[:3])}"
420
- if len(index_name) > 63:
421
- index_name = f"idx_{table_name}_covering_{abs(hash('_'.join(index_columns))) % 10000}"
422
-
423
- index = Index(
424
- name=index_name,
425
- table=table_name,
426
- columns=index_columns,
427
- include_columns=include_columns,
428
- index_type="btree"
429
- )
430
-
431
- reason = f"Covering index for WHERE + ORDER BY optimization"
432
-
433
- # Calculate selectivity for main columns
434
- main_selectivity = 0.5 # Default for covering indexes
435
- if where_columns:
436
- selectivities = [
437
- self.selectivity_estimator.estimate_selectivity(self.tables[table_name][col])
438
- for col in where_columns[:2] # Consider first 2 columns
439
- ]
440
- main_selectivity = max(selectivities)
441
-
442
- sql_parts = [f"CREATE INDEX {index_name} ON {table_name} ({', '.join(index_columns)})"]
443
- if include_columns:
444
- sql_parts.append(f" INCLUDE ({', '.join(include_columns)})")
445
- sql_statement = ''.join(sql_parts) + ";"
446
-
447
- return IndexRecommendation(
448
- recommendation_id=self._generate_recommendation_id(table_name, index_columns, "covering"),
449
- table=table_name,
450
- recommended_index=index,
451
- reason=reason,
452
- query_patterns_helped=[pattern.query_id],
453
- estimated_benefit="High (eliminates table lookups for SELECT)",
454
- estimated_overhead=f"High (covering index with {len(index_columns)} columns)",
455
- priority=self._calculate_priority(main_selectivity, pattern.frequency, len(index_columns)),
456
- sql_statement=sql_statement,
457
- selectivity_analysis={
458
- "main_columns_selectivity": main_selectivity,
459
- "covering_benefit": "Eliminates table lookup for SELECT queries"
460
- }
461
- )
462
-
463
- def _create_join_index_recommendation(
464
- self,
465
- table_name: str,
466
- column: str,
467
- pattern: QueryPattern,
468
- join_condition: Dict[str, Any]
469
- ) -> Optional[IndexRecommendation]:
470
- """Create recommendation for JOIN optimization index."""
471
- column_obj = self.tables[table_name][column]
472
- selectivity = self.selectivity_estimator.estimate_selectivity(column_obj)
473
-
474
- index_name = f"idx_{table_name}_{column}_join"
475
- index = Index(
476
- name=index_name,
477
- table=table_name,
478
- columns=[column],
479
- index_type="btree"
480
- )
481
-
482
- foreign_table = join_condition.get('foreign_table', 'unknown')
483
- reason = f"Optimize JOIN with {foreign_table} table on {column}"
484
-
485
- return IndexRecommendation(
486
- recommendation_id=self._generate_recommendation_id(table_name, [column], "join"),
487
- table=table_name,
488
- recommended_index=index,
489
- reason=reason,
490
- query_patterns_helped=[pattern.query_id],
491
- estimated_benefit=self._estimate_join_benefit(pattern.frequency),
492
- estimated_overhead="Low (single column for JOIN)",
493
- priority=2, # JOINs are generally high priority
494
- sql_statement=f"CREATE INDEX {index_name} ON {table_name} ({column});",
495
- selectivity_analysis={
496
- "column_selectivity": selectivity,
497
- "join_optimization": True
498
- }
499
- )
500
-
501
- def _generate_recommendation_id(self, table: str, columns: List[str], suffix: str = "") -> str:
502
- """Generate unique recommendation ID."""
503
- content = f"{table}_{'_'.join(sorted(columns))}_{suffix}"
504
- return hashlib.md5(content.encode()).hexdigest()[:8]
505
-
506
- def _estimate_benefit(self, selectivity: float, frequency: int) -> str:
507
- """Estimate performance benefit of index."""
508
- if selectivity > 0.8 and frequency > 50:
509
- return "Very High"
510
- elif selectivity > 0.6 and frequency > 20:
511
- return "High"
512
- elif selectivity > 0.4 or frequency > 10:
513
- return "Medium"
514
- else:
515
- return "Low"
516
-
517
- def _estimate_join_benefit(self, frequency: int) -> str:
518
- """Estimate benefit for JOIN indexes."""
519
- if frequency > 50:
520
- return "Very High (frequent JOINs)"
521
- elif frequency > 20:
522
- return "High (regular JOINs)"
523
- elif frequency > 5:
524
- return "Medium (occasional JOINs)"
525
- else:
526
- return "Low (rare JOINs)"
527
-
528
- def _calculate_priority(self, selectivity: float, frequency: int, column_count: int) -> int:
529
- """Calculate priority score (1 = highest priority)."""
530
- # Base score calculation
531
- score = 0
532
-
533
- # Selectivity contribution (0-50 points)
534
- score += int(selectivity * 50)
535
-
536
- # Frequency contribution (0-30 points)
537
- score += min(frequency, 30)
538
-
539
- # Penalty for complex indexes (subtract points)
540
- score -= (column_count - 1) * 5
541
-
542
- # Convert to priority levels
543
- if score >= 70:
544
- return 1 # Highest
545
- elif score >= 50:
546
- return 2 # High
547
- elif score >= 30:
548
- return 3 # Medium
549
- else:
550
- return 4 # Low
551
-
552
- def _deduplicate_recommendations(self, recommendations: List[IndexRecommendation]) -> List[IndexRecommendation]:
553
- """Remove duplicate recommendations."""
554
- seen_indexes = set()
555
- unique_recommendations = []
556
-
557
- for rec in recommendations:
558
- index_signature = (rec.table, tuple(rec.recommended_index.columns))
559
- if index_signature not in seen_indexes:
560
- seen_indexes.add(index_signature)
561
- unique_recommendations.append(rec)
562
- else:
563
- # Merge query patterns helped
564
- for existing_rec in unique_recommendations:
565
- if (existing_rec.table == rec.table and
566
- existing_rec.recommended_index.columns == rec.recommended_index.columns):
567
- existing_rec.query_patterns_helped.extend(rec.query_patterns_helped)
568
- break
569
-
570
- return unique_recommendations
571
-
572
- def _prioritize_recommendations(self, recommendations: List[IndexRecommendation]) -> List[IndexRecommendation]:
573
- """Sort recommendations by priority."""
574
- return sorted(recommendations, key=lambda x: (x.priority, -len(x.query_patterns_helped)))
575
-
576
- def analyze_redundant_indexes(self) -> List[RedundancyIssue]:
577
- """Identify redundant, overlapping, and potentially unused indexes."""
578
- redundancy_issues = []
579
-
580
- for table_name, indexes in self.existing_indexes.items():
581
- if len(indexes) < 2:
582
- continue
583
-
584
- # Find duplicate indexes
585
- duplicates = self._find_duplicate_indexes(table_name, indexes)
586
- redundancy_issues.extend(duplicates)
587
-
588
- # Find overlapping indexes
589
- overlapping = self._find_overlapping_indexes(table_name, indexes)
590
- redundancy_issues.extend(overlapping)
591
-
592
- # Find potentially unused indexes
593
- unused = self._find_unused_indexes(table_name, indexes)
594
- redundancy_issues.extend(unused)
595
-
596
- return redundancy_issues
597
-
598
- def _find_duplicate_indexes(self, table_name: str, indexes: List[Index]) -> List[RedundancyIssue]:
599
- """Find exactly duplicate indexes."""
600
- issues = []
601
- seen_signatures = {}
602
-
603
- for index in indexes:
604
- signature = (tuple(index.columns), index.unique, index.partial_condition)
605
- if signature in seen_signatures:
606
- existing_index = seen_signatures[signature]
607
- issues.append(RedundancyIssue(
608
- issue_type="DUPLICATE",
609
- affected_indexes=[existing_index.name, index.name],
610
- table=table_name,
611
- description=f"Indexes '{existing_index.name}' and '{index.name}' are identical",
612
- recommendation=f"Drop one of the duplicate indexes",
613
- sql_statements=[f"DROP INDEX {index.name};"]
614
- ))
615
- else:
616
- seen_signatures[signature] = index
617
-
618
- return issues
619
-
620
- def _find_overlapping_indexes(self, table_name: str, indexes: List[Index]) -> List[RedundancyIssue]:
621
- """Find overlapping indexes that might be redundant."""
622
- issues = []
623
-
624
- for i, index1 in enumerate(indexes):
625
- for index2 in indexes[i+1:]:
626
- overlap_ratio = self._calculate_overlap_ratio(index1, index2)
627
-
628
- if overlap_ratio >= self.redundancy_overlap_threshold:
629
- # Determine which index to keep
630
- if len(index1.columns) <= len(index2.columns):
631
- redundant_index = index1
632
- keep_index = index2
633
- else:
634
- redundant_index = index2
635
- keep_index = index1
636
-
637
- issues.append(RedundancyIssue(
638
- issue_type="OVERLAPPING",
639
- affected_indexes=[index1.name, index2.name],
640
- table=table_name,
641
- description=f"Index '{redundant_index.name}' overlaps {int(overlap_ratio * 100)}% "
642
- f"with '{keep_index.name}'",
643
- recommendation=f"Consider dropping '{redundant_index.name}' as it's largely "
644
- f"covered by '{keep_index.name}'",
645
- sql_statements=[f"DROP INDEX {redundant_index.name};"]
646
- ))
647
-
648
- return issues
649
-
650
- def _calculate_overlap_ratio(self, index1: Index, index2: Index) -> float:
651
- """Calculate overlap ratio between two indexes."""
652
- cols1 = set(index1.columns)
653
- cols2 = set(index2.columns)
654
-
655
- if not cols1 or not cols2:
656
- return 0.0
657
-
658
- intersection = len(cols1.intersection(cols2))
659
- union = len(cols1.union(cols2))
660
-
661
- return intersection / union if union > 0 else 0.0
662
-
663
- def _find_unused_indexes(self, table_name: str, indexes: List[Index]) -> List[RedundancyIssue]:
664
- """Find potentially unused indexes based on query patterns."""
665
- issues = []
666
-
667
- # Collect all columns used in query patterns for this table
668
- used_columns = set()
669
- table_patterns = [p for p in self.query_patterns if p.table == table_name]
670
-
671
- for pattern in table_patterns:
672
- # Add WHERE condition columns
673
- for condition in pattern.where_conditions:
674
- if condition.get('column'):
675
- used_columns.add(condition['column'])
676
-
677
- # Add JOIN columns
678
- for join in pattern.join_conditions:
679
- if join.get('local_column'):
680
- used_columns.add(join['local_column'])
681
-
682
- # Add ORDER BY columns
683
- for order in pattern.order_by:
684
- if order.get('column'):
685
- used_columns.add(order['column'])
686
-
687
- # Add GROUP BY columns
688
- used_columns.update(pattern.group_by)
689
-
690
- if not used_columns:
691
- return issues # Can't determine usage without query patterns
692
-
693
- for index in indexes:
694
- index_columns = set(index.columns)
695
- if not index_columns.intersection(used_columns):
696
- issues.append(RedundancyIssue(
697
- issue_type="UNUSED",
698
- affected_indexes=[index.name],
699
- table=table_name,
700
- description=f"Index '{index.name}' columns {index.columns} are not used in any query patterns",
701
- recommendation="Consider dropping this index if it's truly unused (verify with query logs)",
702
- sql_statements=[f"-- Review usage before dropping\n-- DROP INDEX {index.name};"]
703
- ))
704
-
705
- return issues
706
-
707
- def estimate_index_sizes(self) -> Dict[str, Dict[str, Any]]:
708
- """Estimate storage requirements for recommended indexes."""
709
- size_estimates = {}
710
-
711
- # This is a simplified estimation - in practice, would need actual table statistics
712
- for table_name in self.tables:
713
- size_estimates[table_name] = {
714
- "estimated_table_rows": 10000, # Default estimate
715
- "existing_indexes_size_mb": len(self.existing_indexes.get(table_name, [])) * 5, # Rough estimate
716
- "index_overhead_per_column_mb": 2 # Rough estimate per column
717
- }
718
-
719
- return size_estimates
720
-
721
- def generate_analysis_report(self) -> Dict[str, Any]:
722
- """Generate comprehensive analysis report."""
723
- recommendations = self.analyze_missing_indexes()
724
- redundancy_issues = self.analyze_redundant_indexes()
725
- size_estimates = self.estimate_index_sizes()
726
-
727
- # Calculate statistics
728
- total_existing_indexes = sum(len(indexes) for indexes in self.existing_indexes.values())
729
- tables_analyzed = len(self.tables)
730
- query_patterns_analyzed = len(self.query_patterns)
731
-
732
- # Categorize recommendations by priority
733
- high_priority = [r for r in recommendations if r.priority <= 2]
734
- medium_priority = [r for r in recommendations if r.priority == 3]
735
- low_priority = [r for r in recommendations if r.priority >= 4]
736
-
737
- return {
738
- "analysis_summary": {
739
- "tables_analyzed": tables_analyzed,
740
- "query_patterns_analyzed": query_patterns_analyzed,
741
- "existing_indexes": total_existing_indexes,
742
- "total_recommendations": len(recommendations),
743
- "high_priority_recommendations": len(high_priority),
744
- "redundancy_issues_found": len(redundancy_issues)
745
- },
746
- "index_recommendations": {
747
- "high_priority": [asdict(r) for r in high_priority],
748
- "medium_priority": [asdict(r) for r in medium_priority],
749
- "low_priority": [asdict(r) for r in low_priority]
750
- },
751
- "redundancy_analysis": [asdict(issue) for issue in redundancy_issues],
752
- "size_estimates": size_estimates,
753
- "sql_statements": {
754
- "create_indexes": [rec.sql_statement for rec in recommendations],
755
- "drop_redundant": [
756
- stmt for issue in redundancy_issues
757
- for stmt in issue.sql_statements
758
- ]
759
- },
760
- "performance_impact": self._generate_performance_impact_analysis(recommendations)
761
- }
762
-
763
- def _generate_performance_impact_analysis(self, recommendations: List[IndexRecommendation]) -> Dict[str, Any]:
764
- """Generate performance impact analysis."""
765
- impact_analysis = {
766
- "query_optimization": {},
767
- "write_overhead": {},
768
- "storage_impact": {}
769
- }
770
-
771
- # Analyze query optimization impact
772
- query_benefits = defaultdict(list)
773
- for rec in recommendations:
774
- for query_id in rec.query_patterns_helped:
775
- query_benefits[query_id].append(rec.estimated_benefit)
776
-
777
- impact_analysis["query_optimization"] = {
778
- "queries_improved": len(query_benefits),
779
- "high_impact_queries": len([q for q, benefits in query_benefits.items()
780
- if any("High" in benefit for benefit in benefits)]),
781
- "benefit_distribution": dict(Counter(
782
- rec.estimated_benefit for rec in recommendations
783
- ))
784
- }
785
-
786
- # Analyze write overhead
787
- impact_analysis["write_overhead"] = {
788
- "total_new_indexes": len(recommendations),
789
- "estimated_insert_overhead": f"{len(recommendations) * 5}%", # Rough estimate
790
- "tables_most_affected": list(Counter(rec.table for rec in recommendations).most_common(3))
791
- }
792
-
793
- return impact_analysis
794
-
795
- def format_text_report(self, analysis: Dict[str, Any]) -> str:
796
- """Format analysis as human-readable text report."""
797
- lines = []
798
- lines.append("DATABASE INDEX OPTIMIZATION REPORT")
799
- lines.append("=" * 50)
800
- lines.append("")
801
-
802
- # Summary
803
- summary = analysis["analysis_summary"]
804
- lines.append("ANALYSIS SUMMARY")
805
- lines.append("-" * 16)
806
- lines.append(f"Tables Analyzed: {summary['tables_analyzed']}")
807
- lines.append(f"Query Patterns: {summary['query_patterns_analyzed']}")
808
- lines.append(f"Existing Indexes: {summary['existing_indexes']}")
809
- lines.append(f"New Recommendations: {summary['total_recommendations']}")
810
- lines.append(f"High Priority: {summary['high_priority_recommendations']}")
811
- lines.append(f"Redundancy Issues: {summary['redundancy_issues_found']}")
812
- lines.append("")
813
-
814
- # High Priority Recommendations
815
- high_priority = analysis["index_recommendations"]["high_priority"]
816
- if high_priority:
817
- lines.append(f"HIGH PRIORITY RECOMMENDATIONS ({len(high_priority)})")
818
- lines.append("-" * 35)
819
- for i, rec in enumerate(high_priority[:10], 1): # Show top 10
820
- lines.append(f"{i}. {rec['table']}: {rec['reason']}")
821
- lines.append(f" Columns: {', '.join(rec['recommended_index']['columns'])}")
822
- lines.append(f" Benefit: {rec['estimated_benefit']}")
823
- lines.append(f" SQL: {rec['sql_statement']}")
824
- lines.append("")
825
-
826
- # Redundancy Issues
827
- redundancy = analysis["redundancy_analysis"]
828
- if redundancy:
829
- lines.append(f"REDUNDANCY ISSUES ({len(redundancy)})")
830
- lines.append("-" * 20)
831
- for issue in redundancy[:5]: # Show first 5
832
- lines.append(f"• {issue['issue_type']}: {issue['description']}")
833
- lines.append(f" Recommendation: {issue['recommendation']}")
834
- if issue['sql_statements']:
835
- lines.append(f" SQL: {issue['sql_statements'][0]}")
836
- lines.append("")
837
-
838
- # Performance Impact
839
- perf_impact = analysis["performance_impact"]
840
- lines.append("PERFORMANCE IMPACT ANALYSIS")
841
- lines.append("-" * 30)
842
- query_opt = perf_impact["query_optimization"]
843
- lines.append(f"Queries to be optimized: {query_opt['queries_improved']}")
844
- lines.append(f"High impact optimizations: {query_opt['high_impact_queries']}")
845
-
846
- write_overhead = perf_impact["write_overhead"]
847
- lines.append(f"Estimated insert overhead: {write_overhead['estimated_insert_overhead']}")
848
- lines.append("")
849
-
850
- # SQL Statements Summary
851
- sql_statements = analysis["sql_statements"]
852
- create_statements = sql_statements["create_indexes"]
853
- if create_statements:
854
- lines.append("RECOMMENDED CREATE INDEX STATEMENTS")
855
- lines.append("-" * 36)
856
- for i, stmt in enumerate(create_statements[:10], 1):
857
- lines.append(f"{i}. {stmt}")
858
-
859
- if len(create_statements) > 10:
860
- lines.append(f"... and {len(create_statements) - 10} more")
861
- lines.append("")
862
-
863
- return "\n".join(lines)
864
-
865
-
866
- def main():
867
- parser = argparse.ArgumentParser(description="Optimize database indexes based on schema and query patterns")
868
- parser.add_argument("--schema", "-s", required=True, help="Schema definition JSON file")
869
- parser.add_argument("--queries", "-q", required=True, help="Query patterns JSON file")
870
- parser.add_argument("--output", "-o", help="Output file (default: stdout)")
871
- parser.add_argument("--format", "-f", choices=["json", "text"], default="text",
872
- help="Output format")
873
- parser.add_argument("--analyze-existing", "-e", action="store_true",
874
- help="Include analysis of existing indexes")
875
- parser.add_argument("--min-priority", "-p", type=int, default=4,
876
- help="Minimum priority level to include (1=highest, 4=lowest)")
877
-
878
- args = parser.parse_args()
879
-
880
- try:
881
- # Load schema
882
- with open(args.schema, 'r') as f:
883
- schema_data = json.load(f)
884
-
885
- # Load queries
886
- with open(args.queries, 'r') as f:
887
- query_data = json.load(f)
888
-
889
- # Initialize optimizer
890
- optimizer = IndexOptimizer()
891
- optimizer.load_schema(schema_data)
892
- optimizer.load_query_patterns(query_data)
893
-
894
- # Generate analysis
895
- analysis = optimizer.generate_analysis_report()
896
-
897
- # Filter by priority if specified
898
- if args.min_priority < 4:
899
- for priority_level in ["high_priority", "medium_priority", "low_priority"]:
900
- analysis["index_recommendations"][priority_level] = [
901
- rec for rec in analysis["index_recommendations"][priority_level]
902
- if rec["priority"] <= args.min_priority
903
- ]
904
-
905
- # Format output
906
- if args.format == "json":
907
- output = json.dumps(analysis, indent=2)
908
- else:
909
- output = optimizer.format_text_report(analysis)
910
-
911
- # Write output
912
- if args.output:
913
- with open(args.output, 'w') as f:
914
- f.write(output)
915
- else:
916
- print(output)
917
-
918
- return 0
919
-
920
- except Exception as e:
921
- print(f"Error: {e}", file=sys.stderr)
922
- return 1
923
-
924
-
925
- if __name__ == "__main__":
926
- sys.exit(main())