moai-adk 0.15.0__py3-none-any.whl → 0.25.4__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 (417) hide show
  1. moai_adk/__init__.py +1 -2
  2. moai_adk/__main__.py +85 -2
  3. moai_adk/cli/__init__.py +0 -1
  4. moai_adk/cli/commands/__init__.py +0 -1
  5. moai_adk/cli/commands/analyze.py +127 -0
  6. moai_adk/cli/commands/backup.py +5 -3
  7. moai_adk/cli/commands/doctor.py +35 -11
  8. moai_adk/cli/commands/improve_user_experience.py +348 -0
  9. moai_adk/cli/commands/init.py +150 -23
  10. moai_adk/cli/commands/language.py +269 -0
  11. moai_adk/cli/commands/migrate.py +158 -0
  12. moai_adk/cli/commands/status.py +13 -12
  13. moai_adk/cli/commands/update.py +364 -60
  14. moai_adk/cli/commands/validate_links.py +118 -0
  15. moai_adk/cli/main.py +3 -2
  16. moai_adk/cli/prompts/init_prompts.py +79 -82
  17. moai_adk/core/__init__.py +0 -1
  18. moai_adk/core/analysis/__init__.py +9 -0
  19. moai_adk/core/analysis/session_analyzer.py +439 -0
  20. moai_adk/core/claude_integration.py +421 -0
  21. moai_adk/core/command_helpers.py +270 -0
  22. moai_adk/core/config/__init__.py +6 -0
  23. moai_adk/core/config/auto_spec_config.py +346 -0
  24. moai_adk/core/config/migration.py +133 -12
  25. moai_adk/core/context_manager.py +279 -0
  26. moai_adk/core/diagnostics/slash_commands.py +0 -1
  27. moai_adk/core/error_recovery_system.py +1289 -0
  28. moai_adk/core/git/__init__.py +0 -1
  29. moai_adk/core/git/branch.py +0 -1
  30. moai_adk/core/git/branch_manager.py +4 -4
  31. moai_adk/core/git/checkpoint.py +1 -5
  32. moai_adk/core/git/commit.py +0 -1
  33. moai_adk/core/git/event_detector.py +3 -5
  34. moai_adk/core/git/manager.py +0 -1
  35. moai_adk/core/hooks/post_tool_auto_spec_completion.py +925 -0
  36. moai_adk/core/integration/__init__.py +22 -0
  37. moai_adk/core/integration/engine.py +169 -0
  38. moai_adk/core/integration/integration_tester.py +225 -0
  39. moai_adk/core/integration/models.py +88 -0
  40. moai_adk/core/integration/utils.py +211 -0
  41. moai_adk/core/issue_creator.py +28 -18
  42. moai_adk/core/language_config.py +202 -0
  43. moai_adk/core/language_validator.py +556 -0
  44. moai_adk/core/mcp/setup.py +113 -0
  45. moai_adk/core/migration/__init__.py +18 -0
  46. moai_adk/core/migration/backup_manager.py +208 -0
  47. moai_adk/core/migration/file_migrator.py +218 -0
  48. moai_adk/core/migration/version_detector.py +143 -0
  49. moai_adk/core/migration/version_migrator.py +228 -0
  50. moai_adk/core/performance/__init__.py +6 -0
  51. moai_adk/core/performance/cache_system.py +318 -0
  52. moai_adk/core/performance/parallel_processor.py +116 -0
  53. moai_adk/core/project/__init__.py +0 -1
  54. moai_adk/core/project/backup_utils.py +2 -7
  55. moai_adk/core/project/checker.py +3 -3
  56. moai_adk/core/project/detector.py +20 -40
  57. moai_adk/core/project/initializer.py +42 -17
  58. moai_adk/core/project/phase_executor.py +415 -58
  59. moai_adk/core/project/validator.py +6 -25
  60. moai_adk/core/quality/__init__.py +1 -1
  61. moai_adk/core/quality/trust_checker.py +64 -110
  62. moai_adk/core/quality/validators/__init__.py +1 -1
  63. moai_adk/core/quality/validators/base_validator.py +1 -1
  64. moai_adk/core/rollback_manager.py +993 -0
  65. moai_adk/core/session_manager.py +667 -0
  66. moai_adk/core/spec/confidence_scoring.py +749 -0
  67. moai_adk/core/spec/ears_template_engine.py +1182 -0
  68. moai_adk/core/spec/quality_validator.py +721 -0
  69. moai_adk/core/spec_status_manager.py +488 -0
  70. moai_adk/core/template/__init__.py +0 -1
  71. moai_adk/core/template/backup.py +41 -1
  72. moai_adk/core/template/config.py +11 -12
  73. moai_adk/core/template/languages.py +0 -1
  74. moai_adk/core/template/merger.py +79 -22
  75. moai_adk/core/template/processor.py +614 -40
  76. moai_adk/core/template_engine.py +36 -27
  77. moai_adk/foundation/git/commit_templates.py +565 -0
  78. moai_adk/foundation/trust/trust_principles.py +725 -0
  79. moai_adk/foundation/trust/validation_checklist.py +1678 -0
  80. moai_adk/statusline/__init__.py +38 -0
  81. moai_adk/statusline/alfred_detector.py +107 -0
  82. moai_adk/statusline/config.py +364 -0
  83. moai_adk/statusline/enhanced_output_style_detector.py +364 -0
  84. moai_adk/statusline/git_collector.py +190 -0
  85. moai_adk/statusline/main.py +228 -0
  86. moai_adk/statusline/metrics_tracker.py +78 -0
  87. moai_adk/statusline/renderer.py +327 -0
  88. moai_adk/statusline/update_checker.py +135 -0
  89. moai_adk/statusline/version_reader.py +647 -0
  90. moai_adk/templates/.git-hooks/pre-commit +66 -0
  91. moai_adk/templates/.git-hooks/pre-push +116 -4
  92. moai_adk/templates/.github/workflows/moai-gitflow.yml +1 -7
  93. moai_adk/templates/.github/workflows/spec-issue-sync.yml +0 -1
  94. moai_adk/templates/.gitignore +44 -0
  95. moai_adk/templates/.mcp.json +22 -0
  96. moai_adk/templates/CLAUDE.md +450 -1071
  97. moai_adk/utils/__init__.py +0 -1
  98. moai_adk/utils/banner.py +0 -1
  99. moai_adk/utils/common.py +308 -0
  100. moai_adk/utils/link_validator.py +249 -0
  101. moai_adk/utils/logger.py +4 -9
  102. moai_adk/utils/safe_file_reader.py +210 -0
  103. moai_adk/utils/user_experience.py +531 -0
  104. moai_adk-0.25.4.dist-info/METADATA +2279 -0
  105. moai_adk-0.25.4.dist-info/RECORD +112 -0
  106. moai_adk/core/tags/__init__.py +0 -86
  107. moai_adk/core/tags/ci_validator.py +0 -463
  108. moai_adk/core/tags/cli.py +0 -283
  109. moai_adk/core/tags/generator.py +0 -109
  110. moai_adk/core/tags/inserter.py +0 -99
  111. moai_adk/core/tags/mapper.py +0 -126
  112. moai_adk/core/tags/parser.py +0 -76
  113. moai_adk/core/tags/pre_commit_validator.py +0 -393
  114. moai_adk/core/tags/reporter.py +0 -956
  115. moai_adk/core/tags/tags.py +0 -149
  116. moai_adk/core/tags/validator.py +0 -897
  117. moai_adk/templates/.claude/agents/alfred/backend-expert.md +0 -319
  118. moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -316
  119. moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -208
  120. moai_adk/templates/.claude/agents/alfred/devops-expert.md +0 -464
  121. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -214
  122. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +0 -357
  123. moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -406
  124. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -423
  125. moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -312
  126. moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -343
  127. moai_adk/templates/.claude/agents/alfred/skill-factory.md +0 -865
  128. moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -392
  129. moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -361
  130. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -428
  131. moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -375
  132. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +0 -571
  133. moai_adk/templates/.claude/commands/alfred/0-project.md +0 -1525
  134. moai_adk/templates/.claude/commands/alfred/1-plan.md +0 -802
  135. moai_adk/templates/.claude/commands/alfred/2-run.md +0 -709
  136. moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -1009
  137. moai_adk/templates/.claude/commands/alfred/9-feedback.md +0 -149
  138. moai_adk/templates/.claude/hooks/alfred/core/project.py +0 -748
  139. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +0 -136
  140. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +0 -108
  141. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +0 -198
  142. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +0 -29
  143. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +0 -94
  144. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +0 -100
  145. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +0 -94
  146. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +0 -94
  147. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +0 -170
  148. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +0 -271
  149. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +0 -67
  150. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +0 -749
  151. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +0 -230
  152. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +0 -198
  153. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +0 -21
  154. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +0 -154
  155. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +0 -174
  156. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +0 -87
  157. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +0 -61
  158. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +0 -112
  159. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +0 -1
  160. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +0 -161
  161. moai_adk/templates/.claude/settings.json +0 -144
  162. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +0 -70
  163. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +0 -62
  164. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +0 -242
  165. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +0 -56
  166. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +0 -28
  167. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +0 -444
  168. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +0 -62
  169. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +0 -28
  170. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +0 -405
  171. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +0 -51
  172. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +0 -355
  173. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +0 -239
  174. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -113
  175. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +0 -29
  176. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +0 -28
  177. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +0 -323
  178. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +0 -286
  179. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +0 -126
  180. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -122
  181. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +0 -29
  182. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +0 -29
  183. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +0 -74
  184. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +0 -4
  185. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +0 -269
  186. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +0 -237
  187. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +0 -615
  188. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +0 -653
  189. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +0 -19
  190. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +0 -4
  191. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +0 -150
  192. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +0 -113
  193. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +0 -29
  194. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +0 -28
  195. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +0 -198
  196. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +0 -431
  197. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +0 -141
  198. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +0 -89
  199. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +0 -122
  200. moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +0 -369
  201. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +0 -508
  202. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +0 -481
  203. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +0 -100
  204. moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +0 -273
  205. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +0 -77
  206. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +0 -265
  207. moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +0 -539
  208. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +0 -19
  209. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +0 -4
  210. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +0 -84
  211. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +0 -137
  212. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +0 -219
  213. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +0 -161
  214. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +0 -541
  215. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +0 -622
  216. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +0 -115
  217. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +0 -4
  218. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +0 -348
  219. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -113
  220. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +0 -29
  221. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +0 -28
  222. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -113
  223. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +0 -29
  224. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +0 -28
  225. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +0 -19
  226. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +0 -4
  227. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +0 -211
  228. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -113
  229. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +0 -29
  230. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +0 -28
  231. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +0 -288
  232. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +0 -269
  233. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +0 -32
  234. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +0 -298
  235. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +0 -26
  236. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +0 -307
  237. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +0 -21
  238. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +0 -252
  239. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +0 -19
  240. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +0 -19
  241. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +0 -24
  242. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +0 -199
  243. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +0 -39
  244. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +0 -316
  245. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +0 -18
  246. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +0 -263
  247. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +0 -30
  248. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +0 -19
  249. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +0 -4
  250. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/reference.md +0 -218
  251. moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +0 -482
  252. moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +0 -278
  253. moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +0 -524
  254. moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +0 -477
  255. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +0 -429
  256. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +0 -391
  257. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +0 -431
  258. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +0 -577
  259. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +0 -271
  260. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +0 -466
  261. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +0 -583
  262. moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +0 -526
  263. moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +0 -465
  264. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +0 -328
  265. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +0 -312
  266. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +0 -245
  267. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +0 -285
  268. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +0 -278
  269. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +0 -303
  270. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +0 -291
  271. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +0 -15
  272. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +0 -802
  273. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +0 -1238
  274. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +0 -673
  275. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +0 -290
  276. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +0 -1633
  277. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +0 -660
  278. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +0 -123
  279. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +0 -29
  280. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +0 -30
  281. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +0 -123
  282. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +0 -29
  283. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +0 -30
  284. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +0 -123
  285. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +0 -29
  286. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +0 -30
  287. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +0 -124
  288. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +0 -29
  289. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +0 -31
  290. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +0 -128
  291. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +0 -29
  292. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +0 -31
  293. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +0 -123
  294. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +0 -29
  295. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +0 -30
  296. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +0 -123
  297. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +0 -29
  298. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +0 -30
  299. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +0 -123
  300. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +0 -29
  301. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +0 -30
  302. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +0 -123
  303. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +0 -29
  304. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +0 -30
  305. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +0 -303
  306. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +0 -1064
  307. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +0 -1047
  308. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +0 -113
  309. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +0 -29
  310. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +0 -28
  311. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +0 -113
  312. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +0 -29
  313. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +0 -28
  314. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +0 -113
  315. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +0 -29
  316. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +0 -28
  317. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +0 -116
  318. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +0 -29
  319. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +0 -28
  320. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +0 -122
  321. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +0 -29
  322. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +0 -29
  323. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +0 -113
  324. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +0 -29
  325. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +0 -28
  326. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +0 -113
  327. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +0 -29
  328. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +0 -28
  329. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +0 -113
  330. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +0 -29
  331. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +0 -28
  332. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +0 -307
  333. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  334. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +0 -1099
  335. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +0 -124
  336. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +0 -29
  337. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +0 -31
  338. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +0 -124
  339. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +0 -29
  340. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +0 -31
  341. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +0 -123
  342. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +0 -29
  343. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +0 -30
  344. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +0 -123
  345. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +0 -29
  346. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +0 -30
  347. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +0 -127
  348. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +0 -29
  349. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +0 -31
  350. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +0 -126
  351. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +0 -29
  352. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +0 -31
  353. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +0 -125
  354. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +0 -29
  355. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +0 -32
  356. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +0 -124
  357. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +0 -29
  358. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +0 -31
  359. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +0 -126
  360. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +0 -29
  361. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +0 -30
  362. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +0 -433
  363. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +0 -624
  364. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +0 -316
  365. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +0 -123
  366. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +0 -29
  367. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +0 -30
  368. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +0 -124
  369. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +0 -29
  370. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +0 -31
  371. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +0 -127
  372. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +0 -29
  373. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +0 -31
  374. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +0 -125
  375. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +0 -29
  376. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +0 -30
  377. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +0 -123
  378. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +0 -29
  379. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +0 -30
  380. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +0 -124
  381. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +0 -29
  382. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +0 -31
  383. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +0 -123
  384. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +0 -29
  385. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +0 -30
  386. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +0 -133
  387. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +0 -29
  388. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +0 -34
  389. moai_adk/templates/.claude/skills/moai-project-documentation.md +0 -622
  390. moai_adk/templates/.github/workflows/c-tag-validation.yml +0 -11
  391. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +0 -11
  392. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +0 -11
  393. moai_adk/templates/.github/workflows/dart-tag-validation.yml +0 -11
  394. moai_adk/templates/.github/workflows/go-tag-validation.yml +0 -130
  395. moai_adk/templates/.github/workflows/java-tag-validation.yml +0 -11
  396. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +0 -135
  397. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +0 -11
  398. moai_adk/templates/.github/workflows/php-tag-validation.yml +0 -11
  399. moai_adk/templates/.github/workflows/python-tag-validation.yml +0 -118
  400. moai_adk/templates/.github/workflows/release.yml +0 -118
  401. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +0 -11
  402. moai_adk/templates/.github/workflows/rust-tag-validation.yml +0 -11
  403. moai_adk/templates/.github/workflows/shell-tag-validation.yml +0 -11
  404. moai_adk/templates/.github/workflows/swift-tag-validation.yml +0 -11
  405. moai_adk/templates/.github/workflows/tag-report.yml +0 -269
  406. moai_adk/templates/.github/workflows/tag-validation.yml +0 -186
  407. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +0 -154
  408. moai_adk/templates/.moai/config.json +0 -115
  409. moai_adk/templates/workflows/go-tag-validation.yml +0 -30
  410. moai_adk/templates/workflows/javascript-tag-validation.yml +0 -41
  411. moai_adk/templates/workflows/python-tag-validation.yml +0 -42
  412. moai_adk/templates/workflows/typescript-tag-validation.yml +0 -31
  413. moai_adk-0.15.0.dist-info/METADATA +0 -3079
  414. moai_adk-0.15.0.dist-info/RECORD +0 -365
  415. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/WHEEL +0 -0
  416. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/entry_points.txt +0 -0
  417. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/licenses/LICENSE +0 -0
@@ -1,3079 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: moai-adk
3
- Version: 0.15.0
4
- Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent & Complete Skills v2.0
5
- Project-URL: Homepage, https://github.com/modu-ai/moai-adk
6
- Project-URL: Repository, https://github.com/modu-ai/moai-adk
7
- Project-URL: Issues, https://github.com/modu-ai/moai-adk/issues
8
- Project-URL: Changelog, https://github.com/modu-ai/moai-adk/releases
9
- Author-email: MoAI Team <support@moduai.kr>
10
- License: MIT
11
- License-File: LICENSE
12
- Keywords: agentic,ai,alfred,claude,development,spec-first,tdd,toolkit
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: MIT License
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Programming Language :: Python :: 3.13
20
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Classifier: Topic :: Software Development :: Quality Assurance
22
- Classifier: Topic :: Software Development :: Testing
23
- Requires-Python: >=3.11
24
- Requires-Dist: click>=8.1.0
25
- Requires-Dist: gitpython>=3.1.45
26
- Requires-Dist: jinja2>=3.0.0
27
- Requires-Dist: packaging>=21.0
28
- Requires-Dist: pyfiglet>=1.0.2
29
- Requires-Dist: pyyaml>=6.0
30
- Requires-Dist: questionary>=2.0.0
31
- Requires-Dist: requests>=2.28.0
32
- Requires-Dist: rich>=13.0.0
33
- Provides-Extra: dev
34
- Requires-Dist: mypy>=1.7.0; extra == 'dev'
35
- Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
36
- Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
37
- Requires-Dist: pytest>=8.4.2; extra == 'dev'
38
- Requires-Dist: ruff>=0.1.0; extra == 'dev'
39
- Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
40
- Provides-Extra: security
41
- Requires-Dist: bandit>=1.8.0; extra == 'security'
42
- Requires-Dist: pip-audit>=2.7.0; extra == 'security'
43
- Description-Content-Type: text/markdown
44
-
45
- # MoAI-ADK (Agentic Development Kit)
46
-
47
- [한국어](README.ko.md) | [English](README.md)
48
-
49
- [![PyPI version](https://img.shields.io/pypi/v/moai-adk)](https://pypi.org/project/moai-adk/)
50
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
- [![Python](https://img.shields.io/badge/Python-3.13+-blue)](https://www.python.org/)
52
- [![Tests](https://github.com/modu-ai/moai-adk/actions/workflows/moai-gitflow.yml/badge.svg)](https://github.com/modu-ai/moai-adk/actions/workflows/moai-gitflow.yml)
53
- [![codecov](https://codecov.io/gh/modu-ai/moai-adk/branch/develop/graph/badge.svg)](https://codecov.io/gh/modu-ai/moai-adk)
54
- [![Coverage](https://img.shields.io/badge/coverage-87.84%25-brightgreen)](https://github.com/modu-ai/moai-adk)
55
-
56
- > **MoAI-ADK delivers a seamless development workflow that naturally connects SPEC → TEST (TDD) → CODE → DOCUMENTATION with AI.**
57
-
58
- ---
59
-
60
- ## 1. MoAI-ADK at a Glance
61
-
62
- MoAI-ADK transforms AI-powered development with three core principles. Use the navigation below to jump to the section that matches your needs.
63
-
64
- If you're **new to MoAI-ADK**, start with "What is MoAI-ADK?".
65
- If you want to **get started quickly**, jump straight to "5-Minute Quick Start".
66
- If you've **already installed it and want to understand the concepts**, we recommend "5 Key Concepts".
67
-
68
- | Question | Jump To |
69
- | ---------------------------------- | ------------------------------------------------------------------------ |
70
- | First time here—what is it? | [What is MoAI-ADK?](#what-is-moai-adk) |
71
- | How do I get started? | [5-Minute Quick Start](#5-minute-quick-start) |
72
- | What's the basic flow? | [Core Workflow (0 → 3)](#core-workflow-0--3) |
73
- | What do Plan/Run/Sync commands do? | [Command Cheat Sheet](#command-cheat-sheet) |
74
- | What are SPEC, TDD, TAG? | [5 Key Concepts](#5-key-concepts) |
75
- | Tell me about agents/Skills | [Sub-agents & Skills Overview](#sub-agents--skills-overview) |
76
- | Want to dive deeper? | [Additional Resources](#additional-resources) |
77
-
78
- ---
79
-
80
- ## What is MoAI-ADK?
81
-
82
- ### The Problem: Trust Crisis in AI Development
83
-
84
- Today, countless developers want help from Claude or ChatGPT, but can't shake one fundamental doubt: **"Can I really trust the code this AI generates?"**
85
-
86
- The reality looks like this. Ask an AI to "build a login feature" and you'll get syntactically perfect code. But these problems keep repeating:
87
-
88
- - **Unclear Requirements**: The basic question "What exactly should we build?" remains unanswered. Email/password login? OAuth? 2FA? Everything relies on guessing.
89
- - **Missing Tests**: Most AIs only test the "happy path". Wrong password? Network error? Three months later, bugs explode in production.
90
- - **Documentation Drift**: Code gets modified but docs stay the same. The question "Why is this code here?" keeps repeating.
91
- - **Context Loss**: Even within the same project, you have to explain everything from scratch each time. Project structure, decision rationale, previous attempts—nothing gets recorded.
92
- - **Impact Tracking Impossible**: When requirements change, you can't track which code is affected.
93
-
94
- ### The Solution: SPEC-First TDD with Alfred SuperAgent
95
-
96
- **MoAI-ADK** (MoAI Agentic Development Kit) is an open-source framework designed to **systematically solve** these problems.
97
-
98
- The core principle is simple yet powerful:
99
-
100
- > **"No tests without code, no SPEC without tests"**
101
-
102
- More precisely, it's the reverse order:
103
-
104
- > **"SPEC comes first. No tests without SPEC. No complete documentation without tests and code."**
105
-
106
- When you follow this order, magical things happen:
107
-
108
- **1️⃣ Clear Requirements**
109
- Write SPECs first with the `/alfred:1-plan` command. A vague request like "login feature" transforms into **clear requirements** like "WHEN valid credentials are provided, the system SHALL issue a JWT token". Alfred's spec-builder uses EARS syntax to create professional SPECs in just 3 minutes.
110
-
111
- **2️⃣ Test Guarantee**
112
- `/alfred:2-run` automatically performs Test-Driven Development (TDD). It proceeds in RED (failing test) → GREEN (minimal implementation) → REFACTOR (cleanup) order, **guaranteeing 85%+ test coverage**. No more "testing later". Tests drive code creation.
113
-
114
- **3️⃣ Automatic Documentation Sync**
115
- A single `/alfred:3-sync` command **synchronizes** all code, tests, and documentation. README, CHANGELOG, API docs, and Living Documents all update automatically. Six months later, code and docs still match.
116
-
117
- **4️⃣ Tracking with @TAG System**
118
- Every piece of code, test, and documentation gets a `@TAG:ID`. When requirements change later, one command—`rg "@SPEC:EX-AUTH-001"`—**finds all related tests, implementations, and docs**. You gain confidence during refactoring.
119
-
120
- **5️⃣ Alfred Remembers Context**
121
- A team of AI agents collaborate to **remember** your project's structure, decision rationale, and work history. No need to repeat the same questions.
122
-
123
- ### MoAI-ADK's 3 Core Promises
124
-
125
- For beginners to remember easily, MoAI-ADK's value simplifies to three things:
126
-
127
- **First, SPEC comes before code**
128
- Start by clearly defining what to build. Writing SPEC helps discover problems before implementation. Communication costs with teammates drop dramatically.
129
-
130
- **Second, tests drive code (TDD)**
131
- Write tests before implementation (RED). Implement minimally to pass tests (GREEN). Then clean up the code (REFACTOR). Result: fewer bugs, confidence in refactoring, code anyone can understand.
132
-
133
- **Third, documentation and code always match**
134
- One `/alfred:3-sync` command auto-updates all documentation. README, CHANGELOG, API docs, and Living Documents always sync with code. No more despair when modifying six-month-old code.
135
-
136
- ---
137
-
138
- ## Why Do You Need It?
139
-
140
- ### Real Challenges in AI Development
141
-
142
- Modern AI-powered development faces various challenges. MoAI-ADK **systematically solves** all these problems:
143
-
144
- | Concern | Traditional Approach Problem | MoAI-ADK Solution |
145
- | ------------------------------- | -------------------------------------------------- | ------------------------------------------------------------- |
146
- | "Can't trust AI code" | Implementation without tests, unclear verification | Enforces SPEC → TEST → CODE order, guarantees 85%+ coverage |
147
- | "Repeating same explanations" | Context loss, unrecorded project history | Alfred remembers everything, 19 AI team members collaborate |
148
- | "Hard to write prompts" | Don't know how to write good prompts | `/alfred` commands provide standardized prompts automatically |
149
- | "Documentation always outdated" | Forget to update docs after code changes | `/alfred:3-sync` auto-syncs with one command |
150
- | "Don't know what changed where" | Hard to search code, unclear intent | @TAG chain connects SPEC → TEST → CODE → DOC |
151
- | "Team onboarding takes forever" | New members can't grasp code context | Reading SPEC makes intent immediately clear |
152
-
153
- ### Benefits You Can Experience Right Now
154
-
155
- From the moment you adopt MoAI-ADK, you'll feel:
156
-
157
- - **Faster Development**: Clear SPEC reduces round-trip explanation time
158
- - **Fewer Bugs**: SPEC-based tests catch issues early
159
- - **Better Code Understanding**: @TAG and SPEC make intent immediately clear
160
- - **Lower Maintenance Costs**: Code and docs always match
161
- - **Efficient Team Collaboration**: Clear communication through SPEC and TAG
162
-
163
- ---
164
-
165
- ## 🖥️ Platform Support
166
-
167
- ### Supported Platforms
168
- - ✅ **macOS** (11.0+)
169
- - ✅ **Linux** (Ubuntu 20.04+, Debian 11+, etc.)
170
- - ✅ **Windows** (10/11) - Full support as of v0.11.0
171
- - Note: Hooks system requires Python 3.11+
172
- - All hook features work seamlessly on Windows with cross-platform timeout handling
173
-
174
- ### System Requirements
175
- - **Python**: 3.11 or higher
176
- - **Git**: 2.30+
177
- - **GitHub CLI** (`gh`): Optional, required for PR automation in team mode
178
-
179
- ---
180
-
181
- ## ⚡ 3-Minute Lightning Start
182
-
183
- Get your first MoAI-ADK project running in **3 simple steps**. Beginners can finish in under 5 minutes.
184
-
185
- ### Step 1: Install uv (about 1 minute)
186
-
187
- #### Command
188
-
189
- **Choose your platform**:
190
-
191
- ```bash
192
- # macOS/Linux
193
- curl -LsSf https://astral.sh/uv/install.sh | sh
194
-
195
- # Windows (PowerShell) - RECOMMENDED FOR WINDOWS USERS
196
- powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
197
-
198
- # Windows (Git Bash) - Alternative
199
- curl -LsSf https://astral.sh/uv/install.sh | bash
200
-
201
- # WSL (Windows Subsystem for Linux)
202
- curl -LsSf https://astral.sh/uv/install.sh | sh
203
-
204
- # Verify installation
205
- uv --version
206
- ```
207
-
208
- **Platform Selection Guide**:
209
-
210
- | Platform | Method | Notes |
211
- |----------|--------|-------|
212
- | **macOS** | bash | Native UNIX-based, use standard installation |
213
- | **Linux** | bash | Native Linux support |
214
- | **Windows (Native)** | ⭐ PowerShell | **RECOMMENDED** - Most stable, native Windows support |
215
- | **Windows (Git Bash)** | bash | Alternative if PowerShell unavailable |
216
- | **WSL** | bash | Use Linux installation within WSL2 |
217
-
218
- **Important Notes on Windows**:
219
- - 🟢 **PowerShell (Native)**: Most reliable and stable method. No WSL or Git Bash needed.
220
- - 🟡 **Git Bash / WSL**: Works, but may encounter path issues. Try PowerShell first.
221
- - ❌ **Do NOT use WSL if**: You're testing on Windows—PowerShell native is easier and faster.
222
-
223
- **Why PowerShell for Windows?**
224
- - Fewer environment setup issues
225
- - Better Windows integration
226
- - Faster execution
227
- - No WSL overhead
228
-
229
- #### Expected Output
230
- ```
231
- ✓ uv 0.5.1 is already installed
232
- $ uv --version
233
- uv 0.5.1
234
- ```
235
-
236
- #### Next: Install MoAI-ADK
237
-
238
- ```bash
239
- uv tool install moai-adk
240
-
241
- # Result: ✅ Installed moai-adk v0.14.0
242
- ```
243
-
244
- **Verification**:
245
- ```bash
246
- moai-adk --version
247
- # Output: MoAI-ADK v0.14.0
248
- ```
249
-
250
- ---
251
-
252
- ### Step 2: Create Your First Project (about 1 minute)
253
-
254
- #### Command
255
-
256
- ```bash
257
- moai-adk init hello-world
258
- cd hello-world
259
- ```
260
-
261
- #### What Gets Created
262
-
263
- ```
264
- hello-world/
265
- ├── .moai/ ✅ Alfred configuration
266
- ├── .claude/ ✅ Claude Code automation
267
- ├── CLAUDE.md ✅ Project guide
268
- └── README.md ✅ Project documentation
269
- ```
270
-
271
- #### Verification: Check Core Files
272
-
273
- ```bash
274
- # Verify core config file exists
275
- ls -la .moai/config.json # ✅ Should exist
276
- ls -la .claude/commands/ # ✅ Should have commands
277
-
278
- # Or all at once
279
- moai-adk doctor
280
- ```
281
-
282
- **Expected Output**:
283
- ```
284
- ✅ Python 3.13.0
285
- ✅ uv 0.5.1
286
- ✅ .moai/ directory initialized
287
- ✅ .claude/ directory ready
288
- ✅ 16 agents configured
289
- ✅ 74 skills loaded
290
- ```
291
-
292
- ---
293
-
294
- ### Step 3: Start Alfred (about 1 minute)
295
-
296
- #### Run Claude Code
297
-
298
- ```bash
299
- claude
300
- ```
301
-
302
- #### Enter in Claude Code
303
-
304
- ```
305
- /alfred:0-project
306
- ```
307
-
308
- #### Alfred Will Ask
309
-
310
- ```
311
- Q1: Project name?
312
- A: hello-world
313
-
314
- Q2: Project goal?
315
- A: Learning MoAI-ADK
316
-
317
- Q3: Main development language?
318
- A: python
319
-
320
- Q4: Mode?
321
- A: personal (for local development)
322
- ```
323
-
324
- #### Result: Project Ready! ✅
325
-
326
- ```
327
- ✅ Project initialized
328
- ✅ Config saved to .moai/config.json
329
- ✅ Documents created in .moai/project/
330
- ✅ Alfred recommends skills
331
-
332
- Next: Run /alfred:1-plan "your feature description"
333
- ```
334
-
335
- ---
336
-
337
- ## Next: Complete Your First Feature in 10 Minutes
338
-
339
- You're now ready to build your first complete feature with SPEC, TDD, and auto-generated docs!
340
-
341
- > **→ Continue to: ["First 10-Minute Hands-On: Hello World API"](#-first-10-minute-hands-on-hello-world-api)**
342
-
343
- In this section you'll experience:
344
- - ✅ Define an API using SPEC
345
- - ✅ Complete TDD cycle (RED → GREEN → REFACTOR)
346
- - ✅ Auto-generate documentation
347
- - ✅ Understand @TAG system
348
-
349
- ---
350
-
351
- ## Language Support
352
-
353
- MoAI-ADK automatically detects and supports **15 programming languages** with dedicated CI/CD workflows:
354
-
355
- ### Core Languages (v0.11.0+)
356
- - **Python** (pytest, mypy, ruff, 85% coverage target)
357
- - **JavaScript** (npm/yarn/pnpm/bun auto-detect, 80% coverage target)
358
- - **TypeScript** (tsc type checking, biome/eslint, 85% coverage target)
359
- - **Go** (golangci-lint, gofmt, 75% coverage target)
360
-
361
- ### Extended Languages (v0.11.1+)
362
- - **Ruby** (RSpec, Rubocop, bundle)
363
- - **PHP** (PHPUnit, PHPCS, composer)
364
- - **Java** (JUnit 5, Jacoco, Maven/Gradle auto-detection)
365
- - **Rust** (cargo test, clippy, rustfmt)
366
- - **Dart** (flutter test, dart analyze)
367
- - **Swift** (XCTest, SwiftLint, SPM)
368
- - **Kotlin** (JUnit 5, ktlint, Gradle)
369
- - **C#** (xUnit, StyleCop, dotnet CLI)
370
- - **C** (gcc/clang, cppcheck, CMake)
371
- - **C++** (g++/clang++, Google Test, cpplint)
372
- - **Shell** (shellcheck, bats-core)
373
-
374
- ### How Language Detection Works
375
-
376
- When you run `/alfred:2-run SPEC-XXX`, MoAI-ADK automatically:
377
- 1. Scans your project for configuration files (package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, build.gradle, etc.)
378
- 2. Detects your project's primary language using priority-based detection (Rust → Dart → Swift → ... → Shell)
379
- 3. Auto-detects build tools (Maven/Gradle for Java, CMake for C/C++, SPM for Swift, etc.)
380
- 4. Selects the appropriate CI/CD workflow template
381
- 5. Generates language-specific testing and linting configuration
382
-
383
- ### Supported Languages
384
-
385
- For detailed language detection priority and build tool detection, see [Language Detection Guide](.moai/docs/language-detection-guide.md)
386
-
387
- ### Customization
388
-
389
- For advanced workflow customization, see [Workflow Templates Guide](.moai/docs/workflow-templates.md)
390
-
391
- ---
392
-
393
- ## Language Localization Architecture (v0.7.0+)
394
-
395
- ### Hybrid Language Model
396
-
397
- MoAI-ADK v0.7.0 introduced a **two-layer language architecture** that enables global teams to work in their preferred language while keeping the infrastructure in English for consistency and maintainability.
398
-
399
- ### Layer 1: User Conversation & Dynamic Content
400
-
401
- **All user-facing content uses your configured `conversation_language`** (set during `/alfred:0-project`):
402
-
403
- - ✅ **Responses & Explanations**: Your language (Korean, Japanese, Spanish, English, Chinese, etc.)
404
- - ✅ **Generated Documents**: SPEC, test files, implementation guides in your language
405
- - ✅ **Code Comments**: Function docstrings and inline comments in your language
406
- - ✅ **Git Commit Messages**: All commits in your language
407
- - ✅ **Sub-agent Communication**: All task prompts in your language
408
-
409
- ### Layer 2: Static Infrastructure (English Only)
410
-
411
- **System infrastructure stays in English** for global consistency:
412
-
413
- - 🔒 `.claude/agents/` — Agent templates (English)
414
- - 🔒 `.claude/commands/` — Command templates (English)
415
- - 🔒 `.claude/skills/` — Skill content (English, industry standard)
416
- - 🔒 `.moai/memory/` — Internal guidelines (English)
417
- - 🔒 @TAG identifiers — Technical markers (English)
418
- - 🔒 Package code in `src/moai_adk/` — Source code comments (English for global distribution)
419
-
420
- ### Configuration Example
421
-
422
- ```json
423
- {
424
- "language": {
425
- "conversation_language": "ko",
426
- "conversation_language_name": "Korean"
427
- }
428
- }
429
- ```
430
-
431
- When configured, Alfred will:
432
- - Respond in Korean (모든 대화)
433
- - Generate SPECs in Korean
434
- - Write code comments in Korean
435
- - Create Git commits in Korean
436
- - All while using English-only Skill() invocations internally
437
-
438
- ### Supported Languages
439
-
440
- - 🇬🇧 English
441
- - 🇰🇷 Korean (한국어)
442
- - 🇯🇵 Japanese (日本語)
443
- - 🇨🇳 Chinese (中文)
444
- - 🇪🇸 Spanish (Español)
445
-
446
- ### Implementation Status (v0.7.0+)
447
-
448
- | Component | Status | Details |
449
- |-----------|--------|---------|
450
- | **Config System** | ✅ Complete | Nested language structure in `.moai/config.json` |
451
- | **Sub-agent Instructions** | ✅ Complete | All 16 agents support language parameter |
452
- | **Code Generation** | ✅ Complete | Comments/docs in user language |
453
- | **Git Integration** | ✅ Complete | Commit messages in user language |
454
- | **Dynamic Content** | ✅ Complete | All reports/explanations in user language |
455
-
456
- ### Why This Matters
457
-
458
- 1. **Global Accessibility**: Support teams in any language without translating infrastructure
459
- 2. **Developer Experience**: Write code comments in your native language
460
- 3. **Maintainability**: Infrastructure stays in English (single source of truth)
461
- 4. **Scalability**: Add new languages instantly without code changes
462
-
463
- ### How to Change Language
464
-
465
- **During Project Initialization**:
466
- ```bash
467
- /alfred:0-project
468
- # Select your language when prompted
469
- ```
470
-
471
- **After Project Creation**:
472
- Edit `.moai/config.json`:
473
- ```json
474
- {
475
- "language": {
476
- "conversation_language": "ja",
477
- "conversation_language_name": "Japanese"
478
- }
479
- }
480
- ```
481
-
482
- Then restart Claude Code for changes to take effect.
483
-
484
- ---
485
-
486
- ## Earlier Detailed Guide (Optional Reading)
487
-
488
- Need more explanations? See detailed guides below.
489
-
490
- ### Detailed Installation Guide
491
-
492
- **After installing uv, verify PATH is set**:
493
- ```bash
494
- # If uv command not found, set PATH manually (macOS/Linux)
495
- export PATH="$HOME/.cargo/bin:$PATH"
496
-
497
- # Verify again
498
- uv --version
499
- ```
500
-
501
- **Available moai-adk commands**:
502
- ```bash
503
- moai-adk init # Initialize new project
504
- moai-adk doctor # System diagnostics
505
- moai-adk update # Update to latest version
506
- ```
507
-
508
- ### Detailed Project Creation
509
-
510
- **Create a new project**:
511
- ```bash
512
- moai-adk init my-project
513
- cd my-project
514
- ```
515
-
516
- **Add to existing project**:
517
- ```bash
518
- cd your-existing-project
519
- moai-adk init .
520
- ```
521
-
522
- Complete directory structure created:
523
- ```
524
- my-project/
525
- ├── .moai/ # MoAI-ADK project configuration
526
- │ ├── config.json # Project settings (language, mode, owner)
527
- │ ├── project/ # Project information
528
- │ │ ├── product.md # Product vision and goals
529
- │ │ ├── structure.md # Directory structure
530
- │ │ └── tech.md # Tech stack and architecture
531
- │ ├── memory/ # Alfred's knowledge base (8 files)
532
- │ │ ├── CLAUDE-AGENTS-GUIDE.md # Sub-agent collaboration guide
533
- │ │ ├── CLAUDE-RULES.md # Decision rules and standards
534
- │ │ ├── CLAUDE-PRACTICES.md # Workflow patterns and examples
535
- │ │ ├── CONFIG-SCHEMA.md # .moai/config.json schema
536
- │ │ ├── DEVELOPMENT-GUIDE.md # SPEC-First TDD workflow guide
537
- │ │ ├── GITFLOW-PROTECTION-POLICY.md # Git branch protection
538
- │ │ ├── SKILLS-DESCRIPTION-POLICY.md # Skills management policy
539
- │ │ └── SPEC-METADATA.md # SPEC YAML frontmatter standard
540
- │ ├── specs/ # SPEC files
541
- │ │ └── SPEC-XXX-001/ # Each SPEC in its own folder
542
- │ │ └── spec.md # EARS-format specification
543
- │ └── reports/ # Analysis reports
544
- ├── .claude/ # Claude Code automation
545
- │ ├── agents/ # 12 Sub-agents
546
- │ │ └── alfred/
547
- │ │ ├── project-manager.md # Project initialization
548
- │ │ ├── spec-builder.md # SPEC authoring (EARS)
549
- │ │ ├── implementation-planner.md # Architecture & TAG design
550
- │ │ ├── tdd-implementer.md # RED-GREEN-REFACTOR loop
551
- │ │ ├── doc-syncer.md # Documentation sync
552
- │ │ ├── quality-gate.md # TRUST 5 verification
553
- │ │ ├── tag-agent.md # TAG chain validation
554
- │ │ ├── trust-checker.md # Code quality checks
555
- │ │ ├── debug-helper.md # Error analysis & fixes
556
- │ │ ├── git-manager.md # GitFlow & PR management
557
- │ │ ├── cc-manager.md # Claude Code optimization
558
- │ │ └── skill-factory.md # Skills creation & updates
559
- │ ├── commands/ # 4 Alfred commands
560
- │ │ └── alfred/
561
- │ │ ├── 0-project.md # Project initialization
562
- │ │ ├── 1-plan.md # SPEC authoring
563
- │ │ ├── 2-run.md # TDD implementation
564
- │ │ └── 3-sync.md # Documentation sync
565
- │ ├── skills/ # 55+ Claude Skills
566
- │ │ ├── moai-foundation-* # 6 Foundation tier
567
- │ │ ├── moai-essentials-* # 4 Essentials tier
568
- │ │ ├── moai-alfred-* # 7 Alfred tier
569
- │ │ ├── moai-domain-* # 10 Domain tier
570
- │ │ ├── moai-lang-* # 18 Language tier
571
- │ │ ├── moai-cc-* # 8 Claude Code tier
572
- │ │ ├── moai-skill-factory # 1 Skill Factory
573
- │ │ └── moai-spec-authoring # 1 SPEC authoring
574
- │ ├── hooks/ # Event-driven automation
575
- │ │ └── alfred/
576
- │ │ └── alfred_hooks.py # 5 hooks (Session, PreTool, etc.)
577
- │ └── settings.json # Claude Code settings
578
- ├── src/ # Implementation code
579
- ├── tests/ # Test code
580
- ├── docs/ # Auto-generated documentation
581
- ├── CLAUDE.md # Alfred's core directives
582
- └── README.md
583
- ```
584
-
585
- ---
586
-
587
- ## Core Concept: 3-Step Repeating Cycle
588
-
589
- After initial setup, every feature follows this cycle:
590
-
591
- | Step | Command | What It Does | Output |
592
- |------|---------|-------------|--------|
593
- | 🚀 **INIT** | `/alfred:0-project` | Collect project description, create config/docs, recommend Skills | `.moai/config.json`, `.moai/project/*`, initial report |
594
- | 📋 **PLAN** | `/alfred:1-plan "feature description"` | Analyze requirements, draft SPEC, create Plan Board | `.moai/specs/SPEC-*/spec.md`, plan/acceptance docs, feature branch |
595
- | 💻 **RUN** | `/alfred:2-run SPEC-ID` | Execute TDD, run tests/implementation/refactor, verify quality | `tests/`, `src/` implementation, quality report, TAG links |
596
- | 📚 **SYNC** | `/alfred:3-sync` | Auto-sync docs/README/CHANGELOG, organize TAG/PR status | `docs/`, `.moai/reports/sync-report.md`, Ready PR |
597
- | 💬 **FEEDBACK** | `/alfred:9-feedback` | Interactive GitHub Issue creation (type → title → description → priority) | GitHub Issue + auto labels + priority + URL |
598
-
599
- > ✅ All commands follow the **Phase 0(optional) → Phase 1 → Phase 2 → Phase 3** cycle. Alfred automatically reports status and suggests next steps.
600
- >
601
- > 💡 **New in v0.7.0+**: Use `/alfred:9-feedback` to create GitHub Issues on-the-fly during development. Keep your team in sync without interrupting your workflow.
602
-
603
- ---
604
-
605
- ## Original Detailed Guide (Complete 7-Step Analysis)
606
-
607
- For comprehensive explanation, see the previous version in [GitHub History](https://github.com/modu-ai/moai-adk/blob/main/README.md).
608
-
609
- ---
610
-
611
- ---
612
-
613
- ## 🚀 First 10-Minute Hands-On: Hello World API
614
-
615
- **Goal**: Experience the complete MoAI-ADK workflow in 10 minutes
616
- **Learn**: SPEC writing, TDD implementation, documentation automation, @TAG system
617
-
618
- > Already completed the 3-minute quick start? Start here!
619
-
620
- ### Prerequisites
621
- - ✅ MoAI-ADK installed
622
- - ✅ Project created (`moai-adk init hello-world`)
623
- - ✅ Claude Code running
624
-
625
- ---
626
-
627
- ### Step 1: Write SPEC (2 minutes)
628
-
629
- #### Command
630
- ```bash
631
- /alfred:1-plan "GET /hello endpoint - receive query parameter 'name' and return greeting"
632
- ```
633
-
634
- #### Alfred Automatically Creates
635
- ```
636
- ✅ SPEC ID: HELLO-001
637
- ✅ File: .moai/specs/SPEC-HELLO-001/spec.md
638
- ✅ Branch: feature/SPEC-HELLO-001
639
- ```
640
-
641
- #### Check Generated SPEC
642
- ```bash
643
- cat .moai/specs/SPEC-HELLO-001/spec.md
644
- ```
645
-
646
- **Example Content**:
647
- ```yaml
648
- ---
649
- id: HELLO-001
650
- version: 0.0.1
651
- status: draft
652
- priority: high
653
- ---
654
-
655
- # `@SPEC:EX-HELLO-001: Hello World API
656
-
657
- ## Ubiquitous Requirements
658
- - System SHALL provide HTTP GET /hello endpoint
659
-
660
- ## Event-driven Requirements
661
- - WHEN query parameter 'name' is provided, THEN return "Hello, {name}!"
662
- - WHEN name is absent, THEN return "Hello, World!"
663
-
664
- ## Constraints
665
- - name limited to 50 characters max
666
- - Response format: JSON
667
- ```
668
-
669
- ✅ **Verify**: `ls .moai/specs/SPEC-HELLO-001/`
670
-
671
- ---
672
-
673
- ### Step 2: TDD Implementation (5 minutes)
674
-
675
- #### Command
676
- ```bash
677
- /alfred:2-run HELLO-001
678
- ```
679
-
680
- #### 🔴 RED Phase: Write Failing Test
681
-
682
- **File Created**: `tests/test_hello.py`
683
-
684
- ```python
685
- # `@TEST:EX-HELLO-001 | SPEC: SPEC-HELLO-001.md
686
-
687
- import pytest
688
- from fastapi.testclient import TestClient
689
- from src.hello.api import app
690
-
691
- client = TestClient(app)
692
-
693
- def test_hello_with_name_should_return_personalized_greeting():
694
- """WHEN name provided, THEN return personalized greeting"""
695
- response = client.get("/hello?name=Alice")
696
- assert response.status_code == 200
697
- assert response.json() == {"message": "Hello, Alice!"}
698
-
699
- def test_hello_without_name_should_return_default_greeting():
700
- """WHEN name absent, THEN return default greeting"""
701
- response = client.get("/hello")
702
- assert response.status_code == 200
703
- assert response.json() == {"message": "Hello, World!"}
704
- ```
705
-
706
- **Run**:
707
- ```bash
708
- pytest tests/test_hello.py -v
709
- ```
710
-
711
- **Result**: ❌ FAILED (app doesn't exist yet - expected!)
712
-
713
- **Commit**:
714
- ```bash
715
- git add tests/test_hello.py
716
- git commit -m "🔴 test(HELLO-001): add failing hello API tests"
717
- ```
718
-
719
- ---
720
-
721
- #### 🟢 GREEN Phase: Minimal Implementation
722
-
723
- **File Created**: `src/hello/api.py`
724
-
725
- ```python
726
- # `@CODE:EX-HELLO-001:API | SPEC: SPEC-HELLO-001.md | TEST: tests/test_hello.py
727
-
728
- from fastapi import FastAPI
729
-
730
- app = FastAPI()
731
-
732
- @app.get("/hello")
733
- def hello(name: str = "World"):
734
- """@CODE:EX-HELLO-001:API - Hello endpoint"""
735
- return {"message": f"Hello, {name}!"}
736
- ```
737
-
738
- **Run**:
739
- ```bash
740
- pytest tests/test_hello.py -v
741
- ```
742
-
743
- **Result**: ✅ PASSED (all tests pass!)
744
-
745
- **Commit**:
746
- ```bash
747
- git add src/hello/api.py
748
- git commit -m "🟢 feat(HELLO-001): implement hello API"
749
- ```
750
-
751
- ---
752
-
753
- #### ♻️ REFACTOR Phase: Add Validation
754
-
755
- **Enhanced Code**:
756
-
757
- ```python
758
- from fastapi import FastAPI, HTTPException
759
-
760
- app = FastAPI()
761
-
762
- @app.get("/hello")
763
- def hello(name: str = "World"):
764
- """@CODE:EX-HELLO-001:API - Hello endpoint with validation"""
765
- if len(name) > 50:
766
- raise HTTPException(status_code=400, detail="Name too long (max 50 chars)")
767
- return {"message": f"Hello, {name}!"}
768
- ```
769
-
770
- **Add Test**:
771
- ```python
772
- def test_hello_with_long_name_should_return_400():
773
- """WHEN name exceeds 50 chars, THEN return 400 error"""
774
- long_name = "a" * 51
775
- response = client.get(f"/hello?name={long_name}")
776
- assert response.status_code == 400
777
- ```
778
-
779
- **Run**:
780
- ```bash
781
- pytest tests/test_hello.py -v
782
- ```
783
-
784
- **Result**: ✅ PASSED (all tests pass!)
785
-
786
- **Commit**:
787
- ```bash
788
- git add tests/test_hello.py src/hello/api.py
789
- git commit -m "♻️ refactor(HELLO-001): add name length validation"
790
- ```
791
-
792
- ---
793
-
794
- ### Step 3: Documentation Sync (2 minutes)
795
-
796
- #### Command
797
- ```bash
798
- /alfred:3-sync
799
- ```
800
-
801
- #### Alfred Automatically
802
- ```
803
- ✅ docs/api/hello.md - API documentation generated
804
- ✅ README.md - Usage examples added
805
- ✅ CHANGELOG.md - Release notes added
806
- ✅ TAG chain validated - All @TAG verified
807
- ```
808
-
809
- #### Check Generated API Documentation
810
- ```bash
811
- cat docs/api/hello.md
812
- ```
813
-
814
- **Example Content**:
815
- ```markdown
816
- # Hello API Documentation
817
-
818
- ## GET /hello
819
-
820
- ### Description
821
- Returns a personalized greeting based on provided name.
822
-
823
- ### Parameters
824
- - `name` (query, optional): Person's name (default: "World", max 50 chars)
825
-
826
- ### Responses
827
- - **200**: Success
828
- ```json
829
- { "message": "Hello, Alice!" }
830
- ```
831
- - **400**: Name too long
832
-
833
- ### Examples
834
- ```bash
835
- curl "http://localhost:8000/hello?name=Alice"
836
- # → {"message": "Hello, Alice!"}
837
-
838
- curl "http://localhost:8000/hello"
839
- # → {"message": "Hello, World!"}
840
- ```
841
-
842
- ### Traceability
843
- - `@SPEC:EX-HELLO-001` - Requirements
844
- - `@TEST:EX-HELLO-001` - Tests
845
- - `@CODE:EX-HELLO-001:API` - Implementation
846
- ```
847
-
848
- ---
849
-
850
- ### Step 4: Verify TAG Chain (1 minute)
851
-
852
- #### Command
853
- ```bash
854
- rg '@(SPEC|TEST|CODE|DOC):HELLO-001' -n
855
- ```
856
-
857
- #### Output (Complete Traceability)
858
- ```
859
- .moai/specs/SPEC-HELLO-001/spec.md:7:# `@SPEC:EX-HELLO-001: Hello World API
860
- tests/test_hello.py:3:# `@TEST:EX-HELLO-001 | SPEC: SPEC-HELLO-001.md
861
- src/hello/api.py:3:# `@CODE:EX-HELLO-001:API | SPEC: SPEC-HELLO-001.md
862
- docs/api/hello.md:24:- `@SPEC:EX-HELLO-001`
863
- ```
864
-
865
- ✅ **Complete chain**: SPEC → TEST → CODE → DOC (fully traceable!)
866
-
867
- ---
868
-
869
- ### Summary: What You've Accomplished
870
-
871
- In just 10 minutes:
872
-
873
- ✅ **SPEC** - Clear requirements documented
874
- ✅ **TDD** - Red → Green → Refactor cycle
875
- ✅ **Implementation** - Simple, testable code with @CODE TAG
876
- ✅ **Documentation** - Auto-generated from code
877
- ✅ **Traceability** - Complete @TAG chain: SPEC → TEST → CODE → DOC
878
- ✅ **Git History** - Clean, semantic commits (🔴 🟢 ♻️)
879
-
880
- ---
881
-
882
- ## Understanding CLAUDE.md (Alfred's Configuration Documents)
883
-
884
- MoAI-ADK's AI coordination is powered by **Alfred**, the MoAI SuperAgent. Alfred's behavior and decision-making are guided by a set of **internal configuration documents** in the `.claude/` directory.
885
-
886
- ### 4-Document Structure
887
-
888
- When you run MoAI-ADK, Alfred loads configuration from **4 coordinated documents** (stored in your `.claude/` directory):
889
-
890
- | Document | Size | Purpose | When Alfred Reads It |
891
- | -------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
892
- | **CLAUDE.md** | ~7kb | Alfred's identity, core directives, project metadata | At session start (bootstrap) |
893
- | **CLAUDE-AGENTS-GUIDE.md** | ~14kb | Sub-agent roster (19 members), Skills distribution (55 packs), team structure | When selecting which agent to invoke |
894
- | **CLAUDE-RULES.md** | ~17kb | Decision-making rules (Skill invocation, Interactive Questions, TAG validation), commit templates, TRUST 5 gates | During each decision point (e.g., when to ask user questions) |
895
- | **CLAUDE-PRACTICES.md** | ~8kb | Practical workflows, context engineering (JIT retrieval), on-demand agent patterns, real examples | During implementation phase |
896
-
897
- ### Why This Structure Matters
898
-
899
- **For Developers**: These documents define how Alfred interprets your requirements and orchestrates development. Understanding them helps you:
900
-
901
- - Write clearer specifications that Alfred understands better
902
- - Know which agent/Skill will be invoked for your request
903
- - Understand decision points where Alfred might ask you questions
904
-
905
- **For AI**: Progressive disclosure means:
906
-
907
- - **Session Start**: Load only CLAUDE.md (7kb) — minimal overhead
908
- - **On-Demand**: Load CLAUDE-AGENTS-GUIDE.md, CLAUDE-RULES.md, CLAUDE-PRACTICES.md only when needed
909
- - **Result**: Faster session boot, cleaner context, clear decision logic
910
-
911
- ### Example: What Happens When You Run `/alfred:2-run`
912
-
913
- 1. **CLAUDE.md** is already loaded → Alfred knows its role and project context
914
- 2. Alfred checks **CLAUDE-RULES.md** → "Should I ask user questions? Which Skill applies here?"
915
- 3. If implementing code: Alfred loads **CLAUDE-AGENTS-GUIDE.md** → "Which agent executes TDD?"
916
- 4. During implementation: Alfred loads **CLAUDE-PRACTICES.md** → "How do I structure the RED → GREEN → REFACTOR workflow?"
917
-
918
- ### Customizing Alfred's Behavior
919
-
920
- **Most developers never modify these files.** MoAI-ADK ships with optimized defaults.
921
-
922
- **If you need to customize Alfred's behavior** (rare), edit these documents in your project's `.claude/` directory:
923
-
924
- - Add new decision rules in **CLAUDE-RULES.md**
925
- - Adjust agent selection logic in **CLAUDE-AGENTS-GUIDE.md**
926
- - Document team-specific workflows in **CLAUDE-PRACTICES.md**
927
-
928
- > ⚠️ **Important**: These are internal configuration files for Alfred, not user guides. Keep them concise and decision-focused. Most teams don't modify them.
929
-
930
- ### Language Policy in CLAUDE.md (v0.7.0+)
931
-
932
- **Key Language Rules**:
933
-
934
- 1. **User Conversation**: Your configured language (Korean, Japanese, Spanish, etc.)
935
- - All responses, explanations, and guidance use your `conversation_language`
936
- - Alfred reads this from `.moai/config.json`
937
-
938
- 2. **Code & Git History**: Your configured language
939
- - Code comments: Your language
940
- - Commit messages: Your language
941
- - Documentation: Your language
942
-
943
- 3. **Infrastructure Only**: English
944
- - `.claude/agents/`, `.claude/commands/`, `.claude/skills/` stay in English
945
- - `@TAG` identifiers and technical terms use English
946
- - `.moai/memory/` files remain in English
947
-
948
- **Example**:
949
- ```
950
- Your CLAUDE.md talks to you in Korean (한국어)
951
- Your code comments are in Korean (한국어)
952
- Your git commits are in Korean (한국어)
953
- Your SPEC documents are in Korean (한국어)
954
-
955
- But Alfred's internal commands use English:
956
- ✅ Skill("moai-foundation-trust")
957
- ✅ @CODE:EX-AUTH-001 (TAG format)
958
- ✅ .claude/skills/ (infrastructure)
959
- ```
960
-
961
- **See Also**: [Language Localization Architecture](#language-localization-architecture-v070) for complete details on the hybrid language model.
962
-
963
- ---
964
-
965
- ## Alfred's Memory Files (.moai/memory/)
966
-
967
- Alfred's knowledge base consists of **14 memory files** stored in `.moai/memory/`. These files define standards, rules, and guidelines that Alfred and Sub-agents reference during development.
968
-
969
- ### Core Knowledge Base (14 Files)
970
-
971
- **Core Guides (3 files)**:
972
-
973
- | File | Size | Purpose | Who Uses It |
974
- | ------------------------ | ----- | ---------------------------------------- | ---------------------- |
975
- | `CLAUDE-AGENTS-GUIDE.md` | ~15KB | Sub-agent selection & collaboration | Alfred, Developers |
976
- | `CLAUDE-PRACTICES.md` | ~12KB | Real-world workflow examples & patterns | Alfred, All Sub-agents |
977
- | `CLAUDE-RULES.md` | ~19KB | Skill/TAG/Git rules & decision standards | Alfred, All Sub-agents |
978
-
979
- **Standards (4 files)**:
980
-
981
- | File | Size | Purpose | Who Uses It |
982
- | ------------------------------ | ----- | ------------------------------------- | -------------------------- |
983
- | `CONFIG-SCHEMA.md` | ~12KB | `.moai/config.json` schema definition | project-manager |
984
- | `DEVELOPMENT-GUIDE.md` | ~14KB | SPEC-First TDD workflow guide | All Sub-agents, Developers |
985
- | `GITFLOW-PROTECTION-POLICY.md` | ~6KB | Git branch protection policy | git-manager |
986
- | `SPEC-METADATA.md` | ~9KB | SPEC YAML frontmatter standard (SSOT) | spec-builder, doc-syncer |
987
-
988
- **Implementation Analysis (7 files)**: Internal reports and policy documents for Skills management, workflow improvements, and team integration analysis.
989
-
990
- ### When Are Memory Files Loaded?
991
-
992
- **Session Start (Always)**:
993
-
994
- - `CLAUDE.md`
995
- - `CLAUDE-AGENTS-GUIDE.md`
996
- - `CLAUDE-RULES.md`
997
-
998
- **Just-In-Time (Command Execution)**:
999
-
1000
- - `/alfred:1-plan` → `SPEC-METADATA.md`, `DEVELOPMENT-GUIDE.md`
1001
- - `/alfred:2-run` → `DEVELOPMENT-GUIDE.md`
1002
- - `/alfred:3-sync` → `DEVELOPMENT-GUIDE.md`
1003
-
1004
- **Conditional (On-Demand)**:
1005
-
1006
- - Config changes → `CONFIG-SCHEMA.md`
1007
- - Git operations → `GITFLOW-PROTECTION-POLICY.md`
1008
- - Skill creation → `SKILLS-DESCRIPTION-POLICY.md`
1009
-
1010
- ### Why Memory Files Matter
1011
-
1012
- 1. **Single Source of Truth (SSOT)**: Each standard is defined exactly once, eliminating conflicts
1013
- 2. **Context Efficiency**: JIT loading reduces initial session overhead (only 3 files at start)
1014
- 3. **Consistent Decisions**: All Sub-agents follow the same rules from `CLAUDE-RULES.md`
1015
- 4. **Traceability**: SPEC metadata, @TAG rules, and Git standards all documented
1016
-
1017
- ### Usage Frequency
1018
-
1019
- | Priority | Files | Usage Pattern |
1020
- | --------- | -------------------------------------------------- | ------------------- |
1021
- | Very High | `CLAUDE-RULES.md` | Every decision |
1022
- | High | `DEVELOPMENT-GUIDE.md`, `SPEC-METADATA.md` | All commands |
1023
- | Medium | `CLAUDE-AGENTS-GUIDE.md`, `CLAUDE-PRACTICES.md` | Agent coordination |
1024
- | Low | `CONFIG-SCHEMA.md`, `GITFLOW-PROTECTION-POLICY.md` | Specific operations |
1025
-
1026
- > 📚 **Complete Analysis**: See `.moai/memory/MEMORY-FILES-USAGE.md` for comprehensive documentation on who uses each file, when they're loaded, where they're referenced, and why they're needed.
1027
-
1028
- ---
1029
-
1030
- ## Keeping MoAI-ADK Up-to-Date
1031
-
1032
- ### Check Version
1033
-
1034
- ```bash
1035
- # Check currently installed version
1036
- moai-adk --version
1037
-
1038
- # Check latest version on PyPI
1039
- uv tool list # Check current version of moai-adk
1040
- ```
1041
-
1042
- ### Upgrading
1043
-
1044
- #### Method 1: MoAI-ADK Built-in Update Command (Recommended - 3-Stage Workflow, v0.6.3+)
1045
- <!-- @DOC:UPDATE-REFACTOR-002-003 -->
1046
-
1047
- MoAI-ADK's `update` command provides **automatic tool detection** and **intelligent 3-stage workflow** with **70-80% performance improvement** for templates already synchronized:
1048
-
1049
- **Basic 3-Stage Workflow** (automatic tool detection):
1050
- ```bash
1051
- # Stage 1: Package version check
1052
- # Shows version comparison, upgrades if needed
1053
- moai-adk update
1054
-
1055
- # Stage 2: Config version comparison (NEW in v0.6.3)
1056
- # Compares package template version with project config
1057
- # If already synchronized, exits early (70-80% faster!)
1058
-
1059
- # Stage 3: Template sync (only if needed)
1060
- # Creates backup → Syncs templates → Updates config
1061
- # Message: "✓ Templates synced!" or "Templates are up to date!"
1062
- ```
1063
-
1064
- **Check for updates without applying them**:
1065
- ```bash
1066
- # Preview available updates (shows package & config versions)
1067
- moai-adk update --check
1068
- ```
1069
-
1070
- **Templates-only mode** (skip package upgrade, useful for manual upgrades):
1071
- ```bash
1072
- # If you manually upgraded the package, sync templates only
1073
- # Still performs Stage 2 config comparison for accuracy
1074
- moai-adk update --templates-only
1075
- ```
1076
-
1077
- **CI/CD mode** (auto-confirm all prompts):
1078
- ```bash
1079
- # Auto-confirms all prompts - useful in automated pipelines
1080
- # Runs all 3 stages automatically
1081
- moai-adk update --yes
1082
- ```
1083
-
1084
- **Force mode** (skip backup creation):
1085
- ```bash
1086
- # Update without creating backup (use with caution)
1087
- # Still performs config version comparison
1088
- moai-adk update --force
1089
- ```
1090
-
1091
- **How the 3-Stage Workflow Works** (v0.6.3):
1092
-
1093
- | Stage | Condition | Action | Performance |
1094
- |-------|-----------|--------|-------------|
1095
- | **Stage 1** | Package: current < latest | Detects installer → Upgrades package | ~20-30s |
1096
- | **Stage 2** | Config: compare versions | Reads template_version from config.json | ~1s ⚡ **NEW!** |
1097
- | **Stage 3** | Config: package > project | Creates backup → Syncs templates (if needed) | ~10-15s |
1098
-
1099
- **Performance Improvement** (v0.6.3):
1100
- - **Same version case**: 12-18s → 3-4s (**70-80% faster!** ⚡)
1101
- - Stage 1: ~1s (version check)
1102
- - Stage 2: ~1s (config comparison)
1103
- - Stage 3: **skipped** (already synchronized)
1104
-
1105
- - **CI/CD repeated runs**: **-30% cost reduction**
1106
- - First run: Full sync
1107
- - Subsequent runs: Only version checks (~3-4s)
1108
-
1109
- **Why 3 stages?**
1110
- Python processes cannot upgrade themselves while running. The 3-stage workflow is necessary for safety AND performance:
1111
- 1. **Stage 1**: Package upgrade detection (compares with PyPI)
1112
- 2. **Stage 2**: Template sync necessity detection (compares config versions) - NEW v0.6.3
1113
- 3. **Stage 3**: Templates and configuration sync (only if necessary)
1114
-
1115
- **Key Improvement in v0.6.3**:
1116
- Previously, all updates would sync templates even if nothing changed. Now, config version comparison (Stage 2) detects when templates are already current, **skipping Stage 3 entirely** (saves 10-15 seconds!)
1117
-
1118
- **Config Version Tracking**:
1119
- ```json
1120
- {
1121
- "project": {
1122
- "template_version": "0.6.3" // Tracks last synchronized template version
1123
- }
1124
- }
1125
- ```
1126
- This field allows MoAI-ADK to accurately determine if templates need synchronization without re-syncing everything.
1127
-
1128
- #### Method 2: Upgrade with uv tool command
1129
-
1130
- **Upgrade specific tool (recommended)**
1131
-
1132
- ```bash
1133
- # Upgrade only moai-adk to latest version
1134
- uv tool upgrade moai-adk
1135
- ```
1136
-
1137
- **Upgrade all installed tools**
1138
-
1139
- ```bash
1140
- # Upgrade all uv tool installations to latest versions
1141
- uv tool update
1142
- ```
1143
-
1144
- **Install specific version**
1145
-
1146
- ```bash
1147
- # Reinstall specific version (e.g., 0.4.2)
1148
- uv tool install moai-adk
1149
- ```
1150
-
1151
- ### Verify After Update
1152
-
1153
- ```bash
1154
- # 1. Check installed version
1155
- moai-adk --version
1156
-
1157
- # 2. Verify project works correctly
1158
- moai-adk doctor
1159
-
1160
- # 3. Check updated features in Alfred
1161
- cd your-project
1162
- claude
1163
- /alfred:0-project # Verify new features like language selection
1164
- ```
1165
-
1166
- > 💡 **New 2-Stage Update Workflow**:
1167
- >
1168
- > - **Stage 1**: `moai-adk update` detects installer (uv tool, pipx, or pip) and upgrades package
1169
- > - **Stage 2**: `moai-adk update` again to sync templates, config, and agent/Skills
1170
- > - **Smart detection**: Auto-detects whether package upgrade is needed based on version comparison
1171
- > - **CI/CD ready**: Use `moai-adk update --yes` for fully automated updates in pipelines
1172
- > - **Manual upgrade path**: Use `moai-adk update --templates-only` after manually upgrading the package
1173
- > - **Rollback safe**: Automatic backups in `.moai-backups/` before template sync
1174
-
1175
- ### Optimize Project Templates with `/alfred:0-project update` (v0.9.0+)
1176
-
1177
- After upgrading MoAI-ADK with `moai-adk update`, your project templates and configurations may need optimization to stay in sync with the latest package version. Use the **dedicated Alfred command** to automatically merge template updates while preserving your customizations.
1178
-
1179
- #### When to Run `/alfred:0-project update`
1180
-
1181
- **Automatic Trigger**: After running `moai-adk update`, your project's `optimized` flag is set based on template changes:
1182
-
1183
- ```bash
1184
- # 1. Upgrade MoAI-ADK package
1185
- moai-adk update
1186
- # Output: ✓ Package upgraded to v0.9.0!
1187
- # ℹ️ Next: Run `/alfred:0-project update` in Claude Code to optimize templates
1188
-
1189
- # 2. Open Claude Code
1190
- claude
1191
-
1192
- # 3. Run optimization command
1193
- /alfred:0-project update
1194
- ```
1195
-
1196
- #### What `/alfred:0-project update` Does
1197
-
1198
- **Phase 1: Smart Backup & Analysis**
1199
- - ✅ Creates automatic backup in `.moai-backups/` (preserves all customizations)
1200
- - ✅ Compares backup version with new template version
1201
- - ✅ Generates comparison report showing changed sections
1202
- - ✅ Presents user-friendly analysis with merge recommendations
1203
-
1204
- **Phase 2: Smart Merge (User Approval)**
1205
- After reviewing the analysis, you can choose:
1206
- - **"Proceed"** → Execute smart merge (merge backup + latest template)
1207
- - **"Preview"** → View detailed change summary before proceeding
1208
- - **"Skip"** → Keep current files unchanged (safe to proceed later)
1209
-
1210
- **Phase 3: Preserve Customizations**
1211
- - ✅ Maintains latest template structure (sections, headers, @TAG format)
1212
- - ✅ Inserts only your customizations (actual content you wrote)
1213
- - ✅ Preserves HISTORY sections cumulatively
1214
- - ✅ Updates version numbers automatically
1215
-
1216
- #### Complete Example
1217
-
1218
- ```bash
1219
- # Terminal: Upgrade MoAI-ADK
1220
- $ moai-adk update
1221
- ✓ Package upgraded to v0.9.0!
1222
-
1223
- # Claude Code
1224
- /alfred:0-project update
1225
-
1226
- # Alfred displays:
1227
- # 📊 Project Update Analysis
1228
- #
1229
- # Current: CLAUDE.md v0.8.1 (248 lines, template + your customizations)
1230
- # Latest: Template v0.9.0 (787 lines, expanded guidelines)
1231
- #
1232
- # Changes Detected:
1233
- # ✅ Alfred Persona System (new)
1234
- # ✅ Language Boundary Rules (enhanced)
1235
- # ✅ Report Style Standards (new)
1236
- # ✅ Your Customizations: Preserved (한국어, GOOS🪿엉아, etc.)
1237
-
1238
- # User selects: 🔄 Smart Merge Proceed
1239
-
1240
- # Result:
1241
- # ✅ Merge Complete!
1242
- # - CLAUDE.md updated (v0.8.1 → v0.9.0)
1243
- # - User customizations preserved
1244
- # - config.json updated with optimization metadata
1245
- # - Backup saved to .moai-backups/20251102-221000/
1246
- ```
1247
-
1248
- #### Key Features
1249
-
1250
- 1. **Automatic Backup**: Always creates backup before merge (safe rollback available)
1251
- 2. **Smart Detection**: Identifies template defaults vs. your customizations
1252
- 3. **Preservation Policy**: Never overwrites your custom content
1253
- 4. **Version Tracking**: Automatically updates template_version in config.json
1254
- 5. **HISTORY Section**: Cumulative merge history preserved
1255
-
1256
- #### Command Reference
1257
-
1258
- | Operation | Command |
1259
- |-----------|---------|
1260
- | **Optimize** | `/alfred:0-project update` |
1261
- | **Review First** | Select "Preview" option when prompted |
1262
- | **Keep Current** | Select "Skip" option (safe—run later anytime) |
1263
- | **Check Status** | `cat .moai/config.json \| grep -A2 optimization` |
1264
-
1265
- #### Rollback If Needed
1266
-
1267
- If something goes wrong, restore from automatic backup:
1268
-
1269
- ```bash
1270
- # List available backups
1271
- ls -lt .moai-backups/
1272
-
1273
- # Restore from backup (example)
1274
- cp -r .moai-backups/20251102-221000/CLAUDE.md ./CLAUDE.md
1275
- cp -r .moai-backups/20251102-221000/.moai/config.json ./.moai/config.json
1276
- ```
1277
-
1278
- #### Why This Matters
1279
-
1280
- - **Stay Current**: Get latest Alfred improvements, fixes, and features
1281
- - **Keep Your Work**: All customizations preserved through merges
1282
- - **No Manual Editing**: Smart merge handles complex version synchronization
1283
- - **Trust the Process**: Automatic backups ensure safe rollback anytime
1284
-
1285
- ---
1286
-
1287
- ## Development Setup for Contributors
1288
-
1289
- If you're developing **MoAI-ADK itself**, follow these steps to set up your development environment.
1290
-
1291
- ### Prerequisites
1292
-
1293
- - Python 3.13+
1294
- - `uv` package manager
1295
- - Git
1296
-
1297
- ### Setup Steps
1298
-
1299
- #### Step 1: Clone and Install in Editable Mode
1300
-
1301
- ```bash
1302
- # Clone the repository
1303
- git clone https://github.com/modu-ai/moai-adk.git
1304
- cd moai-adk
1305
-
1306
- # Install in editable mode (creates symlink, not a copy)
1307
- uv pip install -e .
1308
-
1309
- # Or with pip (also works)
1310
- pip install -e .
1311
- ```
1312
-
1313
- The editable install allows your local changes to be immediately reflected when using `moai-adk` command.
1314
-
1315
- #### Step 2: Initialize Development Configuration
1316
-
1317
- After the editable install, initialize the development repository's configuration:
1318
-
1319
- ```bash
1320
- # Run the initialization script
1321
- bash .moai/scripts/init-dev-config.sh
1322
- ```
1323
-
1324
- **What this script does:**
1325
- - Extracts the actual version from `pyproject.toml`
1326
- - Replaces template placeholders (`{{MOAI_VERSION}}`) with actual version values in `.moai/config.json`
1327
- - Sets up `project.template_version` field
1328
- - Ensures the `moai-adk update` command works correctly on first run
1329
-
1330
- **Why is this necessary?**
1331
-
1332
- When you install MoAI-ADK in editable mode, the `.moai/config.json` file contains unsubstituted template placeholders. This causes the first `moai-adk update` command to fail with version comparison errors. The init script resolves these placeholders so everything works seamlessly.
1333
-
1334
- #### Step 3: Verify Setup
1335
-
1336
- ```bash
1337
- # Check that moai-adk works
1338
- moai-adk --version
1339
-
1340
- # Run the health check
1341
- moai-adk doctor
1342
-
1343
- # Expected output:
1344
- # ✅ Python version: 3.13+
1345
- # ✅ UV installed
1346
- # ✅ Project structure: Valid
1347
- # ✅ Configuration: Ready
1348
- ```
1349
-
1350
- #### Step 4: Run Tests
1351
-
1352
- ```bash
1353
- # Run all tests with coverage
1354
- pytest tests/
1355
-
1356
- # Run specific test module
1357
- pytest tests/unit/test_update.py -v
1358
-
1359
- # Run with coverage report
1360
- pytest tests/ --cov=src/moai_adk --cov-report=html
1361
-
1362
- # Check coverage thresholds
1363
- pytest tests/ --cov=src/moai_adk --cov-report=term-missing
1364
- ```
1365
-
1366
- ### Common Development Workflow
1367
-
1368
- #### After Making Code Changes
1369
-
1370
- ```bash
1371
- # 1. Run tests to ensure nothing broke
1372
- pytest tests/ -v
1373
-
1374
- # 2. Check code style
1375
- ruff check src/
1376
- ruff format src/
1377
-
1378
- # 3. Type checking
1379
- mypy src/
1380
-
1381
- # 4. If you modified update.py, test the update command
1382
- moai-adk update --check
1383
- ```
1384
-
1385
- #### Testing the Update Command
1386
-
1387
- The update command has been fixed to handle invalid version strings gracefully. To test it in development:
1388
-
1389
- ```bash
1390
- # Test update without applying it
1391
- moai-adk update --check
1392
-
1393
- # Test with force mode (skips backup)
1394
- moai-adk update --force
1395
-
1396
- # Test with specific version
1397
- moai-adk update --templates-only
1398
- ```
1399
-
1400
- ### Understanding the Init Script
1401
-
1402
- The `.moai/scripts/init-dev-config.sh` script performs these operations:
1403
-
1404
- 1. **Extracts Version**: Reads `pyproject.toml` to get the current version
1405
- 2. **Updates Config**: Modifies `.moai/config.json` to set:
1406
- - `moai.version` → actual version value
1407
- - `project.template_version` → actual version value
1408
- 3. **Validates**: Ensures the JSON structure is preserved correctly
1409
- 4. **Provides Feedback**: Shows what was updated and verifies the changes
1410
-
1411
- ### Troubleshooting Development Setup
1412
-
1413
- #### Problem: `moai-adk` command not found
1414
-
1415
- ```bash
1416
- # Solution 1: Reinstall in editable mode
1417
- uv pip install -e .
1418
-
1419
- # Solution 2: Verify uv environment
1420
- uv pip list | grep moai-adk
1421
-
1422
- # Solution 3: Use full path
1423
- python -m moai_adk --version
1424
- ```
1425
-
1426
- #### Problem: `.moai/config.json` still has placeholders after running init script
1427
-
1428
- ```bash
1429
- # Manually check the config
1430
- cat .moai/config.json | grep -i moai_version
1431
-
1432
- # If still showing {{MOAI_VERSION}}, rerun the script:
1433
- bash .moai/scripts/init-dev-config.sh
1434
-
1435
- # Or manually update using Python:
1436
- python3 << 'EOF'
1437
- import json
1438
- from pathlib import Path
1439
-
1440
- config_path = Path(".moai/config.json")
1441
- config = json.loads(config_path.read_text())
1442
-
1443
- # Update manually
1444
- config['moai']['version'] = "0.8.1"
1445
- config['project']['template_version'] = "0.8.1"
1446
-
1447
- config_path.write_text(json.dumps(config, indent=2) + '\n')
1448
- print("✅ Config updated manually")
1449
- EOF
1450
- ```
1451
-
1452
- #### Problem: `moai-adk update` requires running twice
1453
-
1454
- This issue has been **fixed** in v0.8.1+. If you're experiencing this:
1455
-
1456
- 1. Ensure you've run the init script: `bash .moai/scripts/init-dev-config.sh`
1457
- 2. Update to the latest version: `pip install -e --upgrade .`
1458
- 3. Verify the config has actual versions: `cat .moai/config.json | grep version`
1459
-
1460
- **What was the issue?**
1461
- - Development installations had unsubstituted `{{MOAI_VERSION}}` placeholders in config
1462
- - First `moai-adk update` would fail comparing "0.8.1" vs "{{MOAI_VERSION}}"
1463
- - Second run might partially work after partial sync
1464
-
1465
- **How it's fixed:**
1466
- - `init-dev-config.sh` replaces placeholders with actual versions
1467
- - Code now gracefully handles InvalidVersion exceptions
1468
- - Added comprehensive unit tests for placeholder detection
1469
-
1470
- #### Problem: UV Tool Upgrade Shows "Nothing to upgrade" Despite New Version
1471
-
1472
- **Status**: Automatically fixed in v0.9.1+ with cache refresh retry
1473
-
1474
- **Symptoms:**
1475
- - `moai-adk update` shows "Nothing to upgrade"
1476
- - PyPI has a newer version available
1477
- - Caused by stale UV cache metadata
1478
-
1479
- **Automatic Fix (v0.9.1+):**
1480
- The system now automatically detects stale cache and retries:
1481
- 1. Detects "Nothing to upgrade" message
1482
- 2. Compares installed version vs PyPI latest version
1483
- 3. Clears UV cache: `uv cache clean moai-adk`
1484
- 4. Automatically retries upgrade
1485
- 5. Completes in a single command run
1486
-
1487
- **Manual Workaround (if needed):**
1488
- ```bash
1489
- # Clear UV cache and retry
1490
- uv cache clean moai-adk && moai-adk update
1491
- ```
1492
-
1493
- **Technical Details:**
1494
- - Root cause: UV caches PyPI metadata that can become outdated
1495
- - Detection: Compares version strings when "Nothing to upgrade" appears
1496
- - Retry limit: Maximum 1 retry to prevent infinite loops
1497
- - Timeout: 10 seconds for cache clear operation
1498
-
1499
- **References:**
1500
- - SPEC: @SPEC:EX-UPDATE-001
1501
- - Implementation: @CODE:EX-UPDATE-001-001, @CODE:EX-UPDATE-001-002, @CODE:EX-UPDATE-001-003
1502
- - Tests: @TEST:EX-UPDATE-001
1503
-
1504
- ### Contributing Tests
1505
-
1506
- When adding new features, always include tests:
1507
-
1508
- ```bash
1509
- # Add tests to tests/unit/ or tests/integration/
1510
- # Follow existing test patterns in test_update.py
1511
-
1512
- # Run your new tests
1513
- pytest tests/unit/test_*.py -v
1514
-
1515
- # Ensure coverage remains ≥ 85%
1516
- pytest tests/ --cov=src/moai_adk --cov-report=term-missing
1517
- ```
1518
-
1519
- ### Making a Pull Request
1520
-
1521
- Before opening a PR, ensure:
1522
-
1523
- ```bash
1524
- # 1. All tests pass
1525
- pytest tests/ -v
1526
-
1527
- # 2. Coverage is adequate
1528
- pytest tests/ --cov=src/moai_adk --cov-report=term-missing
1529
-
1530
- # 3. Code is formatted
1531
- ruff format src/
1532
- ruff check src/
1533
-
1534
- # 4. Types are valid
1535
- mypy src/
1536
-
1537
- # 5. Init script works
1538
- bash .moai/scripts/init-dev-config.sh
1539
-
1540
- # 6. Update command works
1541
- moai-adk update --check
1542
- ```
1543
-
1544
- ---
1545
-
1546
- ## Core Workflow (0 → 3)
1547
-
1548
- Alfred iteratively develops projects with four commands.
1549
-
1550
- ```mermaid
1551
- %%{init: {'theme':'neutral'}}%%
1552
- graph TD
1553
- Start([User Request]) --> Init[0. Init<br/>/alfred:0-project]
1554
- Init --> Plan[1. Plan & SPEC<br/>/alfred:1-plan]
1555
- Plan --> Run[2. Run & TDD<br/>/alfred:2-run]
1556
- Run --> Sync[3. Sync & Docs<br/>/alfred:3-sync]
1557
- Sync --> Plan
1558
- Sync -.-> End([Release])
1559
- ```
1560
-
1561
- ### 0. INIT — Project Preparation
1562
-
1563
- - Questions about project introduction, target, language, mode (locale)
1564
- - Auto-generates `.moai/config.json`, `.moai/project/*` 5 documents
1565
- - Language detection and recommended Skill Pack deployment (Foundation + Essentials + Domain/Language)
1566
- - Template cleanup, initial Git/backup checks
1567
-
1568
- ### 1. PLAN — Agree on What to Build
1569
-
1570
- - Write SPEC with EARS template (includes `@SPEC:ID`)
1571
- - Organize Plan Board, implementation ideas, risk factors
1572
- - Auto-create branch/initial Draft PR in Team mode
1573
-
1574
- ### 2. RUN — Test-Driven Development (TDD)
1575
-
1576
- - Phase 1 `implementation-planner`: Design libraries, folders, TAG layout
1577
- - Phase 2 `tdd-implementer`: RED (failing test) → GREEN (minimal implementation) → REFACTOR (cleanup)
1578
- - quality-gate verifies TRUST 5 principles, coverage changes
1579
-
1580
- ### 3. SYNC — Documentation & PR Organization
1581
-
1582
- - Sync Living Document, README, CHANGELOG, etc.
1583
- - Validate TAG chain and recover orphan TAGs
1584
- - Generate Sync Report, transition Draft → Ready for Review, support `--auto-merge` option
1585
-
1586
- ---
1587
-
1588
- ## Command Cheat Sheet
1589
-
1590
- | Command | What it does | Key Outputs |
1591
- | ------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------ |
1592
- | `/alfred:0-project` | Collect project description, create config/docs, recommend Skills | `.moai/config.json`, `.moai/project/*`, initial report |
1593
- | `/alfred:1-plan <description>` | Analyze requirements, draft SPEC, write Plan Board | `.moai/specs/SPEC-*/spec.md`, plan/acceptance docs, feature branch |
1594
- | `/alfred:2-run <SPEC-ID>` | Execute TDD, test/implement/refactor, verify quality | `tests/`, `src/` implementation, quality report, TAG connection |
1595
- | `/alfred:3-sync` | Sync docs/README/CHANGELOG, organize TAG/PR status | `docs/`, `.moai/reports/sync-report.md`, Ready PR |
1596
- | `/alfred:9-feedback` | Interactively create GitHub Issues (type → title → description → priority) | GitHub Issue with auto labels, priority, URL |
1597
-
1598
- > ❗ All commands maintain **Phase 0 (optional) → Phase 1 → Phase 2 → Phase 3** cycle structure. Alfred automatically reports execution status and next-step suggestions.
1599
- >
1600
- > 💡 **New in v0.7.0+**: `/alfred:9-feedback` enables instant GitHub Issue creation during development, keeping your workflow uninterrupted while keeping issues tracked and visible to the team.
1601
-
1602
- ---
1603
-
1604
- ## SPEC GitHub Issue Automation
1605
-
1606
- MoAI-ADK now provides **automatic GitHub Issue synchronization** from SPEC documents, seamlessly integrating requirements with issue tracking in team mode.
1607
-
1608
- ### How It Works
1609
-
1610
- When you create a SPEC document using `/alfred:1-plan` and push it to a feature branch:
1611
-
1612
- 1. **GitHub Actions Workflow** automatically triggers on PR events
1613
- 2. **SPEC Metadata** (ID, version, status, priority) is extracted from YAML frontmatter
1614
- 3. **GitHub Issue** is created with full SPEC content and metadata table
1615
- 4. **PR Comment** is added with a link to the created issue
1616
- 5. **Labels** are automatically applied based on priority (critical, high, medium, low)
1617
-
1618
- ### What Gets Synchronized
1619
-
1620
- **From SPEC to GitHub Issue:**
1621
- - **SPEC ID**: Unique identifier (e.g., AUTH-001, USER-001)
1622
- - **Version**: Semantic versioning (v0.1.0, v1.0.0)
1623
- - **Status**: draft, in-review, in-progress, completed, stable
1624
- - **Priority**: critical, high, medium, low (becomes GitHub label)
1625
- - **Full Content**: EARS requirements, acceptance criteria, dependencies
1626
-
1627
- **GitHub Issue Format:**
1628
- ```markdown
1629
- # [SPEC-AUTH-001] User Authentication (v1.0.0)
1630
-
1631
- ## SPEC Metadata
1632
-
1633
- | Field | Value |
1634
- |-------|-------|
1635
- | **ID** | AUTH-001 |
1636
- | **Version** | v1.0.0 |
1637
- | **Status** | in-progress |
1638
- | **Priority** | high |
1639
-
1640
- ## SPEC Document
1641
-
1642
- [Full SPEC content from .moai/specs/SPEC-AUTH-001/spec.md]
1643
-
1644
- ---
1645
-
1646
- 📎 **Branch**: `feature/AUTH-001`
1647
- 🔗 **PR**: #123
1648
- 📝 **Auto-synced**: This issue is automatically synchronized from the SPEC document
1649
- ```
1650
-
1651
- ### Features
1652
-
1653
- ✅ **Automatic Issue Creation**: GitHub Issue created on every PR with SPEC file changes
1654
- ✅ **Metadata Extraction**: ID, version, status, priority automatically parsed from YAML frontmatter
1655
- ✅ **PR Integration**: Issue linked to PR via automatic comment
1656
- ✅ **Label Management**: Priority-based labels (critical, high, medium, low) auto-applied
1657
- ✅ **CodeRabbit Review** (local only): AI-powered SPEC quality validation in local development
1658
-
1659
- ### Setup Requirements
1660
-
1661
- **GitHub Actions Workflow**: `.github/workflows/spec-issue-sync.yml`
1662
- **GitHub Issue Template**: `.github/ISSUE_TEMPLATE/spec.yml`
1663
- **GitHub Labels**: `spec`, `planning`, `critical`, `high`, `medium`, `low`
1664
-
1665
- All templates are automatically installed with MoAI-ADK and synced during `moai-adk init`.
1666
-
1667
- ### CodeRabbit Integration (Local Only)
1668
-
1669
- When working in your **local development environment**, CodeRabbit provides automatic SPEC quality review:
1670
-
1671
- **What CodeRabbit Reviews:**
1672
- - ✅ All 7 required metadata fields (id, version, status, created, updated, author, priority)
1673
- - ✅ HISTORY section formatting and chronological order
1674
- - ✅ EARS requirements structure (Ubiquitous, Event-driven, State-driven, Constraints, Optional)
1675
- - ✅ Acceptance criteria in Given-When-Then format
1676
- - ✅ @TAG system compliance for traceability
1677
-
1678
- **CodeRabbit Configuration**: `.coderabbit.yaml` (local only, not distributed in packages)
1679
-
1680
- > **Note**: CodeRabbit integration is available only in local development environments. Package users receive core GitHub Issue automation without CodeRabbit review.
1681
-
1682
- ### Workflow Example
1683
-
1684
- ```bash
1685
- # 1. Create SPEC
1686
- /alfred:1-plan "User authentication feature"
1687
-
1688
- # 2. SPEC file created at .moai/specs/SPEC-AUTH-001/spec.md
1689
- # 3. Feature branch created: feature/SPEC-AUTH-001
1690
- # 4. Draft PR created (team mode)
1691
-
1692
- # 5. GitHub Actions automatically:
1693
- # - Parses SPEC metadata
1694
- # - Creates GitHub Issue #45
1695
- # - Adds PR comment: "✅ SPEC GitHub Issue Created - Issue: #45"
1696
- # - Applies labels: spec, planning, high
1697
-
1698
- # 6. CodeRabbit reviews SPEC (local only):
1699
- # - Validates metadata
1700
- # - Checks EARS requirements
1701
- # - Provides quality score
1702
-
1703
- # 7. Continue with TDD implementation
1704
- /alfred:2-run AUTH-001
1705
- ```
1706
-
1707
- ### Benefits
1708
-
1709
- 1. **Centralized Tracking**: All SPEC requirements tracked as GitHub Issues
1710
- 2. **Team Visibility**: Non-technical stakeholders can follow progress via Issues
1711
- 3. **Automated Workflow**: No manual issue creation—fully automated from SPEC to Issue
1712
- 4. **Traceability**: Direct link between SPEC files, Issues, PRs, and implementation
1713
- 5. **Quality Assurance**: CodeRabbit validates SPEC quality before implementation (local only)
1714
-
1715
- ---
1716
-
1717
- ## Quick Issue Creation with `/alfred:9-feedback`
1718
-
1719
- MoAI-ADK v0.7.0+ includes the **Quick Issue Creation** feature, allowing developers to instantly create GitHub Issues without interrupting their development workflow.
1720
-
1721
- ### Why Quick Issue Creation?
1722
-
1723
- During development, you frequently encounter:
1724
- - 🐛 Bugs that need immediate reporting
1725
- - ✨ Feature ideas that come to mind
1726
- - ⚡ Performance improvements to suggest
1727
- - ❓ Architecture questions that need team discussion
1728
-
1729
- **The old way**: Stop coding, go to GitHub, manually fill issue form, remember what you were working on.
1730
- **The new way**: Type one command, GitHub Issue is created instantly, continue coding.
1731
-
1732
- ### Interactive Dialog Flow
1733
-
1734
- When you run `/alfred:9-help`, Alfred guides you through an interactive multi-step dialog:
1735
-
1736
- **Step 1: Select Issue Type**
1737
- ```
1738
- Alfred: What type of issue do you want to create?
1739
- [ ] 🐛 Bug Report - Something isn't working
1740
- [ ] ✨ Feature Request - Suggest new functionality
1741
- [ ] ⚡ Improvement - Enhance existing features
1742
- [ ] ❓ Question/Discussion - Ask the team
1743
- ```
1744
-
1745
- **Step 2: Enter Issue Title**
1746
- ```
1747
- Alfred: What's the issue title?
1748
- Your input: "Login button not responding to clicks"
1749
- ```
1750
-
1751
- **Step 3: Enter Description (Optional)**
1752
- ```
1753
- Alfred: Provide a detailed description (optional—press Enter to skip)
1754
- Your input: "When I click the login button on iPhone 15, it freezes for 5 seconds then crashes"
1755
- ```
1756
-
1757
- **Step 4: Select Priority Level**
1758
- ```
1759
- Alfred: What's the priority level?
1760
- [ ] 🔴 Critical - System down, data loss, security breach
1761
- [ ] 🟠 High - Major feature broken, significant impact
1762
- [✓] 🟡 Medium - Normal priority (default)
1763
- [ ] 🟢 Low - Minor issues, nice-to-have
1764
- ```
1765
-
1766
- **Step 5: Automatic Issue Creation**
1767
- ```
1768
- Alfred automatically:
1769
- 1. Determines appropriate labels based on issue type and priority
1770
- 2. Formats title with emoji: "🐛 [BUG] Login button not responding..."
1771
- 3. Creates GitHub Issue with all information
1772
- 4. Returns the issue number and URL
1773
- ```
1774
-
1775
- ### Key Features
1776
-
1777
- 1. **⚡ Instant Creation**: Create GitHub Issues in seconds
1778
- 2. **🏷️ Automatic Labels**: Issue type + priority automatically labeled
1779
- 3. **🎯 Priority Selection**: Choose from Critical/High/Medium/Low
1780
- 4. **🔗 Team Visibility**: Issues immediately visible and discussable
1781
- 5. **📋 Standardized Format**: All issues follow consistent structure
1782
-
1783
- ### Complete Example: Bug Report During Code Review
1784
-
1785
- ```bash
1786
- # During code review, you notice a critical issue and want to report it instantly
1787
- $ /alfred:9-feedback
1788
-
1789
- Alfred: What type of issue do you want to create?
1790
- > 🐛 Bug Report
1791
-
1792
- Alfred: What's the issue title?
1793
- > Login button crash on mobile devices
1794
-
1795
- Alfred: Provide a detailed description (optional—press Enter to skip)
1796
- > Tapping the login button on iPhone 15 causes app to freeze for 5 seconds then crash.
1797
- > Tested on iOS 17.2, Chrome 120 on macOS 14.2.
1798
- > Expected: Login modal should appear
1799
- > Actual: No response then crash
1800
-
1801
- Alfred: What's the priority level?
1802
- > 🟠 High
1803
-
1804
- ✅ GitHub Issue #234 created successfully!
1805
-
1806
- 📋 Title: 🐛 [BUG] Login button crash on mobile devices
1807
- 🟠 Priority: High
1808
- 🏷️ Labels: bug, reported, priority-high
1809
- 🔗 URL: https://github.com/owner/repo/issues/234
1810
-
1811
- 💡 Next: Continue with your work—the issue is now tracked!
1812
- ```
1813
-
1814
- ### Integration with MoAI-ADK Workflow
1815
-
1816
- 1. **During Development**: Use `/alfred:9-help` to report bugs/ideas instantly
1817
- 2. **In Code Review**: Convert improvement suggestions to tracked issues
1818
- 3. **When Planning**: Reference created issues in SPEC documents
1819
- 4. **During Sync**: Link issues to SPEC requirements with `/alfred:3-sync`
1820
-
1821
- ### Prerequisites
1822
-
1823
- - GitHub CLI (`gh`) installed and authenticated
1824
- - Repository initialized with Git
1825
-
1826
- ### Learn More
1827
-
1828
- See `.moai/docs/quick-issue-creation-guide.md` for comprehensive documentation including:
1829
- - Detailed usage examples
1830
- - Best practices and tips
1831
- - Troubleshooting guide
1832
- - Integration with SPEC documents
1833
-
1834
- ---
1835
-
1836
- ## 5 Key Concepts
1837
-
1838
- MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and together they create a powerful development system.
1839
-
1840
- ### Key Concept 1: SPEC-First (Requirements First)
1841
-
1842
- **Metaphor**: Like building a house without an architect, you shouldn't code without a blueprint.
1843
-
1844
- **Core Idea**: Before implementation, **clearly define "what to build"**. This isn't just documentation—it's an **executable spec** that both teams and AI can understand.
1845
-
1846
- **EARS Syntax 5 Patterns**:
1847
-
1848
- 1. **Ubiquitous** (basic function): "The system SHALL provide JWT-based authentication"
1849
- 2. **Event-driven** (conditional): "WHEN valid credentials are provided, the system SHALL issue a token"
1850
- 3. **State-driven** (during state): "WHILE the user is authenticated, the system SHALL allow access to protected resources"
1851
- 4. **Optional** (optional): "WHERE a refresh token exists, the system MAY issue a new token"
1852
- 5. **Constraints** (constraints): "Token expiration time SHALL NOT exceed 15 minutes"
1853
-
1854
- **How?** The `/alfred:1-plan` command automatically creates professional SPECs in EARS format.
1855
-
1856
- **What You Get**:
1857
-
1858
- - ✅ Clear requirements everyone on the team understands
1859
- - ✅ SPEC-based test cases (what to test is already defined)
1860
- - ✅ When requirements change, track all affected code with `@SPEC:ID` TAG
1861
-
1862
- ---
1863
-
1864
- ### Key Concept 2: TDD (Test-Driven Development)
1865
-
1866
- **Metaphor**: Like finding the route after setting a destination, you set goals with tests, then write code.
1867
-
1868
- **Core Idea**: Write tests **before** implementation. Like checking ingredients before cooking, this clarifies requirements before implementation.
1869
-
1870
- **3-Step Cycle**:
1871
-
1872
- 1. **🔴 RED**: Write a failing test first
1873
-
1874
- - Each SPEC requirement becomes a test case
1875
- - Must fail because implementation doesn't exist yet
1876
- - Git commit: `test(AUTH-001): add failing test`
1877
-
1878
- 2. **🟢 GREEN**: Minimal implementation to pass the test
1879
-
1880
- - Make it pass using the simplest approach
1881
- - Passing comes before perfection
1882
- - Git commit: `feat(AUTH-001): implement minimal solution`
1883
-
1884
- 3. **♻️ REFACTOR**: Clean up and improve code
1885
- - Apply TRUST 5 principles
1886
- - Remove duplication, improve readability
1887
- - Tests must still pass
1888
- - Git commit: `refactor(AUTH-001): improve code quality`
1889
-
1890
- **How?** The `/alfred:2-run` command automatically executes these 3 steps.
1891
-
1892
- **What You Get**:
1893
-
1894
- - ✅ Guaranteed 85%+ coverage (no code without tests)
1895
- - ✅ Refactoring confidence (always verifiable with tests)
1896
- - ✅ Clear Git history (trace RED → GREEN → REFACTOR process)
1897
-
1898
- ---
1899
-
1900
- ### Key Concept 3: @TAG System
1901
-
1902
- **Metaphor**: Like package tracking numbers, you should be able to trace code's journey.
1903
-
1904
- **Core Idea**: Add `@TAG:ID` to all SPECs, tests, code, and documentation to create **one-to-one correspondence**.
1905
-
1906
- **TAG Chain**:
1907
-
1908
- ```
1909
- @SPEC:EX-AUTH-001 (requirements)
1910
-
1911
- @TEST:EX-AUTH-001 (test)
1912
-
1913
- @CODE:EX-AUTH-001 (implementation)
1914
-
1915
- @DOC:EX-AUTH-001 (documentation)
1916
- ```
1917
-
1918
- **TAG ID Rules**: `<Domain>-<3 digits>`
1919
-
1920
- - AUTH-001, AUTH-002, AUTH-003...
1921
- - USER-001, USER-002...
1922
- - Once assigned, **never change**
1923
-
1924
- **How to Use?** When requirements change:
1925
-
1926
- ```bash
1927
- # Find everything related to AUTH-001
1928
- rg '@TAG:AUTH-001' -n
1929
-
1930
- # Result: Shows all SPEC, TEST, CODE, DOC at once
1931
- # → Clear what needs modification
1932
- ```
1933
-
1934
- **How?** The `/alfred:3-sync` command validates TAG chains and detects orphan TAGs (TAGs without correspondence).
1935
-
1936
- **What You Get**:
1937
-
1938
- - ✅ Clear intent for all code (reading SPEC explains why this code exists)
1939
- - ✅ Instantly identify all affected code during refactoring
1940
- - ✅ Code remains understandable 3 months later (trace TAG → SPEC)
1941
-
1942
- ---
1943
-
1944
- ### Key Concept 4: TRUST 5 Principles
1945
-
1946
- **Metaphor**: Like a healthy body, good code must satisfy all 5 elements.
1947
-
1948
- **Core Idea**: All code must follow these 5 principles. `/alfred:3-sync` automatically verifies them.
1949
-
1950
- 1. **🧪 Test First** (tests come first)
1951
-
1952
- - Test coverage ≥ 85%
1953
- - All code protected by tests
1954
- - Adding feature = adding test
1955
-
1956
- 2. **📖 Readable** (easy-to-read code)
1957
-
1958
- - Functions ≤ 50 lines, files ≤ 300 lines
1959
- - Variable names reveal intent
1960
- - Pass linters (ESLint/ruff/clippy)
1961
-
1962
- 3. **🎯 Unified** (consistent structure)
1963
-
1964
- - Maintain SPEC-based architecture
1965
- - Same patterns repeat (reduces learning curve)
1966
- - Type safety or runtime validation
1967
-
1968
- 4. **🔒 Secured** (security)
1969
-
1970
- - Input validation (defend against XSS, SQL Injection)
1971
- - Password hashing (bcrypt, Argon2)
1972
- - Protect sensitive information (environment variables)
1973
-
1974
- 5. **🔗 Trackable** (traceability)
1975
- - Use @TAG system
1976
- - Include TAG in Git commits
1977
- - Document all decisions
1978
-
1979
- **How?** The `/alfred:3-sync` command automatically performs TRUST verification.
1980
-
1981
- **What You Get**:
1982
-
1983
- - ✅ Production-quality code guaranteed
1984
- - ✅ Entire team develops with same standards
1985
- - ✅ Fewer bugs, prevent security vulnerabilities in advance
1986
-
1987
- ---
1988
-
1989
- ### Key Concept 5: Alfred SuperAgent
1990
-
1991
- **Metaphor**: Like a personal assistant, Alfred handles all the complex work.
1992
-
1993
- **Core Idea**: **19 AI agents** collaborate to automate the entire development process:
1994
-
1995
- **Agent Composition**:
1996
-
1997
- - **Alfred SuperAgent**: Overall orchestration (1)
1998
- - **Core Sub-agents**: Specialized tasks like SPEC writing, TDD implementation, documentation sync (10)
1999
- - **Zero-project Specialists**: Project initialization, language detection, etc. (6)
2000
- - **Built-in Agents**: General questions, codebase exploration (2)
2001
-
2002
- **55 Claude Skills**:
2003
-
2004
- - **Foundation** (6): TRUST/TAG/SPEC/Git/EARS principles
2005
- - **Essentials** (4): Debugging, performance, refactoring, code review
2006
- - **Alfred** (7): Workflow automation
2007
- - **Domain** (10): Backend, frontend, security, etc.
2008
- - **Language** (18): Python, JavaScript, Go, Rust, Java, Kotlin, Swift, Dart, C/C#, Ruby, PHP, SQL, Shell, and more
2009
- - **Ops** (1): Claude Code session management
2010
- - **Other** (2): Skill factory, Spec authoring
2011
-
2012
- **How?** `/alfred:*` commands automatically activate the right expert team.
2013
-
2014
- **What You Get**:
2015
-
2016
- - ✅ No prompt writing needed (use standardized commands)
2017
- - ✅ Automatically remember project context (no repeating same questions)
2018
- - ✅ Auto-assemble optimal expert team (activate appropriate Sub-agents)
2019
-
2020
- > **Want to learn more?** Check detailed rules in `.moai/memory/development-guide.md`.
2021
-
2022
- ---
2023
-
2024
- ## First Hands-on: Todo API Example
2025
-
2026
- Let's now **experience MoAI-ADK's complete workflow** firsthand. We'll build a simple "Todo Management API" and see how SPEC, TDD, and documentation connect.
2027
-
2028
- ### Step 1: PLAN - Write SPEC (about 3 minutes)
2029
-
2030
- ```bash
2031
- /alfred:1-plan "Todo add, view, update, delete API"
2032
- ```
2033
-
2034
- **Execution Result**:
2035
-
2036
- Alfred's **spec-builder** automatically generates:
2037
-
2038
- ```yaml
2039
- # .moai/specs/SPEC-TODO-001/spec.md
2040
-
2041
- ---
2042
- id: TODO-001
2043
- version: 0.0.1
2044
- status: draft
2045
- created: 2025-10-22
2046
- updated: 2025-10-22
2047
- author: @user
2048
- priority: high
2049
- ---
2050
-
2051
- # @SPEC:EX-TODO-001: Todo Management API
2052
-
2053
- ## Ubiquitous Requirements
2054
- - The system SHALL be able to add todos
2055
- - The system SHALL be able to view all todos
2056
- - The system SHALL be able to update specific todos
2057
- - The system SHALL be able to delete todos
2058
-
2059
- ## Event-driven Requirements
2060
- - WHEN a new todo is requested via POST /todos, the system SHALL save the todo and return a 201 response
2061
- - WHEN GET /todos/{id} is requested with an existing todo ID, the system SHALL return that todo
2062
- - WHEN GET is requested with a non-existent todo ID, the system SHALL return a 404 error
2063
-
2064
- ## Constraints
2065
- - Todo title SHALL be minimum 1 character, maximum 200 characters
2066
- - Each todo SHALL automatically record creation time
2067
- ```
2068
-
2069
- **Also auto-generated**:
2070
-
2071
- - 📋 `Plan Board`: Implementation ideas, risk factors, solution strategies
2072
- - ✅ `Acceptance Criteria`: Verification standards
2073
- - 🌿 `feature/spec-todo-001` Git branch
2074
-
2075
- ### Step 2: RUN - TDD Implementation (about 5 minutes)
2076
-
2077
- ```bash
2078
- /alfred:2-run TODO-001
2079
- ```
2080
-
2081
- **Phase 1: Establish Implementation Strategy**
2082
-
2083
- The **implementation-planner** Sub-agent decides:
2084
-
2085
- - 📚 Libraries: FastAPI + SQLAlchemy
2086
- - 📁 Folder structure: `src/todo/`, `tests/todo/`
2087
- - 🏷️ TAG design: `@CODE:EX-TODO-001:API`, `@CODE:EX-TODO-001:MODEL`, `@CODE:EX-TODO-001:REPO`
2088
-
2089
- **Phase 2: RED → GREEN → REFACTOR**
2090
-
2091
- **🔴 RED: Write Tests First**
2092
-
2093
- ```python
2094
- # tests/test_todo_api.py
2095
- # @TEST:README-EXAMPLE-TODO | SPEC: SPEC-TODO-001.md
2096
-
2097
- import pytest
2098
- from src.todo.api import create_todo, get_todos
2099
-
2100
- def test_create_todo_should_return_201_with_todo_id():
2101
- """WHEN a new todo is requested via POST /todos,
2102
- the system SHALL save the todo and return a 201 response"""
2103
- response = create_todo({"title": "Buy groceries"})
2104
- assert response.status_code == 201
2105
- assert "id" in response.json()
2106
- assert response.json()["title"] == "Buy groceries"
2107
-
2108
- def test_get_todos_should_return_all_todos():
2109
- """The system SHALL be able to view all todos"""
2110
- create_todo({"title": "Task 1"})
2111
- create_todo({"title": "Task 2"})
2112
-
2113
- response = get_todos()
2114
- assert response.status_code == 200
2115
- assert len(response.json()) >= 2
2116
-
2117
- def test_get_todo_with_invalid_id_should_return_404():
2118
- """WHEN GET is requested with a non-existent todo ID,
2119
- the system SHALL return a 404 error"""
2120
- response = get_todo(999)
2121
- assert response.status_code == 404
2122
- ```
2123
-
2124
- **Execute**: `pytest tests/test_todo_api.py -v`
2125
- **Result**: ❌ All fail (create_todo not defined)
2126
-
2127
- **Git Commit**:
2128
-
2129
- ```bash
2130
- git commit -m "🔴 test(TODO-001): add failing API tests"
2131
- ```
2132
-
2133
- **🟢 GREEN: Minimal Implementation**
2134
-
2135
- ```python
2136
- # src/todo/api.py
2137
- # @CODE:EX-TODO-001:API | SPEC: SPEC-TODO-001.md | TEST: tests/test_todo_api.py
2138
-
2139
- from fastapi import FastAPI, HTTPException
2140
- from pydantic import BaseModel
2141
- import uuid
2142
-
2143
- app = FastAPI()
2144
- todos_db = {}
2145
-
2146
- class TodoRequest(BaseModel):
2147
- title: str
2148
-
2149
- @app.post("/todos", status_code=201)
2150
- def create_todo(todo: TodoRequest):
2151
- """@CODE:EX-TODO-001:API - POST endpoint"""
2152
- todo_id = str(uuid.uuid4())
2153
- todos_db[todo_id] = {"id": todo_id, "title": todo.title}
2154
- return todos_db[todo_id]
2155
-
2156
- @app.get("/todos")
2157
- def get_todos():
2158
- """@CODE:EX-TODO-001:API - GET all endpoint"""
2159
- return list(todos_db.values())
2160
-
2161
- @app.get("/todos/{todo_id}")
2162
- def get_todo(todo_id: str):
2163
- """@CODE:EX-TODO-001:API - GET by ID endpoint"""
2164
- if todo_id not in todos_db:
2165
- raise HTTPException(status_code=404, detail="Todo not found")
2166
- return todos_db[todo_id]
2167
- ```
2168
-
2169
- **Execute**: `pytest tests/test_todo_api.py -v`
2170
- **Result**: ✅ All pass!
2171
-
2172
- **Git Commit**:
2173
-
2174
- ```bash
2175
- git commit -m "🟢 feat(TODO-001): implement minimal Todo API"
2176
- ```
2177
-
2178
- **♻️ REFACTOR: Code Improvement**
2179
-
2180
- ```python
2181
- # src/todo/models.py
2182
- # @CODE:EX-TODO-001:MODEL | SPEC: SPEC-TODO-001.md
2183
-
2184
- from datetime import datetime
2185
- from sqlalchemy import Column, String, DateTime
2186
- from sqlalchemy.ext.declarative import declarative_base
2187
-
2188
- Base = declarative_base()
2189
-
2190
- class Todo(Base):
2191
- """@CODE:EX-TODO-001:MODEL - Todo data model"""
2192
- __tablename__ = "todos"
2193
-
2194
- id = Column(String, primary_key=True)
2195
- title = Column(String(200), nullable=False, index=True) # Constraint: max 200 chars
2196
- created_at = Column(DateTime, default=datetime.utcnow) # Auto creation time
2197
-
2198
- def validate(self):
2199
- """@CODE:EX-TODO-001:MODEL - Validation"""
2200
- if not self.title or len(self.title) > 200:
2201
- raise ValueError("Title must be 1-200 characters")
2202
- ```
2203
-
2204
- **Execute**: `pytest tests/test_todo_api.py -v`
2205
- **Result**: ✅ Still all pass!
2206
-
2207
- **Git Commit**:
2208
-
2209
- ```bash
2210
- git commit -m "♻️ refactor(TODO-001): add database models and validation"
2211
- ```
2212
-
2213
- **Phase 3: Quality Verification**
2214
-
2215
- ```bash
2216
- # TRUST verification
2217
- ✅ Test First: 87% coverage
2218
- ✅ Readable: All functions < 50 lines
2219
- ✅ Unified: Consistent API patterns
2220
- ✅ Secured: Input validation complete
2221
- ✅ Trackable: All code has @TAG:TODO-001
2222
- ```
2223
-
2224
- ### Step 3: SYNC - Documentation Sync (about 1 minute)
2225
-
2226
- ```bash
2227
- /alfred:3-sync
2228
- ```
2229
-
2230
- **Automatically Performed**:
2231
-
2232
- 1. **TAG Chain Validation**
2233
-
2234
- ```bash
2235
- ✅ @SPEC:EX-TODO-001 → .moai/specs/SPEC-TODO-001/spec.md
2236
- ✅ @TEST:README-EXAMPLE-TODO → tests/test_todo_api.py
2237
- ✅ @CODE:EX-TODO-001 → src/todo/ (3 files)
2238
- ✅ @DOC:EX-TODO-001 → docs/api/todo.md (auto-generated)
2239
-
2240
- TAG Chain Integrity: 100%
2241
- Orphan TAGs: None
2242
- ```
2243
-
2244
- 2. **Living Document Generation**
2245
-
2246
- ```markdown
2247
- # @DOC:EX-TODO-001: Todo Management API
2248
-
2249
- ## Overview
2250
-
2251
- REST API for managing tasks with CRUD operations.
2252
-
2253
- ## Endpoints
2254
-
2255
- ### Create Todo
2256
-
2257
- - Method: POST
2258
- - URL: /todos
2259
- - Request: {"title": "string (1-200 chars)"}
2260
- - Response: 201 Created with todo object
2261
- - Implemented in: @CODE:EX-TODO-001:API
2262
- - Tested in: @TEST:README-EXAMPLE-TODO
2263
-
2264
- ### Get All Todos
2265
-
2266
- - Method: GET
2267
- - URL: /todos
2268
- - Response: 200 OK with array of todos
2269
-
2270
- [... etc ...]
2271
- ```
2272
-
2273
- 3. **README Update**
2274
-
2275
- ```markdown
2276
- ## Features
2277
-
2278
- - ✅ Todo Management API (TODO-001)
2279
- ```
2280
-
2281
- 4. **CHANGELOG Generation**
2282
-
2283
- ```markdown
2284
- # Changelog
2285
-
2286
- ## [0.1.0] - 2025-10-22
2287
-
2288
- ### Added
2289
-
2290
- - Todo Management API with CRUD operations (@SPEC:EX-TODO-001)
2291
- - Create new todos
2292
- - List all todos
2293
- - Update existing todos
2294
- - Delete todos
2295
-
2296
- ### Implementation Details
2297
-
2298
- - SPEC: .moai/specs/SPEC-TODO-001/spec.md
2299
- - Tests: tests/test_todo_api.py (87% coverage)
2300
- - Code: src/todo/ with models, API, repository layers
2301
- ```
2302
-
2303
- ### Step 4: Verification (about 1 minute)
2304
-
2305
- Let's verify everything generated is properly connected:
2306
-
2307
- ```bash
2308
- # 1️⃣ Check TAG chain
2309
- rg '@(SPEC|TEST|CODE|DOC):TODO-001' -n
2310
-
2311
- # Output:
2312
- # .moai/specs/SPEC-TODO-001/spec.md:1: # @SPEC:EX-TODO-001: Todo Management API
2313
- # tests/test_todo_api.py:2: # @TEST:README-EXAMPLE-TODO | SPEC: SPEC-TODO-001.md
2314
- # src/todo/api.py:5: # @CODE:EX-TODO-001:API | SPEC: SPEC-TODO-001.md
2315
- # src/todo/models.py:5: # @CODE:EX-TODO-001:MODEL | SPEC: SPEC-TODO-001.md
2316
- # docs/api/todo.md:1: # @DOC:EX-TODO-001: Todo Management API
2317
-
2318
-
2319
- # 2️⃣ Run tests
2320
- pytest tests/test_todo_api.py -v
2321
- # ✅ test_create_todo_should_return_201_with_todo_id PASSED
2322
- # ✅ test_get_todos_should_return_all_todos PASSED
2323
- # ✅ test_get_todo_with_invalid_id_should_return_404 PASSED
2324
- # ✅ 3 passed in 0.05s
2325
-
2326
-
2327
- # 3️⃣ Check generated documentation
2328
- cat docs/api/todo.md # API documentation auto-generated
2329
- cat README.md # Todo API added
2330
- cat CHANGELOG.md # Change history recorded
2331
-
2332
-
2333
- # 4️⃣ Check Git history
2334
- git log --oneline | head -5
2335
- # a1b2c3d ✅ sync(TODO-001): update docs and changelog
2336
- # f4e5d6c ♻️ refactor(TODO-001): add database models
2337
- # 7g8h9i0 🟢 feat(TODO-001): implement minimal API
2338
- # 1j2k3l4 🔴 test(TODO-001): add failing tests
2339
- # 5m6n7o8 🌿 Create feature/spec-todo-001 branch
2340
- ```
2341
-
2342
- ### After 15 Minutes: Complete System
2343
-
2344
- ```
2345
- ✅ SPEC written (3 minutes)
2346
- └─ @SPEC:EX-TODO-001 TAG assigned
2347
- └─ Clear requirements in EARS format
2348
-
2349
- ✅ TDD implementation (5 minutes)
2350
- └─ 🔴 RED: Tests written first
2351
- └─ 🟢 GREEN: Minimal implementation
2352
- └─ ♻️ REFACTOR: Quality improvement
2353
- └─ @TEST:README-EXAMPLE-TODO, @CODE:EX-TODO-001 TAGs assigned
2354
- └─ 87% coverage, TRUST 5 principles verified
2355
-
2356
- ✅ Documentation sync (1 minute)
2357
- └─ Living Document auto-generated
2358
- └─ README, CHANGELOG updated
2359
- └─ TAG chain validation complete
2360
- └─ @DOC:EX-TODO-001 TAG assigned
2361
- └─ PR status: Draft → Ready for Review
2362
-
2363
- Result:
2364
- - 📋 Clear SPEC (SPEC-TODO-001.md)
2365
- - 🧪 85%+ test coverage (test_todo_api.py)
2366
- - 💎 Production-quality code (src/todo/)
2367
- - 📖 Auto-generated API documentation (docs/api/todo.md)
2368
- - 📝 Change history tracking (CHANGELOG.md)
2369
- - 🔗 Everything connected with TAGs
2370
- ```
2371
-
2372
- > **This is MoAI-ADK's true power.** Not just a simple API implementation,
2373
- > but a **complete development artifact** with everything from SPEC through tests, code, and documentation consistently connected!
2374
-
2375
- ---
2376
-
2377
- ## Sub-agents & Skills Overview
2378
-
2379
- Alfred works by combining multiple specialized agents with Claude Skills.
2380
-
2381
- ### Core Sub-agents (Plan → Run → Sync)
2382
-
2383
- | Sub-agent | Model | Role |
2384
- | ------------------ | ------ | ----------------------------------------------------------------------- |
2385
- | project-manager 📋 | Sonnet | Project initialization, metadata interviews |
2386
- | spec-builder 🏗️ | Sonnet | Plan board, EARS SPEC authoring, expert consultation recommendations |
2387
- | code-builder 💎 | Sonnet | Performs complete TDD with `implementation-planner` + `tdd-implementer` |
2388
- | doc-syncer 📖 | Haiku | Living Doc, README, CHANGELOG sync |
2389
- | tag-agent 🏷️ | Haiku | TAG inventory, orphan detection, @EXPERT TAG validation |
2390
- | git-manager 🚀 | Haiku | GitFlow, Draft/Ready, Auto Merge |
2391
- | debug-helper 🔍 | Sonnet | Failure analysis, fix-forward strategy |
2392
- | trust-checker ✅ | Haiku | TRUST 5 quality gate |
2393
- | quality-gate 🛡️ | Haiku | Coverage change and release blocker review |
2394
- | cc-manager 🛠️ | Sonnet | Claude Code session optimization, Skill deployment |
2395
-
2396
- ### Expert Agents (Proactively Triggered by SPEC Keywords)
2397
-
2398
- Expert agents activate automatically when `implementation-planner` detects domain-specific keywords in SPEC documents. They provide architecture guidance, technology recommendations, and risk analysis for their specialized domains.
2399
-
2400
- | Expert Agent | Model | Specialty | Auto-Trigger Keywords |
2401
- | ----------------- | ------ | --------------------------------------------------- | ------------------------------------------------------------------------ |
2402
- | backend-expert 🔧 | Sonnet | Backend architecture, API design, database, auth | 'backend', 'api', 'server', 'database', 'deployment', 'authentication' |
2403
- | frontend-expert 💻| Sonnet | Frontend architecture, components, state mgmt | 'frontend', 'ui', 'page', 'component', 'client-side', 'web interface' |
2404
- | devops-expert 🚀 | Sonnet | DevOps, CI/CD, deployment, containerization | 'deployment', 'docker', 'kubernetes', 'ci/cd', 'pipeline', 'aws' |
2405
- | ui-ux-expert 🎨 | Sonnet | UI/UX design, accessibility (WCAG), design systems | 'design', 'ux', 'accessibility', 'a11y', 'figma', 'design system' |
2406
-
2407
- **How It Works**:
2408
- - When `/alfred:2-run` starts, `implementation-planner` scans the SPEC content
2409
- - Matching keywords trigger automatic expert agent invocation
2410
- - Experts provide domain-specific architecture guidance
2411
- - All expert consultations are tagged with `@EXPERT:DOMAIN` for traceability
2412
-
2413
- ### Skills (Progressive Disclosure - v0.4 New!)
2414
-
2415
- Alfred organizes Claude Skills in a 4-tier architecture using **Progressive Disclosure** to load Just-In-Time only when needed. Each Skill is a production-grade guide stored in `.claude/skills/` directory.
2416
-
2417
- #### Foundation Tier
2418
-
2419
- Core skills containing fundamental TRUST/TAG/SPEC/Git/EARS/Language principles
2420
-
2421
- | Skill | Description |
2422
- | ----------------------- | ---------------------------------------------------------------------------------- |
2423
- | `moai-foundation-trust` | TRUST 5-principles (Test 85%+, Readable, Unified, Secured, Trackable) verification |
2424
- | `moai-foundation-tags` | @TAG markers scan and inventory generation (CODE-FIRST principle) |
2425
- | `moai-foundation-specs` | SPEC YAML frontmatter validation and HISTORY section management |
2426
- | `moai-foundation-ears` | EARS (Easy Approach to Requirements Syntax) requirements writing guide |
2427
- | `moai-foundation-git` | Git workflow automation (branching, TDD commits, PR management) |
2428
- | `moai-foundation-langs` | Project language/framework auto-detection (package.json, pyproject.toml, etc.) |
2429
-
2430
- #### Essentials Tier
2431
-
2432
- Core tools needed for daily development work
2433
-
2434
- | Skill | Description |
2435
- | -------------------------- | ---------------------------------------------------------------------- |
2436
- | `moai-essentials-debug` | Stack trace analysis, error pattern detection, quick diagnosis support |
2437
- | `moai-essentials-perf` | Performance profiling, bottleneck detection, tuning strategies |
2438
- | `moai-essentials-refactor` | Refactoring guide, design patterns, code improvement strategies |
2439
- | `moai-essentials-review` | Automated code review, SOLID principles, code smell detection |
2440
-
2441
- #### Alfred Tier
2442
-
2443
- MoAI-ADK internal workflow orchestration skills
2444
-
2445
- | Skill | Description |
2446
- | -------------------------------------- | ------------------------------------------------------------------------- |
2447
- | `moai-alfred-ears-authoring` | EARS syntax validation and requirement pattern guidance |
2448
- | `moai-alfred-git-workflow` | MoAI-ADK conventions (feature branch, TDD commits, Draft PR) automation |
2449
- | `moai-alfred-language-detection` | Project language/runtime detection and test tool recommendations |
2450
- | `moai-alfred-spec-metadata-validation` | SPEC YAML frontmatter and HISTORY section consistency validation |
2451
- | `moai-alfred-tag-scanning` | Complete @TAG marker scan and inventory generation (CODE-FIRST principle) |
2452
- | `moai-alfred-trust-validation` | TRUST 5-principles compliance verification |
2453
- | `moai-alfred-interactive-questions` | Claude Code Tools AskUserQuestion TUI menu standardization |
2454
-
2455
- #### Domain Tier
2456
-
2457
- Specialized domain expertise
2458
-
2459
- | Skill | Description |
2460
- | -------------------------- | ---------------------------------------------------------------------------------------- |
2461
- | `moai-domain-backend` | Backend architecture, API design, scaling guide |
2462
- | `moai-domain-cli-tool` | CLI tool development, argument parsing, POSIX compliance, user-friendly help messages |
2463
- | `moai-domain-data-science` | Data analysis, visualization, statistical modeling, reproducible research workflows |
2464
- | `moai-domain-database` | Database design, schema optimization, indexing strategies, migration management |
2465
- | `moai-domain-design-systems` | Design system architecture, W3C DTCG tokens, WCAG 2.2 accessibility, design-to-code, Figma MCP |
2466
- | `moai-domain-devops` | CI/CD pipelines, Docker containerization, Kubernetes orchestration, IaC |
2467
- | `moai-domain-frontend` | React/Vue/Angular development, state management, performance optimization, accessibility |
2468
- | `moai-domain-ml` | Machine learning model training, evaluation, deployment, MLOps workflows |
2469
- | `moai-domain-mobile-app` | Flutter/React Native development, state management, native integration |
2470
- | `moai-domain-security` | OWASP Top 10, static analysis (SAST), dependency security, secrets management |
2471
- | `moai-domain-web-api` | REST API, GraphQL design patterns, authentication, versioning, OpenAPI documentation |
2472
-
2473
- #### Language Tier
2474
-
2475
- Programming language-specific best practices
2476
-
2477
- | Skill | Description |
2478
- | ---------------------- | --------------------------------------------------------- |
2479
- | `moai-lang-python` | pytest, mypy, ruff, black, uv package management |
2480
- | `moai-lang-typescript` | Vitest, Biome, strict typing, npm/pnpm |
2481
- | `moai-lang-javascript` | Jest, ESLint, Prettier, npm package management |
2482
- | `moai-lang-go` | go test, golint, gofmt, standard library |
2483
- | `moai-lang-rust` | cargo test, clippy, rustfmt, ownership/borrow checker |
2484
- | `moai-lang-java` | JUnit, Maven/Gradle, Checkstyle, Spring Boot patterns |
2485
- | `moai-lang-kotlin` | JUnit, Gradle, ktlint, coroutines, extension functions |
2486
- | `moai-lang-swift` | XCTest, SwiftLint, iOS/macOS development patterns |
2487
- | `moai-lang-dart` | flutter test, dart analyze, Flutter widget patterns |
2488
- | `moai-lang-csharp` | xUnit, .NET tooling, LINQ, async/await patterns |
2489
- | `moai-lang-cpp` | Google Test, clang-format, modern C++ (C++17/20) |
2490
- | `moai-lang-c` | Unity test framework, cppcheck, Make build system |
2491
- | `moai-lang-scala` | ScalaTest, sbt, functional programming patterns |
2492
- | `moai-lang-ruby` | RSpec, RuboCop, Bundler, Rails patterns |
2493
- | `moai-lang-php` | PHPUnit, Composer, PSR standards |
2494
- | `moai-lang-sql` | Test frameworks, query optimization, migration management |
2495
- | `moai-lang-shell` | bats, shellcheck, POSIX compliance |
2496
- | `moai-lang-r` | testthat, lintr, data analysis patterns |
2497
-
2498
- #### Claude Code Ops
2499
-
2500
- Claude Code session management
2501
-
2502
- | Skill | Description |
2503
- | ------------------ | ---------------------------------------------------------------------------------- |
2504
- | `moai-claude-code` | Claude Code agents, commands, skills, plugins, settings scaffolding and monitoring |
2505
-
2506
- > **v0.4.6 New Feature**: Claude Skills organized in 4-tier architecture (100% complete in v0.4.6). Each Skill loads via Progressive Disclosure only when needed to minimize context cost. Organized in Foundation → Essentials → Alfred → Domain/Language/Ops tiers, with all skills including production-grade documentation and executable TDD examples.
2507
-
2508
- ---
2509
-
2510
- ## AI Model Selection Guide
2511
-
2512
- | Scenario | Default Model | Why |
2513
- | ---------------------------------------------------- | --------------------- | ----------------------------------------------- |
2514
- | Specifications, design, refactoring, problem solving | **Claude 4.5 Sonnet** | Strong in deep reasoning and structured writing |
2515
- | Document sync, TAG checks, Git automation | **Claude 4.5 Haiku** | Strong in rapid iteration, string processing |
2516
-
2517
- - Start with Haiku for patterned tasks; switch to Sonnet when complex judgment is needed.
2518
- - If you manually change models, noting "why switched" in logs helps collaboration.
2519
-
2520
- ---
2521
-
2522
- ## Claude Code Hooks Guide
2523
-
2524
- MoAI-ADK provides 4 main **Claude Code Hooks** that seamlessly integrate with your development workflow. These hooks enable automatic checkpoints, JIT context loading, and session monitoring—all happening transparently in the background.
2525
-
2526
- ### What Are Hooks?
2527
-
2528
- Hooks are **event-driven** scripts that trigger automatically at specific points in your Claude Code session. Think of them as safety guardrails and productivity boosters that work behind the scenes without interrupting your flow.
2529
-
2530
- ### Installed Hooks
2531
-
2532
- #### 1. SessionStart (Session Initialization)
2533
-
2534
- **Triggers**: When you start a Claude Code session in your project
2535
- **Purpose**: Display project status at a glance
2536
-
2537
- **What You See**:
2538
-
2539
- ```
2540
- 🚀 MoAI-ADK Session Started
2541
- Language: Python
2542
- Branch: develop
2543
- Changes: 2 files
2544
- SPEC Progress: 12/25 (48%)
2545
- ```
2546
-
2547
- **Why It Matters**: Instantly understand your project's current state without running multiple commands.
2548
-
2549
- #### 2. PreToolUse (Before Tool Execution)
2550
-
2551
- **Triggers**: Before executing file edits, Bash commands, or MultiEdit operations
2552
- **Purpose**: Detect risky operations and automatically create safety checkpoints + TAG Guard
2553
-
2554
- **Protection Against**:
2555
-
2556
- - `rm -rf` (file deletion)
2557
- - `git merge`, `git reset --hard` (Git dangerous operations)
2558
- - Editing critical files (`CLAUDE.md`, `config.json`)
2559
- - Mass edits (10+ files at once via MultiEdit)
2560
-
2561
- **TAG Guard**:
2562
- Automatically detects missing @TAG annotations in changed files:
2563
-
2564
- - Scans staged, modified, and untracked files
2565
- - Warns when SPEC/TEST/CODE/DOC files lack required @TAG markers
2566
- - Configurable rules via `.moai/tag-rules.json`
2567
- - Non-blocking (gentle reminder, doesn't stop execution)
2568
-
2569
- **What You See**:
2570
-
2571
- ```
2572
- 🛡️ Checkpoint created: before-delete-20251023-143000
2573
- Operation: delete
2574
- ```
2575
-
2576
- Or when TAGs are missing:
2577
-
2578
- ```
2579
- ⚠️ TAG 누락 감지: 생성/수정한 파일 중 @TAG가 없는 항목이 있습니다.
2580
- - src/auth/service.py → 기대 태그: @CODE:
2581
- - tests/test_auth.py → 기대 태그: @TEST:
2582
- 권장 조치:
2583
- 1) SPEC/TEST/CODE/DOC 유형에 맞는 @TAG를 파일 상단 주석이나 헤더에 추가
2584
- 2) rg로 확인: rg '@(SPEC|TEST|CODE|DOC):' -n <경로>
2585
- ```
2586
-
2587
- **Why It Matters**: Prevents data loss from mistakes and ensures @TAG traceability. You can always restore from the checkpoint if something goes wrong.
2588
-
2589
- #### 3. UserPromptSubmit (Prompt Input)
2590
-
2591
- **Triggers**: When you submit a prompt to Claude
2592
- **Purpose**: JIT (Just-In-Time) context loading—automatically add relevant files
2593
-
2594
- **How It Works**:
2595
-
2596
- - You type: "Fix AUTH bug"
2597
- - Hook scans for AUTH-related files
2598
- - Auto-loads: SPEC, tests, implementation, docs related to AUTH
2599
- - Claude receives full context without you manually specifying files
2600
-
2601
- **Why It Matters**: Saves time and ensures Claude has all the relevant context for your request.
2602
-
2603
- #### 4. SessionEnd (Session Cleanup)
2604
-
2605
- **Triggers**: When you close your Claude Code session
2606
- **Purpose**: Cleanup tasks and state preservation
2607
-
2608
- **Why It Matters**: Ensures clean session transitions and proper state management.
2609
-
2610
- ### Technical Details
2611
-
2612
- - **Location**: `.claude/hooks/alfred/`
2613
- - **Environment Variable**: `$CLAUDE_PROJECT_DIR` (dynamically references project root)
2614
- - **Performance**: Each hook executes in <100ms
2615
- - **Logging**: Errors output to stderr (stdout reserved for JSON payloads)
2616
-
2617
- ### How to Disable Hooks
2618
-
2619
- If you need to temporarily disable hooks, edit `.claude/settings.json`:
2620
-
2621
- ```json
2622
- {
2623
- "hooks": {
2624
- "SessionStart": [], // Disabled
2625
- "PreToolUse": [...] // Still active
2626
- }
2627
- }
2628
- ```
2629
-
2630
- ### Troubleshooting
2631
-
2632
- **Problem: Hook doesn't execute**
2633
-
2634
- - ✅ Verify `.claude/settings.json` is properly configured
2635
- - ✅ Check `uv` is installed: `which uv`
2636
- - ✅ Ensure hook script has execute permissions: `chmod +x .claude/hooks/alfred/alfred_hooks.py`
2637
-
2638
- **Problem: Performance degradation**
2639
-
2640
- - ✅ Check if any hook exceeds 100ms execution time
2641
- - ✅ Disable unnecessary hooks
2642
- - ✅ Review error messages in stderr output
2643
-
2644
- **Problem: Too many checkpoints created**
2645
-
2646
- - ✅ Review PreToolUse trigger conditions
2647
- - ✅ Adjust detection thresholds in `core/checkpoint.py` if needed
2648
-
2649
- ### Installed Hooks (5 total)
2650
-
2651
- | Hook | Status | Feature |
2652
- | -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
2653
- | **SessionStart** | ✅ Active | Project status summary (language, Git, SPEC progress, checkpoints) |
2654
- | **PreToolUse** | ✅ Active | Risk detection + auto checkpoint (critical-delete, delete, merge, script) + **TAG Guard** (missing @TAG detection) |
2655
- | **UserPromptSubmit** | ✅ Active | JIT context loading (auto-load related SPEC, tests, code, docs) |
2656
- | **PostToolUse** | ✅ Active | Auto-run tests after code changes (9 languages: Python, TS, JS, Go, Rust, Java, Kotlin, Swift, Dart) |
2657
- | **SessionEnd** | ✅ Active | Session cleanup and state saving |
2658
-
2659
- ### Future Enhancements
2660
-
2661
- - **Notification**: Important event alerts (logging, notifications)
2662
- - **Stop/SubagentStop**: Cleanup when agents terminate
2663
- - Advanced security: `dd` commands, supply chain checks
2664
-
2665
- ### Learn More
2666
-
2667
- - Comprehensive analysis: `.moai/reports/hooks-analysis-and-implementation.md`
2668
- - PostToolUse implementation: `.moai/reports/phase3-posttool-implementation-complete.md`
2669
- - Security enhancements: `.moai/reports/security-enhancement-critical-delete.md`
2670
- - Hook implementation: `.claude/hooks/alfred/`
2671
- - Hook tests: `tests/hooks/`
2672
-
2673
- ---
2674
-
2675
- ## Frequently Asked Questions (FAQ)
2676
-
2677
- - **Q. Can I install on an existing project?**
2678
- - A. Yes. Run `moai-adk init .` to add only the `.moai/` structure without touching existing code.
2679
- - **Q. How do I run tests?**
2680
- - A. `/alfred:2-run` runs them first; rerun `pytest`, `pnpm test`, etc. per language as needed.
2681
- - **Q. How do I ensure documentation stays current?**
2682
- - A. `/alfred:3-sync` generates a Sync Report. Check the report in Pull Requests.
2683
- - **Q. Can I work manually?**
2684
- - A. Yes, but keep the SPEC → TEST → CODE → DOC order and always leave TAGs.
2685
-
2686
- ---
2687
-
2688
- ## Latest Updates (New!)
2689
-
2690
- | Version | Key Features | Date |
2691
- | ----------- | ------------------------------------------------------------------------------------------------ | ---------- |
2692
- | **v0.8.2** | 📖 EARS terminology update: "Constraints" → "Unwanted Behaviors" for clarity | 2025-10-29 |
2693
- | **v0.8.1** | 🔄 Command rename: `/alfred:9-help` → `/alfred:9-feedback` + User feedback workflow improvements | 2025-10-28 |
2694
- | **v0.8.0** | 🏷️ @DOC TAG auto-generation system + SessionStart version check enhancement | 2025-10-27 |
2695
- | **v0.7.0** | 🌍 Complete language localization system (English, Korean, Japanese, Chinese, Spanish) | 2025-10-26 |
2696
- | **v0.6.3** | ⚡ 3-Stage update workflow: 70-80% performance improvement via parallel operations | 2025-10-25 |
2697
- | **v0.6.0** | 🏗️ Major architecture refactor + Enhanced SPEC metadata structure (7 required + 9 optional) | 2025-10-24 |
2698
- | **v0.5.7** | 🎯 SPEC → GitHub Issue automation + CodeRabbit integration + Auto PR comments | 2025-10-27 |
2699
- | **v0.4.11** | ✨ TAG Guard system + CLAUDE.md formatting improvements + Code cleanup | 2025-10-23 |
2700
-
2701
- > 📦 **Install Now**: `uv tool install moai-adk` or `pip install moai-adk`
2702
-
2703
- ---
2704
-
2705
- ## 🔧 Beginner's Troubleshooting Guide
2706
-
2707
- Common errors and solutions for getting started with MoAI-ADK.
2708
-
2709
- ### 1. uv is Not Installed
2710
-
2711
- **Symptom**:
2712
- ```bash
2713
- $ uv --version
2714
- bash: uv: command not found
2715
- ```
2716
-
2717
- **Cause**: uv not installed or not in PATH
2718
-
2719
- **Solution**:
2720
-
2721
- **macOS/Linux**:
2722
- ```bash
2723
- # Install
2724
- curl -LsSf https://astral.sh/uv/install.sh | sh
2725
-
2726
- # Restart shell
2727
- source ~/.bashrc # or ~/.zshrc
2728
-
2729
- # Verify
2730
- uv --version
2731
- ```
2732
-
2733
- **Windows (PowerShell)**:
2734
- ```powershell
2735
- powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
2736
-
2737
- # Verify
2738
- uv --version
2739
- ```
2740
-
2741
- **If still not working**:
2742
- ```bash
2743
- # Manually add PATH (macOS/Linux)
2744
- export PATH="$HOME/.cargo/bin:$PATH"
2745
-
2746
- # Verify
2747
- uv --version
2748
- ```
2749
-
2750
- ---
2751
-
2752
- ### 2. Python Version Mismatch
2753
-
2754
- **Symptom**:
2755
- ```
2756
- Python 3.8 found, but 3.13+ required
2757
- ```
2758
-
2759
- **Cause**: Python version is less than 3.13
2760
-
2761
- **Solution**:
2762
-
2763
- **Option A: Using pyenv (Recommended)**:
2764
- ```bash
2765
- # Install pyenv
2766
- curl https://pyenv.run | bash
2767
-
2768
- # Install Python 3.13
2769
- pyenv install 3.13
2770
- pyenv global 3.13
2771
-
2772
- # Verify
2773
- python --version # Python 3.13.x
2774
- ```
2775
-
2776
- **Option B: Let uv manage Python**:
2777
- ```bash
2778
- # uv automatically downloads Python 3.13
2779
- uv python install 3.13
2780
- uv python pin 3.13
2781
-
2782
- # Verify
2783
- python --version
2784
- ```
2785
-
2786
- ---
2787
-
2788
- ### 3. Git Not Found
2789
-
2790
- **Symptom**:
2791
- ```
2792
- ✗ Git (runtime): not found
2793
- ```
2794
-
2795
- **Cause**: Git not installed on system
2796
-
2797
- **Solution**:
2798
-
2799
- **macOS**:
2800
- ```bash
2801
- # Using Homebrew
2802
- brew install git
2803
-
2804
- # Or install Xcode Command Line Tools
2805
- xcode-select --install
2806
- ```
2807
-
2808
- **Ubuntu/Debian**:
2809
- ```bash
2810
- sudo apt update
2811
- sudo apt install git -y
2812
- ```
2813
-
2814
- **Windows**:
2815
- ```powershell
2816
- # Using winget
2817
- winget install Git.Git
2818
-
2819
- # Or download from https://git-scm.com/download/win
2820
- ```
2821
-
2822
- **Verify**:
2823
- ```bash
2824
- git --version # git version 2.x.x
2825
- ```
2826
-
2827
- ---
2828
-
2829
- ### 4. Claude Code Doesn't Recognize .moai/ Folder
2830
-
2831
- **Symptom**:
2832
- ```
2833
- "Project not initialized"
2834
- /alfred:0-project command doesn't work
2835
- ```
2836
-
2837
- **Cause**: `.moai/` or `.claude/` folders missing or corrupted
2838
-
2839
- **Solution**:
2840
-
2841
- ```bash
2842
- # 1. Verify current directory
2843
- pwd # /path/to/your-project
2844
-
2845
- # 2. Check if .moai/ exists
2846
- ls -la .moai/config.json
2847
-
2848
- # 3. If missing, reinitialize
2849
- moai-adk init .
2850
-
2851
- # 4. Restart Claude Code
2852
- exit # Exit Claude Code
2853
- claude # Restart
2854
- ```
2855
-
2856
- **Verify**:
2857
- ```bash
2858
- moai-adk doctor
2859
- # All items should show ✅
2860
- ```
2861
-
2862
- ---
2863
-
2864
- ### 5. Module Not Found When Running Tests
2865
-
2866
- **Symptom**:
2867
- ```
2868
- FAILED tests/test_hello.py - ModuleNotFoundError: No module named 'fastapi'
2869
- ```
2870
-
2871
- **Cause**: Required package not installed
2872
-
2873
- **Solution**:
2874
-
2875
- ```bash
2876
- # Install dependencies from project root
2877
- uv sync
2878
-
2879
- # Or install specific packages
2880
- uv add fastapi pytest
2881
-
2882
- # Activate virtual environment
2883
- source .venv/bin/activate # macOS/Linux
2884
- .venv\Scripts\activate # Windows
2885
-
2886
- # Run tests
2887
- pytest tests/ -v
2888
- ```
2889
-
2890
- ---
2891
-
2892
- ### 6. `/alfred` Commands Not Working
2893
-
2894
- **Symptom**:
2895
- ```
2896
- Unknown command: /alfred:1-plan
2897
- ```
2898
-
2899
- **Cause**: Claude Code version issue or `.claude/` folder corrupted
2900
-
2901
- **Solution**:
2902
-
2903
- ```bash
2904
- # 1. Check Claude Code version (need v1.5.0+)
2905
- claude --version
2906
-
2907
- # 2. Verify .claude/ folder
2908
- ls -la .claude/commands/
2909
-
2910
- # 3. Reinitialize if needed
2911
- moai-adk init .
2912
-
2913
- # 4. Restart Claude Code
2914
- exit
2915
- claude
2916
- ```
2917
-
2918
- ---
2919
-
2920
- ### 7. TAG Chain Broken
2921
-
2922
- **Symptom**:
2923
- ```
2924
- ⚠ Orphan TAG detected: @TEST:EX-HELLO-001 (no matching @SPEC)
2925
- ```
2926
-
2927
- **Cause**: SPEC deleted or TAGs don't match
2928
-
2929
- **Solution**:
2930
-
2931
- ```bash
2932
- # 1. Validate TAG chain
2933
- rg '@(SPEC|TEST|CODE):HELLO-001' -n
2934
-
2935
- # 2. Check if SPEC exists
2936
- rg '@SPEC:EX-HELLO-001' -n .moai/specs/
2937
-
2938
- # 3. If SPEC missing, regenerate
2939
- /alfred:1-plan "feature description"
2940
-
2941
- # Or fix TAG in test file
2942
- # Edit tests/test_hello.py: @TEST:EX-HELLO-001 → @TEST:README-EXAMPLE-HELLO
2943
-
2944
- # 4. Sync
2945
- /alfred:3-sync
2946
- ```
2947
-
2948
- ---
2949
-
2950
- ### 8. General Debugging Commands
2951
-
2952
- **Check System Status**:
2953
- ```bash
2954
- moai-adk doctor
2955
- ```
2956
- Shows all dependency checks + recommendations
2957
-
2958
- **Check Project Structure**:
2959
- ```bash
2960
- tree -L 2 .moai/
2961
- ```
2962
-
2963
- **Validate TAG Chain Integrity**:
2964
- ```bash
2965
- rg '@(SPEC|TEST|CODE|DOC):' -n | wc -l
2966
- ```
2967
- Shows total TAG count
2968
-
2969
- **Check Git Status**:
2970
- ```bash
2971
- git status
2972
- git log --oneline -5
2973
- ```
2974
-
2975
- ---
2976
-
2977
- ### Debugging Checklist
2978
-
2979
- When something goes wrong:
2980
-
2981
- 1. **Read**: Copy the complete error message
2982
- 2. **Search**: Check GitHub Issues for similar errors
2983
- 3. **Diagnose**: Run `moai-adk doctor`
2984
- 4. **Restart**: Quit and restart Claude Code
2985
- 5. **Ask**: Post in GitHub Discussions
2986
-
2987
- Quick diagnosis with details:
2988
- ```bash
2989
- moai-adk doctor --verbose
2990
- ```
2991
-
2992
- ---
2993
-
2994
- ### Need More Help?
2995
-
2996
- - **GitHub Issues**: Search for similar problems
2997
- - **GitHub Discussions**: Ask questions
2998
- - **Discord Community**: Real-time chat support
2999
-
3000
- **When reporting issues, include**:
3001
- 1. Output from `moai-adk doctor --verbose`
3002
- 2. Complete error message (screenshot or text)
3003
- 3. Steps to reproduce
3004
- 4. Your OS and version
3005
-
3006
- ---
3007
-
3008
- ### Frequently Asked Questions
3009
-
3010
- **Q. Can I install on an existing project?**
3011
- A. Yes! Run `moai-adk init .` - it only adds `.moai/` structure without touching existing code.
3012
-
3013
- **Q. How do I run tests?**
3014
- A. `/alfred:2-run` runs tests first. You can also run `pytest`, `pnpm test` separately.
3015
-
3016
- **Q. How do I verify documentation is current?**
3017
- A. Run `/alfred:3-sync` which generates a Sync Report. Check the PR to see the report.
3018
-
3019
- **Q. Can I do this manually without Alfred?**
3020
- A. Possible, but remember: SPEC → TEST → CODE → DOC order and keep @TAGs updated.
3021
-
3022
- ---
3023
-
3024
- ## Additional Resources
3025
-
3026
- | Purpose | Resource |
3027
- | ------------------------- | --------------------------------------------------------------- |
3028
- | Skills detailed structure | `.claude/skills/` directory (74 Skills) |
3029
- | Sub-agent details | `.claude/agents/alfred/` directory (16 agents + 4 commands) |
3030
- | Workflow guide | `.claude/commands/alfred/` (4 commands: 0-project ~ 3-sync) |
3031
- | Documentation | Coming soon (see `.moai/`, `.claude/`, `docs/` in your project) |
3032
- | Release notes | GitHub Releases: https://github.com/modu-ai/moai-adk/releases |
3033
-
3034
- ---
3035
-
3036
- ## Community & Support
3037
-
3038
- | Channel | Link |
3039
- | ------------------------ | -------------------------------------------------------- |
3040
- | **GitHub Repository** | https://github.com/modu-ai/moai-adk |
3041
- | **Issues & Discussions** | https://github.com/modu-ai/moai-adk/issues |
3042
- | **PyPI Package** | https://pypi.org/project/moai-adk/ |
3043
- | **Latest Release** | https://github.com/modu-ai/moai-adk/releases |
3044
- | **Documentation** | See `.moai/`, `.claude/`, `docs/` within project |
3045
-
3046
- ---
3047
-
3048
- ## 🚀 MoAI-ADK Philosophy
3049
-
3050
- > **"No CODE without SPEC"**
3051
-
3052
- MoAI-ADK is not simply a code generation tool. Alfred SuperAgent with its 19-member team and 55+ Claude Skills together guarantee:
3053
-
3054
- - ✅ **SPEC → TEST (TDD) → CODE → DOCS consistency**
3055
- - ✅ **Complete history tracking with @TAG system**
3056
- - ✅ **Guaranteed 87.84%+ coverage**
3057
- - ✅ **Iterative development with 4-stage workflow (0-project → 1-plan → 2-run → 3-sync)**
3058
- - ✅ **Collaborate with AI transparently and traceably**
3059
-
3060
- Start a new experience of **trustworthy AI development** with Alfred! 🤖
3061
-
3062
- ---
3063
-
3064
- **MoAI-ADK** — SPEC-First TDD with AI SuperAgent & Complete Skills + TAG Guard
3065
-
3066
- - 📦 PyPI: https://pypi.org/project/moai-adk/
3067
- - 🏠 GitHub: https://github.com/modu-ai/moai-adk
3068
- - 📝 License: MIT
3069
- - ⭐ Skills: 55+ Production-Ready Guides
3070
- - ✅ Tests: 467/476 Passing (85.60% coverage)
3071
- - 🏷️ TAG Guard: Automatic @TAG validation in PreToolUse Hook
3072
-
3073
- ---
3074
-
3075
- ## ⭐ Star History
3076
-
3077
- [![Star History Chart](https://api.star-history.com/svg?repos=modu-ai/moai-adk&type=date&legend=top-left)](https://www.star-history.com/#modu-ai/moai-adk&Date)
3078
-
3079
- ---