moai-adk 0.25.4__py3-none-any.whl → 0.32.8__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.

Potentially problematic release.


This version of moai-adk might be problematic. Click here for more details.

Files changed (378) hide show
  1. moai_adk/__init__.py +2 -5
  2. moai_adk/__main__.py +114 -82
  3. moai_adk/cli/__init__.py +6 -1
  4. moai_adk/cli/commands/__init__.py +1 -3
  5. moai_adk/cli/commands/analyze.py +5 -16
  6. moai_adk/cli/commands/doctor.py +6 -18
  7. moai_adk/cli/commands/init.py +56 -125
  8. moai_adk/cli/commands/language.py +14 -35
  9. moai_adk/cli/commands/status.py +9 -15
  10. moai_adk/cli/commands/update.py +1555 -190
  11. moai_adk/cli/prompts/init_prompts.py +112 -56
  12. moai_adk/cli/spec_status.py +263 -0
  13. moai_adk/cli/ui/__init__.py +44 -0
  14. moai_adk/cli/ui/progress.py +422 -0
  15. moai_adk/cli/ui/prompts.py +389 -0
  16. moai_adk/cli/ui/theme.py +129 -0
  17. moai_adk/cli/worktree/__init__.py +27 -0
  18. moai_adk/cli/worktree/__main__.py +31 -0
  19. moai_adk/cli/worktree/cli.py +672 -0
  20. moai_adk/cli/worktree/exceptions.py +89 -0
  21. moai_adk/cli/worktree/manager.py +490 -0
  22. moai_adk/cli/worktree/models.py +65 -0
  23. moai_adk/cli/worktree/registry.py +128 -0
  24. moai_adk/core/PHASE2_OPTIMIZATIONS.md +467 -0
  25. moai_adk/core/analysis/session_analyzer.py +17 -56
  26. moai_adk/core/claude_integration.py +26 -54
  27. moai_adk/core/command_helpers.py +10 -10
  28. moai_adk/core/comprehensive_monitoring_system.py +1183 -0
  29. moai_adk/core/config/auto_spec_config.py +5 -11
  30. moai_adk/core/config/migration.py +19 -9
  31. moai_adk/core/config/unified.py +436 -0
  32. moai_adk/core/context_manager.py +6 -12
  33. moai_adk/core/enterprise_features.py +1404 -0
  34. moai_adk/core/error_recovery_system.py +725 -112
  35. moai_adk/core/event_driven_hook_system.py +1371 -0
  36. moai_adk/core/git/__init__.py +8 -0
  37. moai_adk/core/git/branch_manager.py +3 -11
  38. moai_adk/core/git/checkpoint.py +1 -3
  39. moai_adk/core/git/conflict_detector.py +413 -0
  40. moai_adk/core/git/manager.py +91 -1
  41. moai_adk/core/hooks/post_tool_auto_spec_completion.py +56 -80
  42. moai_adk/core/input_validation_middleware.py +1006 -0
  43. moai_adk/core/integration/engine.py +6 -18
  44. moai_adk/core/integration/integration_tester.py +10 -9
  45. moai_adk/core/integration/utils.py +1 -1
  46. moai_adk/core/issue_creator.py +10 -28
  47. moai_adk/core/jit_context_loader.py +956 -0
  48. moai_adk/core/jit_enhanced_hook_manager.py +1987 -0
  49. moai_adk/core/language_config_resolver.py +485 -0
  50. moai_adk/core/language_validator.py +28 -41
  51. moai_adk/core/mcp/setup.py +15 -12
  52. moai_adk/core/merge/__init__.py +9 -0
  53. moai_adk/core/merge/analyzer.py +481 -0
  54. moai_adk/core/migration/alfred_to_moai_migrator.py +383 -0
  55. moai_adk/core/migration/backup_manager.py +78 -9
  56. moai_adk/core/migration/custom_element_scanner.py +358 -0
  57. moai_adk/core/migration/file_migrator.py +8 -17
  58. moai_adk/core/migration/interactive_checkbox_ui.py +488 -0
  59. moai_adk/core/migration/selective_restorer.py +470 -0
  60. moai_adk/core/migration/template_utils.py +74 -0
  61. moai_adk/core/migration/user_selection_ui.py +338 -0
  62. moai_adk/core/migration/version_detector.py +6 -10
  63. moai_adk/core/migration/version_migrator.py +3 -3
  64. moai_adk/core/performance/cache_system.py +8 -10
  65. moai_adk/core/phase_optimized_hook_scheduler.py +879 -0
  66. moai_adk/core/project/checker.py +2 -4
  67. moai_adk/core/project/detector.py +1 -3
  68. moai_adk/core/project/initializer.py +135 -23
  69. moai_adk/core/project/phase_executor.py +54 -81
  70. moai_adk/core/project/validator.py +6 -12
  71. moai_adk/core/quality/trust_checker.py +9 -27
  72. moai_adk/core/realtime_monitoring_dashboard.py +1724 -0
  73. moai_adk/core/robust_json_parser.py +611 -0
  74. moai_adk/core/rollback_manager.py +73 -148
  75. moai_adk/core/session_manager.py +10 -26
  76. moai_adk/core/skill_loading_system.py +579 -0
  77. moai_adk/core/spec/confidence_scoring.py +31 -100
  78. moai_adk/core/spec/ears_template_engine.py +351 -286
  79. moai_adk/core/spec/quality_validator.py +35 -69
  80. moai_adk/core/spec_status_manager.py +64 -74
  81. moai_adk/core/template/backup.py +45 -20
  82. moai_adk/core/template/config.py +112 -39
  83. moai_adk/core/template/merger.py +11 -19
  84. moai_adk/core/template/processor.py +253 -149
  85. moai_adk/core/template_engine.py +73 -40
  86. moai_adk/core/template_variable_synchronizer.py +417 -0
  87. moai_adk/core/unified_permission_manager.py +745 -0
  88. moai_adk/core/user_behavior_analytics.py +851 -0
  89. moai_adk/core/version_sync.py +429 -0
  90. moai_adk/foundation/__init__.py +56 -0
  91. moai_adk/foundation/backend.py +1027 -0
  92. moai_adk/foundation/database.py +1115 -0
  93. moai_adk/foundation/devops.py +1585 -0
  94. moai_adk/foundation/ears.py +431 -0
  95. moai_adk/foundation/frontend.py +870 -0
  96. moai_adk/foundation/git/commit_templates.py +4 -12
  97. moai_adk/foundation/git.py +376 -0
  98. moai_adk/foundation/langs.py +484 -0
  99. moai_adk/foundation/ml_ops.py +1162 -0
  100. moai_adk/foundation/testing.py +1524 -0
  101. moai_adk/foundation/trust/trust_principles.py +23 -72
  102. moai_adk/foundation/trust/validation_checklist.py +57 -162
  103. moai_adk/project/__init__.py +0 -0
  104. moai_adk/project/configuration.py +1084 -0
  105. moai_adk/project/documentation.py +566 -0
  106. moai_adk/project/schema.py +447 -0
  107. moai_adk/statusline/alfred_detector.py +1 -3
  108. moai_adk/statusline/config.py +13 -4
  109. moai_adk/statusline/enhanced_output_style_detector.py +23 -15
  110. moai_adk/statusline/main.py +51 -15
  111. moai_adk/statusline/renderer.py +104 -48
  112. moai_adk/statusline/update_checker.py +3 -9
  113. moai_adk/statusline/version_reader.py +140 -46
  114. moai_adk/templates/.claude/agents/moai/ai-nano-banana.md +549 -0
  115. moai_adk/templates/.claude/agents/moai/builder-agent.md +445 -0
  116. moai_adk/templates/.claude/agents/moai/builder-command.md +1132 -0
  117. moai_adk/templates/.claude/agents/moai/builder-skill.md +601 -0
  118. moai_adk/templates/.claude/agents/moai/expert-backend.md +831 -0
  119. moai_adk/templates/.claude/agents/moai/expert-database.md +774 -0
  120. moai_adk/templates/.claude/agents/moai/expert-debug.md +396 -0
  121. moai_adk/templates/.claude/agents/moai/expert-devops.md +711 -0
  122. moai_adk/templates/.claude/agents/moai/expert-frontend.md +666 -0
  123. moai_adk/templates/.claude/agents/moai/expert-security.md +474 -0
  124. moai_adk/templates/.claude/agents/moai/expert-uiux.md +1038 -0
  125. moai_adk/templates/.claude/agents/moai/manager-claude-code.md +429 -0
  126. moai_adk/templates/.claude/agents/moai/manager-docs.md +570 -0
  127. moai_adk/templates/.claude/agents/moai/manager-git.md +937 -0
  128. moai_adk/templates/.claude/agents/moai/manager-project.md +891 -0
  129. moai_adk/templates/.claude/agents/moai/manager-quality.md +598 -0
  130. moai_adk/templates/.claude/agents/moai/manager-spec.md +713 -0
  131. moai_adk/templates/.claude/agents/moai/manager-strategy.md +600 -0
  132. moai_adk/templates/.claude/agents/moai/manager-tdd.md +603 -0
  133. moai_adk/templates/.claude/agents/moai/mcp-context7.md +369 -0
  134. moai_adk/templates/.claude/agents/moai/mcp-figma.md +1567 -0
  135. moai_adk/templates/.claude/agents/moai/mcp-notion.md +749 -0
  136. moai_adk/templates/.claude/agents/moai/mcp-playwright.md +427 -0
  137. moai_adk/templates/.claude/agents/moai/mcp-sequential-thinking.md +994 -0
  138. moai_adk/templates/.claude/commands/moai/0-project.md +1143 -0
  139. moai_adk/templates/.claude/commands/moai/1-plan.md +1435 -0
  140. moai_adk/templates/.claude/commands/moai/2-run.md +883 -0
  141. moai_adk/templates/.claude/commands/moai/3-sync.md +993 -0
  142. moai_adk/templates/.claude/commands/moai/9-feedback.md +314 -0
  143. moai_adk/templates/.claude/hooks/__init__.py +8 -0
  144. moai_adk/templates/.claude/hooks/moai/__init__.py +8 -0
  145. moai_adk/templates/.claude/hooks/moai/lib/__init__.py +85 -0
  146. moai_adk/templates/.claude/hooks/moai/lib/checkpoint.py +244 -0
  147. moai_adk/templates/.claude/hooks/moai/lib/common.py +131 -0
  148. moai_adk/templates/.claude/hooks/moai/lib/config_manager.py +446 -0
  149. moai_adk/templates/.claude/hooks/moai/lib/config_validator.py +639 -0
  150. moai_adk/templates/.claude/hooks/moai/lib/example_config.json +104 -0
  151. moai_adk/templates/.claude/hooks/moai/lib/git_operations_manager.py +590 -0
  152. moai_adk/templates/.claude/hooks/moai/lib/language_validator.py +317 -0
  153. moai_adk/templates/.claude/hooks/moai/lib/models.py +102 -0
  154. moai_adk/templates/.claude/hooks/moai/lib/path_utils.py +28 -0
  155. moai_adk/templates/.claude/hooks/moai/lib/project.py +768 -0
  156. moai_adk/templates/.claude/hooks/moai/lib/test_hooks_improvements.py +443 -0
  157. moai_adk/templates/.claude/hooks/moai/lib/timeout.py +160 -0
  158. moai_adk/templates/.claude/hooks/moai/lib/unified_timeout_manager.py +530 -0
  159. moai_adk/templates/.claude/hooks/moai/session_end__auto_cleanup.py +862 -0
  160. moai_adk/templates/.claude/hooks/moai/session_start__show_project_info.py +921 -0
  161. moai_adk/templates/.claude/output-styles/moai/r2d2.md +380 -0
  162. moai_adk/templates/.claude/output-styles/moai/yoda.md +338 -0
  163. moai_adk/templates/.claude/settings.json +172 -0
  164. moai_adk/templates/.claude/skills/moai-docs-generation/SKILL.md +247 -0
  165. moai_adk/templates/.claude/skills/moai-docs-generation/modules/README.md +44 -0
  166. moai_adk/templates/.claude/skills/moai-docs-generation/modules/api-documentation.md +130 -0
  167. moai_adk/templates/.claude/skills/moai-docs-generation/modules/code-documentation.md +152 -0
  168. moai_adk/templates/.claude/skills/moai-docs-generation/modules/multi-format-output.md +178 -0
  169. moai_adk/templates/.claude/skills/moai-docs-generation/modules/user-guides.md +147 -0
  170. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +319 -0
  171. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +320 -0
  172. moai_adk/templates/.claude/skills/moai-domain-database/modules/README.md +53 -0
  173. moai_adk/templates/.claude/skills/moai-domain-database/modules/mongodb.md +231 -0
  174. moai_adk/templates/.claude/skills/moai-domain-database/modules/postgresql.md +169 -0
  175. moai_adk/templates/.claude/skills/moai-domain-database/modules/redis.md +262 -0
  176. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +496 -0
  177. moai_adk/templates/.claude/skills/moai-domain-uiux/SKILL.md +453 -0
  178. moai_adk/templates/.claude/skills/moai-domain-uiux/examples.md +560 -0
  179. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/accessibility-wcag.md +260 -0
  180. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/component-architecture.md +228 -0
  181. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/design-system-tokens.md +405 -0
  182. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/icon-libraries.md +401 -0
  183. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/theming-system.md +373 -0
  184. moai_adk/templates/.claude/skills/moai-domain-uiux/reference.md +243 -0
  185. moai_adk/templates/.claude/skills/moai-formats-data/SKILL.md +491 -0
  186. moai_adk/templates/.claude/skills/moai-formats-data/modules/README.md +98 -0
  187. moai_adk/templates/.claude/skills/moai-formats-data/modules/SKILL-MODULARIZATION-TEMPLATE.md +278 -0
  188. moai_adk/templates/.claude/skills/moai-formats-data/modules/caching-performance.md +459 -0
  189. moai_adk/templates/.claude/skills/moai-formats-data/modules/data-validation.md +485 -0
  190. moai_adk/templates/.claude/skills/moai-formats-data/modules/json-optimization.md +374 -0
  191. moai_adk/templates/.claude/skills/moai-formats-data/modules/toon-encoding.md +308 -0
  192. moai_adk/templates/.claude/skills/moai-foundation-claude/SKILL.md +201 -0
  193. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/best-practices-checklist.md +616 -0
  194. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-custom-slash-commands-official.md +729 -0
  195. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-hooks-official.md +560 -0
  196. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-iam-official.md +635 -0
  197. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-memory-official.md +543 -0
  198. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-settings-official.md +663 -0
  199. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-skills-official.md +113 -0
  200. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sub-agents-official.md +238 -0
  201. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/complete-configuration-guide.md +175 -0
  202. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-examples.md +1674 -0
  203. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-formatting-guide.md +729 -0
  204. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-examples.md +1513 -0
  205. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-formatting-guide.md +1086 -0
  206. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-integration-patterns.md +1100 -0
  207. moai_adk/templates/.claude/skills/moai-foundation-context/SKILL.md +438 -0
  208. moai_adk/templates/.claude/skills/moai-foundation-core/SKILL.md +515 -0
  209. moai_adk/templates/.claude/skills/moai-foundation-core/modules/README.md +296 -0
  210. moai_adk/templates/.claude/skills/moai-foundation-core/modules/agents-reference.md +346 -0
  211. moai_adk/templates/.claude/skills/moai-foundation-core/modules/commands-reference.md +432 -0
  212. moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-patterns.md +757 -0
  213. moai_adk/templates/.claude/skills/moai-foundation-core/modules/execution-rules.md +687 -0
  214. moai_adk/templates/.claude/skills/moai-foundation-core/modules/modular-system.md +665 -0
  215. moai_adk/templates/.claude/skills/moai-foundation-core/modules/progressive-disclosure.md +649 -0
  216. moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-first-tdd.md +864 -0
  217. moai_adk/templates/.claude/skills/moai-foundation-core/modules/token-optimization.md +708 -0
  218. moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-framework.md +981 -0
  219. moai_adk/templates/.claude/skills/moai-foundation-quality/SKILL.md +362 -0
  220. moai_adk/templates/.claude/skills/moai-foundation-quality/examples.md +1232 -0
  221. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/best-practices.md +261 -0
  222. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/integration-patterns.md +194 -0
  223. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/proactive-analysis.md +229 -0
  224. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/trust5-validation.md +169 -0
  225. moai_adk/templates/.claude/skills/moai-foundation-quality/reference.md +1266 -0
  226. moai_adk/templates/.claude/skills/moai-foundation-quality/scripts/quality-gate.sh +668 -0
  227. moai_adk/templates/.claude/skills/moai-foundation-quality/templates/github-actions-quality.yml +481 -0
  228. moai_adk/templates/.claude/skills/moai-foundation-quality/templates/quality-config.yaml +519 -0
  229. moai_adk/templates/.claude/skills/moai-integration-mcp/SKILL.md +352 -0
  230. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/README.md +52 -0
  231. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/error-handling.md +334 -0
  232. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/integration-patterns.md +310 -0
  233. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/security-authentication.md +256 -0
  234. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/server-architecture.md +253 -0
  235. moai_adk/templates/.claude/skills/moai-lang-unified/README.md +133 -0
  236. moai_adk/templates/.claude/skills/moai-lang-unified/SKILL.md +296 -0
  237. moai_adk/templates/.claude/skills/moai-lang-unified/examples.md +1269 -0
  238. moai_adk/templates/.claude/skills/moai-lang-unified/reference.md +331 -0
  239. moai_adk/templates/.claude/skills/moai-library-mermaid/SKILL.md +298 -0
  240. moai_adk/templates/.claude/skills/moai-library-mermaid/advanced-patterns.md +465 -0
  241. moai_adk/templates/.claude/skills/moai-library-mermaid/examples.md +270 -0
  242. moai_adk/templates/.claude/skills/moai-library-mermaid/optimization.md +440 -0
  243. moai_adk/templates/.claude/skills/moai-library-mermaid/reference.md +228 -0
  244. moai_adk/templates/.claude/skills/moai-library-nextra/SKILL.md +316 -0
  245. moai_adk/templates/.claude/skills/moai-library-nextra/advanced-patterns.md +336 -0
  246. moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-deployment-patterns.md +182 -0
  247. moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-patterns.md +17 -0
  248. moai_adk/templates/.claude/skills/moai-library-nextra/modules/configuration.md +57 -0
  249. moai_adk/templates/.claude/skills/moai-library-nextra/modules/content-architecture-optimization.md +162 -0
  250. moai_adk/templates/.claude/skills/moai-library-nextra/modules/deployment.md +52 -0
  251. moai_adk/templates/.claude/skills/moai-library-nextra/modules/framework-core-configuration.md +186 -0
  252. moai_adk/templates/.claude/skills/moai-library-nextra/modules/i18n-setup.md +55 -0
  253. moai_adk/templates/.claude/skills/moai-library-nextra/modules/mdx-components.md +52 -0
  254. moai_adk/templates/.claude/skills/moai-library-nextra/optimization.md +303 -0
  255. moai_adk/templates/.claude/skills/moai-library-shadcn/SKILL.md +370 -0
  256. moai_adk/templates/.claude/skills/moai-library-shadcn/examples.md +575 -0
  257. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/advanced-patterns.md +394 -0
  258. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/optimization.md +278 -0
  259. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-components.md +457 -0
  260. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-theming.md +373 -0
  261. moai_adk/templates/.claude/skills/moai-library-shadcn/reference.md +74 -0
  262. moai_adk/templates/.claude/skills/moai-platform-baas/README.md +186 -0
  263. moai_adk/templates/.claude/skills/moai-platform-baas/SKILL.md +290 -0
  264. moai_adk/templates/.claude/skills/moai-platform-baas/examples.md +1225 -0
  265. moai_adk/templates/.claude/skills/moai-platform-baas/reference.md +567 -0
  266. moai_adk/templates/.claude/skills/moai-platform-baas/scripts/provider-selector.py +323 -0
  267. moai_adk/templates/.claude/skills/moai-platform-baas/templates/stack-config.yaml +204 -0
  268. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/SKILL.md +446 -0
  269. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/advanced-patterns.md +379 -0
  270. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/optimization.md +286 -0
  271. moai_adk/templates/.claude/skills/moai-workflow-project/README.md +190 -0
  272. moai_adk/templates/.claude/skills/moai-workflow-project/SKILL.md +387 -0
  273. moai_adk/templates/.claude/skills/moai-workflow-project/__init__.py +520 -0
  274. moai_adk/templates/.claude/skills/moai-workflow-project/complete_workflow_demo_fixed.py +574 -0
  275. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_project_setup.py +317 -0
  276. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_workflow_demo.py +663 -0
  277. moai_adk/templates/.claude/skills/moai-workflow-project/examples/config-migration-example.json +190 -0
  278. moai_adk/templates/.claude/skills/moai-workflow-project/examples/question-examples.json +135 -0
  279. moai_adk/templates/.claude/skills/moai-workflow-project/examples/quick_start.py +196 -0
  280. moai_adk/templates/.claude/skills/moai-workflow-project/modules/__init__.py +17 -0
  281. moai_adk/templates/.claude/skills/moai-workflow-project/modules/advanced-patterns.md +158 -0
  282. moai_adk/templates/.claude/skills/moai-workflow-project/modules/ask_user_integration.py +340 -0
  283. moai_adk/templates/.claude/skills/moai-workflow-project/modules/batch_questions.py +713 -0
  284. moai_adk/templates/.claude/skills/moai-workflow-project/modules/config_manager.py +538 -0
  285. moai_adk/templates/.claude/skills/moai-workflow-project/modules/documentation_manager.py +1336 -0
  286. moai_adk/templates/.claude/skills/moai-workflow-project/modules/language_initializer.py +730 -0
  287. moai_adk/templates/.claude/skills/moai-workflow-project/modules/migration_manager.py +608 -0
  288. moai_adk/templates/.claude/skills/moai-workflow-project/modules/template_optimizer.py +1005 -0
  289. moai_adk/templates/.claude/skills/moai-workflow-project/schemas/config-schema.json +316 -0
  290. moai_adk/templates/.claude/skills/moai-workflow-project/schemas/tab_schema.json +1362 -0
  291. moai_adk/templates/.claude/skills/moai-workflow-project/templates/config-template.json +71 -0
  292. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/product-template.md +44 -0
  293. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/structure-template.md +48 -0
  294. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/tech-template.md +71 -0
  295. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/config-manager-setup.json +109 -0
  296. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/language-initializer.json +228 -0
  297. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/menu-project-config.json +130 -0
  298. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/project-batch-questions.json +97 -0
  299. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/spec-workflow-setup.json +150 -0
  300. moai_adk/templates/.claude/skills/moai-workflow-project/test_integration_simple.py +436 -0
  301. moai_adk/templates/.claude/skills/moai-workflow-templates/SKILL.md +374 -0
  302. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/code-templates.md +124 -0
  303. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/feedback-templates.md +100 -0
  304. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/template-optimizer.md +138 -0
  305. moai_adk/templates/.claude/skills/moai-workflow-testing/LICENSE.txt +202 -0
  306. moai_adk/templates/.claude/skills/moai-workflow-testing/SKILL.md +453 -0
  307. moai_adk/templates/.claude/skills/moai-workflow-testing/advanced-patterns.md +576 -0
  308. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/ai-powered-testing.py +294 -0
  309. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/console_logging.py +35 -0
  310. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/element_discovery.py +40 -0
  311. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/static_html_automation.py +34 -0
  312. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/README.md +220 -0
  313. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/ai-debugging.md +845 -0
  314. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review.md +1416 -0
  315. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization.md +1234 -0
  316. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/smart-refactoring.md +1243 -0
  317. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7.md +1260 -0
  318. moai_adk/templates/.claude/skills/moai-workflow-testing/optimization.md +505 -0
  319. moai_adk/templates/.claude/skills/moai-workflow-testing/reference/playwright-best-practices.md +57 -0
  320. moai_adk/templates/.claude/skills/moai-workflow-testing/scripts/with_server.py +218 -0
  321. moai_adk/templates/.claude/skills/moai-workflow-testing/templates/alfred-integration.md +376 -0
  322. moai_adk/templates/.claude/skills/moai-workflow-testing/workflows/enterprise-testing-workflow.py +571 -0
  323. moai_adk/templates/.claude/skills/moai-worktree/SKILL.md +410 -0
  324. moai_adk/templates/.claude/skills/moai-worktree/examples.md +606 -0
  325. moai_adk/templates/.claude/skills/moai-worktree/modules/integration-patterns.md +982 -0
  326. moai_adk/templates/.claude/skills/moai-worktree/modules/parallel-development.md +778 -0
  327. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-commands.md +646 -0
  328. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-management.md +782 -0
  329. moai_adk/templates/.claude/skills/moai-worktree/reference.md +357 -0
  330. moai_adk/templates/.git-hooks/pre-commit +103 -41
  331. moai_adk/templates/.git-hooks/pre-push +116 -21
  332. moai_adk/templates/.github/workflows/ci-universal.yml +513 -0
  333. moai_adk/templates/.github/workflows/security-secrets-check.yml +179 -0
  334. moai_adk/templates/.gitignore +184 -44
  335. moai_adk/templates/.mcp.json +7 -9
  336. moai_adk/templates/.moai/cache/personalization.json +10 -0
  337. moai_adk/templates/.moai/config/config.yaml +344 -0
  338. moai_adk/templates/.moai/config/presets/manual.yaml +28 -0
  339. moai_adk/templates/.moai/config/presets/personal.yaml +30 -0
  340. moai_adk/templates/.moai/config/presets/team.yaml +33 -0
  341. moai_adk/templates/.moai/config/questions/_schema.yaml +79 -0
  342. moai_adk/templates/.moai/config/questions/tab1-user.yaml +108 -0
  343. moai_adk/templates/.moai/config/questions/tab2-project.yaml +122 -0
  344. moai_adk/templates/.moai/config/questions/tab3-git.yaml +542 -0
  345. moai_adk/templates/.moai/config/questions/tab4-quality.yaml +167 -0
  346. moai_adk/templates/.moai/config/questions/tab5-system.yaml +152 -0
  347. moai_adk/templates/.moai/config/sections/git-strategy.yaml +40 -0
  348. moai_adk/templates/.moai/config/sections/language.yaml +11 -0
  349. moai_adk/templates/.moai/config/sections/project.yaml +13 -0
  350. moai_adk/templates/.moai/config/sections/quality.yaml +15 -0
  351. moai_adk/templates/.moai/config/sections/system.yaml +14 -0
  352. moai_adk/templates/.moai/config/sections/user.yaml +5 -0
  353. moai_adk/templates/.moai/config/statusline-config.yaml +86 -0
  354. moai_adk/templates/.moai/scripts/setup-glm.py +136 -0
  355. moai_adk/templates/CLAUDE.md +382 -501
  356. moai_adk/utils/__init__.py +24 -1
  357. moai_adk/utils/banner.py +7 -10
  358. moai_adk/utils/common.py +16 -30
  359. moai_adk/utils/link_validator.py +4 -12
  360. moai_adk/utils/safe_file_reader.py +2 -6
  361. moai_adk/utils/timeout.py +160 -0
  362. moai_adk/utils/toon_utils.py +256 -0
  363. moai_adk/version.py +22 -0
  364. moai_adk-0.32.8.dist-info/METADATA +2478 -0
  365. moai_adk-0.32.8.dist-info/RECORD +396 -0
  366. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/WHEEL +1 -1
  367. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/entry_points.txt +1 -0
  368. moai_adk/cli/commands/backup.py +0 -82
  369. moai_adk/cli/commands/improve_user_experience.py +0 -348
  370. moai_adk/cli/commands/migrate.py +0 -158
  371. moai_adk/cli/commands/validate_links.py +0 -118
  372. moai_adk/templates/.github/workflows/moai-gitflow.yml +0 -413
  373. moai_adk/templates/.github/workflows/moai-release-create.yml +0 -100
  374. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +0 -188
  375. moai_adk/utils/user_experience.py +0 -531
  376. moai_adk-0.25.4.dist-info/METADATA +0 -2279
  377. moai_adk-0.25.4.dist-info/RECORD +0 -112
  378. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/licenses/LICENSE +0 -0
@@ -258,12 +258,10 @@ def check_environment() -> dict[str, bool]:
258
258
  Mapping from check description to boolean status.
259
259
  """
260
260
  return {
261
- "Python >= 3.13": sys.version_info >= (3, 13),
261
+ "Python >= 3.11": sys.version_info >= (3, 11),
262
262
  "Git installed": shutil.which("git") is not None,
263
263
  "Project structure (.moai/)": Path(".moai").exists(),
264
- "Config file (.moai/config/config.json)": Path(
265
- ".moai/config/config.json"
266
- ).exists(),
264
+ "Config file (.moai/config/config.yaml)": Path(".moai/config/config.yaml").exists(),
267
265
  }
268
266
 
269
267
 
@@ -212,9 +212,7 @@ class LanguageDetector:
212
212
 
213
213
  return None
214
214
 
215
- def detect_build_tool(
216
- self, path: str | Path = ".", language: str | None = None
217
- ) -> str | None:
215
+ def detect_build_tool(self, path: str | Path = ".", language: str | None = None) -> str | None:
218
216
  """Detect the build tool for the detected language.
219
217
 
220
218
 
@@ -12,6 +12,7 @@ Phase-based 5-step initialization process:
12
12
  # type: ignore
13
13
 
14
14
  import json
15
+ import stat
15
16
  import time
16
17
  from datetime import datetime
17
18
  from pathlib import Path
@@ -112,10 +113,63 @@ class ProjectInitializer:
112
113
 
113
114
  return created_files
114
115
 
116
+ def _create_user_settings(self) -> list[str]:
117
+ """Create user-specific settings files (.claude/settings.local.json)
118
+
119
+ Returns:
120
+ List of created settings files
121
+ """
122
+ created_files = []
123
+ claude_dir = self.path / ".claude"
124
+ claude_dir.mkdir(parents=True, exist_ok=True)
125
+
126
+ # Create settings.local.json
127
+ settings_local = {
128
+ "_meta": {
129
+ "description": "User-specific Claude Code settings (gitignored - never commit)",
130
+ "created_at": datetime.now().isoformat() + "Z",
131
+ "note": "Edit this file to customize your local development environment",
132
+ },
133
+ "enabledMcpjsonServers": ["context7"], # context7 is mandatory
134
+ }
135
+
136
+ # Add companyAnnouncements in user's selected language
137
+ try:
138
+ import sys
139
+
140
+ utils_dir = (
141
+ Path(__file__).parent.parent.parent / "templates" / ".claude" / "hooks" / "moai" / "shared" / "utils"
142
+ )
143
+
144
+ if utils_dir.exists():
145
+ sys.path.insert(0, str(utils_dir))
146
+ try:
147
+ from announcement_translator import (
148
+ get_language_from_config,
149
+ translate_announcements,
150
+ )
151
+
152
+ language = get_language_from_config(self.path)
153
+ announcements = translate_announcements(language, self.path)
154
+ settings_local["companyAnnouncements"] = announcements
155
+ except Exception as e:
156
+ print(f"[ProjectInitializer] Warning: Failed to add announcements: {e}")
157
+ finally:
158
+ sys.path.remove(str(utils_dir))
159
+
160
+ except Exception as e:
161
+ print(f"[ProjectInitializer] Warning: Announcement module not available: {e}")
162
+
163
+ settings_local_file = claude_dir / "settings.local.json"
164
+ settings_local_file.write_text(json.dumps(settings_local, indent=2, ensure_ascii=False))
165
+ created_files.append(str(settings_local_file))
166
+
167
+ return created_files
168
+
115
169
  def initialize(
116
170
  self,
117
171
  mode: str = "personal",
118
- locale: str = "en", # Changed from "ko" to "en" (will be configurable in /alfred:0-project)
172
+ locale: str = "en", # Changed from "ko" to "en" (will be configurable in /moai:0-project)
119
173
  language: str | None = None,
120
174
  custom_language: str | None = None,
121
175
  backup_enabled: bool = True,
@@ -125,9 +179,9 @@ class ProjectInitializer:
125
179
  """Execute project initialization (5-phase process)
126
180
 
127
181
  Args:
128
- mode: Project mode (personal/team) - Default: personal (configurable in /alfred:0-project)
129
- locale: Locale (ko/en/ja/zh/other) - Default: en (configurable in /alfred:0-project)
130
- language: Force language specification (auto-detect if None) - Will be detected in /alfred:0-project
182
+ mode: Project mode (personal/team) - Default: personal (configurable in /moai:0-project)
183
+ locale: Locale (ko/en/ja/zh/other) - Default: en (configurable in /moai:0-project)
184
+ language: Force language specification (auto-detect if None) - Will be detected in /moai:0-project
131
185
  custom_language: Custom language name when locale="other" (user input)
132
186
  backup_enabled: Whether to enable backup
133
187
  progress_callback: Progress callback
@@ -150,13 +204,11 @@ class ProjectInitializer:
150
204
  )
151
205
 
152
206
  # Use provided language or default to generic
153
- # Language detection now happens in /alfred:0-project via project-manager
207
+ # Language detection now happens in /moai:0-project via project-manager
154
208
  detected_language = language or "generic"
155
209
 
156
210
  # Phase 1: Preparation (backup and validation)
157
- self.executor.execute_preparation_phase(
158
- self.path, backup_enabled, progress_callback
159
- )
211
+ self.executor.execute_preparation_phase(self.path, backup_enabled, progress_callback)
160
212
 
161
213
  # Phase 2: Directory (create directories)
162
214
  self.executor.execute_directory_phase(self.path, progress_callback)
@@ -173,9 +225,22 @@ class ProjectInitializer:
173
225
  }
174
226
 
175
227
  # Phase 3: Resource (copy templates with variable substitution)
176
- resource_files = self.executor.execute_resource_phase(
177
- self.path, config, progress_callback
178
- )
228
+ resource_files = self.executor.execute_resource_phase(self.path, config, progress_callback)
229
+
230
+ # Post-Phase 3: Fix shell script permissions
231
+ # git may not preserve file permissions, so explicitly set them
232
+ scripts_dir = self.path / ".moai" / "scripts"
233
+ if scripts_dir.exists():
234
+ for script_file in scripts_dir.glob("*.sh"):
235
+ try:
236
+ current_mode = script_file.stat().st_mode
237
+ new_mode = current_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
238
+ # On Windows, chmod has limited effect, but we try anyway
239
+ # or check os.name != 'nt' if strict behavior is needed.
240
+ # For now, we just apply it and ignore errors if it fails.
241
+ script_file.chmod(new_mode)
242
+ except Exception:
243
+ pass # Silently ignore permission errors
179
244
 
180
245
  # Phase 4: Configuration (generate config.json)
181
246
  # Handle language configuration
@@ -187,10 +252,10 @@ class ProjectInitializer:
187
252
  }
188
253
  elif locale in ["ko", "en", "ja", "zh"]:
189
254
  language_names = {
190
- "ko": "한국어",
255
+ "ko": "Korean",
191
256
  "en": "English",
192
- "ja": "日本語",
193
- "zh": "中文",
257
+ "ja": "Japanese",
258
+ "zh": "Chinese",
194
259
  }
195
260
  language_config = {
196
261
  "conversation_language": locale,
@@ -209,20 +274,66 @@ class ProjectInitializer:
209
274
  "mode": mode,
210
275
  "locale": locale,
211
276
  "language": detected_language,
212
- # Language detection metadata (will be updated by project-manager via /alfred:0-project)
277
+ # Language detection metadata (will be updated by project-manager via /moai:0-project)
213
278
  "language_detection": {
214
279
  "detected_language": detected_language,
215
- "detection_method": "cli_default", # Will be "context_aware" after /alfred:0-project
280
+ "detection_method": "cli_default", # Will be "context_aware" after /moai:0-project
216
281
  "confidence": None, # Will be calculated by project-manager
217
282
  "markers": [], # Will be populated by project-manager
218
283
  "confirmed_by": None, # Will be "user" after project-manager confirmation
219
284
  },
220
285
  },
221
286
  "language": language_config,
287
+ "constitution": {
288
+ "enforce_tdd": True,
289
+ "principles": {
290
+ "simplicity": {
291
+ "max_projects": 5,
292
+ "notes": "Default recommendation. Adjust in .moai/config.json "
293
+ "or via SPEC/ADR with documented rationale based on project size.",
294
+ }
295
+ },
296
+ "test_coverage_target": 90,
297
+ },
298
+ "git_strategy": {
299
+ "personal": {
300
+ "auto_checkpoint": "disabled",
301
+ "checkpoint_events": [
302
+ "delete",
303
+ "refactor",
304
+ "merge",
305
+ "script",
306
+ "critical-file",
307
+ ],
308
+ "checkpoint_type": "local-branch",
309
+ "max_checkpoints": 10,
310
+ "cleanup_days": 7,
311
+ "push_to_remote": False,
312
+ "auto_commit": True,
313
+ "branch_prefix": "feature/SPEC-",
314
+ "develop_branch": "develop",
315
+ "main_branch": "main",
316
+ "prevent_branch_creation": False,
317
+ "work_on_main": False,
318
+ },
319
+ "team": {
320
+ "auto_pr": False,
321
+ "develop_branch": "develop",
322
+ "draft_pr": False,
323
+ "feature_prefix": "feature/SPEC-",
324
+ "main_branch": "main",
325
+ "use_gitflow": True,
326
+ "default_pr_base": "develop",
327
+ "prevent_main_direct_merge": False,
328
+ },
329
+ },
330
+ "session": {
331
+ "suppress_setup_messages": False,
332
+ "notes": "suppress_setup_messages: false enables SessionStart output. "
333
+ "Set to true to suppress messages (show again after 7 days)",
334
+ },
222
335
  }
223
- config_files = self.executor.execute_configuration_phase(
224
- self.path, config_data, progress_callback
225
- )
336
+ config_files = self.executor.execute_configuration_phase(self.path, config_data, progress_callback)
226
337
 
227
338
  # Phase 5: Validation (verify and finalize)
228
339
  self.executor.execute_validation_phase(self.path, mode, progress_callback)
@@ -230,6 +341,9 @@ class ProjectInitializer:
230
341
  # Phase 6: Create runtime memory files (auto-generated per user/session)
231
342
  memory_files = self._create_memory_files()
232
343
 
344
+ # Phase 7: Create user settings (gitignored, user-specific)
345
+ user_settings_files = self._create_user_settings()
346
+
233
347
  # Generate result
234
348
  duration = int((time.time() - start_time) * 1000) # ms
235
349
  return InstallationResult(
@@ -239,7 +353,7 @@ class ProjectInitializer:
239
353
  mode=mode,
240
354
  locale=locale,
241
355
  duration=duration,
242
- created_files=resource_files + config_files + memory_files,
356
+ created_files=resource_files + config_files + memory_files + user_settings_files,
243
357
  )
244
358
 
245
359
  except Exception as e:
@@ -264,9 +378,7 @@ class ProjectInitializer:
264
378
  return (self.path / ".moai").exists()
265
379
 
266
380
 
267
- def initialize_project(
268
- project_path: Path, progress_callback: ProgressCallback | None = None
269
- ) -> InstallationResult:
381
+ def initialize_project(project_path: Path, progress_callback: ProgressCallback | None = None) -> InstallationResult:
270
382
  """Initialize project (for CLI command)
271
383
 
272
384
  Args:
@@ -109,24 +109,12 @@ class PhaseExecutor:
109
109
 
110
110
  # Enhanced version context with multiple format options
111
111
  version_context["MOAI_VERSION"] = moai_version
112
- version_context["MOAI_VERSION_SHORT"] = self._format_short_version(
113
- moai_version
114
- )
115
- version_context["MOAI_VERSION_DISPLAY"] = self._format_display_version(
116
- moai_version
117
- )
118
- version_context["MOAI_VERSION_TRIMMED"] = self._format_trimmed_version(
119
- moai_version, max_length=10
120
- )
121
- version_context["MOAI_VERSION_SEMVER"] = self._format_semver_version(
122
- moai_version
123
- )
124
- version_context["MOAI_VERSION_VALID"] = (
125
- "true" if moai_version != "unknown" else "false"
126
- )
127
- version_context["MOAI_VERSION_SOURCE"] = self._get_version_source(
128
- version_reader
129
- )
112
+ version_context["MOAI_VERSION_SHORT"] = self._format_short_version(moai_version)
113
+ version_context["MOAI_VERSION_DISPLAY"] = self._format_display_version(moai_version)
114
+ version_context["MOAI_VERSION_TRIMMED"] = self._format_trimmed_version(moai_version, max_length=10)
115
+ version_context["MOAI_VERSION_SEMVER"] = self._format_semver_version(moai_version)
116
+ version_context["MOAI_VERSION_VALID"] = "true" if moai_version != "unknown" else "false"
117
+ version_context["MOAI_VERSION_SOURCE"] = self._get_version_source(version_reader)
130
118
 
131
119
  # Add performance metrics for debugging
132
120
  cache_age = version_reader.get_cache_age_seconds()
@@ -140,18 +128,10 @@ class PhaseExecutor:
140
128
  # Use fallback version with comprehensive fallback formatting
141
129
  fallback_version = __version__
142
130
  version_context["MOAI_VERSION"] = fallback_version
143
- version_context["MOAI_VERSION_SHORT"] = self._format_short_version(
144
- fallback_version
145
- )
146
- version_context["MOAI_VERSION_DISPLAY"] = self._format_display_version(
147
- fallback_version
148
- )
149
- version_context["MOAI_VERSION_TRIMMED"] = self._format_trimmed_version(
150
- fallback_version, max_length=10
151
- )
152
- version_context["MOAI_VERSION_SEMVER"] = self._format_semver_version(
153
- fallback_version
154
- )
131
+ version_context["MOAI_VERSION_SHORT"] = self._format_short_version(fallback_version)
132
+ version_context["MOAI_VERSION_DISPLAY"] = self._format_display_version(fallback_version)
133
+ version_context["MOAI_VERSION_TRIMMED"] = self._format_trimmed_version(fallback_version, max_length=10)
134
+ version_context["MOAI_VERSION_SEMVER"] = self._format_semver_version(fallback_version)
155
135
  version_context["MOAI_VERSION_VALID"] = "true"
156
136
  version_context["MOAI_VERSION_SOURCE"] = "fallback_package"
157
137
  version_context["MOAI_VERSION_CACHE_AGE"] = "unavailable"
@@ -292,9 +272,7 @@ class PhaseExecutor:
292
272
  progress_callback: Optional progress callback.
293
273
  """
294
274
  self.current_phase = 2
295
- self._report_progress(
296
- "Phase 2: Creating directory structure...", progress_callback
297
- )
275
+ self._report_progress("Phase 2: Creating directory structure...", progress_callback)
298
276
 
299
277
  for directory in self.REQUIRED_DIRECTORIES:
300
278
  dir_path = project_path / directory
@@ -316,6 +294,8 @@ class PhaseExecutor:
316
294
  Returns:
317
295
  List of created files or directories.
318
296
  """
297
+ import stat
298
+
319
299
  self.current_phase = 3
320
300
  self._report_progress("Phase 3: Installing resources...", progress_callback)
321
301
 
@@ -329,11 +309,7 @@ class PhaseExecutor:
329
309
  language_config = {}
330
310
 
331
311
  # Detect OS for cross-platform Hook path configuration
332
- hook_project_dir = (
333
- "%CLAUDE_PROJECT_DIR%"
334
- if platform.system() == "Windows"
335
- else "$CLAUDE_PROJECT_DIR"
336
- )
312
+ hook_project_dir = "%CLAUDE_PROJECT_DIR%" if platform.system() == "Windows" else "$CLAUDE_PROJECT_DIR"
337
313
 
338
314
  # Get enhanced version context with fallback strategies
339
315
  version_context = self._get_enhanced_version_context()
@@ -347,20 +323,32 @@ class PhaseExecutor:
347
323
  "PROJECT_VERSION": config.get("version", "0.1.0"),
348
324
  "PROJECT_OWNER": config.get("author", "@user"),
349
325
  "AUTHOR": config.get("author", "@user"),
350
- "CONVERSATION_LANGUAGE": language_config.get(
351
- "conversation_language", "en"
352
- ),
353
- "CONVERSATION_LANGUAGE_NAME": language_config.get(
354
- "conversation_language_name", "English"
355
- ),
326
+ "CONVERSATION_LANGUAGE": language_config.get("conversation_language", "en"),
327
+ "CONVERSATION_LANGUAGE_NAME": language_config.get("conversation_language_name", "English"),
356
328
  "CODEBASE_LANGUAGE": config.get("language", "generic"),
357
329
  "PROJECT_DIR": hook_project_dir,
358
330
  }
359
331
  processor.set_context(context)
360
332
 
361
- processor.copy_templates(
362
- backup=False, silent=True
363
- ) # Avoid progress bar conflicts
333
+ processor.copy_templates(backup=False, silent=True) # Avoid progress bar conflicts
334
+
335
+ # Post-process: Set executable permission on shell scripts
336
+ # This is necessary because git may not preserve file permissions during clone/checkout
337
+ scripts_dir = project_path / ".moai" / "scripts"
338
+ logger = logging.getLogger(__name__)
339
+ if scripts_dir.exists():
340
+ logger.debug(f"Processing shell scripts in {scripts_dir}")
341
+ for script_file in scripts_dir.glob("*.sh"):
342
+ try:
343
+ # Add execute permission for user, group, and others
344
+ current_mode = script_file.stat().st_mode
345
+ new_mode = current_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
346
+ script_file.chmod(new_mode)
347
+ logger.debug(f"Set executable permission on {script_file}: {oct(current_mode)} -> {oct(new_mode)}")
348
+ except Exception as e:
349
+ logger.warning(f"Failed to set executable permission on {script_file}: {e}")
350
+ else:
351
+ logger.debug(f"Scripts directory not found: {scripts_dir}")
364
352
 
365
353
  # Return a simplified list of generated assets
366
354
  return [
@@ -388,9 +376,7 @@ class PhaseExecutor:
388
376
  List of created files.
389
377
  """
390
378
  self.current_phase = 4
391
- self._report_progress(
392
- "Phase 4: Generating configurations...", progress_callback
393
- )
379
+ self._report_progress("Phase 4: Generating configurations...", progress_callback)
394
380
 
395
381
  logger = logging.getLogger(__name__)
396
382
 
@@ -407,9 +393,7 @@ class PhaseExecutor:
407
393
  existing_config = {}
408
394
 
409
395
  # Enhanced config merging with comprehensive version preservation
410
- merged_config = self._merge_configuration_preserving_versions(
411
- config, existing_config
412
- )
396
+ merged_config = self._merge_configuration_preserving_versions(config, existing_config)
413
397
 
414
398
  # Enhanced version handling using VersionReader for consistency
415
399
  try:
@@ -417,17 +401,11 @@ class PhaseExecutor:
417
401
  current_config_version = version_reader.get_version()
418
402
 
419
403
  # Ensure version consistency across the merged config
420
- self._ensure_version_consistency(
421
- merged_config, current_config_version, existing_config
422
- )
404
+ self._ensure_version_consistency(merged_config, current_config_version, existing_config)
423
405
 
424
- logger.debug(
425
- f"Version consistency check completed. Current version: {current_config_version}"
426
- )
406
+ logger.debug(f"Version consistency check completed. Current version: {current_config_version}")
427
407
  except Exception as e:
428
- logger.warning(
429
- f"Version consistency check failed: {e}. Using fallback version."
430
- )
408
+ logger.warning(f"Version consistency check failed: {e}. Using fallback version.")
431
409
  merged_config["moai"]["version"] = __version__
432
410
 
433
411
  # Write final config with enhanced formatting
@@ -467,9 +445,7 @@ class PhaseExecutor:
467
445
  for section_name, strategy in config_sections.items():
468
446
  if section_name in existing_config:
469
447
  logger.debug(f"Merging section: {section_name}")
470
- self._merge_config_section(
471
- merged_config, existing_config, section_name, strategy
472
- )
448
+ self._merge_config_section(merged_config, existing_config, section_name, strategy)
473
449
 
474
450
  return merged_config
475
451
 
@@ -553,12 +529,8 @@ class PhaseExecutor:
553
529
  elif "version" in config_moai:
554
530
  # Version already in new config, validate it
555
531
  config_version = config_moai["version"]
556
- if config_version == "unknown" or not self._is_valid_version_format(
557
- config_version
558
- ):
559
- logger.debug(
560
- f"Invalid config version {config_version}, updating to current: {current_version}"
561
- )
532
+ if config_version == "unknown" or not self._is_valid_version_format(config_version):
533
+ logger.debug(f"Invalid config version {config_version}, updating to current: {current_version}")
562
534
  config_moai["version"] = current_version
563
535
  else:
564
536
  # No version found, use current version
@@ -580,9 +552,7 @@ class PhaseExecutor:
580
552
  pattern = r"^v?(\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?)$"
581
553
  return bool(re.match(pattern, version))
582
554
 
583
- def _write_configuration_file(
584
- self, config_path: Path, config: dict[str, Any]
585
- ) -> None:
555
+ def _write_configuration_file(self, config_path: Path, config: dict[str, Any]) -> None:
586
556
  """
587
557
  Write configuration file with enhanced formatting and error handling.
588
558
 
@@ -621,9 +591,7 @@ class PhaseExecutor:
621
591
  progress_callback: Optional progress callback.
622
592
  """
623
593
  self.current_phase = 5
624
- self._report_progress(
625
- "Phase 5: Validation and finalization...", progress_callback
626
- )
594
+ self._report_progress("Phase 5: Validation and finalization...", progress_callback)
627
595
 
628
596
  # Validate installation results
629
597
  # Comprehensive installation validation
@@ -631,9 +599,8 @@ class PhaseExecutor:
631
599
  # - 0-project.md, 1-plan.md, 2-run.md, 3-sync.md
632
600
  self.validator.validate_installation(project_path)
633
601
 
634
- # Initialize Git for team mode
635
- if mode == "team":
636
- self._initialize_git(project_path)
602
+ # Initialize Git for all modes (team, personal, solo)
603
+ self._initialize_git(project_path)
637
604
 
638
605
  def _create_backup(self, project_path: Path) -> None:
639
606
  """Create a single backup (v0.4.2).
@@ -698,11 +665,17 @@ class PhaseExecutor:
698
665
  dst_item.mkdir(parents=True, exist_ok=True)
699
666
 
700
667
  def _initialize_git(self, project_path: Path) -> None:
701
- """Initialize a Git repository.
668
+ """Initialize a Git repository if not already initialized.
702
669
 
703
670
  Args:
704
671
  project_path: Project path.
705
672
  """
673
+ # Check if .git directory already exists
674
+ git_dir = project_path / ".git"
675
+ if git_dir.exists() and git_dir.is_dir():
676
+ # Git already initialized, skip
677
+ return
678
+
706
679
  try:
707
680
  subprocess.run(
708
681
  ["git", "init"],
@@ -33,7 +33,7 @@ class ProjectValidator:
33
33
 
34
34
  # Required files
35
35
  REQUIRED_FILES = [
36
- ".moai/config/config.json",
36
+ ".moai/config/config.yaml",
37
37
  "CLAUDE.md",
38
38
  ]
39
39
 
@@ -59,9 +59,7 @@ class ProjectValidator:
59
59
  import sys
60
60
 
61
61
  if sys.version_info < (3, 10):
62
- raise ValidationError(
63
- f"Python 3.10+ required (current: {sys.version_info.major}.{sys.version_info.minor})"
64
- )
62
+ raise ValidationError(f"Python 3.10+ required (current: {sys.version_info.major}.{sys.version_info.minor})")
65
63
 
66
64
  def validate_project_path(self, project_path: Path) -> None:
67
65
  """Verify the project path.
@@ -78,9 +76,7 @@ class ProjectValidator:
78
76
 
79
77
  # Parent directory must exist
80
78
  if not project_path.parent.exists():
81
- raise ValidationError(
82
- f"Parent directory does not exist: {project_path.parent}"
83
- )
79
+ raise ValidationError(f"Parent directory does not exist: {project_path.parent}")
84
80
 
85
81
  # Prevent initialization inside the MoAI-ADK package
86
82
  if self._is_inside_moai_package(project_path):
@@ -108,18 +104,16 @@ class ProjectValidator:
108
104
  if not file_path.exists():
109
105
  raise ValidationError(f"Required file not found: {file}")
110
106
 
111
- alfred_dir = project_path / ".claude" / "commands" / "alfred"
107
+ moai_commands_dir = project_path / ".claude" / "commands" / "moai"
112
108
  missing_commands = []
113
109
  for cmd in self.REQUIRED_ALFRED_COMMANDS:
114
- cmd_path = alfred_dir / cmd
110
+ cmd_path = moai_commands_dir / cmd
115
111
  if not cmd_path.exists():
116
112
  missing_commands.append(cmd)
117
113
 
118
114
  if missing_commands:
119
115
  missing_list = ", ".join(missing_commands)
120
- raise ValidationError(
121
- f"Required Alfred command files not found: {missing_list}"
122
- )
116
+ raise ValidationError(f"Required Alfred command files not found: {missing_list}")
123
117
 
124
118
  def _is_inside_moai_package(self, project_path: Path) -> bool:
125
119
  """Determine whether the path is inside the MoAI-ADK package.
@@ -43,9 +43,7 @@ class TrustChecker:
43
43
  # T: Test First - Coverage Validation
44
44
  # ========================================
45
45
 
46
- def validate_coverage(
47
- self, project_path: Path, coverage_data: dict[str, Any]
48
- ) -> ValidationResult:
46
+ def validate_coverage(self, project_path: Path, coverage_data: dict[str, Any]) -> ValidationResult:
49
47
  """
50
48
  Validate test coverage (≥85%)
51
49
 
@@ -119,9 +117,7 @@ class TrustChecker:
119
117
  loc = len(lines)
120
118
 
121
119
  if loc > MAX_FILE_LINES_OF_CODE:
122
- violations.append(
123
- f"{py_file.name}: {loc} LOC (Limit: {MAX_FILE_LINES_OF_CODE})"
124
- )
120
+ violations.append(f"{py_file.name}: {loc} LOC (Limit: {MAX_FILE_LINES_OF_CODE})")
125
121
  except (UnicodeDecodeError, PermissionError):
126
122
  # Security: handle file access errors
127
123
  continue
@@ -129,9 +125,7 @@ class TrustChecker:
129
125
  if not violations:
130
126
  return ValidationResult(passed=True, message="All files within 300 LOC")
131
127
 
132
- details = "Files exceeding 300 LOC:\n" + "\n".join(
133
- f" - {v}" for v in violations
134
- )
128
+ details = "Files exceeding 300 LOC:\n" + "\n".join(f" - {v}" for v in violations)
135
129
  details += "\n\nRecommended: Refactor large files into smaller modules."
136
130
 
137
131
  return ValidationResult(
@@ -181,9 +175,7 @@ class TrustChecker:
181
175
  if not violations:
182
176
  return ValidationResult(passed=True, message="All functions within 50 LOC")
183
177
 
184
- details = "Functions exceeding 50 LOC:\n" + "\n".join(
185
- f" - {v}" for v in violations
186
- )
178
+ details = "Functions exceeding 50 LOC:\n" + "\n".join(f" - {v}" for v in violations)
187
179
  details += "\n\nRecommended: Extract complex functions into smaller ones."
188
180
 
189
181
  return ValidationResult(
@@ -222,13 +214,9 @@ class TrustChecker:
222
214
  continue
223
215
 
224
216
  if not violations:
225
- return ValidationResult(
226
- passed=True, message="All functions within 5 parameters"
227
- )
217
+ return ValidationResult(passed=True, message="All functions within 5 parameters")
228
218
 
229
- details = "Functions exceeding 5 parameters:\n" + "\n".join(
230
- f" - {v}" for v in violations
231
- )
219
+ details = "Functions exceeding 5 parameters:\n" + "\n".join(f" - {v}" for v in violations)
232
220
  details += "\n\nRecommended: Use data classes or parameter objects."
233
221
 
234
222
  return ValidationResult(
@@ -267,13 +255,9 @@ class TrustChecker:
267
255
  continue
268
256
 
269
257
  if not violations:
270
- return ValidationResult(
271
- passed=True, message="All functions within complexity 10"
272
- )
258
+ return ValidationResult(passed=True, message="All functions within complexity 10")
273
259
 
274
- details = "Functions exceeding complexity 10:\n" + "\n".join(
275
- f" - {v}" for v in violations
276
- )
260
+ details = "Functions exceeding complexity 10:\n" + "\n".join(f" - {v}" for v in violations)
277
261
  details += "\n\nRecommended: Simplify complex logic using guard clauses."
278
262
 
279
263
  return ValidationResult(
@@ -295,9 +279,7 @@ class TrustChecker:
295
279
  complexity = 1
296
280
  for child in ast.walk(node):
297
281
  # Add 1 for each branching statement
298
- if isinstance(
299
- child, (ast.If, ast.While, ast.For, ast.ExceptHandler, ast.With)
300
- ):
282
+ if isinstance(child, (ast.If, ast.While, ast.For, ast.ExceptHandler, ast.With)):
301
283
  complexity += 1
302
284
  # Add 1 for each and/or operator
303
285
  elif isinstance(child, ast.BoolOp):