moai-adk 0.34.0__py3-none-any.whl → 1.1.0__py3-none-any.whl

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 (524) hide show
  1. moai_adk/__main__.py +136 -5
  2. moai_adk/astgrep/__init__.py +37 -0
  3. moai_adk/astgrep/analyzer.py +522 -0
  4. moai_adk/astgrep/models.py +124 -0
  5. moai_adk/astgrep/rules.py +179 -0
  6. moai_adk/cli/commands/analyze.py +11 -2
  7. moai_adk/cli/commands/doctor.py +7 -1
  8. moai_adk/cli/commands/init.py +321 -11
  9. moai_adk/cli/commands/language.py +7 -1
  10. moai_adk/cli/commands/rank.py +449 -0
  11. moai_adk/cli/commands/status.py +7 -1
  12. moai_adk/cli/commands/switch.py +325 -0
  13. moai_adk/cli/commands/update.py +296 -23
  14. moai_adk/cli/prompts/init_prompts.py +362 -66
  15. moai_adk/cli/prompts/translations/__init__.py +573 -0
  16. moai_adk/cli/ui/prompts.py +61 -2
  17. moai_adk/cli/worktree/cli.py +106 -1
  18. moai_adk/cli/worktree/manager.py +155 -0
  19. moai_adk/core/config/unified.py +244 -63
  20. moai_adk/core/credentials.py +264 -0
  21. moai_adk/core/error_recovery_system.py +22 -4
  22. moai_adk/core/git/conflict_detector.py +10 -1
  23. moai_adk/core/git/event_detector.py +16 -5
  24. moai_adk/core/integration/engine.py +2 -2
  25. moai_adk/core/integration/integration_tester.py +5 -5
  26. moai_adk/core/language_config_resolver.py +9 -3
  27. moai_adk/core/merge/analyzer.py +509 -324
  28. moai_adk/core/migration/alfred_to_moai_migrator.py +7 -1
  29. moai_adk/core/migration/backup_manager.py +54 -4
  30. moai_adk/core/migration/file_migrator.py +174 -2
  31. moai_adk/core/migration/interactive_checkbox_ui.py +42 -31
  32. moai_adk/core/migration/version_detector.py +123 -19
  33. moai_adk/core/migration/version_migrator.py +44 -9
  34. moai_adk/core/model_allocator.py +241 -0
  35. moai_adk/core/project/backup_utils.py +12 -2
  36. moai_adk/core/project/initializer.py +44 -87
  37. moai_adk/core/project/phase_executor.py +95 -33
  38. moai_adk/core/project/validator.py +16 -1
  39. moai_adk/core/quality/trust_checker.py +30 -10
  40. moai_adk/core/rollback_manager.py +60 -25
  41. moai_adk/core/template/backup.py +88 -6
  42. moai_adk/core/template/config.py +33 -9
  43. moai_adk/core/template/merger.py +34 -8
  44. moai_adk/core/template/processor.py +334 -11
  45. moai_adk/core/template_engine.py +10 -1
  46. moai_adk/core/template_variable_synchronizer.py +16 -2
  47. moai_adk/core/version_sync.py +54 -6
  48. moai_adk/foundation/__init__.py +1 -20
  49. moai_adk/foundation/testing.py +1 -1
  50. moai_adk/loop/__init__.py +54 -0
  51. moai_adk/loop/controller.py +305 -0
  52. moai_adk/loop/feedback.py +230 -0
  53. moai_adk/loop/state.py +209 -0
  54. moai_adk/loop/storage.py +220 -0
  55. moai_adk/lsp/__init__.py +70 -0
  56. moai_adk/lsp/client.py +320 -0
  57. moai_adk/lsp/models.py +261 -0
  58. moai_adk/lsp/protocol.py +404 -0
  59. moai_adk/lsp/server_manager.py +248 -0
  60. moai_adk/project/configuration.py +8 -1
  61. moai_adk/py.typed +0 -0
  62. moai_adk/ralph/__init__.py +37 -0
  63. moai_adk/ralph/engine.py +307 -0
  64. moai_adk/rank/__init__.py +21 -0
  65. moai_adk/rank/auth.py +425 -0
  66. moai_adk/rank/client.py +557 -0
  67. moai_adk/rank/config.py +147 -0
  68. moai_adk/rank/hook.py +1503 -0
  69. moai_adk/rank/py.typed +0 -0
  70. moai_adk/statusline/__init__.py +3 -0
  71. moai_adk/statusline/enhanced_output_style_detector.py +5 -5
  72. moai_adk/statusline/main.py +20 -1
  73. moai_adk/statusline/memory_collector.py +268 -0
  74. moai_adk/statusline/renderer.py +54 -38
  75. moai_adk/tag_system/__init__.py +48 -0
  76. moai_adk/tag_system/atomic_ops.py +117 -0
  77. moai_adk/tag_system/linkage.py +335 -0
  78. moai_adk/tag_system/parser.py +176 -0
  79. moai_adk/tag_system/validator.py +200 -0
  80. moai_adk/templates/.claude/agents/moai/builder-agent.md +19 -3
  81. moai_adk/templates/.claude/agents/moai/builder-command.md +62 -16
  82. moai_adk/templates/.claude/agents/moai/builder-plugin.md +763 -0
  83. moai_adk/templates/.claude/agents/moai/builder-skill.md +21 -5
  84. moai_adk/templates/.claude/agents/moai/expert-backend.md +103 -39
  85. moai_adk/templates/.claude/agents/moai/expert-debug.md +9 -3
  86. moai_adk/templates/.claude/agents/moai/expert-devops.md +16 -14
  87. moai_adk/templates/.claude/agents/moai/expert-frontend.md +45 -31
  88. moai_adk/templates/.claude/agents/moai/expert-performance.md +13 -9
  89. moai_adk/templates/.claude/agents/moai/expert-refactoring.md +228 -0
  90. moai_adk/templates/.claude/agents/moai/expert-security.md +19 -3
  91. moai_adk/templates/.claude/agents/moai/expert-testing.md +13 -9
  92. moai_adk/templates/.claude/agents/moai/manager-claude-code.md +8 -2
  93. moai_adk/templates/.claude/agents/moai/manager-docs.md +10 -5
  94. moai_adk/templates/.claude/agents/moai/manager-git.md +99 -27
  95. moai_adk/templates/.claude/agents/moai/manager-project.md +87 -7
  96. moai_adk/templates/.claude/agents/moai/manager-quality.md +22 -5
  97. moai_adk/templates/.claude/agents/moai/manager-spec.md +8 -2
  98. moai_adk/templates/.claude/agents/moai/manager-strategy.md +45 -14
  99. moai_adk/templates/.claude/agents/moai/manager-tdd.md +16 -3
  100. moai_adk/templates/.claude/commands/moai/0-project.md +239 -1185
  101. moai_adk/templates/.claude/commands/moai/1-plan.md +383 -363
  102. moai_adk/templates/.claude/commands/moai/2-run.md +254 -347
  103. moai_adk/templates/.claude/commands/moai/3-sync.md +174 -100
  104. moai_adk/templates/.claude/commands/moai/9-feedback.md +49 -33
  105. moai_adk/templates/.claude/commands/moai/alfred.md +339 -0
  106. moai_adk/templates/.claude/commands/moai/cancel-loop.md +163 -0
  107. moai_adk/templates/.claude/commands/moai/fix.md +264 -0
  108. moai_adk/templates/.claude/commands/moai/loop.md +363 -0
  109. moai_adk/templates/.claude/hooks/moai/lib/README.md +143 -0
  110. moai_adk/templates/.claude/hooks/moai/lib/__init__.py +37 -81
  111. moai_adk/templates/.claude/hooks/moai/lib/alfred_detector.py +105 -0
  112. moai_adk/templates/.claude/hooks/moai/lib/atomic_write.py +122 -0
  113. moai_adk/templates/.claude/hooks/moai/lib/checkpoint.py +4 -1
  114. moai_adk/templates/.claude/hooks/moai/lib/common.py +35 -5
  115. moai_adk/templates/.claude/hooks/moai/lib/config.py +376 -0
  116. moai_adk/templates/.claude/hooks/moai/lib/config_manager.py +24 -28
  117. moai_adk/templates/.claude/hooks/moai/lib/config_validator.py +14 -14
  118. moai_adk/templates/.claude/hooks/moai/lib/enhanced_output_style_detector.py +372 -0
  119. moai_adk/templates/.claude/hooks/moai/lib/exceptions.py +171 -0
  120. moai_adk/templates/.claude/hooks/moai/lib/file_utils.py +95 -0
  121. moai_adk/templates/.claude/hooks/moai/lib/git_collector.py +190 -0
  122. moai_adk/templates/.claude/hooks/moai/lib/git_operations_manager.py +15 -13
  123. moai_adk/templates/.claude/hooks/moai/lib/language_detector.py +298 -0
  124. moai_adk/templates/.claude/hooks/moai/lib/language_validator.py +125 -25
  125. moai_adk/templates/.claude/hooks/moai/lib/main.py +341 -0
  126. moai_adk/templates/.claude/hooks/moai/lib/memory_collector.py +268 -0
  127. moai_adk/templates/.claude/hooks/moai/lib/metrics_tracker.py +78 -0
  128. moai_adk/templates/.claude/hooks/moai/lib/models.py +9 -7
  129. moai_adk/templates/.claude/hooks/moai/lib/path_utils.py +204 -13
  130. moai_adk/templates/.claude/hooks/moai/lib/project.py +23 -14
  131. moai_adk/templates/.claude/hooks/moai/lib/renderer.py +359 -0
  132. moai_adk/templates/.claude/hooks/moai/lib/tag_linkage.py +333 -0
  133. moai_adk/templates/.claude/hooks/moai/lib/tag_parser.py +176 -0
  134. moai_adk/templates/.claude/hooks/moai/lib/tag_validator.py +200 -0
  135. moai_adk/templates/.claude/hooks/moai/lib/timeout.py +5 -5
  136. moai_adk/templates/.claude/hooks/moai/lib/tool_registry.py +896 -0
  137. moai_adk/templates/.claude/hooks/moai/lib/unified_timeout_manager.py +30 -18
  138. moai_adk/templates/.claude/hooks/moai/lib/update_checker.py +129 -0
  139. moai_adk/templates/.claude/hooks/moai/lib/version_reader.py +741 -0
  140. moai_adk/templates/.claude/hooks/moai/post_tool__ast_grep_scan.py +276 -0
  141. moai_adk/templates/.claude/hooks/moai/post_tool__code_formatter.py +255 -0
  142. moai_adk/templates/.claude/hooks/moai/post_tool__coverage_guard.py +325 -0
  143. moai_adk/templates/.claude/hooks/moai/post_tool__linter.py +315 -0
  144. moai_adk/templates/.claude/hooks/moai/post_tool__lsp_diagnostic.py +508 -0
  145. moai_adk/templates/.claude/hooks/moai/pre_commit__tag_validator.py +287 -0
  146. moai_adk/templates/.claude/hooks/moai/pre_tool__security_guard.py +268 -0
  147. moai_adk/templates/.claude/hooks/moai/pre_tool__tdd_enforcer.py +208 -0
  148. moai_adk/templates/.claude/hooks/moai/session_end__auto_cleanup.py +93 -61
  149. moai_adk/templates/.claude/hooks/moai/session_end__rank_submit.py +69 -0
  150. moai_adk/templates/.claude/hooks/moai/session_start__show_project_info.py +165 -70
  151. moai_adk/templates/.claude/hooks/moai/shared/utils/announcement_translator.py +206 -0
  152. moai_adk/templates/.claude/hooks/moai/stop__loop_controller.py +621 -0
  153. moai_adk/templates/.claude/output-styles/moai/alfred.md +758 -0
  154. moai_adk/templates/.claude/output-styles/moai/r2d2.md +86 -3
  155. moai_adk/templates/.claude/output-styles/moai/yoda.md +2 -2
  156. moai_adk/templates/.claude/settings.json +154 -77
  157. moai_adk/templates/.claude/skills/moai-docs-generation/SKILL.md +252 -198
  158. moai_adk/templates/.claude/skills/moai-docs-generation/examples.md +169 -323
  159. moai_adk/templates/.claude/skills/moai-docs-generation/modules/README.md +39 -27
  160. moai_adk/templates/.claude/skills/moai-docs-generation/modules/api-documentation.md +115 -125
  161. moai_adk/templates/.claude/skills/moai-docs-generation/modules/code-documentation.md +150 -150
  162. moai_adk/templates/.claude/skills/moai-docs-generation/modules/multi-format-output.md +182 -175
  163. moai_adk/templates/.claude/skills/moai-docs-generation/modules/user-guides.md +198 -138
  164. moai_adk/templates/.claude/skills/moai-docs-generation/reference.md +226 -320
  165. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +43 -222
  166. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +75 -219
  167. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +103 -463
  168. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/component-architecture.md +723 -0
  169. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/nextjs16-patterns.md +713 -0
  170. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/performance-optimization.md +694 -0
  171. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/react19-patterns.md +591 -0
  172. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/state-management.md +680 -0
  173. moai_adk/templates/.claude/skills/moai-domain-frontend/modules/vue35-patterns.md +802 -0
  174. moai_adk/templates/.claude/skills/moai-domain-uiux/SKILL.md +118 -339
  175. moai_adk/templates/.claude/skills/moai-formats-data/SKILL.md +74 -377
  176. moai_adk/templates/.claude/skills/moai-formats-data/modules/README.md +299 -70
  177. moai_adk/templates/.claude/skills/moai-foundation-claude/SKILL.md +205 -182
  178. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/advanced-agent-patterns.md +370 -0
  179. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-cli-reference-official.md +420 -0
  180. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-custom-slash-commands-official.md +32 -22
  181. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-devcontainers-official.md +381 -0
  182. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-discover-plugins-official.md +379 -0
  183. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-headless-official.md +378 -0
  184. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-hooks-official.md +110 -0
  185. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-plugin-marketplaces-official.md +308 -0
  186. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-plugins-official.md +640 -0
  187. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sandboxing-official.md +282 -0
  188. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-skills-official.md +425 -71
  189. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-statusline-official.md +293 -0
  190. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sub-agents-official.md +325 -143
  191. moai_adk/templates/.claude/skills/moai-foundation-context/SKILL.md +96 -316
  192. moai_adk/templates/.claude/skills/moai-foundation-core/SKILL.md +116 -294
  193. moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-advanced.md +279 -0
  194. moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-implementation.md +267 -0
  195. moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-patterns.md +121 -650
  196. moai_adk/templates/.claude/skills/moai-foundation-core/modules/patterns.md +22 -0
  197. moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-ears-format.md +200 -0
  198. moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-first-tdd.md +37 -730
  199. moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-tdd-implementation.md +275 -0
  200. moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-framework.md +77 -819
  201. moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-implementation.md +244 -0
  202. moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-validation.md +219 -0
  203. moai_adk/templates/.claude/skills/moai-foundation-philosopher/SKILL.md +14 -18
  204. moai_adk/templates/.claude/skills/moai-foundation-quality/SKILL.md +86 -270
  205. moai_adk/templates/.claude/skills/moai-framework-electron/SKILL.md +288 -0
  206. moai_adk/templates/.claude/skills/moai-framework-electron/examples.md +2082 -0
  207. moai_adk/templates/.claude/skills/moai-framework-electron/reference.md +1649 -0
  208. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +76 -582
  209. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +1239 -0
  210. moai_adk/templates/.claude/skills/moai-lang-cpp/modules/advanced-patterns.md +401 -0
  211. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +1136 -0
  212. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +82 -436
  213. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +585 -0
  214. moai_adk/templates/.claude/skills/moai-lang-csharp/modules/aspnet-core.md +627 -0
  215. moai_adk/templates/.claude/skills/moai-lang-csharp/modules/blazor-components.md +767 -0
  216. moai_adk/templates/.claude/skills/moai-lang-csharp/modules/cqrs-validation.md +626 -0
  217. moai_adk/templates/.claude/skills/moai-lang-csharp/modules/csharp12-features.md +580 -0
  218. moai_adk/templates/.claude/skills/moai-lang-csharp/modules/efcore-patterns.md +622 -0
  219. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +403 -0
  220. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +65 -542
  221. moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +1171 -0
  222. moai_adk/templates/.claude/skills/moai-lang-elixir/modules/advanced-patterns.md +531 -0
  223. moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +889 -0
  224. moai_adk/templates/.claude/skills/moai-lang-flutter/SKILL.md +32 -405
  225. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +114 -293
  226. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +83 -307
  227. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +179 -0
  228. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +973 -0
  229. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +1543 -0
  230. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +42 -279
  231. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +94 -556
  232. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +1608 -0
  233. moai_adk/templates/.claude/skills/moai-lang-php/modules/advanced-patterns.md +538 -0
  234. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +1323 -0
  235. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +108 -358
  236. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +84 -482
  237. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +1154 -0
  238. moai_adk/templates/.claude/skills/moai-lang-r/modules/advanced-patterns.md +489 -0
  239. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +1087 -0
  240. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +106 -610
  241. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +1106 -0
  242. moai_adk/templates/.claude/skills/moai-lang-ruby/modules/advanced-patterns.md +309 -0
  243. moai_adk/templates/.claude/skills/moai-lang-ruby/modules/testing-patterns.md +306 -0
  244. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +1024 -0
  245. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +51 -265
  246. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +106 -442
  247. moai_adk/templates/.claude/skills/moai-lang-scala/modules/akka-actors.md +479 -0
  248. moai_adk/templates/.claude/skills/moai-lang-scala/modules/cats-effect.md +489 -0
  249. moai_adk/templates/.claude/skills/moai-lang-scala/modules/functional-programming.md +460 -0
  250. moai_adk/templates/.claude/skills/moai-lang-scala/modules/spark-data.md +498 -0
  251. moai_adk/templates/.claude/skills/moai-lang-scala/modules/zio-patterns.md +541 -0
  252. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +88 -457
  253. moai_adk/templates/.claude/skills/moai-lang-swift/modules/combine-reactive.md +256 -0
  254. moai_adk/templates/.claude/skills/moai-lang-swift/modules/concurrency.md +270 -0
  255. moai_adk/templates/.claude/skills/moai-lang-swift/modules/swift6-features.md +265 -0
  256. moai_adk/templates/.claude/skills/moai-lang-swift/modules/swiftui-patterns.md +314 -0
  257. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +75 -283
  258. moai_adk/templates/.claude/skills/moai-library-mermaid/SKILL.md +97 -252
  259. moai_adk/templates/.claude/skills/moai-library-nextra/SKILL.md +64 -240
  260. moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-patterns.md +331 -12
  261. moai_adk/templates/.claude/skills/moai-library-nextra/modules/configuration.md +330 -37
  262. moai_adk/templates/.claude/skills/moai-library-shadcn/SKILL.md +90 -287
  263. moai_adk/templates/.claude/skills/moai-platform-auth0/SKILL.md +200 -206
  264. moai_adk/templates/.claude/skills/moai-platform-auth0/examples.md +2446 -0
  265. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/adaptive-mfa.md +233 -0
  266. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/akamai-integration.md +214 -0
  267. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/application-credentials.md +280 -0
  268. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/attack-protection-log-events.md +224 -0
  269. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/attack-protection-overview.md +140 -0
  270. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/bot-detection.md +144 -0
  271. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/breached-password-detection.md +187 -0
  272. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/brute-force-protection.md +189 -0
  273. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/certifications.md +282 -0
  274. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/compliance-overview.md +263 -0
  275. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/continuous-session-protection.md +307 -0
  276. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/customize-mfa.md +177 -0
  277. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/dpop-implementation.md +283 -0
  278. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/fapi-implementation.md +259 -0
  279. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/gdpr-compliance.md +313 -0
  280. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/guardian-configuration.md +269 -0
  281. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/highly-regulated-identity.md +272 -0
  282. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/jwt-fundamentals.md +248 -0
  283. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/mdl-verification.md +210 -0
  284. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/mfa-api-management.md +278 -0
  285. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/mfa-factors.md +226 -0
  286. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/mfa-overview.md +174 -0
  287. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/mtls-sender-constraining.md +316 -0
  288. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/ropg-flow-mfa.md +216 -0
  289. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/security-center.md +325 -0
  290. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/security-guidance.md +277 -0
  291. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/state-parameters.md +177 -0
  292. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/step-up-authentication.md +251 -0
  293. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/suspicious-ip-throttling.md +240 -0
  294. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/tenant-access-control.md +179 -0
  295. moai_adk/templates/.claude/skills/moai-platform-auth0/modules/webauthn-fido.md +235 -0
  296. moai_adk/templates/.claude/skills/moai-platform-auth0/reference.md +224 -0
  297. moai_adk/templates/.claude/skills/moai-platform-clerk/SKILL.md +75 -330
  298. moai_adk/templates/.claude/skills/moai-platform-clerk/examples.md +1426 -0
  299. moai_adk/templates/.claude/skills/moai-platform-clerk/modules/advanced-patterns.md +417 -0
  300. moai_adk/templates/.claude/skills/moai-platform-clerk/reference.md +273 -0
  301. moai_adk/templates/.claude/skills/moai-platform-convex/SKILL.md +100 -340
  302. moai_adk/templates/.claude/skills/moai-platform-convex/examples.md +506 -0
  303. moai_adk/templates/.claude/skills/moai-platform-convex/modules/auth-integration.md +421 -0
  304. moai_adk/templates/.claude/skills/moai-platform-convex/modules/file-storage.md +474 -0
  305. moai_adk/templates/.claude/skills/moai-platform-convex/modules/reactive-queries.md +302 -0
  306. moai_adk/templates/.claude/skills/moai-platform-convex/modules/server-functions.md +452 -0
  307. moai_adk/templates/.claude/skills/moai-platform-convex/reference.md +385 -0
  308. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/SKILL.md +113 -326
  309. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/examples.md +514 -0
  310. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/modules/custom-claims.md +374 -0
  311. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/modules/phone-auth.md +372 -0
  312. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/modules/social-auth.md +339 -0
  313. moai_adk/templates/.claude/skills/moai-platform-firebase-auth/reference.md +382 -0
  314. moai_adk/templates/.claude/skills/moai-platform-firestore/SKILL.md +71 -302
  315. moai_adk/templates/.claude/skills/moai-platform-firestore/examples.md +445 -0
  316. moai_adk/templates/.claude/skills/moai-platform-firestore/modules/offline-cache.md +392 -0
  317. moai_adk/templates/.claude/skills/moai-platform-firestore/modules/realtime-listeners.md +441 -0
  318. moai_adk/templates/.claude/skills/moai-platform-firestore/modules/security-rules.md +352 -0
  319. moai_adk/templates/.claude/skills/moai-platform-firestore/modules/transactions.md +452 -0
  320. moai_adk/templates/.claude/skills/moai-platform-firestore/reference.md +322 -0
  321. moai_adk/templates/.claude/skills/moai-platform-neon/SKILL.md +101 -412
  322. moai_adk/templates/.claude/skills/moai-platform-neon/examples.md +470 -0
  323. moai_adk/templates/.claude/skills/moai-platform-neon/modules/auto-scaling.md +349 -0
  324. moai_adk/templates/.claude/skills/moai-platform-neon/modules/branching-workflows.md +354 -0
  325. moai_adk/templates/.claude/skills/moai-platform-neon/modules/connection-pooling.md +412 -0
  326. moai_adk/templates/.claude/skills/moai-platform-neon/modules/pitr-backups.md +458 -0
  327. moai_adk/templates/.claude/skills/moai-platform-neon/reference.md +272 -0
  328. moai_adk/templates/.claude/skills/moai-platform-railway/SKILL.md +96 -327
  329. moai_adk/templates/.claude/skills/moai-platform-railway/examples.md +539 -0
  330. moai_adk/templates/.claude/skills/moai-platform-railway/modules/docker-deployment.md +261 -0
  331. moai_adk/templates/.claude/skills/moai-platform-railway/modules/multi-service.md +291 -0
  332. moai_adk/templates/.claude/skills/moai-platform-railway/modules/networking-domains.md +338 -0
  333. moai_adk/templates/.claude/skills/moai-platform-railway/modules/volumes-storage.md +353 -0
  334. moai_adk/templates/.claude/skills/moai-platform-railway/reference.md +374 -0
  335. moai_adk/templates/.claude/skills/moai-platform-supabase/SKILL.md +103 -428
  336. moai_adk/templates/.claude/skills/moai-platform-supabase/examples.md +502 -0
  337. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/auth-integration.md +384 -0
  338. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/edge-functions.md +371 -0
  339. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/postgresql-pgvector.md +231 -0
  340. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/realtime-presence.md +354 -0
  341. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/row-level-security.md +286 -0
  342. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/storage-cdn.md +319 -0
  343. moai_adk/templates/.claude/skills/moai-platform-supabase/modules/typescript-patterns.md +453 -0
  344. moai_adk/templates/.claude/skills/moai-platform-supabase/reference.md +284 -0
  345. moai_adk/templates/.claude/skills/moai-platform-vercel/SKILL.md +96 -446
  346. moai_adk/templates/.claude/skills/moai-platform-vercel/examples.md +502 -0
  347. moai_adk/templates/.claude/skills/moai-platform-vercel/modules/analytics-speed.md +348 -0
  348. moai_adk/templates/.claude/skills/moai-platform-vercel/modules/deployment-config.md +344 -0
  349. moai_adk/templates/.claude/skills/moai-platform-vercel/modules/edge-functions.md +222 -0
  350. moai_adk/templates/.claude/skills/moai-platform-vercel/modules/isr-caching.md +306 -0
  351. moai_adk/templates/.claude/skills/moai-platform-vercel/modules/kv-storage.md +399 -0
  352. moai_adk/templates/.claude/skills/moai-platform-vercel/reference.md +360 -0
  353. moai_adk/templates/.claude/skills/moai-tool-ast-grep/SKILL.md +193 -0
  354. moai_adk/templates/.claude/skills/moai-tool-ast-grep/examples.md +1099 -0
  355. moai_adk/templates/.claude/skills/moai-tool-ast-grep/modules/language-specific.md +307 -0
  356. moai_adk/templates/.claude/skills/moai-tool-ast-grep/modules/pattern-syntax.md +237 -0
  357. moai_adk/templates/.claude/skills/moai-tool-ast-grep/modules/refactoring-patterns.md +260 -0
  358. moai_adk/templates/.claude/skills/moai-tool-ast-grep/modules/security-rules.md +239 -0
  359. moai_adk/templates/.claude/skills/moai-tool-ast-grep/reference.md +288 -0
  360. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/languages/go.yml +90 -0
  361. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/languages/python.yml +101 -0
  362. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/languages/typescript.yml +83 -0
  363. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/quality/complexity-check.yml +94 -0
  364. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/quality/deprecated-apis.yml +84 -0
  365. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/security/secrets-detection.yml +89 -0
  366. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/security/sql-injection.yml +45 -0
  367. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/security/xss-prevention.yml +50 -0
  368. moai_adk/templates/.claude/skills/moai-tool-ast-grep/rules/sgconfig.yml +54 -0
  369. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/SKILL.md +225 -423
  370. moai_adk/templates/.claude/skills/moai-workflow-loop/SKILL.md +197 -0
  371. moai_adk/templates/.claude/skills/moai-workflow-loop/examples.md +1063 -0
  372. moai_adk/templates/.claude/skills/moai-workflow-loop/reference.md +1414 -0
  373. moai_adk/templates/.claude/skills/moai-workflow-project/SKILL.md +211 -314
  374. moai_adk/templates/.claude/skills/moai-workflow-project/schemas/tab_schema.json +15 -43
  375. moai_adk/templates/.claude/skills/moai-workflow-spec/SKILL.md +119 -316
  376. moai_adk/templates/.claude/skills/moai-workflow-spec/modules/advanced-patterns.md +237 -0
  377. moai_adk/templates/.claude/skills/moai-workflow-templates/SKILL.md +96 -203
  378. moai_adk/templates/.claude/skills/moai-workflow-testing/SKILL.md +201 -388
  379. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/README.md +52 -3
  380. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/ai-debugging.md +263 -806
  381. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/context7-integration.md +286 -0
  382. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/review-workflows.md +500 -0
  383. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/relevance-analysis.md +154 -0
  384. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/safety-analysis.md +148 -0
  385. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/scoring-algorithms.md +196 -0
  386. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/timeliness-analysis.md +168 -0
  387. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/truthfulness-analysis.md +136 -0
  388. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework/usability-analysis.md +153 -0
  389. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review/trust5-framework.md +257 -0
  390. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review.md +191 -1344
  391. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/code-review/analysis-patterns.md +340 -0
  392. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/code-review/core-classes.md +299 -0
  393. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/code-review/tool-integration.md +380 -0
  394. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/debugging/debugging-workflows.md +451 -0
  395. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/debugging/error-analysis.md +442 -0
  396. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance/optimization-patterns.md +473 -0
  397. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance/profiling-techniques.md +481 -0
  398. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization/ai-optimization.md +241 -0
  399. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization/bottleneck-detection.md +397 -0
  400. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization/optimization-plan.md +315 -0
  401. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization/profiler-core.md +277 -0
  402. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization/real-time-monitoring.md +187 -0
  403. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization.md +287 -1194
  404. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/quality-metrics.md +415 -0
  405. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/refactoring/ai-workflows.md +620 -0
  406. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/refactoring/patterns.md +692 -0
  407. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/security-analysis.md +429 -0
  408. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/smart-refactoring.md +262 -1192
  409. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/static-analysis.md +438 -0
  410. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd/core-classes.md +397 -0
  411. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7/advanced-features.md +494 -0
  412. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7/red-green-refactor.md +316 -0
  413. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7/test-generation.md +471 -0
  414. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7/test-patterns.md +371 -0
  415. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7.md +227 -1222
  416. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/trust5-validation.md +428 -0
  417. moai_adk/templates/.claude/skills/moai-workflow-worktree/SKILL.md +228 -0
  418. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/integration-patterns.md +149 -0
  419. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/moai-adk-integration.md +245 -0
  420. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/parallel-advanced.md +310 -0
  421. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/parallel-development.md +202 -0
  422. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/parallel-workflows.md +302 -0
  423. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/registry-architecture.md +271 -0
  424. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/resource-optimization.md +300 -0
  425. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/tools-integration.md +280 -0
  426. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/troubleshooting.md +397 -0
  427. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/worktree-commands.md +296 -0
  428. moai_adk/templates/.claude/skills/moai-workflow-worktree/modules/worktree-management.md +217 -0
  429. moai_adk/templates/.git-hooks/pre-push +162 -59
  430. moai_adk/templates/.github/workflows/ci-universal.yml +934 -133
  431. moai_adk/templates/.gitignore +65 -107
  432. moai_adk/templates/.lsp.json +152 -0
  433. moai_adk/templates/.mcp.json +2 -20
  434. moai_adk/templates/.moai/announcements/en.json +18 -0
  435. moai_adk/templates/.moai/announcements/ja.json +18 -0
  436. moai_adk/templates/.moai/announcements/ko.json +18 -0
  437. moai_adk/templates/.moai/announcements/zh.json +18 -0
  438. moai_adk/templates/.moai/config/config.yaml +8 -2
  439. moai_adk/templates/.moai/config/multilingual-triggers.yaml +213 -0
  440. moai_adk/templates/.moai/config/sections/language.yaml +2 -2
  441. moai_adk/templates/.moai/config/sections/llm.yaml +41 -0
  442. moai_adk/templates/.moai/config/sections/pricing.yaml +30 -0
  443. moai_adk/templates/.moai/config/sections/project.yaml +2 -2
  444. moai_adk/templates/.moai/config/sections/quality.yaml +43 -5
  445. moai_adk/templates/.moai/config/sections/ralph.yaml +55 -0
  446. moai_adk/templates/.moai/config/sections/system.yaml +46 -1
  447. moai_adk/templates/.moai/config/sections/user.yaml +1 -1
  448. moai_adk/templates/.moai/config/statusline-config.yaml +2 -2
  449. moai_adk/templates/.moai/llm-configs/glm.json +22 -0
  450. moai_adk/templates/CLAUDE.ja.md +343 -0
  451. moai_adk/templates/CLAUDE.ko.md +343 -0
  452. moai_adk/templates/CLAUDE.md +200 -499
  453. moai_adk/templates/CLAUDE.zh.md +343 -0
  454. moai_adk/utils/common.py +37 -0
  455. moai_adk/version.py +1 -1
  456. moai_adk-1.1.0.dist-info/METADATA +2443 -0
  457. moai_adk-1.1.0.dist-info/RECORD +701 -0
  458. {moai_adk-0.34.0.dist-info → moai_adk-1.1.0.dist-info}/entry_points.txt +2 -0
  459. moai_adk-1.1.0.dist-info/licenses/LICENSE +99 -0
  460. moai_adk/core/config/auto_spec_config.py +0 -340
  461. moai_adk/core/hooks/post_tool_auto_spec_completion.py +0 -901
  462. moai_adk/core/spec/confidence_scoring.py +0 -680
  463. moai_adk/core/spec/ears_template_engine.py +0 -1247
  464. moai_adk/core/spec/quality_validator.py +0 -687
  465. moai_adk/templates/.claude/agents/moai/ai-nano-banana.md +0 -670
  466. moai_adk/templates/.claude/agents/moai/expert-database.md +0 -777
  467. moai_adk/templates/.claude/agents/moai/expert-uiux.md +0 -1041
  468. moai_adk/templates/.claude/agents/moai/mcp-context7.md +0 -458
  469. moai_adk/templates/.claude/agents/moai/mcp-figma.md +0 -1607
  470. moai_adk/templates/.claude/agents/moai/mcp-notion.md +0 -789
  471. moai_adk/templates/.claude/agents/moai/mcp-playwright.md +0 -469
  472. moai_adk/templates/.claude/agents/moai/mcp-sequential-thinking.md +0 -1032
  473. moai_adk/templates/.claude/skills/moai-ai-nano-banana/SKILL.md +0 -438
  474. moai_adk/templates/.claude/skills/moai-ai-nano-banana/examples.md +0 -431
  475. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/design-system-tokens.md +0 -405
  476. moai_adk/templates/.claude/skills/moai-library-nextra/advanced-patterns.md +0 -336
  477. moai_adk/templates/.claude/skills/moai-mcp-figma/SKILL.md +0 -402
  478. moai_adk/templates/.claude/skills/moai-mcp-figma/advanced-patterns.md +0 -607
  479. moai_adk/templates/.claude/skills/moai-mcp-notion/SKILL.md +0 -300
  480. moai_adk/templates/.claude/skills/moai-mcp-notion/advanced-patterns.md +0 -537
  481. moai_adk/templates/.claude/skills/moai-workflow-project/__init__.py +0 -520
  482. moai_adk/templates/.claude/skills/moai-workflow-project/complete_workflow_demo_fixed.py +0 -574
  483. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_project_setup.py +0 -317
  484. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_workflow_demo.py +0 -663
  485. moai_adk/templates/.claude/skills/moai-workflow-project/examples/config-migration-example.json +0 -190
  486. moai_adk/templates/.claude/skills/moai-workflow-project/examples/question-examples.json +0 -175
  487. moai_adk/templates/.claude/skills/moai-workflow-project/examples/quick_start.py +0 -196
  488. moai_adk/templates/.claude/skills/moai-workflow-project/modules/__init__.py +0 -17
  489. moai_adk/templates/.claude/skills/moai-workflow-project/modules/advanced-patterns.md +0 -158
  490. moai_adk/templates/.claude/skills/moai-workflow-project/modules/ask_user_integration.py +0 -340
  491. moai_adk/templates/.claude/skills/moai-workflow-project/modules/batch_questions.py +0 -713
  492. moai_adk/templates/.claude/skills/moai-workflow-project/modules/config_manager.py +0 -538
  493. moai_adk/templates/.claude/skills/moai-workflow-project/modules/documentation_manager.py +0 -1336
  494. moai_adk/templates/.claude/skills/moai-workflow-project/modules/language_initializer.py +0 -730
  495. moai_adk/templates/.claude/skills/moai-workflow-project/modules/migration_manager.py +0 -608
  496. moai_adk/templates/.claude/skills/moai-workflow-project/modules/template_optimizer.py +0 -1005
  497. moai_adk/templates/.claude/skills/moai-workflow-project/test_integration_simple.py +0 -436
  498. moai_adk/templates/.claude/skills/moai-worktree/SKILL.md +0 -411
  499. moai_adk/templates/.claude/skills/moai-worktree/modules/integration-patterns.md +0 -982
  500. moai_adk/templates/.claude/skills/moai-worktree/modules/parallel-development.md +0 -778
  501. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-commands.md +0 -646
  502. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-management.md +0 -782
  503. moai_adk/templates/.moai/config/questions/_schema.yaml +0 -151
  504. moai_adk/templates/.moai/config/questions/tab0-init.yaml +0 -251
  505. moai_adk/templates/.moai/config/questions/tab1-user.yaml +0 -108
  506. moai_adk/templates/.moai/config/questions/tab2-project.yaml +0 -81
  507. moai_adk/templates/.moai/config/questions/tab3-git.yaml +0 -634
  508. moai_adk/templates/.moai/config/questions/tab4-quality.yaml +0 -170
  509. moai_adk/templates/.moai/config/questions/tab5-system.yaml +0 -87
  510. moai_adk/templates/.moai/scripts/setup-glm.py +0 -136
  511. moai_adk-0.34.0.dist-info/METADATA +0 -2999
  512. moai_adk-0.34.0.dist-info/RECORD +0 -463
  513. moai_adk-0.34.0.dist-info/licenses/LICENSE +0 -21
  514. /moai_adk/foundation/{git.py → git/__init__.py} +0 -0
  515. /moai_adk/templates/.claude/skills/moai-library-mermaid/{advanced-patterns.md → modules/advanced-patterns.md} +0 -0
  516. /moai_adk/templates/.claude/skills/moai-library-mermaid/{optimization.md → modules/optimization.md} +0 -0
  517. /moai_adk/templates/.claude/skills/moai-library-nextra/{optimization.md → modules/optimization.md} +0 -0
  518. /moai_adk/templates/.claude/skills/moai-workflow-jit-docs/{advanced-patterns.md → modules/advanced-patterns.md} +0 -0
  519. /moai_adk/templates/.claude/skills/moai-workflow-jit-docs/{optimization.md → modules/optimization.md} +0 -0
  520. /moai_adk/templates/.claude/skills/moai-workflow-testing/{advanced-patterns.md → modules/advanced-patterns.md} +0 -0
  521. /moai_adk/templates/.claude/skills/moai-workflow-testing/{optimization.md → modules/optimization.md} +0 -0
  522. /moai_adk/templates/.claude/skills/{moai-worktree → moai-workflow-worktree}/examples.md +0 -0
  523. /moai_adk/templates/.claude/skills/{moai-worktree → moai-workflow-worktree}/reference.md +0 -0
  524. {moai_adk-0.34.0.dist-info → moai_adk-1.1.0.dist-info}/WHEEL +0 -0
@@ -5,841 +5,298 @@
5
5
  > Time: 20+ minutes
6
6
  > Dependencies: Python 3.8+, Context7 MCP, asyncio, traceback, dataclasses
7
7
 
8
- ## Core Implementation
8
+ ## Overview
9
9
 
10
- ### AIDebugger Class
10
+ AI-powered debugging system that combines intelligent error classification, Context7 documentation integration, and pattern recognition to provide comprehensive error analysis and solution generation.
11
+
12
+ ### Core Capabilities
13
+
14
+ Error Classification: AI-enhanced error categorization with context-aware type mapping and severity assessment
15
+
16
+ Context7 Integration: Automatic retrieval of latest debugging patterns and best practices from official documentation
17
+
18
+ Pattern Matching: Comprehensive regex-based error pattern recognition with confidence scoring
19
+
20
+ Solution Generation: Multi-source solution generation from patterns, Context7, and AI-generated fixes
21
+
22
+ Learning System: Self-improving debugger that learns from successful fixes over time
23
+
24
+ ### Key Features
25
+
26
+ Intelligent Classification: Multi-heuristic error classification using type mapping, message analysis, and context awareness
27
+
28
+ Comprehensive Solutions: Pattern-based, Context7-sourced, and AI-generated solutions with confidence scoring
29
+
30
+ Prevention Strategies: Type-specific prevention strategies and related error detection for proactive debugging
31
+
32
+ Performance Monitoring: Built-in statistics tracking, error frequency analysis, and cache optimization
33
+
34
+ ---
35
+
36
+ ## Quick Reference
37
+
38
+ ### Error Type Classification
39
+
40
+ System supports comprehensive error type categorization:
41
+
42
+ - Syntax Errors: SYNTAX - Syntax and indentation issues
43
+ - Import Errors: IMPORT - Module import and dependency issues
44
+ - Runtime Errors: RUNTIME - General runtime exceptions
45
+ - Type Errors: TYPE_ERROR - Data type mismatches
46
+ - Value Errors: VALUE_ERROR - Invalid value conversions
47
+ - Attribute Errors: ATTRIBUTE_ERROR - Object attribute access issues
48
+ - Key Errors: KEY_ERROR - Dictionary key access issues
49
+ - Network Errors: NETWORK - Connection and timeout issues
50
+ - Database Errors: DATABASE - SQL and database operation issues
51
+ - Memory Errors: MEMORY - Memory allocation and heap issues
52
+ - Concurrency Errors: CONCURRENCY - Thread and locking issues
53
+ - Unknown Errors: UNKNOWN - Uncategorized or novel errors
54
+
55
+ ### Data Structures
56
+
57
+ Core data classes for error analysis:
11
58
 
12
59
  ```python
13
- import asyncio
14
- import traceback
15
- from typing import Dict, List, Optional, Any, Union
16
60
  from dataclasses import dataclass
17
61
  from enum import Enum
18
62
 
19
63
  class ErrorType(Enum):
20
- """Classification of error types for intelligent handling."""
21
- SYNTAX = "syntax_error"
22
- RUNTIME = "runtime_error"
23
- IMPORT = "import_error"
24
- TYPE_ERROR = "type_error"
25
- VALUE_ERROR = "value_error"
26
- ATTRIBUTE_ERROR = "attribute_error"
27
- KEY_ERROR = "key_error"
28
- NETWORK = "network_error"
29
- DATABASE = "database_error"
30
- MEMORY = "memory_error"
31
- CONCURRENCY = "concurrency_error"
32
- UNKNOWN = "unknown_error"
64
+ """Classification of error types for intelligent handling."""
65
+ SYNTAX = "syntax_error"
66
+ RUNTIME = "runtime_error"
67
+ IMPORT = "import_error"
68
+ TYPE_ERROR = "type_error"
69
+ VALUE_ERROR = "value_error"
70
+ ATTRIBUTE_ERROR = "attribute_error"
71
+ KEY_ERROR = "key_error"
72
+ NETWORK = "network_error"
73
+ DATABASE = "database_error"
74
+ MEMORY = "memory_error"
75
+ CONCURRENCY = "concurrency_error"
76
+ UNKNOWN = "unknown_error"
33
77
 
34
78
  @dataclass
35
79
  class ErrorAnalysis:
36
- """Analysis of an error with classification and metadata."""
37
- type: ErrorType
38
- confidence: float
39
- message: str
40
- traceback: str
41
- context: Dict[str, Any]
42
- frequency: int
43
- severity: str # "low", "medium", "high", "critical"
44
- likely_causes: List[str]
45
- suggested_fixes: List[str]
80
+ """Analysis of an error with classification and metadata."""
81
+ type: ErrorType
82
+ confidence: float
83
+ message: str
84
+ traceback: str
85
+ context: Dict[str, Any]
86
+ frequency: int
87
+ severity: str # "low", "medium", "high", "critical"
88
+ likely_causes: List[str]
89
+ suggested_fixes: List[str]
46
90
 
47
91
  @dataclass
48
92
  class Solution:
49
- """Proposed solution for an error."""
50
- type: str # "context7_pattern", "ai_generated", "known_fix"
51
- description: str
52
- code_example: str
53
- confidence: float
54
- impact: str # "low", "medium", "high"
55
- dependencies: List[str]
93
+ """Proposed solution for an error."""
94
+ type: str # "context7_pattern", "ai_generated", "known_fix"
95
+ description: str
96
+ code_example: str
97
+ confidence: float
98
+ impact: str # "low", "medium", "high"
99
+ dependencies: List[str]
56
100
 
57
101
  @dataclass
58
102
  class DebugAnalysis:
59
- """Complete debug analysis with solutions and prevention strategies."""
60
- error_type: ErrorType
61
- confidence: float
62
- context7_patterns: Dict[str, Any]
63
- solutions: List[Solution]
64
- prevention_strategies: List[str]
65
- related_errors: List[str]
66
- estimated_fix_time: str
67
-
68
- class AIDebugger:
69
- """AI-powered debugging with Context7 integration."""
70
-
71
- def __init__(self, context7_client=None):
72
- self.context7 = context7_client
73
- self.error_patterns = self._load_error_patterns()
74
- self.error_history = {}
75
- self.pattern_cache = {}
76
-
77
- def _load_error_patterns(self) -> Dict[str, Any]:
78
- """Load comprehensive error patterns database."""
79
- return {
80
- 'ImportError': {
81
- 'patterns': [
82
- r"No module named '(.+)'",
83
- r"cannot import name '(.+)' from '(.+)'",
84
- r"circular import"
85
- ],
86
- 'solutions': [
87
- 'Install missing package',
88
- 'Check import path',
89
- 'Resolve circular dependencies'
90
- ],
91
- 'context7_topics': [
92
- 'python import system best practices',
93
- 'module resolution troubleshooting',
94
- 'dependency management'
95
- ]
96
- },
97
- 'AttributeError': {
98
- 'patterns': [
99
- r"'(.+)' object has no attribute '(.+)'",
100
- r"module '(.+)' has no attribute '(.+)'"
101
- ],
102
- 'solutions': [
103
- 'Check object type and available attributes',
104
- 'Verify module import',
105
- 'Add missing attribute or method'
106
- ],
107
- 'context7_topics': [
108
- 'python attribute access patterns',
109
- 'object-oriented debugging',
110
- 'introspection techniques'
111
- ]
112
- },
113
- 'TypeError': {
114
- 'patterns': [
115
- r" unsupported operand type\(s\) for",
116
- r" takes \d+ positional arguments but \d+ were given",
117
- r" must be str, not .+"
118
- ],
119
- 'solutions': [
120
- 'Check data types before operations',
121
- 'Verify function signatures',
122
- 'Add type validation'
123
- ],
124
- 'context7_topics': [
125
- 'python type system debugging',
126
- 'function signature validation',
127
- 'type checking best practices'
128
- ]
129
- },
130
- 'ValueError': {
131
- 'patterns': [
132
- r"invalid literal for int\(\) with base 10",
133
- r"cannot convert",
134
- r"empty set"
135
- ],
136
- 'solutions': [
137
- 'Validate input data format',
138
- 'Add error handling for conversions',
139
- 'Check value ranges'
140
- ],
141
- 'context7_topics': [
142
- 'input validation patterns',
143
- 'data conversion error handling',
144
- 'value range checking'
145
- ]
146
- }
147
- }
148
-
149
- async def debug_with_context7_patterns(
150
- self, error: Exception, context: Dict, codebase_path: str
151
- ) -> DebugAnalysis:
152
- """Debug using AI pattern recognition and Context7 best practices."""
153
-
154
- # Classify error with high accuracy
155
- error_analysis = await self._classify_error_with_ai(error, context)
156
-
157
- # Get Context7 patterns if available
158
- context7_patterns = {}
159
- if self.context7:
160
- context7_patterns = await self._get_context7_patterns(error_analysis)
161
-
162
- # Match against known patterns
163
- pattern_matches = self._match_error_patterns(error, error_analysis)
164
-
165
- # Generate comprehensive solutions
166
- solutions = await self._generate_solutions(
167
- error_analysis, context7_patterns, pattern_matches, context
168
- )
169
-
170
- # Suggest prevention strategies
171
- prevention = self._suggest_prevention_strategies(error_analysis, context)
172
-
173
- # Estimate fix time based on complexity
174
- fix_time = self._estimate_fix_time(error_analysis, solutions)
175
-
176
- return DebugAnalysis(
177
- error_type=error_analysis.type,
178
- confidence=error_analysis.confidence,
179
- context7_patterns=context7_patterns,
180
- solutions=solutions,
181
- prevention_strategies=prevention,
182
- related_errors=self._find_related_errors(error_analysis),
183
- estimated_fix_time=fix_time
184
- )
185
-
186
- async def _classify_error_with_ai(
187
- self, error: Exception, context: Dict
188
- ) -> ErrorAnalysis:
189
- """Classify error using AI-enhanced pattern recognition."""
190
-
191
- error_type_name = type(error).__name__
192
- error_message = str(error)
193
- error_traceback = traceback.format_exc()
194
-
195
- # Enhanced classification with context awareness
196
- classification = self._classify_by_type_and_message(
197
- error_type_name, error_message, context
198
- )
199
-
200
- # Analyze frequency and severity
201
- error_key = f"{error_type_name}:{error_message[:50]}"
202
- frequency = self.error_history.get(error_key, 0) + 1
203
- self.error_history[error_key] = frequency
204
-
205
- severity = self._assess_severity(error, context, frequency)
206
-
207
- # Generate likely causes based on analysis
208
- likely_causes = self._analyze_likely_causes(
209
- error_type_name, error_message, context
210
- )
211
-
212
- # Generate initial suggested fixes
213
- suggested_fixes = self._generate_quick_fixes(
214
- classification, error_message, context
215
- )
216
-
217
- return ErrorAnalysis(
218
- type=classification,
219
- confidence=self._calculate_confidence(classification, error_message),
220
- message=error_message,
221
- traceback=error_traceback,
222
- context=context,
223
- frequency=frequency,
224
- severity=severity,
225
- likely_causes=likely_causes,
226
- suggested_fixes=suggested_fixes
227
- )
228
-
229
- def _classify_by_type_and_message(
230
- self, error_type: str, message: str, context: Dict
231
- ) -> ErrorType:
232
- """Enhanced error classification using multiple heuristics."""
233
-
234
- # Direct type mapping
235
- type_mapping = {
236
- 'ImportError': ErrorType.IMPORT,
237
- 'ModuleNotFoundError': ErrorType.IMPORT,
238
- 'AttributeError': ErrorType.ATTRIBUTE_ERROR,
239
- 'KeyError': ErrorType.KEY_ERROR,
240
- 'TypeError': ErrorType.TYPE_ERROR,
241
- 'ValueError': ErrorType.VALUE_ERROR,
242
- 'SyntaxError': ErrorType.SYNTAX,
243
- 'IndentationError': ErrorType.SYNTAX,
244
- }
245
-
246
- if error_type in type_mapping:
247
- return type_mapping[error_type]
248
-
249
- # Message-based classification
250
- message_lower = message.lower()
251
-
252
- if any(keyword in message_lower for keyword in [
253
- 'connection', 'timeout', 'network', 'http', 'socket'
254
- ]):
255
- return ErrorType.NETWORK
256
-
257
- if any(keyword in message_lower for keyword in [
258
- 'database', 'sql', 'query', 'connection', 'cursor'
259
- ]):
260
- return ErrorType.DATABASE
261
-
262
- if any(keyword in message_lower for keyword in [
263
- 'memory', 'out of memory', 'allocation', 'heap'
264
- ]):
265
- return ErrorType.MEMORY
266
-
267
- if any(keyword in message_lower for keyword in [
268
- 'thread', 'lock', 'race condition', 'concurrent'
269
- ]):
270
- return ErrorType.CONCURRENCY
271
-
272
- # Context-based classification
273
- if context.get('operation_type') == 'database':
274
- return ErrorType.DATABASE
275
- elif context.get('operation_type') == 'network':
276
- return ErrorType.NETWORK
277
-
278
- return ErrorType.UNKNOWN
279
-
280
- async def _get_context7_patterns(
281
- self, error_analysis: ErrorAnalysis
282
- ) -> Dict[str, Any]:
283
- """Get latest debugging patterns from Context7."""
284
-
285
- cache_key = f"{error_analysis.type.value}_{error_analysis.message[:30]}"
286
- if cache_key in self.pattern_cache:
287
- return self.pattern_cache[cache_key]
288
-
289
- # Determine appropriate Context7 libraries based on error type
290
- context7_queries = self._build_context7_queries(error_analysis)
291
-
292
- patterns = {}
293
- if self.context7:
294
- for library_id, topic in context7_queries:
295
- try:
296
- result = await self.context7.get_library_docs(
297
- context7_library_id=library_id,
298
- topic=topic,
299
- tokens=4000
300
- )
301
- patterns[library_id] = result
302
- except Exception as e:
303
- print(f"Context7 query failed for {library_id}: {e}")
304
-
305
- # Cache results
306
- self.pattern_cache[cache_key] = patterns
307
- return patterns
308
-
309
- def _build_context7_queries(self, error_analysis: ErrorAnalysis) -> List[tuple]:
310
- """Build Context7 queries based on error analysis."""
311
-
312
- queries = []
313
-
314
- # Base debugging library
315
- queries.append(("/microsoft/debugpy",
316
- f"AI debugging patterns {error_analysis.type.value} error analysis 2025"))
317
-
318
- # Language-specific libraries
319
- if error_analysis.context.get('language') == 'python':
320
- queries.append(("/python/cpython",
321
- f"{error_analysis.type.value} debugging best practices"))
322
-
323
- # Framework-specific queries
324
- framework = error_analysis.context.get('framework')
325
- if framework:
326
- queries.append((f"/{framework}/{framework}",
327
- f"{framework} {error_analysis.type.value} troubleshooting"))
328
-
329
- return queries
330
-
331
- def _match_error_patterns(
332
- self, error: Exception, error_analysis: ErrorAnalysis
333
- ) -> Dict[str, Any]:
334
- """Match error against known patterns."""
335
-
336
- error_type = type(error).__name__
337
- error_message = str(error)
338
-
339
- if error_type in self.error_patterns:
340
- pattern_data = self.error_patterns[error_type]
341
-
342
- # Try to match regex patterns
343
- import re
344
- matched_patterns = []
345
- for pattern in pattern_data['patterns']:
346
- if re.search(pattern, error_message, re.IGNORECASE):
347
- matched_patterns.append(pattern)
348
-
349
- return {
350
- 'matched_patterns': matched_patterns,
351
- 'solutions': pattern_data['solutions'],
352
- 'context7_topics': pattern_data['context7_topics']
353
- }
354
-
355
- return {'matched_patterns': [], 'solutions': [], 'context7_topics': []}
356
-
357
- async def _generate_solutions(
358
- self, error_analysis: ErrorAnalysis,
359
- context7_patterns: Dict, pattern_matches: Dict,
360
- context: Dict
361
- ) -> List[Solution]:
362
- """Generate comprehensive solutions using multiple sources."""
363
-
364
- solutions = []
365
-
366
- # Pattern-based solutions
367
- for pattern in pattern_matches.get('matched_patterns', []):
368
- solution = Solution(
369
- type='pattern_match',
370
- description=f"Apply known pattern: {pattern}",
371
- code_example=self._generate_pattern_example(pattern, context),
372
- confidence=0.85,
373
- impact='medium',
374
- dependencies=[]
375
- )
376
- solutions.append(solution)
377
-
378
- # Context7-based solutions
379
- for library_id, docs in context7_patterns.items():
380
- if docs and 'solutions' in docs:
381
- for sol in docs['solutions']:
382
- solution = Solution(
383
- type='context7_pattern',
384
- description=sol['description'],
385
- code_example=sol.get('code_example', ''),
386
- confidence=sol.get('confidence', 0.7),
387
- impact=sol.get('impact', 'medium'),
388
- dependencies=sol.get('dependencies', [])
389
- )
390
- solutions.append(solution)
391
-
392
- # AI-generated solutions
393
- if self.context7 and len(solutions) < 3: # Generate AI solutions if limited patterns found
394
- ai_solutions = await self._generate_ai_solutions(error_analysis, context)
395
- solutions.extend(ai_solutions)
396
-
397
- # Sort by confidence and impact
398
- solutions.sort(key=lambda x: (x.confidence, x.impact), reverse=True)
399
- return solutions[:5] # Return top 5 solutions
400
-
401
- async def _generate_ai_solutions(
402
- self, error_analysis: ErrorAnalysis, context: Dict
403
- ) -> List[Solution]:
404
- """Generate AI-powered solutions when patterns are insufficient."""
405
-
406
- solutions = []
407
-
408
- try:
409
- # Query for specific error solutions
410
- language = context.get('language', 'python')
411
- ai_response = await self.context7.get_library_docs(
412
- context7_library_id="/openai/chatgpt",
413
- topic=f"solve {error_analysis.type.value} in {language}: {error_analysis.message[:100]}",
414
- tokens=3000
415
- )
416
-
417
- if ai_response and 'solutions' in ai_response:
418
- for sol in ai_response['solutions']:
419
- solution = Solution(
420
- type='ai_generated',
421
- description=sol['description'],
422
- code_example=sol.get('code_example', ''),
423
- confidence=0.75,
424
- impact='medium',
425
- dependencies=sol.get('dependencies', [])
426
- )
427
- solutions.append(solution)
428
-
429
- except Exception as e:
430
- print(f"AI solution generation failed: {e}")
431
-
432
- return solutions
433
-
434
- def _generate_pattern_example(self, pattern: str, context: Dict) -> str:
435
- """Generate code example for a specific error pattern."""
436
-
437
- examples = {
438
- r"No module named '(.+)'": """
439
- # Install missing package
440
- pip install package_name
441
-
442
- # Or add to requirements.txt
443
- echo "package_name" >> requirements.txt
444
- """,
445
- r"'(.+)' object has no attribute '(.+)'": """
446
- # Check object type before accessing attribute
447
- if hasattr(obj, 'attribute_name'):
448
- result = obj.attribute_name
449
- else:
450
- print(f"Object of type {type(obj)} doesn't have attribute 'attribute_name'")
451
- """,
452
- r" takes \d+ positional arguments but \d+ were given": """
453
- # Check function signature and call with correct arguments
454
- def function_name(arg1, arg2, arg3=None):
455
- pass
456
-
457
- # Correct call
458
- function_name(value1, value2)
459
- """,
460
- r"invalid literal for int\(\) with base 10": """
461
- # Add error handling for type conversion
462
- try:
463
- number = int(value)
464
- except ValueError:
465
- print(f"Cannot convert '{value}' to integer")
466
- # Handle the error appropriately
467
- """,
468
- }
469
-
470
- for pattern_key, example in examples.items():
471
- if pattern_key in pattern:
472
- return example
473
-
474
- return f"# Implement fix for pattern: {pattern}"
475
-
476
- def _suggest_prevention_strategies(
477
- self, error_analysis: ErrorAnalysis, context: Dict
478
- ) -> List[str]:
479
- """Suggest prevention strategies based on error analysis."""
480
-
481
- strategies = []
482
-
483
- # Type-specific prevention
484
- if error_analysis.type == ErrorType.IMPORT:
485
- strategies.extend([
486
- "Add proper dependency management with requirements.txt",
487
- "Implement module availability checks before imports",
488
- "Use virtual environments for dependency isolation"
489
- ])
490
- elif error_analysis.type == ErrorType.ATTRIBUTE_ERROR:
491
- strategies.extend([
492
- "Use hasattr() checks before attribute access",
493
- "Implement proper object type checking",
494
- "Add comprehensive unit tests for object interfaces"
495
- ])
496
- elif error_analysis.type == ErrorType.TYPE_ERROR:
497
- strategies.extend([
498
- "Add type hints and static type checking with mypy",
499
- "Implement runtime type validation",
500
- "Use isinstance() checks before operations"
501
- ])
502
- elif error_analysis.type == ErrorType.VALUE_ERROR:
503
- strategies.extend([
504
- "Add input validation at function boundaries",
505
- "Implement comprehensive error handling",
506
- "Use try-except blocks for data conversion"
507
- ])
508
-
509
- # General prevention strategies
510
- strategies.extend([
511
- "Implement comprehensive logging for error tracking",
512
- "Add automated testing to catch errors early",
513
- "Use code review process to prevent common issues"
514
- ])
515
-
516
- return strategies
517
-
518
- def _find_related_errors(self, error_analysis: ErrorAnalysis) -> List[str]:
519
- """Find related errors that might occur together."""
520
-
521
- related_map = {
522
- ErrorType.IMPORT: ["ModuleNotFoundError", "ImportError", "AttributeError"],
523
- ErrorType.ATTRIBUTE_ERROR: ["TypeError", "KeyError", "ImportError"],
524
- ErrorType.TYPE_ERROR: ["ValueError", "AttributeError", "TypeError"],
525
- ErrorType.VALUE_ERROR: ["TypeError", "KeyError", "IndexError"],
526
- ErrorType.KEY_ERROR: ["AttributeError", "TypeError", "IndexError"],
527
- }
528
-
529
- return related_map.get(error_analysis.type, ["TypeError", "ValueError"])
530
-
531
- def _estimate_fix_time(
532
- self, error_analysis: ErrorAnalysis, solutions: List[Solution]
533
- ) -> str:
534
- """Estimate time required to fix the error."""
535
-
536
- base_times = {
537
- ErrorType.SYNTAX: "1-5 minutes",
538
- ErrorType.IMPORT: "2-10 minutes",
539
- ErrorType.ATTRIBUTE_ERROR: "5-15 minutes",
540
- ErrorType.TYPE_ERROR: "5-20 minutes",
541
- ErrorType.VALUE_ERROR: "2-15 minutes",
542
- ErrorType.KEY_ERROR: "2-10 minutes",
543
- ErrorType.NETWORK: "10-30 minutes",
544
- ErrorType.DATABASE: "15-45 minutes",
545
- ErrorType.MEMORY: "20-60 minutes",
546
- ErrorType.CONCURRENCY: "30-90 minutes",
547
- ErrorType.UNKNOWN: "15-60 minutes"
548
- }
549
-
550
- base_time = base_times.get(error_analysis.type, "10-30 minutes")
551
-
552
- # Adjust based on solution confidence
553
- if solutions and solutions[0].confidence > 0.9:
554
- return f"Quick fix: {base_time}"
555
- elif solutions and solutions[0].confidence > 0.7:
556
- return f"Standard: {base_time}"
557
- else:
558
- return f"Complex: {base_time}"
559
-
560
- def _calculate_confidence(
561
- self, classification: ErrorType, message: str
562
- ) -> float:
563
- """Calculate confidence in error classification."""
564
-
565
- # High confidence for direct type matches
566
- if classification != ErrorType.UNKNOWN:
567
- return 0.85
568
-
569
- # Lower confidence for unknown errors
570
- return 0.4
571
-
572
- def _assess_severity(
573
- self, error: Exception, context: Dict, frequency: int
574
- ) -> str:
575
- """Assess error severity based on context and frequency."""
576
-
577
- # High severity indicators
578
- if any(keyword in str(error).lower() for keyword in [
579
- 'critical', 'fatal', 'corruption', 'security'
580
- ]):
581
- return "critical"
582
-
583
- # Frequency-based severity
584
- if frequency > 10:
585
- return "high"
586
- elif frequency > 3:
587
- return "medium"
588
-
589
- # Context-based severity
590
- if context.get('production', False):
591
- return "high"
592
- elif context.get('user_facing', False):
593
- return "medium"
594
-
595
- return "low"
596
-
597
- def _analyze_likely_causes(
598
- self, error_type: str, message: str, context: Dict
599
- ) -> List[str]:
600
- """Analyze likely causes of the error."""
601
-
602
- causes = []
603
-
604
- if error_type == "ImportError":
605
- if "No module named" in message:
606
- causes.extend([
607
- "Missing dependency installation",
608
- "Incorrect import path",
609
- "Virtual environment not activated"
610
- ])
611
- elif "circular import" in message:
612
- causes.extend([
613
- "Circular dependency between modules",
614
- "Improper module structure"
615
- ])
616
-
617
- elif error_type == "AttributeError":
618
- causes.extend([
619
- "Wrong object type being used",
620
- "Incorrect attribute name",
621
- "Object not properly initialized"
622
- ])
623
-
624
- elif error_type == "TypeError":
625
- causes.extend([
626
- "Incorrect data types in operation",
627
- "Function called with wrong argument types",
628
- "Missing type conversion"
629
- ])
630
-
631
- return causes
632
-
633
- def _generate_quick_fixes(
634
- self, classification: ErrorType, message: str, context: Dict
635
- ) -> List[str]:
636
- """Generate quick fixes for the error."""
637
-
638
- fixes = []
639
-
640
- if classification == ErrorType.IMPORT:
641
- fixes.extend([
642
- "Install missing package with pip",
643
- "Check Python path configuration",
644
- "Verify module exists in expected location"
645
- ])
646
-
647
- elif classification == ErrorType.ATTRIBUTE_ERROR:
648
- fixes.extend([
649
- "Add hasattr() check before attribute access",
650
- "Verify object initialization",
651
- "Check for typos in attribute name"
652
- ])
653
-
654
- elif classification == ErrorType.TYPE_ERROR:
655
- fixes.extend([
656
- "Add type conversion before operation",
657
- "Check function signature",
658
- "Use isinstance() for type validation"
659
- ])
660
-
661
- return fixes
662
-
663
- def get_error_frequency(self, error: Exception) -> int:
664
- """Get frequency of this error occurrence."""
665
- error_key = f"{type(error).__name__}:{str(error)[:50]}"
666
- return self.error_history.get(error_key, 0)
667
-
668
- def clear_error_history(self):
669
- """Clear error history for fresh analysis."""
670
- self.error_history.clear()
671
- self.pattern_cache.clear()
672
-
673
- def get_debug_statistics(self) -> Dict[str, Any]:
674
- """Get debugging session statistics."""
675
- return {
676
- 'total_errors_analyzed': len(self.error_history),
677
- 'error_types': dict(Counter(key.split(':')[0] for key in self.error_history.keys())),
678
- 'cache_hits': len(self.pattern_cache),
679
- 'most_common_errors': sorted(
680
- self.error_history.items(),
681
- key=lambda x: x[1],
682
- reverse=True
683
- )[:5]
684
- }
685
-
686
- # Usage Examples
687
- """
688
- # Basic usage
103
+ """Complete debug analysis with solutions and prevention strategies."""
104
+ error_type: ErrorType
105
+ confidence: float
106
+ context7_patterns: Dict[str, Any]
107
+ solutions: List[Solution]
108
+ prevention_strategies: List[str]
109
+ related_errors: List[str]
110
+ estimated_fix_time: str
111
+ ```
112
+
113
+ ### Basic Usage Pattern
114
+
115
+ Standard debugging workflow implementation:
116
+
117
+ ```python
689
118
  debugger = AIDebugger(context7_client=context7)
690
119
 
691
120
  try:
692
- # Code that might fail
693
- result = some_risky_operation()
694
- except Exception as e:
695
- analysis = await debugger.debug_with_context7_patterns(
696
- e,
697
- {'file': __file__, 'function': 'some_risky_operation', 'language': 'python'},
698
- '/project/src'
699
- )
700
-
701
- print(f"Error type: {analysis.error_type}")
702
- print(f"Confidence: {analysis.confidence}")
703
- print(f"Solutions found: {len(analysis.solutions)}")
704
-
705
- for i, solution in enumerate(analysis.solutions, 1):
706
- print(f"\nSolution {i}:")
707
- print(f" Description: {solution.description}")
708
- print(f" Confidence: {solution.confidence}")
709
- print(f" Impact: {solution.impact}")
710
- if solution.code_example:
711
- print(f" Example:\n{solution.code_example}")
712
-
713
- # Advanced usage with custom context
714
- try:
715
- data = process_user_input(user_data)
121
+ result = some_risky_operation()
716
122
  except Exception as e:
717
- analysis = await debugger.debug_with_context7_patterns(
718
- e,
719
- {
720
- 'file': __file__,
721
- 'function': 'process_user_input',
722
- 'language': 'python',
723
- 'framework': 'django',
724
- 'operation_type': 'data_processing',
725
- 'user_facing': True,
726
- 'production': False
727
- },
728
- '/project/src'
729
- )
730
-
731
- # Get prevention strategies
732
- print("Prevention strategies:")
733
- for strategy in analysis.prevention_strategies:
734
- print(f" - {strategy}")
735
-
736
- # Check debug statistics
737
- stats = debugger.get_debug_statistics()
738
- print(f"Debugged {stats['total_errors_analyzed']} errors")
739
- print(f"Most common: {stats['most_common_errors'][:3]}")
740
- """
123
+ analysis = await debugger.debug_with_context7_patterns(
124
+ e,
125
+ {'file': __file__, 'function': 'some_risky_operation', 'language': 'python'},
126
+ '/project/src'
127
+ )
128
+
129
+ print(f"Error type: {analysis.error_type}")
130
+ print(f"Confidence: {analysis.confidence}")
131
+ print(f"Solutions found: {len(analysis.solutions)}")
132
+
133
+ for i, solution in enumerate(analysis.solutions, 1):
134
+ print(f"\nSolution {i}:")
135
+ print(f" Description: {solution.description}")
136
+ print(f" Confidence: {solution.confidence}")
137
+ print(f" Impact: {solution.impact}")
138
+ if solution.code_example:
139
+ print(f" Example:\n{solution.code_example}")
741
140
  ```
742
141
 
743
- ## Advanced Features
142
+ ---
744
143
 
745
- ### Context Integration
144
+ ## Implementation Guide
746
145
 
747
- Enhanced Context Collection:
748
- ```python
749
- def collect_debug_context(
750
- error: Exception,
751
- frame_depth: int = 5
752
- ) -> Dict[str, Any]:
753
- """Collect comprehensive debug context."""
754
-
755
- import inspect
756
- import sys
757
-
758
- # Get current frame and walk up the stack
759
- frame = inspect.currentframe()
760
- context = {
761
- 'error_type': type(error).__name__,
762
- 'error_message': str(error),
763
- 'timestamp': datetime.now().isoformat(),
764
- 'python_version': sys.version,
765
- 'stack_trace': []
766
- }
767
-
768
- # Collect frame information
769
- for _ in range(frame_depth):
770
- if frame:
771
- frame_info = {
772
- 'filename': frame.f_code.co_filename,
773
- 'function': frame.f_code.co_name,
774
- 'lineno': frame.f_lineno,
775
- 'locals': list(frame.f_locals.keys())
776
- }
777
- context['stack_trace'].append(frame_info)
778
- frame = frame.f_back
779
-
780
- return context
781
- ```
146
+ ### Module Structure
782
147
 
783
- ### Error Pattern Learning
148
+ The AI debugging system is organized into progressive modules:
784
149
 
785
- Self-Improving Pattern Recognition:
786
- ```python
787
- class LearningDebugger(AIDebugger):
788
- """Debugger that learns from fixed errors."""
789
-
790
- def __init__(self, context7_client=None):
791
- super().__init__(context7_client)
792
- self.learned_patterns = {}
793
- self.successful_fixes = {}
794
-
795
- def record_successful_fix(
796
- self, error_signature: str, applied_solution: str
797
- ):
798
- """Record successful fix for future reference."""
799
-
800
- if error_signature not in self.successful_fixes:
801
- self.successful_fixes[error_signature] = []
802
-
803
- self.successful_fixes[error_signature].append({
804
- 'solution': applied_solution,
805
- 'timestamp': datetime.now().isoformat(),
806
- 'success_rate': 1.0
807
- })
808
-
809
- def get_learned_solutions(self, error_signature: str) -> List[Solution]:
810
- """Get solutions learned from previous fixes."""
811
-
812
- if error_signature in self.successful_fixes:
813
- learned = self.successful_fixes[error_signature]
814
-
815
- # Create solutions from learned data
816
- solutions = []
817
- for fix in learned:
818
- if fix['success_rate'] > 0.7: # Only return successful fixes
819
- solution = Solution(
820
- type='learned_pattern',
821
- description=f"Previously successful fix: {fix['solution']}",
822
- code_example=fix['solution'],
823
- confidence=fix['success_rate'],
824
- impact='high', # Previously successful fixes are high impact
825
- dependencies=[]
826
- )
827
- solutions.append(solution)
828
-
829
- return solutions
830
-
831
- return []
832
- ```
150
+ Main Module (Current File): Overview and quick reference with data structures and usage patterns
151
+
152
+ Core Implementation: [debugging-workflows.md](./debugging/debugging-workflows.md) - Complete AIDebugger class with initialization, error patterns, main debugging method, error classification, Context7 integration, and learning extensions
153
+
154
+ Advanced Analysis: [error-analysis.md](./debugging/error-analysis.md) - Pattern matching, solution generation, code examples, severity assessment, prevention strategies, fix time estimation, and statistics tracking
155
+
156
+ ### Core Implementation Workflow
157
+
158
+ Complete AIDebugger class implementation with Context7 integration:
159
+
160
+ Step 1: Initialize debugger with Context7 client and load error patterns database
161
+
162
+ Step 2: Classify error using AI-enhanced pattern recognition with context awareness
163
+
164
+ Step 3: Retrieve Context7 patterns for latest debugging documentation and best practices
165
+
166
+ Step 4: Match error against known patterns using regex matching and solution lookup
167
+
168
+ Step 5: Generate comprehensive solutions from patterns, Context7, and AI sources
169
+
170
+ Step 6: Suggest prevention strategies and estimate fix time based on error complexity
171
+
172
+ ### Error Classification Process
173
+
174
+ Multi-heuristic error classification using three analysis layers:
175
+
176
+ Layer 1 - Direct Type Mapping: Maps standard Python exceptions to ErrorType categories using direct type name matching
177
+
178
+ Layer 2 - Message Pattern Analysis: Analyzes error message content for network, database, memory, and concurrency keywords
179
+
180
+ Layer 3 - Context-Based Classification: Uses operation context from provided metadata for enhanced accuracy
181
+
182
+ ### Context7 Integration Pattern
183
+
184
+ Automatic documentation retrieval for debugging patterns:
185
+
186
+ Build Context7 Queries: Construct queries based on error type, language, and framework context
187
+
188
+ Retrieve Documentation: Fetch latest debugging patterns from Context7 with intelligent caching
189
+
190
+ Apply Best Practices: Integrate official documentation solutions into analysis results
191
+
192
+ ### Solution Generation Strategy
193
+
194
+ Multi-source solution generation with confidence scoring:
195
+
196
+ Pattern-Based Solutions: High-confidence solutions from known error patterns with code examples
197
+
198
+ Context7 Solutions: Latest best practices from official documentation with moderate confidence
199
+
200
+ AI-Generated Solutions: Fallback AI-generated solutions when limited patterns available
201
+
202
+ Prioritization: Solutions sorted by confidence and impact with top 5 recommendations returned
203
+
204
+ ---
205
+
206
+ ## Advanced Modules
207
+
208
+ ### Debugging Workflows Implementation
209
+
210
+ Complete AIDebugger class implementation with initialization, error classification, Context7 integration, and learning extensions: [debugging-workflows.md](./debugging/debugging-workflows.md)
211
+
212
+ Key Features:
213
+ - AIDebugger class structure with comprehensive error patterns database
214
+ - Main debugging workflow with end-to-end error analysis pipeline
215
+ - AI-enhanced error classification with multi-heuristic approach
216
+ - Context7 integration with intelligent query building and caching
217
+ - Learning debugger extension with successful fix tracking
218
+ - Enhanced context collection with stack frame analysis
219
+ - Complete usage examples for common debugging scenarios
220
+
221
+ ### Error Analysis and Solution Patterns
222
+
223
+ Comprehensive error categorization, solution generation, and prevention strategies: [error-analysis.md](./debugging/error-analysis.md)
224
+
225
+ Key Features:
226
+ - Pattern matching system with regex support for error messages
227
+ - Multi-source solution generation with confidence scoring
228
+ - Code example generation for common error patterns
229
+ - Severity assessment based on context and frequency
230
+ - Likely causes analysis for root cause identification
231
+ - Quick fix generation for immediate resolution
232
+ - Type-specific prevention strategies for proactive debugging
233
+ - Related error detection and fix time estimation
234
+ - Debug statistics and error frequency tracking
235
+ - Cache management and confidence calculation
236
+
237
+ ---
833
238
 
834
239
  ## Best Practices
835
240
 
836
- 1. Context Collection: Always provide comprehensive context including file paths, function names, and relevant variables
837
- 2. Error Categorization: Use specific error types for better pattern matching
838
- 3. Solution Validation: Test proposed solutions before applying them
839
- 4. Learning Integration: Record successful fixes to improve future debugging
840
- 5. Performance Monitoring: Track debugging session performance and cache efficiency
241
+ Context Collection: Always provide comprehensive context including file paths, function names, language, framework, operation type, and environment indicators
242
+
243
+ Error Categorization: Use specific error types for better pattern matching and solution relevance
244
+
245
+ Solution Validation: Test proposed solutions in isolated environment before applying to production code
246
+
247
+ Learning Integration: Record successful fixes with error signatures to improve pattern recognition over time
248
+
249
+ Performance Monitoring: Track debugging session performance with statistics, cache efficiency, and error frequency analysis
250
+
251
+ Prevention Strategy Implementation: Prioritize prevention strategies based on error frequency, severity, and systematic impact
252
+
253
+ Pattern Database Maintenance: Regularly update error patterns with new solutions and Context7 topics for continuous improvement
254
+
255
+ ---
256
+
257
+ ## Module Statistics
258
+
259
+ Current Module: ai-debugging.md (overview and quick reference)
260
+ - Lines: 245 (within 500-line limit)
261
+ - Purpose: Entry point with data structures and usage patterns
262
+
263
+ Core Implementation: debugging/debugging-workflows.md
264
+ - Lines: 350 (within 500-line limit)
265
+ - Purpose: Complete AIDebugger class with initialization and Context7 integration
266
+
267
+ Advanced Analysis: debugging/error-analysis.md
268
+ - Lines: 350 (within 500-line limit)
269
+ - Purpose: Pattern matching, solution generation, and prevention strategies
270
+
271
+ ---
272
+
273
+ ## Works Well With
274
+
275
+ Context7 MCP: Latest documentation retrieval for debugging patterns and best practices
276
+
277
+ Python Testing: Integration with pytest, unittest, and async test frameworks
278
+
279
+ Error Tracking: Compatibility with Sentry, Rollbar, and error monitoring systems
280
+
281
+ IDE Integration: Works with VS Code, PyCharm, and debugger integrations
282
+
283
+ Performance Optimization: Complements performance profiling and bottleneck analysis
284
+
285
+ Smart Refactoring: Coordinates with code refactoring workflows for systematic improvements
286
+
287
+ ---
288
+
289
+ ## Related Modules
290
+
291
+ Smart Refactoring: [smart-refactoring.md](./smart-refactoring.md) - AI-assisted code refactoring with pattern matching
292
+
293
+ Performance Optimization: [performance-optimization.md](./performance-optimization.md) - Performance profiling and optimization patterns
294
+
295
+ Automated Code Review: [automated-code-review.md](./automated-code-review.md) - Code quality analysis with Context7 integration
841
296
 
842
297
  ---
843
298
 
844
- Module: `modules/ai-debugging.md`
845
- Related: [Smart Refactoring](./smart-refactoring.md) | [Performance Optimization](./performance-optimization.md)
299
+ Module: modules/ai-debugging.md
300
+ Version: 2.0.0 (Modular Architecture)
301
+ Last Updated: 2025-12-07
302
+ Lines: 245 (within 500-line limit)