moai-adk 0.3.13__py3-none-any.whl → 0.4.1__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (141) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +1 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/doctor.py +2 -2
  5. moai_adk/cli/commands/init.py +10 -5
  6. moai_adk/cli/commands/status.py +1 -1
  7. moai_adk/cli/commands/update.py +210 -8
  8. moai_adk/cli/prompts/init_prompts.py +15 -19
  9. moai_adk/core/__init__.py +1 -1
  10. moai_adk/core/diagnostics/slash_commands.py +1 -1
  11. moai_adk/core/git/branch.py +1 -1
  12. moai_adk/core/git/manager.py +1 -1
  13. moai_adk/core/project/backup_utils.py +1 -0
  14. moai_adk/core/project/phase_executor.py +3 -1
  15. moai_adk/core/project/validator.py +3 -2
  16. moai_adk/core/quality/__init__.py +1 -1
  17. moai_adk/core/quality/trust_checker.py +1 -1
  18. moai_adk/core/quality/validators/__init__.py +1 -1
  19. moai_adk/core/quality/validators/base_validator.py +1 -1
  20. moai_adk/core/template/__init__.py +1 -1
  21. moai_adk/core/template/backup.py +12 -3
  22. moai_adk/core/template/config.py +24 -0
  23. moai_adk/core/template/languages.py +1 -1
  24. moai_adk/core/template/merger.py +74 -4
  25. moai_adk/core/template/processor.py +62 -14
  26. moai_adk/templates/.claude/agents/alfred/cc-manager.md +765 -191
  27. moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
  28. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
  29. moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
  30. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
  31. moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
  32. moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
  33. moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
  34. moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
  35. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
  36. moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
  37. moai_adk/templates/.claude/commands/alfred/0-project.md +856 -355
  38. moai_adk/templates/.claude/commands/alfred/1-plan.md +572 -0
  39. moai_adk/templates/.claude/commands/alfred/2-run.md +470 -0
  40. moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
  41. moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
  42. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
  43. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
  44. moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
  45. moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
  46. moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
  47. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
  48. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
  49. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +30 -51
  50. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
  51. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
  52. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
  53. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
  54. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
  55. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
  67. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +94 -0
  68. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
  69. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +433 -0
  70. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
  71. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
  72. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +363 -0
  73. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +595 -0
  74. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +496 -0
  75. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +99 -0
  76. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +95 -0
  77. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +98 -0
  78. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +100 -0
  79. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +100 -0
  80. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +99 -0
  81. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +99 -0
  82. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +93 -0
  83. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +105 -0
  84. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -0
  85. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +102 -0
  86. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +104 -0
  87. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +96 -0
  88. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +112 -0
  89. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +98 -0
  90. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +90 -0
  91. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +94 -0
  92. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +93 -0
  93. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +86 -0
  94. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +86 -0
  95. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +100 -0
  96. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +100 -0
  97. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +102 -0
  98. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +100 -0
  99. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +98 -0
  100. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +99 -0
  101. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +100 -0
  102. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +100 -0
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +98 -0
  104. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +96 -0
  105. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +98 -0
  106. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +99 -0
  107. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +98 -0
  108. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +98 -0
  109. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +96 -0
  110. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +99 -0
  111. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +99 -0
  112. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +100 -0
  113. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +100 -0
  114. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +100 -0
  115. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +100 -0
  116. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +99 -0
  117. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +96 -0
  118. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
  120. moai_adk/templates/.moai/config.json +9 -6
  121. moai_adk/templates/.moai/memory/development-guide.md +220 -221
  122. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
  123. moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
  124. moai_adk/templates/.moai/project/product.md +90 -90
  125. moai_adk/templates/.moai/project/structure.md +85 -85
  126. moai_adk/templates/.moai/project/tech.md +117 -117
  127. moai_adk/templates/CLAUDE.md +354 -573
  128. moai_adk/templates/__init__.py +1 -1
  129. moai_adk/utils/__init__.py +1 -1
  130. moai_adk/utils/banner.py +7 -7
  131. moai_adk/utils/logger.py +1 -1
  132. moai_adk-0.4.1.dist-info/METADATA +303 -0
  133. moai_adk-0.4.1.dist-info/RECORD +152 -0
  134. moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -532
  135. moai_adk/templates/.claude/commands/alfred/2-build.md +0 -432
  136. moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
  137. moai_adk-0.3.13.dist-info/METADATA +0 -1586
  138. moai_adk-0.3.13.dist-info/RECORD +0 -90
  139. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
  140. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
  141. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: alfred:0-project
3
- description: 프로젝트 문서 초기화 - product/structure/tech.md 생성 언어별 최적화 설정
3
+ description: Initialize project document - create product/structure/tech.md and set optimization for each language
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Write
@@ -15,197 +15,408 @@ allowed-tools:
15
15
  - Task
16
16
  ---
17
17
 
18
- # 📋 MoAI-ADK 0단계: 범용 언어 지원 프로젝트 문서 초기화/갱신
18
+ # 📋 MoAI-ADK Step 0: Initialize/Update Universal Language Support Project Documentation
19
+ > Interactive prompts rely on `Skill("moai-alfred-tui-survey")` so AskUserQuestion renders TUI selection menus for user surveys and approvals.
19
20
 
20
- ## 🎯 커맨드 목적
21
+ ## 🎯 Command Purpose
21
22
 
22
- 프로젝트 환경을 자동 분석하여 product/structure/tech.md 문서를 생성/갱신하고 언어별 최적화 설정을 구성합니다.
23
+ Automatically analyzes the project environment to create/update product/structure/tech.md documents and configure language-specific optimization settings.
23
24
 
24
- ## 📋 실행 흐름
25
+ ## 📋 Execution flow
25
26
 
26
- 1. **환경 분석**: 프로젝트 유형(신규/레거시) 언어 자동 감지
27
- 2. **인터뷰 전략 수립**: 프로젝트 특성에 맞는 질문 트리 선택
28
- 3. **사용자 확인**: 인터뷰 계획 검토 승인
29
- 4. **프로젝트 문서 작성**: product/structure/tech.md 생성
30
- 5. **설정 파일 생성**: config.json 자동 구성
27
+ 1. **Environment Analysis**: Automatically detect project type (new/legacy) and language
28
+ 2. **Establishment of interview strategy**: Select question tree suited to project characteristics
29
+ 3. **User Verification**: Review and approve interview plan
30
+ 4. **Create project documentation**: Create product/structure/tech.md
31
+ 5. **Create configuration file**: config.json auto-configuration
31
32
 
32
- ## 🔗 연관 에이전트
33
+ ## 🧠 Skill Loadout Overview
33
34
 
34
- - **Primary**: project-manager (📋 기획자) - 프로젝트 초기화 전담
35
- - **Quality Check**: trust-checker (✅ 품질 보증 리드) - 초기 구조 검증 (선택적)
36
- - **Secondary**: None (독립 실행)
35
+ | Agent | Auto core skill | Conditional skills |
36
+ | ----- | ---------------- | ------------------ |
37
+ | project-manager | Skill("moai-alfred-language-detection") | Skill("moai-foundation-ears"), Skill("moai-foundation-langs"), Detected domain skill (e.g., Skill("moai-domain-backend")), Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tui-survey") |
38
+ | trust-checker | Skill("moai-alfred-trust-validation") | Skill("moai-alfred-tag-scanning"), Skill("moai-foundation-trust"), Skill("moai-alfred-code-reviewer"), Skill("moai-alfred-performance-optimizer"), Skill("moai-alfred-tui-survey") |
37
39
 
38
- ## 💡 사용 예시
40
+ ## 🔗 Associated Agent
39
41
 
40
- 사용자가 `/alfred:8-project` 커맨드를 실행하여 프로젝트 분석 문서 생성/갱신을 수행합니다.
42
+ - **Primary**: project-manager (📋 planner) - Dedicated to project initialization
43
+ - **Quality Check**: trust-checker (✅ Quality assurance lead) - Initial structural verification (optional)
44
+ - **Secondary**: None (standalone execution)
41
45
 
42
- ## 명령어 개요
46
+ ## 💡 Example of use
43
47
 
44
- 프로젝트 환경을 분석하고 product/structure/tech.md 문서를 생성/갱신하는 체계적인 초기화 시스템입니다.
48
+ The user executes the `/alfred:8-project` command to analyze the project and create/update documents.
45
49
 
46
- - **언어 자동 감지**: Python, TypeScript, Java, Go, Rust 등 자동 인식
47
- - **프로젝트 유형 분류**: 신규 vs 기존 프로젝트 자동 판단
48
- - **고성능 초기화**: TypeScript 기반 CLI로 0.18초 초기화 달성
49
- - **2단계 워크플로우**: 1) 분석 및 계획 → 2) 사용자 승인 후 실행
50
+ ## Command Overview
50
51
 
51
- ## 사용법
52
+ It is a systematic initialization system that analyzes the project environment and creates/updates product/structure/tech.md documents.
52
53
 
53
- 사용자가 `/alfred:8-project` 커맨드를 실행하여 프로젝트 분석 문서 생성/갱신을 시작합니다.
54
+ - **Automatically detect language**: Automatically recognize Python, TypeScript, Java, Go, Rust, etc.
55
+ - **Project type classification**: Automatically determine new vs. existing projects
56
+ - **High-performance initialization**: Achieve 0.18 second initialization with TypeScript-based CLI
57
+ - **2-step workflow**: 1) Analysis and planning → 2) Execution after user approval
54
58
 
55
- **자동 처리**:
56
- - 기존 `.moai/project/` 문서가 있으면 갱신 모드
57
- - 문서가 없으면 신규 생성 모드
58
- - 언어 및 프로젝트 유형은 자동 감지
59
+ ## How to use
59
60
 
60
- ## ⚠️ 금지 사항
61
+ The user executes the `/alfred:8-project` command to start analyzing the project and creating/updating documents.
61
62
 
62
- **절대 하지 말아야 할 작업**:
63
+ **Automatic processing**:
64
+ - Update mode if there is an existing `.moai/project/` document
65
+ - New creation mode if there is no document
66
+ - Automatic detection of language and project type
63
67
 
64
- - `.claude/memory/` 디렉토리에 파일 생성
65
- - ❌ `.claude/commands/alfred/*.json` 파일 생성
66
- - ❌ 기존 문서 불필요한 덮어쓰기
67
- - ❌ 날짜와 수치 예측 ("3개월 내", "50% 단축" 등)
68
- - ❌ 가상의 시나리오, 예상 시장 규모, 미래 기술 트렌드 예측
68
+ ## ⚠️ Prohibitions
69
69
 
70
- **사용해야 표현**:
70
+ **What you should never do**:
71
71
 
72
- - "우선순위 높음/중간/낮음"
73
- - "즉시 필요", "단계적 개선"
74
- - 현재 확인 가능한 사실
75
- - 기존 기술 스택
76
- - 실제 문제점
72
+ - Create a file in the `.claude/memory/` directory
73
+ - Create a file `.claude/commands/alfred/*.json`
74
+ - Unnecessary overwriting of existing documents
75
+ - Date and numerical prediction (“within 3 months”, “50% reduction”) etc.)
76
+ - Hypothetical scenarios, expected market size, future technology trend predictions
77
77
 
78
- ## 🚀 STEP 1: 환경 분석 및 인터뷰 계획 수립
78
+ **Expressions to use**:
79
79
 
80
- 프로젝트 환경을 분석하고 체계적인 인터뷰 계획을 수립합니다.
80
+ - “High/medium/low priority”
81
+ - ✅ “Immediately needed”, “step-by-step improvements”
82
+ - ✅ Current facts
83
+ - ✅ Existing technology stack
84
+ - ✅ Real problems
81
85
 
82
- ### 1.1 프로젝트 환경 분석 실행
86
+ ## 🚀 STEP 1: Environmental analysis and interview plan development
83
87
 
84
- **자동 분석 항목**:
88
+ Analyze the project environment and develop a systematic interview plan.
85
89
 
86
- 1. **프로젝트 유형 감지**
87
- Alfred는 디렉토리 구조를 분석하여 신규 vs 기존 프로젝트를 분류합니다:
88
- - 빈 디렉토리 → 신규 프로젝트
89
- - 코드/문서 존재 → 기존 프로젝트
90
+ ### 1.0 Check backup directory (highest priority)
90
91
 
91
- 2. **언어/프레임워크 자동 감지**: 파일 패턴을 기반으로 프로젝트의 주요 언어를 감지합니다
92
+ **Processing backup files after moai-adk init reinitialization**
93
+
94
+ Alfred first checks the `.moai-backups/` directory:
95
+
96
+ ```bash
97
+ # Check latest backup timestamp
98
+ ls -t .moai-backups/ | head -1
99
+
100
+ # Check the optimized flag in config.json
101
+ grep "optimized" .moai/config.json
102
+ ```
103
+
104
+ **Backup existence conditions**:
105
+ - `.moai-backups/` directory exists
106
+ - `.moai/project/*.md` file exists in the latest backup folder
107
+ - `optimized: false` in `config.json` (immediately after reinitialization)
108
+
109
+ **Select user if backup exists**
110
+ Call `Skill("moai-alfred-tui-survey")` to display a TUI with the following options:
111
+ - **Merge**: Merge backup contents and latest template (recommended)
112
+ - **New**: Ignore the backup and start a new interview
113
+ - **Skip**: Keep current file (terminate task)
114
+
115
+ **Response processing**:
116
+ - **"Merge"** → Proceed to Phase 1.1 (backup merge workflow)
117
+ - **"Create new"** → Proceed to Phase 1.2 (Project environment analysis) (existing process)
118
+ - **"Skip"** → End task
119
+
120
+ **No backup or optimized: true**:
121
+ - Proceed directly to Phase 1.2 (project environment analysis)
122
+
123
+ ---
124
+
125
+ ### 1.1 Backup merge workflow (when user selects “Merge”)
126
+
127
+ **Purpose**: Restore only user customizations while maintaining the latest template structure.
128
+
129
+ **STEP 1: Read backup file**
130
+
131
+ Alfred reads files from the latest backup directory:
132
+ ```bash
133
+ # Latest backup directory path
134
+ BACKUP_DIR=.moai-backups/$(ls -t .moai-backups/ | head -1)
135
+
136
+ # Read backup file
137
+ Read $BACKUP_DIR/.moai/project/product.md
138
+ Read $BACKUP_DIR/.moai/project/structure.md
139
+ Read $BACKUP_DIR/.moai/project/tech.md
140
+ Read $BACKUP_DIR/CLAUDE.md
141
+ ```
142
+
143
+ **STEP 2: Detect template defaults**
144
+
145
+ The following patterns are considered "template defaults" (not merged):
146
+ - "Define your key user base"
147
+ - "Describe the core problem you are trying to solve"
148
+ - "List the strengths and differences of your project"
149
+ - "{{PROJECT_NAME}}", "{{PROJECT_DESCRIPTION}}", etc. Variable format
150
+ - Guide phrases such as "Example:", "Sample:", "Example:", etc.
151
+
152
+ **STEP 3: Extract user customization**
153
+
154
+ Extract only **non-template default content** from the backup file:
155
+ - `product.md`:
156
+ - Define your actual user base in the USER section
157
+ - Describe the actual problem in the PROBLEM section
158
+ - Real differences in the STRATEGY section
159
+ - Actual success metrics in the SUCCESS section
160
+ - `structure.md`:
161
+ - Actual design in the ARCHITECTURE section
162
+ - Actual module structure in the MODULES section
163
+ - Actual integration plan in the INTEGRATION section
164
+ - `tech.md`:
165
+ - The actual technology stack
166
+ in the STACK section - The actual framework
167
+ in the FRAMEWORK section - The actual quality policy
168
+ in the QUALITY section - `HISTORY` section: **Full Preservation** (all files)
169
+
170
+ **STEP 4: Merge Strategy**
171
+
172
+ ```markdown
173
+ Latest template structure (v0.4.0+)
174
+
175
+ Insert user customization (extracted from backup file)
176
+
177
+ HISTORY section updates
178
+
179
+ Version update (v0.1.x → v0.1.x+1)
180
+ ```
181
+
182
+ **Merge Principle**:
183
+ - ✅ Maintain the latest version of the template structure (section order, header, @TAG format)
184
+ - ✅ Insert only user customization (actual content written)
185
+ - ✅ Cumulative preservation of the HISTORY section (existing history + merge history)
186
+ - ❌ Replace template default values ​​with the latest version
187
+
188
+ **STEP 5: HISTORY Section Update**
189
+
190
+ After the merge is complete, add history to the HISTORY section of each file:
191
+ ```yaml
192
+ ### v0.1.x+1 (2025-10-19)
193
+ - **UPDATED**: Merge backup files (automatic optimization)
194
+ - AUTHOR: @Alfred
195
+ - BACKUP: .moai-backups/20251018-003638/
196
+ - REASON: Restoring user customization after moai-adk init reinitialization
197
+ ```
198
+
199
+ **STEP 6: Update config.json**
200
+
201
+ Set optimization flags after the merge is complete:
202
+ ```json
203
+ {
204
+ "project": {
205
+ "optimized": true,
206
+ "last_merge": "2025-10-19T12:34:56+09:00",
207
+ "backup_source": ".moai-backups/20251018-003638/"
208
+ }
209
+ }
210
+ ```
211
+
212
+ **STEP 7: Completion Report**
213
+
214
+ ```markdown
215
+ ✅ Backup merge completed!
216
+
217
+ 📁 Merged files:
218
+ - .moai/project/product.md (v0.1.4 → v0.1.5)
219
+ - .moai/project/structure.md (v0.1.1 → v0.1.2)
220
+ - .moai/project/tech.md (v0.1.1 → v0.1.2)
221
+ - .moai/config.json (optimized: false → true)
222
+
223
+ 🔍 Merge history:
224
+ - USER section: Restore customized contents of backup file
225
+ - PROBLEM section: Restore problem description of backup file
226
+ - STRATEGY section: Restore differentials of backup file
227
+ - HISTORY section: Add merge history (cumulative retention)
228
+
229
+ 💾 Backup file location:
230
+ - Original backup: .moai-backups/20251018-003638/
231
+ - Retention period: Permanent (until manual deletion)
232
+
233
+ 📋 Next steps:
234
+ 1. Review the merged document
235
+ 2. Additional modifications if necessary
236
+ 3. Create your first SPEC with /alfred:1-plan
237
+
238
+ ---
239
+ **Task completed: /alfred:0-project terminated**
240
+ ```
241
+
242
+ **Finish work after merge**: Complete immediately without interview
243
+
244
+ ---
245
+
246
+ ### 1.2 Run project environment analysis (when user selects "New" or no backup)
247
+
248
+ **Automatically analyzed items**:
249
+
250
+ 1. **Project Type Detection**
251
+ Alfred classifies new vs existing projects by analyzing the directory structure:
252
+ - Empty directory → New project
253
+ - Code/documentation present → Existing project
254
+
255
+ 2. **Auto-detect language/framework**: Detects the main language of your project based on file patterns
92
256
  - pyproject.toml, requirements.txt → Python
93
257
  - package.json, tsconfig.json → TypeScript/Node.js
94
258
  - pom.xml, build.gradle → Java
95
259
  - go.mod → Go
96
260
  - Cargo.toml → Rust
97
- - backend/ + frontend/ → 풀스택
261
+ - backend/ + frontend/ → full stack
98
262
 
99
- 3. **문서 현황 분석**
100
- - 기존 `.moai/project/*.md` 파일 상태 확인
101
- - 부족한 정보 영역 식별
102
- - 보완 필요 항목 정리
263
+ 3. **Document status analysis**
264
+ - Check the status of existing `.moai/project/*.md` files
265
+ - Identify areas of insufficient information
266
+ - Organize items that need supplementation
103
267
 
104
- 4. **프로젝트 구조 평가**
105
- - 디렉토리 구조 복잡도
106
- - 단일 언어 vs 하이브리드 vs 마이크로서비스
107
- - 코드 기반 크기 추정
268
+ 4. **Project structure evaluation**
269
+ - Directory structure complexity
270
+ - Monolingual vs. hybrid vs. microservice
271
+ - Code base size estimation
108
272
 
109
- ### 1.2 인터뷰 전략 수립
273
+ ### 1.3 Establish interview strategy (when user selects “New”)
110
274
 
111
- **프로젝트 유형별 질문 트리 선택**:
275
+ **Select question tree by project type**:
112
276
 
113
- | 프로젝트 유형 | 질문 카테고리 | 중점 영역 |
114
- |-------------|-------------|----------|
115
- | **신규 프로젝트** | Product Discovery | 미션, 사용자, 해결 문제 |
116
- | **기존 프로젝트** | Legacy Analysis | 코드 기반, 기술 부채, 통합점 |
117
- | **TypeScript 전환** | Migration Strategy | 기존 프로젝트의 TypeScript 전환 |
277
+ | Project Type | Question Category | Focus Areas |
278
+ | ------------------------- | ------------------ | --------------------------------------------- |
279
+ | **New Project** | Product Discovery | Mission, Users, Problems Solved |
280
+ | **Existing Project** | Legacy Analysis | Code Base, Technical Debt, Integration Points |
281
+ | **TypeScript conversion** | Migration Strategy | TypeScript conversion for existing projects |
118
282
 
119
- **질문 우선순위**:
120
- - **필수 질문**: 핵심 비즈니스 가치, 주요 사용자층 (모든 프로젝트)
121
- - **기술 질문**: 언어/프레임워크, 품질 정책, 배포 전략
122
- - **거버넌스**: 보안 요구사항, 추적성 전략 (선택적)
283
+ **Question Priority**:
284
+ - **Essential Questions**: Core Business Value, Key User Bases (all projects)
285
+ - **Technical Questions**: Language/Framework, Quality Policy, Deployment Strategy
286
+ - **Governance**: Security Requirements, Traceability Strategy (Optional)
123
287
 
124
- ### 1.3 인터뷰 계획 보고서 생성
288
+ ### 1.4 Generate Interview Plan Report (when user selects “Create New”)
125
289
 
126
- **사용자에게 제시할 계획서 포맷**:
290
+ **Format of plan to be presented to users**:
127
291
 
128
292
  ```markdown
129
- ## 📊 프로젝트 초기화 계획: [PROJECT-NAME]
130
-
131
- ### 환경 분석 결과
132
- - **프로젝트 유형**: [신규/기존/하이브리드]
133
- - **감지된 언어**: [언어 목록]
134
- - **현재 문서 상태**: [완성도 평가 0-100%]
135
- - **구조 복잡도**: [단순/중간/복잡]
136
-
137
- ### 🎯 인터뷰 전략
138
- - **질문 카테고리**: Product Discovery / Structure / Tech
139
- - **예상 질문 수**: [N (필수 M + 선택 K개)]
140
- - **예상 소요시간**: [시간 산정]
141
- - **우선순위 영역**: [중점적으로 다룰 영역]
142
-
143
- ### ⚠️ 주의사항
144
- - **기존 문서**: [덮어쓰기 vs 보완 전략]
145
- - **언어 설정**: [자동 감지 vs 수동 설정]
146
- - **설정 충돌**: [기존 config.json과의 호환성]
147
-
148
- ### ✅ 예상 산출물
149
- - **product.md**: [비즈니스 요구사항 문서]
150
- - **structure.md**: [시스템 아키텍처 문서]
151
- - **tech.md**: [기술 스택 정책 문서]
152
- - **config.json**: [프로젝트 설정 파일]
293
+ ## 📊 Project initialization plan: [PROJECT-NAME]
294
+
295
+ ### Environmental Analysis Results
296
+ - **Project Type**: [New/Existing/Hybrid]
297
+ - **Languages ​​Detected**: [Language List]
298
+ - **Current Document Status**: [Completeness Rating 0-100%]
299
+ - **Structure Complexity**: [Simple/Medium/Complex]
300
+
301
+ ### 🎯 Interview strategy
302
+ - **Question category**: Product Discovery / Structure / Tech
303
+ - **Expected number of questions**: [N (M required + K optional)]
304
+ - **Estimated time required**: [Time estimation]
305
+ - **Priority area**: [Focus on Areas to be covered]
306
+
307
+ ### ⚠️ Notes
308
+ - **Existing document**: [Overwrite vs supplementation strategy]
309
+ - **Language settings**: [Automatic detection vs manual setting]
310
+ - **Configuration conflicts**: [Compatibility with existing config.json]
311
+
312
+ ### ✅ Expected deliverables
313
+ - **product.md**: [Business requirements document]
314
+ - **structure.md**: [System architecture document]
315
+ - **tech.md**: [Technology stack and policy document]
316
+ - **config.json**: [Project configuration file]
153
317
 
154
318
  ---
155
- **승인 요청**: 계획으로 인터뷰를 진행하시겠습니까?
156
- ("진행", "수정 [내용]", "중단" 중 선택)
319
+ **Approval Request**: Would you like to proceed with the interview using the above plan?
320
+ (Choose “Proceed,” “Modify [Content],” or “Abort”)
157
321
  ```
158
322
 
159
- ### 1.4 사용자 확인 대기
323
+ ### 1.5 Wait for user approval (moai-alfred-tui-survey) (when user selects "New")
160
324
 
161
- **반응에 따른 분기**:
162
- - **"진행"** 또는 **"시작"**: STEP 2로 진행
163
- - **"수정 [내용]"**: 계획 수정 재제시
164
- - **"중단"**: 프로젝트 초기화 중단
325
+ After Alfred receives the project-manager's interview plan report, calls `Skill("moai-alfred-tui-survey")` and asks whether Phase 2 is approved.
326
+ - **Proceed**: Interview conducted according to approved plan
327
+ - **Modify**: Re-establish the plan (re-execute Phase 1)
328
+ - **Stop**: Stop initialization
329
+
330
+ **Response processing**:
331
+ - **"Progress"** (`answers["0"] === "Progress"`) → Execute Phase 2
332
+ - **"Modify"** (`answers["0"] === "Modify"`) → Repeat Phase 1 (recall project-manager)
333
+ - **"Abort"** (`answers["0"] === "Abort"`) → End task
165
334
 
166
335
  ---
167
336
 
168
- ## 🚀 STEP 2: 프로젝트 초기화 실행 (사용자 승인 )
337
+ ## 🚀 STEP 2: Execute project initialization (after user approves “New”)
338
+
339
+ **Note**: This step will only be executed if the user selects **"New"**.
340
+ - When selecting "Merge": End the task in Phase 1.1 (Merge Backups)
341
+ - When selecting "Skip": End the task
342
+ - When selecting "New": Proceed with the process below
343
+
344
+ After user approval, the project-manager agent performs initialization.
345
+
346
+ ### 2.1 Call project-manager agent (when user selects “New”)
347
+
348
+ Alfred starts project initialization by calling the project-manager agent. We will proceed based on the following information:
349
+ - Detected Languages: [Language List]
350
+ - Project Type: [New/Existing]
351
+ - Existing Document Status: [Existence/Absence]
352
+ - Approved Interview Plan: [Plan Summary]
353
+
354
+ Agents conduct structured interviews and create/update product/structure/tech.md documents.
355
+
356
+ ### 2.2 Automatic activation of Alfred Skills (optional)
357
+
358
+ After the project-manager has finished creating the document, **Alfred can optionally call Skills** (upon user request).
359
+
360
+ **Automatic activation conditions** (optional):
169
361
 
170
- 사용자 승인 project-manager 에이전트가 초기화를 수행합니다.
362
+ | Conditions | Automatic selection Skill | Purpose |
363
+ | ------------------------------------ | ---------------------------- | -------------------------------------- |
364
+ | User Requests “Quality Verification” | moai-alfred-trust-validation | Initial project structure verification |
171
365
 
172
- ### 2.1 project-manager 에이전트 호출
366
+ **Execution flow** (optional):
367
+ ```
368
+ 1. project-manager completion
369
+
370
+ 2. User selection:
371
+ - "Quality verification required" → moai-alfred-trust-validation (Level 1 quick scan)
372
+ - "Skip" → Complete immediately
373
+ ```
374
+
375
+ **Note**: Quality verification is optional during the project initialization phase.
376
+
377
+ ### 2.3 Sub-agent moai-alfred-tui-survey (Nested)
378
+
379
+ **The project-manager agent can internally call the TUI survey skill** to check the details of the task.
173
380
 
174
- Alfred는 project-manager 에이전트를 호출하여 프로젝트 초기화를 시작합니다. 다음 정보를 기반으로 진행합니다:
175
- - 감지된 언어: [언어 목록]
176
- - 프로젝트 유형: [신규/기존]
177
- - 기존 문서 상태: [존재/부재]
178
- - 승인된 인터뷰 계획: [계획 요약]
381
+ **When to call**:
382
+ - Before overwriting existing project documents
383
+ - When selecting language/framework
384
+ - When changing important settings
179
385
 
180
- 에이전트는 체계적인 인터뷰를 진행하고 product/structure/tech.md 문서를 생성/갱신합니다.
386
+ **Example** (inside project-manager): Ask whether to "overwrite file" with `Skill("moai-alfred-tui-survey")`,
387
+ - Allows you to choose between **Overwrite** / **Merge** / **Skip**.
181
388
 
182
- ### 2.2 프로젝트 유형별 처리 방식
389
+ **Nested pattern**:
390
+ - **Command level** (Phase approval): Called by Alfred → "Shall we proceed with Phase 2?"
391
+ - **Sub-agent level** (Detailed confirmation): Called by project-manager → "Shall we overwrite the file?"
183
392
 
184
- #### A. 신규 프로젝트 (그린필드)
393
+ ### 2.4 Processing method by project type
185
394
 
186
- **인터뷰 흐름**:
395
+ #### A. New project (Greenfield)
187
396
 
188
- 1. **Product Discovery** (product.md 작성)
189
- - 핵심 미션 정의 (@DOC:MISSION-001)
190
- - 주요 사용자층 파악 (@SPEC:USER-001)
191
- - 해결할 핵심 문제 식별 (@SPEC:PROBLEM-001)
192
- - 차별점 및 강점 정리 (@DOC:STRATEGY-001)
193
- - 성공 지표 설정 (@SPEC:SUCCESS-001)
397
+ **Interview Flow**:
194
398
 
195
- 2. **Structure Blueprint** (structure.md 작성)
196
- - 아키텍처 전략 선택 (@DOC:ARCHITECTURE-001)
197
- - 모듈별 책임 구분 (@DOC:MODULES-001)
198
- - 외부 시스템 통합 계획 (@DOC:INTEGRATION-001)
199
- - 추적성 전략 정의 (@DOC:TRACEABILITY-001)
399
+ 1. **Product Discovery** (create product.md)
400
+ - Define core mission (@DOC:MISSION-001)
401
+ - Identify key user base (@SPEC:USER-001)
402
+ - Identify key problems to solve (@SPEC:PROBLEM-001)
403
+ - Summary of differences and strengths (@DOC:STRATEGY-001)
404
+ - Setting success indicators (@SPEC:SUCCESS-001)
200
405
 
201
- 3. **Tech Stack Mapping** (tech.md 작성)
202
- - 언어 & 런타임 선택 (@DOC:STACK-001)
203
- - 핵심 프레임워크 결정 (@DOC:FRAMEWORK-001)
204
- - 품질 게이트 설정 (@DOC:QUALITY-001)
205
- - 보안 정책 정의 (@DOC:SECURITY-001)
206
- - 배포 채널 계획 (@DOC:DEPLOY-001)
406
+ 2. **Structure Blueprint** (create structure.md)
407
+ - Selection of architecture strategy (@DOC:ARCHITECTURE-001)
408
+ - Division of responsibilities by module (@DOC:MODULES-001)
409
+ - External system integration plan (@DOC:INTEGRATION-001)
410
+ - Define traceability strategy (@DOC:TRACEABILITY-001)
207
411
 
208
- **config.json 자동 생성**:
412
+ 3. **Tech Stack Mapping** (written by tech.md)
413
+ - Select language & runtime (@DOC:STACK-001)
414
+ - Determine core framework (@DOC:FRAMEWORK-001)
415
+ - Set quality gate (@DOC:QUALITY-001)
416
+ - Define security policy (@DOC:SECURITY-001)
417
+ - Plan distribution channels (@DOC:DEPLOY-001)
418
+
419
+ **Automatically generate config.json**:
209
420
  ```json
210
421
  {
211
422
  "project_name": "detected-name",
@@ -219,305 +430,595 @@ Alfred는 project-manager 에이전트를 호출하여 프로젝트 초기화를
219
430
  }
220
431
  ```
221
432
 
222
- #### B. 기존 프로젝트 (레거시 도입)
433
+ #### B. Existing project (legacy introduction)
223
434
 
224
435
  **Legacy Snapshot & Alignment**:
225
436
 
226
- **STEP 1: 전체 프로젝트 구조 파악**
437
+ **STEP 1: Identify the overall project structure**
227
438
 
228
- Alfred 전체 프로젝트 구조를 파악합니다:
229
- - tree 명령어 또는 find 명령어를 사용하여 디렉토리 구조 시각화
230
- - node_modules, .git, dist, build, __pycache__ 등 빌드 산출물 제외
231
- - 주요 소스 디렉토리 설정 파일 식별
439
+ Alfred identifies the entire project structure:
440
+ - Visualize the directory structure using the tree or find commands
441
+ - Exclude build artifacts such as node_modules, .git, dist, build, __pycache__, etc.
442
+ - Identify key source directories and configuration files.
232
443
 
233
- **산출물**:
234
- - 프로젝트 전체 폴더/파일 계층 구조 시각화
235
- - 주요 디렉토리 식별 (src/, tests/, docs/, config/ )
236
- - 언어/프레임워크 힌트 파일 확인 (package.json, pyproject.toml, go.mod )
444
+ **Output**:
445
+ - Visualize the entire folder/file hierarchy of the project
446
+ - Identify major directories (src/, tests/, docs/, config/, etc.)
447
+ - Check language/framework hint files (package.json, pyproject.toml, go.mod, etc.)
237
448
 
238
- **STEP 2: 병렬 분석 전략 수립**
449
+ **STEP 2: Establish parallel analysis strategy**
239
450
 
240
- Alfred Glob 패턴으로 파일 그룹을 식별합니다:
241
- 1. **설정 파일들**: *.json, *.toml, *.yaml, *.yml, *.config.js
242
- 2. **소스 코드 파일들**: src/**/*.{ts,js,py,go,rs,java}
243
- 3. **테스트 파일들**: tests/**/*.{ts,js,py,go,rs,java}, **/*.test.*, **/*.spec.*
244
- 4. **문서 파일들**: *.md, docs/**/*.md, README*, CHANGELOG*
451
+ Alfred identifies groups of files by the Glob pattern:
452
+ 1. **Configuration files**: *.json, *.toml, *.yaml, *.yml, *.config.js
453
+ 2. **Source code files**: src/**/*.{ts,js,py,go,rs,java}
454
+ 3. **Test files**: tests/**/*.{ts,js,py,go,rs,java}, **/*.test.*, **/*.spec.*
455
+ 4. **Documentation files**: *.md, docs/**/*.md, README*, CHANGELOG*
245
456
 
246
- **병렬 Read 전략**:
247
- - 여러 파일을 동시에 Read 도구로 읽어 분석 속도 향상
248
- - 파일 그룹별로 배치 처리
249
- - 우선순위: 설정 파일핵심 소스테스트문서
457
+ **Parallel Read Strategy**:
458
+ - Speed ​​up analysis by reading multiple files simultaneously with the Read tool
459
+ - Batch processing for each file group
460
+ - Priority: Configuration fileCore sourceTestDocument
250
461
 
251
- **STEP 3: 파일별 특성 분석 보고**
462
+ **STEP 3: Analysis and reporting of characteristics for each file**
252
463
 
253
- 파일을 읽으면서 다음 정보를 수집:
464
+ As each file is read, the following information is collected:
254
465
 
255
- 1. **설정 파일 분석**
256
- - 프로젝트 메타데이터 (이름, 버전, 설명)
257
- - 의존성 목록 버전
258
- - 빌드/테스트 스크립트
259
- - 언어/프레임워크 확정
466
+ 1. **Configuration file analysis**
467
+ - Project metadata (name, version, description)
468
+ - Dependency list and versions
469
+ - Build/test script
470
+ - Confirm language/framework
260
471
 
261
- 2. **소스 코드 분석**
262
- - 주요 모듈 클래스 식별
263
- - 아키텍처 패턴 추론 (MVC, 클린 아키텍처, 마이크로서비스 )
264
- - 외부 API 호출 통합점 파악
265
- - 도메인 로직 핵심 영역
472
+ 2. **Source code analysis**
473
+ - Identify major modules and classes
474
+ - Architectural pattern inference (MVC, clean architecture, microservice, etc.)
475
+ - Identify external API calls and integration points
476
+ - Key areas of domain logic
266
477
 
267
- 3. **테스트 코드 분석**
268
- - 테스트 프레임워크 확인
269
- - 커버리지 설정 파악
270
- - 주요 테스트 시나리오 식별
271
- - TDD 준수 여부 평가
478
+ 3. **Test code analysis**
479
+ - Check test framework
480
+ - Identify coverage settings
481
+ - Identify key test scenarios
482
+ - Evaluate TDD compliance
272
483
 
273
- 4. **문서 분석**
274
- - 기존 README 내용
275
- - 아키텍처 문서 존재 여부
276
- - API 문서 현황
277
- - 설치/배포 가이드 완성도
484
+ 4. **Document analysis**
485
+ - Existing README contents
486
+ - Existence of architecture document
487
+ - API document status
488
+ - Installation/deployment guide completeness
278
489
 
279
- **보고 형식**:
490
+ **Report Format**:
280
491
  ```markdown
281
- ## 파일별 분석 결과
282
-
283
- ### 설정 파일
284
- - package.json: Node.js 18+, TypeScript 5.x, Vitest 테스트
285
- - tsconfig.json: strict 모드, ESNext 타겟
286
- - biome.json: 린터/포매터 설정 존재
287
-
288
- ### 소스 코드 (src/)
289
- - src/core/: 핵심 비즈니스 로직 (3 모듈)
290
- - src/api/: REST API 엔드포인트 (5 라우터)
291
- - src/utils/: 유틸리티 함수 (로깅, 검증 )
292
- - 아키텍처: 계층형 (controller → service → repository)
293
-
294
- ### 테스트 (tests/)
295
- - Vitest + @testing-library 사용
296
- - 유닛 테스트 커버리지 60% 추정
297
- - E2E 테스트 미비
298
-
299
- ### 문서
300
- - README.md: 설치 가이드만 존재
301
- - API 문서 부재
302
- - 아키텍처 문서 부재
492
+ ## Analysis results for each file
493
+
494
+ ### Configuration file
495
+ - package.json: Node.js 18+, TypeScript 5.x, Vitest test
496
+ - tsconfig.json: strict mode, ESNext target
497
+ - biome.json: Linter/formatter settings exist
498
+
499
+ ### Source code (src/)
500
+ - src/core/: Core business logic (3 modules)
501
+ - src/api/: REST API endpoints (5 routers)
502
+ - src/utils/: Utility functions (logging, verification, etc.)
503
+ - Architecture: Hierarchical (controller) → service → repository)
504
+
505
+ ### Tests (tests/)
506
+ - Vitest + @testing-library used
507
+ - Unit test coverage estimated at about 60%
508
+ - E2E testing lacking
509
+
510
+ ### Documentation
511
+ - README.md: Only installation guide
512
+ - Absence of API documentation
513
+ - Absence of architecture document
303
514
  ```
304
515
 
305
- **STEP 4: 종합 분석 product/structure/tech 반영**
516
+ **STEP 4: Comprehensive analysis and product/structure/tech reflection**
306
517
 
307
- 수집된 정보를 바탕으로 3대 문서에 반영:
518
+ Based on the collected information, it is reflected in three major documents:
308
519
 
309
- 1. **product.md 반영 내용**
310
- - 기존 README/문서에서 추출한 프로젝트 미션
311
- - 코드에서 추론한 주요 사용자층 시나리오
312
- - 해결하는 핵심 문제 역추적
313
- - 기존 자산을 "Legacy Context"에 보존
520
+ 1. Contents reflected in **product.md**
521
+ - Project mission extracted from existing README/document
522
+ - Main user base and scenario inferred from code
523
+ - Backtracking of core problem to be solved
524
+ - Preservation of existing assets in “Legacy Context
314
525
 
315
- 2. **structure.md 반영 내용**
316
- - 파악된 실제 디렉토리 구조
317
- - 모듈별 책임 분석 결과
318
- - 외부 시스템 통합점 (API 호출, DB 연결 )
319
- - 기술 부채 항목 (@CODE 태그로 표기)
526
+ 2. Contents reflected in **structure.md**
527
+ - Identified actual directory structure
528
+ - Responsibility analysis results for each module
529
+ - External system integration points (API calls, DB connections, etc.)
530
+ - Technical debt items (marked with @CODE tag)
320
531
 
321
- 3. **tech.md 반영 내용**
322
- - 실제 사용 중인 언어/프레임워크/라이브러리
323
- - 기존 빌드/테스트 파이프라인
324
- - 품질 게이트 현황 (린터, 포매터, 테스트 커버리지)
325
- - 보안/배포 정책 파악
326
- - 개선 필요 항목 (TODO 태그로 표기)
532
+ 3. **tech.md reflection content**
533
+ - Languages/frameworks/libraries actually in use
534
+ - Existing build/test pipeline
535
+ - Status of quality gates (linter, formatter, test coverage)
536
+ - Identification of security/distribution policy
537
+ - Items requiring improvement (marked with TODO tags)
327
538
 
328
- **보존 정책**:
329
- - 기존 문서를 덮어쓰지 않고 부족한 부분만 보완
330
- - 충돌하는 내용은 "Legacy Context" 섹션에 보존
331
- - @CODE, TODO 태그로 개선 필요 항목 표시
539
+ **Preservation Policy**:
540
+ - Supplement only the missing parts without overwriting existing documents
541
+ - Preserve conflicting content in the “Legacy Context section
542
+ - Mark items needing improvement with @CODE and TODO tags
332
543
 
333
- **최종 보고서 예시**:
544
+ **Example Final Report**:
334
545
  ```markdown
335
- ## 기존 프로젝트 분석 완료
336
-
337
- ### 환경 정보
338
- - **언어**: TypeScript 5.x (Node.js 18+)
339
- - **프레임워크**: Express.js
340
- - **테스트**: Vitest (커버리지 ~60%)
341
- - **린터/포매터**: Biome
342
-
343
- ### 주요 발견사항
344
- 1. **강점**:
345
- - 타입 안전성 높음 (strict 모드)
346
- - 모듈 구조 명확 (core/api/utils 분리)
347
-
348
- 2. **개선 필요**:
349
- - 테스트 커버리지 85% 미달 (TODO:TEST-COVERAGE-001)
350
- - API 문서 부재 (TODO:DOCS-API-001)
351
- - E2E 테스트 미비 (@CODE:TEST-E2E-001)
352
-
353
- ### 다음 단계
354
- 1. product/structure/tech.md 생성 완료
355
- 2. @CODE/TODO 항목 우선순위 확정
356
- 3. /alfred:1-spec으로 개선 SPEC 작성 시작
546
+ ## Complete analysis of existing project
547
+
548
+ ### Environment Information
549
+ - **Language**: TypeScript 5.x (Node.js 18+)
550
+ - **Framework**: Express.js
551
+ - **Test**: Vitest (coverage ~60%)
552
+ - **Linter/Formatter**: Biome
553
+
554
+ ### Main findings
555
+ 1. **Strengths**:
556
+ - High type safety (strict mode)
557
+ - Clear module structure (separation of core/api/utils)
558
+
559
+ 2. **Needs improvement**:
560
+ - Test coverage below 85% (TODO:TEST-COVERAGE-001)
561
+ - Absence of API documentation (TODO:DOCS-API-001)
562
+ - Insufficient E2E testing (@CODE:TEST-E2E-001)
563
+
564
+ ### Next step
565
+ 1. product/structure/tech.md creation completed
566
+ 2. @CODE/TODO item priority confirmation
567
+ 3. /alfred:Start writing an improvement SPEC with 1-spec
357
568
  ```
358
569
 
359
- ### 2.3 문서 생성 검증
570
+ ### 2.3 Document creation and verification
360
571
 
361
- **산출물**:
362
- - `.moai/project/product.md` (비즈니스 요구사항)
363
- - `.moai/project/structure.md` (시스템 아키텍처)
364
- - `.moai/project/tech.md` (기술 스택 정책)
365
- - `.moai/config.json` (프로젝트 설정)
572
+ **Output**:
573
+ - `.moai/project/product.md` (Business Requirements)
574
+ - `.moai/project/structure.md` (System Architecture)
575
+ - `.moai/project/tech.md` (Technology Stack and policy)
576
+ - `.moai/config.json` (project settings)
366
577
 
367
- **품질 검증**:
368
- - [ ] 모든 필수 @TAG 섹션 존재 확인
369
- - [ ] EARS 구문 형식 준수 확인
370
- - [ ] config.json 구문 유효성 검증
371
- - [ ] 문서 일관성 검증
578
+ **Quality Verification**:
579
+ - [ ] Verify existence of all required @TAG sections
580
+ - [ ] Verify compliance with EARS syntax format
581
+ - [ ] Verify config.json syntax validity
582
+ - [ ] Verify cross-document consistency
372
583
 
373
- ### 2.4 완료 보고
584
+ ### 2.4 Completion Report
374
585
 
375
586
  ```markdown
376
- 프로젝트 초기화 완료!
377
-
378
- 📁 생성된 문서:
379
- - .moai/project/product.md (비즈니스 정의)
380
- - .moai/project/structure.md (아키텍처 설계)
381
- - .moai/project/tech.md (기술 스택)
382
- - .moai/config.json (프로젝트 설정)
383
-
384
- 🔍 감지된 환경:
385
- - 언어: [언어 목록]
386
- - 프레임워크: [프레임워크 목록]
387
- - 테스트 도구: [도구 목록]
388
-
389
- 📋 다음 단계:
390
- 1. 생성된 문서를 검토하세요
391
- 2. /alfred:1-spec으로 첫 번째 SPEC 작성
392
- 3. 필요 /alfred:8-project update로 재조정
587
+ Project initialization complete!
588
+
589
+ 📁 Documents generated:
590
+ - .moai/project/product.md (Business Definition)
591
+ - .moai/project/structure.md (Architecture Design)
592
+ - .moai/project/tech.md (Technology Stack)
593
+ - .moai/config.json (project settings)
594
+
595
+ 🔍 Detected environments:
596
+ - Language: [List of languages]
597
+ - Frameworks: [List of frameworks]
598
+ - Test tools: [List of tools]
599
+
600
+ 📋 Next steps:
601
+ 1. Review the generated document
602
+ 2. Create your first SPEC with /alfred:1-plan
603
+ 3. If necessary, readjust with /alfred:8-project update
393
604
  ```
394
605
 
395
- ### 2.5: 초기 구조 검증 (선택적)
606
+ ### 2.5: Initial structural verification (optional)
607
+
608
+ After project initialization is complete, you can optionally run quality verification.
609
+
610
+ **Execution Conditions**: Only when explicitly requested by the user.
611
+
612
+ **Verification Purpose**:
613
+ - Basic verification of project documentation and configuration files
614
+ - Verification of compliance with the TRUST principles of the initial structure
615
+ - Validation of configuration files
616
+
617
+ **How ​​it works**:
618
+ Alfred only calls the trust-checker agent to perform project initial structural verification if explicitly requested by the user.
619
+
620
+ **Verification items**:
621
+ - **Document completeness**: Check existence of required sections in product/structure/tech.md
622
+ - **Settings validity**: Verify config.json JSON syntax and required fields
623
+ - **TAG scheme**: Check compliance with @TAG format in document
624
+ - **EARS syntax**: Validation of the EARS template to be used when writing SPECs
625
+
626
+ **Run Verification**: Level 1 quick scan (3-5 seconds)
627
+
628
+ **Handling verification results**:
629
+
630
+ ✅ **Pass**: Can proceed to next step
631
+ - Documents and settings are all normal
632
+
633
+ ⚠️ **Warning**: Proceed after warning
634
+ - Some optional sections are missing
635
+ - Recommendations not applied
636
+
637
+ ❌ **Critical**: Needs fix
638
+ - Required section missing
639
+ - config.json syntax error
640
+ - User choice: “Revalidate after fix” or “Skip”
641
+
642
+ **Skip verification**:
643
+ - Verification is not run by default
644
+ - Run only when explicitly requested by the user
645
+
646
+ ### 2.6: Agent & Skill Tailoring (Project Optimization)
647
+
648
+ Based on the results of the interviews and initial analysis, we recommend and activate sub-agents and skills that should be immediately utilized in the project.
649
+ Before actual application, user confirmation is received with `Skill("moai-alfred-tui-survey")`, and selected items are recorded in `CLAUDE.md` and `.moai/config.json`.
396
650
 
397
- 프로젝트 초기화 완료 선택적으로 품질 검증을 실행할 수 있습니다.
651
+ #### 2.6.0 Create cc-manager briefing
398
652
 
399
- **실행 조건**: 사용자가 명시적으로 요청한 경우에만
653
+ Once the document creation is complete, **read all three documents (product/structure/tech.md)** and summarize the following information to create a text called `cc_manager_briefing`.
400
654
 
401
- **검증 목적**:
402
- - 프로젝트 문서와 설정 파일 기본 검증
403
- - 초기 구조의 TRUST 원칙 준수 확인
404
- - 설정 파일 유효성 검증
655
+ - `product.md`: Organize the mission, key users, problems to be solved, success indicators, and backlog (TODO) with a quotation from the original text or a one-line summary.
656
+ - `structure.md`: Records architecture type, module boundaries and scope of responsibility, external integration, traceability strategy, and TODO contents.
657
+ - `tech.md`: Organizes language/framework version, build/test/deployment procedures, quality/security policy, operation/monitoring method, and TODO items.
405
658
 
406
- **실행 방식**:
407
- 사용자가 명시적으로 요청한 경우에만 Alfred가 trust-checker 에이전트를 호출하여 프로젝트 초기 구조 검증을 수행합니다.
659
+ Be sure to include the source (e.g. `product.md@SPEC:SUCCESS-001`) for each item so that cc-manager can understand the basis.
408
660
 
409
- **검증 항목**:
410
- - **문서 완성도**: product/structure/tech.md 필수 섹션 존재 확인
411
- - **설정 유효성**: config.json JSON 구문 및 필수 필드 검증
412
- - **TAG 체계**: 문서 내 @TAG 형식 준수 확인
413
- - **EARS 구문**: SPEC 작성 시 사용할 EARS 템플릿 검증
661
+ #### 2.6.1 cc-manager judgment guide
414
662
 
415
- **검증 실행**: Level 1 빠른 스캔 (3-5초)
663
+ cc-manager selects the required sub-agents and skills based on the briefing.The table below is a reference guide to help you make a decision, and when making an actual call, the supporting sentences from the relevant document are also delivered.
416
664
 
417
- **검증 결과 처리**:
665
+ |Project requirements (document basis) |Recommended sub-agent/skill |Purpose |
666
+ | -------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------ |
667
+ |High quality and coverage goals (`product.md@SPEC:SUCCESS-001`) |`tdd-implementer`, `moai-essentials-debug`, `moai-essentials-review` |Establishment of RED·GREEN·REFACTOR workflow |
668
+ |Traceability/TAG improvement request (`structure.md@DOC:TRACEABILITY-001`) |`doc-syncer`, `moai-alfred-tag-scanning`, `moai-alfred-trust-validation` |Enhanced TAG traceability and document/code synchronization |
669
+ |Deployment automation/branch strategy required (`structure.md` Architecture/TODO) |`git-manager`, `moai-alfred-git-workflow`, `moai-foundation-git` |Branch Strategy·Commit Policy·PR Automation |
670
+ |Refactoring legacy modules (`product.md` BACKLOG, `tech.md` TODO) |`implementation-planner`, `moai-alfred-refactoring-coach`, `moai-essentials-refactor` |Technical Debt Diagnosis and Refactoring Roadmap |
671
+ |Strengthening regulatory/security compliance (`tech.md@DOC:SECURITY-001`) |`quality-gate`, `moai-alfred-trust-validation`, `moai-foundation-trust`, `moai-domain-security` |TRUST S (Secured) and Trackable Compliance, Security Consulting |
672
+ |CLI Automation/Tooling Requirements (`tech.md` BUILD/CLI section) |`implementation-planner`, `moai-domain-cli-tool`, detected language skills (e.g. `moai-lang-python`) |CLI command design, input/output standardization |
673
+ |Data analysis/reporting needs (`product.md` DATA, `tech.md` ANALYTICS) |`implementation-planner`, `moai-domain-data-science`, detected language skills |Data Pipeline·Notebook Job Definition |
674
+ |Improved database structure (`structure.md` DB, `tech.md` STORAGE) |`doc-syncer`, `moai-domain-database`, `moai-alfred-tag-scanning` |Strengthening schema documentation and TAG-DB mapping |
675
+ |DevOps/Infrastructure automation required (`tech.md` DEVOPS, `structure.md` CI/CD) |`implementation-planner`, `moai-domain-devops`, `moai-alfred-git-workflow` |Establishing a deployment pipeline and IaC strategy |
676
+ |Introduction of ML/AI functions (`product.md` AI, `tech.md` MODEL) |`implementation-planner`, `moai-domain-ml`, detected language skills |Model training/inference pipeline definition |
677
+ |Mobile app strategy (`product.md` MOBILE, `structure.md` CLIENT) |`implementation-planner`, `moai-domain-mobile-app`, detected language skills (e.g. `moai-lang-dart`, `moai-lang-swift`) |Mobile client structure design |
678
+ |Strengthening coding standards/review process (`tech.md` REVIEW) |`quality-gate`, `moai-essentials-review`, `moai-alfred-code-reviewer` |Strengthening review checklist and quality reporting |
679
+ |Requires onboarding/training mode (`tech.md` STACK description, etc.) |`moai-alfred-tui-survey`, `moai-adk-learning`, `agentic-coding` Output style |Enhanced interview TUI and automatically provided onboarding materials |
418
680
 
419
- **Pass**: 다음 단계 진행 가능
420
- - 문서와 설정 모두 정상
681
+ > **Language/Domain Skill Selection Rules**
682
+ > - Select and add one relevant language skill (`moai-lang-python`, `moai-lang-java`, …) based on the `moai-alfred-language-detection` results or the stack recorded in the Tech section of the briefing.
683
+ > - Skills listed in the domain row are automatically included by cc-manager in the `selected_skills` list when the conditions are met.
684
+ > - The skill directory is always copied in its entirety, and only actual activation is recorded in `skill_pack` and `CLAUDE.md`.
421
685
 
422
- ⚠️ **Warning**: 경고 표시 진행
423
- - 일부 선택적 섹션 누락
424
- - 권장사항 미적용
686
+ If multiple conditions are met, the candidates are merged without duplicates and organized into sets of `candidate_agents`, `candidate_skills`, and `candidate_styles`.
425
687
 
426
- **Critical**: 수정 필요
427
- - 필수 섹션 누락
428
- - config.json 구문 오류
429
- - 사용자 선택: "수정 후 재검증" 또는 "건너뛰기"
688
+ #### 2.6.2 User confirmation flow
430
689
 
431
- **검증 건너뛰기**:
432
- - 기본적으로 검증은 실행되지 않음
433
- - 사용자가 명시적으로 요청할 때만 실행
690
+ `Skill("moai-alfred-tui-survey")` asks “whether to enable recommended items.”
691
+ - Provides three options: **Install all** / **Install selectively** / **Do not install**.
692
+ Selecting “Selective Install” presents the list of candidates again as multiple choices, allowing the user to select only the items they need.
434
693
 
694
+ #### 2.6.3 Activation and Recording Steps
435
695
 
436
- ## 프로젝트 유형별 인터뷰 가이드
696
+ 1. **Preparing briefing**: Organize the results of user selection (install all/install selectively) and the full text of `cc_manager_briefing`.
697
+ 2. **Call the cc-manager agent**:
698
+ - Call `subagent_type: "cc-manager"` with the `Task` tool and include a briefing and user selections in the prompt.
699
+ - cc-manager determines the necessary sub-agents and skills based on the briefing, and copies and updates `CLAUDE.md`, `.claude/agents/alfred/*.md`, and `.claude/skills/*.md` as customized for the project.
700
+ 3. **Check for configuration updates**: Review the results reflected by cc-manager.
701
+ - Sub-Agents: Keep the `.claude/agents/alfred/` template active and list it in the `CLAUDE.md` “Agents” section.
702
+ - Skills: Check the `.claude/skills/` document and add it to the `CLAUDE.md` “Skills” section.
703
+ - Output style: Apply `.claude/output-styles/alfred/` and record the activation in `CLAUDE.md` “Output Styles”.
704
+ 4. **Update config.json**
705
+ ```json
706
+ {
707
+ "project": {
708
+ "optimized": true,
709
+ "agent_pack": ["tdd-implementer", "doc-syncer"],
710
+ "skill_pack": ["moai-alfred-git-workflow", "moai-alfred-tag-scanning"],
711
+ "output_styles": ["moai-adk-learning"]
712
+ }
713
+ }
714
+ ```
715
+ Merge existing properties, if any.
716
+ 5. **Final Report**: Add a list of “Activated Sub-Agents/Skills/Style” and a `cc_manager_briefing` summary at the top of the Completion Report, and reflect the same contents in the `CLAUDE.md` table so that they are automatically searched in subsequent commands.
717
+
718
+ ## Interview guide by project type
437
719
 
438
- ### 신규 프로젝트 인터뷰 영역
720
+ ### New project interview area
439
721
 
440
722
  **Product Discovery** (product.md)
441
- - 핵심 미션 가치 제안
442
- - 주요 사용자층 니즈
443
- - 해결할 핵심 문제 3가지
444
- - 경쟁 솔루션 대비 차별점
445
- - 측정 가능한 성공 지표
723
+ - Core mission and value proposition
724
+ - Key user bases and needs
725
+ - 3 key problems to solve
726
+ - Differentiation compared to competing solutions
727
+ - Measurable indicators of success
446
728
 
447
729
  **Structure Blueprint** (structure.md)
448
- - 시스템 아키텍처 전략
449
- - 모듈 분리 책임 구분
450
- - 외부 시스템 통합 계획
451
- - @TAG 기반 추적성 전략
730
+ - System architecture strategy
731
+ - Separation of modules and division of responsibilities
732
+ - External system integration plan
733
+ - @TAG-based traceability strategy
452
734
 
453
735
  **Tech Stack Mapping** (tech.md)
454
- - 언어/런타임 선택 버전
455
- - 프레임워크 라이브러리
456
- - 품질 게이트 정책 (커버리지, 린터)
457
- - 보안 정책 배포 채널
736
+ - Language/runtime selection and version
737
+ - Framework and libraries
738
+ - Quality gate policy (coverage, linter)
739
+ - Security policy and distribution channel
458
740
 
459
- ### 기존 프로젝트 인터뷰 영역
741
+ ### Existing project interview area
460
742
 
461
743
  **Legacy Analysis**
462
- - 현재 코드 구조 모듈 파악
463
- - 빌드/테스트 파이프라인 현황
464
- - 기술 부채 제약사항 식별
465
- - 외부 연동 인증 방식
466
- - MoAI-ADK 전환 우선순위 계획
744
+ - Identify current code structure and modules
745
+ - Status of build/test pipeline
746
+ - Identify technical debt and constraints
747
+ - External integration and authentication methods
748
+ - MoAI-ADK transition priority plan
467
749
 
468
- **보존 정책**: 기존 문서는 "Legacy Context" 섹션에 보존하고 @CODE/TODO 태그로 개선 필요 항목 표시
750
+ **Retention Policy**: Preserve existing documents in the "Legacy Context" section and mark items needing improvement with @CODE/TODO tags
469
751
 
470
- ## 🏷️ TAG 시스템 적용 규칙
752
+ ## 🏷️ TAG system application rules
471
753
 
472
- **섹션별 @TAG 자동 생성**:
754
+ **Automatically create @TAGs per section**:
473
755
 
474
- - 미션/비전 → @DOC:MISSION-XXX, @DOC:STRATEGY-XXX
475
- - 사용자 정의 → @SPEC:USER-XXX, @SPEC:PERSONA-XXX
476
- - 문제 분석 → @SPEC:PROBLEM-XXX, @SPEC:SOLUTION-XXX
477
- - 아키텍처 → @DOC:ARCHITECTURE-XXX, @SPEC:PATTERN-XXX
478
- - 기술 스택 → @DOC:STACK-XXX, @DOC:FRAMEWORK-XXX
756
+ - Mission/Vision → @DOC:MISSION-XXX, @DOC:STRATEGY-XXX
757
+ - Customization → @SPEC:USER-XXX, @SPEC:PERSONA-XXX
758
+ - Problem analysis → @SPEC:PROBLEM-XXX, @SPEC:SOLUTION-XXX
759
+ - Architecture → @DOC:ARCHITECTURE-XXX, @SPEC:PATTERN-XXX
760
+ - Technology Stack → @DOC:STACK-XXX, @DOC:FRAMEWORK-XXX
479
761
 
480
- **레거시 프로젝트 태그**:
762
+ **Legacy Project Tags**:
481
763
 
482
- - 기술 부채 → @CODE:REFACTOR-XXX, @CODE:TEST-XXX, @CODE:MIGRATION-XXX
483
- - 해결 계획 → @CODE:MIGRATION-XXX, TODO:SPEC-BACKLOG-XXX
484
- - 품질 개선 → TODO:TEST-COVERAGE-XXX, TODO:DOCS-SYNC-XXX
764
+ - Technical debt → @CODE:REFACTOR-XXX, @CODE:TEST-XXX, @CODE:MIGRATION-XXX
765
+ - Resolution plan → @CODE:MIGRATION-XXX, TODO:SPEC-BACKLOG-XXX
766
+ - Quality improvement → TODO:TEST-COVERAGE-XXX, TODO:DOCS-SYNC-XXX
485
767
 
486
- ## 오류 처리
768
+ ## Error handling
487
769
 
488
- ### 일반적인 오류 해결 방법
770
+ ### Common errors and solutions
489
771
 
490
- **오류 1**: 프로젝트 언어 감지 실패
772
+ **Error 1**: Project language detection failed
491
773
  ```
492
- 증상: "언어를 감지할 없습니다" 메시지
493
- 해결: 수동으로 언어 지정 또는 언어별 설정 파일 생성
774
+ Symptom: “Language not detected” message
775
+ Solution: Specify language manually or create language-specific settings file
494
776
  ```
495
777
 
496
- **오류 2**: 기존 문서와 충돌
778
+ **Error 2**: Conflict with existing document
497
779
  ```
498
- 증상: product.md 이미 존재하며 내용이 다름
499
- 해결: "Legacy Context" 섹션에 기존 내용 보존 내용 추가
780
+ Symptom: product.md already exists and has different contents
781
+ Solution: Preserve existing contents and add new contents in “Legacy Context” section
500
782
  ```
501
783
 
502
- **오류 3**: config.json 작성 실패
784
+ **Error 3**: Failed to create config.json
503
785
  ```
504
- 증상: JSON 구문 오류 또는 권한 거부
505
- 해결: 파일 권한 확인 (chmod 644) 또는 수동으로 config.json 생성
786
+ Symptom: JSON syntax error or permission denied
787
+ Solution: Check file permissions (chmod 644) or create config.json manually
506
788
  ```
507
789
 
508
- ## 다음 단계
790
+ ---
791
+
792
+ ## /alfred:0-project update: Template optimization (subcommand)
793
+
794
+ > **Purpose**: After running moai-adk update, compare the backup and new template to optimize the template while preserving user customization.
795
+
796
+ ### Execution conditions
797
+
798
+ This subcommand is executed under the following conditions:
799
+
800
+ 1. **After executing moai-adk update**: `optimized=false` status in `config.json`
801
+ 2. **Template update required**: When there is a difference between the backup and the new template
802
+ 3. **User explicit request**: User directly executes `/alfred:0-project update`
803
+
804
+ ### Execution flow
805
+
806
+ #### Phase 1: Backup analysis and comparison
807
+
808
+ 1. **Make sure you have the latest backup**:
809
+ ```bash
810
+ # Browse the latest backups in the .moai-backups/ directory
811
+ ls -lt .moai-backups/ | head -1
812
+ ```
813
+
814
+ 2. **Change Analysis**:
815
+ - Compare `.claude/` directory from backup with current template
816
+ - Compare `.moai/project/` document from backup with current document
817
+ - Identify user customization items
818
+
819
+ 3. **Create Comparison Report**:
820
+ ```markdown
821
+ ## 📊 Template optimization analysis
822
+
823
+ ### Changed items
824
+ - CLAUDE.md: "## Project Information" section needs to be preserved
825
+ - settings.json: 3 env variables need to be preserved
826
+ - product.md: Has user-written content
827
+
828
+ ### Recommended Action
829
+ - Run Smart Merge
830
+ - Preserve User Customizations
831
+ - Set optimized=true
832
+ ```
833
+
834
+ 4. **Waiting for user approval**
835
+ `Skill("moai-alfred-tui-survey")` asks “Do you want to proceed with template optimization?” and provides the following options.
836
+ - **Proceed** → Phase 2 execution
837
+ - **Preview** → Display change details and recheck
838
+ - **Skip** → keep optimized=false
839
+
840
+ #### Phase 2: Run smart merge (after user approval)
841
+
842
+ 1. **Execute smart merge logic**:
843
+ - Run `TemplateProcessor.copy_templates()`
844
+ - CLAUDE.md: Preserve "## Project Information" section
845
+ - settings.json: env variables and permissions.allow merge
846
+
847
+ 2. Set **optimized=true**:
848
+ ```python
849
+ # update config.json
850
+ config_data["project"]["optimized"] = True
851
+ ```
852
+
853
+ 3. **Optimization completion report**:
854
+ ```markdown
855
+ ✅ Template optimization completed!
856
+
857
+ 📄 Merged files:
858
+ - CLAUDE.md (preserves project information)
859
+ - settings.json (preserves env variables)
860
+
861
+ ⚙️ config.json: optimized=true Configuration complete
862
+ ```
863
+
864
+ ### Alfred Automation Strategy
865
+
866
+ **Alfred automatic decision**:
867
+ - Automatically call project-manager agent
868
+ - Check backup freshness (within 24 hours)
869
+ - Automatically analyze changes
870
+
871
+ **Auto-activation of Skills**:
872
+ - moai-alfred-tag-scanning: TAG chain verification
873
+ - moai-alfred-trust-validation: Verification of compliance with TRUST principles
874
+
875
+ ### Running example
876
+
877
+ ```bash
878
+ # After running moai-adk update
879
+ moai-adk update
880
+
881
+ # Output:
882
+ # ✓ Update complete!
883
+ # ℹ️ Next step: Run /alfred:0-project update to optimize template changes
884
+
885
+ # Run Alfred
886
+ /alfred:0-project update
887
+
888
+ # → Phase 1: Generate backup analysis and comparison report
889
+ # → Wait for user approval
890
+ # → Phase 2: Run smart merge, set optimized=true
891
+ ```
892
+
893
+ ### caution
894
+
895
+ - **Backup required**: Cannot run without backup in `.moai-backups/` directory
896
+ - **Manual review recommended**: Preview is required if there are important customizations
897
+ - **Conflict resolution**: Request user selection in case of merge conflict
898
+
899
+ ---
900
+
901
+ ## 🚀 STEP 3: Project Custom Optimization (Optional)
902
+
903
+ **Execution conditions**:
904
+ - After completion of Phase 2 (project initialization)
905
+ - or after completion of Phase 1.1 (backup merge)
906
+ - Explicitly requested by the user or automatically determined by Alfred
907
+
908
+ **Purpose**: Lightweight by selecting only Commands, Agents, and Skills that fit the project characteristics (37 skills → 3~5)
909
+
910
+ ### 3.1 Automatic execution of Feature Selection
911
+
912
+ **Alfred automatically calls the moai-alfred-feature-selector skill**:
913
+
914
+ **Skill Entry**:
915
+ - `.moai/project/product.md` (project category hint)
916
+ - `.moai/project/tech.md` (main language, framework)
917
+ - `.moai/config.json` (project settings)
918
+
919
+ **Skill Output**:
920
+ ```json
921
+ {
922
+ "category": "web-api",
923
+ "language": "python",
924
+ "framework": "fastapi",
925
+ "commands": ["1-spec", "2-build", "3-sync"],
926
+ "agents": ["spec-builder", "code-builder", "doc-syncer", "git-manager", "debug-helper"],
927
+ "skills": ["moai-lang-python", "moai-domain-web-api", "moai-domain-backend"],
928
+ "excluded_skills_count": 34,
929
+ "optimization_rate": "87%"
930
+ }
931
+ ```
932
+
933
+ **How ​​to Run**:
934
+ ```
935
+ Alfred: Skill("moai-alfred-feature-selector")
936
+ ```
937
+
938
+ ---
939
+
940
+ ### 3.2 Automatic execution of Template Generation
941
+
942
+ **Alfred automatically calls the moai-alfred-template-generator skill**:
943
+
944
+ **Skill input**:
945
+ - `.moai/.feature-selection.json` (feature-selector output)
946
+ - `CLAUDE.md` template
947
+ - Entire commands/agents/skills file
948
+
949
+ **Skill Output**:
950
+ - `CLAUDE.md` (custom agent table - selected agents only)
951
+ - `.claude/commands/` (selected commands only)
952
+ - `.claude/agents/` (selected agents only)
953
+ - `.claude/skills/` (selected skills only)
954
+ - `.moai/config.json` (updates `optimized: true`)
955
+
956
+ **How ​​to Run**:
957
+ ```
958
+ Alfred: Skill("moai-alfred-template-generator")
959
+ ```
960
+
961
+ ---
962
+
963
+ ### 3.3 Optimization completion report
964
+
965
+ **Report Format**:
966
+ ```markdown
967
+ ✅ Project customized optimization completed!
968
+
969
+ 📊 Optimization results:
970
+ - **Project**: {{PROJECT_NAME}}
971
+ - **Category**: web-api
972
+ - **Main language**: python
973
+ - **Framework**: fastapi
974
+
975
+ 🎯 Selected capabilities:
976
+ - Commands: 4 items (0-project, 1-spec, 2-build, 3-sync)
977
+ - Agents: 5 items (spec-builder, code-builder, doc-syncer, git-manager, debug-helper)
978
+ - Skills: 3 items (moai-lang-python, moai-domain-web-api, moai-domain-backend)
979
+
980
+ 💡 Lightweight effect:
981
+ - Skills excluded: 34
982
+ - Lightweight: 87%
983
+ - CLAUDE.md: Create custom agent table
984
+
985
+ 📋 Next steps:
986
+ 1. Check the CLAUDE.md file (only 5 agents are displayed)
987
+ 2. Run /alfred:1-plan "first function"
988
+ 3. Start the MoAI-ADK workflow
989
+ ```
990
+
991
+ ---
992
+
993
+ ### 3.4 Skip Phase 3 (optional)
994
+
995
+ **Users can skip Phase 3**:
996
+
997
+ **Skip condition**:
998
+ - User explicitly selects “Skip”
999
+ - “Simple project” when Alfred automatically determines (only basic features required)
1000
+
1001
+ **Skip effect**:
1002
+ - Maintain all 37 skills (no lightweighting)
1003
+ - Maintain default 9 agents in CLAUDE.md template
1004
+ - Maintain `optimized: false` in config.json
1005
+
1006
+ ---
1007
+
1008
+ ## Next steps
509
1009
 
510
- **권장사항**: 다음 단계 진행 `/clear` 또는 `/new` 명령으로 새로운 대화 세션을 시작하면 나은 성능과 컨텍스트 관리를 경험할 있습니다.
1010
+ **Recommendation**: For better performance and context management, start a new chat session with the `/clear` or `/new` command before proceeding to the next step.
511
1011
 
512
- 초기화 완료 후:
1012
+ After initialization is complete:
513
1013
 
514
- - **신규 프로젝트**: `/alfred:1-spec`을 실행해 설계 기반 SPEC 백로그 생성
515
- - **레거시 프로젝트**: product/structure/tech 문서의 @CODE/@CODE/TODO 항목 검토 우선순위 확정
516
- - **설정 변경**: `/alfred:8-project`를 다시 실행하여 문서 갱신
1014
+ - **New project**: Run `/alfred:1-plan` to create design-based SPEC backlog
1015
+ - **Legacy project**: Review @CODE/@CODE/TODO items in product/structure/tech document and confirm priority
1016
+ - **Set Change**: Run `/alfred:0-project` again to update document
1017
+ - **Template optimization**: Run `/alfred:0-project update` after `moai-adk update`
517
1018
 
518
- ## 관련 명령어
1019
+ ## Related commands
519
1020
 
520
- - `/alfred:1-spec` - SPEC 작성 시작
521
- - `/alfred:9-update` - MoAI-ADK 업데이트
522
- - `moai doctor` - 시스템 진단
523
- - `moai status` - 프로젝트 상태 확인
1021
+ - `/alfred:1-plan` - Start writing SPEC
1022
+ - `/alfred:9-update` - MoAI-ADK update
1023
+ - `moai doctor` - System diagnosis
1024
+ - `moai status` - Check project status