moai-adk 0.4.0__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.
- moai_adk/__init__.py +1 -8
- moai_adk/cli/commands/init.py +10 -5
- moai_adk/cli/commands/update.py +274 -118
- moai_adk/cli/prompts/init_prompts.py +14 -18
- moai_adk/core/diagnostics/slash_commands.py +1 -1
- moai_adk/core/project/backup_utils.py +1 -0
- moai_adk/core/project/phase_executor.py +3 -1
- moai_adk/core/project/validator.py +3 -2
- moai_adk/core/template/backup.py +11 -3
- moai_adk/core/template/merger.py +16 -3
- moai_adk/core/template/processor.py +22 -3
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +443 -424
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
- moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
- moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
- moai_adk/templates/.claude/commands/alfred/0-project.md +673 -640
- moai_adk/templates/.claude/commands/alfred/1-plan.md +342 -333
- moai_adk/templates/.claude/commands/alfred/2-run.md +295 -285
- moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
- moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
- moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
- moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
- moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
- moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
- moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
- moai_adk/templates/.claude/hooks/alfred/handlers/session.py +27 -27
- moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
- moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +70 -43
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +141 -141
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +179 -165
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +78 -78
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +90 -90
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +39 -25
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +117 -74
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +131 -134
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +43 -11
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +47 -11
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +47 -11
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +51 -14
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +46 -10
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +62 -25
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +44 -17
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +44 -14
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +45 -13
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +46 -14
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +48 -8
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +44 -12
- moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
- moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
- moai_adk/templates/.moai/config.json +9 -6
- moai_adk/templates/.moai/memory/development-guide.md +220 -221
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
- moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
- moai_adk/templates/.moai/project/product.md +90 -90
- moai_adk/templates/.moai/project/structure.md +85 -85
- moai_adk/templates/.moai/project/tech.md +117 -117
- moai_adk/templates/CLAUDE.md +350 -722
- moai_adk-0.4.1.dist-info/METADATA +303 -0
- moai_adk-0.4.1.dist-info/RECORD +152 -0
- moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -31
- moai_adk/templates/.claude/commands/alfred/2-build.md +0 -30
- moai_adk/templates/.claude/skills/scripts/standardize_skills.py +0 -166
- moai_adk/templates/.claude/skills/scripts/verify_standardization.sh +0 -43
- moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
- moai_adk-0.4.0.dist-info/METADATA +0 -1816
- moai_adk-0.4.0.dist-info/RECORD +0 -145
- {moai_adk-0.4.0.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.0.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.0.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:
|
|
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,202 +15,190 @@ 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
|
-
|
|
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.
|
|
30
|
-
5.
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
+
The user executes the `/alfred:8-project` command to analyze the project and create/update documents.
|
|
45
49
|
|
|
46
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
+
### 1.0 Check backup directory (highest priority)
|
|
91
|
+
|
|
92
|
+
**Processing backup files after moai-adk init reinitialization**
|
|
93
|
+
|
|
94
|
+
Alfred first checks the `.moai-backups/` directory:
|
|
87
95
|
|
|
88
96
|
```bash
|
|
89
|
-
#
|
|
97
|
+
# Check latest backup timestamp
|
|
90
98
|
ls -t .moai-backups/ | head -1
|
|
91
99
|
|
|
92
|
-
#
|
|
100
|
+
# Check the optimized flag in config.json
|
|
93
101
|
grep "optimized" .moai/config.json
|
|
94
102
|
```
|
|
95
103
|
|
|
96
|
-
|
|
97
|
-
- `.moai-backups/`
|
|
98
|
-
-
|
|
99
|
-
- `
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
question: "백업 파일(.moai-backups/{timestamp}/)이 발견되었습니다. 어떻게 처리하시겠습니까?",
|
|
107
|
-
header: "백업 처리 방식",
|
|
108
|
-
options: [
|
|
109
|
-
{
|
|
110
|
-
label: "병합",
|
|
111
|
-
description: "백업 파일의 사용자 커스터마이징을 최신 템플릿에 병합 (권장)"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
label: "새로 작성",
|
|
115
|
-
description: "백업 무시하고 새로운 인터뷰 시작 (처음부터 다시 작성)"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
label: "건너뛰기",
|
|
119
|
-
description: "현재 파일 유지 (변경 없음, 작업 종료)"
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
multiSelect: false
|
|
123
|
-
}]
|
|
124
|
-
})
|
|
125
|
-
```
|
|
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)
|
|
126
114
|
|
|
127
|
-
|
|
128
|
-
- **"
|
|
129
|
-
- **"
|
|
130
|
-
- **"
|
|
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
|
|
131
119
|
|
|
132
|
-
|
|
133
|
-
- Phase 1.2 (
|
|
120
|
+
**No backup or optimized: true**:
|
|
121
|
+
- Proceed directly to Phase 1.2 (project environment analysis)
|
|
134
122
|
|
|
135
123
|
---
|
|
136
124
|
|
|
137
|
-
### 1.1
|
|
125
|
+
### 1.1 Backup merge workflow (when user selects “Merge”)
|
|
138
126
|
|
|
139
|
-
|
|
127
|
+
**Purpose**: Restore only user customizations while maintaining the latest template structure.
|
|
140
128
|
|
|
141
|
-
**STEP 1:
|
|
129
|
+
**STEP 1: Read backup file**
|
|
142
130
|
|
|
143
|
-
Alfred
|
|
131
|
+
Alfred reads files from the latest backup directory:
|
|
144
132
|
```bash
|
|
145
|
-
#
|
|
133
|
+
# Latest backup directory path
|
|
146
134
|
BACKUP_DIR=.moai-backups/$(ls -t .moai-backups/ | head -1)
|
|
147
135
|
|
|
148
|
-
#
|
|
136
|
+
# Read backup file
|
|
149
137
|
Read $BACKUP_DIR/.moai/project/product.md
|
|
150
138
|
Read $BACKUP_DIR/.moai/project/structure.md
|
|
151
139
|
Read $BACKUP_DIR/.moai/project/tech.md
|
|
152
140
|
Read $BACKUP_DIR/CLAUDE.md
|
|
153
141
|
```
|
|
154
142
|
|
|
155
|
-
**STEP 2:
|
|
143
|
+
**STEP 2: Detect template defaults**
|
|
156
144
|
|
|
157
|
-
|
|
158
|
-
- "
|
|
159
|
-
- "
|
|
160
|
-
- "
|
|
161
|
-
- "{{PROJECT_NAME}}", "{{PROJECT_DESCRIPTION}}"
|
|
162
|
-
- "
|
|
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.
|
|
163
151
|
|
|
164
|
-
**STEP 3:
|
|
152
|
+
**STEP 3: Extract user customization**
|
|
165
153
|
|
|
166
|
-
|
|
154
|
+
Extract only **non-template default content** from the backup file:
|
|
167
155
|
- `product.md`:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
172
160
|
- `structure.md`:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
- Actual design in the ARCHITECTURE section
|
|
162
|
+
- Actual module structure in the MODULES section
|
|
163
|
+
- Actual integration plan in the INTEGRATION section
|
|
176
164
|
- `tech.md`:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- `HISTORY`
|
|
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)
|
|
181
169
|
|
|
182
|
-
**STEP 4:
|
|
170
|
+
**STEP 4: Merge Strategy**
|
|
183
171
|
|
|
184
172
|
```markdown
|
|
185
|
-
|
|
173
|
+
Latest template structure (v0.4.0+)
|
|
186
174
|
↓
|
|
187
|
-
|
|
175
|
+
Insert user customization (extracted from backup file)
|
|
188
176
|
↓
|
|
189
|
-
HISTORY
|
|
177
|
+
HISTORY section updates
|
|
190
178
|
↓
|
|
191
|
-
|
|
179
|
+
Version update (v0.1.x → v0.1.x+1)
|
|
192
180
|
```
|
|
193
181
|
|
|
194
|
-
|
|
195
|
-
- ✅
|
|
196
|
-
- ✅
|
|
197
|
-
- ✅
|
|
198
|
-
- ❌
|
|
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
|
|
199
187
|
|
|
200
|
-
**STEP 5: HISTORY
|
|
188
|
+
**STEP 5: HISTORY Section Update**
|
|
201
189
|
|
|
202
|
-
|
|
190
|
+
After the merge is complete, add history to the HISTORY section of each file:
|
|
203
191
|
```yaml
|
|
204
192
|
### v0.1.x+1 (2025-10-19)
|
|
205
|
-
- **UPDATED**:
|
|
193
|
+
- **UPDATED**: Merge backup files (automatic optimization)
|
|
206
194
|
- AUTHOR: @Alfred
|
|
207
195
|
- BACKUP: .moai-backups/20251018-003638/
|
|
208
|
-
- REASON: moai-adk init
|
|
196
|
+
- REASON: Restoring user customization after moai-adk init reinitialization
|
|
209
197
|
```
|
|
210
198
|
|
|
211
|
-
**STEP 6: config.json
|
|
199
|
+
**STEP 6: Update config.json**
|
|
212
200
|
|
|
213
|
-
|
|
201
|
+
Set optimization flags after the merge is complete:
|
|
214
202
|
```json
|
|
215
203
|
{
|
|
216
204
|
"project": {
|
|
@@ -221,239 +209,214 @@ HISTORY 섹션 업데이트
|
|
|
221
209
|
}
|
|
222
210
|
```
|
|
223
211
|
|
|
224
|
-
**STEP 7:
|
|
212
|
+
**STEP 7: Completion Report**
|
|
225
213
|
|
|
226
214
|
```markdown
|
|
227
|
-
✅
|
|
215
|
+
✅ Backup merge completed!
|
|
228
216
|
|
|
229
|
-
📁
|
|
217
|
+
📁 Merged files:
|
|
230
218
|
- .moai/project/product.md (v0.1.4 → v0.1.5)
|
|
231
219
|
- .moai/project/structure.md (v0.1.1 → v0.1.2)
|
|
232
220
|
- .moai/project/tech.md (v0.1.1 → v0.1.2)
|
|
233
221
|
- .moai/config.json (optimized: false → true)
|
|
234
222
|
|
|
235
|
-
🔍
|
|
236
|
-
- USER
|
|
237
|
-
- PROBLEM
|
|
238
|
-
- STRATEGY
|
|
239
|
-
- HISTORY
|
|
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)
|
|
240
228
|
|
|
241
|
-
💾
|
|
242
|
-
-
|
|
243
|
-
-
|
|
229
|
+
💾 Backup file location:
|
|
230
|
+
- Original backup: .moai-backups/20251018-003638/
|
|
231
|
+
- Retention period: Permanent (until manual deletion)
|
|
244
232
|
|
|
245
|
-
📋
|
|
246
|
-
1.
|
|
247
|
-
2.
|
|
248
|
-
3. /alfred:1-
|
|
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
|
|
249
237
|
|
|
250
238
|
---
|
|
251
|
-
|
|
239
|
+
**Task completed: /alfred:0-project terminated**
|
|
252
240
|
```
|
|
253
241
|
|
|
254
|
-
|
|
242
|
+
**Finish work after merge**: Complete immediately without interview
|
|
255
243
|
|
|
256
244
|
---
|
|
257
245
|
|
|
258
|
-
### 1.2
|
|
246
|
+
### 1.2 Run project environment analysis (when user selects "New" or no backup)
|
|
259
247
|
|
|
260
|
-
|
|
248
|
+
**Automatically analyzed items**:
|
|
261
249
|
|
|
262
|
-
1.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
|
266
254
|
|
|
267
|
-
2.
|
|
255
|
+
2. **Auto-detect language/framework**: Detects the main language of your project based on file patterns
|
|
268
256
|
- pyproject.toml, requirements.txt → Python
|
|
269
257
|
- package.json, tsconfig.json → TypeScript/Node.js
|
|
270
258
|
- pom.xml, build.gradle → Java
|
|
271
259
|
- go.mod → Go
|
|
272
260
|
- Cargo.toml → Rust
|
|
273
|
-
|
|
261
|
+
- backend/ + frontend/ → full stack
|
|
274
262
|
|
|
275
|
-
3.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
|
279
267
|
|
|
280
|
-
4.
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
268
|
+
4. **Project structure evaluation**
|
|
269
|
+
- Directory structure complexity
|
|
270
|
+
- Monolingual vs. hybrid vs. microservice
|
|
271
|
+
- Code base size estimation
|
|
284
272
|
|
|
285
|
-
### 1.3
|
|
273
|
+
### 1.3 Establish interview strategy (when user selects “New”)
|
|
286
274
|
|
|
287
|
-
|
|
275
|
+
**Select question tree by project type**:
|
|
288
276
|
|
|
289
|
-
|
|
|
290
|
-
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
| **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 |
|
|
294
282
|
|
|
295
|
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
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)
|
|
299
287
|
|
|
300
|
-
### 1.4
|
|
288
|
+
### 1.4 Generate Interview Plan Report (when user selects “Create New”)
|
|
301
289
|
|
|
302
|
-
|
|
290
|
+
**Format of plan to be presented to users**:
|
|
303
291
|
|
|
304
292
|
```markdown
|
|
305
|
-
## 📊
|
|
306
|
-
|
|
307
|
-
###
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
|
|
313
|
-
### 🎯
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
### ⚠️
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
|
|
324
|
-
### ✅
|
|
325
|
-
- **product.md**: [
|
|
326
|
-
- **structure.md**: [
|
|
327
|
-
- **tech.md**: [
|
|
328
|
-
- **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]
|
|
329
317
|
|
|
330
318
|
---
|
|
331
|
-
|
|
332
|
-
(
|
|
319
|
+
**Approval Request**: Would you like to proceed with the interview using the above plan?
|
|
320
|
+
(Choose “Proceed,” “Modify [Content],” or “Abort”)
|
|
333
321
|
```
|
|
334
322
|
|
|
335
|
-
### 1.5
|
|
336
|
-
|
|
337
|
-
Alfred
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
questions: [{
|
|
342
|
-
question: "project-manager가 제시한 인터뷰 계획으로 프로젝트 초기화를 진행하시겠습니까?",
|
|
343
|
-
header: "Phase 2 승인",
|
|
344
|
-
options: [
|
|
345
|
-
{ label: "진행", description: "승인된 계획대로 인터뷰 및 문서 생성 시작" },
|
|
346
|
-
{ label: "수정", description: "계획 재수립 (Phase 1 반복)" },
|
|
347
|
-
{ label: "중단", description: "프로젝트 초기화 중단" }
|
|
348
|
-
],
|
|
349
|
-
multiSelect: false
|
|
350
|
-
}]
|
|
351
|
-
})
|
|
352
|
-
```
|
|
323
|
+
### 1.5 Wait for user approval (moai-alfred-tui-survey) (when user selects "New")
|
|
324
|
+
|
|
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
|
|
353
329
|
|
|
354
|
-
|
|
355
|
-
- **"
|
|
356
|
-
- **"
|
|
357
|
-
- **"
|
|
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
|
|
358
334
|
|
|
359
335
|
---
|
|
360
336
|
|
|
361
|
-
## 🚀 STEP 2:
|
|
337
|
+
## 🚀 STEP 2: Execute project initialization (after user approves “New”)
|
|
362
338
|
|
|
363
|
-
|
|
364
|
-
- "
|
|
365
|
-
- "
|
|
366
|
-
-
|
|
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
|
|
367
343
|
|
|
368
|
-
|
|
344
|
+
After user approval, the project-manager agent performs initialization.
|
|
369
345
|
|
|
370
|
-
### 2.1 project-manager
|
|
346
|
+
### 2.1 Call project-manager agent (when user selects “New”)
|
|
371
347
|
|
|
372
|
-
Alfred
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
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]
|
|
377
353
|
|
|
378
|
-
|
|
354
|
+
Agents conduct structured interviews and create/update product/structure/tech.md documents.
|
|
379
355
|
|
|
380
|
-
### 2.2 Alfred Skills
|
|
356
|
+
### 2.2 Automatic activation of Alfred Skills (optional)
|
|
381
357
|
|
|
382
|
-
project-manager
|
|
358
|
+
After the project-manager has finished creating the document, **Alfred can optionally call Skills** (upon user request).
|
|
383
359
|
|
|
384
|
-
|
|
360
|
+
**Automatic activation conditions** (optional):
|
|
385
361
|
|
|
386
|
-
|
|
|
387
|
-
|
|
388
|
-
|
|
|
362
|
+
| Conditions | Automatic selection Skill | Purpose |
|
|
363
|
+
| ------------------------------------ | ---------------------------- | -------------------------------------- |
|
|
364
|
+
| User Requests “Quality Verification” | moai-alfred-trust-validation | Initial project structure verification |
|
|
389
365
|
|
|
390
|
-
|
|
366
|
+
**Execution flow** (optional):
|
|
391
367
|
```
|
|
392
|
-
1. project-manager
|
|
368
|
+
1. project-manager completion
|
|
393
369
|
↓
|
|
394
|
-
2.
|
|
395
|
-
|
|
396
|
-
|
|
370
|
+
2. User selection:
|
|
371
|
+
- "Quality verification required" → moai-alfred-trust-validation (Level 1 quick scan)
|
|
372
|
+
- "Skip" → Complete immediately
|
|
397
373
|
```
|
|
398
374
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
### 2.3 Sub-agent AskUserQuestion (Nested)
|
|
402
|
-
|
|
403
|
-
**project-manager 에이전트는 내부적으로 AskUserQuestion을 호출**하여 세부 작업을 확인할 수 있습니다.
|
|
404
|
-
|
|
405
|
-
**호출 시점**:
|
|
406
|
-
- 기존 프로젝트 문서 덮어쓰기 전
|
|
407
|
-
- 언어/프레임워크 선택 시
|
|
408
|
-
- 중요한 설정 변경 시
|
|
409
|
-
|
|
410
|
-
**예시** (project-manager 내부):
|
|
411
|
-
```typescript
|
|
412
|
-
AskUserQuestion({
|
|
413
|
-
questions: [{
|
|
414
|
-
question: "기존 product.md 파일이 존재합니다. 어떻게 처리하시겠습니까?",
|
|
415
|
-
header: "파일 덮어쓰기 확인",
|
|
416
|
-
options: [
|
|
417
|
-
{ label: "덮어쓰기", description: "기존 파일 백업 후 새 내용으로 교체" },
|
|
418
|
-
{ label: "병합", description: "기존 내용과 새 내용 병합" },
|
|
419
|
-
{ label: "건너뛰기", description: "기존 파일 유지" }
|
|
420
|
-
],
|
|
421
|
-
multiSelect: false
|
|
422
|
-
}]
|
|
423
|
-
})
|
|
424
|
-
```
|
|
375
|
+
**Note**: Quality verification is optional during the project initialization phase.
|
|
425
376
|
|
|
426
|
-
|
|
427
|
-
- **커맨드 레벨** (Phase 승인): Alfred가 호출 → "Phase 2 진행할까요?"
|
|
428
|
-
- **Sub-agent 레벨** (세부 확인): project-manager가 호출 → "파일 덮어쓸까요?"
|
|
377
|
+
### 2.3 Sub-agent moai-alfred-tui-survey (Nested)
|
|
429
378
|
|
|
430
|
-
|
|
379
|
+
**The project-manager agent can internally call the TUI survey skill** to check the details of the task.
|
|
431
380
|
|
|
432
|
-
|
|
381
|
+
**When to call**:
|
|
382
|
+
- Before overwriting existing project documents
|
|
383
|
+
- When selecting language/framework
|
|
384
|
+
- When changing important settings
|
|
433
385
|
|
|
434
|
-
|
|
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**.
|
|
435
388
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
- 해결할 핵심 문제 식별 (@SPEC:PROBLEM-001)
|
|
440
|
-
- 차별점 및 강점 정리 (@DOC:STRATEGY-001)
|
|
441
|
-
- 성공 지표 설정 (@SPEC:SUCCESS-001)
|
|
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?"
|
|
442
392
|
|
|
443
|
-
2.
|
|
444
|
-
- 아키텍처 전략 선택 (@DOC:ARCHITECTURE-001)
|
|
445
|
-
- 모듈별 책임 구분 (@DOC:MODULES-001)
|
|
446
|
-
- 외부 시스템 통합 계획 (@DOC:INTEGRATION-001)
|
|
447
|
-
- 추적성 전략 정의 (@DOC:TRACEABILITY-001)
|
|
393
|
+
### 2.4 Processing method by project type
|
|
448
394
|
|
|
449
|
-
|
|
450
|
-
- 언어 & 런타임 선택 (@DOC:STACK-001)
|
|
451
|
-
- 핵심 프레임워크 결정 (@DOC:FRAMEWORK-001)
|
|
452
|
-
- 품질 게이트 설정 (@DOC:QUALITY-001)
|
|
453
|
-
- 보안 정책 정의 (@DOC:SECURITY-001)
|
|
454
|
-
- 배포 채널 계획 (@DOC:DEPLOY-001)
|
|
395
|
+
#### A. New project (Greenfield)
|
|
455
396
|
|
|
456
|
-
**
|
|
397
|
+
**Interview Flow**:
|
|
398
|
+
|
|
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)
|
|
405
|
+
|
|
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)
|
|
411
|
+
|
|
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**:
|
|
457
420
|
```json
|
|
458
421
|
{
|
|
459
422
|
"project_name": "detected-name",
|
|
@@ -467,423 +430,493 @@ AskUserQuestion({
|
|
|
467
430
|
}
|
|
468
431
|
```
|
|
469
432
|
|
|
470
|
-
#### B.
|
|
433
|
+
#### B. Existing project (legacy introduction)
|
|
471
434
|
|
|
472
435
|
**Legacy Snapshot & Alignment**:
|
|
473
436
|
|
|
474
|
-
**STEP 1:
|
|
437
|
+
**STEP 1: Identify the overall project structure**
|
|
475
438
|
|
|
476
|
-
Alfred
|
|
477
|
-
-
|
|
478
|
-
- node_modules, .git, dist, build, __pycache__
|
|
479
|
-
-
|
|
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.
|
|
480
443
|
|
|
481
|
-
|
|
482
|
-
-
|
|
483
|
-
-
|
|
484
|
-
-
|
|
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.)
|
|
485
448
|
|
|
486
|
-
**STEP 2:
|
|
449
|
+
**STEP 2: Establish parallel analysis strategy**
|
|
487
450
|
|
|
488
|
-
Alfred
|
|
489
|
-
1.
|
|
490
|
-
2.
|
|
491
|
-
3.
|
|
492
|
-
4.
|
|
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*
|
|
493
456
|
|
|
494
|
-
|
|
495
|
-
-
|
|
496
|
-
-
|
|
497
|
-
-
|
|
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 file → Core source → Test → Document
|
|
498
461
|
|
|
499
|
-
**STEP 3:
|
|
462
|
+
**STEP 3: Analysis and reporting of characteristics for each file**
|
|
500
463
|
|
|
501
|
-
|
|
464
|
+
As each file is read, the following information is collected:
|
|
502
465
|
|
|
503
|
-
1.
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
466
|
+
1. **Configuration file analysis**
|
|
467
|
+
- Project metadata (name, version, description)
|
|
468
|
+
- Dependency list and versions
|
|
469
|
+
- Build/test script
|
|
470
|
+
- Confirm language/framework
|
|
508
471
|
|
|
509
|
-
2.
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
|
514
477
|
|
|
515
|
-
3.
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
478
|
+
3. **Test code analysis**
|
|
479
|
+
- Check test framework
|
|
480
|
+
- Identify coverage settings
|
|
481
|
+
- Identify key test scenarios
|
|
482
|
+
- Evaluate TDD compliance
|
|
520
483
|
|
|
521
|
-
4.
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
484
|
+
4. **Document analysis**
|
|
485
|
+
- Existing README contents
|
|
486
|
+
- Existence of architecture document
|
|
487
|
+
- API document status
|
|
488
|
+
- Installation/deployment guide completeness
|
|
526
489
|
|
|
527
|
-
|
|
490
|
+
**Report Format**:
|
|
528
491
|
```markdown
|
|
529
|
-
##
|
|
530
|
-
|
|
531
|
-
###
|
|
532
|
-
- package.json: Node.js 18+, TypeScript 5.x, Vitest
|
|
533
|
-
- tsconfig.json: strict
|
|
534
|
-
- biome.json:
|
|
535
|
-
|
|
536
|
-
###
|
|
537
|
-
- src/core/:
|
|
538
|
-
- src/api/: REST API
|
|
539
|
-
- src/utils/:
|
|
540
|
-
-
|
|
541
|
-
|
|
542
|
-
###
|
|
543
|
-
- Vitest + @testing-library
|
|
544
|
-
-
|
|
545
|
-
- E2E
|
|
546
|
-
|
|
547
|
-
###
|
|
548
|
-
- README.md:
|
|
549
|
-
- API
|
|
550
|
-
-
|
|
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
|
|
551
514
|
```
|
|
552
515
|
|
|
553
|
-
**STEP 4:
|
|
516
|
+
**STEP 4: Comprehensive analysis and product/structure/tech reflection**
|
|
554
517
|
|
|
555
|
-
|
|
518
|
+
Based on the collected information, it is reflected in three major documents:
|
|
556
519
|
|
|
557
|
-
1. **product.md
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
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”
|
|
562
525
|
|
|
563
|
-
2. **structure.md
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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)
|
|
568
531
|
|
|
569
|
-
3. **tech.md
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
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)
|
|
575
538
|
|
|
576
|
-
|
|
577
|
-
-
|
|
578
|
-
-
|
|
579
|
-
-
|
|
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
|
|
580
543
|
|
|
581
|
-
|
|
544
|
+
**Example Final Report**:
|
|
582
545
|
```markdown
|
|
583
|
-
##
|
|
584
|
-
|
|
585
|
-
###
|
|
586
|
-
-
|
|
587
|
-
-
|
|
588
|
-
-
|
|
589
|
-
-
|
|
590
|
-
|
|
591
|
-
###
|
|
592
|
-
1.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
2.
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
###
|
|
602
|
-
1. product/structure/tech.md
|
|
603
|
-
2. @CODE/TODO
|
|
604
|
-
3. /alfred:
|
|
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
|
|
605
568
|
```
|
|
606
569
|
|
|
607
|
-
### 2.3
|
|
570
|
+
### 2.3 Document creation and verification
|
|
608
571
|
|
|
609
|
-
|
|
610
|
-
- `.moai/project/product.md` (
|
|
611
|
-
- `.moai/project/structure.md` (
|
|
612
|
-
- `.moai/project/tech.md` (
|
|
613
|
-
- `.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)
|
|
614
577
|
|
|
615
|
-
|
|
616
|
-
- [ ]
|
|
617
|
-
- [ ]
|
|
618
|
-
- [ ] config.json
|
|
619
|
-
- [ ]
|
|
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
|
|
620
583
|
|
|
621
|
-
### 2.4
|
|
584
|
+
### 2.4 Completion Report
|
|
622
585
|
|
|
623
586
|
```markdown
|
|
624
|
-
✅
|
|
625
|
-
|
|
626
|
-
📁
|
|
627
|
-
- .moai/project/product.md (
|
|
628
|
-
- .moai/project/structure.md (
|
|
629
|
-
- .moai/project/tech.md (
|
|
630
|
-
- .moai/config.json (
|
|
631
|
-
|
|
632
|
-
🔍
|
|
633
|
-
-
|
|
634
|
-
-
|
|
635
|
-
-
|
|
636
|
-
|
|
637
|
-
📋
|
|
638
|
-
1.
|
|
639
|
-
2. /alfred:1-
|
|
640
|
-
3.
|
|
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
|
|
641
604
|
```
|
|
642
605
|
|
|
643
|
-
### 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.
|
|
644
611
|
|
|
645
|
-
|
|
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
|
|
646
616
|
|
|
647
|
-
|
|
617
|
+
**How it works**:
|
|
618
|
+
Alfred only calls the trust-checker agent to perform project initial structural verification if explicitly requested by the user.
|
|
648
619
|
|
|
649
|
-
|
|
650
|
-
-
|
|
651
|
-
-
|
|
652
|
-
-
|
|
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
|
|
653
625
|
|
|
654
|
-
|
|
655
|
-
사용자가 명시적으로 요청한 경우에만 Alfred가 trust-checker 에이전트를 호출하여 프로젝트 초기 구조 검증을 수행합니다.
|
|
626
|
+
**Run Verification**: Level 1 quick scan (3-5 seconds)
|
|
656
627
|
|
|
657
|
-
|
|
658
|
-
- **문서 완성도**: product/structure/tech.md 필수 섹션 존재 확인
|
|
659
|
-
- **설정 유효성**: config.json JSON 구문 및 필수 필드 검증
|
|
660
|
-
- **TAG 체계**: 문서 내 @TAG 형식 준수 확인
|
|
661
|
-
- **EARS 구문**: SPEC 작성 시 사용할 EARS 템플릿 검증
|
|
628
|
+
**Handling verification results**:
|
|
662
629
|
|
|
663
|
-
|
|
630
|
+
✅ **Pass**: Can proceed to next step
|
|
631
|
+
- Documents and settings are all normal
|
|
664
632
|
|
|
665
|
-
|
|
633
|
+
⚠️ **Warning**: Proceed after warning
|
|
634
|
+
- Some optional sections are missing
|
|
635
|
+
- Recommendations not applied
|
|
666
636
|
|
|
667
|
-
|
|
668
|
-
-
|
|
637
|
+
❌ **Critical**: Needs fix
|
|
638
|
+
- Required section missing
|
|
639
|
+
- config.json syntax error
|
|
640
|
+
- User choice: “Revalidate after fix” or “Skip”
|
|
669
641
|
|
|
670
|
-
|
|
671
|
-
-
|
|
672
|
-
-
|
|
642
|
+
**Skip verification**:
|
|
643
|
+
- Verification is not run by default
|
|
644
|
+
- Run only when explicitly requested by the user
|
|
673
645
|
|
|
674
|
-
|
|
675
|
-
- 필수 섹션 누락
|
|
676
|
-
- config.json 구문 오류
|
|
677
|
-
- 사용자 선택: "수정 후 재검증" 또는 "건너뛰기"
|
|
646
|
+
### 2.6: Agent & Skill Tailoring (Project Optimization)
|
|
678
647
|
|
|
679
|
-
|
|
680
|
-
-
|
|
681
|
-
- 사용자가 명시적으로 요청할 때만 실행
|
|
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`.
|
|
682
650
|
|
|
651
|
+
#### 2.6.0 Create cc-manager briefing
|
|
652
|
+
|
|
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`.
|
|
654
|
+
|
|
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.
|
|
658
|
+
|
|
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.
|
|
660
|
+
|
|
661
|
+
#### 2.6.1 cc-manager judgment guide
|
|
662
|
+
|
|
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.
|
|
664
|
+
|
|
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 |
|
|
680
|
+
|
|
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`.
|
|
685
|
+
|
|
686
|
+
If multiple conditions are met, the candidates are merged without duplicates and organized into sets of `candidate_agents`, `candidate_skills`, and `candidate_styles`.
|
|
687
|
+
|
|
688
|
+
#### 2.6.2 User confirmation flow
|
|
689
|
+
|
|
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.
|
|
693
|
+
|
|
694
|
+
#### 2.6.3 Activation and Recording Steps
|
|
695
|
+
|
|
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.
|
|
683
717
|
|
|
684
|
-
##
|
|
718
|
+
## Interview guide by project type
|
|
685
719
|
|
|
686
|
-
###
|
|
720
|
+
### New project interview area
|
|
687
721
|
|
|
688
722
|
**Product Discovery** (product.md)
|
|
689
|
-
-
|
|
690
|
-
-
|
|
691
|
-
-
|
|
692
|
-
-
|
|
693
|
-
-
|
|
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
|
|
694
728
|
|
|
695
729
|
**Structure Blueprint** (structure.md)
|
|
696
|
-
-
|
|
697
|
-
-
|
|
698
|
-
-
|
|
699
|
-
- @TAG
|
|
730
|
+
- System architecture strategy
|
|
731
|
+
- Separation of modules and division of responsibilities
|
|
732
|
+
- External system integration plan
|
|
733
|
+
- @TAG-based traceability strategy
|
|
700
734
|
|
|
701
735
|
**Tech Stack Mapping** (tech.md)
|
|
702
|
-
-
|
|
703
|
-
-
|
|
704
|
-
-
|
|
705
|
-
-
|
|
736
|
+
- Language/runtime selection and version
|
|
737
|
+
- Framework and libraries
|
|
738
|
+
- Quality gate policy (coverage, linter)
|
|
739
|
+
- Security policy and distribution channel
|
|
706
740
|
|
|
707
|
-
###
|
|
741
|
+
### Existing project interview area
|
|
708
742
|
|
|
709
743
|
**Legacy Analysis**
|
|
710
|
-
-
|
|
711
|
-
-
|
|
712
|
-
-
|
|
713
|
-
-
|
|
714
|
-
- 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
|
|
715
749
|
|
|
716
|
-
|
|
750
|
+
**Retention Policy**: Preserve existing documents in the "Legacy Context" section and mark items needing improvement with @CODE/TODO tags
|
|
717
751
|
|
|
718
|
-
## 🏷️ TAG
|
|
752
|
+
## 🏷️ TAG system application rules
|
|
719
753
|
|
|
720
|
-
|
|
754
|
+
**Automatically create @TAGs per section**:
|
|
721
755
|
|
|
722
|
-
-
|
|
723
|
-
-
|
|
724
|
-
-
|
|
725
|
-
-
|
|
726
|
-
-
|
|
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
|
|
727
761
|
|
|
728
|
-
|
|
762
|
+
**Legacy Project Tags**:
|
|
729
763
|
|
|
730
|
-
-
|
|
731
|
-
-
|
|
732
|
-
-
|
|
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
|
|
733
767
|
|
|
734
|
-
##
|
|
768
|
+
## Error handling
|
|
735
769
|
|
|
736
|
-
###
|
|
770
|
+
### Common errors and solutions
|
|
737
771
|
|
|
738
|
-
|
|
772
|
+
**Error 1**: Project language detection failed
|
|
739
773
|
```
|
|
740
|
-
|
|
741
|
-
|
|
774
|
+
Symptom: “Language not detected” message
|
|
775
|
+
Solution: Specify language manually or create language-specific settings file
|
|
742
776
|
```
|
|
743
777
|
|
|
744
|
-
|
|
778
|
+
**Error 2**: Conflict with existing document
|
|
745
779
|
```
|
|
746
|
-
|
|
747
|
-
|
|
780
|
+
Symptom: product.md already exists and has different contents
|
|
781
|
+
Solution: Preserve existing contents and add new contents in “Legacy Context” section
|
|
748
782
|
```
|
|
749
783
|
|
|
750
|
-
|
|
784
|
+
**Error 3**: Failed to create config.json
|
|
751
785
|
```
|
|
752
|
-
|
|
753
|
-
|
|
786
|
+
Symptom: JSON syntax error or permission denied
|
|
787
|
+
Solution: Check file permissions (chmod 644) or create config.json manually
|
|
754
788
|
```
|
|
755
789
|
|
|
756
790
|
---
|
|
757
791
|
|
|
758
|
-
## /alfred:0-project update:
|
|
792
|
+
## /alfred:0-project update: Template optimization (subcommand)
|
|
759
793
|
|
|
760
|
-
>
|
|
794
|
+
> **Purpose**: After running moai-adk update, compare the backup and new template to optimize the template while preserving user customization.
|
|
761
795
|
|
|
762
|
-
###
|
|
796
|
+
### Execution conditions
|
|
763
797
|
|
|
764
|
-
|
|
798
|
+
This subcommand is executed under the following conditions:
|
|
765
799
|
|
|
766
|
-
1. **moai-adk update
|
|
767
|
-
2.
|
|
768
|
-
3.
|
|
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`
|
|
769
803
|
|
|
770
|
-
###
|
|
804
|
+
### Execution flow
|
|
771
805
|
|
|
772
|
-
#### Phase 1:
|
|
806
|
+
#### Phase 1: Backup analysis and comparison
|
|
773
807
|
|
|
774
|
-
1.
|
|
808
|
+
1. **Make sure you have the latest backup**:
|
|
775
809
|
```bash
|
|
776
|
-
|
|
810
|
+
# Browse the latest backups in the .moai-backups/ directory
|
|
777
811
|
ls -lt .moai-backups/ | head -1
|
|
778
812
|
```
|
|
779
813
|
|
|
780
|
-
2.
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
|
784
818
|
|
|
785
|
-
3.
|
|
819
|
+
3. **Create Comparison Report**:
|
|
786
820
|
```markdown
|
|
787
|
-
|
|
821
|
+
## 📊 Template optimization analysis
|
|
788
822
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
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
|
|
793
827
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
828
|
+
### Recommended Action
|
|
829
|
+
- Run Smart Merge
|
|
830
|
+
- Preserve User Customizations
|
|
831
|
+
- Set optimized=true
|
|
798
832
|
```
|
|
799
833
|
|
|
800
|
-
4.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
- "건너뛰기" → optimized=false 유지
|
|
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
|
|
806
839
|
|
|
807
|
-
#### Phase 2:
|
|
840
|
+
#### Phase 2: Run smart merge (after user approval)
|
|
808
841
|
|
|
809
|
-
1.
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
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
|
|
813
846
|
|
|
814
|
-
2. **optimized=true
|
|
847
|
+
2. Set **optimized=true**:
|
|
815
848
|
```python
|
|
816
|
-
# config.json
|
|
849
|
+
# update config.json
|
|
817
850
|
config_data["project"]["optimized"] = True
|
|
818
851
|
```
|
|
819
852
|
|
|
820
|
-
3.
|
|
853
|
+
3. **Optimization completion report**:
|
|
821
854
|
```markdown
|
|
822
|
-
|
|
855
|
+
✅ Template optimization completed!
|
|
823
856
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
857
|
+
📄 Merged files:
|
|
858
|
+
- CLAUDE.md (preserves project information)
|
|
859
|
+
- settings.json (preserves env variables)
|
|
827
860
|
|
|
828
|
-
|
|
861
|
+
⚙️ config.json: optimized=true Configuration complete
|
|
829
862
|
```
|
|
830
863
|
|
|
831
|
-
### Alfred
|
|
864
|
+
### Alfred Automation Strategy
|
|
832
865
|
|
|
833
|
-
**Alfred
|
|
834
|
-
- project-manager
|
|
835
|
-
-
|
|
836
|
-
-
|
|
866
|
+
**Alfred automatic decision**:
|
|
867
|
+
- Automatically call project-manager agent
|
|
868
|
+
- Check backup freshness (within 24 hours)
|
|
869
|
+
- Automatically analyze changes
|
|
837
870
|
|
|
838
|
-
**
|
|
839
|
-
- moai-alfred-tag-scanning: TAG
|
|
840
|
-
- moai-alfred-trust-validation:
|
|
871
|
+
**Auto-activation of Skills**:
|
|
872
|
+
- moai-alfred-tag-scanning: TAG chain verification
|
|
873
|
+
- moai-alfred-trust-validation: Verification of compliance with TRUST principles
|
|
841
874
|
|
|
842
|
-
###
|
|
875
|
+
### Running example
|
|
843
876
|
|
|
844
877
|
```bash
|
|
845
|
-
# moai-adk update
|
|
878
|
+
# After running moai-adk update
|
|
846
879
|
moai-adk update
|
|
847
880
|
|
|
848
|
-
#
|
|
881
|
+
# Output:
|
|
849
882
|
# ✓ Update complete!
|
|
850
883
|
# ℹ️ Next step: Run /alfred:0-project update to optimize template changes
|
|
851
884
|
|
|
852
|
-
# Alfred
|
|
885
|
+
# Run Alfred
|
|
853
886
|
/alfred:0-project update
|
|
854
887
|
|
|
855
|
-
# → Phase 1:
|
|
856
|
-
# →
|
|
857
|
-
# → Phase 2:
|
|
888
|
+
# → Phase 1: Generate backup analysis and comparison report
|
|
889
|
+
# → Wait for user approval
|
|
890
|
+
# → Phase 2: Run smart merge, set optimized=true
|
|
858
891
|
```
|
|
859
892
|
|
|
860
|
-
###
|
|
893
|
+
### caution
|
|
861
894
|
|
|
862
|
-
-
|
|
863
|
-
-
|
|
864
|
-
-
|
|
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
|
|
865
898
|
|
|
866
899
|
---
|
|
867
900
|
|
|
868
|
-
## 🚀 STEP 3:
|
|
901
|
+
## 🚀 STEP 3: Project Custom Optimization (Optional)
|
|
869
902
|
|
|
870
|
-
|
|
871
|
-
- Phase 2 (
|
|
872
|
-
-
|
|
873
|
-
-
|
|
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
|
|
874
907
|
|
|
875
|
-
|
|
908
|
+
**Purpose**: Lightweight by selecting only Commands, Agents, and Skills that fit the project characteristics (37 skills → 3~5)
|
|
876
909
|
|
|
877
|
-
### 3.1 Feature Selection
|
|
910
|
+
### 3.1 Automatic execution of Feature Selection
|
|
878
911
|
|
|
879
|
-
**Alfred
|
|
912
|
+
**Alfred automatically calls the moai-alfred-feature-selector skill**:
|
|
880
913
|
|
|
881
|
-
|
|
882
|
-
- `.moai/project/product.md` (
|
|
883
|
-
- `.moai/project/tech.md` (
|
|
884
|
-
- `.moai/config.json` (
|
|
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)
|
|
885
918
|
|
|
886
|
-
|
|
919
|
+
**Skill Output**:
|
|
887
920
|
```json
|
|
888
921
|
{
|
|
889
922
|
"category": "web-api",
|
|
@@ -897,95 +930,95 @@ moai-adk update
|
|
|
897
930
|
}
|
|
898
931
|
```
|
|
899
932
|
|
|
900
|
-
|
|
933
|
+
**How to Run**:
|
|
901
934
|
```
|
|
902
935
|
Alfred: Skill("moai-alfred-feature-selector")
|
|
903
936
|
```
|
|
904
937
|
|
|
905
938
|
---
|
|
906
939
|
|
|
907
|
-
### 3.2 Template Generation
|
|
940
|
+
### 3.2 Automatic execution of Template Generation
|
|
908
941
|
|
|
909
|
-
**Alfred
|
|
942
|
+
**Alfred automatically calls the moai-alfred-template-generator skill**:
|
|
910
943
|
|
|
911
|
-
|
|
912
|
-
- `.moai/.feature-selection.json` (feature-selector
|
|
913
|
-
- `CLAUDE.md`
|
|
914
|
-
-
|
|
944
|
+
**Skill input**:
|
|
945
|
+
- `.moai/.feature-selection.json` (feature-selector output)
|
|
946
|
+
- `CLAUDE.md` template
|
|
947
|
+
- Entire commands/agents/skills file
|
|
915
948
|
|
|
916
|
-
|
|
917
|
-
- `CLAUDE.md` (
|
|
918
|
-
- `.claude/commands/` (
|
|
919
|
-
- `.claude/agents/` (
|
|
920
|
-
- `.claude/skills/` (
|
|
921
|
-
- `.moai/config.json` (`optimized: true`
|
|
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`)
|
|
922
955
|
|
|
923
|
-
|
|
956
|
+
**How to Run**:
|
|
924
957
|
```
|
|
925
958
|
Alfred: Skill("moai-alfred-template-generator")
|
|
926
959
|
```
|
|
927
960
|
|
|
928
961
|
---
|
|
929
962
|
|
|
930
|
-
### 3.3
|
|
963
|
+
### 3.3 Optimization completion report
|
|
931
964
|
|
|
932
|
-
|
|
965
|
+
**Report Format**:
|
|
933
966
|
```markdown
|
|
934
|
-
✅
|
|
935
|
-
|
|
936
|
-
📊
|
|
937
|
-
-
|
|
938
|
-
-
|
|
939
|
-
-
|
|
940
|
-
-
|
|
941
|
-
|
|
942
|
-
🎯
|
|
943
|
-
- Commands: 4
|
|
944
|
-
- Agents: 5
|
|
945
|
-
- Skills: 3
|
|
946
|
-
|
|
947
|
-
💡
|
|
948
|
-
-
|
|
949
|
-
-
|
|
950
|
-
- CLAUDE.md:
|
|
951
|
-
|
|
952
|
-
📋
|
|
953
|
-
1. CLAUDE.md
|
|
954
|
-
2. /alfred:1-
|
|
955
|
-
3. MoAI-ADK
|
|
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
|
|
956
989
|
```
|
|
957
990
|
|
|
958
991
|
---
|
|
959
992
|
|
|
960
|
-
### 3.4 Phase 3
|
|
993
|
+
### 3.4 Skip Phase 3 (optional)
|
|
961
994
|
|
|
962
|
-
|
|
995
|
+
**Users can skip Phase 3**:
|
|
963
996
|
|
|
964
|
-
|
|
965
|
-
-
|
|
966
|
-
-
|
|
997
|
+
**Skip condition**:
|
|
998
|
+
- User explicitly selects “Skip”
|
|
999
|
+
- “Simple project” when Alfred automatically determines (only basic features required)
|
|
967
1000
|
|
|
968
|
-
|
|
969
|
-
-
|
|
970
|
-
-
|
|
971
|
-
-
|
|
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
|
|
972
1005
|
|
|
973
1006
|
---
|
|
974
1007
|
|
|
975
|
-
##
|
|
1008
|
+
## Next steps
|
|
976
1009
|
|
|
977
|
-
|
|
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.
|
|
978
1011
|
|
|
979
|
-
|
|
1012
|
+
After initialization is complete:
|
|
980
1013
|
|
|
981
|
-
-
|
|
982
|
-
-
|
|
983
|
-
-
|
|
984
|
-
-
|
|
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`
|
|
985
1018
|
|
|
986
|
-
##
|
|
1019
|
+
## Related commands
|
|
987
1020
|
|
|
988
|
-
- `/alfred:1-
|
|
989
|
-
- `/alfred:9-update` - MoAI-ADK
|
|
990
|
-
- `moai doctor` -
|
|
991
|
-
- `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
|