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
@@ -0,0 +1,1063 @@
1
+ # Ralph Engine Practical Examples
2
+
3
+ ## Basic Loop Usage
4
+
5
+ ### Starting a Feedback Loop
6
+
7
+ ```bash
8
+ # Start Ralph loop for automated error fixing
9
+ /moai:loop
10
+
11
+ # Start with custom max iterations
12
+ /moai:loop --max-iterations 5
13
+
14
+ # Start with specific completion criteria
15
+ /moai:loop --zero-warnings true
16
+ ```
17
+
18
+ **Loop State Management:**
19
+
20
+ ```json
21
+ // .moai/cache/.moai_loop_state.json
22
+ {
23
+ "active": true,
24
+ "iteration": 1,
25
+ "max_iterations": 10,
26
+ "last_error_count": 5,
27
+ "start_time": "2026-01-10T10:30:00Z",
28
+ "completion_reason": null
29
+ }
30
+ ```
31
+
32
+ **Expected Behavior:**
33
+
34
+ 1. Ralph activates and begins monitoring code changes
35
+ 2. PostToolUse hook runs after each Write/Edit operation
36
+ 3. LSP diagnostics are collected and reported to Claude
37
+ 4. Stop hook checks completion conditions after each response
38
+ 5. Loop continues until zero errors or max iterations reached
39
+
40
+ **Example Conversation Flow:**
41
+
42
+ ```
43
+ User: /moai:loop
44
+ Claude: Ralph loop activated. Starting automated error correction...
45
+
46
+ [Claude makes code changes]
47
+
48
+ Hook Output: LSP: 3 error(s), 2 warning(s) in auth.py
49
+ - [ERROR] Line 45: undefined name 'user_id'
50
+ - [ERROR] Line 67: too many arguments for function
51
+ - [ERROR] Line 89: incompatible return type
52
+
53
+ Claude: Fixing 3 errors found by LSP diagnostics...
54
+
55
+ [Claude fixes errors]
56
+
57
+ Hook Output: LSP: 1 error(s), 0 warning(s) in auth.py
58
+ - [ERROR] Line 45: type mismatch
59
+
60
+ Claude: Fixing remaining error...
61
+
62
+ [Claude fixes final error]
63
+
64
+ Hook Output: LSP: 0 error(s), 0 warning(s) in auth.py
65
+ Stop Hook: Ralph Loop: COMPLETE | All errors resolved!
66
+
67
+ Claude: ✓ Ralph loop completed successfully. All diagnostics clear.
68
+ ```
69
+
70
+ ### Monitoring Progress
71
+
72
+ **Stop Hook Progress Report:**
73
+
74
+ ```
75
+ Ralph Loop: CONTINUE | Iteration: 3/10 | Errors: 2
76
+ Next actions: Fix 2 error(s) in src/api/users.py
77
+ ```
78
+
79
+ **Completion Messages:**
80
+
81
+ ```
82
+ Ralph Loop: COMPLETE | Zero errors achieved
83
+ Ralph Loop: COMPLETE | Max iterations (10) reached
84
+ Ralph Loop: COMPLETE | Manual cancellation
85
+ ```
86
+
87
+ ### Handling Completion
88
+
89
+ **Successful Completion:**
90
+
91
+ ```json
92
+ {
93
+ "active": false,
94
+ "iteration": 5,
95
+ "max_iterations": 10,
96
+ "last_error_count": 0,
97
+ "completion_reason": "zero_errors",
98
+ "end_time": "2026-01-10T10:45:00Z"
99
+ }
100
+ ```
101
+
102
+ **Max Iterations Reached:**
103
+
104
+ ```json
105
+ {
106
+ "active": false,
107
+ "iteration": 10,
108
+ "max_iterations": 10,
109
+ "last_error_count": 2,
110
+ "completion_reason": "max_iterations",
111
+ "remaining_issues": [
112
+ "src/auth.py:45: type mismatch",
113
+ "src/auth.py:67: undefined variable"
114
+ ]
115
+ }
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Fix Command Examples
121
+
122
+ ### One-Time Error Fixes
123
+
124
+ **Basic Usage:**
125
+
126
+ ```bash
127
+ # Fix all current LSP errors
128
+ /moai:fix
129
+
130
+ # Fix errors in specific file
131
+ /moai:fix src/auth.py
132
+
133
+ # Fix with specific severity threshold
134
+ /moai:fix --severity error
135
+ ```
136
+
137
+ **Example Session:**
138
+
139
+ ```
140
+ User: /moai:fix
141
+
142
+ Claude: Running LSP diagnostics...
143
+
144
+ LSP Results:
145
+ src/auth.py:
146
+ - [ERROR] Line 45: undefined name 'user_id'
147
+ - [ERROR] Line 67: missing return statement
148
+ src/api.py:
149
+ - [WARNING] Line 23: unused import 'os'
150
+
151
+ Fixing 2 errors...
152
+
153
+ [Claude makes fixes]
154
+
155
+ Claude: ✓ Fixed 2 errors
156
+ - Defined user_id in auth.py line 45
157
+ - Added return statement in auth.py line 67
158
+
159
+ Remaining: 1 warning (use --severity warning to include)
160
+ ```
161
+
162
+ ### Fixing Different Error Types
163
+
164
+ **Python Type Errors:**
165
+
166
+ ```python
167
+ # Before
168
+ def get_user(id: int) -> User:
169
+ user = db.query(User).filter(User.id == id).first()
170
+ return user # Error: might return None
171
+
172
+ # After (Ralph fixes)
173
+ def get_user(id: int) -> User | None:
174
+ user = db.query(User).filter(User.id == id).first()
175
+ return user
176
+ ```
177
+
178
+ **TypeScript Type Errors:**
179
+
180
+ ```typescript
181
+ // Before
182
+ function processUser(user: User): string {
183
+ return user.name; // Error: Property 'name' does not exist
184
+ }
185
+
186
+ // After (Ralph fixes)
187
+ interface User {
188
+ name: string;
189
+ email: string;
190
+ }
191
+
192
+ function processUser(user: User): string {
193
+ return user.name;
194
+ }
195
+ ```
196
+
197
+ **Go Type Errors:**
198
+
199
+ ```go
200
+ // Before
201
+ func GetUser(id int) User {
202
+ user := db.Find(id)
203
+ return user // Error: cannot use *User as User
204
+ }
205
+
206
+ // After (Ralph fixes)
207
+ func GetUser(id int) *User {
208
+ user := db.Find(id)
209
+ return user
210
+ }
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Configuration Examples
216
+
217
+ ### Basic Configuration (ralph.yaml)
218
+
219
+ **Minimal Setup:**
220
+
221
+ ```yaml
222
+ ralph:
223
+ enabled: true
224
+
225
+ lsp:
226
+ auto_start: true
227
+
228
+ loop:
229
+ max_iterations: 10
230
+ ```
231
+
232
+ **Production Configuration:**
233
+
234
+ ```yaml
235
+ ralph:
236
+ enabled: true
237
+
238
+ lsp:
239
+ auto_start: true
240
+ timeout_seconds: 30
241
+ graceful_degradation: true
242
+ servers:
243
+ python: "pyright"
244
+ typescript: "tsserver"
245
+ go: "gopls"
246
+
247
+ ast_grep:
248
+ enabled: true
249
+ security_scan: true
250
+ quality_scan: true
251
+ custom_rules:
252
+ - .moai/ast-grep/security/**/*.yml
253
+ - .moai/ast-grep/quality/**/*.yml
254
+
255
+ loop:
256
+ max_iterations: 15
257
+ auto_fix: false
258
+ require_confirmation: true
259
+ completion:
260
+ zero_errors: true
261
+ zero_warnings: false
262
+ tests_pass: true
263
+ coverage_threshold: 85
264
+
265
+ hooks:
266
+ post_tool_lsp:
267
+ enabled: true
268
+ severity_threshold: "error"
269
+ ignore_patterns:
270
+ - "*.test.py"
271
+ - "tests/**/*"
272
+ stop_loop_controller:
273
+ enabled: true
274
+ verbose: true
275
+ ```
276
+
277
+ ### Development vs Production Configurations
278
+
279
+ **Development (relaxed):**
280
+
281
+ ```yaml
282
+ ralph:
283
+ enabled: true
284
+
285
+ loop:
286
+ max_iterations: 20
287
+ auto_fix: true
288
+ require_confirmation: false
289
+ completion:
290
+ zero_errors: true
291
+ zero_warnings: false
292
+ tests_pass: false
293
+ ```
294
+
295
+ **Production (strict):**
296
+
297
+ ```yaml
298
+ ralph:
299
+ enabled: true
300
+
301
+ loop:
302
+ max_iterations: 5
303
+ auto_fix: false
304
+ require_confirmation: true
305
+ completion:
306
+ zero_errors: true
307
+ zero_warnings: true
308
+ tests_pass: true
309
+ coverage_threshold: 90
310
+ security_scan: true
311
+ ```
312
+
313
+ ### Language-Specific Configurations
314
+
315
+ **Python Project:**
316
+
317
+ ```yaml
318
+ ralph:
319
+ enabled: true
320
+
321
+ lsp:
322
+ auto_start: true
323
+ servers:
324
+ python: "pyright"
325
+ settings:
326
+ pyright:
327
+ typeCheckingMode: "strict"
328
+ useLibraryCodeForTypes: true
329
+
330
+ ast_grep:
331
+ enabled: true
332
+ rules:
333
+ - .moai/ast-grep/python/**/*.yml
334
+
335
+ loop:
336
+ completion:
337
+ zero_errors: true
338
+ coverage_threshold: 90
339
+ ```
340
+
341
+ **TypeScript/React Project:**
342
+
343
+ ```yaml
344
+ ralph:
345
+ enabled: true
346
+
347
+ lsp:
348
+ auto_start: true
349
+ servers:
350
+ typescript: "tsserver"
351
+ javascript: "tsserver"
352
+ settings:
353
+ typescript:
354
+ strict: true
355
+ noImplicitAny: true
356
+
357
+ ast_grep:
358
+ enabled: true
359
+ rules:
360
+ - .moai/ast-grep/react/**/*.yml
361
+ - .moai/ast-grep/typescript/**/*.yml
362
+ ```
363
+
364
+ **Multi-Language Project:**
365
+
366
+ ```yaml
367
+ ralph:
368
+ enabled: true
369
+
370
+ lsp:
371
+ auto_start: true
372
+ servers:
373
+ python: "pyright"
374
+ typescript: "tsserver"
375
+ go: "gopls"
376
+ rust: "rust-analyzer"
377
+
378
+ ast_grep:
379
+ enabled: true
380
+ rules:
381
+ - .moai/ast-grep/**/*.yml
382
+ ```
383
+
384
+ ---
385
+
386
+ ## Hook Integration Examples
387
+
388
+ ### PostToolUse Hook Communication
389
+
390
+ **Hook Input Schema:**
391
+
392
+ ```json
393
+ {
394
+ "tool_name": "Write",
395
+ "tool_input": {
396
+ "file_path": "/Users/project/src/auth.py",
397
+ "content": "def authenticate(user: str, password: str):\n return True"
398
+ },
399
+ "tool_output": "File written successfully"
400
+ }
401
+ ```
402
+
403
+ **Hook Output Schema:**
404
+
405
+ ```json
406
+ {
407
+ "hookSpecificOutput": {
408
+ "hookEventName": "PostToolUse",
409
+ "additionalContext": "LSP: 2 error(s), 1 warning(s) in auth.py\n - [ERROR] Line 2: missing return type annotation\n - [ERROR] Line 3: security issue - hardcoded credentials\n - [WARNING] Line 1: function too complex"
410
+ }
411
+ }
412
+ ```
413
+
414
+ **Exit Codes:**
415
+
416
+ ```python
417
+ # post_tool__lsp_diagnostic.py
418
+
419
+ # Exit 0: No diagnostics or all clear
420
+ sys.exit(0)
421
+
422
+ # Exit 2: Errors found, attention needed
423
+ sys.exit(2)
424
+
425
+ # Exit 1: Hook execution error (rare)
426
+ sys.exit(1)
427
+ ```
428
+
429
+ ### Stop Hook Loop Control
430
+
431
+ **State File Management:**
432
+
433
+ ```python
434
+ # stop__loop_controller.py
435
+
436
+ def load_loop_state() -> dict:
437
+ state_file = Path(".moai/cache/.moai_loop_state.json")
438
+ if state_file.exists():
439
+ return json.loads(state_file.read_text())
440
+ return {"active": False}
441
+
442
+ def save_loop_state(state: dict):
443
+ state_file = Path(".moai/cache/.moai_loop_state.json")
444
+ state_file.parent.mkdir(parents=True, exist_ok=True)
445
+ state_file.write_text(json.dumps(state, indent=2))
446
+
447
+ def update_iteration(state: dict) -> dict:
448
+ state["iteration"] += 1
449
+ state["last_updated"] = datetime.now(timezone.utc).isoformat()
450
+ return state
451
+ ```
452
+
453
+ **Completion Check Logic:**
454
+
455
+ ```python
456
+ def check_completion(state: dict, config: dict) -> tuple[bool, str | None]:
457
+ # Check max iterations
458
+ if state["iteration"] >= config["loop"]["max_iterations"]:
459
+ return True, "max_iterations"
460
+
461
+ # Check zero errors
462
+ if config["loop"]["completion"]["zero_errors"]:
463
+ if state["last_error_count"] > 0:
464
+ return False, None
465
+
466
+ # Check zero warnings
467
+ if config["loop"]["completion"]["zero_warnings"]:
468
+ if state["last_warning_count"] > 0:
469
+ return False, None
470
+
471
+ # Check tests pass
472
+ if config["loop"]["completion"]["tests_pass"]:
473
+ if not state["tests_passing"]:
474
+ return False, None
475
+
476
+ # All conditions met
477
+ return True, "zero_errors"
478
+ ```
479
+
480
+ **Hook Output Generation:**
481
+
482
+ ```python
483
+ def generate_hook_output(state: dict, complete: bool, reason: str | None) -> dict:
484
+ if complete:
485
+ message = f"Ralph Loop: COMPLETE | {reason}"
486
+ else:
487
+ iteration_info = f"{state['iteration']}/{state['max_iterations']}"
488
+ error_info = f"Errors: {state['last_error_count']}"
489
+ message = f"Ralph Loop: CONTINUE | Iteration: {iteration_info} | {error_info}"
490
+
491
+ return {
492
+ "hookSpecificOutput": {
493
+ "hookEventName": "Stop",
494
+ "additionalContext": message
495
+ }
496
+ }
497
+ ```
498
+
499
+ ---
500
+
501
+ ## LSP Diagnostics Examples
502
+
503
+ ### Python Diagnostics (Pyright)
504
+
505
+ **Type Errors:**
506
+
507
+ ```python
508
+ # Code with errors
509
+ def process_user(user_id: int) -> str:
510
+ user = get_user(user_id) # Returns User | None
511
+ return user.name # Error: 'None' has no attribute 'name'
512
+
513
+ # LSP Diagnostic
514
+ {
515
+ "range": {
516
+ "start": {"line": 2, "character": 11},
517
+ "end": {"line": 2, "character": 20}
518
+ },
519
+ "severity": 1, # Error
520
+ "code": "reportOptionalMemberAccess",
521
+ "source": "pyright",
522
+ "message": "'name' is not a known member of 'None'"
523
+ }
524
+
525
+ # Ralph's fix
526
+ def process_user(user_id: int) -> str:
527
+ user = get_user(user_id)
528
+ if user is None:
529
+ raise ValueError(f"User {user_id} not found")
530
+ return user.name
531
+ ```
532
+
533
+ **Import Errors:**
534
+
535
+ ```python
536
+ # Code with error
537
+ from typing import Dict # Error: Use dict instead (PEP 585)
538
+
539
+ # LSP Diagnostic
540
+ {
541
+ "severity": 2, # Warning
542
+ "message": "\"Dict\" is deprecated, use \"dict\" instead",
543
+ "source": "pyright"
544
+ }
545
+
546
+ # Ralph's fix
547
+ from typing import TYPE_CHECKING
548
+ ```
549
+
550
+ ### TypeScript Diagnostics (tsserver)
551
+
552
+ **Type Mismatches:**
553
+
554
+ ```typescript
555
+ // Code with error
556
+ interface User {
557
+ id: number;
558
+ name: string;
559
+ }
560
+
561
+ function getUser(id: string): User { // Error: id should be number
562
+ return { id, name: "Test" }; // Error: Type 'string' is not assignable to type 'number'
563
+ }
564
+
565
+ // LSP Diagnostic
566
+ {
567
+ "range": {
568
+ "start": {"line": 5, "character": 13},
569
+ "end": {"line": 5, "character": 15}
570
+ },
571
+ "severity": 1,
572
+ "code": 2322,
573
+ "source": "ts",
574
+ "message": "Type 'string' is not assignable to type 'number'"
575
+ }
576
+
577
+ // Ralph's fix
578
+ function getUser(id: number): User {
579
+ return { id, name: "Test" };
580
+ }
581
+ ```
582
+
583
+ ### Go Diagnostics (gopls)
584
+
585
+ **Unused Variables:**
586
+
587
+ ```go
588
+ // Code with error
589
+ func ProcessUser(id int) error {
590
+ user, err := GetUser(id) // Error: user declared but not used
591
+ if err != nil {
592
+ return err
593
+ }
594
+ return nil
595
+ }
596
+
597
+ // LSP Diagnostic
598
+ {
599
+ "severity": 1,
600
+ "message": "user declared and not used",
601
+ "source": "compiler"
602
+ }
603
+
604
+ // Ralph's fix
605
+ func ProcessUser(id int) error {
606
+ _, err := GetUser(id)
607
+ if err != nil {
608
+ return err
609
+ }
610
+ return nil
611
+ }
612
+ ```
613
+
614
+ ---
615
+
616
+ ## AST-grep Security Scan Examples
617
+
618
+ ### SQL Injection Detection
619
+
620
+ **AST-grep Rule:**
621
+
622
+ ```yaml
623
+ # .moai/ast-grep/security/sql-injection.yml
624
+ id: sql-injection-python
625
+ language: python
626
+ rule:
627
+ pattern: cursor.execute($SQL)
628
+ where:
629
+ SQL:
630
+ kind: binary_expression
631
+ has:
632
+ kind: string
633
+ message: "Potential SQL injection vulnerability"
634
+ severity: error
635
+ ```
636
+
637
+ **Code Detected:**
638
+
639
+ ```python
640
+ # Vulnerable code
641
+ def get_user(user_id):
642
+ cursor.execute("SELECT * FROM users WHERE id = " + user_id)
643
+ ```
644
+
645
+ **Ralph's Fix:**
646
+
647
+ ```python
648
+ # Fixed code
649
+ def get_user(user_id):
650
+ cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))
651
+ ```
652
+
653
+ ### XSS Prevention
654
+
655
+ **AST-grep Rule:**
656
+
657
+ ```yaml
658
+ # .moai/ast-grep/security/xss-prevention.yml
659
+ id: xss-react
660
+ language: typescript
661
+ rule:
662
+ pattern: dangerouslySetInnerHTML={{ __html: $HTML }}
663
+ where:
664
+ HTML:
665
+ not:
666
+ has:
667
+ kind: call_expression
668
+ has:
669
+ field: function
670
+ regex: "sanitize|escape"
671
+ message: "Unsanitized HTML may cause XSS"
672
+ severity: error
673
+ ```
674
+
675
+ **Code Detected:**
676
+
677
+ ```typescript
678
+ // Vulnerable code
679
+ function UserProfile({ bio }: { bio: string }) {
680
+ return <div dangerouslySetInnerHTML={{ __html: bio }} />;
681
+ }
682
+ ```
683
+
684
+ **Ralph's Fix:**
685
+
686
+ ```typescript
687
+ // Fixed code
688
+ import DOMPurify from 'dompurify';
689
+
690
+ function UserProfile({ bio }: { bio: string }) {
691
+ const sanitizedBio = DOMPurify.sanitize(bio);
692
+ return <div dangerouslySetInnerHTML={{ __html: sanitizedBio }} />;
693
+ }
694
+ ```
695
+
696
+ ### Hardcoded Secrets
697
+
698
+ **AST-grep Rule:**
699
+
700
+ ```yaml
701
+ # .moai/ast-grep/security/hardcoded-secrets.yml
702
+ id: hardcoded-api-key
703
+ language: python
704
+ rule:
705
+ any:
706
+ - pattern: API_KEY = "$KEY"
707
+ - pattern: SECRET_KEY = "$KEY"
708
+ - pattern: PASSWORD = "$PWD"
709
+ where:
710
+ KEY:
711
+ regex: "^[A-Za-z0-9]{20,}$"
712
+ message: "Hardcoded secret detected"
713
+ severity: error
714
+ ```
715
+
716
+ **Code Detected:**
717
+
718
+ ```python
719
+ # Vulnerable code
720
+ API_KEY = "sk_live_1234567890abcdefghij"
721
+ ```
722
+
723
+ **Ralph's Fix:**
724
+
725
+ ```python
726
+ # Fixed code
727
+ import os
728
+ API_KEY = os.environ.get("API_KEY")
729
+ if not API_KEY:
730
+ raise ValueError("API_KEY environment variable not set")
731
+ ```
732
+
733
+ ---
734
+
735
+ ## CI/CD Integration
736
+
737
+ ### GitHub Actions Workflow
738
+
739
+ **Basic Integration:**
740
+
741
+ ```yaml
742
+ # .github/workflows/ralph-quality.yml
743
+ name: Ralph Quality Check
744
+
745
+ on:
746
+ pull_request:
747
+ branches: [main]
748
+
749
+ jobs:
750
+ ralph-check:
751
+ runs-on: ubuntu-latest
752
+ steps:
753
+ - uses: actions/checkout@v4
754
+
755
+ - name: Set up Python
756
+ uses: actions/setup-python@v5
757
+ with:
758
+ python-version: "3.13"
759
+
760
+ - name: Install MoAI-ADK
761
+ run: |
762
+ pip install moai-adk
763
+ moai init
764
+
765
+ - name: Run Ralph Loop
766
+ run: |
767
+ claude -p "/moai:loop --max-iterations 5" \
768
+ --allowedTools "Read,Write,Edit,Bash" \
769
+ --output-format json
770
+ env:
771
+ MOAI_LOOP_ACTIVE: "true"
772
+ CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
773
+
774
+ - name: Check Results
775
+ run: |
776
+ python .moai/scripts/check_ralph_results.py
777
+ ```
778
+
779
+ **Advanced CI/CD Integration:**
780
+
781
+ ```yaml
782
+ # .github/workflows/ralph-advanced.yml
783
+ name: Ralph Advanced Quality
784
+
785
+ on:
786
+ push:
787
+ branches: [main, develop]
788
+ pull_request:
789
+
790
+ jobs:
791
+ ralph-full-check:
792
+ runs-on: ubuntu-latest
793
+ strategy:
794
+ matrix:
795
+ check: [lsp, ast-grep, tests, coverage]
796
+
797
+ steps:
798
+ - uses: actions/checkout@v4
799
+
800
+ - name: Install Dependencies
801
+ run: |
802
+ pip install moai-adk
803
+ moai init
804
+
805
+ - name: Run ${{ matrix.check }} Check
806
+ run: |
807
+ case "${{ matrix.check }}" in
808
+ lsp)
809
+ claude -p "/moai:fix --severity error" \
810
+ --allowedTools "Read,Write,Edit"
811
+ ;;
812
+ ast-grep)
813
+ moai ast-grep scan --security
814
+ ;;
815
+ tests)
816
+ pytest tests/ -v
817
+ ;;
818
+ coverage)
819
+ pytest tests/ --cov --cov-report=json
820
+ ;;
821
+ esac
822
+ env:
823
+ CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
824
+
825
+ - name: Upload Results
826
+ uses: actions/upload-artifact@v4
827
+ with:
828
+ name: ${{ matrix.check }}-results
829
+ path: .moai/reports/${{ matrix.check }}
830
+ ```
831
+
832
+ ### Pre-commit Hook Integration
833
+
834
+ **Setup Script:**
835
+
836
+ ```bash
837
+ # .git/hooks/pre-commit
838
+ #!/bin/bash
839
+
840
+ echo "Running Ralph pre-commit checks..."
841
+
842
+ # Run LSP diagnostics
843
+ moai lsp diagnose --changed-files
844
+
845
+ if [ $? -ne 0 ]; then
846
+ echo "❌ LSP errors found. Run '/moai:fix' to resolve."
847
+ exit 1
848
+ fi
849
+
850
+ # Run AST-grep security scan
851
+ moai ast-grep scan --security --changed-files
852
+
853
+ if [ $? -ne 0 ]; then
854
+ echo "❌ Security issues found. Review and fix."
855
+ exit 1
856
+ fi
857
+
858
+ echo "✓ All Ralph checks passed"
859
+ exit 0
860
+ ```
861
+
862
+ ### Docker Integration
863
+
864
+ **Dockerfile with Ralph:**
865
+
866
+ ```dockerfile
867
+ FROM python:3.13-slim
868
+
869
+ WORKDIR /app
870
+
871
+ # Install MoAI-ADK
872
+ RUN pip install moai-adk
873
+
874
+ # Copy project
875
+ COPY . .
876
+
877
+ # Initialize MoAI-ADK
878
+ RUN moai init
879
+
880
+ # Run Ralph quality check
881
+ RUN claude -p "/moai:loop --max-iterations 3" \
882
+ --allowedTools "Read,Write,Edit" \
883
+ --output-format json || exit 1
884
+
885
+ # Continue with application build
886
+ CMD ["python", "app.py"]
887
+ ```
888
+
889
+ ---
890
+
891
+ ## Complete Integration Example
892
+
893
+ ### Full Project Setup with Ralph
894
+
895
+ **Project Structure:**
896
+
897
+ ```
898
+ my-project/
899
+ ├── .moai/
900
+ │ ├── config/
901
+ │ │ └── sections/
902
+ │ │ └── ralph.yaml
903
+ │ ├── cache/
904
+ │ │ └── .moai_loop_state.json
905
+ │ └── ast-grep/
906
+ │ ├── security/
907
+ │ │ ├── sql-injection.yml
908
+ │ │ ├── xss-prevention.yml
909
+ │ │ └── secrets.yml
910
+ │ └── quality/
911
+ │ ├── complexity.yml
912
+ │ └── best-practices.yml
913
+ ├── .claude/
914
+ │ ├── hooks/
915
+ │ │ └── moai/
916
+ │ │ ├── post_tool__lsp_diagnostic.py
917
+ │ │ └── stop__loop_controller.py
918
+ │ └── settings.json
919
+ ├── .lsp.json
920
+ └── src/
921
+ ```
922
+
923
+ **Complete ralph.yaml:**
924
+
925
+ ```yaml
926
+ ralph:
927
+ enabled: true
928
+
929
+ lsp:
930
+ auto_start: true
931
+ timeout_seconds: 30
932
+ graceful_degradation: true
933
+ servers:
934
+ python: "pyright"
935
+ typescript: "tsserver"
936
+ settings:
937
+ pyright:
938
+ typeCheckingMode: "strict"
939
+
940
+ ast_grep:
941
+ enabled: true
942
+ security_scan: true
943
+ quality_scan: true
944
+ custom_rules:
945
+ - .moai/ast-grep/security/**/*.yml
946
+ - .moai/ast-grep/quality/**/*.yml
947
+
948
+ loop:
949
+ max_iterations: 10
950
+ auto_fix: false
951
+ require_confirmation: true
952
+ completion:
953
+ zero_errors: true
954
+ zero_warnings: false
955
+ tests_pass: true
956
+ coverage_threshold: 85
957
+
958
+ hooks:
959
+ post_tool_lsp:
960
+ enabled: true
961
+ severity_threshold: "error"
962
+ stop_loop_controller:
963
+ enabled: true
964
+ verbose: true
965
+ ```
966
+
967
+ **Typical Workflow:**
968
+
969
+ ```bash
970
+ # 1. Start development
971
+ /moai:1-plan "User authentication system"
972
+
973
+ # 2. Implement with Ralph loop
974
+ /moai:loop
975
+
976
+ # (Ralph automatically fixes LSP errors during implementation)
977
+
978
+ # 3. Verify quality
979
+ /moai:fix --severity warning
980
+
981
+ # 4. Run security scan
982
+ moai ast-grep scan --security
983
+
984
+ # 5. Sync documentation
985
+ /moai:3-sync
986
+ ```
987
+
988
+ ---
989
+
990
+ ## Troubleshooting Examples
991
+
992
+ ### Debug LSP Issues
993
+
994
+ **Check LSP Server Status:**
995
+
996
+ ```bash
997
+ # View LSP logs
998
+ cat .moai/logs/lsp_diagnostic.log
999
+
1000
+ # Test LSP connection
1001
+ moai lsp test-connection python
1002
+
1003
+ # View diagnostics directly
1004
+ moai lsp diagnose src/auth.py
1005
+ ```
1006
+
1007
+ **Common LSP Errors:**
1008
+
1009
+ ```
1010
+ Error: LSP server not found
1011
+ Solution: Install language server (e.g., pip install pyright)
1012
+
1013
+ Error: LSP timeout
1014
+ Solution: Increase timeout in ralph.yaml:
1015
+ lsp:
1016
+ timeout_seconds: 60
1017
+
1018
+ Error: Invalid LSP configuration
1019
+ Solution: Verify .lsp.json configuration format
1020
+ ```
1021
+
1022
+ ### Debug Loop Issues
1023
+
1024
+ **Check Loop State:**
1025
+
1026
+ ```bash
1027
+ # View current state
1028
+ cat .moai/cache/.moai_loop_state.json
1029
+
1030
+ # Reset loop state
1031
+ rm .moai/cache/.moai_loop_state.json
1032
+
1033
+ # View loop logs
1034
+ cat .moai/logs/loop_controller.log
1035
+ ```
1036
+
1037
+ **Common Loop Issues:**
1038
+
1039
+ ```
1040
+ Issue: Loop not starting
1041
+ Check:
1042
+ - ralph.enabled: true in config
1043
+ - MOAI_DISABLE_LOOP_CONTROLLER not set
1044
+ - State file writable
1045
+
1046
+ Issue: Loop stuck
1047
+ Check:
1048
+ - Max iterations setting
1049
+ - Completion conditions
1050
+ - Error count not decreasing
1051
+ Solution: /moai:cancel-loop then review errors manually
1052
+
1053
+ Issue: Loop completes too early
1054
+ Check:
1055
+ - Completion conditions too relaxed
1056
+ - zero_warnings: false (warnings ignored)
1057
+ Solution: Tighten completion criteria in ralph.yaml
1058
+ ```
1059
+
1060
+ ---
1061
+
1062
+ Last Updated: 2026-01-10
1063
+ Version: 1.0.0