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
@@ -0,0 +1,871 @@
1
+ # Alfred Interactive Questions - Real-World Examples
2
+
3
+ > **Main Skill**: [SKILL.md](SKILL.md)
4
+ > **API Reference**: [reference.md](reference.md)
5
+
6
+ ---
7
+
8
+ ## Example 1: Vague Feature Request
9
+
10
+ ### Scenario
11
+
12
+ **User**: "Add a completion page for the competition."
13
+
14
+ **Alfred detects ambiguity**:
15
+ - Where should it live? (new route vs modify existing)
16
+ - Who can access it? (public vs authenticated)
17
+ - What should it display? (results vs simple message)
18
+
19
+ ### AskUserQuestion Invocation
20
+
21
+ ```typescript
22
+ const answer = await AskUserQuestion({
23
+ questions: [
24
+ {
25
+ question: "How should the completion page be implemented?",
26
+ header: "Approach",
27
+ multiSelect: false,
28
+ options: [
29
+ {
30
+ label: "New public route",
31
+ description: "New page at /competition-complete, visible to all visitors."
32
+ },
33
+ {
34
+ label: "Modify existing page",
35
+ description: "Add conditional logic to existing /end page based on competition status."
36
+ },
37
+ {
38
+ label: "Environment flag",
39
+ description: "Set NEXT_PUBLIC_COMPETITION_CLOSED=true to show message on homepage."
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ question: "For logged-in participants, what should they see?",
45
+ header: "Behavior",
46
+ multiSelect: false,
47
+ options: [
48
+ {
49
+ label: "Show full results",
50
+ description: "Redirect to /end page with their submission history and rankings."
51
+ },
52
+ {
53
+ label: "Show simple message",
54
+ description: "Display 'Competition concluded. Thank you for participating!' only."
55
+ }
56
+ ]
57
+ }
58
+ ]
59
+ });
60
+
61
+ // Result:
62
+ // {
63
+ // "Approach": "New public route",
64
+ // "Behavior": "Show full results"
65
+ // }
66
+ ```
67
+
68
+ ### Outcome
69
+
70
+ Alfred now knows **exactly** what to build:
71
+ - Create `/app/competition-complete/page.tsx`
72
+ - New public route
73
+ - Logged-in users redirected to `/end` page with full results
74
+ - Non-logged-in users see simple completion message
75
+
76
+ ---
77
+
78
+ ## Example 2: Implementation Approach (Pattern 1)
79
+
80
+ ### Scenario
81
+
82
+ **User**: "Add i18n support to the app."
83
+
84
+ **Alfred detects**:
85
+ - Multiple valid i18n libraries exist
86
+ - Each has different trade-offs (DX, complexity, performance)
87
+ - User hasn't specified preference
88
+
89
+ ### AskUserQuestion Invocation
90
+
91
+ ```typescript
92
+ const answer = await AskUserQuestion({
93
+ questions: [{
94
+ question: "Which i18n library should we use for Next.js 15?",
95
+ header: "Library",
96
+ multiSelect: false,
97
+ options: [
98
+ {
99
+ label: "next-intl",
100
+ description: "Native Next.js 15 support, best DX, automatic type safety."
101
+ },
102
+ {
103
+ label: "react-i18next",
104
+ description: "Most popular, flexible, more setup required, larger bundle."
105
+ },
106
+ {
107
+ label: "Format.js",
108
+ description: "ICU message format, powerful pluralization, steeper learning curve."
109
+ }
110
+ ]
111
+ }]
112
+ });
113
+
114
+ // Result: { "Library": "next-intl" }
115
+ ```
116
+
117
+ ### Outcome
118
+
119
+ Alfred proceeds with `next-intl`, avoiding:
120
+ - ❌ Guessing wrong library
121
+ - ❌ Implementing then refactoring later
122
+ - ❌ 3-5 rounds of "actually, can we use X instead?"
123
+
124
+ ---
125
+
126
+ ## Example 3: Risky Operation Confirmation (Pattern 2)
127
+
128
+ ### Scenario
129
+
130
+ **User**: "Delete all test users from production database."
131
+
132
+ **Alfred detects**:
133
+ - Destructive operation (data loss)
134
+ - Production environment (high risk)
135
+ - Explicit confirmation required
136
+
137
+ ### AskUserQuestion Invocation
138
+
139
+ ```typescript
140
+ const answer = await AskUserQuestion({
141
+ questions: [{
142
+ question: "⚠️ This will PERMANENTLY delete 50 test users from PRODUCTION database. Are you sure?",
143
+ header: "Confirm",
144
+ multiSelect: false,
145
+ options: [
146
+ {
147
+ label: "No, cancel",
148
+ description: "Abort operation. No changes will be made."
149
+ },
150
+ {
151
+ label: "Yes, proceed",
152
+ description: "🚨 IRREVERSIBLE. Delete 50 users now."
153
+ }
154
+ ]
155
+ }]
156
+ });
157
+
158
+ // Result: { "Confirm": "No, cancel" } (user cancelled)
159
+ ```
160
+
161
+ ### Outcome
162
+
163
+ Alfred **aborts** operation without executing destructive command. User explicitly chose to cancel after seeing full risk disclosure.
164
+
165
+ ---
166
+
167
+ ## Example 4: Multi-Select Feature Selection (Pattern 4)
168
+
169
+ ### Scenario
170
+
171
+ **User**: "Set up testing for the new project."
172
+
173
+ **Alfred detects**:
174
+ - Multiple testing frameworks can coexist
175
+ - User might want unit + E2E + visual testing
176
+ - No explicit preference stated
177
+
178
+ ### AskUserQuestion Invocation
179
+
180
+ ```typescript
181
+ const answer = await AskUserQuestion({
182
+ questions: [{
183
+ question: "Which testing frameworks should we set up? (Select all that apply)",
184
+ header: "Test Tools",
185
+ multiSelect: true, // Multiple selections allowed
186
+ options: [
187
+ {
188
+ label: "Unit tests (Vitest)",
189
+ description: "Fast, modern, Vite-native. ~2min setup."
190
+ },
191
+ {
192
+ label: "E2E tests (Playwright)",
193
+ description: "Browser automation, cross-browser. ~10min setup."
194
+ },
195
+ {
196
+ label: "Visual regression",
197
+ description: "Screenshot comparison with Playwright. ~5min setup."
198
+ }
199
+ ]
200
+ }]
201
+ });
202
+
203
+ // Result: { "Test Tools": ["Unit tests (Vitest)", "E2E tests (Playwright)"] }
204
+ ```
205
+
206
+ ### Outcome
207
+
208
+ Alfred installs and configures:
209
+ - ✅ Vitest for unit tests
210
+ - ✅ Playwright for E2E tests
211
+ - ❌ Skips visual regression (not selected)
212
+
213
+ ---
214
+
215
+ ## Example 5: Sequential Questions (Conditional Flow, Pattern 5)
216
+
217
+ ### Scenario
218
+
219
+ **User**: "Add authentication to the app."
220
+
221
+ **Alfred detects**:
222
+ - First decision: Enable auth? (Yes/No)
223
+ - Second decision: If yes, which provider? (depends on Q1)
224
+
225
+ ### AskUserQuestion Invocation (Part 1)
226
+
227
+ ```typescript
228
+ // Question 1: Enable authentication?
229
+ const q1 = await AskUserQuestion({
230
+ questions: [{
231
+ question: "Should we enable user authentication?",
232
+ header: "Auth",
233
+ multiSelect: false,
234
+ options: [
235
+ {
236
+ label: "Yes",
237
+ description: "User login required for protected routes."
238
+ },
239
+ {
240
+ label: "No",
241
+ description: "Public access only, no authentication."
242
+ }
243
+ ]
244
+ }]
245
+ });
246
+
247
+ // Result: { "Auth": "Yes" }
248
+ ```
249
+
250
+ ### AskUserQuestion Invocation (Part 2, Conditional)
251
+
252
+ ```typescript
253
+ // Question 2: Only ask if Q1 = "Yes"
254
+ if (q1["Auth"] === "Yes") {
255
+ const q2 = await AskUserQuestion({
256
+ questions: [{
257
+ question: "Which authentication provider?",
258
+ header: "Provider",
259
+ multiSelect: false,
260
+ options: [
261
+ {
262
+ label: "JWT + email",
263
+ description: "Traditional email/password with JWT tokens. ~30min setup."
264
+ },
265
+ {
266
+ label: "OAuth (Google)",
267
+ description: "Third-party login via Google. Faster for users. ~20min setup."
268
+ },
269
+ {
270
+ label: "SAML",
271
+ description: "Enterprise SSO (for corporate environments). ~2hr setup."
272
+ }
273
+ ]
274
+ }]
275
+ });
276
+
277
+ // Result: { "Provider": "OAuth (Google)" }
278
+ }
279
+ ```
280
+
281
+ ### Outcome
282
+
283
+ Alfred implements:
284
+ - ✅ Authentication enabled
285
+ - ✅ OAuth with Google provider
286
+ - ✅ Skips JWT setup (not selected)
287
+ - ❌ If Q1 was "No", Q2 never asked (saves time)
288
+
289
+ ---
290
+
291
+ ## Example 6: Option Grouping (Hierarchical Selection)
292
+
293
+ ### Scenario
294
+
295
+ **User**: "Set up a database for the project."
296
+
297
+ **Alfred detects**:
298
+ - 8+ database options exist
299
+ - Too many for one question → choice paralysis
300
+ - Need hierarchical selection: Category → Specific
301
+
302
+ ### AskUserQuestion Invocation (Step 1: Category)
303
+
304
+ ```typescript
305
+ // Step 1: Narrow by database type
306
+ const category = await AskUserQuestion({
307
+ questions: [{
308
+ question: "What type of database does your project need?",
309
+ header: "DB Type",
310
+ multiSelect: false,
311
+ options: [
312
+ {
313
+ label: "Relational (SQL)",
314
+ description: "PostgreSQL, MySQL, SQLite. ACID guarantees, structured data."
315
+ },
316
+ {
317
+ label: "Document (NoSQL)",
318
+ description: "MongoDB, CouchDB. Flexible schema, JSON documents."
319
+ },
320
+ {
321
+ label: "Key-Value",
322
+ description: "Redis, Memcached. In-memory cache, fast reads."
323
+ }
324
+ ]
325
+ }]
326
+ });
327
+
328
+ // Result: { "DB Type": "Relational (SQL)" }
329
+ ```
330
+
331
+ ### AskUserQuestion Invocation (Step 2: Specific Choice)
332
+
333
+ ```typescript
334
+ // Step 2: Specific database within category
335
+ if (category["DB Type"] === "Relational (SQL)") {
336
+ const specific = await AskUserQuestion({
337
+ questions: [{
338
+ question: "Which SQL database?",
339
+ header: "SQL DB",
340
+ multiSelect: false,
341
+ options: [
342
+ {
343
+ label: "PostgreSQL",
344
+ description: "Advanced features (JSON, full-text search, extensions). Industry standard."
345
+ },
346
+ {
347
+ label: "MySQL",
348
+ description: "Most popular, wide hosting support, good performance."
349
+ },
350
+ {
351
+ label: "SQLite",
352
+ description: "Embedded, serverless, single-file. Good for prototypes and small apps."
353
+ }
354
+ ]
355
+ }]
356
+ });
357
+
358
+ // Result: { "SQL DB": "PostgreSQL" }
359
+ }
360
+ ```
361
+
362
+ ### Outcome
363
+
364
+ Alfred avoids:
365
+ - ❌ Presenting 8 options at once (choice paralysis)
366
+ - ❌ User confusion ("What's the difference between MariaDB and MySQL?")
367
+
368
+ Instead:
369
+ - ✅ First narrows to category (3 options)
370
+ - ✅ Then presents specific choices within category (3 options)
371
+ - ✅ Clear, manageable decision flow
372
+
373
+ ---
374
+
375
+ ## Example 7: Batch Related Questions
376
+
377
+ ### Scenario
378
+
379
+ **User**: "Initialize a new Next.js project with best practices."
380
+
381
+ **Alfred detects**:
382
+ - Multiple independent decisions needed
383
+ - All decisions are related to project setup
384
+ - Can ask 3 questions at once (no dependencies)
385
+
386
+ ### AskUserQuestion Invocation
387
+
388
+ ```typescript
389
+ const answers = await AskUserQuestion({
390
+ questions: [
391
+ {
392
+ question: "Which database?",
393
+ header: "Database",
394
+ multiSelect: false,
395
+ options: [
396
+ { label: "PostgreSQL", description: "Relational, ACID-compliant, advanced features." },
397
+ { label: "MongoDB", description: "Document store, flexible schema, rapid prototyping." }
398
+ ]
399
+ },
400
+ {
401
+ question: "Which testing frameworks? (Select all that apply)",
402
+ header: "Testing",
403
+ multiSelect: true, // Multiple selections allowed
404
+ options: [
405
+ { label: "Unit tests", description: "Vitest for fast unit testing." },
406
+ { label: "E2E tests", description: "Playwright for browser automation." },
407
+ { label: "Visual tests", description: "Screenshot comparison testing." }
408
+ ]
409
+ },
410
+ {
411
+ question: "Enable TypeScript strict mode?",
412
+ header: "TypeScript",
413
+ multiSelect: false,
414
+ options: [
415
+ { label: "Yes (recommended)", description: "Strict type checking, catch errors early." },
416
+ { label: "No", description: "Loose type checking, faster initial development." }
417
+ ]
418
+ }
419
+ ]
420
+ });
421
+
422
+ // Result:
423
+ // {
424
+ // "Database": "PostgreSQL",
425
+ // "Testing": ["Unit tests", "E2E tests"],
426
+ // "TypeScript": "Yes (recommended)"
427
+ // }
428
+ ```
429
+
430
+ ### Outcome
431
+
432
+ Alfred configures project with:
433
+ - ✅ PostgreSQL database
434
+ - ✅ Vitest unit tests
435
+ - ✅ Playwright E2E tests
436
+ - ❌ No visual regression tests
437
+ - ✅ TypeScript strict mode enabled
438
+
439
+ All decided in **one interaction** instead of 3 separate back-and-forth exchanges.
440
+
441
+ ---
442
+
443
+ ## Example 8: Error Recovery After Test Failure
444
+
445
+ ### Scenario
446
+
447
+ **Context**: Alfred is in `/alfred:2-run` phase, tests are failing.
448
+
449
+ **Alfred detects**:
450
+ - Tests fail after implementation
451
+ - Multiple possible fixes exist
452
+ - User input needed to decide repair strategy
453
+
454
+ ### AskUserQuestion Invocation
455
+
456
+ ```typescript
457
+ const answer = await AskUserQuestion({
458
+ questions: [{
459
+ question: "Tests are failing. How should we proceed?",
460
+ header: "Fix Strategy",
461
+ multiSelect: false,
462
+ options: [
463
+ {
464
+ label: "Fix implementation",
465
+ description: "Adjust code to pass existing tests (tests are correct)."
466
+ },
467
+ {
468
+ label: "Update tests",
469
+ description: "Modify tests to match new implementation (implementation is correct)."
470
+ },
471
+ {
472
+ label: "Debug together",
473
+ description: "Review both implementation and tests to identify root cause."
474
+ }
475
+ ]
476
+ }]
477
+ });
478
+
479
+ // Result: { "Fix Strategy": "Fix implementation" }
480
+ ```
481
+
482
+ ### Outcome
483
+
484
+ Alfred:
485
+ - ✅ Keeps tests unchanged
486
+ - ✅ Fixes implementation to satisfy test expectations
487
+ - ✅ Avoids "test modification to make them pass" anti-pattern
488
+ - ✅ Follows RED → GREEN → REFACTOR TDD cycle correctly
489
+
490
+ ---
491
+
492
+ ## Example 9: SPEC Scope Clarification (spec-builder)
493
+
494
+ ### Scenario
495
+
496
+ **User**: "Create SPEC for performance improvements."
497
+
498
+ **Alfred detects** (spec-builder sub-agent):
499
+ - SPEC title is vague ("performance improvements")
500
+ - Scope undefined (backend? frontend? database?)
501
+ - Multiple domains affected
502
+
503
+ ### AskUserQuestion Invocation
504
+
505
+ ```typescript
506
+ const answer = await AskUserQuestion({
507
+ questions: [
508
+ {
509
+ question: "Which area needs performance improvements?",
510
+ header: "Domain",
511
+ multiSelect: false,
512
+ options: [
513
+ { label: "Backend API", description: "Optimize API response times, database queries." },
514
+ { label: "Frontend", description: "Improve page load times, bundle size, rendering." },
515
+ { label: "Database", description: "Add indexes, optimize queries, caching." },
516
+ { label: "All of the above", description: "Comprehensive performance audit." }
517
+ ]
518
+ },
519
+ {
520
+ question: "What's the performance target?",
521
+ header: "Target",
522
+ multiSelect: false,
523
+ options: [
524
+ { label: "< 200ms API", description: "API responses under 200ms (P95)." },
525
+ { label: "< 2s page load", description: "Pages load under 2 seconds (P95)." },
526
+ { label: "< 100ms queries", description: "Database queries under 100ms (P95)." }
527
+ ]
528
+ }
529
+ ]
530
+ });
531
+
532
+ // Result:
533
+ // {
534
+ // "Domain": "Backend API",
535
+ // "Target": "< 200ms API"
536
+ // }
537
+ ```
538
+
539
+ ### Outcome
540
+
541
+ spec-builder generates precise SPEC:
542
+ - ✅ Title: `[PERF-001] Optimize Backend API Response Times to <200ms`
543
+ - ✅ Scope: Backend API performance only
544
+ - ✅ Clear success criteria: P95 latency < 200ms
545
+ - ❌ Avoids vague SPEC like "Improve performance"
546
+
547
+ ---
548
+
549
+ ## Example 10: Doc Sync Mode Selection (doc-syncer)
550
+
551
+ ### Scenario
552
+
553
+ **User**: "Sync documentation."
554
+
555
+ **Alfred detects** (doc-syncer sub-agent):
556
+ - Sync mode unclear (auto-detect vs force-regenerate vs partial)
557
+ - User hasn't specified preference
558
+ - Different modes have different time/accuracy trade-offs
559
+
560
+ ### AskUserQuestion Invocation
561
+
562
+ ```typescript
563
+ const answer = await AskUserQuestion({
564
+ questions: [{
565
+ question: "Which documentation sync mode?",
566
+ header: "Sync Mode",
567
+ multiSelect: false,
568
+ options: [
569
+ {
570
+ label: "auto",
571
+ description: "Smart detection of changes. Fast, minimal updates. (Recommended)"
572
+ },
573
+ {
574
+ label: "force",
575
+ description: "Regenerate ALL documentation. Slow but guaranteed accurate."
576
+ },
577
+ {
578
+ label: "partial",
579
+ description: "Update only specified sections. Fast, targeted."
580
+ }
581
+ ]
582
+ }]
583
+ });
584
+
585
+ // Result: { "Sync Mode": "auto" }
586
+ ```
587
+
588
+ ### Outcome
589
+
590
+ doc-syncer:
591
+ - ✅ Uses auto-detection mode
592
+ - ✅ Only updates changed sections
593
+ - ✅ Faster execution (1-2 min vs 10 min for force mode)
594
+ - ✅ User sees clear time/accuracy trade-off before deciding
595
+
596
+ ---
597
+
598
+ ## Example 11: Report Generation Control with Token Warnings (v0.17.0)
599
+
600
+ ### Scenario
601
+
602
+ **Context**: User is running `/alfred:0-project` initialization.
603
+
604
+ **Alfred detects** (project-manager):
605
+ - Report generation is a configurable feature (new in v0.17.0)
606
+ - User needs to understand token cost implications
607
+ - Token budget is important for Claude Pro users
608
+ - Decision affects `/alfred:3-sync` behavior
609
+
610
+ ### AskUserQuestion Invocation
611
+
612
+ ```typescript
613
+ const answer = await AskUserQuestion({
614
+ questions: [{
615
+ question: `How would you like to handle automatic report generation?
616
+
617
+ ⚠️ TOKEN COST WARNING:
618
+ - Enable: ~50-60 tokens per report × 3-5 reports per command = 150-300 tokens/session
619
+ - Minimal: ~20-30 tokens per report × 1-2 reports per command = 20-60 tokens/session
620
+ - Disable: ~0 tokens (0 reports generated)
621
+
622
+ For Claude Pro $20/month users: Token usage directly impacts API costs (~$0.02 per 1K tokens).`,
623
+ header: "Report Generation",
624
+ multiSelect: false,
625
+ options: [
626
+ {
627
+ label: "Enable (Default)",
628
+ description: "Full analysis reports for every sync. Best for understanding project changes. (High token usage)"
629
+ },
630
+ {
631
+ label: "⚡ Minimal (Recommended)",
632
+ description: "Essential reports only (sync summary + TAG validation). Balances insight with token efficiency. (Low token usage)"
633
+ },
634
+ {
635
+ label: "🚫 Disable",
636
+ description: "No automatic reports. Maximum token savings but no analysis output. (Zero token usage)"
637
+ }
638
+ ]
639
+ }]
640
+ });
641
+
642
+ // Result: { "Report Generation": "⚡ Minimal (Recommended)" }
643
+ ```
644
+
645
+ ### Config Storage
646
+
647
+ After user selection, Alfred stores in `.moai/config.json`:
648
+
649
+ ```json
650
+ {
651
+ "report_generation": {
652
+ "enabled": true,
653
+ "auto_create": false,
654
+ "warn_user": true,
655
+ "user_choice": "Minimal",
656
+ "configured_at": "2025-11-04T19:37:30+09:00"
657
+ }
658
+ }
659
+ ```
660
+
661
+ ### Outcome
662
+
663
+ Alfred behavior in `/alfred:3-sync`:
664
+ - ✅ `enabled: true` → Report generation is active
665
+ - ✅ `auto_create: false` → Only essential reports (TAG validation, sync summary)
666
+ - ✅ `warn_user: true` → Display token warnings in future syncs
667
+ - ✅ User saves 80% tokens (300 tokens → 60 tokens per session)
668
+ - ❌ No full analysis reports (but critical info still provided)
669
+
670
+ ---
671
+
672
+ ## Example 12: Batching Design Pattern (v0.17.0)
673
+
674
+ ### Scenario
675
+
676
+ **Context**: Project initialization with multiple independent decisions.
677
+
678
+ **Problem**: Asking questions sequentially = 5 user interactions = high UX friction.
679
+
680
+ **Solution**: Batch 3 related questions in ONE interaction = 1 user turn = efficient UX.
681
+
682
+ ### AskUserQuestion Invocation (Batched)
683
+
684
+ ```typescript
685
+ const answers = await AskUserQuestion({
686
+ questions: [
687
+ {
688
+ question: "What's your working language for this project?",
689
+ header: "Language",
690
+ multiSelect: false,
691
+ options: [
692
+ { label: "English", description: "Documentation and discussions in English." },
693
+ { label: "한국어 (Korean)", description: "Documentation and discussions in Korean." },
694
+ { label: "日本語 (Japanese)", description: "Documentation and discussions in Japanese." }
695
+ ]
696
+ },
697
+ {
698
+ question: "Which project mode would you prefer?",
699
+ header: "Mode",
700
+ multiSelect: false,
701
+ options: [
702
+ {
703
+ label: "Personal (Solo)",
704
+ description: "Fast, flexible workflow. No branching or PR reviews needed."
705
+ },
706
+ {
707
+ label: "Team (GitFlow)",
708
+ description: "Professional workflow with feature branches and PR reviews."
709
+ }
710
+ ]
711
+ },
712
+ {
713
+ question: "How would you like to handle automatic report generation?",
714
+ header: "Report Generation",
715
+ multiSelect: false,
716
+ options: [
717
+ {
718
+ label: "Enable",
719
+ description: "Full analysis reports. (150-300 tokens/session)"
720
+ },
721
+ {
722
+ label: "⚡ Minimal",
723
+ description: "Essential reports only. (20-60 tokens/session)"
724
+ },
725
+ {
726
+ label: "🚫 Disable",
727
+ description: "No reports. (0 tokens/session)"
728
+ }
729
+ ]
730
+ }
731
+ ]
732
+ });
733
+
734
+ // Result (ONE interaction, all 3 questions answered):
735
+ // {
736
+ // "Language": "한국어 (Korean)",
737
+ // "Mode": "Team (GitFlow)",
738
+ // "Report Generation": "⚡ Minimal"
739
+ // }
740
+ ```
741
+
742
+ ### UX Comparison
743
+
744
+ **❌ Sequential (Old Pattern)**:
745
+ ```
746
+ User: "Initialize project"
747
+
748
+ Alfred: "What language?" → User selects → Question 1 complete
749
+
750
+ Alfred: "Which mode?" → User selects → Question 2 complete
751
+
752
+ Alfred: "Report generation?" → User selects → Question 3 complete
753
+
754
+ (3 separate interactions = slow UX)
755
+ ```
756
+
757
+ **✅ Batched (v0.17.0 Pattern)**:
758
+ ```
759
+ User: "Initialize project"
760
+
761
+ Alfred: [3 questions at once] → User selects all → All 3 complete
762
+
763
+ (1 interaction = fast UX, 66% fewer back-and-forth turns)
764
+ ```
765
+
766
+ ### Outcome
767
+
768
+ - ✅ User provides 3 answers in ONE interaction
769
+ - ✅ 66% reduction in back-and-forth turns
770
+ - ✅ Project configured with Language (Korean), Mode (Team), Reports (Minimal)
771
+ - ✅ Better user experience: clearer, faster, less frustrating
772
+
773
+ ---
774
+
775
+ ## Example 13: Conditional Report Generation in Team Mode
776
+
777
+ ### Scenario
778
+
779
+ **Context**: User chose Team mode + Minimal reports during initialization.
780
+
781
+ **User runs**: `/alfred:3-sync auto`
782
+
783
+ **Alfred needs to decide**: Should full sync reports be generated or just essential?
784
+
785
+ ### AskUserQuestion Invocation
786
+
787
+ ```typescript
788
+ // Read config to check user's report preference
789
+ const reportConfig = config.report_generation;
790
+
791
+ if (reportConfig.enabled && reportConfig.auto_create === false) {
792
+ // User chose "Minimal" - ask for this sync only
793
+ const syncReportChoice = await AskUserQuestion({
794
+ questions: [{
795
+ question: "Your default is 'Minimal' reports. For THIS sync, would you prefer more detail?",
796
+ header: "This Sync Only",
797
+ multiSelect: false,
798
+ options: [
799
+ {
800
+ label: "Stick with Minimal",
801
+ description: "Only sync summary + TAG validation. (20-30 tokens)"
802
+ },
803
+ {
804
+ label: "Full report this time",
805
+ description: "Include architecture analysis, TAG traceability matrix, impact analysis. (50-60 tokens)"
806
+ }
807
+ ]
808
+ }]
809
+ });
810
+ }
811
+ // Result: { "This Sync Only": "Stick with Minimal" }
812
+ ```
813
+
814
+ ### Outcome
815
+
816
+ - ✅ Respects user's default setting (Minimal)
817
+ - ✅ Allows per-sync override without changing config
818
+ - ✅ User gets targeted token usage: 25 tokens instead of 300
819
+ - ✅ User can still request full reports when needed (e.g., major refactoring)
820
+
821
+ ---
822
+
823
+ ## Summary: Pattern Catalog
824
+
825
+ | Pattern | Use Case | Example Scenario |
826
+ |---------|----------|------------------|
827
+ | **Pattern 1: Implementation Approach** | Multiple valid implementation paths | "Add i18n support" (which library?) |
828
+ | **Pattern 2: Confirmation** | Risky/destructive operations | "Delete production data" (are you sure?) |
829
+ | **Pattern 3: Multi-Option Selection** | Choose ONE from multiple frameworks/tools | "Which testing framework?" |
830
+ | **Pattern 4: Multi-Select** | Enable/disable independent features | "Which features to enable?" (check multiple) |
831
+ | **Pattern 5: Sequential Questions** | Q2 depends on Q1 answer | "Enable auth?" → If yes, "Which provider?" |
832
+ | **Pattern 6: Option Grouping** | Too many options → hierarchical selection | Database type → Specific database |
833
+ | **Pattern 7: Batch Questions** | Multiple independent decisions | Project setup (DB + Testing + TypeScript) |
834
+ | **Pattern 8: Error Recovery** | Handle failures with user guidance | Test failure → Fix implementation vs update tests |
835
+ | **Pattern 9: SPEC Clarification** | Vague SPEC scope/title | "Performance improvements" → Which domain? |
836
+ | **Pattern 10: Mode Selection** | Choose workflow mode/strategy | Doc sync mode (auto vs force vs partial) |
837
+ | **Pattern 11: Token-Aware Configuration** | Feature with cost implications | Report generation (Enable/Minimal/Disable) with token warnings |
838
+ | **Pattern 12: Batching for Efficiency** | Combine related questions | Language + Mode + Reports (3 questions, 1 interaction) |
839
+ | **Pattern 13: Conditional Per-Session Override** | Respect defaults while allowing override | "Your default is Minimal. Full report this time?" |
840
+
841
+ ---
842
+
843
+ ## Best Practices Summary
844
+
845
+ ### ✅ DO Use AskUserQuestion When:
846
+ - User intent is ambiguous (vague, multiple interpretations)
847
+ - Multiple valid approaches exist (technology choices, architecture)
848
+ - Important configuration decisions with trade-offs
849
+ - Risky operations requiring explicit consent
850
+ - Feature flags with cost/performance implications (v0.17.0+)
851
+
852
+ ### ✅ DO Batch Questions When:
853
+ - Questions are **independent** (no dependencies)
854
+ - Questions are **related** (same decision domain)
855
+ - Reduces interaction turns (3 questions in 1 turn = 66% faster UX)
856
+ - All answers needed before proceeding
857
+
858
+ ### ✅ DO Include Token Warnings When:
859
+ - Feature has cost implications (report generation, analysis depth)
860
+ - Users on Claude Pro care about token budget
861
+ - Decision impacts future session costs
862
+ - Show concrete numbers: "150-300 tokens/session" vs "20-60 tokens/session"
863
+
864
+ ### ❌ DON'T Use Sequential When:
865
+ - Questions are independent (use batching instead)
866
+ - No dependencies between Q1 and Q2 (ask together)
867
+ - Results in friction: 3 questions = 3 separate interactions
868
+
869
+ ---
870
+
871
+ **End of Examples** | 2025-11-04