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.
- moai_adk/__init__.py +1 -1
- moai_adk/__main__.py +1 -1
- moai_adk/cli/commands/__init__.py +1 -1
- moai_adk/cli/commands/doctor.py +2 -2
- moai_adk/cli/commands/init.py +10 -5
- moai_adk/cli/commands/status.py +1 -1
- moai_adk/cli/commands/update.py +210 -8
- moai_adk/cli/prompts/init_prompts.py +15 -19
- moai_adk/core/__init__.py +1 -1
- moai_adk/core/diagnostics/slash_commands.py +1 -1
- moai_adk/core/git/branch.py +1 -1
- moai_adk/core/git/manager.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/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +1 -1
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/template/__init__.py +1 -1
- moai_adk/core/template/backup.py +12 -3
- moai_adk/core/template/config.py +24 -0
- moai_adk/core/template/languages.py +1 -1
- moai_adk/core/template/merger.py +74 -4
- moai_adk/core/template/processor.py +62 -14
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +765 -191
- 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 +856 -355
- moai_adk/templates/.claude/commands/alfred/1-plan.md +572 -0
- moai_adk/templates/.claude/commands/alfred/2-run.md +470 -0
- 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 +30 -51
- 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 +94 -0
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +433 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +363 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +595 -0
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +496 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +95 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +93 -0
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +105 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +102 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +104 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +96 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +112 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +90 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +94 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +93 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +86 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +86 -0
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +102 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +96 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +96 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +100 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +96 -0
- 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 +354 -573
- moai_adk/templates/__init__.py +1 -1
- moai_adk/utils/__init__.py +1 -1
- moai_adk/utils/banner.py +7 -7
- moai_adk/utils/logger.py +1 -1
- 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 -532
- moai_adk/templates/.claude/commands/alfred/2-build.md +0 -432
- moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
- moai_adk-0.3.13.dist-info/METADATA +0 -1586
- moai_adk-0.3.13.dist-info/RECORD +0 -90
- {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
- {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:
|
|
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
|
-
|
|
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
|
-
1.
|
|
87
|
-
Alfred는 디렉토리 구조를 분석하여 신규 vs 기존 프로젝트를 분류합니다:
|
|
88
|
-
- 빈 디렉토리 → 신규 프로젝트
|
|
89
|
-
- 코드/문서 존재 → 기존 프로젝트
|
|
90
|
+
### 1.0 Check backup directory (highest priority)
|
|
90
91
|
|
|
91
|
-
|
|
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
|
-
|
|
261
|
+
- backend/ + frontend/ → full stack
|
|
98
262
|
|
|
99
|
-
3.
|
|
100
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
|
116
|
-
|
|
|
117
|
-
| **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.
|
|
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
|
-
## 📊
|
|
130
|
-
|
|
131
|
-
###
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
### 🎯
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
### ⚠️
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
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.
|
|
323
|
+
### 1.5 Wait for user approval (moai-alfred-tui-survey) (when user selects "New")
|
|
160
324
|
|
|
161
|
-
|
|
162
|
-
- **
|
|
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
|
-
|
|
362
|
+
| Conditions | Automatic selection Skill | Purpose |
|
|
363
|
+
| ------------------------------------ | ---------------------------- | -------------------------------------- |
|
|
364
|
+
| User Requests “Quality Verification” | moai-alfred-trust-validation | Initial project structure verification |
|
|
171
365
|
|
|
172
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
393
|
+
### 2.4 Processing method by project type
|
|
185
394
|
|
|
186
|
-
|
|
395
|
+
#### A. New project (Greenfield)
|
|
187
396
|
|
|
188
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
236
|
-
-
|
|
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
|
|
241
|
-
1.
|
|
242
|
-
2.
|
|
243
|
-
3.
|
|
244
|
-
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*
|
|
245
456
|
|
|
246
|
-
|
|
247
|
-
-
|
|
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 file → Core source → Test → Document
|
|
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
|
-
|
|
264
|
-
|
|
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
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
|
286
|
-
- biome.json:
|
|
287
|
-
|
|
288
|
-
###
|
|
289
|
-
- src/core/:
|
|
290
|
-
- src/api/: REST API
|
|
291
|
-
- src/utils/:
|
|
292
|
-
-
|
|
293
|
-
|
|
294
|
-
###
|
|
295
|
-
- Vitest + @testing-library
|
|
296
|
-
-
|
|
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:
|
|
516
|
+
**STEP 4: Comprehensive analysis and product/structure/tech reflection**
|
|
306
517
|
|
|
307
|
-
|
|
518
|
+
Based on the collected information, it is reflected in three major documents:
|
|
308
519
|
|
|
309
|
-
1. **product.md
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
319
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
331
|
-
-
|
|
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
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
###
|
|
344
|
-
1.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
2.
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
###
|
|
354
|
-
1. product/structure/tech.md
|
|
355
|
-
2. @CODE/TODO
|
|
356
|
-
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
|
|
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
|
-
- [ ]
|
|
369
|
-
- [ ]
|
|
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-
|
|
392
|
-
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
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
754
|
+
**Automatically create @TAGs per section**:
|
|
473
755
|
|
|
474
|
-
-
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
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
|
-
-
|
|
483
|
-
-
|
|
484
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
778
|
+
**Error 2**: Conflict with existing document
|
|
497
779
|
```
|
|
498
|
-
|
|
499
|
-
|
|
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
|
-
|
|
784
|
+
**Error 3**: Failed to create config.json
|
|
503
785
|
```
|
|
504
|
-
|
|
505
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
515
|
-
-
|
|
516
|
-
-
|
|
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-
|
|
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
|