moai-adk 0.4.5__py3-none-any.whl β†’ 0.20.1__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 (433) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +74 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/analyze.py +119 -0
  5. moai_adk/cli/commands/backup.py +25 -1
  6. moai_adk/cli/commands/doctor.py +31 -5
  7. moai_adk/cli/commands/improve_user_experience.py +307 -0
  8. moai_adk/cli/commands/init.py +111 -10
  9. moai_adk/cli/commands/status.py +33 -3
  10. moai_adk/cli/commands/update.py +921 -130
  11. moai_adk/cli/commands/validate_links.py +120 -0
  12. moai_adk/cli/prompts/init_prompts.py +22 -87
  13. moai_adk/core/analysis/__init__.py +9 -0
  14. moai_adk/core/analysis/session_analyzer.py +388 -0
  15. moai_adk/core/analysis/tag_chain_analyzer.py +344 -0
  16. moai_adk/core/analysis/tag_chain_repair.py +879 -0
  17. moai_adk/core/config/__init__.py +19 -0
  18. moai_adk/core/config/migration.py +235 -0
  19. moai_adk/core/git/__init__.py +1 -1
  20. moai_adk/core/git/branch.py +1 -1
  21. moai_adk/core/git/commit.py +1 -1
  22. moai_adk/core/git/manager.py +1 -1
  23. moai_adk/core/issue_creator.py +313 -0
  24. moai_adk/core/mcp/setup.py +56 -0
  25. moai_adk/core/mcp/setup_old.py +296 -0
  26. moai_adk/core/project/backup_utils.py +1 -1
  27. moai_adk/core/project/checker.py +2 -2
  28. moai_adk/core/project/detector.py +211 -12
  29. moai_adk/core/project/initializer.py +85 -15
  30. moai_adk/core/project/phase_executor.py +76 -13
  31. moai_adk/core/project/validator.py +13 -13
  32. moai_adk/core/quality/__init__.py +1 -1
  33. moai_adk/core/quality/trust_checker.py +1 -1
  34. moai_adk/core/quality/validators/__init__.py +1 -1
  35. moai_adk/core/quality/validators/base_validator.py +1 -1
  36. moai_adk/core/tags/__init__.py +86 -0
  37. moai_adk/core/tags/auto_corrector.py +693 -0
  38. moai_adk/core/tags/ci_validator.py +463 -0
  39. moai_adk/core/tags/cli.py +283 -0
  40. moai_adk/core/tags/generator.py +109 -0
  41. moai_adk/core/tags/inserter.py +99 -0
  42. moai_adk/core/tags/mapper.py +126 -0
  43. moai_adk/core/tags/parser.py +76 -0
  44. moai_adk/core/tags/policy_validator.py +580 -0
  45. moai_adk/core/tags/pre_commit_validator.py +421 -0
  46. moai_adk/core/tags/reporter.py +956 -0
  47. moai_adk/core/tags/rollback_manager.py +525 -0
  48. moai_adk/core/tags/tags.py +149 -0
  49. moai_adk/core/tags/validator.py +897 -0
  50. moai_adk/core/template/__init__.py +1 -1
  51. moai_adk/core/template/backup.py +1 -1
  52. moai_adk/core/template/merger.py +50 -1
  53. moai_adk/core/template/processor.py +119 -13
  54. moai_adk/core/template_engine.py +268 -0
  55. moai_adk/templates/.claude/agents/alfred/backend-expert.md +348 -0
  56. moai_adk/templates/.claude/agents/alfred/cc-manager.md +209 -944
  57. moai_adk/templates/.claude/agents/alfred/database-expert.md +352 -0
  58. moai_adk/templates/.claude/agents/alfred/debug-helper.md +34 -5
  59. moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
  60. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +38 -8
  61. moai_adk/templates/.claude/agents/alfred/format-expert.md +469 -0
  62. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
  63. moai_adk/templates/.claude/agents/alfred/git-manager.md +128 -9
  64. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +104 -6
  65. moai_adk/templates/.claude/agents/alfred/project-manager.md +88 -16
  66. moai_adk/templates/.claude/agents/alfred/quality-gate.md +36 -9
  67. moai_adk/templates/.claude/agents/alfred/security-expert.md +270 -0
  68. moai_adk/templates/.claude/agents/alfred/skill-factory.md +865 -0
  69. moai_adk/templates/.claude/agents/alfred/spec-builder.md +214 -43
  70. moai_adk/templates/.claude/agents/alfred/tag-agent.md +111 -9
  71. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +309 -160
  72. moai_adk/templates/.claude/agents/alfred/trust-checker.md +36 -7
  73. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +605 -0
  74. moai_adk/templates/.claude/commands/alfred/0-project.md +393 -966
  75. moai_adk/templates/.claude/commands/alfred/1-plan.md +651 -367
  76. moai_adk/templates/.claude/commands/alfred/2-run.md +388 -241
  77. moai_adk/templates/.claude/commands/alfred/3-sync.md +1921 -410
  78. moai_adk/templates/.claude/commands/alfred/9-feedback.md +153 -0
  79. moai_adk/templates/.claude/commands/alfred/release-new.md +3604 -0
  80. moai_adk/templates/.claude/hooks/alfred/core/project.py +484 -20
  81. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  82. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  83. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
  84. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +14 -6
  85. moai_adk/templates/.claude/hooks/alfred/post_tool__enable_streaming_ui.py +50 -0
  86. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +93 -0
  87. moai_adk/templates/.claude/hooks/alfred/post_tool__tag_auto_corrector.py +407 -0
  88. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +99 -0
  89. moai_adk/templates/.claude/hooks/alfred/pre_tool__realtime_tag_monitor.py +335 -0
  90. moai_adk/templates/.claude/hooks/alfred/pre_tool__tag_policy_validator.py +325 -0
  91. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +93 -0
  92. moai_adk/templates/.claude/hooks/alfred/session_start__auto_cleanup.py +580 -0
  93. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +298 -0
  94. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +170 -0
  95. moai_adk/templates/.claude/hooks/alfred/{core β†’ shared/core}/checkpoint.py +3 -3
  96. moai_adk/templates/.claude/hooks/alfred/{core β†’ shared/core}/context.py +5 -5
  97. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
  98. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +230 -0
  99. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
  100. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
  101. moai_adk/templates/.claude/hooks/alfred/shared/handlers/daily_analysis.py +351 -0
  102. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +154 -0
  103. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +174 -0
  104. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +87 -0
  105. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +61 -0
  106. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +111 -0
  107. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  108. moai_adk/templates/.claude/hooks/alfred/utils/hook_config.py +94 -0
  109. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
  110. moai_adk/templates/.claude/output-styles/alfred/alfred-moai-adk-beginner.md +267 -0
  111. moai_adk/templates/.claude/output-styles/alfred/keating-personal-tutor.md +440 -0
  112. moai_adk/templates/.claude/output-styles/alfred/r2d2-agentic-coding.md +583 -0
  113. moai_adk/templates/.claude/settings.json +96 -14
  114. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
  115. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
  116. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +242 -0
  117. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/SKILL.md +237 -0
  118. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/examples.md +871 -0
  119. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/reference.md +653 -0
  120. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/README.md +162 -0
  121. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/SKILL.md +227 -0
  122. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/examples.md +354 -0
  123. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/reference.md +158 -0
  124. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +179 -79
  125. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +117 -0
  126. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/scripts/pre-review-check.sh +62 -0
  127. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +132 -0
  128. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
  129. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
  130. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
  131. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
  132. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
  133. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
  134. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
  135. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
  136. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
  137. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
  138. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
  139. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +229 -0
  140. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
  141. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +150 -0
  142. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
  143. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
  144. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
  145. moai_adk/templates/.claude/skills/moai-alfred-personas/README.md +42 -0
  146. moai_adk/templates/.claude/skills/moai-alfred-personas/SKILL.md +429 -0
  147. moai_adk/templates/.claude/skills/moai-alfred-personas/examples.md +520 -0
  148. moai_adk/templates/.claude/skills/moai-alfred-personas/reference.md +405 -0
  149. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
  150. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
  151. moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +369 -0
  152. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
  153. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
  154. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
  155. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
  156. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
  157. moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +539 -0
  158. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +320 -0
  159. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
  160. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
  161. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +137 -0
  162. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +219 -0
  163. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +161 -0
  164. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +541 -0
  165. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +622 -0
  166. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
  167. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
  168. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
  169. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
  170. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +269 -0
  171. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  172. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +298 -0
  173. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  174. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +307 -0
  175. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  176. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +252 -0
  177. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  178. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  179. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  180. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +199 -0
  181. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  182. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +316 -0
  183. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  184. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +263 -0
  185. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  186. moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +482 -0
  187. moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +303 -0
  188. moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
  189. moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +477 -0
  190. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  191. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  192. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  193. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
  194. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +273 -0
  195. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  196. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +583 -0
  197. moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +526 -0
  198. moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +608 -0
  199. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +328 -0
  200. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +312 -0
  201. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
  202. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +285 -0
  203. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +278 -0
  204. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +303 -0
  205. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +291 -0
  206. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  207. moai_adk/templates/.claude/skills/moai-change-logger/SKILL.md +563 -0
  208. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
  209. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
  210. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
  211. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
  212. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
  213. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
  214. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
  215. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
  216. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
  217. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
  218. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
  219. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
  220. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
  221. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
  222. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
  223. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
  224. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
  225. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
  226. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +102 -73
  227. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
  228. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
  229. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
  230. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
  231. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
  232. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
  233. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
  234. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
  235. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
  236. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
  237. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
  238. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
  239. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
  240. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
  241. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +265 -64
  242. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1064 -0
  243. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1047 -0
  244. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
  245. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
  246. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
  247. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
  248. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
  249. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
  250. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
  251. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
  252. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
  253. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +80 -62
  254. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
  255. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
  256. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +207 -50
  257. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
  258. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
  259. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
  260. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
  261. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
  262. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
  263. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
  264. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
  265. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
  266. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
  267. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
  268. moai_adk/templates/.claude/skills/moai-foundation-trust/.!11330!examples.md +0 -0
  269. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
  270. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  271. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
  272. moai_adk/templates/.claude/skills/moai-jit-docs-enhanced/SKILL.md +460 -0
  273. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
  274. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
  275. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
  276. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
  277. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
  278. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
  279. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +2358 -70
  280. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
  281. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
  282. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +2962 -68
  283. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
  284. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
  285. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +1898 -70
  286. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
  287. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
  288. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +1465 -68
  289. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
  290. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
  291. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +2364 -66
  292. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
  293. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
  294. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +1630 -69
  295. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
  296. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
  297. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +89 -61
  298. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
  299. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
  300. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +735 -66
  301. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
  302. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
  303. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
  304. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
  305. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
  306. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
  307. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
  308. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
  309. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +1834 -70
  310. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
  311. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
  312. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +99 -74
  313. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
  314. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
  315. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
  316. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
  317. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
  318. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
  319. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
  320. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
  321. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +1959 -69
  322. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
  323. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
  324. moai_adk/templates/.claude/skills/moai-lang-template/SKILL.md +348 -0
  325. moai_adk/templates/.claude/skills/moai-lang-template/VARIABLES.md +98 -0
  326. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +1230 -66
  327. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
  328. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
  329. moai_adk/templates/.claude/skills/moai-learning-optimizer/SKILL.md +575 -0
  330. moai_adk/templates/.claude/skills/moai-project-batch-questions/README.md +50 -0
  331. moai_adk/templates/.claude/skills/moai-project-batch-questions/SKILL.md +304 -0
  332. moai_adk/templates/.claude/skills/moai-project-batch-questions/examples.md +417 -0
  333. moai_adk/templates/.claude/skills/moai-project-batch-questions/reference.md +704 -0
  334. moai_adk/templates/.claude/skills/moai-project-config-manager/README.md +87 -0
  335. moai_adk/templates/.claude/skills/moai-project-config-manager/SKILL.md +552 -0
  336. moai_adk/templates/.claude/skills/moai-project-config-manager/examples.md +1109 -0
  337. moai_adk/templates/.claude/skills/moai-project-config-manager/reference.md +514 -0
  338. moai_adk/templates/.claude/skills/moai-project-config-manager/validate.py +106 -0
  339. moai_adk/templates/.claude/skills/moai-project-documentation/README.md +11 -0
  340. moai_adk/templates/.claude/skills/moai-project-documentation/SKILL.md +622 -0
  341. moai_adk/templates/.claude/skills/moai-project-documentation/examples.md +20 -0
  342. moai_adk/templates/.claude/skills/moai-project-documentation/reference.md +12 -0
  343. moai_adk/templates/.claude/skills/moai-project-language-initializer/README.md +152 -0
  344. moai_adk/templates/.claude/skills/moai-project-language-initializer/SKILL.md +285 -0
  345. moai_adk/templates/.claude/skills/moai-project-language-initializer/examples.md +333 -0
  346. moai_adk/templates/.claude/skills/moai-project-language-initializer/reference.md +386 -0
  347. moai_adk/templates/.claude/skills/moai-project-template-optimizer/README.md +49 -0
  348. moai_adk/templates/.claude/skills/moai-project-template-optimizer/SKILL.md +319 -0
  349. moai_adk/templates/.claude/skills/moai-project-template-optimizer/examples.md +58 -0
  350. moai_adk/templates/.claude/skills/moai-project-template-optimizer/reference.md +123 -0
  351. moai_adk/templates/.claude/skills/moai-session-info/SKILL.md +314 -0
  352. moai_adk/templates/.claude/skills/moai-streaming-ui/SKILL.md +552 -0
  353. moai_adk/templates/.claude/skills/moai-tag-policy-validator/SKILL.md +570 -0
  354. moai_adk/templates/.git-hooks/pre-commit +66 -0
  355. moai_adk/templates/.git-hooks/pre-push +255 -0
  356. moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
  357. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
  358. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
  359. moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
  360. moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
  361. moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
  362. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
  363. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
  364. moai_adk/templates/.github/workflows/moai-gitflow.yml +166 -3
  365. moai_adk/templates/.github/workflows/moai-release-create.yml +100 -0
  366. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +188 -0
  367. moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
  368. moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
  369. moai_adk/templates/.github/workflows/release.yml +118 -0
  370. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
  371. moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
  372. moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
  373. moai_adk/templates/.github/workflows/spec-issue-sync.yml +338 -0
  374. moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
  375. moai_adk/templates/.github/workflows/tag-report.yml +269 -0
  376. moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
  377. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
  378. moai_adk/templates/.mcp.json +31 -0
  379. moai_adk/templates/.moai/config.json +80 -7
  380. moai_adk/templates/CLAUDE.md +562 -546
  381. moai_adk/utils/banner.py +5 -5
  382. moai_adk/utils/common.py +294 -0
  383. moai_adk/utils/link_validator.py +235 -0
  384. moai_adk/utils/logger.py +8 -8
  385. moai_adk/utils/user_experience.py +451 -0
  386. moai_adk-0.20.1.dist-info/METADATA +233 -0
  387. moai_adk-0.20.1.dist-info/RECORD +404 -0
  388. moai_adk/templates/.claude/hooks/alfred/README.md +0 -230
  389. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -156
  390. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +0 -85
  391. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +0 -25
  392. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +0 -92
  393. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +0 -70
  394. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +0 -41
  395. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -636
  396. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -692
  397. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -470
  398. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -103
  399. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -103
  400. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -95
  401. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -105
  402. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -97
  403. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -97
  404. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -90
  405. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -99
  406. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -87
  407. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -62
  408. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -94
  409. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -513
  410. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -433
  411. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
  412. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
  413. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
  414. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
  415. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
  416. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -100
  417. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -99
  418. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -100
  419. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -98
  420. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -98
  421. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
  422. moai_adk/templates/.moai/memory/development-guide.md +0 -344
  423. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -220
  424. moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
  425. moai_adk/templates/.moai/project/product.md +0 -161
  426. moai_adk/templates/.moai/project/structure.md +0 -156
  427. moai_adk/templates/.moai/project/tech.md +0 -227
  428. moai_adk/templates/__init__.py +0 -2
  429. moai_adk-0.4.5.dist-info/METADATA +0 -369
  430. moai_adk-0.4.5.dist-info/RECORD +0 -152
  431. {moai_adk-0.4.5.dist-info β†’ moai_adk-0.20.1.dist-info}/WHEEL +0 -0
  432. {moai_adk-0.4.5.dist-info β†’ moai_adk-0.20.1.dist-info}/entry_points.txt +0 -0
  433. {moai_adk-0.4.5.dist-info β†’ moai_adk-0.20.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: alfred:0-project
3
- description: Initialize project document - create product/structure/tech.md and set optimization for each language
3
+ description: "Initialize project metadata and documentation"
4
+ argument-hint: "[setting|update]"
4
5
  allowed-tools:
5
6
  - Read
6
7
  - Write
@@ -16,39 +17,58 @@ allowed-tools:
16
17
  ---
17
18
 
18
19
  # πŸ“‹ MoAI-ADK Step 0: Initialize/Update Universal Language Support Project Documentation
19
- > Interactive prompts rely on `Skill("moai-alfred-tui-survey")` so AskUserQuestion renders TUI selection menus for user surveys and approvals.
20
+
21
+ > **Note**: Interactive prompts use `AskUserQuestion tool (documented in moai-alfred-ask-user-questions skill)` for TUI selection menus. The skill is loaded on-demand when user interaction is required.
20
22
 
21
23
  ## 🎯 Command Purpose
22
24
 
23
- Automatically analyzes the project environment to create/update product/structure/tech.md documents and configure language-specific optimization settings.
25
+ Automatically analyzes the project environment to create/update product/structure/tech.md documents and configure language-specific optimization settings with **language-first contextual flows**.
24
26
 
25
- ## πŸ“‹ Execution flow
27
+ ## 🌐 Language-First Architecture (CRITICAL)
26
28
 
27
- 0. **Conversation Language Selection**: User selects the language for all dialogs and documentation
28
- 1. **Environment Analysis**: Automatically detect project type (new/legacy) and codebase language
29
- 2. **Establishment of interview strategy**: Select question tree suited to project characteristics
30
- 3. **User Verification**: Review and approve interview plan
31
- 4. **Create project documentation**: Create product/structure/tech.md in the selected language
32
- 5. **Create configuration file**: config.json auto-configuration
29
+ **Core Principle**: Language selection ALWAYS happens BEFORE any other configuration or operations.
33
30
 
34
- ## 🧠 Associated Skills & Agents
31
+ ### Language-First Flow Rules
32
+ 1. **Language First**: Language selection is the VERY FIRST step in ANY flow
33
+ 2. **Context Persistence**: Once selected, ALL subsequent interactions use that language
34
+ 3. **Flow Adaptation**: Each flow (fresh install/update/settings) adapts based on language context
35
+ 4. **Settings Respect**: Existing language settings are confirmed before any operations
35
36
 
36
- | Agent | Core Skill | Purpose |
37
- | ----- | -------- | ------- |
38
- | project-manager | `moai-alfred-language-detection` | Initialize project and interview requirements |
39
- | trust-checker | `moai-alfred-trust-validation` | Verify initial project structure (optional) |
37
+ ### Contextual Flow Differentiation
38
+ | Context | Language Handling | Flow Type | Key Features |
39
+ |---------|-------------------|-----------|--------------|
40
+ | **Fresh Install** | Language selection FIRST | Installation questionnaire | Complete setup, language-aware documentation |
41
+ | **Update Mode** | Language confirmation FIRST | Update/merge questionnaire | Template optimization, language-aware updates |
42
+ | **Existing Project** | Language confirmation FIRST | Settings modification options | Language change priority, contextual settings |
40
43
 
41
- **Note**: TUI Survey Skill is used for user confirmations during project initialization and is shared across all interactive prompts.
44
+ ## πŸ“‹ Execution Flow
45
+
46
+ **Step 1: Command Routing** - Detect subcommand and route to appropriate workflow
47
+ **Step 2: Language Context Establishment** - ALWAYS determine/confirm language FIRST
48
+ **Step 3: Contextual Flow Execution** - Execute appropriate contextual flow
49
+ **Step 4: Skills Integration** - Use specialized skills with language context
50
+ **Step 5: Completion** - Provide next step options in selected language
51
+
52
+ ## 🧠 Associated Skills & Agents
53
+
54
+ | Agent/Skill | Core Skill | Purpose |
55
+ | ------------------------------ | ----------------------------------- | --------------------------------------------- |
56
+ | project-manager | `moai-alfred-language-detection` | Initialize project and interview requirements |
57
+ | trust-checker | `moai-alfred-trust-validation` | Verify initial project structure (optional) |
58
+ | **NEW: Language Initializer** | `moai-project-language-initializer` | Handle language and user setup workflows |
59
+ | **NEW: Config Manager** | `moai-project-config-manager` | Manage all configuration operations |
60
+ | **NEW: Template Optimizer** | `moai-project-template-optimizer` | Handle template comparison and optimization |
61
+ | **NEW: Batch Questions** | `moai-project-batch-questions` | Standardize user interaction patterns |
42
62
 
43
63
  ## πŸ”— Associated Agent
44
64
 
45
65
  - **Primary**: project-manager (πŸ“‹ planner) - Dedicated to project initialization
46
66
  - **Quality Check**: trust-checker (βœ… Quality assurance lead) - Initial structural verification (optional)
47
- - **Secondary**: None (standalone execution)
67
+ - **Secondary**: 4 specialized skills for complex workflows
48
68
 
49
69
  ## πŸ’‘ Example of use
50
70
 
51
- The user executes the `/alfred:8-project` command to analyze the project and create/update documents.
71
+ The user executes the `/alfred:0-project` command to analyze the project and create/update documents.
52
72
 
53
73
  ## Command Overview
54
74
 
@@ -58,12 +78,14 @@ It is a systematic initialization system that analyzes the project environment a
58
78
  - **Project type classification**: Automatically determine new vs. existing projects
59
79
  - **High-performance initialization**: Achieve 0.18 second initialization with TypeScript-based CLI
60
80
  - **2-step workflow**: 1) Analysis and planning β†’ 2) Execution after user approval
81
+ - **Skills-based architecture**: Complex operations handled by dedicated skills
61
82
 
62
83
  ## How to use
63
84
 
64
- The user executes the `/alfred:8-project` command to start analyzing the project and creating/updating documents.
85
+ The user executes the `/alfred:0-project` command to start analyzing the project and creating/updating documents.
65
86
 
66
87
  **Automatic processing**:
88
+
67
89
  - Update mode if there is an existing `.moai/project/` document
68
90
  - New creation mode if there is no document
69
91
  - Automatic detection of language and project type
@@ -75,7 +97,7 @@ The user executes the `/alfred:8-project` command to start analyzing the project
75
97
  - ❌ Create a file in the `.claude/memory/` directory
76
98
  - ❌ Create a file `.claude/commands/alfred/*.json`
77
99
  - ❌ Unnecessary overwriting of existing documents
78
- - ❌ Date and numerical prediction (β€œwithin 3 months”, β€œ50% reduction”) etc.)
100
+ - ❌ Date and numerical prediction ("within 3 months", "50% reduction") etc.
79
101
  - ❌ Hypothetical scenarios, expected market size, future technology trend predictions
80
102
 
81
103
  **Expressions to use**:
@@ -88,1020 +110,425 @@ The user executes the `/alfred:8-project` command to start analyzing the project
88
110
 
89
111
  ---
90
112
 
91
- ## πŸš€ STEP 0: Conversation Language Selection (NEW in v0.4.2)
92
-
93
- **Purpose**: Establish the conversation language before project initialization begins. This selection applies to all Alfred prompts, interview questions, and generated documentation.
94
-
95
- ### 0.1 Display Language Selection Menu
96
-
97
- Alfred displays a language selection menu as the **very first interaction** using `Skill("moai-alfred-tui-survey")`:
98
-
99
- **Question**:
100
- ```
101
- Which language would you like to use for the project initialization and documentation?
102
- ```
103
-
104
- **Options** (AskUserQuestion with moai-alfred-tui-survey):
105
- - **English** (en) β€” All dialogs and documentation in English
106
- - **ν•œκ΅­μ–΄** (ko) β€” All dialogs and documentation in Korean
107
- - **ζ—₯本θͺž** (ja) β€” All dialogs and documentation in Japanese
108
- - **δΈ­ζ–‡** (zh) β€” All dialogs and documentation in Chinese
109
- - **Other** β€” User can specify custom language (e.g., "EspaΓ±ol", "FranΓ§ais", "Deutsch")
110
-
111
- ### 0.2 Store Language Preference
112
-
113
- Alfred records the selected language:
114
-
115
- ```json
116
- {
117
- "conversation_language": "ko",
118
- "conversation_language_name": "ν•œκ΅­μ–΄",
119
- "selected_at": "2025-10-22T12:34:56Z"
120
- }
121
- ```
122
-
123
- This language preference is:
124
- - Passed to all sub-agents as a context parameter
125
- - Stored in `.moai/config.json` under `language` field
126
- - Used to generate all documentation in the selected language
127
- - Displayed in CLAUDE.md under "## Project Information"
128
-
129
- ### 0.3 Transition to STEP 1
130
-
131
- After language selection, all subsequent interactions proceed in the selected language:
132
- - Alfred's prompts are translated
133
- - project-manager sub-agent receives language parameter
134
- - Interview questions are in the selected language
135
- - Generated documents (product.md, structure.md, tech.md) are in the selected language
136
- - CLAUDE.md displays the selected language prominently
137
-
138
- **Example output for Korean selection**:
139
- ```markdown
140
- βœ… μ–Έμ–΄ 선택 μ™„λ£Œ: ν•œκ΅­μ–΄ (ko)
141
-
142
- 이제 ν”„λ‘œμ νŠΈ ν™˜κ²½ λΆ„μ„μœΌλ‘œ μ§„ν–‰ν•˜κ² μŠ΅λ‹ˆλ‹€...
143
- ```
144
-
145
- ---
146
-
147
- ## πŸš€ STEP 1: Environmental analysis and interview plan development
148
-
149
- Analyze the project environment and develop a systematic interview plan.
150
-
151
- ### 1.0 Check backup directory (highest priority)
152
-
153
- **Processing backup files after moai-adk init reinitialization**
154
-
155
- Alfred first checks the `.moai-backups/` directory:
156
-
157
- ```bash
158
- # Check latest backup timestamp
159
- ls -t .moai-backups/ | head -1
160
-
161
- # Check the optimized flag in config.json
162
- grep "optimized" .moai/config.json
163
- ```
164
-
165
- **Backup existence conditions**:
166
- - `.moai-backups/` directory exists
167
- - `.moai/project/*.md` file exists in the latest backup folder
168
- - `optimized: false` in `config.json` (immediately after reinitialization)
169
-
170
- **Select user if backup exists**
171
- Call `Skill("moai-alfred-tui-survey")` to display a TUI with the following options:
172
- - **Merge**: Merge backup contents and latest template (recommended)
173
- - **New**: Ignore the backup and start a new interview
174
- - **Skip**: Keep current file (terminate task)
175
-
176
- **Response processing**:
177
- - **"Merge"** β†’ Proceed to Phase 1.1 (backup merge workflow)
178
- - **"Create new"** β†’ Proceed to Phase 1.2 (Project environment analysis) (existing process)
179
- - **"Skip"** β†’ End task
180
-
181
- **No backup or optimized: true**:
182
- - Proceed directly to Phase 1.2 (project environment analysis)
183
-
184
- ---
185
-
186
- ### 1.1 Backup merge workflow (when user selects β€œMerge”)
187
-
188
- **Purpose**: Restore only user customizations while maintaining the latest template structure.
189
-
190
- **STEP 1: Read backup file**
191
-
192
- Alfred reads files from the latest backup directory:
193
- ```bash
194
- # Latest backup directory path
195
- BACKUP_DIR=.moai-backups/$(ls -t .moai-backups/ | head -1)
196
-
197
- # Read backup file
198
- Read $BACKUP_DIR/.moai/project/product.md
199
- Read $BACKUP_DIR/.moai/project/structure.md
200
- Read $BACKUP_DIR/.moai/project/tech.md
201
- Read $BACKUP_DIR/CLAUDE.md
202
- ```
203
-
204
- **STEP 2: Detect template defaults**
205
-
206
- The following patterns are considered "template defaults" (not merged):
207
- - "Define your key user base"
208
- - "Describe the core problem you are trying to solve"
209
- - "List the strengths and differences of your project"
210
- - "{{PROJECT_NAME}}", "{{PROJECT_DESCRIPTION}}", etc. Variable format
211
- - Guide phrases such as "Example:", "Sample:", "Example:", etc.
212
-
213
- **STEP 3: Extract user customization**
214
-
215
- Extract only **non-template default content** from the backup file:
216
- - `product.md`:
217
- - Define your actual user base in the USER section
218
- - Describe the actual problem in the PROBLEM section
219
- - Real differences in the STRATEGY section
220
- - Actual success metrics in the SUCCESS section
221
- - `structure.md`:
222
- - Actual design in the ARCHITECTURE section
223
- - Actual module structure in the MODULES section
224
- - Actual integration plan in the INTEGRATION section
225
- - `tech.md`:
226
- - The actual technology stack
227
- in the STACK section - The actual framework
228
- in the FRAMEWORK section - The actual quality policy
229
- in the QUALITY section - `HISTORY` section: **Full Preservation** (all files)
230
-
231
- **STEP 4: Merge Strategy**
232
-
233
- ```markdown
234
- Latest template structure (v0.4.0+)
235
- ↓
236
- Insert user customization (extracted from backup file)
237
- ↓
238
- HISTORY section updates
239
- ↓
240
- Version update (v0.1.x β†’ v0.1.x+1)
241
- ```
242
-
243
- **Merge Principle**:
244
- - βœ… Maintain the latest version of the template structure (section order, header, @TAG format)
245
- - βœ… Insert only user customization (actual content written)
246
- - βœ… Cumulative preservation of the HISTORY section (existing history + merge history)
247
- - ❌ Replace template default values ​​with the latest version
248
-
249
- **STEP 5: HISTORY Section Update**
250
-
251
- After the merge is complete, add history to the HISTORY section of each file:
252
- ```yaml
253
- ### v0.1.x+1 (2025-10-19)
254
- - **UPDATED**: Merge backup files (automatic optimization)
255
- - AUTHOR: @Alfred
256
- - BACKUP: .moai-backups/20251018-003638/
257
- - REASON: Restoring user customization after moai-adk init reinitialization
258
- ```
259
-
260
- **STEP 6: Update config.json**
261
-
262
- Set optimization flags after the merge is complete:
263
- ```json
264
- {
265
- "project": {
266
- "optimized": true,
267
- "last_merge": "2025-10-19T12:34:56+09:00",
268
- "backup_source": ".moai-backups/20251018-003638/"
269
- }
270
- }
271
- ```
272
-
273
- **STEP 7: Completion Report**
274
-
275
- ```markdown
276
- βœ… Backup merge completed!
277
-
278
- πŸ“ Merged files:
279
- - .moai/project/product.md (v0.1.4 β†’ v0.1.5)
280
- - .moai/project/structure.md (v0.1.1 β†’ v0.1.2)
281
- - .moai/project/tech.md (v0.1.1 β†’ v0.1.2)
282
- - .moai/config.json (optimized: false β†’ true)
283
-
284
- πŸ” Merge history:
285
- - USER section: Restore customized contents of backup file
286
- - PROBLEM section: Restore problem description of backup file
287
- - STRATEGY section: Restore differentials of backup file
288
- - HISTORY section: Add merge history (cumulative retention)
113
+ ## πŸš€ Command Router: Detect and Route
114
+
115
+ **Your immediate task**: Detect which subcommand the user provided and route to the correct workflow.
116
+
117
+ ### Step 1: Check what subcommand the user provided
118
+
119
+ **Look at the user's command carefully**:
120
+ - Did they type `/alfred:0-project setting`?
121
+ - Did they type `/alfred:0-project update`?
122
+ - Did they type just `/alfred:0-project` (no subcommand)?
123
+ - Did they type something invalid like `/alfred:0-project xyz`?
124
+
125
+ ### Step 2: Route based on subcommand
126
+
127
+ **IF user typed: `/alfred:0-project setting`**:
128
+ 1. Print: "πŸ”§ Entering Settings Mode - Modify existing project configuration"
129
+ 2. **IMPORTANT**: Language context will be established in SETTINGS MODE
130
+ 3. Jump to **SETTINGS MODE** below
131
+ 4. Skip ALL other sections
132
+ 5. Stop after completing SETTINGS MODE
133
+ 6. **DO NOT proceed** to other workflows
134
+
135
+ **ELSE IF user typed: `/alfred:0-project update`**:
136
+ 1. Print: "πŸ”„ Entering Template Update Mode - Optimize templates after moai-adk update"
137
+ 2. **IMPORTANT**: Language context will be established FIRST in UPDATE MODE
138
+ 3. Jump to **UPDATE MODE** below
139
+ 4. Skip ALL other sections
140
+ 5. Stop after completing UPDATE MODE
141
+ 6. **DO NOT proceed** to other workflows
142
+
143
+ **ELSE IF user typed: `/alfred:0-project` (no subcommand, nothing after)**:
144
+ 1. Check if the file `.moai/config.json` exists in the current directory
145
+ - Read the file path: `.moai/config.json`
146
+ - IF file exists β†’ Print "βœ… Project is already initialized!" AND jump to **AUTO-DETECT MODE**
147
+ - IF file does NOT exist β†’ Print "πŸš€ Starting first-time project initialization..." AND jump to **INITIALIZATION MODE**
148
+ - **CRITICAL**: Both modes will establish language context FIRST
149
+
150
+ **ELSE IF user typed an invalid subcommand** (like `/alfred:0-project xyz`):
151
+ 1. Print this error message:
152
+ ```
153
+ ❌ Unknown subcommand: xyz
289
154
 
290
- πŸ’Ύ Backup file location:
291
- - Original backup: .moai-backups/20251018-003638/
292
- - Retention period: Permanent (until manual deletion)
155
+ Valid subcommands:
156
+ /alfred:0-project - Auto-detect mode (first-time or already initialized)
157
+ /alfred:0-project setting - Modify existing settings
158
+ /alfred:0-project update - Optimize templates after moai-adk update
293
159
 
294
- πŸ“‹ Next steps:
295
- 1. Review the merged document
296
- 2. Additional modifications if necessary
297
- 3. Create your first SPEC with /alfred:1-plan
160
+ Example: /alfred:0-project setting
161
+ ```
162
+ 2. Exit immediately
163
+ 3. **DO NOT make any changes**
298
164
 
299
- ---
300
- **Task completed: /alfred:0-project terminated**
301
- ```
165
+ ### Step 3: CRITICAL RULES
302
166
 
303
- **Finish work after merge**: Complete immediately without interview
167
+ ⚠️ **IMPORTANT - Read this carefully**:
168
+ - Execute ONLY ONE mode per command invocation
169
+ - **DO NOT execute multiple modes** (e.g., do not run setting mode AND first-time setup in the same invocation)
170
+ - Stop and exit immediately after completing the selected mode
171
+ - **DO NOT jump to other workflows** unless that is the explicitly detected mode
172
+ - **DO NOT guess** which mode the user wanted - always detect from their actual command
304
173
 
305
174
  ---
306
175
 
307
- ### 1.2 Run project environment analysis (when user selects "New" or no backup)
308
-
309
- **Automatically analyzed items**:
310
-
311
- 1. **Project Type Detection**
312
- Alfred classifies new vs existing projects by analyzing the directory structure:
313
- - Empty directory β†’ New project
314
- - Code/documentation present β†’ Existing project
176
+ ## πŸ”§ SETTINGS MODE: Modify Existing Project Configuration
315
177
 
316
- 2. **Auto-detect language/framework**: Detects the main language of your project based on file patterns
317
- - pyproject.toml, requirements.txt β†’ Python
318
- - package.json, tsconfig.json β†’ TypeScript/Node.js
319
- - pom.xml, build.gradle β†’ Java
320
- - go.mod β†’ Go
321
- - Cargo.toml β†’ Rust
322
- - backend/ + frontend/ β†’ full stack
178
+ **When to execute**: `/alfred:0-project setting` OR user selected "Modify Settings" from auto-detect mode
323
179
 
324
- 3. **Document status analysis**
325
- - Check the status of existing `.moai/project/*.md` files
326
- - Identify areas of insufficient information
327
- - Organize items that need supplementation
180
+ ### Step 1: Language-First Settings Context
181
+ **IMPORTANT**: Always establish language context BEFORE any settings modifications.
328
182
 
329
- 4. **Project structure evaluation**
330
- - Directory structure complexity
331
- - Monolingual vs. hybrid vs. microservice
332
- - Code base size estimation
183
+ 1. **Check `.moai/config.json`** for existing language settings
184
+ 2. **Language Confirmation** (in current language):
185
+ - If no config exists β†’ **STOP** and redirect to INITIALIZATION MODE
186
+ - If config exists β†’ Display current language and confirm
187
+ 3. **Set Settings Language Context**: ALL settings interactions in confirmed language
333
188
 
334
- ### 1.3 Establish interview strategy (when user selects β€œNew”)
335
-
336
- **Select question tree by project type**:
337
-
338
- | Project Type | Question Category | Focus Areas |
339
- | ------------------------- | ------------------ | --------------------------------------------- |
340
- | **New Project** | Product Discovery | Mission, Users, Problems Solved |
341
- | **Existing Project** | Legacy Analysis | Code Base, Technical Debt, Integration Points |
342
- | **TypeScript conversion** | Migration Strategy | TypeScript conversion for existing projects |
343
-
344
- **Question Priority**:
345
- - **Essential Questions**: Core Business Value, Key User Bases (all projects)
346
- - **Technical Questions**: Language/Framework, Quality Policy, Deployment Strategy
347
- - **Governance**: Security Requirements, Traceability Strategy (Optional)
348
-
349
- ### 1.4 Generate Interview Plan Report (when user selects β€œCreate New”)
350
-
351
- **Format of plan to be presented to users**:
352
-
353
- ```markdown
354
- ## πŸ“Š Project initialization plan: [PROJECT-NAME]
189
+ ### Step 2: Load and Display Current Configuration (in confirmed language)
190
+ 1. **Read `.moai/config.json`** to verify it exists and is valid JSON
191
+ 2. **Extract and display current settings** (in confirmed language):
192
+ ```
193
+ βœ… **μ–Έμ–΄**: [language.conversation_language_name]
194
+ βœ… **λ‹‰λ„€μž„**: [user.nickname]
195
+ βœ… **μ—μ΄μ „νŠΈ ν”„λ‘¬ν”„νŠΈ μ–Έμ–΄**: [language.agent_prompt_language]
196
+ βœ… **GitHub μžλ™ 브랜치 μ‚­μ œ**: [github.auto_delete_branches]
197
+ βœ… **SPEC Git μ›Œν¬ν”Œλ‘œμš°**: [github.spec_git_workflow]
198
+ βœ… **λ³΄κ³ μ„œ 생성**: [report_generation.user_choice]
199
+ βœ… **μ„ νƒλœ 도메인**: [stack.selected_domains]
200
+ ```
355
201
 
356
- ### Environmental Analysis Results
357
- - **Project Type**: [New/Existing/Hybrid]
358
- - **Languages ​​Detected**: [Language List]
359
- - **Current Document Status**: [Completeness Rating 0-100%]
360
- - **Structure Complexity**: [Simple/Medium/Complex]
202
+ ### Step 3: Language Change Option (CRITICAL)
203
+ **Before showing other settings, offer language change first** (in confirmed language):
361
204
 
362
- ### 🎯 Interview strategy
363
- - **Question category**: Product Discovery / Structure / Tech
364
- - **Expected number of questions**: [N (M required + K optional)]
365
- - **Estimated time required**: [Time estimation]
366
- - **Priority area**: [Focus on Areas to be covered]
205
+ 1. **Language Priority Question**:
206
+ - "μ–Έμ–΄ 섀정을 λ³€κ²½ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?" (in Korean)
207
+ - "Would you like to change language settings?" (in English)
208
+ - Options: "Change Language" | "Keep Current" | "Show All Settings"
367
209
 
368
- ### ⚠️ Notes
369
- - **Existing document**: [Overwrite vs supplementation strategy]
370
- - **Language settings**: [Automatic detection vs manual setting]
371
- - **Configuration conflicts**: [Compatibility with existing config.json]
210
+ 2. **IF user selects "Change Language"**:
211
+ ```python
212
+ Skill("moai-project-language-initializer", mode="language_change_only")
213
+ ```
214
+ - Update language context
215
+ - Restart settings mode in new language
372
216
 
373
- ### βœ… Expected deliverables
374
- - **product.md**: [Business requirements document]
375
- - **structure.md**: [System architecture document]
376
- - **tech.md**: [Technology stack and policy document]
377
- - **config.json**: [Project configuration file]
217
+ 3. **IF user selects "Keep Current" or "Show All Settings"**:
218
+ - Continue with current language context
219
+ - Proceed to Step 4
378
220
 
379
- ---
380
- **Approval Request**: Would you like to proceed with the interview using the above plan?
381
- (Choose β€œProceed,” β€œModify [Content],” or β€œAbort”)
221
+ ### Step 4: Use Config Manager Skill (Language-Aware)
222
+ ```python
223
+ Skill("moai-project-config-manager", language=confirmed_language)
382
224
  ```
383
225
 
384
- ### 1.5 Wait for user approval (moai-alfred-tui-survey) (when user selects "New")
385
-
386
- After Alfred receives the project-manager's interview plan report, calls `Skill("moai-alfred-tui-survey")` and asks whether Phase 2 is approved.
387
- - **Proceed**: Interview conducted according to approved plan
388
- - **Modify**: Re-establish the plan (re-execute Phase 1)
389
- - **Stop**: Stop initialization
390
-
391
- **Response processing**:
392
- - **"Progress"** (`answers["0"] === "Progress"`) β†’ Execute Phase 2
393
- - **"Modify"** (`answers["0"] === "Modify"`) β†’ Repeat Phase 1 (recall project-manager)
394
- - **"Abort"** (`answers["0"] === "Abort"`) β†’ End task
226
+ **Purpose**: Let the skill handle all configuration modification workflows with language context
227
+ **The skill will** (in confirmed language):
228
+ - Ask which settings to modify (using batched questions in confirmed language)
229
+ - Collect new values using batched questions in confirmed language
230
+ - Update config.json with proper merge strategy
231
+ - Handle validation and error recovery with language-appropriate messages
232
+ - Provide completion report in confirmed language
233
+
234
+ ### Step 5: Exit after completion (in confirmed language)
235
+ 1. **Print**: "βœ… μ„€μ • μ—…λ°μ΄νŠΈ μ™„λ£Œ!" (or equivalent in confirmed language)
236
+ 2. **Offer Next Steps** (in confirmed language):
237
+ - Option 1: "μΆ”κ°€ μ„€μ • μˆ˜μ •" β†’ Continue settings mode
238
+ - Option 2: "ν”„λ‘œμ νŠΈ λ¬Έμ„œ 생성" β†’ Guide to `/alfred:1-plan`
239
+ - Option 3: "μ’…λ£Œ" β†’ End command
240
+ 3. **Do NOT proceed** to any other workflows
241
+ 4. **End command execution**
395
242
 
396
243
  ---
397
244
 
398
- ## πŸš€ STEP 2: Execute project initialization (after user approves β€œNew”)
399
-
400
- **Note**: This step will only be executed if the user selects **"New"**.
401
- - When selecting "Merge": End the task in Phase 1.1 (Merge Backups)
402
- - When selecting "Skip": End the task
403
- - When selecting "New": Proceed with the process below
404
-
405
- After user approval, the project-manager agent performs initialization.
406
-
407
- ### 2.1 Call project-manager agent (when user selects "New")
408
-
409
- Alfred starts project initialization by calling the project-manager agent with the following parameters:
410
-
411
- **Parameters passed to project-manager**:
412
- - **conversation_language** (from STEP 0): Language code selected by user (e.g., "ko", "en", "ja", "zh")
413
- - **language_name** (from STEP 0): Display name of selected language (e.g., "Korean", "English")
414
- - Detected Languages: [Language List from codebase detection]
415
- - Project Type: [New/Existing]
416
- - Existing Document Status: [Existence/Absence]
417
- - Approved Interview Plan: [Plan Summary]
418
-
419
- **Execution**:
420
- ```bash
421
- # Pseudo-code showing parameter flow
422
- Task(
423
- subagent_type="project-manager",
424
- description="Initialize project with conversation language support",
425
- prompt=f"""You are project-manager. Initialize project with these parameters:
426
- - conversation_language: "{conversation_language}" # e.g., "ko"
427
- - language_name: "{language_name}" # e.g., "Korean"
428
- - project_type: "{project_type}" # e.g., "new"
429
- - detected_languages: {detected_languages}
430
-
431
- All interviews and documentation must be generated in the conversation_language.
432
- Update .moai/config.json with these language parameters.
433
- """
434
- )
435
- ```
436
-
437
- **Outcome**: The project-manager agent conducts structured interviews entirely in the selected language and creates/updates product/structure/tech.md documents in that language.
438
-
439
- ### 2.2 Automatic activation of Alfred Skills (optional)
440
-
441
- After the project-manager has finished creating the document, **Alfred can optionally call Skills** (upon user request).
442
-
443
- **Automatic activation conditions** (optional):
444
-
445
- | Conditions | Automatic selection Skill | Purpose |
446
- | ------------------------------------ | ---------------------------- | -------------------------------------- |
447
- | User Requests β€œQuality Verification” | moai-alfred-trust-validation | Initial project structure verification |
448
-
449
- **Execution flow** (optional):
450
- ```
451
- 1. project-manager completion
452
- ↓
453
- 2. User selection:
454
- - "Quality verification required" β†’ moai-alfred-trust-validation (Level 1 quick scan)
455
- - "Skip" β†’ Complete immediately
456
- ```
457
-
458
- **Note**: Quality verification is optional during the project initialization phase.
459
-
460
- ### 2.3 Sub-agent moai-alfred-tui-survey (Nested)
461
-
462
- **The project-manager agent can internally call the TUI survey skill** to check the details of the task.
463
-
464
- **When to call**:
465
- - Before overwriting existing project documents
466
- - When selecting language/framework
467
- - When changing important settings
468
-
469
- **Example** (inside project-manager): Ask whether to "overwrite file" with `Skill("moai-alfred-tui-survey")`,
470
- - Allows you to choose between **Overwrite** / **Merge** / **Skip**.
471
-
472
- **Nested pattern**:
473
- - **Command level** (Phase approval): Called by Alfred β†’ "Shall we proceed with Phase 2?"
474
- - **Sub-agent level** (Detailed confirmation): Called by project-manager β†’ "Shall we overwrite the file?"
475
-
476
- ### 2.4 Processing method by project type
477
-
478
- #### A. New project (Greenfield)
479
-
480
- **Interview Flow**:
481
-
482
- 1. **Product Discovery** (create product.md)
483
- - Define core mission (@DOC:MISSION-001)
484
- - Identify key user base (@SPEC:USER-001)
485
- - Identify key problems to solve (@SPEC:PROBLEM-001)
486
- - Summary of differences and strengths (@DOC:STRATEGY-001)
487
- - Setting success indicators (@SPEC:SUCCESS-001)
488
-
489
- 2. **Structure Blueprint** (create structure.md)
490
- - Selection of architecture strategy (@DOC:ARCHITECTURE-001)
491
- - Division of responsibilities by module (@DOC:MODULES-001)
492
- - External system integration plan (@DOC:INTEGRATION-001)
493
- - Define traceability strategy (@DOC:TRACEABILITY-001)
494
-
495
- 3. **Tech Stack Mapping** (written by tech.md)
496
- - Select language & runtime (@DOC:STACK-001)
497
- - Determine core framework (@DOC:FRAMEWORK-001)
498
- - Set quality gate (@DOC:QUALITY-001)
499
- - Define security policy (@DOC:SECURITY-001)
500
- - Plan distribution channels (@DOC:DEPLOY-001)
501
-
502
- **Automatically generate config.json**:
503
- ```json
504
- {
505
- "project_name": "detected-name",
506
- "project_type": "single|fullstack|microservice",
507
- "project_language": "python|typescript|java|go|rust",
508
- "test_framework": "pytest|vitest|junit|go test|cargo test",
509
- "linter": "ruff|biome|eslint|golint|clippy",
510
- "formatter": "black|biome|prettier|gofmt|rustfmt",
511
- "coverage_target": 85,
512
- "mode": "personal"
513
- }
514
- ```
515
-
516
- #### B. Existing project (legacy introduction)
517
-
518
- **Legacy Snapshot & Alignment**:
519
-
520
- **STEP 1: Identify the overall project structure**
521
-
522
- Alfred identifies the entire project structure:
523
- - Visualize the directory structure using the tree or find commands
524
- - Exclude build artifacts such as node_modules, .git, dist, build, __pycache__, etc.
525
- - Identify key source directories and configuration files.
526
-
527
- **Output**:
528
- - Visualize the entire folder/file hierarchy of the project
529
- - Identify major directories (src/, tests/, docs/, config/, etc.)
530
- - Check language/framework hint files (package.json, pyproject.toml, go.mod, etc.)
531
-
532
- **STEP 2: Establish parallel analysis strategy**
533
-
534
- Alfred identifies groups of files by the Glob pattern:
535
- 1. **Configuration files**: *.json, *.toml, *.yaml, *.yml, *.config.js
536
- 2. **Source code files**: src/**/*.{ts,js,py,go,rs,java}
537
- 3. **Test files**: tests/**/*.{ts,js,py,go,rs,java}, **/*.test.*, **/*.spec.*
538
- 4. **Documentation files**: *.md, docs/**/*.md, README*, CHANGELOG*
539
-
540
- **Parallel Read Strategy**:
541
- - Speed ​​up analysis by reading multiple files simultaneously with the Read tool
542
- - Batch processing for each file group
543
- - Priority: Configuration file β†’ Core source β†’ Test β†’ Document
544
-
545
- **STEP 3: Analysis and reporting of characteristics for each file**
546
-
547
- As each file is read, the following information is collected:
548
-
549
- 1. **Configuration file analysis**
550
- - Project metadata (name, version, description)
551
- - Dependency list and versions
552
- - Build/test script
553
- - Confirm language/framework
554
-
555
- 2. **Source code analysis**
556
- - Identify major modules and classes
557
- - Architectural pattern inference (MVC, clean architecture, microservice, etc.)
558
- - Identify external API calls and integration points
559
- - Key areas of domain logic
560
-
561
- 3. **Test code analysis**
562
- - Check test framework
563
- - Identify coverage settings
564
- - Identify key test scenarios
565
- - Evaluate TDD compliance
566
-
567
- 4. **Document analysis**
568
- - Existing README contents
569
- - Existence of architecture document
570
- - API document status
571
- - Installation/deployment guide completeness
572
-
573
- **Report Format**:
574
- ```markdown
575
- ## Analysis results for each file
576
-
577
- ### Configuration file
578
- - package.json: Node.js 18+, TypeScript 5.x, Vitest test
579
- - tsconfig.json: strict mode, ESNext target
580
- - biome.json: Linter/formatter settings exist
581
-
582
- ### Source code (src/)
583
- - src/core/: Core business logic (3 modules)
584
- - src/api/: REST API endpoints (5 routers)
585
- - src/utils/: Utility functions (logging, verification, etc.)
586
- - Architecture: Hierarchical (controller) β†’ service β†’ repository)
587
-
588
- ### Tests (tests/)
589
- - Vitest + @testing-library used
590
- - Unit test coverage estimated at about 60%
591
- - E2E testing lacking
592
-
593
- ### Documentation
594
- - README.md: Only installation guide
595
- - Absence of API documentation
596
- - Absence of architecture document
597
- ```
245
+ ## πŸ”„ UPDATE MODE: Template Optimization After moai-adk Update
598
246
 
599
- **STEP 4: Comprehensive analysis and product/structure/tech reflection**
600
-
601
- Based on the collected information, it is reflected in three major documents:
602
-
603
- 1. Contents reflected in **product.md**
604
- - Project mission extracted from existing README/document
605
- - Main user base and scenario inferred from code
606
- - Backtracking of core problem to be solved
607
- - Preservation of existing assets in β€œLegacy Context”
608
-
609
- 2. Contents reflected in **structure.md**
610
- - Identified actual directory structure
611
- - Responsibility analysis results for each module
612
- - External system integration points (API calls, DB connections, etc.)
613
- - Technical debt items (marked with @CODE tag)
614
-
615
- 3. **tech.md reflection content**
616
- - Languages/frameworks/libraries actually in use
617
- - Existing build/test pipeline
618
- - Status of quality gates (linter, formatter, test coverage)
619
- - Identification of security/distribution policy
620
- - Items requiring improvement (marked with TODO tags)
621
-
622
- **Preservation Policy**:
623
- - Supplement only the missing parts without overwriting existing documents
624
- - Preserve conflicting content in the β€œLegacy Context” section
625
- - Mark items needing improvement with @CODE and TODO tags
626
-
627
- **Example Final Report**:
628
- ```markdown
629
- ## Complete analysis of existing project
630
-
631
- ### Environment Information
632
- - **Language**: TypeScript 5.x (Node.js 18+)
633
- - **Framework**: Express.js
634
- - **Test**: Vitest (coverage ~60%)
635
- - **Linter/Formatter**: Biome
636
-
637
- ### Main findings
638
- 1. **Strengths**:
639
- - High type safety (strict mode)
640
- - Clear module structure (separation of core/api/utils)
641
-
642
- 2. **Needs improvement**:
643
- - Test coverage below 85% (TODO:TEST-COVERAGE-001)
644
- - Absence of API documentation (TODO:DOCS-API-001)
645
- - Insufficient E2E testing (@CODE:TEST-E2E-001)
646
-
647
- ### Next step
648
- 1. product/structure/tech.md creation completed
649
- 2. @CODE/TODO item priority confirmation
650
- 3. /alfred:Start writing an improvement SPEC with 1-spec
651
- ```
652
-
653
- ### 2.3 Document creation and verification
247
+ **When to execute**: `/alfred:0-project update` OR user selected template optimization
654
248
 
655
- **Output**:
656
- - `.moai/project/product.md` (Business Requirements)
657
- - `.moai/project/structure.md` (System Architecture)
658
- - `.moai/project/tech.md` (Technology Stack and policy)
659
- - `.moai/config.json` (project settings)
249
+ ### Step 1: Language-First Update Context Detection
250
+ **IMPORTANT**: Always establish language context BEFORE any update operations.
660
251
 
661
- **Quality Verification**:
662
- - [ ] Verify existence of all required @TAG sections
663
- - [ ] Verify compliance with EARS syntax format
664
- - [ ] Verify config.json syntax validity
665
- - [ ] Verify cross-document consistency
252
+ 1. **Check `.moai/config.json`** for existing language settings
253
+ 2. **Language Confirmation** (in current language):
254
+ - If no config exists β†’ Run language selection FIRST
255
+ - If config exists β†’ Confirm current language settings
256
+ 3. **Set Update Language Context**: ALL update interactions in confirmed language
666
257
 
667
- ### 2.4 Completion Report
258
+ ### Step 2: Contextual Update Analysis
259
+ **Analyze the update context** (in confirmed language):
668
260
 
669
- ```markdown
670
- βœ… Project initialization complete!
261
+ 1. **Update Type Detection**:
262
+ ```
263
+ πŸ” **μ—…λ°μ΄νŠΈ μœ ν˜• 뢄석 쀑...**
264
+ βœ… **moai-adk 버전 λ³€κ²½ 감지**: [version detection]
265
+ βœ… **λ°±μ—… 파일 발견**: [backup analysis]
266
+ βœ… **ν…œν”Œλ¦Ώ λ³€κ²½ 사항**: [template differences]
267
+ ```
671
268
 
672
- πŸ“ Documents generated:
673
- - .moai/project/product.md (Business Definition)
674
- - .moai/project/structure.md (Architecture Design)
675
- - .moai/project/tech.md (Technology Stack)
676
- - .moai/config.json (project settings)
269
+ 2. **Backup Discovery**:
270
+ - Check `.moai-backups/` directory for existing backups
271
+ - Analyze backup versions and completeness
272
+ - Identify which backup to use for comparison
677
273
 
678
- πŸ” Detected environments:
679
- - Language: [List of languages]
680
- - Frameworks: [List of frameworks]
681
- - Test tools: [List of tools]
274
+ 3. **Template Comparison**:
275
+ - Check template versions vs current project files
276
+ - Analyze what needs optimization
277
+ - Detect user customizations vs template defaults
682
278
 
683
- πŸ“‹ Next steps:
684
- 1. Review the generated document
685
- 2. Create your first SPEC with /alfred:1-plan
686
- 3. If necessary, readjust with /alfred:8-project update
279
+ ### Step 3: Use Template Optimizer Skill (Language-Aware)
280
+ ```python
281
+ Skill("moai-project-template-optimizer", mode="update", language=confirmed_language)
687
282
  ```
688
283
 
689
- ### 2.5: Initial structural verification (optional)
690
-
691
- After project initialization is complete, you can optionally run quality verification.
692
-
693
- **Execution Conditions**: Only when explicitly requested by the user.
694
-
695
- **Verification Purpose**:
696
- - Basic verification of project documentation and configuration files
697
- - Verification of compliance with the TRUST principles of the initial structure
698
- - Validation of configuration files
699
-
700
- **How ​​it works**:
701
- Alfred only calls the trust-checker agent to perform project initial structural verification if explicitly requested by the user.
702
-
703
- **Verification items**:
704
- - **Document completeness**: Check existence of required sections in product/structure/tech.md
705
- - **Settings validity**: Verify config.json JSON syntax and required fields
706
- - **TAG scheme**: Check compliance with @TAG format in document
707
- - **EARS syntax**: Validation of the EARS template to be used when writing SPECs
284
+ **Purpose**: Let the skill handle template comparison and optimization with language context
285
+ **The skill will** (in confirmed language):
286
+ - Detect and analyze existing backups
287
+ - Compare current templates with backup files
288
+ - Perform smart merging to preserve user customizations
289
+ - Update optimization flags in config.json
290
+ - Generate completion report in confirmed language
708
291
 
709
- **Run Verification**: Level 1 quick scan (3-5 seconds)
710
-
711
- **Handling verification results**:
712
-
713
- βœ… **Pass**: Can proceed to next step
714
- - Documents and settings are all normal
715
-
716
- ⚠️ **Warning**: Proceed after warning
717
- - Some optional sections are missing
718
- - Recommendations not applied
719
-
720
- ❌ **Critical**: Needs fix
721
- - Required section missing
722
- - config.json syntax error
723
- - User choice: β€œRevalidate after fix” or β€œSkip”
724
-
725
- **Skip verification**:
726
- - Verification is not run by default
727
- - Run only when explicitly requested by the user
728
-
729
- ### 2.6: Agent & Skill Tailoring (Project Optimization)
730
-
731
- Based on the results of the interviews and initial analysis, we recommend and activate sub-agents and skills that should be immediately utilized in the project.
732
- Before actual application, user confirmation is received with `Skill("moai-alfred-tui-survey")`, and selected items are recorded in `CLAUDE.md` and `.moai/config.json`.
733
-
734
- #### 2.6.0 Create cc-manager briefing
735
-
736
- Once the document creation is complete, **read all three documents (product/structure/tech.md)** and summarize the following information to create a text called `cc_manager_briefing`.
737
-
738
- - `product.md`: Organize the mission, key users, problems to be solved, success indicators, and backlog (TODO) with a quotation from the original text or a one-line summary.
739
- - `structure.md`: Records architecture type, module boundaries and scope of responsibility, external integration, traceability strategy, and TODO contents.
740
- - `tech.md`: Organizes language/framework version, build/test/deployment procedures, quality/security policy, operation/monitoring method, and TODO items.
741
-
742
- Be sure to include the source (e.g. `product.md@SPEC:SUCCESS-001`) for each item so that cc-manager can understand the basis.
743
-
744
- #### 2.6.1 cc-manager judgment guide
745
-
746
- cc-manager selects the required sub-agents and skills based on the briefing.The table below is a reference guide to help you make a decision, and when making an actual call, the supporting sentences from the relevant document are also delivered.
747
-
748
- |Project requirements (document basis) |Recommended sub-agent/skill |Purpose |
749
- | -------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------ |
750
- |High quality and coverage goals (`product.md@SPEC:SUCCESS-001`) |`tdd-implementer`, `moai-essentials-debug`, `moai-essentials-review` |Establishment of REDΒ·GREENΒ·REFACTOR workflow |
751
- |Traceability/TAG improvement request (`structure.md@DOC:TRACEABILITY-001`) |`doc-syncer`, `moai-alfred-tag-scanning`, `moai-alfred-trust-validation` |Enhanced TAG traceability and document/code synchronization |
752
- |Deployment automation/branch strategy required (`structure.md` Architecture/TODO) |`git-manager`, `moai-alfred-git-workflow`, `moai-foundation-git` |Branch StrategyΒ·Commit PolicyΒ·PR Automation |
753
- |Refactoring legacy modules (`product.md` BACKLOG, `tech.md` TODO) |`implementation-planner`, `moai-alfred-refactoring-coach`, `moai-essentials-refactor` |Technical Debt Diagnosis and Refactoring Roadmap |
754
- |Strengthening regulatory/security compliance (`tech.md@DOC:SECURITY-001`) |`quality-gate`, `moai-alfred-trust-validation`, `moai-foundation-trust`, `moai-domain-security` |TRUST S (Secured) and Trackable Compliance, Security Consulting |
755
- |CLI Automation/Tooling Requirements (`tech.md` BUILD/CLI section) |`implementation-planner`, `moai-domain-cli-tool`, detected language skills (e.g. `moai-lang-python`) |CLI command design, input/output standardization |
756
- |Data analysis/reporting needs (`product.md` DATA, `tech.md` ANALYTICS) |`implementation-planner`, `moai-domain-data-science`, detected language skills |Data PipelineΒ·Notebook Job Definition |
757
- |Improved database structure (`structure.md` DB, `tech.md` STORAGE) |`doc-syncer`, `moai-domain-database`, `moai-alfred-tag-scanning` |Strengthening schema documentation and TAG-DB mapping |
758
- |DevOps/Infrastructure automation required (`tech.md` DEVOPS, `structure.md` CI/CD) |`implementation-planner`, `moai-domain-devops`, `moai-alfred-git-workflow` |Establishing a deployment pipeline and IaC strategy |
759
- |Introduction of ML/AI functions (`product.md` AI, `tech.md` MODEL) |`implementation-planner`, `moai-domain-ml`, detected language skills |Model training/inference pipeline definition |
760
- |Mobile app strategy (`product.md` MOBILE, `structure.md` CLIENT) |`implementation-planner`, `moai-domain-mobile-app`, detected language skills (e.g. `moai-lang-dart`, `moai-lang-swift`) |Mobile client structure design |
761
- |Strengthening coding standards/review process (`tech.md` REVIEW) |`quality-gate`, `moai-essentials-review`, `moai-alfred-code-reviewer` |Strengthening review checklist and quality reporting |
762
- |Requires onboarding/training mode (`tech.md` STACK description, etc.) |`moai-alfred-tui-survey`, `moai-adk-learning`, `agentic-coding` Output style |Enhanced interview TUI and automatically provided onboarding materials |
763
-
764
- > **Language/Domain Skill Selection Rules**
765
- > - Select and add one relevant language skill (`moai-lang-python`, `moai-lang-java`, …) based on the `moai-alfred-language-detection` results or the stack recorded in the Tech section of the briefing.
766
- > - Skills listed in the domain row are automatically included by cc-manager in the `selected_skills` list when the conditions are met.
767
- > - The skill directory is always copied in its entirety, and only actual activation is recorded in `skill_pack` and `CLAUDE.md`.
768
-
769
- If multiple conditions are met, the candidates are merged without duplicates and organized into sets of `candidate_agents`, `candidate_skills`, and `candidate_styles`.
770
-
771
- #### 2.6.2 User confirmation flow
772
-
773
- `Skill("moai-alfred-tui-survey")` asks β€œwhether to enable recommended items.”
774
- - Provides three options: **Install all** / **Install selectively** / **Do not install**.
775
- Selecting β€œSelective Install” presents the list of candidates again as multiple choices, allowing the user to select only the items they need.
776
-
777
- #### 2.6.3 Activation and Recording Steps
778
-
779
- 1. **Preparing briefing**: Organize the results of user selection (install all/install selectively) and the full text of `cc_manager_briefing`.
780
- 2. **Call the cc-manager agent**:
781
- - Call `subagent_type: "cc-manager"` with the `Task` tool and include a briefing and user selections in the prompt.
782
- - cc-manager determines the necessary sub-agents and skills based on the briefing, and copies and updates `CLAUDE.md`, `.claude/agents/alfred/*.md`, and `.claude/skills/*.md` as customized for the project.
783
- 3. **Check for configuration updates**: Review the results reflected by cc-manager.
784
- - Sub-Agents: Keep the `.claude/agents/alfred/` template active and list it in the `CLAUDE.md` β€œAgents” section.
785
- - Skills: Check the `.claude/skills/` document and add it to the `CLAUDE.md` β€œSkills” section.
786
- - Output style: Apply `.claude/output-styles/alfred/` and record the activation in `CLAUDE.md` β€œOutput Styles”.
787
- 4. **Update config.json**
788
- ```json
789
- {
790
- "project": {
791
- "optimized": true,
792
- "agent_pack": ["tdd-implementer", "doc-syncer"],
793
- "skill_pack": ["moai-alfred-git-workflow", "moai-alfred-tag-scanning"],
794
- "output_styles": ["moai-adk-learning"]
795
- }
796
- }
292
+ ### Step 4: Update Confirmation and Completion (in confirmed language)
293
+ 1. **Display Update Results** (in confirmed language):
294
+ ```
295
+ βœ… **ν…œν”Œλ¦Ώ μ΅œμ ν™” μ™„λ£Œ!**
296
+ πŸ“Š **μ—…λ°μ΄νŠΈλœ 파일**: [number]개
297
+ πŸ”§ **μ‚¬μš©μž μ •μ˜ μœ μ§€**: [number]개
298
+ πŸ“ **μƒμ„±λœ λ³΄κ³ μ„œ**: [report location]
797
299
  ```
798
- Merge existing properties, if any.
799
- 5. **Final Report**: Add a list of β€œActivated Sub-Agents/Skills/Style” and a `cc_manager_briefing` summary at the top of the Completion Report, and reflect the same contents in the `CLAUDE.md` table so that they are automatically searched in subsequent commands.
800
-
801
- ## Interview guide by project type
802
-
803
- ### New project interview area
804
-
805
- **Product Discovery** (product.md)
806
- - Core mission and value proposition
807
- - Key user bases and needs
808
- - 3 key problems to solve
809
- - Differentiation compared to competing solutions
810
- - Measurable indicators of success
811
-
812
- **Structure Blueprint** (structure.md)
813
- - System architecture strategy
814
- - Separation of modules and division of responsibilities
815
- - External system integration plan
816
- - @TAG-based traceability strategy
817
-
818
- **Tech Stack Mapping** (tech.md)
819
- - Language/runtime selection and version
820
- - Framework and libraries
821
- - Quality gate policy (coverage, linter)
822
- - Security policy and distribution channel
823
-
824
- ### Existing project interview area
825
-
826
- **Legacy Analysis**
827
- - Identify current code structure and modules
828
- - Status of build/test pipeline
829
- - Identify technical debt and constraints
830
- - External integration and authentication methods
831
- - MoAI-ADK transition priority plan
832
-
833
- **Retention Policy**: Preserve existing documents in the "Legacy Context" section and mark items needing improvement with @CODE/TODO tags
834
-
835
- ## 🏷️ TAG system application rules
836
-
837
- **Automatically create @TAGs per section**:
838
300
 
839
- - Mission/Vision β†’ @DOC:MISSION-XXX, @DOC:STRATEGY-XXX
840
- - Customization β†’ @SPEC:USER-XXX, @SPEC:PERSONA-XXX
841
- - Problem analysis β†’ @SPEC:PROBLEM-XXX, @SPEC:SOLUTION-XXX
842
- - Architecture β†’ @DOC:ARCHITECTURE-XXX, @SPEC:PATTERN-XXX
843
- - Technology Stack β†’ @DOC:STACK-XXX, @DOC:FRAMEWORK-XXX
301
+ 2. **Ask for Next Steps** (in confirmed language):
302
+ - Option 1: "μ—…λ°μ΄νŠΈ λ‚΄μš© κ²€ν† " β†’ Show detailed changes
303
+ - Option 2: "μ„€μ • μˆ˜μ •" β†’ Go to settings mode
304
+ - Option 3: "μ’…λ£Œ" β†’ End command
844
305
 
845
- **Legacy Project Tags**:
306
+ 3. **Exit after completion**
307
+ 4. **Do NOT proceed** to any other workflows
308
+ 5. **End command execution**
846
309
 
847
- - Technical debt β†’ @CODE:REFACTOR-XXX, @CODE:TEST-XXX, @CODE:MIGRATION-XXX
848
- - Resolution plan β†’ @CODE:MIGRATION-XXX, TODO:SPEC-BACKLOG-XXX
849
- - Quality improvement β†’ TODO:TEST-COVERAGE-XXX, TODO:DOCS-SYNC-XXX
310
+ ---
850
311
 
851
- ## Error handling
312
+ ## πŸš€ INITIALIZATION MODE: First-time Project Setup
852
313
 
853
- ### Common errors and solutions
314
+ **When to execute**: `/alfred:0-project` with no existing config.json
854
315
 
855
- **Error 1**: Project language detection failed
856
- ```
857
- Symptom: β€œLanguage not detected” message
858
- Solution: Specify language manually or create language-specific settings file
859
- ```
316
+ ### Step 1: Language-First Initialization (CRITICAL)
317
+ **IMPORTANT**: Language selection MUST happen BEFORE any other configuration.
860
318
 
861
- **Error 2**: Conflict with existing document
862
- ```
863
- Symptom: product.md already exists and has different contents
864
- Solution: Preserve existing contents and add new contents in β€œLegacy Context” section
319
+ 1. **Display**: "πŸš€ Starting first-time project initialization..."
320
+ 2. **Immediate Language Selection**: Use Language Initializer Skill FIRST
321
+ ```python
322
+ Skill("moai-project-language-initializer", mode="language_first")
323
+ ```
324
+ 3. **Language Detection Strategy**:
325
+ - Check environment variables (LANG, locale)
326
+ - Detect from system settings
327
+ - Present language options immediately
328
+ 4. **Language Confirmation**: Display selected language and confirm
329
+ 5. **Set Language Context**: ALL subsequent interactions MUST use selected language
330
+
331
+ ### Step 2: Contextual Fresh Install Flow
332
+ **After language selection, proceed with fresh install workflow**:
333
+
334
+ ```python
335
+ Skill("moai-project-language-initializer", mode="fresh_install", language=selected_language)
865
336
  ```
866
337
 
867
- **Error 3**: Failed to create config.json
868
- ```
869
- Symptom: JSON syntax error or permission denied
870
- Solution: Check file permissions (chmod 644) or create config.json manually
871
- ```
338
+ **Fresh Install Process**:
339
+ 1. **User Profile Collection** (in selected language):
340
+ - Nickname and user preferences
341
+ - Experience level and role
342
+ - Team vs personal mode selection
343
+
344
+ 2. **Project Analysis** (language-aware):
345
+ - Detect project type and codebase language
346
+ - Analyze existing structure (if any)
347
+ - Identify technology stack
348
+
349
+ 3. **Comprehensive Configuration** (in selected language):
350
+ - Team settings (if team mode)
351
+ - Domain selection
352
+ - Report generation preferences
353
+ - GitHub and Git workflow configuration
354
+
355
+ 4. **Create Initial Configuration**:
356
+ - Generate complete `.moai/config.json`
357
+ - Validate all settings
358
+ - Set up language-specific configurations
359
+
360
+ ### Step 3: Project Documentation Creation (Language-Aware)
361
+ 1. **Invoke**: `Task` with `project-manager` agent
362
+ 2. **Pass Language Context**: Ensure all documentation in selected language
363
+ 3. **Parameters**: Language, user preferences, project context
364
+ 4. **The agent will**:
365
+ - Conduct environmental analysis
366
+ - Create interview strategy in selected language
367
+ - Generate project documentation in selected language
368
+
369
+ ### Step 4: Completion and Next Steps (in selected language)
370
+ 1. **Print**: "βœ… ν”„λ‘œμ νŠΈ μ΄ˆκΈ°ν™”κ°€ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!" (or equivalent in selected language)
371
+ 2. **Ask user what to do next** using AskUserQuestion (in selected language):
372
+ - Option 1: "μ‚¬μ–‘μ„œ μž‘μ„±" β†’ Guide to `/alfred:1-plan`
373
+ - Option 2: "ν”„λ‘œμ νŠΈ ꡬ쑰 κ²€ν† " β†’ Show current state
374
+ - Option 3: "μƒˆ μ„Έμ…˜ μ‹œμž‘" β†’ Guide to `/clear`
375
+ 3. **End command execution**
872
376
 
873
377
  ---
874
378
 
875
- ## /alfred:0-project update: Template optimization (subcommand)
876
-
877
- > **Purpose**: After running moai-adk update, compare the backup and new template to optimize the template while preserving user customization.
878
-
879
- ### Execution conditions
880
-
881
- This subcommand is executed under the following conditions:
882
-
883
- 1. **After executing moai-adk update**: `optimized=false` status in `config.json`
884
- 2. **Template update required**: When there is a difference between the backup and the new template
885
- 3. **User explicit request**: User directly executes `/alfred:0-project update`
379
+ ## πŸ” AUTO-DETECT MODE: Handle Already Initialized Projects
886
380
 
887
- ### Execution flow
381
+ **When to execute**: `/alfred:0-project` with existing config.json
888
382
 
889
- #### Phase 1: Backup analysis and comparison
383
+ ### Step 1: Language-First Context Detection
384
+ **IMPORTANT**: Always confirm/establish language context FIRST.
890
385
 
891
- 1. **Make sure you have the latest backup**:
892
- ```bash
893
- # Browse the latest backups in the .moai-backups/ directory
894
- ls -lt .moai-backups/ | head -1
386
+ 1. **Read `.moai/config.json`** to get current language settings
387
+ 2. **Display Language Confirmation** (in current language):
895
388
  ```
896
-
897
- 2. **Change Analysis**:
898
- - Compare `.claude/` directory from backup with current template
899
- - Compare `.moai/project/` document from backup with current document
900
- - Identify user customization items
901
-
902
- 3. **Create Comparison Report**:
903
- ```markdown
904
- ## πŸ“Š Template optimization analysis
905
-
906
- ### Changed items
907
- - CLAUDE.md: "## Project Information" section needs to be preserved
908
- - settings.json: 3 env variables need to be preserved
909
- - product.md: Has user-written content
910
-
911
- ### Recommended Action
912
- - Run Smart Merge
913
- - Preserve User Customizations
914
- - Set optimized=true
389
+ βœ… **ν˜„μž¬ μ–Έμ–΄ μ„€μ •**: [language.conversation_language_name]
390
+ βœ… **λŒ€ν™” μ–Έμ–΄**: [language.conversation_language]
915
391
  ```
916
-
917
- 4. **Waiting for user approval**
918
- `Skill("moai-alfred-tui-survey")` asks β€œDo you want to proceed with template optimization?” and provides the following options.
919
- - **Proceed** β†’ Phase 2 execution
920
- - **Preview** β†’ Display change details and recheck
921
- - **Skip** β†’ keep optimized=false
922
-
923
- #### Phase 2: Run smart merge (after user approval)
924
-
925
- 1. **Execute smart merge logic**:
926
- - Run `TemplateProcessor.copy_templates()`
927
- - CLAUDE.md: Preserve "## Project Information" section
928
- - settings.json: env variables and permissions.allow merge
929
-
930
- 2. Set **optimized=true**:
392
+ 3. **Language Confirmation Question** (in current language):
393
+ - "ν˜„μž¬ μ–Έμ–΄ 섀정을 계속 μ‚¬μš©ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?" (in Korean)
394
+ - "Continue using current language settings?" (in English)
395
+ - Options: "Continue" | "Change Language" | "Show Current Settings"
396
+
397
+ ### Step 2: Language Context Handling
398
+ **IF user selects "Change Language"**:
399
+ 1. **Immediate Language Selection**:
931
400
  ```python
932
- # update config.json
933
- config_data["project"]["optimized"] = True
401
+ Skill("moai-project-language-initializer", mode="language_change_only")
934
402
  ```
403
+ 2. **Update Language Context**: Switch ALL subsequent interactions to new language
404
+ 3. **Update Configuration**: Save new language settings
405
+ 4. **Continue with new language context**
935
406
 
936
- 3. **Optimization completion report**:
937
- ```markdown
938
- βœ… Template optimization completed!
407
+ **IF user selects "Continue" or "Show Current Settings"**:
408
+ 1. **Maintain Current Language Context**
409
+ 2. **Proceed to Step 3** with confirmed language
939
410
 
940
- πŸ“„ Merged files:
941
- - CLAUDE.md (preserves project information)
942
- - settings.json (preserves env variables)
943
-
944
- βš™οΈ config.json: optimized=true Configuration complete
411
+ ### Step 3: Display Current Configuration (in confirmed language)
412
+ 1. **Read `.moai/config.json`** to get all current settings
413
+ 2. **Display current project status** (in confirmed language):
414
+ ```
415
+ βœ… **μ–Έμ–΄**: [language.conversation_language_name]
416
+ βœ… **λ‹‰λ„€μž„**: [user.nickname]
417
+ βœ… **μ—μ΄μ „νŠΈ ν”„λ‘¬ν”„νŠΈ μ–Έμ–΄**: [language.agent_prompt_language]
418
+ βœ… **GitHub μžλ™ 브랜치 μ‚­μ œ**: [github.auto_delete_branches]
419
+ βœ… **SPEC Git μ›Œν¬ν”Œλ‘œμš°**: [github.spec_git_workflow]
420
+ βœ… **λ³΄κ³ μ„œ 생성**: [report_generation.user_choice]
421
+ βœ… **μ„ νƒλœ 도메인**: [stack.selected_domains]
945
422
  ```
946
423
 
947
- ### Alfred Automation Strategy
948
-
949
- **Alfred automatic decision**:
950
- - Automatically call project-manager agent
951
- - Check backup freshness (within 24 hours)
952
- - Automatically analyze changes
953
-
954
- **Auto-activation of Skills**:
955
- - moai-alfred-tag-scanning: TAG chain verification
956
- - moai-alfred-trust-validation: Verification of compliance with TRUST principles
957
-
958
- ### Running example
959
-
960
- ```bash
961
- # After running moai-adk update
962
- moai-adk update
963
-
964
- # Output:
965
- # βœ“ Update complete!
966
- # ℹ️ Next step: Run /alfred:0-project update to optimize template changes
967
-
968
- # Run Alfred
969
- /alfred:0-project update
970
-
971
- # β†’ Phase 1: Generate backup analysis and comparison report
972
- # β†’ Wait for user approval
973
- # β†’ Phase 2: Run smart merge, set optimized=true
974
- ```
975
-
976
- ### caution
977
-
978
- - **Backup required**: Cannot run without backup in `.moai-backups/` directory
979
- - **Manual review recommended**: Preview is required if there are important customizations
980
- - **Conflict resolution**: Request user selection in case of merge conflict
981
-
982
- ---
983
-
984
- ## πŸš€ STEP 3: Project Custom Optimization (Optional)
985
-
986
- **Execution conditions**:
987
- - After completion of Phase 2 (project initialization)
988
- - or after completion of Phase 1.1 (backup merge)
989
- - Explicitly requested by the user or automatically determined by Alfred
990
-
991
- **Purpose**: Lightweight by selecting only Commands, Agents, and Skills that fit the project characteristics (37 skills β†’ 3~5)
992
-
993
- ### 3.1 Automatic execution of Feature Selection
994
-
995
- **Alfred automatically calls the moai-alfred-feature-selector skill**:
424
+ ### Step 4: Ask what user wants to do (in confirmed language)
425
+ **Present these 4 options** to the user (in confirmed language):
996
426
 
997
- **Skill Entry**:
998
- - `.moai/project/product.md` (project category hint)
999
- - `.moai/project/tech.md` (main language, framework)
1000
- - `.moai/config.json` (project settings)
427
+ 1. **"πŸ”§ μ„€μ • μˆ˜μ •"** - Change language, nickname, GitHub settings, or reports config
428
+ 2. **"πŸ“‹ ν˜„μž¬ μ„€μ • κ²€ν† "** - Display full current project configuration
429
+ 3. **"πŸ”„ λ‹€μ‹œ μ΄ˆκΈ°ν™”"** - Run full initialization again (with warning)
430
+ 4. **"⏸️ μ·¨μ†Œ"** - Exit without making any changes
1001
431
 
1002
- **Skill Output**:
1003
- ```json
1004
- {
1005
- "category": "web-api",
1006
- "language": "python",
1007
- "framework": "fastapi",
1008
- "commands": ["1-spec", "2-build", "3-sync"],
1009
- "agents": ["spec-builder", "code-builder", "doc-syncer", "git-manager", "debug-helper"],
1010
- "skills": ["moai-lang-python", "moai-domain-web-api", "moai-domain-backend"],
1011
- "excluded_skills_count": 34,
1012
- "optimization_rate": "87%"
1013
- }
1014
- ```
432
+ ### Step 6: Handle user selection
1015
433
 
1016
- **How ​​to Run**:
1017
- ```
1018
- Alfred: Skill("moai-alfred-feature-selector")
1019
- ```
434
+ **IF user selected: "πŸ”§ Modify Settings"**:
435
+ 1. Print: "πŸ”§ Entering Settings Mode..."
436
+ 2. **Jump to SETTINGS MODE** above
437
+ 3. Let SETTINGS MODE handle the rest
438
+ 4. Stop after SETTINGS MODE completes
1020
439
 
1021
- ---
440
+ **ELSE IF user selected: "πŸ“‹ Review Current Setup"**:
441
+ 1. Print this header: `## Current Project Configuration`
442
+ 2. Show all current settings (from config.json)
443
+ 3. Print: "βœ… Configuration review complete."
444
+ 4. Exit (stop the command)
1022
445
 
1023
- ### 3.2 Automatic execution of Template Generation
1024
-
1025
- **Alfred automatically calls the moai-alfred-template-generator skill**:
1026
-
1027
- **Skill input**:
1028
- - `.moai/.feature-selection.json` (feature-selector output)
1029
- - `CLAUDE.md` template
1030
- - Entire commands/agents/skills file
446
+ **ELSE IF user selected: "πŸ”„ Re-initialize"**:
447
+ 1. Print this warning:
448
+ ```
449
+ ⚠️ WARNING: This will re-run the full project initialization
1031
450
 
1032
- **Skill Output**:
1033
- - `CLAUDE.md` (custom agent table - selected agents only)
1034
- - `.claude/commands/` (selected commands only)
1035
- - `.claude/agents/` (selected agents only)
1036
- - `.claude/skills/` (selected skills only)
1037
- - `.moai/config.json` (updates `optimized: true`)
451
+ Your existing files will be preserved in:
452
+ - Backup: .moai-backups/[TIMESTAMP]/
453
+ - Current: .moai/project/*.md (will be UPDATED)
454
+ ```
455
+ 2. **Ask the user**: "Are you sure you want to continue? Type 'yes' to confirm or anything else to cancel"
456
+ 3. **IF user typed 'yes'**:
457
+ - Print: "πŸ”„ Starting full re-initialization..."
458
+ - **Jump to INITIALIZATION MODE** above
459
+ - Let INITIALIZATION MODE handle the rest
460
+ 4. **ELSE** (user typed anything else):
461
+ - Print: "βœ… Re-initialization cancelled."
462
+ - Exit (stop the command)
463
+
464
+ **ELSE IF user selected: "⏸️ Cancel"**:
465
+ 1. Print:
466
+ ```
467
+ βœ… Exiting without changes.
1038
468
 
1039
- **How ​​to Run**:
1040
- ```
1041
- Alfred: Skill("moai-alfred-template-generator")
1042
- ```
469
+ Your project remains initialized with current settings.
470
+ To modify settings later, run: /alfred:0-project setting
471
+ ```
472
+ 2. Exit immediately (stop the command)
1043
473
 
1044
474
  ---
1045
475
 
1046
- ### 3.3 Optimization completion report
1047
-
1048
- **Report Format**:
1049
- ```markdown
1050
- βœ… Project customized optimization completed!
1051
-
1052
- πŸ“Š Optimization results:
1053
- - **Project**: {{PROJECT_NAME}}
1054
- - **Category**: web-api
1055
- - **Main language**: python
1056
- - **Framework**: fastapi
1057
-
1058
- 🎯 Selected capabilities:
1059
- - Commands: 4 items (0-project, 1-spec, 2-build, 3-sync)
1060
- - Agents: 5 items (spec-builder, code-builder, doc-syncer, git-manager, debug-helper)
1061
- - Skills: 3 items (moai-lang-python, moai-domain-web-api, moai-domain-backend)
1062
-
1063
- πŸ’‘ Lightweight effect:
1064
- - Skills excluded: 34
1065
- - Lightweight: 87%
1066
- - CLAUDE.md: Create custom agent table
1067
-
1068
- πŸ“‹ Next steps:
1069
- 1. Check the CLAUDE.md file (only 5 agents are displayed)
1070
- 2. Run /alfred:1-plan "first function"
1071
- 3. Start the MoAI-ADK workflow
476
+ ## πŸ“Š Command Completion Pattern
477
+
478
+ **CRITICAL**: When any Alfred command completes, **ALWAYS use `AskUserQuestion` tool** to ask the user what to do next.
479
+
480
+ ### Implementation Example
481
+ ```python
482
+ AskUserQuestion(
483
+ questions=[
484
+ {
485
+ "question": "Project initialization is complete. What would you like to do next?",
486
+ "header": "Next Step",
487
+ "options": [
488
+ {"label": "Write Specifications", "description": "Run /alfred:1-plan to define requirements"},
489
+ {"label": "Review Project Structure", "description": "Check current project state"},
490
+ {"label": "Start New Session", "description": "Run /clear to start fresh"}
491
+ ]
492
+ }
493
+ ]
494
+ )
1072
495
  ```
1073
496
 
1074
- ---
1075
-
1076
- ### 3.4 Skip Phase 3 (optional)
1077
-
1078
- **Users can skip Phase 3**:
1079
-
1080
- **Skip condition**:
1081
- - User explicitly selects β€œSkip”
1082
- - β€œSimple project” when Alfred automatically determines (only basic features required)
1083
-
1084
- **Skip effect**:
1085
- - Maintain all 37 skills (no lightweighting)
1086
- - Maintain default 9 agents in CLAUDE.md template
1087
- - Maintain `optimized: false` in config.json
497
+ **Rules**:
498
+ 1. **NO EMOJIS** in JSON fields (causes API errors)
499
+ 2. **Always use AskUserQuestion** - Never suggest next steps in prose
500
+ 3. **Provide 3-4 clear options** - Not open-ended
501
+ 4. **Language**: Present options in user's `conversation_language`
1088
502
 
1089
503
  ---
1090
504
 
1091
- ## Next steps
1092
-
1093
- **Recommendation**: For better performance and context management, start a new chat session with the `/clear` or `/new` command before proceeding to the next step.
1094
-
1095
- After initialization is complete:
1096
-
1097
- - **New project**: Run `/alfred:1-plan` to create design-based SPEC backlog
1098
- - **Legacy project**: Review @CODE/@CODE/TODO items in product/structure/tech document and confirm priority
1099
- - **Set Change**: Run `/alfred:0-project` again to update document
1100
- - **Template optimization**: Run `/alfred:0-project update` after `moai-adk update`
1101
-
1102
- ## Related commands
1103
-
1104
- - `/alfred:1-plan` - Start writing SPEC
1105
- - `/alfred:9-update` - MoAI-ADK update
1106
- - `moai doctor` - System diagnosis
1107
- - `moai status` - Check project status
505
+ ## 🎯 Key Improvements Achieved
506
+
507
+ ### βœ… Language-First Architecture
508
+ - **Core Principle**: Language selection ALWAYS happens before any other configuration
509
+ - **Context Persistence**: Once selected, ALL subsequent interactions use that language
510
+ - **Flow Adaptation**: Each flow (fresh install/update/settings) adapts based on language context
511
+ - **Improvement**: Eliminates language confusion and ensures consistent user experience
512
+
513
+ ### βœ… Contextual Flow Differentiation
514
+ - **Fresh Install**: Language selection β†’ Installation questionnaire β†’ Setup completion
515
+ - **Update Mode**: Language confirmation β†’ Update/merge options β†’ Optimization
516
+ - **Existing Project**: Language confirmation β†’ Settings options or re-initialization
517
+ - **Improvement**: Clear separation between installation types with appropriate workflows
518
+
519
+ ### βœ… Modular Architecture
520
+ - **Original**: 3,647 lines in single monolithic file
521
+ - **Optimized**: ~600 lines main router + 4 specialized skills
522
+ - **Improvement**: 83% size reduction in main file with enhanced functionality
523
+
524
+ ### βœ… Skills-Based Delegation
525
+ - **Language Initializer**: Handles language-first project setup workflows
526
+ - **Config Manager**: Manages all configuration operations with language context
527
+ - **Template Optimizer**: Handles template comparison and optimization
528
+ - **Batch Questions**: Standardizes user interaction patterns with language support
529
+
530
+ ### βœ… Enhanced User Experience
531
+ - **Language-First Interactions**: All user-facing content respects language selection
532
+ - **Contextual Workflows**: Each flow type provides appropriate options and guidance
533
+ - **Faster Execution**: Skills optimized for specific tasks with language awareness
534
+ - **Better Error Handling**: Specialized error recovery with language-appropriate messages