moai-adk 0.9.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 (186) hide show
  1. moai_adk/cli/commands/init.py +14 -2
  2. moai_adk/cli/commands/update.py +214 -56
  3. moai_adk/core/issue_creator.py +2 -2
  4. moai_adk/core/project/detector.py +201 -12
  5. moai_adk/core/project/initializer.py +62 -1
  6. moai_adk/core/project/phase_executor.py +48 -6
  7. moai_adk/core/tags/ci_validator.py +34 -4
  8. moai_adk/core/tags/pre_commit_validator.py +40 -2
  9. moai_adk/core/tags/reporter.py +2 -3
  10. moai_adk/core/tags/validator.py +1 -1
  11. moai_adk/core/template_engine.py +20 -5
  12. moai_adk/templates/.claude/agents/alfred/backend-expert.md +319 -0
  13. moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
  14. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +1 -1
  15. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
  16. moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
  17. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +76 -3
  18. moai_adk/templates/.claude/agents/alfred/project-manager.md +49 -10
  19. moai_adk/templates/.claude/agents/alfred/quality-gate.md +3 -3
  20. moai_adk/templates/.claude/agents/alfred/spec-builder.md +108 -3
  21. moai_adk/templates/.claude/agents/alfred/tag-agent.md +74 -0
  22. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +107 -5
  23. moai_adk/templates/.claude/agents/alfred/trust-checker.md +2 -2
  24. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +571 -0
  25. moai_adk/templates/.claude/commands/alfred/0-project.md +465 -129
  26. moai_adk/templates/.claude/commands/alfred/1-plan.md +139 -65
  27. moai_adk/templates/.claude/commands/alfred/2-run.md +214 -50
  28. moai_adk/templates/.claude/commands/alfred/3-sync.md +372 -46
  29. moai_adk/templates/.claude/commands/alfred/9-feedback.md +1 -1
  30. moai_adk/templates/.claude/hooks/alfred/core/project.py +25 -27
  31. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  32. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  33. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +4 -4
  34. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +29 -0
  35. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +11 -19
  36. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +11 -19
  37. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +11 -19
  38. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +10 -18
  39. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +2 -2
  40. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +3 -3
  41. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +5 -5
  42. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +40 -41
  43. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +55 -23
  44. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +4 -4
  45. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +132 -3
  46. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +9 -10
  47. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +3 -6
  48. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +19 -0
  49. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +14 -22
  50. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  51. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
  52. moai_adk/templates/.claude/settings.json +5 -5
  53. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
  54. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
  55. moai_adk/templates/{.moai/memory/CLAUDE-AGENTS-GUIDE.md → .claude/skills/moai-alfred-agent-guide/reference.md} +34 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +56 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
  67. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
  68. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +74 -0
  69. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +4 -0
  70. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +269 -0
  71. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +19 -0
  72. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
  73. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +198 -0
  74. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +431 -0
  75. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +141 -0
  76. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
  77. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
  78. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
  79. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
  80. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
  81. moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +273 -0
  82. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
  83. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
  84. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +19 -0
  85. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
  86. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
  87. moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/SKILL.md +5 -5
  88. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +115 -0
  89. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +4 -0
  90. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +348 -0
  91. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
  92. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
  93. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
  94. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
  95. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +19 -0
  96. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +4 -0
  97. moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL.md +3 -3
  98. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
  99. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
  100. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
  101. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +17 -13
  102. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +15 -12
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +14 -12
  104. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +14 -11
  105. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +10 -8
  106. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +15 -12
  107. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +13 -11
  108. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +16 -10
  109. moai_adk/templates/.claude/skills/moai-project-documentation.md +622 -0
  110. moai_adk/templates/.git-hooks/pre-push +143 -0
  111. moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
  112. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
  113. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
  114. moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
  115. moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
  116. moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
  117. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
  118. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +182 -25
  120. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +35 -29
  121. moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
  122. moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
  123. moai_adk/templates/.github/workflows/release.yml +76 -7
  124. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
  125. moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
  126. moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
  127. moai_adk/templates/.github/workflows/spec-issue-sync.yml +208 -41
  128. moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
  129. moai_adk/templates/.github/workflows/tag-report.yml +269 -0
  130. moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
  131. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
  132. moai_adk/templates/.moai/config.json +3 -1
  133. moai_adk/templates/CLAUDE.md +940 -45
  134. moai_adk/templates/workflows/go-tag-validation.yml +30 -0
  135. moai_adk/templates/workflows/javascript-tag-validation.yml +41 -0
  136. moai_adk/templates/workflows/python-tag-validation.yml +42 -0
  137. moai_adk/templates/workflows/typescript-tag-validation.yml +31 -0
  138. moai_adk/utils/banner.py +5 -5
  139. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/METADATA +1166 -455
  140. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/RECORD +169 -109
  141. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -209
  142. moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +0 -102
  143. moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +0 -102
  144. moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +0 -102
  145. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -640
  146. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -696
  147. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -474
  148. moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +0 -176
  149. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
  150. moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +0 -344
  151. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  152. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -330
  153. moai_adk/templates/.moai/project/product.md +0 -161
  154. moai_adk/templates/.moai/project/structure.md +0 -156
  155. moai_adk/templates/.moai/project/tech.md +0 -227
  156. moai_adk/templates/README.md +0 -256
  157. moai_adk/templates/__init__.py +0 -2
  158. /moai_adk/templates/{.moai/memory/ISSUE-LABEL-MAPPING.md → .claude/skills/moai-alfred-issue-labels/reference.md} +0 -0
  159. /moai_adk/templates/{.moai/memory/CLAUDE-PRACTICES.md → .claude/skills/moai-alfred-practices/reference.md} +0 -0
  160. /moai_adk/templates/{.moai/memory/CLAUDE-RULES.md → .claude/skills/moai-alfred-rules/reference.md} +0 -0
  161. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/README.md +0 -0
  162. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples/validate-spec.sh +0 -0
  163. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples.md +0 -0
  164. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/reference.md +0 -0
  165. /moai_adk/templates/{.moai/memory/SKILLS-DESCRIPTION-POLICY.md → .claude/skills/moai-cc-skill-descriptions/reference.md} +0 -0
  166. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/CHECKLIST.md +0 -0
  167. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/EXAMPLES.md +0 -0
  168. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/INTERACTIVE-DISCOVERY.md +0 -0
  169. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/METADATA.md +0 -0
  170. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PARALLEL-ANALYSIS-REPORT.md +0 -0
  171. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PYTHON-VERSION-MATRIX.md +0 -0
  172. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-FACTORY-WORKFLOW.md +0 -0
  173. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-UPDATE-ADVISOR.md +0 -0
  174. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STEP-BY-STEP-GUIDE.md +0 -0
  175. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STRUCTURE.md +0 -0
  176. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/WEB-RESEARCH.md +0 -0
  177. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/reference.md +0 -0
  178. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/generate-structure.sh +0 -0
  179. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/validate-skill.sh +0 -0
  180. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/SKILL_TEMPLATE.md +0 -0
  181. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/examples-template.md +0 -0
  182. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/reference-template.md +0 -0
  183. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/scripts-template.sh +0 -0
  184. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/WHEEL +0 -0
  185. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/entry_points.txt +0 -0
  186. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moai-adk
3
- Version: 0.9.0
3
+ Version: 0.15.0
4
4
  Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent & Complete Skills v2.0
5
5
  Project-URL: Homepage, https://github.com/modu-ai/moai-adk
6
6
  Project-URL: Repository, https://github.com/modu-ai/moai-adk
@@ -14,17 +14,21 @@ Classifier: Development Status :: 4 - Beta
14
14
  Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
17
19
  Classifier: Programming Language :: Python :: 3.13
18
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
21
  Classifier: Topic :: Software Development :: Quality Assurance
20
22
  Classifier: Topic :: Software Development :: Testing
21
- Requires-Python: >=3.13
23
+ Requires-Python: >=3.11
22
24
  Requires-Dist: click>=8.1.0
23
25
  Requires-Dist: gitpython>=3.1.45
26
+ Requires-Dist: jinja2>=3.0.0
24
27
  Requires-Dist: packaging>=21.0
25
28
  Requires-Dist: pyfiglet>=1.0.2
26
29
  Requires-Dist: pyyaml>=6.0
27
30
  Requires-Dist: questionary>=2.0.0
31
+ Requires-Dist: requests>=2.28.0
28
32
  Requires-Dist: rich>=13.0.0
29
33
  Provides-Extra: dev
30
34
  Requires-Dist: mypy>=1.7.0; extra == 'dev'
@@ -40,7 +44,7 @@ Description-Content-Type: text/markdown
40
44
 
41
45
  # MoAI-ADK (Agentic Development Kit)
42
46
 
43
- [한국어](README.ko.md) |[English](README.md) | [ไทย](README.th.md) | [日本語](README.ja.md) | [中文](README.zh.md) | [हिन्दी](README.hi.md)
47
+ [한국어](README.ko.md) | [English](README.md)
44
48
 
45
49
  [![PyPI version](https://img.shields.io/pypi/v/moai-adk)](https://pypi.org/project/moai-adk/)
46
50
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -111,7 +115,7 @@ Write SPECs first with the `/alfred:1-plan` command. A vague request like "login
111
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.
112
116
 
113
117
  **4️⃣ Tracking with @TAG System**
114
- Every piece of code, test, and documentation gets a `@TAG:ID`. When requirements change later, one command—`rg "@SPEC:AUTH-001"`—**finds all related tests, implementations, and docs**. You gain confidence during refactoring.
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.
115
119
 
116
120
  **5️⃣ Alfred Remembers Context**
117
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.
@@ -158,61 +162,364 @@ From the moment you adopt MoAI-ADK, you'll feel:
158
162
 
159
163
  ---
160
164
 
161
- ## 5-Minute Quick Start
165
+ ## 🖥️ Platform Support
162
166
 
163
- Now let's start your first project with MoAI-ADK. Follow these 5 steps and in just **5 minutes** you'll have a project with SPEC, TDD, and documentation all connected.
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
164
173
 
165
- ### Step 1: Install uv (about 30 seconds)
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
166
178
 
167
- First, install `uv`. `uv` is an ultra-fast Python package manager written in Rust. It's **10+ times faster** than traditional `pip` and works perfectly with MoAI-ADK.
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**:
168
190
 
169
191
  ```bash
170
192
  # macOS/Linux
171
193
  curl -LsSf https://astral.sh/uv/install.sh | sh
172
194
 
173
- # Windows (PowerShell)
195
+ # Windows (PowerShell) - RECOMMENDED FOR WINDOWS USERS
174
196
  powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
175
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
+
176
204
  # Verify installation
177
205
  uv --version
178
- # Output: uv 0.x.x
179
206
  ```
180
207
 
181
- **Why uv?** MoAI-ADK is optimized to leverage uv's fast installation speed and stability. Perfect project isolation means no impact on other Python environments.
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 |
182
217
 
183
- ### Step 2: Install MoAI-ADK (about 1 minute)
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.
184
222
 
185
- Install MoAI-ADK as a global tool. This won't affect your project dependencies.
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
186
237
 
187
238
  ```bash
188
- # Install in tool mode (recommended: runs in isolated environment)
189
239
  uv tool install moai-adk
190
240
 
191
- # Verify installation
241
+ # Result: ✅ Installed moai-adk v0.14.0
242
+ ```
243
+
244
+ **Verification**:
245
+ ```bash
192
246
  moai-adk --version
193
- # Output: MoAI-ADK v1.0.0
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
194
259
  ```
195
260
 
196
- Once installed, you can use the `moai-adk` command anywhere.
261
+ #### What Gets Created
197
262
 
198
- ### Step 3: Create Project (about 1 minute)
263
+ ```
264
+ hello-world/
265
+ ├── .moai/ ✅ Alfred configuration
266
+ ├── .claude/ ✅ Claude Code automation
267
+ ├── CLAUDE.md ✅ Project guide
268
+ └── README.md ✅ Project documentation
269
+ ```
199
270
 
200
- **To start a new project:**
271
+ #### Verification: Check Core Files
201
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**:
202
511
  ```bash
203
512
  moai-adk init my-project
204
513
  cd my-project
205
514
  ```
206
515
 
207
- **To add to an existing project:**
208
-
516
+ **Add to existing project**:
209
517
  ```bash
210
518
  cd your-existing-project
211
519
  moai-adk init .
212
520
  ```
213
521
 
214
- This one command automatically generates:
215
-
522
+ Complete directory structure created:
216
523
  ```
217
524
  my-project/
218
525
  ├── .moai/ # MoAI-ADK project configuration
@@ -267,11 +574,6 @@ my-project/
267
574
  │ ├── hooks/ # Event-driven automation
268
575
  │ │ └── alfred/
269
576
  │ │ └── alfred_hooks.py # 5 hooks (Session, PreTool, etc.)
270
- │ ├── output-styles/ # Response styles
271
- │ │ └── alfred/
272
- │ │ ├── agentic-coding.md # Professional development mode
273
- │ │ ├── moai-adk-learning.md # Educational explanations mode
274
- │ │ └── study-with-alfred.md # Interactive learning mode
275
577
  │ └── settings.json # Claude Code settings
276
578
  ├── src/ # Implementation code
277
579
  ├── tests/ # Test code
@@ -280,178 +582,331 @@ my-project/
280
582
  └── README.md
281
583
  ```
282
584
 
283
- ### Step 4: Start Alfred in Claude Code (about 2 minutes)
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).
284
608
 
285
- Run Claude Code and invoke the Alfred SuperAgent:
609
+ ---
610
+
611
+ ---
286
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
287
630
  ```bash
288
- # Run Claude Code
289
- claude
631
+ /alfred:1-plan "GET /hello endpoint - receive query parameter 'name' and return greeting"
290
632
  ```
291
633
 
292
- Then enter this in Claude Code's command input:
293
-
634
+ #### Alfred Automatically Creates
294
635
  ```
295
- /alfred:0-project
636
+ ✅ SPEC ID: HELLO-001
637
+ ✅ File: .moai/specs/SPEC-HELLO-001/spec.md
638
+ ✅ Branch: feature/SPEC-HELLO-001
296
639
  ```
297
640
 
298
- This command performs:
641
+ #### Check Generated SPEC
642
+ ```bash
643
+ cat .moai/specs/SPEC-HELLO-001/spec.md
644
+ ```
299
645
 
300
- 1. **Collect Project Info**: "Project name?", "Goals?", "Main language?"
301
- 2. **Auto-detect Tech Stack**: Automatically recognizes Python/JavaScript/Go, etc.
302
- 3. **Deploy Skill Packs**: Prepares necessary Skills for your project
303
- 4. **Generate Initial Report**: Project structure, suggested next steps
646
+ **Example Content**:
647
+ ```yaml
648
+ ---
649
+ id: HELLO-001
650
+ version: 0.0.1
651
+ status: draft
652
+ priority: high
653
+ ---
304
654
 
305
- ### Step 5: Write First SPEC (about 1 minute)
655
+ # `@SPEC:EX-HELLO-001: Hello World API
306
656
 
307
- After project initialization completes, write your first feature as a SPEC:
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!"
308
663
 
664
+ ## Constraints
665
+ - name limited to 50 characters max
666
+ - Response format: JSON
309
667
  ```
310
- /alfred:1-plan "User registration feature"
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
311
678
  ```
312
679
 
313
- Automatically generated:
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
314
690
 
315
- - `@SPEC:USER-001` - Unique ID assigned
316
- - `.moai/specs/SPEC-USER-001/spec.md` - Professional SPEC in EARS format
317
- - `feature/spec-user-001` - Git branch auto-created
691
+ client = TestClient(app)
318
692
 
319
- ### Step 6: TDD Implementation (about 3 minutes)
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!"}
320
698
 
321
- Once SPEC is written, implement using TDD:
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
+ ```
322
705
 
706
+ **Run**:
707
+ ```bash
708
+ pytest tests/test_hello.py -v
323
709
  ```
324
- /alfred:2-run USER-001
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"
325
717
  ```
326
718
 
327
- This command handles:
719
+ ---
720
+
721
+ #### 🟢 GREEN Phase: Minimal Implementation
328
722
 
329
- - 🔴 **RED**: Automatically write failing test (`@TEST:USER-001`)
330
- - 🟢 **GREEN**: Minimal implementation to pass test (`@CODE:USER-001`)
331
- - ♻️ **REFACTOR**: Improve code quality
723
+ **File Created**: `src/hello/api.py`
332
724
 
333
- ### Step 7: Documentation Sync (about 1 minute)
725
+ ```python
726
+ # `@CODE:EX-HELLO-001:API | SPEC: SPEC-HELLO-001.md | TEST: tests/test_hello.py
334
727
 
335
- Finally, auto-sync all documentation:
728
+ from fastapi import FastAPI
729
+
730
+ app = FastAPI()
336
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}!"}
337
736
  ```
338
- /alfred:3-sync
737
+
738
+ **Run**:
739
+ ```bash
740
+ pytest tests/test_hello.py -v
339
741
  ```
340
742
 
341
- Automatically generated/updated:
743
+ **Result**: ✅ PASSED (all tests pass!)
342
744
 
343
- - Living Document (API documentation)
344
- - README updates
345
- - CHANGELOG generation
346
- - @TAG chain validation
745
+ **Commit**:
746
+ ```bash
747
+ git add src/hello/api.py
748
+ git commit -m "🟢 feat(HELLO-001): implement hello API"
749
+ ```
347
750
 
348
- ### Complete!
751
+ ---
349
752
 
350
- After these 7 steps, everything is ready:
753
+ #### ♻️ REFACTOR Phase: Add Validation
351
754
 
352
- Requirements specification (SPEC)
353
- ✅ Test code (85%+ coverage)
354
- ✅ Implementation code (tracked with @TAG)
355
- ✅ API documentation (auto-generated)
356
- ✅ Change history (CHANGELOG)
357
- ✅ Git commit history (RED/GREEN/REFACTOR)
755
+ **Enhanced Code**:
358
756
 
359
- **Everything completes in 15 minutes!**
757
+ ```python
758
+ from fastapi import FastAPI, HTTPException
360
759
 
361
- ### Verify Generated Results
760
+ app = FastAPI()
362
761
 
363
- Check if the generated results were properly created:
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
+ ```
364
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**:
365
780
  ```bash
366
- # 1. Check TAG chain (SPEC → TEST → CODE → DOC)
367
- rg '@(SPEC|TEST|CODE):USER-001' -n
781
+ pytest tests/test_hello.py -v
782
+ ```
368
783
 
369
- # 2. Run tests
370
- pytest tests/ -v
784
+ **Result**: PASSED (all tests pass!)
371
785
 
372
- # 3. Check generated documentation
373
- cat docs/api/user.md
374
- cat README.md
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"
375
790
  ```
376
791
 
377
- > 🔍 **Verification Command**: `moai-adk doctor` — Checks if Python/uv versions, `.moai/` structure, and agent/Skills configuration are all ready.
378
- >
379
- > ```bash
380
- > moai-adk doctor
381
- > ```
382
- >
383
- > All green checkmarks mean perfect readiness!
384
-
385
792
  ---
386
793
 
387
- ## Understanding CLAUDE.md (Alfred's Configuration Documents)
794
+ ### Step 3: Documentation Sync (2 minutes)
388
795
 
389
- 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.
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
390
817
 
391
- ### 4-Document Structure (Progressive Disclosure Pattern)
818
+ ## GET /hello
392
819
 
393
- When you run MoAI-ADK, Alfred loads configuration from **4 coordinated documents** (stored in your `.claude/` directory). This layered approach follows **Progressive Disclosure** — each document adds context only when needed:
820
+ ### Description
821
+ Returns a personalized greeting based on provided name.
394
822
 
395
- #### Layer 1: Bootstrap (Always Loaded)
823
+ ### Parameters
824
+ - `name` (query, optional): Person's name (default: "World", max 50 chars)
396
825
 
397
- | Document | Size | Purpose | Single Responsibility |
398
- |----------|------|---------|----------------------|
399
- | **CLAUDE.md** | ~7kb | Alfred's identity, directives, project metadata, language settings | **Project-specific guidance** (your team's working playbook) |
826
+ ### Responses
827
+ - **200**: Success
828
+ ```json
829
+ { "message": "Hello, Alice!" }
830
+ ```
831
+ - **400**: Name too long
400
832
 
401
- #### Layers 2-4: Just-In-Time (JIT) Loading
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
+ ```
402
847
 
403
- | Document | Size | Purpose | Triggered When |
404
- |----------|------|---------|----------------|
405
- | **CLAUDE-AGENTS-GUIDE.md** | ~14kb | Sub-agent roster (19 members), Skills map (55 packs), selection criteria | Deciding which agent to invoke (e.g., `/alfred:2-run` → need tdd-implementer) |
406
- | **CLAUDE-RULES.md** | ~17kb | Decision rules: Skill invocation, Interactive Questions, TAG validation, TRUST gates, commit templates | At decision points (e.g., "Should I ask user?", "Which Skill applies?") |
407
- | **CLAUDE-PRACTICES.md** | ~8kb | Real-world workflows, context engineering (JIT retrieval), agent collaboration patterns, code examples | During implementation phase (e.g., executing `/alfred:2-run` RED→GREEN→REFACTOR) |
848
+ ---
408
849
 
409
- ### How Progressive Disclosure Works
850
+ ### Step 4: Verify TAG Chain (1 minute)
410
851
 
411
- **Example: You run `/alfred:2-run AUTH-001`**
852
+ #### Command
853
+ ```bash
854
+ rg '@(SPEC|TEST|CODE|DOC):HELLO-001' -n
855
+ ```
412
856
 
857
+ #### Output (Complete Traceability)
413
858
  ```
414
- Session Start
415
- Load CLAUDE.md (7kb)
416
- ├─ Alfred knows: project context, language settings, core directives
417
- ↓ User invokes /alfred:2-run
418
- ├─ Load CLAUDE-AGENTS-GUIDE.md (14kb)
419
- ├─ Alfred decides: "I need tdd-implementer agent"
420
- ├─ Load CLAUDE-RULES.md (17kb)
421
- ├─ Alfred checks: "TDD rules? TEST before CODE? TRUST gates?"
422
- ├─ Load CLAUDE-PRACTICES.md (8kb)
423
- ├─ Alfred references: "RED → GREEN → REFACTOR pattern"
424
- ↓ Implementation complete
425
- └─ Context cleaned up (only CLAUDE.md remains for next task)
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`
426
863
  ```
427
864
 
428
- **Result**:
429
- - ✅ Session boots fast (only 7kb initial load)
430
- - ✅ Context stays clean (7kb → 7kb+14kb → 7kb+14kb+17kb as needed)
431
- - ✅ Each document has single responsibility (easier to maintain)
432
- - Developers know exactly where to find/modify specific guidance
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 |
433
896
 
434
897
  ### Why This Structure Matters
435
898
 
436
- **For Developers**:
437
- 1. **CLAUDE.md**: Your project's working guide (language, settings, directives)
438
- 2. **CLAUDE-AGENTS-GUIDE.md**: "Who does what?" (agent selection logic)
439
- 3. **CLAUDE-RULES.md**: "How do we decide?" (decision frameworks, gates)
440
- 4. **CLAUDE-PRACTICES.md**: "Real examples" (practical patterns to follow)
899
+ **For Developers**: These documents define how Alfred interprets your requirements and orchestrates development. Understanding them helps you:
441
900
 
442
- Understanding this helps you:
443
- - Write clearer SPEC requirements that Alfred understands
444
- - Know which agent/Skill executes your request
445
- - Predict where Alfred might ask questions or apply TRUST verification
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
446
904
 
447
- **For AI (Context Efficiency)**:
448
- - **Phase 1** (Session Start): Minimal context footprint (7kb)
449
- - **Phase 2** (Planning): Load agent selection guide (total ~21kb)
450
- - **Phase 3** (Implementation): Load decision rules (~38kb)
451
- - **Phase 4** (Execution): Load practical patterns (~46kb)
452
- - **Between Tasks**: Unload unnecessary layers, keep CLAUDE.md active
905
+ **For AI**: Progressive disclosure means:
453
906
 
454
- 📚 **Learn More**: `.claude/CLAUDE.md` | `.claude/CLAUDE-AGENTS-GUIDE.md` | `.claude/CLAUDE-RULES.md` | `.claude/CLAUDE-PRACTICES.md`
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
455
910
 
456
911
  ### Example: What Happens When You Run `/alfred:2-run`
457
912
 
@@ -472,6 +927,39 @@ Understanding this helps you:
472
927
 
473
928
  > ⚠️ **Important**: These are internal configuration files for Alfred, not user guides. Keep them concise and decision-focused. Most teams don't modify them.
474
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
+
475
963
  ---
476
964
 
477
965
  ## Alfred's Memory Files (.moai/memory/)
@@ -675,14 +1163,124 @@ claude
675
1163
  /alfred:0-project # Verify new features like language selection
676
1164
  ```
677
1165
 
678
- > 💡 **New 2-Stage Update Workflow**:
679
- >
680
- > - **Stage 1**: `moai-adk update` detects installer (uv tool, pipx, or pip) and upgrades package
681
- > - **Stage 2**: `moai-adk update` again to sync templates, config, and agent/Skills
682
- > - **Smart detection**: Auto-detects whether package upgrade is needed based on version comparison
683
- > - **CI/CD ready**: Use `moai-adk update --yes` for fully automated updates in pipelines
684
- > - **Manual upgrade path**: Use `moai-adk update --templates-only` after manually upgrading the package
685
- > - **Rollback safe**: Automatic backups in `.moai-backups/` before template sync
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
686
1284
 
687
1285
  ---
688
1286
 
@@ -869,6 +1467,40 @@ This issue has been **fixed** in v0.8.1+. If you're experiencing this:
869
1467
  - Code now gracefully handles InvalidVersion exceptions
870
1468
  - Added comprehensive unit tests for placeholder detection
871
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
+
872
1504
  ### Contributing Tests
873
1505
 
874
1506
  When adding new features, always include tests:
@@ -913,109 +1545,19 @@ moai-adk update --check
913
1545
 
914
1546
  ## Core Workflow (0 → 3)
915
1547
 
916
- Alfred iteratively develops projects with four commands, guided by the **4-Step Workflow Logic** for every user request.
1548
+ Alfred iteratively develops projects with four commands.
917
1549
 
918
1550
  ```mermaid
919
1551
  %%{init: {'theme':'neutral'}}%%
920
1552
  graph TD
921
- Start([User Request]) --> Intent[Step 1: Intent Understanding<br/>Clarify ambiguity if needed]
922
- Intent --> Plan[Step 2: Plan Creation<br/>Decompose tasks + identify order]
923
- Plan --> Execute[Step 3: Task Execution<br/>TodoWrite: pending → in_progress → completed]
924
- Execute --> Report[Step 4: Report & Commit<br/>Document decisions + create git commits]
925
- Report --> Init[0. Init<br/>/alfred:0-project]
926
- Init --> PlanPhase[1. Plan & SPEC<br/>/alfred:1-plan]
927
- PlanPhase --> Run[2. Run & TDD<br/>/alfred:2-run]
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]
928
1556
  Run --> Sync[3. Sync & Docs<br/>/alfred:3-sync]
929
- Sync --> PlanPhase
1557
+ Sync --> Plan
930
1558
  Sync -.-> End([Release])
931
1559
  ```
932
1560
 
933
- ### Alfred's 4-Step Workflow Logic
934
-
935
- Every user request follows this systematic process:
936
-
937
- #### Step 1: Intent Understanding
938
- - **Goal**: Clarify user intent before any action
939
- - **Action**: Evaluate request clarity
940
- - **HIGH clarity**: Technical stack, requirements, scope all specified → Skip to Step 2
941
- - **MEDIUM/LOW clarity**: Multiple interpretations possible → Invoke `AskUserQuestion`
942
- - **Outcome**: Clear, unambiguous intent confirmed with user
943
-
944
- #### Step 2: Plan Creation
945
- - **Goal**: Analyze tasks and identify execution strategy
946
- - **Action**: Invoke Plan Agent to:
947
- - Decompose tasks into structured steps
948
- - Identify dependencies between tasks
949
- - Determine single vs parallel execution opportunities
950
- - Estimate work scope and files affected
951
- - **Outcome**: Structured task breakdown for TodoWrite initialization
952
-
953
- #### Step 3: Task Execution
954
- - **Goal**: Execute tasks with transparent progress tracking
955
- - **Action**:
956
- 1. Initialize TodoWrite with all pending tasks
957
- 2. For each task:
958
- - Update status: pending → **in_progress** (exactly ONE at a time)
959
- - Execute task (call appropriate sub-agent or tool)
960
- - Update status: in_progress → **completed** (immediately after)
961
- 3. Handle blockers: Keep task in_progress, create new blocking task
962
- - **Outcome**: All tasks completed with verified progress
963
-
964
- #### Step 4: Report & Commit
965
- - **Goal**: Document work and create git history
966
- - **Action**:
967
- - **Report Generation**: ONLY if user explicitly requested
968
- - ❌ Prohibited: Auto-generate reports without request
969
- - ✅ Allowed: `.moai/docs/`, `.moai/reports/`, `.moai/specs/`
970
- - **Git Commit**: ALWAYS create commits
971
- - Call git-manager for all Git operations
972
- - TDD commits: RED → GREEN → REFACTOR → DOCS
973
- - Include Alfred co-authorship
974
- - **Outcome**: Complete audit trail with documented decisions
975
-
976
- ### How 4-Step Workflow Maps to Phase 0-3 Commands
977
-
978
- The **4-Step Workflow Logic** is universal and applies to **every command execution**. Here's how it manifests in each Phase:
979
-
980
- #### Phase 0: Project Initialization (`/alfred:0-project`)
981
- ```
982
- Step 1: Intent → Clarify project needs (language, framework, team structure)
983
- Step 2: Plan → Design `.moai/` structure, detect tech stack
984
- Step 3: Run → Initialize config, deploy Skills, set up project template
985
- Step 4: Report → Create product/structure/tech.md documentation
986
- ```
987
-
988
- #### Phase 1: Planning (`/alfred:1-plan <description>`)
989
- ```
990
- Step 1: Intent → Parse requirements, clarify SPEC scope
991
- Step 2: Plan → Decompose into EARS statements, identify acceptance criteria
992
- Step 3: Run → Write SPEC document, create Plan Board, generate GitHub Issue
993
- Step 4: Report → Create feature branch, commit SPEC with TAG
994
- ```
995
-
996
- #### Phase 2: TDD Implementation (`/alfred:2-run <SPEC-ID>`)
997
- ```
998
- Step 1: Intent → Understand SPEC requirements and test strategy
999
- Step 2: Plan → Decompose SPEC into 3-step TDD cycle (RED/GREEN/REFACTOR)
1000
- Step 3: Run → Execute TDD: 🔴 RED test → 🟢 GREEN implementation → ♻️ REFACTOR quality
1001
- Step 4: Report → Verify TRUST 5 gates, commit code with @TEST/@CODE TAGs
1002
- ```
1003
-
1004
- #### Phase 3: Sync & Docs (`/alfred:3-sync`)
1005
- ```
1006
- Step 1: Intent → Understand what documentation needs synchronization
1007
- Step 2: Plan → Identify TAG chains, detect orphans, plan doc updates
1008
- Step 3: Run → Sync docs, validate TAGs, update README/CHANGELOG
1009
- Step 4: Report → Create sync report, auto-close SPEC Issues, ready PR for merge
1010
- ```
1011
-
1012
- **Key Insight**: Each command (0, 1, 2, 3) follows the same **4-Step Logic**. This ensures:
1013
- - ✅ Consistent decision-making across all phases
1014
- - ✅ Clear progression: understand → plan → execute → document
1015
- - ✅ Predictable workflow that teams can rely on
1016
-
1017
- ---
1018
-
1019
1561
  ### 0. INIT — Project Preparation
1020
1562
 
1021
1563
  - Questions about project introduction, target, language, mode (locale)
@@ -1040,19 +1582,18 @@ Step 4: Report → Create sync report, auto-close SPEC Issues, ready PR for merg
1040
1582
  - Sync Living Document, README, CHANGELOG, etc.
1041
1583
  - Validate TAG chain and recover orphan TAGs
1042
1584
  - Generate Sync Report, transition Draft → Ready for Review, support `--auto-merge` option
1043
- - **Auto-close related SPEC Issues** (Closes #XX reference in commit message)
1044
1585
 
1045
1586
  ---
1046
1587
 
1047
1588
  ## Command Cheat Sheet
1048
1589
 
1049
- | Command | What It Does | Key Outputs |
1050
- |---------|-------------|------------|
1051
- | `/alfred:0-project` | **Initialize project**: gather metadata, detect tech stack, deploy 55 Claude Skills, set up `.moai/` directory | `.moai/config.json`, `.moai/project/*`, `product/structure/tech.md` |
1052
- | `/alfred:1-plan <desc>` | **Write SPEC** in EARS format, create Plan Board, auto-generate acceptance criteria, create feature branch | `.moai/specs/SPEC-*/spec.md`, plan board, acceptance criteria, GitHub Issue |
1053
- | `/alfred:2-run <ID>` | **Execute TDD cycle**: 🔴 RED (failing test) 🟢 GREEN (minimal implementation) → ♻️ REFACTOR (cleanup) → quality gates | `tests/`, `src/` with `@TEST:ID` and `@CODE:ID` tags, test report |
1054
- | `/alfred:3-sync` | **Synchronize Living Docs**: sync README, docs, CHANGELOG; validate TAG chains; auto-close SPEC Issues on PR merge | `docs/`, `.moai/reports/`, `@DOC:ID` tags, Issue closed |
1055
- | `/alfred:9-feedback` | **Create GitHub Issues** interactively (workflow: issue type → title → description → priority/labels) | GitHub Issue with proper labels, priority, auto-assignable |
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 |
1056
1597
 
1057
1598
  > ❗ All commands maintain **Phase 0 (optional) → Phase 1 → Phase 2 → Phase 3** cycle structure. Alfred automatically reports execution status and next-step suggestions.
1058
1599
  >
@@ -1074,69 +1615,6 @@ When you create a SPEC document using `/alfred:1-plan` and push it to a feature
1074
1615
  4. **PR Comment** is added with a link to the created issue
1075
1616
  5. **Labels** are automatically applied based on priority (critical, high, medium, low)
1076
1617
 
1077
- ### Automatic Issue Closure & Lifecycle Synchronization
1078
-
1079
- When you complete implementation and run `/alfred:3-sync`, the system manages the complete SPEC-to-Issue lifecycle:
1080
-
1081
- #### Issue Lifecycle Stages
1082
-
1083
- | Stage | SPEC Status | GitHub Issue Status | Action |
1084
- |-------|------------|-------------------|--------|
1085
- | **1. Creation** | `draft` | `open` + `spec` label | SPEC created, Issue auto-created |
1086
- | **2. Review** | `in-review` | `open` + `planning` label | Awaiting SPEC approval |
1087
- | **3. Implementation** | `in-progress` | `open` + `in_progress` label | `/alfred:2-run` execution |
1088
- | **4. Completion** | `completed` | Closing... | `/alfred:3-sync` adds `Closes #XX` |
1089
- | **5. Release** | `stable` | `closed` ✅ | PR merges → Issue auto-closes |
1090
-
1091
- #### Auto-Close Workflow Detail
1092
-
1093
- When you run `/alfred:3-sync` to finalize implementation:
1094
-
1095
- 1. **SPEC Issue Detection**: System scans SPEC document for GitHub Issue number
1096
- 2. **Status Validation**: Confirms SPEC status is `completed` or `stable`
1097
- 3. **Closes Reference Generation**: Automatically generates `Closes #XX` in commit message
1098
- 4. **Smart Linking**: Issues PR to SPEC Issue with correlation
1099
- 5. **Auto-Close on Merge**: When PR merges to main branch:
1100
- - GitHub reads `Closes #XX` reference in commit message
1101
- - Automatically transitions Issue to `closed` status
1102
- - SPEC Issue and GitHub Issue statuses now match
1103
-
1104
- **Complete Example Workflow:**
1105
- ```
1106
- Day 1: Create SPEC
1107
- ├─ /alfred:1-plan "User Authentication"
1108
- ├─ SPEC-AUTH-001 created in .moai/specs/SPEC-AUTH-001/
1109
- └─ GitHub Issue #45 auto-created (status: open)
1110
-
1111
- Day 2: Implement Feature
1112
- ├─ /alfred:2-run AUTH-001
1113
- ├─ 🔴 RED: Add failing test @TEST:AUTH-001
1114
- ├─ 🟢 GREEN: Implement minimal solution @CODE:AUTH-001
1115
- ├─ ♻️ REFACTOR: Improve quality per TRUST 5
1116
- ├─ GitHub Issue #45 status: open, developer assignment active
1117
-
1118
- Day 3: Finalize & Sync
1119
- ├─ /alfred:3-sync
1120
- ├─ SPEC status: draft → completed → stable
1121
- ├─ Commit message: "🔖 RELEASE: v0.8.3 ... Closes #45"
1122
- ├─ PR created with automatic Issue linking
1123
- └─ PR merges to main → Issue #45 automatically closed ✅
1124
-
1125
- Result:
1126
- - ✅ SPEC-AUTH-001 fully implemented
1127
- - ✅ All tests passing (85%+ coverage)
1128
- - ✅ Documentation synchronized
1129
- - ✅ GitHub Issue #45 closed
1130
- - ✅ Complete audit trail via git history
1131
- ```
1132
-
1133
- #### Benefits of Automatic Closure
1134
-
1135
- - **Single Source of Truth**: SPEC document status always matches GitHub Issue status
1136
- - **No Manual Updates**: No need to manually close issues (GitHub does it automatically)
1137
- - **Traceable History**: Complete record in git commits shows SPEC→Issue→Close chain
1138
- - **Team Coordination**: Everyone sees status via GitHub, no separate tracking system needed
1139
-
1140
1618
  ### What Gets Synchronized
1141
1619
 
1142
1620
  **From SPEC to GitHub Issue:**
@@ -1381,8 +1859,6 @@ MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and to
1381
1859
  - ✅ SPEC-based test cases (what to test is already defined)
1382
1860
  - ✅ When requirements change, track all affected code with `@SPEC:ID` TAG
1383
1861
 
1384
- 📚 **Learn More**: `.moai/specs/` | [EARS Syntax Guide](./CLAUDE-RULES.md#ears-syntax) | [SPEC Examples](./CLAUDE-PRACTICES.md#spec-examples)
1385
-
1386
1862
  ---
1387
1863
 
1388
1864
  ### Key Concept 2: TDD (Test-Driven Development)
@@ -1419,8 +1895,6 @@ MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and to
1419
1895
  - ✅ Refactoring confidence (always verifiable with tests)
1420
1896
  - ✅ Clear Git history (trace RED → GREEN → REFACTOR process)
1421
1897
 
1422
- 📚 **Learn More**: [TDD Workflow](./CLAUDE-PRACTICES.md#tdd-workflow) | [Test Examples](./CLAUDE-PRACTICES.md#test-examples) | [Quality Gates](./CLAUDE-RULES.md#trust-5-principles)
1423
-
1424
1898
  ---
1425
1899
 
1426
1900
  ### Key Concept 3: @TAG System
@@ -1432,13 +1906,13 @@ MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and to
1432
1906
  **TAG Chain**:
1433
1907
 
1434
1908
  ```
1435
- @SPEC:AUTH-001 (requirements)
1909
+ @SPEC:EX-AUTH-001 (requirements)
1436
1910
 
1437
- @TEST:AUTH-001 (test)
1911
+ @TEST:EX-AUTH-001 (test)
1438
1912
 
1439
- @CODE:AUTH-001 (implementation)
1913
+ @CODE:EX-AUTH-001 (implementation)
1440
1914
 
1441
- @DOC:AUTH-001 (documentation)
1915
+ @DOC:EX-AUTH-001 (documentation)
1442
1916
  ```
1443
1917
 
1444
1918
  **TAG ID Rules**: `<Domain>-<3 digits>`
@@ -1447,36 +1921,6 @@ MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and to
1447
1921
  - USER-001, USER-002...
1448
1922
  - Once assigned, **never change**
1449
1923
 
1450
- **Advanced TAG Usage: Multi-Component TAGs**
1451
-
1452
- For complex features with multiple components, use sub-tags:
1453
-
1454
- ```
1455
- @SPEC:AUTH-001 (complete requirements)
1456
-
1457
- @TEST:AUTH-001 (test suite)
1458
- ├─ @TEST:AUTH-001:login (login flow tests)
1459
- ├─ @TEST:AUTH-001:token (token refresh tests)
1460
- └─ @TEST:AUTH-001:session (session management tests)
1461
-
1462
- @CODE:AUTH-001 (implementation)
1463
- ├─ @CODE:AUTH-001:service (authentication service)
1464
- ├─ @CODE:AUTH-001:model (User/Token models)
1465
- ├─ @CODE:AUTH-001:middleware (auth middleware)
1466
- └─ @CODE:AUTH-001:repository (database access layer)
1467
-
1468
- @DOC:AUTH-001 (documentation)
1469
- ├─ @DOC:AUTH-001:api (API documentation)
1470
- └─ @DOC:AUTH-001:guide (integration guide)
1471
- ```
1472
-
1473
- **Component TAG Rules**:
1474
- - Format: `@TAG:ID` or `@TAG:ID:component`
1475
- - Component names are optional but **highly recommended** for clarity
1476
- - All components share the same ID (never change ID once assigned)
1477
- - When querying: `rg '@TAG:AUTH-001' -n` finds all components
1478
- - Helps organize large features without creating new IDs
1479
-
1480
1924
  **How to Use?** When requirements change:
1481
1925
 
1482
1926
  ```bash
@@ -1495,8 +1939,6 @@ rg '@TAG:AUTH-001' -n
1495
1939
  - ✅ Instantly identify all affected code during refactoring
1496
1940
  - ✅ Code remains understandable 3 months later (trace TAG → SPEC)
1497
1941
 
1498
- 📚 **Learn More**: [TAG System Guide](./CLAUDE-RULES.md#tag-system) | [TAG Validation](./CLAUDE-PRACTICES.md#tag-validation) | [Orphan Detection](./CLAUDE-RULES.md#orphan-tag-detection)
1499
-
1500
1942
  ---
1501
1943
 
1502
1944
  ### Key Concept 4: TRUST 5 Principles
@@ -1542,8 +1984,6 @@ rg '@TAG:AUTH-001' -n
1542
1984
  - ✅ Entire team develops with same standards
1543
1985
  - ✅ Fewer bugs, prevent security vulnerabilities in advance
1544
1986
 
1545
- 📚 **Learn More**: [TRUST 5 Validation](./CLAUDE-RULES.md#trust-5-principles) | [Quality Gates](./CLAUDE-RULES.md#quality-gates) | [Security Best Practices](./CLAUDE-RULES.md#security-guidelines)
1546
-
1547
1987
  ---
1548
1988
 
1549
1989
  ### Key Concept 5: Alfred SuperAgent
@@ -1554,40 +1994,10 @@ rg '@TAG:AUTH-001' -n
1554
1994
 
1555
1995
  **Agent Composition**:
1556
1996
 
1557
- #### 1. Alfred SuperAgent (1)
1558
- - **🎩 Alfred**: Overall orchestration, workflow management, team coordination
1559
-
1560
- #### 2. Core Sub-agents (10)
1561
- Specialized experts handling SPEC → TDD → SYNC pipeline:
1562
-
1563
- | Agent | Role | Responsibility |
1564
- |-------|------|-----------------|
1565
- | **📋 project-manager** | Project Initialization | Setup `.moai/` structure, tech stack detection, Skills deployment |
1566
- | **🏗️ spec-builder** | SPEC Authoring | Write EARS-format specifications, acceptance criteria |
1567
- | **💎 tdd-implementer** | TDD Implementation | RED → GREEN → REFACTOR cycle, test-first development |
1568
- | **📖 doc-syncer** | Documentation Sync | Living docs, README sync, changelog management |
1569
- | **🏷️ tag-agent** | TAG Validation | @TAG chain verification, orphan detection, traceability |
1570
- | **🚀 git-manager** | Git Workflow | Branch management, commits, PR automation, releases |
1571
- | **🔬 debug-helper** | Error Analysis | Stack trace parsing, error diagnosis, fix suggestions |
1572
- | **✅ trust-checker** | TRUST Verification | Test coverage (85%+), code quality, security checks |
1573
- | **🛠️ cc-manager** | Claude Code Config | Session settings, tool permissions, hook management |
1574
- | **📊 implementation-planner** | Strategy Planning | Task decomposition, dependency analysis, parallelization |
1575
-
1576
- #### 3. Specialist Sub-agents (6)
1577
- Domain-specific experts:
1578
-
1579
- - **Language Detection**: Auto-detect Python, TS, Go, Rust, Java from package config
1580
- - **Skills Factory**: Research and integrate new Claude Skills
1581
- - **Template Managers**: Project scaffolding, documentation templates
1582
- - **Quality Gate**: Code review, linting, type checking orchestration
1583
- - **Context Optimizer**: Memory management, JIT context loading
1584
- - **Interactive Questions**: TUI-based user input for AskUserQuestion
1585
-
1586
- #### 4. Built-in Claude Agents (2)
1587
- General-purpose capabilities:
1588
-
1589
- - **General Q&A**: Answer questions about coding, architecture, debugging
1590
- - **Codebase Exploration**: Fast grep/glob searches, code pattern analysis
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)
1591
2001
 
1592
2002
  **55 Claude Skills**:
1593
2003
 
@@ -1638,7 +2048,7 @@ author: @user
1638
2048
  priority: high
1639
2049
  ---
1640
2050
 
1641
- # @SPEC:TODO-001: Todo Management API
2051
+ # @SPEC:EX-TODO-001: Todo Management API
1642
2052
 
1643
2053
  ## Ubiquitous Requirements
1644
2054
  - The system SHALL be able to add todos
@@ -1674,7 +2084,7 @@ The **implementation-planner** Sub-agent decides:
1674
2084
 
1675
2085
  - 📚 Libraries: FastAPI + SQLAlchemy
1676
2086
  - 📁 Folder structure: `src/todo/`, `tests/todo/`
1677
- - 🏷️ TAG design: `@CODE:TODO-001:API`, `@CODE:TODO-001:MODEL`, `@CODE:TODO-001:REPO`
2087
+ - 🏷️ TAG design: `@CODE:EX-TODO-001:API`, `@CODE:EX-TODO-001:MODEL`, `@CODE:EX-TODO-001:REPO`
1678
2088
 
1679
2089
  **Phase 2: RED → GREEN → REFACTOR**
1680
2090
 
@@ -1682,7 +2092,7 @@ The **implementation-planner** Sub-agent decides:
1682
2092
 
1683
2093
  ```python
1684
2094
  # tests/test_todo_api.py
1685
- # @TEST:TODO-001 | SPEC: SPEC-TODO-001.md
2095
+ # @TEST:README-EXAMPLE-TODO | SPEC: SPEC-TODO-001.md
1686
2096
 
1687
2097
  import pytest
1688
2098
  from src.todo.api import create_todo, get_todos
@@ -1724,7 +2134,7 @@ git commit -m "🔴 test(TODO-001): add failing API tests"
1724
2134
 
1725
2135
  ```python
1726
2136
  # src/todo/api.py
1727
- # @CODE:TODO-001:API | SPEC: SPEC-TODO-001.md | TEST: tests/test_todo_api.py
2137
+ # @CODE:EX-TODO-001:API | SPEC: SPEC-TODO-001.md | TEST: tests/test_todo_api.py
1728
2138
 
1729
2139
  from fastapi import FastAPI, HTTPException
1730
2140
  from pydantic import BaseModel
@@ -1738,19 +2148,19 @@ class TodoRequest(BaseModel):
1738
2148
 
1739
2149
  @app.post("/todos", status_code=201)
1740
2150
  def create_todo(todo: TodoRequest):
1741
- """@CODE:TODO-001:API - POST endpoint"""
2151
+ """@CODE:EX-TODO-001:API - POST endpoint"""
1742
2152
  todo_id = str(uuid.uuid4())
1743
2153
  todos_db[todo_id] = {"id": todo_id, "title": todo.title}
1744
2154
  return todos_db[todo_id]
1745
2155
 
1746
2156
  @app.get("/todos")
1747
2157
  def get_todos():
1748
- """@CODE:TODO-001:API - GET all endpoint"""
2158
+ """@CODE:EX-TODO-001:API - GET all endpoint"""
1749
2159
  return list(todos_db.values())
1750
2160
 
1751
2161
  @app.get("/todos/{todo_id}")
1752
2162
  def get_todo(todo_id: str):
1753
- """@CODE:TODO-001:API - GET by ID endpoint"""
2163
+ """@CODE:EX-TODO-001:API - GET by ID endpoint"""
1754
2164
  if todo_id not in todos_db:
1755
2165
  raise HTTPException(status_code=404, detail="Todo not found")
1756
2166
  return todos_db[todo_id]
@@ -1769,7 +2179,7 @@ git commit -m "🟢 feat(TODO-001): implement minimal Todo API"
1769
2179
 
1770
2180
  ```python
1771
2181
  # src/todo/models.py
1772
- # @CODE:TODO-001:MODEL | SPEC: SPEC-TODO-001.md
2182
+ # @CODE:EX-TODO-001:MODEL | SPEC: SPEC-TODO-001.md
1773
2183
 
1774
2184
  from datetime import datetime
1775
2185
  from sqlalchemy import Column, String, DateTime
@@ -1778,7 +2188,7 @@ from sqlalchemy.ext.declarative import declarative_base
1778
2188
  Base = declarative_base()
1779
2189
 
1780
2190
  class Todo(Base):
1781
- """@CODE:TODO-001:MODEL - Todo data model"""
2191
+ """@CODE:EX-TODO-001:MODEL - Todo data model"""
1782
2192
  __tablename__ = "todos"
1783
2193
 
1784
2194
  id = Column(String, primary_key=True)
@@ -1786,7 +2196,7 @@ class Todo(Base):
1786
2196
  created_at = Column(DateTime, default=datetime.utcnow) # Auto creation time
1787
2197
 
1788
2198
  def validate(self):
1789
- """@CODE:TODO-001:MODEL - Validation"""
2199
+ """@CODE:EX-TODO-001:MODEL - Validation"""
1790
2200
  if not self.title or len(self.title) > 200:
1791
2201
  raise ValueError("Title must be 1-200 characters")
1792
2202
  ```
@@ -1822,10 +2232,10 @@ git commit -m "♻️ refactor(TODO-001): add database models and validation"
1822
2232
  1. **TAG Chain Validation**
1823
2233
 
1824
2234
  ```bash
1825
- ✅ @SPEC:TODO-001 → .moai/specs/SPEC-TODO-001/spec.md
1826
- ✅ @TEST:TODO-001 → tests/test_todo_api.py
1827
- ✅ @CODE:TODO-001 → src/todo/ (3 files)
1828
- ✅ @DOC:TODO-001 → docs/api/todo.md (auto-generated)
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)
1829
2239
 
1830
2240
  TAG Chain Integrity: 100%
1831
2241
  Orphan TAGs: None
@@ -1834,7 +2244,7 @@ git commit -m "♻️ refactor(TODO-001): add database models and validation"
1834
2244
  2. **Living Document Generation**
1835
2245
 
1836
2246
  ```markdown
1837
- # @DOC:TODO-001: Todo Management API
2247
+ # @DOC:EX-TODO-001: Todo Management API
1838
2248
 
1839
2249
  ## Overview
1840
2250
 
@@ -1848,8 +2258,8 @@ git commit -m "♻️ refactor(TODO-001): add database models and validation"
1848
2258
  - URL: /todos
1849
2259
  - Request: {"title": "string (1-200 chars)"}
1850
2260
  - Response: 201 Created with todo object
1851
- - Implemented in: @CODE:TODO-001:API
1852
- - Tested in: @TEST:TODO-001
2261
+ - Implemented in: @CODE:EX-TODO-001:API
2262
+ - Tested in: @TEST:README-EXAMPLE-TODO
1853
2263
 
1854
2264
  ### Get All Todos
1855
2265
 
@@ -1877,7 +2287,7 @@ git commit -m "♻️ refactor(TODO-001): add database models and validation"
1877
2287
 
1878
2288
  ### Added
1879
2289
 
1880
- - Todo Management API with CRUD operations (@SPEC:TODO-001)
2290
+ - Todo Management API with CRUD operations (@SPEC:EX-TODO-001)
1881
2291
  - Create new todos
1882
2292
  - List all todos
1883
2293
  - Update existing todos
@@ -1899,11 +2309,11 @@ Let's verify everything generated is properly connected:
1899
2309
  rg '@(SPEC|TEST|CODE|DOC):TODO-001' -n
1900
2310
 
1901
2311
  # Output:
1902
- # .moai/specs/SPEC-TODO-001/spec.md:1: # @SPEC:TODO-001: Todo Management API
1903
- # tests/test_todo_api.py:2: # @TEST:TODO-001 | SPEC: SPEC-TODO-001.md
1904
- # src/todo/api.py:5: # @CODE:TODO-001:API | SPEC: SPEC-TODO-001.md
1905
- # src/todo/models.py:5: # @CODE:TODO-001:MODEL | SPEC: SPEC-TODO-001.md
1906
- # docs/api/todo.md:1: # @DOC:TODO-001: Todo Management API
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
1907
2317
 
1908
2318
 
1909
2319
  # 2️⃣ Run tests
@@ -1933,21 +2343,21 @@ git log --oneline | head -5
1933
2343
 
1934
2344
  ```
1935
2345
  ✅ SPEC written (3 minutes)
1936
- └─ @SPEC:TODO-001 TAG assigned
2346
+ └─ @SPEC:EX-TODO-001 TAG assigned
1937
2347
  └─ Clear requirements in EARS format
1938
2348
 
1939
2349
  ✅ TDD implementation (5 minutes)
1940
2350
  └─ 🔴 RED: Tests written first
1941
2351
  └─ 🟢 GREEN: Minimal implementation
1942
2352
  └─ ♻️ REFACTOR: Quality improvement
1943
- └─ @TEST:TODO-001, @CODE:TODO-001 TAGs assigned
2353
+ └─ @TEST:README-EXAMPLE-TODO, @CODE:EX-TODO-001 TAGs assigned
1944
2354
  └─ 87% coverage, TRUST 5 principles verified
1945
2355
 
1946
2356
  ✅ Documentation sync (1 minute)
1947
2357
  └─ Living Document auto-generated
1948
2358
  └─ README, CHANGELOG updated
1949
2359
  └─ TAG chain validation complete
1950
- └─ @DOC:TODO-001 TAG assigned
2360
+ └─ @DOC:EX-TODO-001 TAG assigned
1951
2361
  └─ PR status: Draft → Ready for Review
1952
2362
 
1953
2363
  Result:
@@ -1973,16 +2383,33 @@ Alfred works by combining multiple specialized agents with Claude Skills.
1973
2383
  | Sub-agent | Model | Role |
1974
2384
  | ------------------ | ------ | ----------------------------------------------------------------------- |
1975
2385
  | project-manager 📋 | Sonnet | Project initialization, metadata interviews |
1976
- | spec-builder 🏗️ | Sonnet | Plan board, EARS SPEC authoring |
2386
+ | spec-builder 🏗️ | Sonnet | Plan board, EARS SPEC authoring, expert consultation recommendations |
1977
2387
  | code-builder 💎 | Sonnet | Performs complete TDD with `implementation-planner` + `tdd-implementer` |
1978
2388
  | doc-syncer 📖 | Haiku | Living Doc, README, CHANGELOG sync |
1979
- | tag-agent 🏷️ | Haiku | TAG inventory, orphan detection |
2389
+ | tag-agent 🏷️ | Haiku | TAG inventory, orphan detection, @EXPERT TAG validation |
1980
2390
  | git-manager 🚀 | Haiku | GitFlow, Draft/Ready, Auto Merge |
1981
2391
  | debug-helper 🔍 | Sonnet | Failure analysis, fix-forward strategy |
1982
2392
  | trust-checker ✅ | Haiku | TRUST 5 quality gate |
1983
2393
  | quality-gate 🛡️ | Haiku | Coverage change and release blocker review |
1984
2394
  | cc-manager 🛠️ | Sonnet | Claude Code session optimization, Skill deployment |
1985
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
+
1986
2413
  ### Skills (Progressive Disclosure - v0.4 New!)
1987
2414
 
1988
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.
@@ -2035,6 +2462,7 @@ Specialized domain expertise
2035
2462
  | `moai-domain-cli-tool` | CLI tool development, argument parsing, POSIX compliance, user-friendly help messages |
2036
2463
  | `moai-domain-data-science` | Data analysis, visualization, statistical modeling, reproducible research workflows |
2037
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 |
2038
2466
  | `moai-domain-devops` | CI/CD pipelines, Docker containerization, Kubernetes orchestration, IaC |
2039
2467
  | `moai-domain-frontend` | React/Vue/Angular development, state management, performance optimization, accessibility |
2040
2468
  | `moai-domain-ml` | Machine learning model training, evaluation, deployment, MLOps workflows |
@@ -2158,42 +2586,7 @@ Or when TAGs are missing:
2158
2586
 
2159
2587
  **Why It Matters**: Prevents data loss from mistakes and ensures @TAG traceability. You can always restore from the checkpoint if something goes wrong.
2160
2588
 
2161
- #### 3. PostToolUse (After Tool Execution)
2162
-
2163
- **Triggers**: After executing file edits, code changes, or MultiEdit operations
2164
- **Purpose**: Automatically run tests to verify changes didn't break anything
2165
-
2166
- **Auto-Test Execution**:
2167
-
2168
- Supported Languages (9 total):
2169
- - 🐍 **Python**: `pytest` with coverage report
2170
- - 📘 **TypeScript/JavaScript**: `Vitest` or `Jest`
2171
- - 🐹 **Go**: `go test` with `-v` flag
2172
- - 🦀 **Rust**: `cargo test` with `--all`
2173
- - ☕ **Java**: `JUnit` via Maven/Gradle
2174
- - 🎯 **Kotlin**: `JUnit` with Gradle
2175
- - 🍎 **Swift**: `XCTest` via Xcode
2176
- - 🎨 **Dart**: `flutter test`
2177
-
2178
- **What You See**:
2179
-
2180
- ```
2181
- ✅ Tests passed (47 passed in 2.3s)
2182
- Coverage: 87% (improved from 84%)
2183
- ```
2184
-
2185
- Or if tests fail:
2186
-
2187
- ```
2188
- ❌ Test failures detected
2189
- ├─ src/auth/service.test.ts:23
2190
- │ Expected token.length > 0
2191
- └─ Revert to previous version? (y/n)
2192
- ```
2193
-
2194
- **Why It Matters**: Instant feedback on code quality. Catches breaking changes immediately before you commit.
2195
-
2196
- #### 4. UserPromptSubmit (Prompt Input)
2589
+ #### 3. UserPromptSubmit (Prompt Input)
2197
2590
 
2198
2591
  **Triggers**: When you submit a prompt to Claude
2199
2592
  **Purpose**: JIT (Just-In-Time) context loading—automatically add relevant files
@@ -2207,7 +2600,7 @@ Or if tests fail:
2207
2600
 
2208
2601
  **Why It Matters**: Saves time and ensures Claude has all the relevant context for your request.
2209
2602
 
2210
- #### 5. SessionEnd (Session Cleanup)
2603
+ #### 4. SessionEnd (Session Cleanup)
2211
2604
 
2212
2605
  **Triggers**: When you close your Claude Code session
2213
2606
  **Purpose**: Cleanup tasks and state preservation
@@ -2296,7 +2689,6 @@ If you need to temporarily disable hooks, edit `.claude/settings.json`:
2296
2689
 
2297
2690
  | Version | Key Features | Date |
2298
2691
  | ----------- | ------------------------------------------------------------------------------------------------ | ---------- |
2299
- | **v0.8.3** | 🔄 4-Step Workflow Logic (Intent → Plan → Execute → Report) + AI decision framework | 2025-10-30 |
2300
2692
  | **v0.8.2** | 📖 EARS terminology update: "Constraints" → "Unwanted Behaviors" for clarity | 2025-10-29 |
2301
2693
  | **v0.8.1** | 🔄 Command rename: `/alfred:9-help` → `/alfred:9-feedback` + User feedback workflow improvements | 2025-10-28 |
2302
2694
  | **v0.8.0** | 🏷️ @DOC TAG auto-generation system + SessionStart version check enhancement | 2025-10-27 |
@@ -2310,12 +2702,331 @@ If you need to temporarily disable hooks, edit `.claude/settings.json`:
2310
2702
 
2311
2703
  ---
2312
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
+
2313
3024
  ## Additional Resources
2314
3025
 
2315
3026
  | Purpose | Resource |
2316
3027
  | ------------------------- | --------------------------------------------------------------- |
2317
- | Skills detailed structure | `.claude/skills/` directory (55+ Skills) |
2318
- | Sub-agent details | `.claude/agents/alfred/` directory (12 agents) |
3028
+ | Skills detailed structure | `.claude/skills/` directory (74 Skills) |
3029
+ | Sub-agent details | `.claude/agents/alfred/` directory (16 agents + 4 commands) |
2319
3030
  | Workflow guide | `.claude/commands/alfred/` (4 commands: 0-project ~ 3-sync) |
2320
3031
  | Documentation | Coming soon (see `.moai/`, `.claude/`, `docs/` in your project) |
2321
3032
  | Release notes | GitHub Releases: https://github.com/modu-ai/moai-adk/releases |