moai-adk 0.11.0__py3-none-any.whl → 0.12.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (268) hide show
  1. moai_adk/core/issue_creator.py +2 -2
  2. moai_adk/core/project/detector.py +195 -12
  3. moai_adk/core/tags/ci_validator.py +1 -1
  4. moai_adk/core/tags/pre_commit_validator.py +1 -1
  5. moai_adk/core/tags/validator.py +1 -1
  6. moai_adk/templates/.claude/agents/alfred/cc-manager.md +316 -0
  7. moai_adk/templates/.claude/agents/alfred/debug-helper.md +208 -0
  8. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +214 -0
  9. moai_adk/templates/.claude/agents/alfred/git-manager.md +406 -0
  10. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +350 -0
  11. moai_adk/templates/.claude/agents/alfred/project-manager.md +273 -0
  12. moai_adk/templates/.claude/agents/alfred/quality-gate.md +343 -0
  13. moai_adk/templates/.claude/agents/alfred/skill-factory.md +865 -0
  14. moai_adk/templates/.claude/agents/alfred/spec-builder.md +287 -0
  15. moai_adk/templates/.claude/agents/alfred/tag-agent.md +287 -0
  16. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +326 -0
  17. moai_adk/templates/.claude/agents/alfred/trust-checker.md +375 -0
  18. moai_adk/templates/.claude/commands/alfred/0-project.md +1275 -0
  19. moai_adk/templates/.claude/commands/alfred/1-plan.md +734 -0
  20. moai_adk/templates/.claude/commands/alfred/2-run.md +551 -0
  21. moai_adk/templates/.claude/commands/alfred/3-sync.md +689 -0
  22. moai_adk/templates/.claude/commands/alfred/9-feedback.md +149 -0
  23. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +206 -0
  24. moai_adk/templates/.claude/hooks/alfred/core/project.py +742 -0
  25. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  26. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  27. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
  28. moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +95 -0
  29. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +95 -0
  30. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +101 -0
  31. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +95 -0
  32. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +97 -0
  33. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +170 -0
  34. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +271 -0
  35. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +67 -0
  36. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
  37. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +230 -0
  38. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
  39. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
  40. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +154 -0
  41. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +174 -0
  42. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +87 -0
  43. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +61 -0
  44. moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +95 -0
  45. moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +95 -0
  46. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +111 -0
  47. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  48. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +136 -0
  49. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +640 -0
  50. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +696 -0
  51. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +474 -0
  52. moai_adk/templates/.claude/settings.json +144 -0
  53. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +113 -0
  54. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +29 -0
  55. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +28 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +122 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +29 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +29 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +237 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +615 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +653 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +113 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +113 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +29 -0
  67. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +28 -0
  68. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +113 -0
  69. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +29 -0
  70. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +28 -0
  71. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +113 -0
  72. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +29 -0
  73. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +28 -0
  74. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +269 -0
  75. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  76. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +298 -0
  77. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  78. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +307 -0
  79. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  80. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +252 -0
  81. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  82. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  83. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  84. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +199 -0
  85. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  86. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +316 -0
  87. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  88. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +263 -0
  89. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  90. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +291 -0
  91. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  92. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +290 -0
  93. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
  94. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
  95. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +123 -0
  96. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
  97. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
  98. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +123 -0
  99. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
  100. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
  101. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +123 -0
  102. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
  103. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
  104. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +124 -0
  105. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
  106. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
  107. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +124 -0
  108. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
  109. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
  110. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +123 -0
  111. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
  112. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
  113. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +123 -0
  114. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
  115. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
  116. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +123 -0
  117. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
  118. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
  119. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +123 -0
  120. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
  121. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
  122. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +303 -0
  123. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1064 -0
  124. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1047 -0
  125. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +113 -0
  126. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
  127. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
  128. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +113 -0
  129. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
  130. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
  131. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +113 -0
  132. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
  133. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
  134. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +116 -0
  135. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
  136. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
  137. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +122 -0
  138. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
  139. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
  140. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +113 -0
  141. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
  142. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
  143. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +113 -0
  144. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
  145. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
  146. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +113 -0
  147. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
  148. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
  149. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +307 -0
  150. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  151. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
  152. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +124 -0
  153. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
  154. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
  155. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +124 -0
  156. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
  157. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
  158. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +123 -0
  159. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
  160. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
  161. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +123 -0
  162. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
  163. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
  164. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +124 -0
  165. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
  166. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
  167. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +124 -0
  168. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
  169. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
  170. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +125 -0
  171. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
  172. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
  173. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +124 -0
  174. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
  175. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
  176. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +123 -0
  177. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
  178. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
  179. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +431 -0
  180. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
  181. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
  182. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +123 -0
  183. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
  184. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
  185. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +124 -0
  186. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
  187. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
  188. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +124 -0
  189. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
  190. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
  191. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +123 -0
  192. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
  193. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
  194. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +123 -0
  195. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
  196. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
  197. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +124 -0
  198. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
  199. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
  200. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +123 -0
  201. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
  202. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
  203. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +127 -0
  204. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
  205. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
  206. moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +482 -0
  207. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +278 -0
  208. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
  209. moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +477 -0
  210. moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  211. moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  212. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  213. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
  214. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +271 -0
  215. moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  216. moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +583 -0
  217. moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +526 -0
  218. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +465 -0
  219. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +328 -0
  220. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +312 -0
  221. moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
  222. moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +285 -0
  223. moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +278 -0
  224. moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +303 -0
  225. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +137 -0
  226. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +219 -0
  227. moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
  228. moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +541 -0
  229. moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +622 -0
  230. moai_adk/templates/.github/workflows/c-tag-validation.yml +83 -0
  231. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +79 -0
  232. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +65 -0
  233. moai_adk/templates/.github/workflows/dart-tag-validation.yml +82 -0
  234. moai_adk/templates/.github/workflows/java-tag-validation.yml +75 -0
  235. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +67 -0
  236. moai_adk/templates/.github/workflows/php-tag-validation.yml +56 -0
  237. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +68 -0
  238. moai_adk/templates/.github/workflows/rust-tag-validation.yml +73 -0
  239. moai_adk/templates/.github/workflows/shell-tag-validation.yml +65 -0
  240. moai_adk/templates/.github/workflows/swift-tag-validation.yml +79 -0
  241. moai_adk/templates/.moai/config.json +113 -0
  242. moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md +208 -0
  243. moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md +369 -0
  244. moai_adk/templates/.moai/memory/CLAUDE-RULES.md +539 -0
  245. moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +344 -0
  246. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +330 -0
  247. moai_adk/templates/.moai/memory/ISSUE-LABEL-MAPPING.md +150 -0
  248. moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md +218 -0
  249. moai_adk/templates/.moai/memory/SPEC-METADATA.md +356 -0
  250. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +330 -0
  251. moai_adk/templates/.moai/memory/spec-metadata.md +356 -0
  252. moai_adk/templates/.moai/project/product.md +161 -0
  253. moai_adk/templates/.moai/project/structure.md +156 -0
  254. moai_adk/templates/.moai/project/tech.md +227 -0
  255. moai_adk/templates/CLAUDE.md +90 -10
  256. moai_adk/templates/workflows/go-tag-validation.yml +130 -0
  257. moai_adk/templates/workflows/javascript-tag-validation.yml +135 -0
  258. moai_adk/templates/workflows/python-tag-validation.yml +118 -0
  259. moai_adk/templates/workflows/typescript-tag-validation.yml +154 -0
  260. {moai_adk-0.11.0.dist-info → moai_adk-0.12.0.dist-info}/METADATA +43 -1
  261. moai_adk-0.12.0.dist-info/RECORD +330 -0
  262. moai_adk-0.11.0.dist-info/RECORD +0 -77
  263. /moai_adk/templates/.github/workflows/{release.yml → moai-adk-release.yml} +0 -0
  264. /moai_adk/templates/.github/workflows/{spec-issue-sync.yml → moai-adk-spec-issue-sync.yml} +0 -0
  265. /moai_adk/templates/.github/workflows/{tag-validation.yml → moai-adk-tag-validation.yml} +0 -0
  266. {moai_adk-0.11.0.dist-info → moai_adk-0.12.0.dist-info}/WHEEL +0 -0
  267. {moai_adk-0.11.0.dist-info → moai_adk-0.12.0.dist-info}/entry_points.txt +0 -0
  268. {moai_adk-0.11.0.dist-info → moai_adk-0.12.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1275 @@
1
+ ---
2
+ name: alfred:0-project
3
+ description: "Initialize project document - create product/structure/tech.md and set optimization for each language"
4
+ # Translations:
5
+ # - ko: "프로젝트 문서 초기화 - product/structure/tech.md 생성 및 언어별 최적화 설정"
6
+ # - ja: "プロジェクト文書の初期化 - product/structure/tech.mdの作成と言語別最適化設定"
7
+ # - zh: "初始化项目文档 - 创建product/structure/tech.md并设置语言优化"
8
+ allowed-tools:
9
+ - Read
10
+ - Write
11
+ - Edit
12
+ - MultiEdit
13
+ - Grep
14
+ - Glob
15
+ - TodoWrite
16
+ - Bash(ls:*)
17
+ - Bash(find:*)
18
+ - Bash(cat:*)
19
+ - Task
20
+ ---
21
+
22
+ # 📋 MoAI-ADK Step 0: Initialize/Update Universal Language Support Project Documentation
23
+ > **Note**: Interactive prompts use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` for TUI selection menus. The skill is loaded on-demand when user interaction is required.
24
+
25
+ ## 🎯 Command Purpose
26
+
27
+ Automatically analyzes the project environment to create/update product/structure/tech.md documents and configure language-specific optimization settings.
28
+
29
+ ## 📋 Execution flow
30
+
31
+ 0. **Conversation Language Selection**: User selects the language for all dialogs and documentation
32
+ 1. **Environment Analysis**: Automatically detect project type (new/legacy) and codebase language
33
+ 2. **Establishment of interview strategy**: Select question tree suited to project characteristics
34
+ 3. **User Verification**: Review and approve interview plan
35
+ 4. **Create project documentation**: Create product/structure/tech.md in the selected language
36
+ 5. **Create configuration file**: config.json auto-configuration
37
+
38
+ ## 🧠 Associated Skills & Agents
39
+
40
+ | Agent | Core Skill | Purpose |
41
+ | --------------- | -------------------------------- | --------------------------------------------- |
42
+ | project-manager | `moai-alfred-language-detection` | Initialize project and interview requirements |
43
+ | trust-checker | `moai-alfred-trust-validation` | Verify initial project structure (optional) |
44
+
45
+ **Note**: TUI Survey Skill is used for user confirmations during project initialization and is shared across all interactive prompts.
46
+
47
+ ## 🔗 Associated Agent
48
+
49
+ - **Primary**: project-manager (📋 planner) - Dedicated to project initialization
50
+ - **Quality Check**: trust-checker (✅ Quality assurance lead) - Initial structural verification (optional)
51
+ - **Secondary**: None (standalone execution)
52
+
53
+ ## 💡 Example of use
54
+
55
+ The user executes the `/alfred:8-project` command to analyze the project and create/update documents.
56
+
57
+ ## Command Overview
58
+
59
+ It is a systematic initialization system that analyzes the project environment and creates/updates product/structure/tech.md documents.
60
+
61
+ - **Automatically detect language**: Automatically recognize Python, TypeScript, Java, Go, Rust, etc.
62
+ - **Project type classification**: Automatically determine new vs. existing projects
63
+ - **High-performance initialization**: Achieve 0.18 second initialization with TypeScript-based CLI
64
+ - **2-step workflow**: 1) Analysis and planning → 2) Execution after user approval
65
+
66
+ ## How to use
67
+
68
+ The user executes the `/alfred:8-project` command to start analyzing the project and creating/updating documents.
69
+
70
+ **Automatic processing**:
71
+ - Update mode if there is an existing `.moai/project/` document
72
+ - New creation mode if there is no document
73
+ - Automatic detection of language and project type
74
+
75
+ ## ⚠️ Prohibitions
76
+
77
+ **What you should never do**:
78
+
79
+ - ❌ Create a file in the `.claude/memory/` directory
80
+ - ❌ Create a file `.claude/commands/alfred/*.json`
81
+ - ❌ Unnecessary overwriting of existing documents
82
+ - ❌ Date and numerical prediction (“within 3 months”, “50% reduction”) etc.)
83
+ - ❌ Hypothetical scenarios, expected market size, future technology trend predictions
84
+
85
+ **Expressions to use**:
86
+
87
+ - ✅ "High/medium/low priority"
88
+ - ✅ "Immediately needed", "step-by-step improvements"
89
+ - ✅ Current facts
90
+ - ✅ Existing technology stack
91
+ - ✅ Real problems
92
+
93
+ ---
94
+
95
+ ## 🚀 STEP 0: 초기 설정 - 언어 및 사용자 정보 선택
96
+
97
+ **목적**: 프로젝트 초기화 시작 전에 대화 언어를 설정하고 사용자 닉네임을 등록합니다. 이 설정은 모든 Alfred 프롬프트, 인터뷰 질문 및 생성된 문서에 적용됩니다.
98
+
99
+ **UX 개선**: 2개 질문을 **1회 배치 호출**로 통합 (50% 상호작용 감소: 2 turns → 1 turn)
100
+
101
+ ### 0.0 Alfred 자기소개 및 환영 인사
102
+
103
+ Alfred가 첫 상호작용으로 다음과 같이 인사합니다:
104
+
105
+ ```
106
+ 안녕하세요! 👋 저는 Alfred입니다.
107
+ MoAI-ADK의 SuperAgent로서 당신의 프로젝트를 함께 만들어갈 준비가 되어 있습니다.
108
+
109
+ 앞으로의 모든 대화에서 당신을 편하게 부르기 위해,
110
+ 먼저 기본 설정을 진행하겠습니다.
111
+ ```
112
+
113
+ ### 0.1 배치 설계: 언어 선택 + 사용자 닉네임 + GitHub 설정 확인 (1-3회 호출)
114
+
115
+ Alfred가 `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` 를 사용하여 **배치 호출**로 필수 정보를 수집합니다:
116
+
117
+ **기본 배치 (항상 실행)**:
118
+ - 언어 선택
119
+ - 사용자 닉네임
120
+
121
+ **추가 배치 (팀 모드 감지 시)**:
122
+ - GitHub "Automatically delete head branches" 설정 확인
123
+
124
+ #### 0.1.1 팀 모드 감지
125
+
126
+ ```bash
127
+ # config.json에서 mode 확인
128
+ grep "mode" .moai/config.json
129
+
130
+ # 결과: "mode": "team" → 추가 질문 포함
131
+ # "mode": "personal" → 기본 질문만 실행
132
+ ```
133
+
134
+ #### 0.1.2 기본 배치: 언어 선택 + 닉네임
135
+
136
+ **Example AskUserQuestion Call**:
137
+ ```python
138
+ AskUserQuestion(
139
+ questions=[
140
+ {
141
+ "question": "Which language would you like to use for the project initialization and documentation?",
142
+ "header": "Language",
143
+ "multiSelect": false,
144
+ "options": [
145
+ {
146
+ "label": "🌍 English",
147
+ "description": "All dialogs and documentation in English"
148
+ },
149
+ {
150
+ "label": "🇰🇷 한국어",
151
+ "description": "All dialogs and documentation in Korean"
152
+ },
153
+ {
154
+ "label": "🇯🇵 日本語",
155
+ "description": "All dialogs and documentation in Japanese"
156
+ },
157
+ {
158
+ "label": "🇨🇳 中文",
159
+ "description": "All dialogs and documentation in Chinese"
160
+ }
161
+ ]
162
+ },
163
+ {
164
+ "question": "How would you like to be called in our conversations? (e.g., GOOS, Team Lead, Developer, or custom name - max 20 chars)",
165
+ "header": "Nickname",
166
+ "multiSelect": false,
167
+ "options": [
168
+ {
169
+ "label": "Enter custom nickname",
170
+ "description": "Type your preferred name using the 'Other' option below"
171
+ }
172
+ ]
173
+ }
174
+ ]
175
+ )
176
+ ```
177
+
178
+ #### 0.1.3 팀 모드 추가 배치: GitHub 설정 확인 (팀 모드만)
179
+
180
+ **조건**: `config.json`에서 `"mode": "team"` 감지 시 실행
181
+
182
+ **Example AskUserQuestion Call**:
183
+ ```python
184
+ AskUserQuestion(
185
+ questions=[
186
+ {
187
+ "question": "[Team Mode] Is 'Automatically delete head branches' enabled in your GitHub repository settings?",
188
+ "header": "GitHub Branch Settings",
189
+ "multiSelect": false,
190
+ "options": [
191
+ {
192
+ "label": "✅ Yes, already enabled",
193
+ "description": "PR merge 후 자동으로 원격 브랜치 삭제됨"
194
+ },
195
+ {
196
+ "label": "❌ No, not enabled (Recommended: Enable)",
197
+ "description": "Settings → General → '자동 삭제' 체크박스 확인 필요"
198
+ },
199
+ {
200
+ "label": "🤔 Not sure / Need to check",
201
+ "description": "GitHub Settings → General 확인 후 다시 진행"
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ )
207
+ ```
208
+
209
+ **응답 처리**:
210
+ - **"Yes, already enabled"** → `auto_delete_branches: true` 저장
211
+ - **"No, not enabled"** → `auto_delete_branches: false` + 권장사항 저장
212
+ - **"Not sure"** → `auto_delete_branches: null` + 경고 메시지
213
+
214
+ **User Response Example**:
215
+ ```
216
+ Selected Language: 🇰🇷 한국어
217
+ Selected Nickname: GOOS (typed via "Other" option)
218
+ ```
219
+
220
+ ### 0.2 사용자 정보 저장
221
+
222
+ Alfred가 선택된 언어, 닉네임, 그리고 팀 모드 설정을 다음과 같이 저장합니다:
223
+
224
+ #### 0.2.1 기본 정보 저장 (항상)
225
+
226
+ ```json
227
+ {
228
+ "language": {
229
+ "conversation_language": "ko",
230
+ "conversation_language_name": "한국어"
231
+ },
232
+ "user": {
233
+ "nickname": "GOOS",
234
+ "selected_at": "2025-10-23T12:34:56Z"
235
+ }
236
+ }
237
+ ```
238
+
239
+ #### 0.2.2 GitHub 설정 저장 (팀 모드만)
240
+
241
+ **팀 모드 감지 시 추가 저장**:
242
+ ```json
243
+ {
244
+ "github": {
245
+ "auto_delete_branches": true,
246
+ "checked_at": "2025-10-23T12:34:56Z",
247
+ "recommendation": "Branch cleanup will be automated after PR merge"
248
+ }
249
+ }
250
+ ```
251
+
252
+ **또는 (미활성화 상태)**:
253
+ ```json
254
+ {
255
+ "github": {
256
+ "auto_delete_branches": false,
257
+ "checked_at": "2025-10-23T12:34:56Z",
258
+ "recommendation": "Enable 'Automatically delete head branches' in GitHub Settings → General for better GitFlow workflow"
259
+ }
260
+ }
261
+ ```
262
+
263
+ #### 0.2.3 저장된 정보 활용
264
+
265
+ 이 정보는:
266
+ - 모든 sub-agents 에게 컨텍스트 파라미터로 전달됨
267
+ - `.moai/config.json` 의 `language`, `user`, `github` 필드에 저장됨
268
+ - CLAUDE.md의 `{{CONVERSATION_LANGUAGE}}` 및 `{{USER_NICKNAME}}` 변수로 치환됨
269
+ - 모든 Alfred 대화에서 사용됨
270
+ - **팀 모드**: git-manager가 GitHub 설정 상태를 참고하여 브랜치 정리 전략 수립
271
+
272
+ **설정 완료 출력 예시**:
273
+ ```markdown
274
+ ✅ 초기 설정 완료!
275
+
276
+ 언어: 한국어 (ko)
277
+ 닉네임: GOOS
278
+
279
+ 이제 GOOS님의 프로젝트 환경 분석으로 진행하겠습니다...
280
+ ```
281
+
282
+ ### 0.3 STEP 1로 전환
283
+
284
+ 언어 및 사용자 정보 설정 완료 후, 모든 후속 상호작용이 선택된 언어로 진행됩니다:
285
+ - Alfred의 모든 프롬프트가 선택된 언어로 번역됨
286
+ - project-manager sub-agent이 언어 및 사용자 정보 파라미터를 수신
287
+ - 인터뷰 질문이 선택된 언어로 진행됨
288
+ - 생성된 문서 (product.md, structure.md, tech.md)가 선택된 언어로 작성됨
289
+ - CLAUDE.md가 선택된 언어와 사용자 닉네임을 표시함
290
+
291
+ ---
292
+
293
+ ## 🚀 STEP 1: Environmental analysis and interview plan development
294
+
295
+ Analyze the project environment and develop a systematic interview plan.
296
+
297
+ ### 1.0 Check backup directory (highest priority)
298
+
299
+ **Processing backup files after moai-adk init reinitialization**
300
+
301
+ Alfred first checks the `.moai-backups/` directory:
302
+
303
+ ```bash
304
+ # Check latest backup timestamp
305
+ ls -t .moai-backups/ | head -1
306
+
307
+ # Check the optimized flag in config.json
308
+ grep "optimized" .moai/config.json
309
+ ```
310
+
311
+ **Backup existence conditions**:
312
+ - `.moai-backups/` directory exists
313
+ - `.moai/project/*.md` file exists in the latest backup folder
314
+ - `optimized: false` in `config.json` (immediately after reinitialization)
315
+
316
+ **Select user if backup exists**
317
+ Call `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` to display a TUI with the following options:
318
+ - **Merge**: Merge backup contents and latest template (recommended)
319
+ - **New**: Ignore the backup and start a new interview
320
+ - **Skip**: Keep current file (terminate task)
321
+
322
+ **Response processing**:
323
+ - **"Merge"** → Proceed to Phase 1.1 (backup merge workflow)
324
+ - **"Create new"** → Proceed to Phase 1.2 (Project environment analysis) (existing process)
325
+ - **"Skip"** → End task
326
+
327
+ **No backup or optimized: true**:
328
+ - Proceed directly to Phase 1.2 (project environment analysis)
329
+
330
+ ---
331
+
332
+ ### 1.1 Backup merge workflow (when user selects “Merge”)
333
+
334
+ **Purpose**: Restore only user customizations while maintaining the latest template structure.
335
+
336
+ **STEP 1: Read backup file**
337
+
338
+ Alfred reads files from the latest backup directory:
339
+ ```bash
340
+ # Latest backup directory path
341
+ BACKUP_DIR=.moai-backups/$(ls -t .moai-backups/ | head -1)
342
+
343
+ # Read backup file
344
+ Read $BACKUP_DIR/.moai/project/product.md
345
+ Read $BACKUP_DIR/.moai/project/structure.md
346
+ Read $BACKUP_DIR/.moai/project/tech.md
347
+ Read $BACKUP_DIR/CLAUDE.md
348
+ ```
349
+
350
+ **STEP 2: Detect template defaults**
351
+
352
+ The following patterns are considered "template defaults" (not merged):
353
+ - "Define your key user base"
354
+ - "Describe the core problem you are trying to solve"
355
+ - "List the strengths and differences of your project"
356
+ - "MoAI-ADK", "MoAI-Agentic Development Kit", etc. Variable format
357
+ - Guide phrases such as "Example:", "Sample:", "Example:", etc.
358
+
359
+ **STEP 3: Extract user customization**
360
+
361
+ Extract only **non-template default content** from the backup file:
362
+ - `product.md`:
363
+ - Define your actual user base in the USER section
364
+ - Describe the actual problem in the PROBLEM section
365
+ - Real differences in the STRATEGY section
366
+ - Actual success metrics in the SUCCESS section
367
+ - `structure.md`:
368
+ - Actual design in the ARCHITECTURE section
369
+ - Actual module structure in the MODULES section
370
+ - Actual integration plan in the INTEGRATION section
371
+ - `tech.md`:
372
+ - The actual technology stack
373
+ in the STACK section - The actual framework
374
+ in the FRAMEWORK section - The actual quality policy
375
+ in the QUALITY section - `HISTORY` section: **Full Preservation** (all files)
376
+
377
+ **STEP 4: Merge Strategy**
378
+
379
+ ```markdown
380
+ Latest template structure (v0.4.0+)
381
+
382
+ Insert user customization (extracted from backup file)
383
+
384
+ HISTORY section updates
385
+
386
+ Version update (v0.1.x → v0.1.x+1)
387
+ ```
388
+
389
+ **Merge Principle**:
390
+ - ✅ Maintain the latest version of the template structure (section order, header, @TAG format)
391
+ - ✅ Insert only user customization (actual content written)
392
+ - ✅ Cumulative preservation of the HISTORY section (existing history + merge history)
393
+ - ❌ Replace template default values ​​with the latest version
394
+
395
+ **STEP 5: HISTORY Section Update**
396
+
397
+ After the merge is complete, add history to the HISTORY section of each file:
398
+ ```yaml
399
+ ### v0.1.x+1 (2025-10-19)
400
+ - **UPDATED**: Merge backup files (automatic optimization)
401
+ - AUTHOR: @Alfred
402
+ - BACKUP: .moai-backups/20251018-003638/
403
+ - REASON: Restoring user customization after moai-adk init reinitialization
404
+ ```
405
+
406
+ **STEP 6: Update config.json**
407
+
408
+ Set optimization flags after the merge is complete:
409
+ ```json
410
+ {
411
+ "project": {
412
+ "optimized": true,
413
+ "last_merge": "2025-10-19T12:34:56+09:00",
414
+ "backup_source": ".moai-backups/20251018-003638/"
415
+ }
416
+ }
417
+ ```
418
+
419
+ **STEP 7: Completion Report**
420
+
421
+ ```markdown
422
+ ✅ Backup merge completed!
423
+
424
+ 📁 Merged files:
425
+ - .moai/project/product.md (v0.1.4 → v0.1.5)
426
+ - .moai/project/structure.md (v0.1.1 → v0.1.2)
427
+ - .moai/project/tech.md (v0.1.1 → v0.1.2)
428
+ - .moai/config.json (optimized: false → true)
429
+
430
+ 🔍 Merge history:
431
+ - USER section: Restore customized contents of backup file
432
+ - PROBLEM section: Restore problem description of backup file
433
+ - STRATEGY section: Restore differentials of backup file
434
+ - HISTORY section: Add merge history (cumulative retention)
435
+
436
+ 💾 Backup file location:
437
+ - Original backup: .moai-backups/20251018-003638/
438
+ - Retention period: Permanent (until manual deletion)
439
+
440
+ 📋 Next steps:
441
+ 1. Review the merged document
442
+ 2. Additional modifications if necessary
443
+ 3. Create your first SPEC with /alfred:1-plan
444
+
445
+ ---
446
+ **Task completed: /alfred:0-project terminated**
447
+ ```
448
+
449
+ **Finish work after merge**: Complete immediately without interview
450
+
451
+ ---
452
+
453
+ ### 1.2 Run project environment analysis (when user selects "New" or no backup)
454
+
455
+ **Automatically analyzed items**:
456
+
457
+ 1. **Project Type Detection**
458
+ Alfred classifies new vs existing projects by analyzing the directory structure:
459
+ - Empty directory → New project
460
+ - Code/documentation present → Existing project
461
+
462
+ 2. **Auto-detect language/framework**: Detects the main language of your project based on file patterns
463
+ - pyproject.toml, requirements.txt → Python
464
+ - package.json, tsconfig.json → TypeScript/Node.js
465
+ - pom.xml, build.gradle → Java
466
+ - go.mod → Go
467
+ - Cargo.toml → Rust
468
+ - backend/ + frontend/ → full stack
469
+
470
+ 3. **Document status analysis**
471
+ - Check the status of existing `.moai/project/*.md` files
472
+ - Identify areas of insufficient information
473
+ - Organize items that need supplementation
474
+
475
+ 4. **Project structure evaluation**
476
+ - Directory structure complexity
477
+ - Monolingual vs. hybrid vs. microservice
478
+ - Code base size estimation
479
+
480
+ ### 1.3 Establish interview strategy (when user selects “New”)
481
+
482
+ **Select question tree by project type**:
483
+
484
+ | Project Type | Question Category | Focus Areas |
485
+ | ------------------------- | ------------------ | --------------------------------------------- |
486
+ | **New Project** | Product Discovery | Mission, Users, Problems Solved |
487
+ | **Existing Project** | Legacy Analysis | Code Base, Technical Debt, Integration Points |
488
+ | **TypeScript conversion** | Migration Strategy | TypeScript conversion for existing projects |
489
+
490
+ **Question Priority**:
491
+ - **Essential Questions**: Core Business Value, Key User Bases (all projects)
492
+ - **Technical Questions**: Language/Framework, Quality Policy, Deployment Strategy
493
+ - **Governance**: Security Requirements, Traceability Strategy (Optional)
494
+
495
+ ### 1.4 Generate Interview Plan Report (when user selects “Create New”)
496
+
497
+ **Format of plan to be presented to users**:
498
+
499
+ ```markdown
500
+ ## 📊 Project initialization plan: [PROJECT-NAME]
501
+
502
+ ### Environmental Analysis Results
503
+ - **Project Type**: [New/Existing/Hybrid]
504
+ - **Languages ​​Detected**: [Language List]
505
+ - **Current Document Status**: [Completeness Rating 0-100%]
506
+ - **Structure Complexity**: [Simple/Medium/Complex]
507
+
508
+ ### 🎯 Interview strategy
509
+ - **Question category**: Product Discovery / Structure / Tech
510
+ - **Expected number of questions**: [N (M required + K optional)]
511
+ - **Estimated time required**: [Time estimation]
512
+ - **Priority area**: [Focus on Areas to be covered]
513
+
514
+ ### ⚠️ Notes
515
+ - **Existing document**: [Overwrite vs supplementation strategy]
516
+ - **Language settings**: [Automatic detection vs manual setting]
517
+ - **Configuration conflicts**: [Compatibility with existing config.json]
518
+
519
+ ### ✅ Expected deliverables
520
+ - **product.md**: [Business requirements document]
521
+ - **structure.md**: [System architecture document]
522
+ - **tech.md**: [Technology stack and policy document]
523
+ - **config.json**: [Project configuration file]
524
+
525
+ ---
526
+ **Approval Request**: Would you like to proceed with the interview using the above plan?
527
+ (Choose “Proceed,” “Modify [Content],” or “Abort”)
528
+ ```
529
+
530
+ ### 1.5 Wait for user approval (moai-alfred-interactive-questions) (when user selects "New")
531
+
532
+ After Alfred receives the project-manager's interview plan report, uses `AskUserQuestion` tool (documented in moai-alfred-interactive-questions skill) and asks whether Phase 2 is approved.
533
+ - **Proceed**: Interview conducted according to approved plan
534
+ - **Modify**: Re-establish the plan (re-execute Phase 1)
535
+ - **Stop**: Stop initialization
536
+
537
+ **Response processing**:
538
+ - **"Progress"** (`answers["0"] === "Progress"`) → Execute Phase 2
539
+ - **"Modify"** (`answers["0"] === "Modify"`) → Repeat Phase 1 (recall project-manager)
540
+ - **"Abort"** (`answers["0"] === "Abort"`) → End task
541
+
542
+ ---
543
+
544
+ ## 🚀 STEP 2: Execute project initialization (after user approves “New”)
545
+
546
+ **Note**: This step will only be executed if the user selects **"New"**.
547
+ - When selecting "Merge": End the task in Phase 1.1 (Merge Backups)
548
+ - When selecting "Skip": End the task
549
+ - When selecting "New": Proceed with the process below
550
+
551
+ After user approval, the project-manager agent performs initialization.
552
+
553
+ ### 2.1 Call project-manager agent (when user selects "New")
554
+
555
+ Alfred starts project initialization by calling the project-manager agent with the following parameters:
556
+
557
+ **Parameters passed to project-manager**:
558
+ - **conversation_language** (from STEP 0): Language code selected by user (e.g., "ko", "en", "ja", "zh")
559
+ - **language_name** (from STEP 0): Display name of selected language (e.g., "Korean", "English")
560
+ - Detected Languages: [Language List from codebase detection]
561
+ - Project Type: [New/Existing]
562
+ - Existing Document Status: [Existence/Absence]
563
+ - Approved Interview Plan: [Plan Summary]
564
+
565
+ **Execution**:
566
+ ```
567
+ Call the Task tool:
568
+ - subagent_type: "project-manager"
569
+ - description: "Initialize project with conversation language support"
570
+ - prompt: """You are project-manager agent.
571
+
572
+ LANGUAGE CONFIGURATION:
573
+ - conversation_language: {{CONVERSATION_LANGUAGE}}
574
+ - language_name: {{CONVERSATION_LANGUAGE_NAME}}
575
+
576
+ PROJECT_TYPE: [new|existing]
577
+ DETECTED_LANGUAGES: [detected codebase languages]
578
+
579
+ CRITICAL INSTRUCTION:
580
+ All interviews and generated documentation MUST be in conversation_language:
581
+ - product.md: Generate in {{CONVERSATION_LANGUAGE}}
582
+ - structure.md: Generate in {{CONVERSATION_LANGUAGE}}
583
+ - tech.md: Generate in {{CONVERSATION_LANGUAGE}}
584
+
585
+ If conversation_language is 'ko': All narrative content in Korean
586
+ If conversation_language is 'ja': All narrative content in Japanese
587
+ If conversation_language is other: Follow the specified language
588
+
589
+ After project initialization, update .moai/config.json with nested language structure:
590
+ {
591
+ "language": {
592
+ "conversation_language": "{{CONVERSATION_LANGUAGE}}",
593
+ "conversation_language_name": "{{CONVERSATION_LANGUAGE_NAME}}"
594
+ }
595
+ }
596
+
597
+ SKILL INVOCATION:
598
+ Use explicit Skill() calls when needed:
599
+ - Skill("moai-alfred-language-detection") for codebase language detection
600
+ - Skill("moai-foundation-langs") for multi-language project setup
601
+
602
+ TASK: Conduct project interviews and create/update product/structure/tech.md documents."""
603
+ ```
604
+
605
+ **Outcome**: The project-manager agent conducts structured interviews entirely in the selected language and creates/updates product/structure/tech.md documents in that language.
606
+
607
+ ### 2.2 Automatic activation of Alfred Skills (optional)
608
+
609
+ After the project-manager has finished creating the document, **Alfred can optionally call Skills** (upon user request).
610
+
611
+ **Automatic activation conditions** (optional):
612
+
613
+ | Conditions | Automatic selection Skill | Purpose |
614
+ | ------------------------------------ | ---------------------------- | -------------------------------------- |
615
+ | User Requests “Quality Verification” | moai-alfred-trust-validation | Initial project structure verification |
616
+
617
+ **Execution flow** (optional):
618
+ ```
619
+ 1. project-manager completion
620
+
621
+ 2. User selection:
622
+ - "Quality verification required" → moai-alfred-trust-validation (Level 1 quick scan)
623
+ - "Skip" → Complete immediately
624
+ ```
625
+
626
+ **Note**: Quality verification is optional during the project initialization phase.
627
+
628
+ ### 2.3 Sub-agent moai-alfred-interactive-questions (Nested)
629
+
630
+ **The project-manager agent can internally call the TUI survey skill** to check the details of the task.
631
+
632
+ **When to call**:
633
+ - Before overwriting existing project documents
634
+ - When selecting language/framework
635
+ - When changing important settings
636
+
637
+ **Example** (inside project-manager): Ask whether to "overwrite file" with `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)`,
638
+ - Allows you to choose between **Overwrite** / **Merge** / **Skip**.
639
+
640
+ **Nested pattern**:
641
+ - **Command level** (Phase approval): Called by Alfred → "Shall we proceed with Phase 2?"
642
+ - **Sub-agent level** (Detailed confirmation): Called by project-manager → "Shall we overwrite the file?"
643
+
644
+ ### 2.4 Processing method by project type
645
+
646
+ #### A. New project (Greenfield)
647
+
648
+ **Interview Flow**:
649
+
650
+ 1. **Product Discovery** (create product.md)
651
+ - Define core mission (@DOC:MISSION-001)
652
+ - Identify key user base (@SPEC:USER-001)
653
+ - Identify key problems to solve (@SPEC:PROBLEM-001)
654
+ - Summary of differences and strengths (@DOC:STRATEGY-001)
655
+ - Setting success indicators (@SPEC:SUCCESS-001)
656
+
657
+ 2. **Structure Blueprint** (create structure.md)
658
+ - Selection of architecture strategy (@DOC:ARCHITECTURE-001)
659
+ - Division of responsibilities by module (@DOC:MODULES-001)
660
+ - External system integration plan (@DOC:INTEGRATION-001)
661
+ - Define traceability strategy (@DOC:TRACEABILITY-001)
662
+
663
+ 3. **Tech Stack Mapping** (written by tech.md)
664
+ - Select language & runtime (@DOC:STACK-001)
665
+ - Determine core framework (@DOC:FRAMEWORK-001)
666
+ - Set quality gate (@DOC:QUALITY-001)
667
+ - Define security policy (@DOC:SECURITY-001)
668
+ - Plan distribution channels (@DOC:DEPLOY-001)
669
+
670
+ **Automatically generate config.json**:
671
+ ```json
672
+ {
673
+ "project_name": "detected-name",
674
+ "project_type": "single|fullstack|microservice",
675
+ "project_language": "python|typescript|java|go|rust",
676
+ "test_framework": "pytest|vitest|junit|go test|cargo test",
677
+ "linter": "ruff|biome|eslint|golint|clippy",
678
+ "formatter": "black|biome|prettier|gofmt|rustfmt",
679
+ "coverage_target": 85,
680
+ "mode": "personal"
681
+ }
682
+ ```
683
+
684
+ #### B. Existing project (legacy introduction)
685
+
686
+ **Legacy Snapshot & Alignment**:
687
+
688
+ **STEP 1: Identify the overall project structure**
689
+
690
+ Alfred identifies the entire project structure:
691
+ - Visualize the directory structure using the tree or find commands
692
+ - Exclude build artifacts such as node_modules, .git, dist, build, __pycache__, etc.
693
+ - Identify key source directories and configuration files.
694
+
695
+ **Output**:
696
+ - Visualize the entire folder/file hierarchy of the project
697
+ - Identify major directories (src/, tests/, docs/, config/, etc.)
698
+ - Check language/framework hint files (package.json, pyproject.toml, go.mod, etc.)
699
+
700
+ **STEP 2: Establish parallel analysis strategy**
701
+
702
+ Alfred identifies groups of files by the Glob pattern:
703
+ 1. **Configuration files**: *.json, *.toml, *.yaml, *.yml, *.config.js
704
+ 2. **Source code files**: src/**/*.{ts,js,py,go,rs,java}
705
+ 3. **Test files**: tests/**/*.{ts,js,py,go,rs,java}, **/*.test.*, **/*.spec.*
706
+ 4. **Documentation files**: *.md, docs/**/*.md, README*, CHANGELOG*
707
+
708
+ **Parallel Read Strategy**:
709
+ - Speed ​​up analysis by reading multiple files simultaneously with the Read tool
710
+ - Batch processing for each file group
711
+ - Priority: Configuration file → Core source → Test → Document
712
+
713
+ **STEP 3: Analysis and reporting of characteristics for each file**
714
+
715
+ As each file is read, the following information is collected:
716
+
717
+ 1. **Configuration file analysis**
718
+ - Project metadata (name, version, description)
719
+ - Dependency list and versions
720
+ - Build/test script
721
+ - Confirm language/framework
722
+
723
+ 2. **Source code analysis**
724
+ - Identify major modules and classes
725
+ - Architectural pattern inference (MVC, clean architecture, microservice, etc.)
726
+ - Identify external API calls and integration points
727
+ - Key areas of domain logic
728
+
729
+ 3. **Test code analysis**
730
+ - Check test framework
731
+ - Identify coverage settings
732
+ - Identify key test scenarios
733
+ - Evaluate TDD compliance
734
+
735
+ 4. **Document analysis**
736
+ - Existing README contents
737
+ - Existence of architecture document
738
+ - API document status
739
+ - Installation/deployment guide completeness
740
+
741
+ **Report Format**:
742
+ ```markdown
743
+ ## Analysis results for each file
744
+
745
+ ### Configuration file
746
+ - package.json: Node.js 18+, TypeScript 5.x, Vitest test
747
+ - tsconfig.json: strict mode, ESNext target
748
+ - biome.json: Linter/formatter settings exist
749
+
750
+ ### Source code (src/)
751
+ - src/core/: Core business logic (3 modules)
752
+ - src/api/: REST API endpoints (5 routers)
753
+ - src/utils/: Utility functions (logging, verification, etc.)
754
+ - Architecture: Hierarchical (controller) → service → repository)
755
+
756
+ ### Tests (tests/)
757
+ - Vitest + @testing-library used
758
+ - Unit test coverage estimated at about 60%
759
+ - E2E testing lacking
760
+
761
+ ### Documentation
762
+ - README.md: Only installation guide
763
+ - Absence of API documentation
764
+ - Absence of architecture document
765
+ ```
766
+
767
+ **STEP 4: Comprehensive analysis and product/structure/tech reflection**
768
+
769
+ Based on the collected information, it is reflected in three major documents:
770
+
771
+ 1. Contents reflected in **product.md**
772
+ - Project mission extracted from existing README/document
773
+ - Main user base and scenario inferred from code
774
+ - Backtracking of core problem to be solved
775
+ - Preservation of existing assets in “Legacy Context”
776
+
777
+ 2. Contents reflected in **structure.md**
778
+ - Identified actual directory structure
779
+ - Responsibility analysis results for each module
780
+ - External system integration points (API calls, DB connections, etc.)
781
+ - Technical debt items (marked with @CODE tag)
782
+
783
+ 3. **tech.md reflection content**
784
+ - Languages/frameworks/libraries actually in use
785
+ - Existing build/test pipeline
786
+ - Status of quality gates (linter, formatter, test coverage)
787
+ - Identification of security/distribution policy
788
+ - Items requiring improvement (marked with TODO tags)
789
+
790
+ **Preservation Policy**:
791
+ - Supplement only the missing parts without overwriting existing documents
792
+ - Preserve conflicting content in the “Legacy Context” section
793
+ - Mark items needing improvement with @CODE and TODO tags
794
+
795
+ **Example Final Report**:
796
+ ```markdown
797
+ ## Complete analysis of existing project
798
+
799
+ ### Environment Information
800
+ - **Language**: TypeScript 5.x (Node.js 18+)
801
+ - **Framework**: Express.js
802
+ - **Test**: Vitest (coverage ~60%)
803
+ - **Linter/Formatter**: Biome
804
+
805
+ ### Main findings
806
+ 1. **Strengths**:
807
+ - High type safety (strict mode)
808
+ - Clear module structure (separation of core/api/utils)
809
+
810
+ 2. **Needs improvement**:
811
+ - Test coverage below 85% (TODO:TEST-COVERAGE-001)
812
+ - Absence of API documentation (TODO:DOCS-API-001)
813
+ - Insufficient E2E testing (@CODE:TEST-E2E-001)
814
+
815
+ ### Next step
816
+ 1. product/structure/tech.md creation completed
817
+ 2. @CODE/TODO item priority confirmation
818
+ 3. /alfred:Start writing an improvement SPEC with 1-spec
819
+ ```
820
+
821
+ ### 2.3 Document creation and verification
822
+
823
+ **Output**:
824
+ - `.moai/project/product.md` (Business Requirements)
825
+ - `.moai/project/structure.md` (System Architecture)
826
+ - `.moai/project/tech.md` (Technology Stack and policy)
827
+ - `.moai/config.json` (project settings)
828
+
829
+ **Quality Verification**:
830
+ - [ ] Verify existence of all required @TAG sections
831
+ - [ ] Verify compliance with EARS syntax format
832
+ - [ ] Verify config.json syntax validity
833
+ - [ ] Verify cross-document consistency
834
+
835
+ ### 2.4 Completion Report
836
+
837
+ ```markdown
838
+ ✅ Project initialization complete!
839
+
840
+ 📁 Documents generated:
841
+ - .moai/project/product.md (Business Definition)
842
+ - .moai/project/structure.md (Architecture Design)
843
+ - .moai/project/tech.md (Technology Stack)
844
+ - .moai/config.json (project settings)
845
+
846
+ 🔍 Detected environments:
847
+ - Language: [List of languages]
848
+ - Frameworks: [List of frameworks]
849
+ - Test tools: [List of tools]
850
+
851
+ 📋 Next steps:
852
+ 1. Review the generated document
853
+ 2. Create your first SPEC with /alfred:1-plan
854
+ 3. If necessary, readjust with /alfred:8-project update
855
+ ```
856
+
857
+ ### 2.5: Initial structural verification (optional)
858
+
859
+ After project initialization is complete, you can optionally run quality verification.
860
+
861
+ **Execution Conditions**: Only when explicitly requested by the user.
862
+
863
+ **Verification Purpose**:
864
+ - Basic verification of project documentation and configuration files
865
+ - Verification of compliance with the TRUST principles of the initial structure
866
+ - Validation of configuration files
867
+
868
+ **How ​​it works**:
869
+ Alfred only calls the trust-checker agent to perform project initial structural verification if explicitly requested by the user.
870
+
871
+ **Verification items**:
872
+ - **Document completeness**: Check existence of required sections in product/structure/tech.md
873
+ - **Settings validity**: Verify config.json JSON syntax and required fields
874
+ - **TAG scheme**: Check compliance with @TAG format in document
875
+ - **EARS syntax**: Validation of the EARS template to be used when writing SPECs
876
+
877
+ **Run Verification**: Level 1 quick scan (3-5 seconds)
878
+
879
+ **Handling verification results**:
880
+
881
+ ✅ **Pass**: Can proceed to next step
882
+ - Documents and settings are all normal
883
+
884
+ ⚠️ **Warning**: Proceed after warning
885
+ - Some optional sections are missing
886
+ - Recommendations not applied
887
+
888
+ ❌ **Critical**: Needs fix
889
+ - Required section missing
890
+ - config.json syntax error
891
+ - User choice: “Revalidate after fix” or “Skip”
892
+
893
+ **Skip verification**:
894
+ - Verification is not run by default
895
+ - Run only when explicitly requested by the user
896
+
897
+ ### 2.6: Agent & Skill Tailoring (Project Optimization)
898
+
899
+ 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.
900
+ Before actual application, user confirmation is received with `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)`, and selected items are recorded in `CLAUDE.md` and `.moai/config.json`.
901
+
902
+ #### 2.6.0 Create cc-manager briefing
903
+
904
+ 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`.
905
+
906
+ - `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.
907
+ - `structure.md`: Records architecture type, module boundaries and scope of responsibility, external integration, traceability strategy, and TODO contents.
908
+ - `tech.md`: Organizes language/framework version, build/test/deployment procedures, quality/security policy, operation/monitoring method, and TODO items.
909
+
910
+ Be sure to include the source (e.g. `product.md@SPEC:SUCCESS-001`) for each item so that cc-manager can understand the basis.
911
+
912
+ #### 2.6.1 cc-manager judgment guide
913
+
914
+ 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.
915
+
916
+ | Project requirements (document basis) | Recommended sub-agent/skill | Purpose |
917
+ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
918
+ | High quality and coverage goals (`product.md@SPEC:SUCCESS-001`) | `tdd-implementer`, `moai-essentials-debug`, `moai-essentials-review` | Establishment of RED·GREEN·REFACTOR workflow |
919
+ | 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 |
920
+ | Deployment automation/branch strategy required (`structure.md` Architecture/TODO) | `git-manager`, `moai-alfred-git-workflow`, `moai-foundation-git` | Branch Strategy·Commit Policy·PR Automation |
921
+ | Refactoring legacy modules (`product.md` BACKLOG, `tech.md` TODO) | `implementation-planner`, `moai-essentials-refactor` | Technical Debt Diagnosis and Refactoring Roadmap |
922
+ | 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 |
923
+ | 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 |
924
+ | Data analysis/reporting needs (`product.md` DATA, `tech.md` ANALYTICS) | `implementation-planner`, `moai-domain-data-science`, detected language skills | Data Pipeline·Notebook Job Definition |
925
+ | 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 |
926
+ | 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 |
927
+ | Introduction of ML/AI functions (`product.md` AI, `tech.md` MODEL) | `implementation-planner`, `moai-domain-ml`, detected language skills | Model training/inference pipeline definition |
928
+ | 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 |
929
+ | Strengthening coding standards/review process (`tech.md` REVIEW) | `quality-gate`, `moai-essentials-review` | Strengthening review checklist and quality reporting |
930
+ | Requires onboarding/training mode (`tech.md` STACK description, etc.) | `moai-alfred-interactive-questions`, `moai-adk-learning`, `agentic-coding` Output style | Enhanced interview TUI and automatically provided onboarding materials |
931
+
932
+ > **Language/Domain Skill Selection Rules**
933
+ > - 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.
934
+ > - Skills listed in the domain row are automatically included by cc-manager in the `selected_skills` list when the conditions are met.
935
+ > - The skill directory is always copied in its entirety, and only actual activation is recorded in `skill_pack` and `CLAUDE.md`.
936
+
937
+ If multiple conditions are met, the candidates are merged without duplicates and organized into sets of `candidate_agents`, `candidate_skills`, and `candidate_styles`.
938
+
939
+ #### 2.6.2 User confirmation flow
940
+
941
+ `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` asks “whether to enable recommended items.”
942
+ - Provides three options: **Install all** / **Install selectively** / **Do not install**.
943
+ Selecting “Selective Install” presents the list of candidates again as multiple choices, allowing the user to select only the items they need.
944
+
945
+ #### 2.6.3 Activation and Recording Steps
946
+
947
+ 1. **Preparing briefing**: Organize the results of user selection (install all/install selectively) and the full text of `cc_manager_briefing`.
948
+ 2. **Call the cc-manager agent**:
949
+ - Call `subagent_type: "cc-manager"` with the `Task` tool and include a briefing and user selections in the prompt.
950
+ - 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.
951
+ 3. **Check for configuration updates**: Review the results reflected by cc-manager.
952
+ - Sub-Agents: Keep the `.claude/agents/alfred/` template active and list it in the `CLAUDE.md` “Agents” section.
953
+ - Skills: Check the `.claude/skills/` document and add it to the `CLAUDE.md` “Skills” section.
954
+ - Output style: Apply `.claude/output-styles/alfred/` and record the activation in `CLAUDE.md` “Output Styles”.
955
+ 4. **Update config.json**
956
+ ```json
957
+ {
958
+ "project": {
959
+ "optimized": true,
960
+ "agent_pack": ["tdd-implementer", "doc-syncer"],
961
+ "skill_pack": ["moai-alfred-git-workflow", "moai-alfred-tag-scanning"],
962
+ "output_styles": ["moai-adk-learning"]
963
+ }
964
+ }
965
+ ```
966
+ Merge existing properties, if any.
967
+ 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.
968
+
969
+ ## Interview guide by project type
970
+
971
+ ### New project interview area
972
+
973
+ **Product Discovery** (product.md)
974
+ - Core mission and value proposition
975
+ - Key user bases and needs
976
+ - 3 key problems to solve
977
+ - Differentiation compared to competing solutions
978
+ - Measurable indicators of success
979
+
980
+ **Structure Blueprint** (structure.md)
981
+ - System architecture strategy
982
+ - Separation of modules and division of responsibilities
983
+ - External system integration plan
984
+ - @TAG-based traceability strategy
985
+
986
+ **Tech Stack Mapping** (tech.md)
987
+ - Language/runtime selection and version
988
+ - Framework and libraries
989
+ - Quality gate policy (coverage, linter)
990
+ - Security policy and distribution channel
991
+
992
+ ### Existing project interview area
993
+
994
+ **Legacy Analysis**
995
+ - Identify current code structure and modules
996
+ - Status of build/test pipeline
997
+ - Identify technical debt and constraints
998
+ - External integration and authentication methods
999
+ - MoAI-ADK transition priority plan
1000
+
1001
+ **Retention Policy**: Preserve existing documents in the "Legacy Context" section and mark items needing improvement with @CODE/TODO tags
1002
+
1003
+ ## 🏷️ TAG system application rules
1004
+
1005
+ **Automatically create @TAGs per section**:
1006
+
1007
+ - Mission/Vision → @DOC:MISSION-XXX, @DOC:STRATEGY-XXX
1008
+ - Customization → @SPEC:USER-XXX, @SPEC:PERSONA-XXX
1009
+ - Problem analysis → @SPEC:PROBLEM-XXX, @SPEC:SOLUTION-XXX
1010
+ - Architecture → @DOC:ARCHITECTURE-XXX, @SPEC:PATTERN-XXX
1011
+ - Technology Stack → @DOC:STACK-XXX, @DOC:FRAMEWORK-XXX
1012
+
1013
+ **Legacy Project Tags**:
1014
+
1015
+ - Technical debt → @CODE:REFACTOR-XXX, @CODE:TEST-XXX, @CODE:MIGRATION-XXX
1016
+ - Resolution plan → @CODE:MIGRATION-XXX, TODO:SPEC-BACKLOG-XXX
1017
+ - Quality improvement → TODO:TEST-COVERAGE-XXX, TODO:DOCS-SYNC-XXX
1018
+
1019
+ ## Error handling
1020
+
1021
+ ### Common errors and solutions
1022
+
1023
+ **Error 1**: Project language detection failed
1024
+ ```
1025
+ Symptom: “Language not detected” message
1026
+ Solution: Specify language manually or create language-specific settings file
1027
+ ```
1028
+
1029
+ **Error 2**: Conflict with existing document
1030
+ ```
1031
+ Symptom: product.md already exists and has different contents
1032
+ Solution: Preserve existing contents and add new contents in “Legacy Context” section
1033
+ ```
1034
+
1035
+ **Error 3**: Failed to create config.json
1036
+ ```
1037
+ Symptom: JSON syntax error or permission denied
1038
+ Solution: Check file permissions (chmod 644) or create config.json manually
1039
+ ```
1040
+
1041
+ ---
1042
+
1043
+ ## /alfred:0-project update: Template optimization (subcommand)
1044
+
1045
+ > **Purpose**: After running moai-adk update, compare the backup and new template to optimize the template while preserving user customization.
1046
+
1047
+ ### Execution conditions
1048
+
1049
+ This subcommand is executed under the following conditions:
1050
+
1051
+ 1. **After executing moai-adk update**: `optimized=false` status in `config.json`
1052
+ 2. **Template update required**: When there is a difference between the backup and the new template
1053
+ 3. **User explicit request**: User directly executes `/alfred:0-project update`
1054
+
1055
+ ### Execution flow
1056
+
1057
+ #### Phase 1: Backup analysis and comparison
1058
+
1059
+ 1. **Make sure you have the latest backup**:
1060
+ ```bash
1061
+ # Browse the latest backups in the .moai-backups/ directory
1062
+ ls -lt .moai-backups/ | head -1
1063
+ ```
1064
+
1065
+ 2. **Change Analysis**:
1066
+ - Compare `.claude/` directory from backup with current template
1067
+ - Compare `.moai/project/` document from backup with current document
1068
+ - Identify user customization items
1069
+
1070
+ 3. **Create Comparison Report**:
1071
+ ```markdown
1072
+ ## 📊 Template optimization analysis
1073
+
1074
+ ### Changed items
1075
+ - CLAUDE.md: "## Project Information" section needs to be preserved
1076
+ - settings.json: 3 env variables need to be preserved
1077
+ - product.md: Has user-written content
1078
+
1079
+ ### Recommended Action
1080
+ - Run Smart Merge
1081
+ - Preserve User Customizations
1082
+ - Set optimized=true
1083
+ ```
1084
+
1085
+ 4. **Waiting for user approval**
1086
+ `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` asks “Do you want to proceed with template optimization?” and provides the following options.
1087
+ - **Proceed** → Phase 2 execution
1088
+ - **Preview** → Display change details and recheck
1089
+ - **Skip** → keep optimized=false
1090
+
1091
+ #### Phase 2: Run smart merge (after user approval)
1092
+
1093
+ 1. **Execute smart merge logic**:
1094
+ - Run `TemplateProcessor.copy_templates()`
1095
+ - CLAUDE.md: Preserve "## Project Information" section
1096
+ - settings.json: env variables and permissions.allow merge
1097
+
1098
+ 2. Set **optimized=true**:
1099
+ ```python
1100
+ # update config.json
1101
+ config_data["project"]["optimized"] = True
1102
+ ```
1103
+
1104
+ 3. **Optimization completion report**:
1105
+ ```markdown
1106
+ ✅ Template optimization completed!
1107
+
1108
+ 📄 Merged files:
1109
+ - CLAUDE.md (preserves project information)
1110
+ - settings.json (preserves env variables)
1111
+
1112
+ ⚙️ config.json: optimized=true Configuration complete
1113
+ ```
1114
+
1115
+ ### Alfred Automation Strategy
1116
+
1117
+ **Alfred automatic decision**:
1118
+ - Automatically call project-manager agent
1119
+ - Check backup freshness (within 24 hours)
1120
+ - Automatically analyze changes
1121
+
1122
+ **Auto-activation of Skills**:
1123
+ - moai-alfred-tag-scanning: TAG chain verification
1124
+ - moai-alfred-trust-validation: Verification of compliance with TRUST principles
1125
+
1126
+ ### Running example
1127
+
1128
+ ```bash
1129
+ # After running moai-adk update
1130
+ moai-adk update
1131
+
1132
+ # Output:
1133
+ # ✓ Update complete!
1134
+ # ℹ️ Next step: Run /alfred:0-project update to optimize template changes
1135
+
1136
+ # Run Alfred
1137
+ /alfred:0-project update
1138
+
1139
+ # → Phase 1: Generate backup analysis and comparison report
1140
+ # → Wait for user approval
1141
+ # → Phase 2: Run smart merge, set optimized=true
1142
+ ```
1143
+
1144
+ ### caution
1145
+
1146
+ - **Backup required**: Cannot run without backup in `.moai-backups/` directory
1147
+ - **Manual review recommended**: Preview is required if there are important customizations
1148
+ - **Conflict resolution**: Request user selection in case of merge conflict
1149
+
1150
+ ---
1151
+
1152
+ ## 🚀 STEP 3: Project Custom Optimization (Optional)
1153
+
1154
+ **Execution conditions**:
1155
+ - After completion of Phase 2 (project initialization)
1156
+ - or after completion of Phase 1.1 (backup merge)
1157
+ - Explicitly requested by the user or automatically determined by Alfred
1158
+
1159
+ **Purpose**: Lightweight by selecting only Commands, Agents, and Skills that fit the project characteristics (37 skills → 3~5)
1160
+
1161
+ ### 3.1 Automatic execution of Feature Selection
1162
+
1163
+ **Alfred automatically calls the moai-alfred-feature-selector skill**:
1164
+
1165
+ **Skill Entry**:
1166
+ - `.moai/project/product.md` (project category hint)
1167
+ - `.moai/project/tech.md` (main language, framework)
1168
+ - `.moai/config.json` (project settings)
1169
+
1170
+ **Skill Output**:
1171
+ ```json
1172
+ {
1173
+ "category": "web-api",
1174
+ "language": "python",
1175
+ "framework": "fastapi",
1176
+ "commands": ["1-spec", "2-build", "3-sync"],
1177
+ "agents": ["spec-builder", "code-builder", "doc-syncer", "git-manager", "debug-helper"],
1178
+ "skills": ["moai-lang-python", "moai-domain-web-api", "moai-domain-backend"],
1179
+ "excluded_skills_count": 34,
1180
+ "optimization_rate": "87%"
1181
+ }
1182
+ ```
1183
+
1184
+ **How ​​to Run**:
1185
+ ```
1186
+ Alfred: Skill("moai-alfred-feature-selector")
1187
+ ```
1188
+
1189
+ ---
1190
+
1191
+ ### 3.2 Automatic execution of Template Generation
1192
+
1193
+ **Alfred automatically calls the moai-alfred-template-generator skill**:
1194
+
1195
+ **Skill input**:
1196
+ - `.moai/.feature-selection.json` (feature-selector output)
1197
+ - `CLAUDE.md` template
1198
+ - Entire commands/agents/skills file
1199
+
1200
+ **Skill Output**:
1201
+ - `CLAUDE.md` (custom agent table - selected agents only)
1202
+ - `.claude/commands/` (selected commands only)
1203
+ - `.claude/agents/` (selected agents only)
1204
+ - `.claude/skills/` (selected skills only)
1205
+ - `.moai/config.json` (updates `optimized: true`)
1206
+
1207
+ **How ​​to Run**:
1208
+ ```
1209
+ Alfred: Skill("moai-alfred-template-generator")
1210
+ ```
1211
+
1212
+ ---
1213
+
1214
+ ### 3.3 Optimization completion report
1215
+
1216
+ **Report Format**:
1217
+ ```markdown
1218
+ ✅ Project customized optimization completed!
1219
+
1220
+ 📊 Optimization results:
1221
+ - **Project**: MoAI-ADK
1222
+ - **Category**: web-api
1223
+ - **Main language**: python
1224
+ - **Framework**: fastapi
1225
+
1226
+ 🎯 Selected capabilities:
1227
+ - Commands: 4 items (0-project, 1-spec, 2-build, 3-sync)
1228
+ - Agents: 5 items (spec-builder, code-builder, doc-syncer, git-manager, debug-helper)
1229
+ - Skills: 3 items (moai-lang-python, moai-domain-web-api, moai-domain-backend)
1230
+
1231
+ 💡 Lightweight effect:
1232
+ - Skills excluded: 34
1233
+ - Lightweight: 87%
1234
+ - CLAUDE.md: Create custom agent table
1235
+
1236
+ 📋 Next steps:
1237
+ 1. Check the CLAUDE.md file (only 5 agents are displayed)
1238
+ 2. Run /alfred:1-plan "first function"
1239
+ 3. Start the MoAI-ADK workflow
1240
+ ```
1241
+
1242
+ ---
1243
+
1244
+ ### 3.4 Skip Phase 3 (optional)
1245
+
1246
+ **Users can skip Phase 3**:
1247
+
1248
+ **Skip condition**:
1249
+ - User explicitly selects “Skip”
1250
+ - “Simple project” when Alfred automatically determines (only basic features required)
1251
+
1252
+ **Skip effect**:
1253
+ - Maintain all 37 skills (no lightweighting)
1254
+ - Maintain default 9 agents in CLAUDE.md template
1255
+ - Maintain `optimized: false` in config.json
1256
+
1257
+ ---
1258
+
1259
+ ## Next steps
1260
+
1261
+ **Recommendation**: For better performance and context management, start a new chat session with the `/clear` or `/new` command before proceeding to the next step.
1262
+
1263
+ After initialization is complete:
1264
+
1265
+ - **New project**: Run `/alfred:1-plan` to create design-based SPEC backlog
1266
+ - **Legacy project**: Review @CODE/@CODE/TODO items in product/structure/tech document and confirm priority
1267
+ - **Set Change**: Run `/alfred:0-project` again to update document
1268
+ - **Template optimization**: Run `/alfred:0-project update` after `moai-adk update`
1269
+
1270
+ ## Related commands
1271
+
1272
+ - `/alfred:1-plan` - Start writing SPEC
1273
+ - `/alfred:9-update` - MoAI-ADK update
1274
+ - `moai doctor` - System diagnosis
1275
+ - `moai status` - Check project status