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
moai_adk/templates/CLAUDE.md
CHANGED
|
@@ -6,722 +6,503 @@
|
|
|
6
6
|
|
|
7
7
|
## ▶◀ Meet Alfred: Your MoAI SuperAgent
|
|
8
8
|
|
|
9
|
-
**Alfred
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| **
|
|
46
|
-
| **
|
|
47
|
-
| **
|
|
48
|
-
| **
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- 🔍 복잡한 코드 구조 파악이 필요할 때
|
|
77
|
-
- 🔍 여러 파일에 걸친 구현을 추적할 때
|
|
78
|
-
- 🔍 특정 기능의 전체 흐름을 이해할 때
|
|
79
|
-
- 🔍 의존성 관계를 분석할 때
|
|
80
|
-
- 🔍 리팩토링 전 영향 범위를 확인할 때
|
|
81
|
-
|
|
82
|
-
**사용 예시**:
|
|
9
|
+
**Alfred** orchestrates the MoAI-ADK agentic workflow across a four-layer stack (Commands → Sub-agents → Skills → Hooks). The SuperAgent interprets user intent, activates the right specialists, streams Claude Skills on demand, and enforces the TRUST 5 principles so every project follows the SPEC → TDD → Sync rhythm.
|
|
10
|
+
|
|
11
|
+
### 4-Layer Architecture (v0.4.0)
|
|
12
|
+
|
|
13
|
+
| Layer | Owner | Purpose | Examples |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| **Commands** | User ↔ Alfred | Workflow entry points that establish the Plan → Run → Sync cadence | `/alfred:0-project`, `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync` |
|
|
16
|
+
| **Sub-agents** | Alfred | Deep reasoning and decision making for each phase | project-manager, spec-builder, code-builder pipeline, doc-syncer |
|
|
17
|
+
| **Skills (44)** | Claude Skills | Reusable knowledge capsules loaded just-in-time | Foundation (TRUST/TAG/Git), Essentials (debug/refactor/review), Domain & Language packs |
|
|
18
|
+
| **Hooks** | Runtime guardrails | Fast validation + JIT context hints (<100 ms) | SessionStart status card, PreToolUse destructive-command blocker |
|
|
19
|
+
|
|
20
|
+
### Core Sub-agent Roster
|
|
21
|
+
|
|
22
|
+
> Alfred + 10 core sub-agents + 6 zero-project specialists + 2 built-in Claude agents = **19-member team**
|
|
23
|
+
|
|
24
|
+
| Sub-agent | Model | Phase | Responsibility | Trigger |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| **project-manager** 📋 | Sonnet | Init | Project bootstrap, metadata interview, mode selection | `/alfred:0-project` |
|
|
27
|
+
| **spec-builder** 🏗️ | Sonnet | Plan | Plan board consolidation, EARS-based SPEC authoring | `/alfred:1-plan` |
|
|
28
|
+
| **code-builder pipeline** 💎 | Sonnet | Run | Phase 1 `implementation-planner` → Phase 2 `tdd-implementer` to execute RED → GREEN → REFACTOR | `/alfred:2-run` |
|
|
29
|
+
| **doc-syncer** 📖 | Haiku | Sync | Living documentation, README/CHANGELOG updates | `/alfred:3-sync` |
|
|
30
|
+
| **tag-agent** 🏷️ | Haiku | Sync | TAG inventory, orphan detection, chain repair | `@agent-tag-agent` |
|
|
31
|
+
| **git-manager** 🚀 | Haiku | Plan · Sync | GitFlow automation, Draft→Ready PR, auto-merge policy | `@agent-git-manager` |
|
|
32
|
+
| **debug-helper** 🔍 | Sonnet | Run | Failure diagnosis, fix-forward guidance | `@agent-debug-helper` |
|
|
33
|
+
| **trust-checker** ✅ | Haiku | All phases | TRUST 5 principle enforcement and risk flags | `@agent-trust-checker` |
|
|
34
|
+
| **quality-gate** 🛡️ | Haiku | Sync | Coverage delta review, release gate validation | Auto during `/alfred:3-sync` |
|
|
35
|
+
| **cc-manager** 🛠️ | Sonnet | Ops | Claude Code session tuning, Skill lifecycle management | `@agent-cc-manager` |
|
|
36
|
+
|
|
37
|
+
The **code-builder pipeline** runs two Sonnet specialists in sequence: **implementation-planner** (strategy, libraries, TAG design) followed by **tdd-implementer** (RED → GREEN → REFACTOR execution).
|
|
38
|
+
|
|
39
|
+
### Zero-project Specialists
|
|
40
|
+
|
|
41
|
+
| Sub-agent | Model | Focus | Trigger |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| **language-detector** 🔍 | Haiku | Stack detection, language matrix | Auto during `/alfred:0-project` |
|
|
44
|
+
| **backup-merger** 📦 | Sonnet | Backup restore, checkpoint diff | `@agent-backup-merger` |
|
|
45
|
+
| **project-interviewer** 💬 | Sonnet | Requirement interviews, persona capture | `/alfred:0-project` Q&A |
|
|
46
|
+
| **document-generator** 📝 | Haiku | Project docs seed (`product.md`, `structure.md`, `tech.md`) | `/alfred:0-project` |
|
|
47
|
+
| **feature-selector** 🎯 | Haiku | Skill pack recommendation | `/alfred:0-project` |
|
|
48
|
+
| **template-optimizer** ⚙️ | Haiku | Template cleanup, migration helpers | `/alfred:0-project` |
|
|
49
|
+
|
|
50
|
+
### Built-in Claude Agents
|
|
51
|
+
|
|
52
|
+
| Agent | Model | Specialty | Invocation |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| **Explore** 🔍 | Haiku | Repository-wide search & architecture mapping | `@agent-Explore` |
|
|
55
|
+
| **general-purpose** | Sonnet | General assistance | Automatic |
|
|
56
|
+
|
|
57
|
+
#### Explore Agent Guide
|
|
58
|
+
|
|
59
|
+
The **Explore** agent excels at navigating large codebases.
|
|
60
|
+
|
|
61
|
+
**Use cases**:
|
|
62
|
+
- ✅ **Code analysis** (understand complex implementations, trace dependencies, study architecture)
|
|
63
|
+
- ✅ Search for specific keywords or patterns (e.g., "API endpoints", "authentication logic")
|
|
64
|
+
- ✅ Locate files (e.g., `src/components/**/*.tsx`)
|
|
65
|
+
- ✅ Understand codebase structure (e.g., "explain the project architecture")
|
|
66
|
+
- ✅ Search across many files (Glob + Grep patterns)
|
|
67
|
+
|
|
68
|
+
**Recommend Explore when**:
|
|
69
|
+
- 🔍 You need to understand a complex structure
|
|
70
|
+
- 🔍 The implementation spans multiple files
|
|
71
|
+
- 🔍 You want the end-to-end flow of a feature
|
|
72
|
+
- 🔍 Dependency relationships must be analyzed
|
|
73
|
+
- 🔍 You're planning a refactor and need impact analysis
|
|
74
|
+
|
|
75
|
+
**Usage examples**:
|
|
83
76
|
```python
|
|
84
|
-
# 1.
|
|
77
|
+
# 1. Deep code analysis
|
|
85
78
|
Task(
|
|
86
79
|
subagent_type="Explore",
|
|
87
|
-
description="
|
|
88
|
-
prompt="""
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
thoroughness
|
|
80
|
+
description="Analyze the full implementation of TemplateProcessor",
|
|
81
|
+
prompt="""Please analyze the TemplateProcessor class implementation:
|
|
82
|
+
- Class definition location
|
|
83
|
+
- Key method implementations
|
|
84
|
+
- Dependent classes/modules
|
|
85
|
+
- Related tests
|
|
86
|
+
thoroughness level: very thorough"""
|
|
94
87
|
)
|
|
95
88
|
|
|
96
|
-
# 2.
|
|
89
|
+
# 2. Domain-specific search (inside commands)
|
|
97
90
|
Task(
|
|
98
91
|
subagent_type="Explore",
|
|
99
|
-
description="
|
|
100
|
-
prompt="""
|
|
101
|
-
- SPEC
|
|
102
|
-
thoroughness
|
|
92
|
+
description="Find files related to the AUTH domain",
|
|
93
|
+
prompt="""Find every file related to the AUTH domain:
|
|
94
|
+
- SPEC documents, tests, implementation (src), documentation
|
|
95
|
+
thoroughness level: medium"""
|
|
103
96
|
)
|
|
104
97
|
|
|
105
|
-
# 3.
|
|
106
|
-
|
|
107
|
-
→ Alfred
|
|
108
|
-
→
|
|
109
|
-
→ Alfred
|
|
98
|
+
# 3. Natural language questions (auto-delegated by Alfred)
|
|
99
|
+
User: "Where is JWT authentication implemented in this project?"
|
|
100
|
+
→ Alfred automatically delegates to Explore
|
|
101
|
+
→ Explore returns the relevant file list
|
|
102
|
+
→ Alfred reads only the necessary files
|
|
110
103
|
```
|
|
111
104
|
|
|
112
|
-
**thoroughness
|
|
113
|
-
- `quick`:
|
|
114
|
-
- `medium`:
|
|
115
|
-
- `very thorough`:
|
|
105
|
+
**thoroughness levels** (declare explicitly inside the prompt text):
|
|
106
|
+
- `quick`: fast scan (basic patterns)
|
|
107
|
+
- `medium`: moderate sweep (multiple locations + naming rules) — **recommended**
|
|
108
|
+
- `very thorough`: exhaustive scan (full codebase analysis)
|
|
116
109
|
|
|
117
|
-
###
|
|
110
|
+
### Claude Skills (44 packs)
|
|
118
111
|
|
|
119
|
-
|
|
120
|
-
- **단일 책임 원칙**: 각 에이전트는 자신의 전문 영역만 담당
|
|
121
|
-
- **중앙 조율**: Alfred만이 에이전트 간 작업을 조율 (에이전트 간 직접 호출 금지)
|
|
122
|
-
- **품질 게이트**: 각 단계 완료 시 TRUST 원칙 및 @TAG 무결성 자동 검증
|
|
112
|
+
Alfred relies on 44 Claude Skills grouped by tier. Skills load via Progressive Disclosure: metadata is available at session start, full `SKILL.md` content loads when a sub-agent references it, and supporting templates stream only when required.
|
|
123
113
|
|
|
124
|
-
|
|
114
|
+
**Foundation Tier (6)**
|
|
125
115
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
116
|
+
| Skill | Purpose | Auto-load |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| `moai-foundation-trust` | TRUST checklist, coverage gate policies | SessionStart, `/alfred:3-sync` |
|
|
119
|
+
| `moai-foundation-tags` | TAG inventory & orphan detection | `/alfred:3-sync` |
|
|
120
|
+
| `moai-foundation-specs` | SPEC metadata policy and versioning | `/alfred:1-plan` |
|
|
121
|
+
| `moai-foundation-ears` | EARS templates and requirement phrasing | `/alfred:1-plan` |
|
|
122
|
+
| `moai-foundation-git` | GitFlow automation & PR policy | Plan/Run/Sync |
|
|
123
|
+
| `moai-foundation-langs` | Language detection & Skill preload | SessionStart, `/alfred:2-run` |
|
|
132
124
|
|
|
133
|
-
|
|
125
|
+
**Essentials Tier (4)**
|
|
134
126
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
127
|
+
| Skill | Purpose | Auto-load |
|
|
128
|
+
| --- | --- | --- |
|
|
129
|
+
| `moai-essentials-debug` | Failure diagnosis & reproduction checklist | Auto when `/alfred:2-run` detects failures |
|
|
130
|
+
| `moai-essentials-perf` | Performance analysis & profiling strategies | On demand |
|
|
131
|
+
| `moai-essentials-refactor` | Refactoring patterns & code-smell remediation | `/alfred:2-run` |
|
|
132
|
+
| `moai-essentials-review` | Code review checklist & quality feedback | `/alfred:3-sync` |
|
|
141
133
|
|
|
142
|
-
|
|
134
|
+
**Domain Tier (10)** — `moai-domain-backend`, `web-api`, `frontend`, `mobile-app`, `security`, `devops`, `database`, `data-science`, `ml`, `cli-tool`.
|
|
143
135
|
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
작업이 복잡한 판단/설계/창의성이 필요한가?
|
|
147
|
-
├─ YES → Sonnet 4.5
|
|
148
|
-
│ ├─ 예: "SPEC 설계", "아키텍처 결정", "오류 원인 분석"
|
|
149
|
-
│ └─ 목표: 높은 품질, 정확한 판단
|
|
150
|
-
└─ NO → Haiku 4.5
|
|
151
|
-
├─ 예: "문서 동기화", "TAG 스캔", "Git 명령 실행"
|
|
152
|
-
└─ 목표: 빠른 속도, 비용 절감
|
|
153
|
-
```
|
|
136
|
+
**Language Tier (23)** — Python, TypeScript, Go, Rust, Java, Kotlin, Swift, Dart, C/C++, C#, Scala, Haskell, Elixir, Clojure, Lua, Ruby, PHP, JavaScript, SQL, Shell, Julia, R, plus supporting stacks.
|
|
154
137
|
|
|
155
|
-
|
|
138
|
+
**Claude Code Ops (1)** — `moai-claude-code` manages session settings, output styles, and Skill deployment.
|
|
156
139
|
|
|
157
|
-
|
|
140
|
+
Skills keep the core knowledge lightweight while allowing Alfred to assemble the right expertise for each request.
|
|
158
141
|
|
|
159
|
-
|
|
160
|
-
1. 현재 프로젝트 상태 분석 (Git, 파일, 문서 등)
|
|
161
|
-
2. 작업 범위 및 전략 결정
|
|
162
|
-
3. 계획 보고서 생성 및 사용자 확인 대기
|
|
142
|
+
### Agent Collaboration Principles
|
|
163
143
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
144
|
+
- **Command precedence**: Command instructions outrank agent guidelines; follow the command if conflicts occur.
|
|
145
|
+
- **Single responsibility**: Each agent handles only its specialty.
|
|
146
|
+
- **Zero overlapping ownership**: When unsure, hand off to the agent with the most direct expertise.
|
|
147
|
+
- **Confidence reporting**: Always share confidence levels and identified risks when completing a task.
|
|
148
|
+
- **Escalation path**: When blocked, escalate to Alfred with context, attempted steps, and suggested next actions.
|
|
168
149
|
|
|
169
|
-
|
|
170
|
-
- **"진행"** 또는 **"시작"**: Phase 2로 진행
|
|
171
|
-
- **"수정 [내용]"**: 계획 재수립
|
|
172
|
-
- **"중단"**: 작업 취소
|
|
150
|
+
### Model Selection Guide
|
|
173
151
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
152
|
+
| Model | Primary use cases | Representative sub-agents | Why it fits |
|
|
153
|
+
| --- | --- | --- | --- |
|
|
154
|
+
| **Claude 4.5 Haiku** | Documentation sync, TAG inventory, Git automation, rule-based checks | doc-syncer, tag-agent, git-manager, trust-checker, quality-gate, Explore | Fast, deterministic output for patterned or string-heavy work |
|
|
155
|
+
| **Claude 4.5 Sonnet** | Planning, implementation, troubleshooting, session ops | Alfred, project-manager, spec-builder, code-builder pipeline, debug-helper, cc-manager | Deep reasoning, multi-step synthesis, creative problem solving |
|
|
178
156
|
|
|
179
|
-
|
|
157
|
+
**Guidelines**:
|
|
158
|
+
- Default to **Haiku** when the task is pattern-driven or requires rapid iteration; escalate to **Sonnet** for novel design, architecture, or ambiguous problem solving.
|
|
159
|
+
- Record any manual model switch in the task notes (who, why, expected benefit).
|
|
160
|
+
- Combine both models when needed: e.g., Sonnet plans a refactor, Haiku formats and validates the resulting docs.
|
|
180
161
|
|
|
181
|
-
|
|
162
|
+
### Alfred Command Execution Pattern (Shared)
|
|
182
163
|
|
|
183
|
-
|
|
184
|
-
- **❌ Critical**: 작업 중단, 즉시 조치 필요
|
|
185
|
-
- **⚠️ Warning**: 주의 필요, 계속 진행 가능
|
|
186
|
-
- **ℹ️ Info**: 정보성 메시지, 참고용
|
|
164
|
+
Alfred commands follow a three-phase loop, with an optional bootstrap stage for `/alfred:0-project`.
|
|
187
165
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
[아이콘] [컨텍스트]: [문제 설명]
|
|
191
|
-
→ [권장 조치]
|
|
192
|
-
```
|
|
166
|
+
- **Phase 0 — Bootstrap (optional)**
|
|
167
|
+
Capture project metadata, create `.moai/config.json` and project docs, detect languages, and stage the recommended Skill packs.
|
|
193
168
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
❌ SPEC 문서 작성 실패: .moai/specs/ 디렉토리 권한 거부
|
|
197
|
-
→ chmod 755 .moai/specs 실행 후 재시도
|
|
169
|
+
- **Phase 1 — Analyze & Plan**
|
|
170
|
+
Understand scope, constraints, and desired outputs; review existing context (files, specs, tests); outline the execution plan and surface risks.
|
|
198
171
|
|
|
199
|
-
|
|
200
|
-
|
|
172
|
+
- **Phase 2 — Execute**
|
|
173
|
+
Run the approved steps in order, log progress in the task thread, escalate blockers immediately with mitigation options, and record decisions.
|
|
201
174
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
```
|
|
175
|
+
- **Phase 3 — Sync & Handoff**
|
|
176
|
+
Update docs, TAG inventory, and reports; verify quality gates; summarize outcomes; and suggest the next command or manual follow-up.
|
|
205
177
|
|
|
206
|
-
###
|
|
178
|
+
### Alfred's Next-Step Suggestion Principles
|
|
207
179
|
|
|
208
|
-
|
|
180
|
+
#### Pre-suggestion Checklist
|
|
209
181
|
|
|
210
|
-
|
|
182
|
+
Before suggesting the next step, always verify:
|
|
183
|
+
- You have the latest status from agents.
|
|
184
|
+
- All blockers are documented with context.
|
|
185
|
+
- Required approvals or user confirmations are noted.
|
|
186
|
+
- Suggested tasks include clear owners and outcomes.
|
|
187
|
+
- There is at most one "must-do" suggestion per step.
|
|
211
188
|
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
🔴 RED: [테스트 설명]
|
|
215
|
-
🟢 GREEN: [구현 설명]
|
|
216
|
-
♻️ REFACTOR: [개선 설명]
|
|
217
|
-
📝 DOCS: [문서 설명]
|
|
218
|
-
```
|
|
189
|
+
**cc-manager validation sequence**
|
|
219
190
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
📝 DOCS: [Documentation description]
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
**일본어 (ja)**:
|
|
229
|
-
```bash
|
|
230
|
-
🔴 RED: [テスト説明]
|
|
231
|
-
🟢 GREEN: [実装説明]
|
|
232
|
-
♻️ REFACTOR: [改善説明]
|
|
233
|
-
📝 DOCS: [ドキュメント説明]
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
**중국어 (zh)**:
|
|
237
|
-
```bash
|
|
238
|
-
🔴 RED: [测试说明]
|
|
239
|
-
🟢 GREEN: [实现说明]
|
|
240
|
-
♻️ REFACTOR: [改进说明]
|
|
241
|
-
📝 DOCS: [文档说明]
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
#### 커밋 메시지 구조
|
|
245
|
-
```
|
|
246
|
-
[아이콘] [단계]: [설명]
|
|
247
|
-
|
|
248
|
-
@TAG:[SPEC-ID]-[단계]
|
|
249
|
-
```
|
|
191
|
+
1. **SPEC** – Confirm the SPEC file exists and note its status (`draft`, `active`, `completed`, `archived`). If missing, queue `/alfred:1-plan`.
|
|
192
|
+
2. **TEST & CODE** – Check whether tests and implementation files exist and whether the latest test run passed. Address failing tests before proposing new work.
|
|
193
|
+
3. **DOCS & TAGS** – Ensure `/alfred:3-sync` is not pending, Living Docs and TAG chains are current, and no orphan TAGs remain.
|
|
194
|
+
4. **GIT & PR** – Review the current branch, Draft/Ready PR state, and uncommitted changes. Highlight required Git actions explicitly.
|
|
195
|
+
5. **BLOCKERS & APPROVALS** – List outstanding approvals, unanswered questions, TodoWrite items, or dependency risks.
|
|
250
196
|
|
|
251
|
-
|
|
252
|
-
git-manager는 커밋 생성 시 자동으로 `.moai/config.json`의 `project.locale` 값을 읽어 해당 언어로 커밋 메시지를 생성합니다.
|
|
197
|
+
> cc-manager enforces this order. Reference the most recent status output when replying, and call out the next mandatory action (or confirm that all gates have passed).
|
|
253
198
|
|
|
254
|
-
|
|
199
|
+
#### Poor Suggestion Examples (❌)
|
|
255
200
|
|
|
256
|
-
|
|
201
|
+
- Suggesting tasks already completed.
|
|
202
|
+
- Mixing unrelated actions in one suggestion.
|
|
203
|
+
- Proposing work without explaining the problem or expected result.
|
|
204
|
+
- Ignoring known blockers or assumptions.
|
|
257
205
|
|
|
258
|
-
|
|
206
|
+
#### Good Suggestion Examples (✅)
|
|
259
207
|
|
|
260
|
-
|
|
208
|
+
- Link the suggestion to a clear goal or risk mitigation.
|
|
209
|
+
- Reference evidence (logs, diffs, test output).
|
|
210
|
+
- Provide concrete next steps with estimated effort.
|
|
261
211
|
|
|
262
|
-
|
|
212
|
+
#### Suggestion Restrictions
|
|
263
213
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
- `/alfred:2-build` → `SPEC-XXX/spec.md` + `development-guide.md` 참조
|
|
269
|
-
- `/alfred:3-sync` → `sync-report.md` + TAG 인덱스 참조
|
|
214
|
+
- Do not recommend direct commits; always go through review.
|
|
215
|
+
- Avoid introducing new scope without confirming priority.
|
|
216
|
+
- Never suppress warnings or tests without review.
|
|
217
|
+
- Do not rely on manual verification when automation exists.
|
|
270
218
|
|
|
271
|
-
####
|
|
219
|
+
#### Suggestion Priorities
|
|
272
220
|
|
|
273
|
-
|
|
221
|
+
1. Resolve production blockers.
|
|
222
|
+
2. Restore failing tests or pipelines.
|
|
223
|
+
3. Close gaps against the SPEC.
|
|
224
|
+
4. Improve developer experience or automation.
|
|
274
225
|
|
|
275
|
-
|
|
276
|
-
기존 방식 (비효율):
|
|
277
|
-
❌ Glob + Grep + Read를 여러 번 반복
|
|
278
|
-
❌ Alfred가 직접 파일 하나하나 탐색
|
|
279
|
-
❌ 컨텍스트 비용 증가
|
|
280
|
-
|
|
281
|
-
Explore 방식 (효율):
|
|
282
|
-
✅ Explore 에이전트에 위임 (1회 호출)
|
|
283
|
-
✅ 관련 파일 목록만 반환받음
|
|
284
|
-
✅ 필요한 파일만 선택적 Read
|
|
285
|
-
✅ 컨텍스트 비용 절감
|
|
286
|
-
```
|
|
226
|
+
#### Status Commands
|
|
287
227
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
# Alfred → Explore 에이전트 위임
|
|
292
|
-
Task(
|
|
293
|
-
subagent_type="Explore",
|
|
294
|
-
description="JWT 인증 관련 파일 탐색",
|
|
295
|
-
prompt="""JWT 인증 관련 모든 파일을 찾아주세요.
|
|
296
|
-
thoroughness 레벨: medium"""
|
|
297
|
-
)
|
|
298
|
-
→ 결과: ["src/auth/jwt.py", "tests/test_auth.py", ...]
|
|
299
|
-
→ Alfred는 결과 기반으로 필요한 파일만 Read
|
|
300
|
-
→ 컨텍스트 비용 최소화
|
|
301
|
-
```
|
|
228
|
+
- `/alfred status`: Summary of current phase and active agents.
|
|
229
|
+
- `/alfred queue`: Pending actions with owners.
|
|
230
|
+
- `/alfred blockers`: Known blockers and mitigation status.
|
|
302
231
|
|
|
303
|
-
|
|
232
|
+
### Error Message Standard (Shared)
|
|
304
233
|
|
|
305
|
-
|
|
306
|
-
- `CLAUDE.md` → `development-guide.md` (상세 규칙)
|
|
307
|
-
- `CLAUDE.md` → `product/structure/tech.md` (프로젝트 컨텍스트)
|
|
308
|
-
- `development-guide.md` ↔ `product/structure/tech.md` (상호 참조)
|
|
234
|
+
#### Severity Icons
|
|
309
235
|
|
|
310
|
-
|
|
236
|
+
- 🔴 Critical failure (stop immediately)
|
|
237
|
+
- 🟠 Major issue (needs immediate attention)
|
|
238
|
+
- 🟡 Warning (monitor closely)
|
|
239
|
+
- 🔵 Info (no action needed)
|
|
311
240
|
|
|
312
|
-
|
|
241
|
+
#### Message Format
|
|
313
242
|
|
|
314
|
-
|
|
243
|
+
```
|
|
244
|
+
🔴 <Title>
|
|
245
|
+
- Cause: <root cause>
|
|
246
|
+
- Scope: <affected components>
|
|
247
|
+
- Evidence: <logs/screenshots/links>
|
|
248
|
+
- Next Step: <required action>
|
|
249
|
+
```
|
|
315
250
|
|
|
316
|
-
###
|
|
251
|
+
### Git Commit Message Standard (Locale-aware)
|
|
317
252
|
|
|
318
|
-
|
|
319
|
-
- 실행 시점: Claude Code 생명주기의 특정 지점 (SessionStart, PreToolUse 등)
|
|
320
|
-
- 실행 방식: Bash 명령어 (stdin/stdout JSON)
|
|
321
|
-
- 실행 속도: 빠름 (<100ms 권장)
|
|
322
|
-
- 차단 가능: blocked=true로 작업 차단 가능
|
|
253
|
+
#### TDD Stage Commit Templates
|
|
323
254
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
255
|
+
| Stage | Template |
|
|
256
|
+
| -------- | ---------------------------------------------------------- |
|
|
257
|
+
| RED | `test: add failing test for <feature>` |
|
|
258
|
+
| GREEN | `feat: implement <feature> to pass tests` |
|
|
259
|
+
| REFACTOR | `refactor: clean up <component> without changing behavior` |
|
|
329
260
|
|
|
330
|
-
|
|
331
|
-
- 가벼운 로직 (≤50 LOC per handler)
|
|
332
|
-
- 복잡한 분석/검증은 Agents로 위임
|
|
333
|
-
- 사용자 상호작용 최소화 (차단 메시지만)
|
|
261
|
+
#### Commit Structure
|
|
334
262
|
|
|
335
|
-
**예시**:
|
|
336
|
-
```python
|
|
337
|
-
# ✅ 올바른 Hooks 사용
|
|
338
|
-
def handle_pre_tool_use(payload):
|
|
339
|
-
if "rm -rf" in payload.get("command", ""):
|
|
340
|
-
create_checkpoint() # 빠른 백업
|
|
341
|
-
return HookResult(blocked=True, message="위험한 작업 차단")
|
|
342
|
-
return HookResult(blocked=False)
|
|
343
|
-
|
|
344
|
-
# ❌ 잘못된 Hooks 사용 (너무 무거움)
|
|
345
|
-
def handle_pre_tool_use(payload):
|
|
346
|
-
validate_spec_metadata() # 복잡한 검증 → Agent로!
|
|
347
|
-
check_trust_compliance() # 시간 소요 → Agent로!
|
|
348
|
-
generate_report() # 보고서 생성 → Agent로!
|
|
349
263
|
```
|
|
264
|
+
<type>(scope): <subject>
|
|
350
265
|
|
|
351
|
-
|
|
266
|
+
- Context of the change
|
|
267
|
+
- Additional notes (optional)
|
|
352
268
|
|
|
353
|
-
|
|
269
|
+
Refs: @TAG-ID (if applicable)
|
|
270
|
+
```
|
|
354
271
|
|
|
355
|
-
|
|
356
|
-
- 실행 시점: 사용자 명시적 호출 또는 Alfred 위임
|
|
357
|
-
- 실행 방식: Claude Code Agent (Task tool)
|
|
358
|
-
- 실행 속도: 느림 (수 초 ~ 수 분)
|
|
359
|
-
- 사용자 상호작용: 질문/확인/보고서 제공
|
|
272
|
+
## Context Engineering Strategy
|
|
360
273
|
|
|
361
|
-
|
|
362
|
-
- ✅ **상세 분석**: SPEC 메타데이터 검증, EARS 구문 검증
|
|
363
|
-
- ✅ **품질 검증**: TRUST 5원칙 준수 확인, 테스트 커버리지 분석
|
|
364
|
-
- ✅ **TAG 관리**: TAG 체인 완전성 검증, 고아 TAG 탐지
|
|
365
|
-
- ✅ **디버깅**: 오류 원인 분석, 해결 방법 제시
|
|
366
|
-
- ✅ **보고서 생성**: 상세한 분석 결과 및 권장사항 제공
|
|
274
|
+
### 1. JIT (Just-in-Time) Retrieval
|
|
367
275
|
|
|
368
|
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
- 여러 도구(Read, Grep, Bash) 조합 사용
|
|
276
|
+
- Pull only the context required for the immediate step.
|
|
277
|
+
- Prefer `Explore` over manual file hunting.
|
|
278
|
+
- Cache critical insights in the task thread for reuse.
|
|
372
279
|
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
# ✅ 올바른 Agents 사용
|
|
376
|
-
@agent-trust-checker "현재 프로젝트의 TRUST 원칙 준수도 확인"
|
|
377
|
-
→ 테스트 커버리지 87%, 코드 제약 45/45 파일 준수, TAG 체인 2개 고아 발견
|
|
280
|
+
#### Efficient Use of Explore
|
|
378
281
|
|
|
379
|
-
|
|
380
|
-
|
|
282
|
+
- Request call graphs or dependency maps when changing core modules.
|
|
283
|
+
- Fetch examples from similar features before implementing new ones.
|
|
284
|
+
- Ask for SPEC references or TAG metadata to anchor changes.
|
|
381
285
|
|
|
382
|
-
|
|
383
|
-
→ project.py:142 라인에서 config가 None, .moai/config.json 누락 확인
|
|
384
|
-
```
|
|
286
|
+
### 2. Layered Context Summaries
|
|
385
287
|
|
|
386
|
-
|
|
288
|
+
1. **High-level brief**: purpose, stakeholders, success criteria.
|
|
289
|
+
2. **Technical core**: entry points, domain models, shared utilities.
|
|
290
|
+
3. **Edge cases**: known bugs, performance constraints, SLAs.
|
|
387
291
|
|
|
388
|
-
###
|
|
292
|
+
### 3. Living Documentation Sync
|
|
389
293
|
|
|
390
|
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
- 실행 속도: 중간 (수 초 ~ 수 분)
|
|
394
|
-
- 사용자 상호작용: 계획 승인 → 실행
|
|
294
|
+
- Align code, tests, and docs after each significant change.
|
|
295
|
+
- Use `/alfred:3-sync` to update Living Docs and TAG references.
|
|
296
|
+
- Record rationale for deviations from the SPEC.
|
|
395
297
|
|
|
396
|
-
|
|
397
|
-
- ✅ **워크플로우 관리**: 여러 단계를 순차/병렬 실행
|
|
398
|
-
- ✅ **Agent 조율**: 적절한 Agent를 호출하여 작업 위임
|
|
399
|
-
- ✅ **Git 통합**: 브랜치 생성, PR 생성, 커밋 자동화
|
|
400
|
-
- ✅ **문서 동기화**: SPEC ↔ CODE ↔ DOC 일관성 유지
|
|
298
|
+
## Commands · Sub-agents · Skills · Hooks
|
|
401
299
|
|
|
402
|
-
|
|
403
|
-
- 2단계 워크플로우 (Phase 1 계획 → Phase 2 실행)
|
|
404
|
-
- 복잡한 로직은 Agent로 위임
|
|
405
|
-
- Git 작업은 사용자 확인 필수
|
|
300
|
+
MoAI-ADK assigns every responsibility to a dedicated execution layer.
|
|
406
301
|
|
|
407
|
-
|
|
408
|
-
```bash
|
|
409
|
-
# ✅ 올바른 Commands 사용
|
|
410
|
-
/alfred:1-spec "사용자 인증 기능"
|
|
411
|
-
→ Phase 1: 프로젝트 분석, SPEC 후보 제안
|
|
412
|
-
→ 사용자 승인
|
|
413
|
-
→ Phase 2: SPEC 문서 작성, 브랜치 생성, Draft PR 생성
|
|
414
|
-
|
|
415
|
-
/alfred:2-build AUTH-001
|
|
416
|
-
→ Phase 1: SPEC 분석, TDD 계획 수립
|
|
417
|
-
→ 사용자 승인
|
|
418
|
-
→ Phase 2: RED → GREEN → REFACTOR 구현
|
|
419
|
-
|
|
420
|
-
/alfred:3-sync
|
|
421
|
-
→ Phase 1: 동기화 범위 분석
|
|
422
|
-
→ 사용자 승인
|
|
423
|
-
→ Phase 2: 문서 업데이트, TAG 검증, PR Ready 전환
|
|
424
|
-
```
|
|
302
|
+
### Commands — Workflow orchestration
|
|
425
303
|
|
|
426
|
-
|
|
304
|
+
- User-facing entry points that enforce the Plan → Run → Sync cadence.
|
|
305
|
+
- Examples: `/alfred:0-project`, `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync`.
|
|
306
|
+
- Coordinate multiple sub-agents, manage approvals, and track progress.
|
|
427
307
|
|
|
428
|
-
###
|
|
308
|
+
### Sub-agents — Deep reasoning & decision making
|
|
429
309
|
|
|
430
|
-
|
|
310
|
+
- Task-focused specialists (Sonnet/Haiku) that analyze, design, or validate.
|
|
311
|
+
- Examples: spec-builder, code-builder pipeline, doc-syncer, tag-agent, git-manager.
|
|
312
|
+
- Communicate status, escalate blockers, and request Skills when additional knowledge is required.
|
|
431
313
|
|
|
432
|
-
|
|
433
|
-
┌─────────────────────────────────────┐
|
|
434
|
-
│ 작업이 <100ms 안에 완료되는가? │
|
|
435
|
-
│ AND 차단/경고/알림만 필요한가? │
|
|
436
|
-
└─────────────────────────────────────┘
|
|
437
|
-
↓ YES ↓ NO
|
|
438
|
-
┌─────────┐ ┌──────────────┐
|
|
439
|
-
│ Hooks │ │ 사용자와 │
|
|
440
|
-
└─────────┘ │ 상호작용이 │
|
|
441
|
-
│ 필요한가? │
|
|
442
|
-
└──────────────┘
|
|
443
|
-
↓ YES ↓ NO
|
|
444
|
-
┌──────────┐ ┌────────────┐
|
|
445
|
-
│ Agents │ │ Commands │
|
|
446
|
-
└──────────┘ └────────────┘
|
|
447
|
-
```
|
|
314
|
+
### Skills — Reusable knowledge capsules (44 packs)
|
|
448
315
|
|
|
449
|
-
|
|
450
|
-
-
|
|
451
|
-
|
|
452
|
-
- Q: "rm -rf 명령 차단을 어디에 구현?"
|
|
453
|
-
- A: Hook (PreToolUse) - 빠른 차단, 간단한 로직
|
|
454
|
-
- Q: "TDD 워크플로우를 어디에 구현?"
|
|
455
|
-
- A: Command (`/alfred:2-build`) - 여러 단계 오케스트레이션
|
|
316
|
+
- <500-word playbooks stored under `.claude/skills/`.
|
|
317
|
+
- Loaded via Progressive Disclosure only when relevant.
|
|
318
|
+
- Provide standard templates, best practices, and checklists across Foundation, Essentials, Domain, Language, and Ops tiers.
|
|
456
319
|
|
|
457
|
-
|
|
320
|
+
### Hooks — Guardrails & just-in-time context
|
|
458
321
|
|
|
459
|
-
|
|
322
|
+
- Lightweight (<100 ms) checks triggered by session events.
|
|
323
|
+
- Block destructive commands, surface status cards, and seed context pointers.
|
|
324
|
+
- Examples: SessionStart project summary, PreToolUse safety checks.
|
|
460
325
|
|
|
461
|
-
|
|
462
|
-
- **TDD-First**: 테스트 없이는 구현 없음
|
|
463
|
-
- **GitFlow 지원**: Git 작업 자동화, Living Document 동기화, @TAG 추적성
|
|
464
|
-
- **다중 언어 지원**: Python, TypeScript, Java, Go, Rust, Ruby, Dart, Swift, Kotlin 등 20개 주요 언어
|
|
465
|
-
- **모바일 지원**: Flutter, React Native, iOS (Swift), Android (Kotlin)
|
|
466
|
-
- **CODE-FIRST @TAG**: 코드 직접 스캔 방식 (중간 캐시 없음)
|
|
326
|
+
### Selecting the right layer
|
|
467
327
|
|
|
468
|
-
|
|
328
|
+
1. Runs automatically on an event? → **Hook**.
|
|
329
|
+
2. Requires reasoning or conversation? → **Sub-agent**.
|
|
330
|
+
3. Encodes reusable knowledge or policy? → **Skill**.
|
|
331
|
+
4. Orchestrates multiple steps or approvals? → **Command**.
|
|
469
332
|
|
|
470
|
-
|
|
333
|
+
Combine layers when necessary: a command triggers sub-agents, sub-agents activate Skills, and Hooks keep the session safe.
|
|
471
334
|
|
|
472
|
-
|
|
335
|
+
## Core Philosophy
|
|
473
336
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
```
|
|
337
|
+
- **SPEC-first**: requirements drive implementation and tests.
|
|
338
|
+
- **Automation-first**: trust repeatable pipelines over manual checks.
|
|
339
|
+
- **Transparency**: every decision, assumption, and risk is documented.
|
|
340
|
+
- **Traceability**: @TAG links code, tests, docs, and history.
|
|
479
341
|
|
|
480
|
-
|
|
481
|
-
- **Ubiquitous**: 시스템은 [기능]을 제공해야 한다
|
|
482
|
-
- **Event-driven**: WHEN [조건]이면, 시스템은 [동작]해야 한다
|
|
483
|
-
- **State-driven**: WHILE [상태]일 때, 시스템은 [동작]해야 한다
|
|
484
|
-
- **Optional**: WHERE [조건]이면, 시스템은 [동작]할 수 있다
|
|
485
|
-
- **Constraints**: IF [조건]이면, 시스템은 [제약]해야 한다
|
|
342
|
+
## Three-phase Development Workflow
|
|
486
343
|
|
|
487
|
-
|
|
344
|
+
> Phase 0 (`/alfred:0-project`) bootstraps project metadata and resources before the cycle begins.
|
|
488
345
|
|
|
489
|
-
|
|
346
|
+
1. **SPEC**: Define requirements with `/alfred:1-plan`.
|
|
347
|
+
2. **BUILD**: Implement via `/alfred:2-run` (TDD loop).
|
|
348
|
+
3. **SYNC**: Align docs/tests using `/alfred:3-sync`.
|
|
490
349
|
|
|
491
|
-
|
|
492
|
-
```bash
|
|
493
|
-
# 1단계: SPEC 작성 (develop에서 분기)
|
|
494
|
-
/alfred:1-spec "새 기능"
|
|
495
|
-
→ feature/SPEC-{ID} 브랜치 생성
|
|
496
|
-
→ Draft PR 생성 (feature → develop)
|
|
497
|
-
|
|
498
|
-
# 2단계: TDD 구현
|
|
499
|
-
/alfred:2-build SPEC-{ID}
|
|
500
|
-
→ RED → GREEN → REFACTOR 커밋
|
|
501
|
-
|
|
502
|
-
# 3단계: 문서 동기화 + 자동 머지
|
|
503
|
-
/alfred:3-sync --auto-merge
|
|
504
|
-
→ 문서 동기화
|
|
505
|
-
→ PR Ready 전환
|
|
506
|
-
→ CI/CD 확인
|
|
507
|
-
→ PR 자동 머지 (squash)
|
|
508
|
-
→ develop 체크아웃
|
|
509
|
-
→ 다음 작업 준비 완료 ✅
|
|
510
|
-
```
|
|
350
|
+
### Fully Automated GitFlow
|
|
511
351
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
/alfred:3-sync # 문서 동기화 + 로컬 머지
|
|
517
|
-
```
|
|
352
|
+
1. Create feature branch via command.
|
|
353
|
+
2. Follow RED → GREEN → REFACTOR commits.
|
|
354
|
+
3. Run automated QA gates.
|
|
355
|
+
4. Merge with traceable @TAG references.
|
|
518
356
|
|
|
519
|
-
|
|
357
|
+
## On-demand Agent Usage
|
|
520
358
|
|
|
521
|
-
|
|
359
|
+
### Debugging & Analysis
|
|
522
360
|
|
|
523
|
-
|
|
361
|
+
- Use `debug-helper` for error triage and hypothesis testing.
|
|
362
|
+
- Attach logs, stack traces, and reproduction steps.
|
|
363
|
+
- Ask for fix-forward vs rollback recommendations.
|
|
524
364
|
|
|
525
|
-
###
|
|
526
|
-
```bash
|
|
527
|
-
@agent-debug-helper "TypeError: 'NoneType' object has no attribute 'name'"
|
|
528
|
-
@agent-debug-helper "TAG 체인 검증을 수행해주세요"
|
|
529
|
-
@agent-debug-helper "TRUST 원칙 준수 여부 확인"
|
|
530
|
-
```
|
|
365
|
+
### TAG System Management
|
|
531
366
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
@agent-tag-agent "고아 TAG 및 끊어진 링크 감지"
|
|
536
|
-
```
|
|
367
|
+
- Assign IDs as `<DOMAIN>-<###>` (e.g., `AUTH-003`).
|
|
368
|
+
- Update HISTORY with every change.
|
|
369
|
+
- Cross-check usage with `rg '@TAG:ID' -n` searches.
|
|
537
370
|
|
|
538
|
-
###
|
|
539
|
-
```bash
|
|
540
|
-
# 수동 checkpoint 생성
|
|
541
|
-
/alfred:9-checkpoint create --name "refactor-start"
|
|
542
|
-
|
|
543
|
-
# Checkpoint 목록 조회
|
|
544
|
-
/alfred:9-checkpoint list
|
|
545
|
-
|
|
546
|
-
# Checkpoint 복구
|
|
547
|
-
/alfred:9-checkpoint restore <ID>
|
|
371
|
+
### Backup Management
|
|
548
372
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
**자동 checkpoint**: 위험한 작업 전 자동 생성 (삭제, 병합, 스크립트 실행 등)
|
|
373
|
+
- `/alfred:0-project` and `git-manager` create automatic safety snapshots (e.g., `.moai-backups/`) before risky actions.
|
|
374
|
+
- Manual `/alfred:9-checkpoint` commands have been deprecated; rely on Git branches or team-approved backup workflows when additional restore points are needed.
|
|
554
375
|
|
|
555
|
-
|
|
376
|
+
## @TAG Lifecycle
|
|
556
377
|
|
|
557
|
-
|
|
378
|
+
### Core Principles
|
|
558
379
|
|
|
559
|
-
|
|
380
|
+
- TAG IDs never change once assigned.
|
|
381
|
+
- Content can evolve; log updates in HISTORY.
|
|
382
|
+
- Tie implementations and tests to the same TAG.
|
|
560
383
|
|
|
561
|
-
###
|
|
384
|
+
### TAG Structure
|
|
562
385
|
|
|
563
|
-
-
|
|
564
|
-
-
|
|
565
|
-
-
|
|
386
|
+
- `@SPEC:ID` in specs
|
|
387
|
+
- `@CODE:ID` in source
|
|
388
|
+
- `@TEST:ID` in tests
|
|
389
|
+
- `@DOC:ID` in docs
|
|
566
390
|
|
|
567
|
-
### TAG
|
|
391
|
+
### TAG Block Template
|
|
568
392
|
|
|
569
393
|
```
|
|
570
|
-
@
|
|
394
|
+
// @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/auth/service.test.ts
|
|
571
395
|
```
|
|
572
396
|
|
|
573
|
-
| TAG | 역할 | TDD 단계 | 위치 | 필수 |
|
|
574
|
-
| ---------- | -------------------- | ---------------- | ------------ | ---- |
|
|
575
|
-
| `@SPEC:ID` | 요구사항 명세 (EARS) | 사전 준비 | .moai/specs/ | ✅ |
|
|
576
|
-
| `@TEST:ID` | 테스트 케이스 | RED | tests/ | ✅ |
|
|
577
|
-
| `@CODE:ID` | 구현 코드 | GREEN + REFACTOR | src/ | ✅ |
|
|
578
|
-
| `@DOC:ID` | 문서화 | REFACTOR | docs/ | ⚠️ |
|
|
579
|
-
|
|
580
|
-
### TAG BLOCK 템플릿
|
|
581
|
-
|
|
582
|
-
> **📋 SPEC 메타데이터 표준 (SSOT)**: @.moai/memory/spec-metadata.md
|
|
583
|
-
|
|
584
|
-
**모든 SPEC 문서는 다음 구조를 따릅니다**:
|
|
585
|
-
- **필수 필드 7개**: id, version, status, created, updated, author, priority
|
|
586
|
-
- **선택 필드 9개**: category, labels, depends_on, blocks, related_specs, related_issue, scope
|
|
587
|
-
- **HISTORY 섹션**: 필수 (모든 버전 변경 이력 기록)
|
|
588
|
-
|
|
589
|
-
**전체 템플릿 및 필드 상세 설명**: `.moai/memory/spec-metadata.md` 참조
|
|
590
|
-
|
|
591
|
-
**간단한 예시**:
|
|
592
|
-
```yaml
|
|
593
|
-
---
|
|
594
|
-
id: AUTH-001
|
|
595
|
-
version: 0.0.1
|
|
596
|
-
status: draft
|
|
597
|
-
created: 2025-09-15
|
|
598
|
-
updated: 2025-09-15
|
|
599
|
-
author: @{{AUTHOR}}
|
|
600
|
-
priority: high
|
|
601
|
-
---
|
|
602
|
-
|
|
603
|
-
# @SPEC:AUTH-001: JWT 인증 시스템
|
|
604
|
-
|
|
605
397
|
## HISTORY
|
|
606
|
-
### v0.0.1 (2025-09-15)
|
|
607
|
-
- **INITIAL**: JWT 기반 인증 시스템 명세 작성
|
|
608
|
-
...
|
|
609
|
-
```
|
|
610
398
|
|
|
611
|
-
|
|
612
|
-
```typescript
|
|
613
|
-
// @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/auth/service.test.ts
|
|
614
|
-
```
|
|
399
|
+
### v0.0.1 (2025-09-15)
|
|
615
400
|
|
|
616
|
-
|
|
617
|
-
```typescript
|
|
618
|
-
// @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
619
|
-
```
|
|
401
|
+
- **INITIAL**: Draft the JWT-based authentication SPEC.
|
|
620
402
|
|
|
621
|
-
### TAG
|
|
403
|
+
### TAG Core Rules
|
|
622
404
|
|
|
623
|
-
- **TAG ID**:
|
|
624
|
-
- **TAG
|
|
625
|
-
-
|
|
626
|
-
-
|
|
627
|
-
- **TAG
|
|
628
|
-
-
|
|
629
|
-
- **
|
|
405
|
+
- **TAG ID**: `<Domain>-<3 digits>` (e.g., `AUTH-003`) — immutable.
|
|
406
|
+
- **TAG Content**: Flexible but record changes in HISTORY.
|
|
407
|
+
- **Versioning**: Semantic Versioning (`v0.0.1 → v0.1.0 → v1.0.0`).
|
|
408
|
+
- Detailed rules: see `@.moai/memory/spec-metadata.md#versioning`.
|
|
409
|
+
- **TAG References**: Use file names without versions (e.g., `SPEC-AUTH-001.md`).
|
|
410
|
+
- **Duplicate Check**: `rg "@SPEC:AUTH" -n` or `rg "AUTH-001" -n`.
|
|
411
|
+
- **Code-first**: The source of truth lives in code.
|
|
630
412
|
|
|
631
|
-
### @CODE
|
|
413
|
+
### @CODE Subcategories (Comment Level)
|
|
632
414
|
|
|
633
|
-
|
|
634
|
-
- `@CODE:ID:
|
|
635
|
-
- `@CODE:ID:
|
|
636
|
-
- `@CODE:ID:
|
|
637
|
-
- `@CODE:ID:
|
|
638
|
-
- `@CODE:ID:INFRA` - 인프라, 데이터베이스, 외부 연동
|
|
415
|
+
- `@CODE:ID:API` — REST/GraphQL endpoints
|
|
416
|
+
- `@CODE:ID:UI` — Components and UI
|
|
417
|
+
- `@CODE:ID:DATA` — Data models, schemas, types
|
|
418
|
+
- `@CODE:ID:DOMAIN` — Business logic
|
|
419
|
+
- `@CODE:ID:INFRA` — Infra, databases, integrations
|
|
639
420
|
|
|
640
|
-
### TAG
|
|
421
|
+
### TAG Validation & Integrity
|
|
641
422
|
|
|
642
|
-
|
|
423
|
+
**Avoid duplicates**:
|
|
643
424
|
```bash
|
|
644
|
-
rg "@SPEC:AUTH" -n #
|
|
645
|
-
rg "@CODE:AUTH-001" -n #
|
|
646
|
-
rg "AUTH-001" -n # ID
|
|
425
|
+
rg "@SPEC:AUTH" -n # Search AUTH specs
|
|
426
|
+
rg "@CODE:AUTH-001" -n # Targeted ID search
|
|
427
|
+
rg "AUTH-001" -n # Global ID search
|
|
647
428
|
```
|
|
648
429
|
|
|
649
|
-
**TAG
|
|
430
|
+
**TAG chain verification** (`/alfred:3-sync` runs automatically):
|
|
650
431
|
```bash
|
|
651
432
|
rg '@(SPEC|TEST|CODE|DOC):' -n .moai/specs/ tests/ src/ docs/
|
|
652
433
|
|
|
653
|
-
#
|
|
654
|
-
rg '@CODE:AUTH-001' -n src/ # CODE
|
|
655
|
-
rg '@SPEC:AUTH-001' -n .moai/specs/ # SPEC
|
|
434
|
+
# Detect orphaned TAGs
|
|
435
|
+
rg '@CODE:AUTH-001' -n src/ # CODE exists
|
|
436
|
+
rg '@SPEC:AUTH-001' -n .moai/specs/ # SPEC missing → orphan
|
|
656
437
|
```
|
|
657
438
|
|
|
658
439
|
---
|
|
659
440
|
|
|
660
|
-
## TRUST 5
|
|
441
|
+
## TRUST 5 Principles (Language-agnostic)
|
|
661
442
|
|
|
662
|
-
>
|
|
443
|
+
> Detailed guide: `@.moai/memory/development-guide.md#trust-5-principles`
|
|
663
444
|
|
|
664
|
-
Alfred
|
|
445
|
+
Alfred enforces these quality gates on every change:
|
|
665
446
|
|
|
666
|
-
- **T**est First:
|
|
667
|
-
- **R**eadable:
|
|
668
|
-
- **U**nified:
|
|
669
|
-
- **S**ecured:
|
|
670
|
-
- **T**rackable:
|
|
447
|
+
- **T**est First: Use the best testing tool per language (Jest/Vitest, pytest, go test, cargo test, JUnit, flutter test, ...).
|
|
448
|
+
- **R**eadable: Run linters (ESLint/Biome, ruff, golint, clippy, dart analyze, ...).
|
|
449
|
+
- **U**nified: Ensure type safety or runtime validation.
|
|
450
|
+
- **S**ecured: Apply security/static analysis tools.
|
|
451
|
+
- **T**rackable: Maintain @TAG coverage directly in code.
|
|
671
452
|
|
|
672
|
-
|
|
453
|
+
**Language-specific guidance**: `.moai/memory/development-guide.md#trust-5-principles`.
|
|
673
454
|
|
|
674
455
|
---
|
|
675
456
|
|
|
676
|
-
##
|
|
457
|
+
## Language-specific Code Rules
|
|
677
458
|
|
|
678
|
-
|
|
679
|
-
-
|
|
680
|
-
-
|
|
681
|
-
-
|
|
682
|
-
-
|
|
459
|
+
**Global constraints**:
|
|
460
|
+
- Files ≤ 300 LOC
|
|
461
|
+
- Functions ≤ 50 LOC
|
|
462
|
+
- Parameters ≤ 5
|
|
463
|
+
- Cyclomatic complexity ≤ 10
|
|
683
464
|
|
|
684
|
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
687
|
-
-
|
|
688
|
-
-
|
|
465
|
+
**Quality targets**:
|
|
466
|
+
- Test coverage ≥ 85%
|
|
467
|
+
- Intent-revealing names
|
|
468
|
+
- Early guard clauses
|
|
469
|
+
- Use language-standard tooling
|
|
689
470
|
|
|
690
|
-
|
|
691
|
-
-
|
|
692
|
-
-
|
|
693
|
-
-
|
|
471
|
+
**Testing strategy**:
|
|
472
|
+
- Prefer the standard framework per language
|
|
473
|
+
- Keep tests isolated and deterministic
|
|
474
|
+
- Derive cases directly from the SPEC
|
|
694
475
|
|
|
695
476
|
---
|
|
696
477
|
|
|
697
|
-
## TDD
|
|
478
|
+
## TDD Workflow Checklist
|
|
698
479
|
|
|
699
|
-
**1
|
|
700
|
-
- [ ] `.moai/specs/SPEC-<ID>/spec.md`
|
|
701
|
-
- [ ] YAML
|
|
702
|
-
- [ ] `@SPEC:ID` TAG
|
|
703
|
-
- [ ] **HISTORY
|
|
704
|
-
- [ ] EARS
|
|
705
|
-
- [ ]
|
|
480
|
+
**Step 1: SPEC authoring** (`/alfred:1-plan`)
|
|
481
|
+
- [ ] Create `.moai/specs/SPEC-<ID>/spec.md` (with directory structure)
|
|
482
|
+
- [ ] Add YAML front matter (id, version: 0.0.1, status: draft, created)
|
|
483
|
+
- [ ] Include the `@SPEC:ID` TAG
|
|
484
|
+
- [ ] Write the **HISTORY** section (v0.0.1 INITIAL)
|
|
485
|
+
- [ ] Use EARS syntax for requirements
|
|
486
|
+
- [ ] Check for duplicate IDs: `rg "@SPEC:<ID>" -n`
|
|
706
487
|
|
|
707
|
-
**2
|
|
708
|
-
- [ ] **RED**:
|
|
709
|
-
- [ ] **GREEN**:
|
|
710
|
-
- [ ] **REFACTOR**:
|
|
711
|
-
- [ ]
|
|
488
|
+
**Step 2: TDD implementation** (`/alfred:2-run`)
|
|
489
|
+
- [ ] **RED**: Write `@TEST:ID` under `tests/` and watch it fail
|
|
490
|
+
- [ ] **GREEN**: Add `@CODE:ID` under `src/` and make the test pass
|
|
491
|
+
- [ ] **REFACTOR**: Improve code quality; document TDD history in comments
|
|
492
|
+
- [ ] List SPEC/TEST file paths in the TAG block
|
|
712
493
|
|
|
713
|
-
**3
|
|
714
|
-
- [ ]
|
|
715
|
-
- [ ]
|
|
716
|
-
- [ ] Living Document
|
|
717
|
-
- [ ] PR
|
|
494
|
+
**Step 3: Documentation sync** (`/alfred:3-sync`)
|
|
495
|
+
- [ ] Scan TAGs: `rg '@(SPEC|TEST|CODE):' -n`
|
|
496
|
+
- [ ] Ensure no orphan TAGs remain
|
|
497
|
+
- [ ] Regenerate the Living Document
|
|
498
|
+
- [ ] Move PR status from Draft → Ready
|
|
718
499
|
|
|
719
500
|
---
|
|
720
501
|
|
|
721
|
-
##
|
|
502
|
+
## Project Information
|
|
722
503
|
|
|
723
|
-
-
|
|
724
|
-
-
|
|
725
|
-
-
|
|
726
|
-
-
|
|
727
|
-
-
|
|
504
|
+
- **Name**: {{PROJECT_NAME}}
|
|
505
|
+
- **Description**: {{PROJECT_DESCRIPTION}}
|
|
506
|
+
- **Version**: {{PROJECT_VERSION}}
|
|
507
|
+
- **Mode**: {{PROJECT_MODE}}
|
|
508
|
+
- **Toolchain**: Automatically selects the best tools for the chosen language
|