moai-adk 0.8.0__py3-none-any.whl → 0.15.0__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (207) hide show
  1. moai_adk/cli/commands/init.py +14 -2
  2. moai_adk/cli/commands/update.py +229 -60
  3. moai_adk/core/config/migration.py +1 -1
  4. moai_adk/core/issue_creator.py +313 -0
  5. moai_adk/core/project/detector.py +201 -12
  6. moai_adk/core/project/initializer.py +62 -1
  7. moai_adk/core/project/phase_executor.py +48 -6
  8. moai_adk/core/tags/__init__.py +86 -0
  9. moai_adk/core/tags/ci_validator.py +463 -0
  10. moai_adk/core/tags/cli.py +283 -0
  11. moai_adk/core/tags/generator.py +109 -0
  12. moai_adk/core/tags/inserter.py +99 -0
  13. moai_adk/core/tags/mapper.py +126 -0
  14. moai_adk/core/tags/parser.py +76 -0
  15. moai_adk/core/tags/pre_commit_validator.py +393 -0
  16. moai_adk/core/tags/reporter.py +956 -0
  17. moai_adk/core/tags/tags.py +149 -0
  18. moai_adk/core/tags/validator.py +897 -0
  19. moai_adk/core/template_engine.py +268 -0
  20. moai_adk/templates/.claude/agents/alfred/backend-expert.md +319 -0
  21. moai_adk/templates/.claude/agents/alfred/cc-manager.md +25 -2
  22. moai_adk/templates/.claude/agents/alfred/debug-helper.md +24 -12
  23. moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
  24. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +20 -13
  25. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
  26. moai_adk/templates/.claude/agents/alfred/git-manager.md +47 -16
  27. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +95 -15
  28. moai_adk/templates/.claude/agents/alfred/project-manager.md +78 -12
  29. moai_adk/templates/.claude/agents/alfred/quality-gate.md +28 -5
  30. moai_adk/templates/.claude/agents/alfred/skill-factory.md +30 -2
  31. moai_adk/templates/.claude/agents/alfred/spec-builder.md +133 -13
  32. moai_adk/templates/.claude/agents/alfred/tag-agent.md +104 -8
  33. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +133 -16
  34. moai_adk/templates/.claude/agents/alfred/trust-checker.md +27 -4
  35. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +571 -0
  36. moai_adk/templates/.claude/commands/alfred/0-project.md +466 -125
  37. moai_adk/templates/.claude/commands/alfred/1-plan.md +208 -71
  38. moai_adk/templates/.claude/commands/alfred/2-run.md +276 -55
  39. moai_adk/templates/.claude/commands/alfred/3-sync.md +439 -53
  40. moai_adk/templates/.claude/commands/alfred/9-feedback.md +149 -0
  41. moai_adk/templates/.claude/hooks/alfred/core/project.py +361 -29
  42. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  43. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  44. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
  45. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +14 -6
  46. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +94 -0
  47. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +100 -0
  48. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +94 -0
  49. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +94 -0
  50. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/__init__.py +2 -2
  51. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/checkpoint.py +3 -3
  52. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/context.py +5 -5
  53. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
  54. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/tags.py +55 -23
  55. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
  56. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
  57. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +154 -0
  58. moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/session.py +28 -15
  59. moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/tool.py +3 -6
  60. moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/user.py +19 -0
  61. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +112 -0
  62. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  63. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
  64. moai_adk/templates/.claude/settings.json +5 -5
  65. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
  67. moai_adk/templates/{.moai/memory/CLAUDE-AGENTS-GUIDE.md → .claude/skills/moai-alfred-agent-guide/reference.md} +34 -0
  68. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +56 -0
  69. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
  70. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
  71. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
  72. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
  73. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
  74. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
  75. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
  76. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
  77. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
  78. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
  79. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +74 -0
  80. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +4 -0
  81. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +269 -0
  82. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +19 -0
  83. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
  84. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +150 -0
  85. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +198 -0
  86. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +431 -0
  87. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +141 -0
  88. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
  89. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
  90. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
  91. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
  92. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
  93. moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +273 -0
  94. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
  95. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
  96. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +19 -0
  97. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
  98. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
  99. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +137 -0
  100. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +219 -0
  101. moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples/validate-spec.sh +3 -3
  102. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +541 -0
  103. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +622 -0
  104. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +115 -0
  105. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +4 -0
  106. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +348 -0
  107. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
  108. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
  109. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
  110. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
  111. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +19 -0
  112. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +4 -0
  113. moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL.md +3 -3
  114. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
  115. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
  116. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
  117. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +17 -13
  118. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +9 -6
  119. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +15 -12
  120. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +14 -12
  121. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +14 -11
  122. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +10 -8
  123. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +15 -12
  124. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +13 -11
  125. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +16 -10
  126. moai_adk/templates/.claude/skills/moai-project-documentation.md +622 -0
  127. moai_adk/templates/.git-hooks/pre-push +143 -0
  128. moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
  129. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
  130. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
  131. moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
  132. moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
  133. moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
  134. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
  135. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
  136. moai_adk/templates/.github/workflows/moai-gitflow.yml +166 -3
  137. moai_adk/templates/.github/workflows/moai-release-create.yml +100 -0
  138. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +188 -0
  139. moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
  140. moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
  141. moai_adk/templates/.github/workflows/release.yml +118 -0
  142. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
  143. moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
  144. moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
  145. moai_adk/templates/.github/workflows/spec-issue-sync.yml +206 -35
  146. moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
  147. moai_adk/templates/.github/workflows/tag-report.yml +269 -0
  148. moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
  149. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
  150. moai_adk/templates/.moai/config.json +21 -2
  151. moai_adk/templates/CLAUDE.md +972 -78
  152. moai_adk/templates/workflows/go-tag-validation.yml +30 -0
  153. moai_adk/templates/workflows/javascript-tag-validation.yml +41 -0
  154. moai_adk/templates/workflows/python-tag-validation.yml +42 -0
  155. moai_adk/templates/workflows/typescript-tag-validation.yml +31 -0
  156. moai_adk/utils/banner.py +5 -5
  157. {moai_adk-0.8.0.dist-info → moai_adk-0.15.0.dist-info}/METADATA +1518 -161
  158. {moai_adk-0.8.0.dist-info → moai_adk-0.15.0.dist-info}/RECORD +183 -100
  159. moai_adk/templates/.claude/hooks/alfred/HOOK_SCHEMA_VALIDATION.md +0 -313
  160. moai_adk/templates/.claude/hooks/alfred/README.md +0 -230
  161. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -174
  162. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +0 -25
  163. moai_adk/templates/.claude/hooks/alfred/test_hook_output.py +0 -175
  164. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -640
  165. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -696
  166. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -474
  167. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +0 -137
  168. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +0 -218
  169. moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +0 -541
  170. moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +0 -622
  171. moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +0 -176
  172. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
  173. moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +0 -344
  174. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
  175. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  176. moai_adk/templates/.moai/memory/config-schema.md +0 -444
  177. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -220
  178. moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
  179. moai_adk/templates/.moai/project/product.md +0 -161
  180. moai_adk/templates/.moai/project/structure.md +0 -156
  181. moai_adk/templates/.moai/project/tech.md +0 -227
  182. moai_adk/templates/__init__.py +0 -2
  183. /moai_adk/templates/{.moai/memory/CONFIG-SCHEMA.md → .claude/skills/moai-alfred-config-schema/reference.md} +0 -0
  184. /moai_adk/templates/{.moai/memory/CLAUDE-PRACTICES.md → .claude/skills/moai-alfred-practices/reference.md} +0 -0
  185. /moai_adk/templates/{.moai/memory/CLAUDE-RULES.md → .claude/skills/moai-alfred-rules/reference.md} +0 -0
  186. /moai_adk/templates/{.moai/memory/SKILLS-DESCRIPTION-POLICY.md → .claude/skills/moai-cc-skill-descriptions/reference.md} +0 -0
  187. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/CHECKLIST.md +0 -0
  188. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/EXAMPLES.md +0 -0
  189. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/INTERACTIVE-DISCOVERY.md +0 -0
  190. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/METADATA.md +0 -0
  191. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PARALLEL-ANALYSIS-REPORT.md +0 -0
  192. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PYTHON-VERSION-MATRIX.md +0 -0
  193. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-FACTORY-WORKFLOW.md +0 -0
  194. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-UPDATE-ADVISOR.md +0 -0
  195. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STEP-BY-STEP-GUIDE.md +0 -0
  196. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STRUCTURE.md +0 -0
  197. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/WEB-RESEARCH.md +0 -0
  198. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/reference.md +0 -0
  199. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/generate-structure.sh +0 -0
  200. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/validate-skill.sh +0 -0
  201. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/SKILL_TEMPLATE.md +0 -0
  202. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/examples-template.md +0 -0
  203. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/reference-template.md +0 -0
  204. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/scripts-template.sh +0 -0
  205. {moai_adk-0.8.0.dist-info → moai_adk-0.15.0.dist-info}/WHEEL +0 -0
  206. {moai_adk-0.8.0.dist-info → moai_adk-0.15.0.dist-info}/entry_points.txt +0 -0
  207. {moai_adk-0.8.0.dist-info → moai_adk-0.15.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +1,6 @@
1
1
  ---
2
2
  name: alfred:2-run
3
- description: "Execute planned work (TDD implementation, prototyping, documentation, etc.)"
4
- # Translations:
5
- # - ko: "계획된 작업 실행 (TDD 구현, 프로토타이핑, 문서화 등)"
6
- # - ja: "計画されたタスクの実行(TDD実装、プロトタイピング、ドキュメント作成など)"
7
- # - zh: "执行计划任务(TDD实现、原型开发、文档编写等)"
3
+ description: "Execute TDD implementation cycle"
8
4
  argument-hint: "SPEC-ID - All with SPEC ID to implement (e.g. SPEC-001) or all \"SPEC Implementation\""
9
5
  allowed-tools:
10
6
  - Read
@@ -25,6 +21,12 @@ allowed-tools:
25
21
 
26
22
  # ⚒️ MoAI-ADK Phase 2: Run the plan - Flexible implementation strategy
27
23
  > **Note**: Interactive prompts use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` for TUI selection menus. The skill is loaded on-demand when user interaction is required.
24
+ >
25
+ > **Batched Design**: All AskUserQuestion calls follow batched design principles (1-4 questions per call) to minimize user interaction turns. See CLAUDE.md section "Alfred Command Completion Pattern" for details.
26
+
27
+ <!-- @CODE:ALF-WORKFLOW-002:CMD-RUN -->
28
+
29
+ **4-Step Workflow Integration**: This command implements Step 3 of Alfred's workflow (Task Execution with TodoWrite tracking). See CLAUDE.md for full workflow details.
28
30
 
29
31
  ## 🎯 Command Purpose
30
32
 
@@ -96,51 +98,101 @@ Users can run commands as follows:
96
98
 
97
99
  ## 🔍 STEP 1: SPEC analysis and execution plan establishment
98
100
 
99
- First, the specified SPEC is analyzed to establish an action plan and receive user confirmation.
101
+ STEP 1 consists of **two independent phases** to provide flexible workflow based on task complexity:
102
+
103
+ ### 📋 STEP 1 Workflow Overview
104
+
105
+ ```
106
+ ┌─────────────────────────────────────────────────────────────┐
107
+ │ STEP 1: SPEC Analysis & Planning │
108
+ ├─────────────────────────────────────────────────────────────┤
109
+ │ │
110
+ │ Phase A (OPTIONAL) │
111
+ │ ┌─────────────────────────────────────────┐ │
112
+ │ │ 🔍 Explore Agent │ │
113
+ │ │ • Browse existing codebase │ │
114
+ │ │ • Find similar implementations │ │
115
+ │ │ • Identify patterns & architecture │ │
116
+ │ └─────────────────────────────────────────┘ │
117
+ │ ↓ │
118
+ │ (exploration results) │
119
+ │ ↓ │
120
+ │ Phase B (REQUIRED) │
121
+ │ ┌─────────────────────────────────────────┐ │
122
+ │ │ ⚙️ implementation-planner Agent │ │
123
+ │ │ • Analyze SPEC requirements │ │
124
+ │ │ • Design execution strategy │ │
125
+ │ │ • Create implementation plan │ │
126
+ │ │ • Request user approval │ │
127
+ │ └─────────────────────────────────────────┘ │
128
+ │ ↓ │
129
+ │ (user approval via AskUserQuestion) │
130
+ │ ↓ │
131
+ │ PROCEED TO STEP 2 │
132
+ └─────────────────────────────────────────────────────────────┘
133
+ ```
134
+
135
+ **Key Points**:
136
+ - **Phase A is optional** - Skip if you don't need to explore existing code
137
+ - **Phase B is required** - Always runs to analyze SPEC and create execution plan
138
+ - **Results flow forward** - Exploration results (if any) are passed to implementation-planner
100
139
 
101
- **The implementation-planner agent automatically loads and analyzes the required documents.**
140
+ ---
141
+
142
+ ### 🔍 Phase A: Codebase Exploration (OPTIONAL)
143
+
144
+ **Use the Explore agent when you need to understand existing code before planning.**
145
+
146
+ #### When to use Phase A:
102
147
 
103
- ### 🔍 Browse the code base (recommended)
148
+ - Need to understand existing code structure/patterns
149
+ - ✅ Need to find similar function implementations for reference
150
+ - ✅ Need to understand project architectural rules
151
+ - ✅ Need to check libraries and versions being used
104
152
 
105
- **If you need to understand existing code structure or find similar patterns** Use the Explore agent first:
153
+ #### How to invoke Explore agent:
106
154
 
107
155
  ```
108
156
  Invoking the Task tool (Explore agent):
109
157
  - subagent_type: "Explore"
110
158
  - description: "Explore existing code structures and patterns"
111
- - prompt: "Please explore existing code related to SPEC-$ARGUMENTS:
112
- - Similar function implementation code (src/)
113
- - Test patterns for reference (tests/)
114
- - Architectural patterns and design patterns
115
- - Use Current libraries and versions (package.json, requirements.txt)
116
- thoroughness level: medium"
159
+ - prompt: "SPEC-$ARGUMENTS와 관련된 기존 코드를 탐색해주세요:
160
+ - 유사한 기능 구현 코드 (src/)
161
+ - 참고할 테스트 패턴 (tests/)
162
+ - 아키텍처 패턴 디자인 패턴
163
+ - 현재 라이브러리 버전 (package.json, requirements.txt)
164
+ 상세도 수준: medium"
117
165
  ```
118
166
 
119
- **When to use the Explore Agent**:
120
- - ✅ When you need to understand the existing code structure/pattern
121
- - ✅ When you need to refer to how a similar function is implemented
122
- - ✅ When you need to understand the architectural rules of the project
123
- - ✅ Check the library and version being used
167
+ **Note**: If you skip Phase A, proceed directly to Phase B.
124
168
 
125
- ### ⚙️ How to call an agent
169
+ ---
170
+
171
+ ### ⚙️ Phase B: Execution Planning (REQUIRED)
126
172
 
127
- **In STEP 1, we call the implementation-planner agent using the Task tool**:
173
+ **Call the implementation-planner agent to analyze SPEC and establish execution strategy.**
174
+
175
+ This phase is **always required** regardless of whether Phase A was executed.
176
+
177
+ #### How to invoke implementation-planner:
128
178
 
129
179
  ```
130
- Task tool call example:
180
+ Task tool call:
131
181
  - subagent_type: "implementation-planner"
132
182
  - description: "SPEC analysis and establishment of execution strategy"
133
- - prompt: "Please analyze the SPEC of $ARGUMENTS and establish an execution plan.
134
- It must include the following:
135
- 1. SPEC requirements extraction and complexity assessment
136
- 2. Library and tool selection (using WebFetch)
137
- 3. TAG chain design
138
- 4. Step-by-step execution plan
139
- 5. Risks and response plans
140
- 6. Create action plan and use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` to confirm the next action with the user
141
- (Optional) Explore results: $EXPLORE_RESULTS"
183
+ - prompt: "$ARGUMENTS SPEC을 분석하고 실행 계획을 수립해주세요.
184
+ 다음을 포함해야 합니다:
185
+ 1. SPEC 요구사항 추출 복잡도 평가
186
+ 2. 라이브러리 도구 선택 (WebFetch 사용)
187
+ 3. TAG 체인 설계
188
+ 4. 단계별 실행 계획
189
+ 5. 위험 요소 대응 계획
190
+ 6. 행동 계획을 작성하고 `AskUserQuestion 도구 (moai-alfred-interactive-questions 스킬 참고)`로 사용자와 다음 단계를 확인합니다
191
+ (선택사항) 탐색 결과: $EXPLORE_RESULTS"
142
192
  ```
143
193
 
194
+ **Note**: If Phase A was executed, pass the exploration results via `$EXPLORE_RESULTS` variable.
195
+
144
196
  ### SPEC analysis in progress
145
197
 
146
198
  1. **SPEC document analysis**
@@ -183,36 +235,166 @@ After reviewing the action plan, select one of the following:
183
235
 
184
236
  After user approval (gathered through `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)`), **call the tdd-implementer agent using the Task tool**.
185
237
 
186
- ### ⚙️ How to call an agent
238
+ ---
187
239
 
188
- **STEP 2 calls tdd-implementer using the Task tool**:
240
+ ### 2.0.5 Domain Readiness Check (Automatic - Before Implementation)
241
+
242
+ **Purpose**: Load domain-expert agents as "implementation advisors" based on SPEC.stack metadata
189
243
 
244
+ **When to run**: After user approval, BEFORE invoking tdd-implementer
245
+
246
+ **Detection Logic**:
247
+
248
+ Alfred reads the SPEC metadata to identify required domains:
249
+
250
+ ```bash
251
+ # Read SPEC metadata
252
+ spec_metadata=$(grep "^domains:" .moai/specs/SPEC-{ID}/spec.md)
253
+
254
+ # Or read from config.json
255
+ selected_domains=$(jq -r '.stack.selected_domains[]' .moai/config.json)
190
256
  ```
191
- Call the Task tool:
192
- - subagent_type: "tdd-implementer"
193
- - description: "Execute task with TDD implementation"
194
- - prompt: """You are tdd-implementer agent.
195
257
 
196
- LANGUAGE CONFIGURATION:
197
- - conversation_language: {{CONVERSATION_LANGUAGE}}
198
- - language_name: {{CONVERSATION_LANGUAGE_NAME}}
258
+ **Domain Expert Advisory Pattern**:
259
+
260
+ | Domain | Readiness Check | Advisory Focus |
261
+ |--------|----------------|----------------|
262
+ | **Frontend** | Component structure, testing strategy, state management | Component hierarchy, React/Vue best practices, UI testing patterns |
263
+ | **Backend** | API contract, database schema, async patterns | RESTful design, database indexing, error handling, authentication |
264
+ | **DevOps** | Docker readiness, environment variables, health checks | Containerization, CI/CD integration, deployment strategies |
265
+ | **Database** | Schema design, migration strategy, indexing | Data modeling, query optimization, migration safety |
266
+ | **Data Science** | Data pipeline design, notebook structure | ETL patterns, data validation, model versioning |
267
+ | **Mobile** | Platform-specific requirements, app lifecycle | Native integration, state management, offline support |
268
+
269
+ **Example Invocation** (Frontend + Backend detected):
270
+
271
+ ```python
272
+ # Read SPEC metadata
273
+ spec_domains = ["frontend", "backend"] # from SPEC frontmatter
274
+
275
+ # Invoke domain experts BEFORE tdd-implementer
276
+ for domain in spec_domains:
277
+ if domain == "frontend":
278
+ Task(
279
+ subagent_type="Explore",
280
+ prompt="""You are consulting as frontend-expert for TDD implementation.
281
+
282
+ SPEC: [SPEC-UI-001 - User Dashboard Component]
283
+
284
+ Provide implementation readiness check:
285
+ 1. Component structure recommendations
286
+ 2. State management approach (Redux/Zustand/Context)
287
+ 3. Testing strategy (Jest + Testing Library)
288
+ 4. Accessibility requirements
289
+ 5. Performance optimization tips
290
+
291
+ Output: Brief advisory for tdd-implementer (3-4 key points)"""
292
+ )
293
+
294
+ if domain == "backend":
295
+ Task(
296
+ subagent_type="Explore",
297
+ prompt="""You are consulting as backend-expert for TDD implementation.
298
+
299
+ SPEC: [SPEC-API-001 - Authentication Endpoints]
300
+
301
+ Provide implementation readiness check:
302
+ 1. API contract validation
303
+ 2. Database schema requirements
304
+ 3. Authentication/authorization patterns
305
+ 4. Error handling strategy
306
+ 5. Async processing considerations
307
+
308
+ Output: Brief advisory for tdd-implementer (3-4 key points)"""
309
+ )
310
+ ```
311
+
312
+ **Output Format** (Stored in SPEC plan.md):
313
+
314
+ ```markdown
315
+ ## Domain Expert Advisory (Implementation Phase)
316
+
317
+ ### Frontend Readiness
318
+ - Component structure: Use compound component pattern for Dashboard
319
+ - State management: Recommend Zustand for lightweight state
320
+ - Testing: Prioritize user interaction tests over implementation details
321
+ - Performance: Implement React.memo for expensive components
322
+
323
+ ### Backend Readiness
324
+ - API contract: OpenAPI 3.0 spec generated from FastAPI
325
+ - Database schema: Add index on user_id and created_at columns
326
+ - Authentication: Use JWT with refresh token rotation
327
+ - Async: Use background tasks for email notifications
328
+ ```
329
+
330
+ **Integration with tdd-implementer**:
331
+
332
+ ```python
333
+ # Pass domain expert feedback to tdd-implementer
334
+ Task(
335
+ subagent_type="tdd-implementer",
336
+ prompt="""You are tdd-implementer agent.
199
337
 
200
- CRITICAL INSTRUCTION:
201
- Code and technical output MUST be in English.
202
- Code comments MAY be in {{CONVERSATION_LANGUAGE}} if appropriate.
203
- Test descriptions and documentation can use {{CONVERSATION_LANGUAGE}}.
338
+ SPEC: SPEC-{ID}
204
339
 
205
- TASK: Execute the task according to the plan approved in STEP 1.
340
+ DOMAIN EXPERT ADVISORY:
341
+ {domain_expert_feedback}
206
342
 
207
- For TDD scenario:
208
- - Perform RED → GREEN → REFACTOR cycle
209
- - Perform the following for each TAG:
210
- 1. RED Phase: Write a test that fails with the @TEST:ID tag
211
- 2. GREEN Phase: Minimal implementation with the @CODE:ID tag
212
- 3. REFACTOR Phase: Improve code quality
213
- 4. Verify TAG completion conditions and proceed to the next TAG
343
+ Execute TDD implementation considering domain expert guidance.
344
+ Follow RED → GREEN → REFACTOR cycle with domain best practices.
214
345
 
215
- Execute on: $ARGUMENTS"""
346
+ $ARGUMENTS"""
347
+ )
348
+ ```
349
+
350
+ **Graceful Degradation**:
351
+ - If SPEC.stack.domains missing → Skip advisory (greenfield implementation)
352
+ - If domain expert unavailable → Continue with tdd-implementer only
353
+ - Advisory is non-blocking (implementation proceeds regardless)
354
+
355
+ ---
356
+
357
+ ### ⚙️ How to call an agent
358
+
359
+ **STEP 2 calls tdd-implementer using the Task tool**:
360
+
361
+ ```
362
+ Call the Task tool:
363
+ - subagent_type: "tdd-implementer"
364
+ - description: "Execute task with TDD implementation"
365
+ - prompt: """당신은 tdd-implementer 에이전트입니다.
366
+
367
+ 언어 설정:
368
+ - 대화_언어: {{CONVERSATION_LANGUAGE}}
369
+ - 언어명: {{CONVERSATION_LANGUAGE_NAME}}
370
+
371
+ 중요 지시사항:
372
+ **Code and technical output MUST be in English.** This ensures global compatibility and maintainability.
373
+
374
+ 코드 문법 및 키워드: 영어 (고정).
375
+ 코드 주석:
376
+ - 로컬 프로젝트 코드: 반드시 {{CONVERSATION_LANGUAGE}}로 작성
377
+ - 패키지 코드 (src/moai_adk/): 반드시 영어로 작성 (글로벌 배포용)
378
+ 테스트 설명 및 문서: 반드시 {{CONVERSATION_LANGUAGE}}로 작성.
379
+
380
+ 스킬 호출:
381
+ 필요 시 명시적 Skill() 호출 사용:
382
+ - Skill("moai-alfred-language-detection") - 프로젝트 언어 감지
383
+ - Skill("moai-lang-python") 또는 언어별 스킬 - 베스트 프랙티스
384
+ - Skill("moai-essentials-debug") - 테스트 실패 시
385
+ - Skill("moai-essentials-refactor") - REFACTOR 단계에서
386
+
387
+ 작업: STEP 1에서 승인된 계획에 따라 작업을 실행합니다.
388
+
389
+ TDD 시나리오의 경우:
390
+ - RED → GREEN → REFACTOR 사이클 수행
391
+ - 각 TAG에 대해 다음을 수행:
392
+ 1. RED 단계: @TEST:ID 태그로 실패하는 테스트 작성
393
+ 2. GREEN 단계: @CODE:ID 태그로 최소한의 구현
394
+ 3. REFACTOR 단계: 코드 품질 개선
395
+ 4. TAG 완료 조건 확인 및 다음 TAG 진행
396
+
397
+ 실행 대상: $ARGUMENTS"""
216
398
  ```
217
399
 
218
400
  ## 🔗 TDD optimization for each language
@@ -469,7 +651,7 @@ Only if the user selects **"Proceed"** or **"Start"** will Alfred call the tdd-i
469
651
 
470
652
  ## 🧠 Context Management
471
653
 
472
- > For more information: `.moai/memory/development-guide.md` - see section "Context Engineering"
654
+ > For more information: Skill("moai-alfred-dev-guide") - see section "Context Engineering"
473
655
 
474
656
  ### Core strategy of this command
475
657
 
@@ -479,6 +661,45 @@ Only if the user selects **"Proceed"** or **"Start"** will Alfred call the tdd-i
479
661
 
480
662
  ---
481
663
 
664
+ ## Final Step
665
+
666
+ ### After STEP 3 (git-manager) Completes
667
+
668
+ Alfred calls AskUserQuestion to collect user's next action:
669
+
670
+ ```python
671
+ AskUserQuestion(
672
+ questions=[
673
+ {
674
+ "question": "구현이 완료되었습니다. 다음으로 뭘 하시겠습니까?",
675
+ "header": "다음 단계",
676
+ "multiSelect": false,
677
+ "options": [
678
+ {
679
+ "label": "📚 문서 동기화 진행",
680
+ "description": "/alfred:3-sync 실행하여 문서 동기화"
681
+ },
682
+ {
683
+ "label": "🔍 추가 구현",
684
+ "description": "다른 SPEC 구현 진행"
685
+ },
686
+ {
687
+ "label": "🔄 새 세션 시작",
688
+ "description": "성능 최적화를 위해 /clear 실행"
689
+ }
690
+ ]
691
+ }
692
+ ]
693
+ )
694
+ ```
695
+
696
+ **User Responses**:
697
+ - **📚 문서 동기화**: Proceed to `/alfred:3-sync` for documentation synchronization
698
+ - **🔍 추가 구현**: Repeat `/alfred:2-run SPEC-XXX` for next feature
699
+ - **🔄 새 세션**: Execute `/clear` to start fresh session (recommended for performance)
700
+
701
+ ---
702
+
482
703
  ## Next steps
483
704
 
484
705
  **Recommendation**: For better performance and context management, start a new chat session with the `/clear` or `/new` command before proceeding to the next step.