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

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

Potentially problematic release.


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

Files changed (141) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +1 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/doctor.py +2 -2
  5. moai_adk/cli/commands/init.py +10 -5
  6. moai_adk/cli/commands/status.py +1 -1
  7. moai_adk/cli/commands/update.py +210 -8
  8. moai_adk/cli/prompts/init_prompts.py +15 -19
  9. moai_adk/core/__init__.py +1 -1
  10. moai_adk/core/diagnostics/slash_commands.py +1 -1
  11. moai_adk/core/git/branch.py +1 -1
  12. moai_adk/core/git/manager.py +1 -1
  13. moai_adk/core/project/backup_utils.py +1 -0
  14. moai_adk/core/project/phase_executor.py +3 -1
  15. moai_adk/core/project/validator.py +3 -2
  16. moai_adk/core/quality/__init__.py +1 -1
  17. moai_adk/core/quality/trust_checker.py +1 -1
  18. moai_adk/core/quality/validators/__init__.py +1 -1
  19. moai_adk/core/quality/validators/base_validator.py +1 -1
  20. moai_adk/core/template/__init__.py +1 -1
  21. moai_adk/core/template/backup.py +12 -3
  22. moai_adk/core/template/config.py +24 -0
  23. moai_adk/core/template/languages.py +1 -1
  24. moai_adk/core/template/merger.py +74 -4
  25. moai_adk/core/template/processor.py +62 -14
  26. moai_adk/templates/.claude/agents/alfred/cc-manager.md +765 -191
  27. moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
  28. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
  29. moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
  30. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
  31. moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
  32. moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
  33. moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
  34. moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
  35. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
  36. moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
  37. moai_adk/templates/.claude/commands/alfred/0-project.md +856 -355
  38. moai_adk/templates/.claude/commands/alfred/1-plan.md +572 -0
  39. moai_adk/templates/.claude/commands/alfred/2-run.md +470 -0
  40. moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
  41. moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
  42. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
  43. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
  44. moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
  45. moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
  46. moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
  47. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
  48. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
  49. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +30 -51
  50. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
  51. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
  52. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
  53. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
  54. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
  55. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
  67. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +94 -0
  68. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
  69. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +433 -0
  70. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
  71. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
  72. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +363 -0
  73. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +595 -0
  74. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +496 -0
  75. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +99 -0
  76. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +95 -0
  77. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +98 -0
  78. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +100 -0
  79. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +100 -0
  80. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +99 -0
  81. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +99 -0
  82. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +93 -0
  83. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +105 -0
  84. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -0
  85. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +102 -0
  86. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +104 -0
  87. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +96 -0
  88. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +112 -0
  89. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +98 -0
  90. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +90 -0
  91. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +94 -0
  92. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +93 -0
  93. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +86 -0
  94. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +86 -0
  95. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +100 -0
  96. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +100 -0
  97. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +102 -0
  98. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +100 -0
  99. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +98 -0
  100. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +99 -0
  101. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +100 -0
  102. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +100 -0
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +98 -0
  104. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +96 -0
  105. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +98 -0
  106. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +99 -0
  107. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +98 -0
  108. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +98 -0
  109. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +96 -0
  110. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +99 -0
  111. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +99 -0
  112. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +100 -0
  113. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +100 -0
  114. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +100 -0
  115. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +100 -0
  116. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +99 -0
  117. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +96 -0
  118. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
  120. moai_adk/templates/.moai/config.json +9 -6
  121. moai_adk/templates/.moai/memory/development-guide.md +220 -221
  122. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
  123. moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
  124. moai_adk/templates/.moai/project/product.md +90 -90
  125. moai_adk/templates/.moai/project/structure.md +85 -85
  126. moai_adk/templates/.moai/project/tech.md +117 -117
  127. moai_adk/templates/CLAUDE.md +354 -573
  128. moai_adk/templates/__init__.py +1 -1
  129. moai_adk/utils/__init__.py +1 -1
  130. moai_adk/utils/banner.py +7 -7
  131. moai_adk/utils/logger.py +1 -1
  132. moai_adk-0.4.1.dist-info/METADATA +303 -0
  133. moai_adk-0.4.1.dist-info/RECORD +152 -0
  134. moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -532
  135. moai_adk/templates/.claude/commands/alfred/2-build.md +0 -432
  136. moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
  137. moai_adk-0.3.13.dist-info/METADATA +0 -1586
  138. moai_adk-0.3.13.dist-info/RECORD +0 -90
  139. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
  140. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
  141. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,432 +0,0 @@
1
- ---
2
- name: alfred:2-build
3
- description: "구현할 SPEC ID (예: SPEC-001) 또는 all로 모든 SPEC 구현 - 언어별 최적화된 TDD 구현 (Red-Green-Refactor) with SQLite3 tags.db"
4
- argument-hint: "SPEC-ID - 구현할 SPEC ID (예: SPEC-001) 또는 all로 모든 SPEC 구현"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - MultiEdit
10
- - Bash(python3:*)
11
- - Bash(pytest:*)
12
- - Bash(npm:*)
13
- - Bash(node:*)
14
- - Bash(git:*)
15
- - Task
16
- - WebFetch
17
- - Grep
18
- - Glob
19
- - TodoWrite
20
- ---
21
-
22
- # ⚒️ MoAI-ADK 2단계: 언어별 최적화된 TDD 구현 (Red-Green-Refactor)
23
-
24
- ## 🎯 커맨드 목적
25
-
26
- SPEC 문서를 분석하여 언어별 최적화된 TDD 사이클(Red-Green-Refactor)로 고품질 코드를 구현합니다.
27
-
28
- **TDD 구현 대상**: $ARGUMENTS
29
-
30
- > **표준 2단계 워크플로우** (자세한 내용: `CLAUDE.md` - "Alfred 커맨드 실행 패턴" 참조)
31
-
32
- ## 📋 실행 흐름
33
-
34
- 1. **SPEC 분석**: 요구사항 추출 및 복잡도 평가
35
- 2. **구현 전략 수립**: 언어별 최적화된 TDD 접근법 결정
36
- 3. **사용자 확인**: 구현 계획 검토 및 승인
37
- 4. **TDD 구현**: RED → GREEN → REFACTOR 사이클 실행
38
- 5. **Git 작업**: git-manager를 통한 단계별 커밋 생성
39
-
40
- ## 🔗 연관 에이전트
41
-
42
- - **Phase 1**: implementation-planner (📋 테크니컬 아키텍트) - SPEC 분석 및 구현 전략 수립
43
- - **Phase 2**: tdd-implementer (🔬 시니어 개발자) - TDD 구현 전담
44
- - **Phase 2.5**: quality-gate (🛡️ 품질 보증 엔지니어) - TRUST 원칙 검증 (자동)
45
- - **Phase 3**: git-manager (🚀 릴리스 엔지니어) - Git 커밋 전담
46
-
47
- ## 💡 사용 예시
48
-
49
- 사용자가 다음과 같이 커맨드를 실행할 수 있습니다:
50
- - `/alfred:2-build SPEC-001` - 특정 SPEC 구현
51
- - `/alfred:2-build all` - 모든 SPEC 일괄 구현
52
- - `/alfred:2-build SPEC-003 --test` - 테스트만 실행
53
-
54
- ## 🔍 STEP 1: SPEC 분석 및 구현 계획 수립
55
-
56
- 먼저 지정된 SPEC을 분석하여 구현 계획을 수립하고 사용자 확인을 받습니다.
57
-
58
- **implementation-planner 에이전트가 자동으로 필요한 문서를 로드하여 분석합니다.**
59
-
60
- ### 🔍 코드베이스 탐색 (권장)
61
-
62
- **기존 코드 구조를 파악하거나 유사 패턴을 찾아야 하는 경우** Explore 에이전트를 먼저 활용합니다:
63
-
64
- ```
65
- Task tool 호출 (Explore 에이전트):
66
- - subagent_type: "Explore"
67
- - description: "기존 코드 구조 및 패턴 탐색"
68
- - prompt: "SPEC-$ARGUMENTS와 관련된 기존 코드를 탐색해주세요:
69
- - 유사한 기능 구현 코드 (src/)
70
- - 참고할 테스트 패턴 (tests/)
71
- - 아키텍처 패턴 및 디자인 패턴
72
- - 사용 중인 라이브러리 및 버전 (package.json, requirements.txt)
73
- thoroughness 레벨: medium"
74
- ```
75
-
76
- **Explore 에이전트 사용 시점**:
77
- - ✅ 기존 코드 구조/패턴 파악이 필요한 경우
78
- - ✅ 유사 기능의 구현 방식을 참고해야 할 때
79
- - ✅ 프로젝트의 아키텍처 규칙을 이해해야 할 때
80
- - ✅ 사용 중인 라이브러리 및 버전 확인
81
-
82
- ### ⚙️ 에이전트 호출 방법
83
-
84
- **STEP 1에서는 Task tool을 사용하여 implementation-planner 에이전트를 호출합니다**:
85
-
86
- ```
87
- Task tool 호출 예시:
88
- - subagent_type: "implementation-planner"
89
- - description: "SPEC 분석 및 구현 전략 수립"
90
- - prompt: "$ARGUMENTS 의 SPEC을 분석하여 구현 계획을 수립해주세요.
91
- 다음을 포함해야 합니다:
92
- 1. SPEC 요구사항 추출 및 복잡도 평가
93
- 2. 라이브러리 및 도구 선정 (WebFetch 사용)
94
- 3. TAG 체인 설계
95
- 4. 단계별 구현 계획
96
- 5. 리스크 및 대응 방안
97
- 6. 구현 계획서 작성 및 사용자 승인 대기
98
- (선택) Explore 결과: $EXPLORE_RESULTS"
99
- ```
100
-
101
- ### SPEC 분석 진행
102
-
103
- 1. **SPEC 문서 분석**
104
- - 요구사항 추출 및 복잡도 평가
105
- - 기술적 제약사항 확인
106
- - 의존성 및 영향 범위 분석
107
- - (선택) Explore 결과 기반 기존 코드 구조 파악
108
-
109
- 2. **구현 전략 수립**
110
- - 프로젝트 언어 감지 및 최적화된 구현 전략
111
- - TDD 접근 방식 결정 (언어별 도구 선택)
112
- - 예상 작업 범위 및 시간 산정
113
-
114
- 3. **라이브러리 버전 확인 및 명시 (필수)**
115
- - **웹 검색**: `WebSearch`를 통해 사용할 모든 라이브러리의 최신 안정 버전 확인
116
- - **버전 명시**: 구현 계획 보고서에 라이브러리별 정확한 버전 명시 (예: `fastapi>=0.118.3`)
117
- - **안정성 우선**: 베타/알파 버전 제외, 프로덕션 안정 버전만 선택
118
- - **호환성 확인**: 라이브러리 간 버전 호환성 검증
119
- - **검색 키워드 예시**:
120
- - `"FastAPI latest stable version 2025"`
121
- - `"SQLAlchemy 2.0 latest stable version 2025"`
122
- - `"React 18 latest stable version 2025"`
123
-
124
- 4. **구현 계획 보고**
125
- - 단계별 구현 계획 제시
126
- - 잠재적 위험 요소 식별
127
- - 품질 게이트 체크포인트 설정
128
- - **라이브러리 버전 명시 (필수)**
129
-
130
- ### 사용자 확인 단계
131
-
132
- 구현 계획 검토 후 다음 중 선택하세요:
133
- - **"진행"** 또는 **"시작"**: 계획대로 TDD 구현 시작
134
- - **"수정 [내용]"**: 계획 수정 요청
135
- - **"중단"**: 구현 작업 중단
136
-
137
- ---
138
-
139
- ## 🚀 STEP 2: TDD 구현 실행 (사용자 승인 후)
140
-
141
- 사용자 승인 후 **Task tool을 사용하여 tdd-implementer 에이전트를 호출**합니다.
142
-
143
- ### ⚙️ 에이전트 호출 방법
144
-
145
- **STEP 2에서는 Task tool을 사용하여 tdd-implementer를 호출합니다**:
146
-
147
- ```
148
- Task tool 호출 예시:
149
- - subagent_type: "tdd-implementer"
150
- - description: "TDD 구현 실행"
151
- - prompt: "STEP 1에서 승인된 계획에 따라 TDD 구현을 실행해주세요.
152
- RED → GREEN → REFACTOR 사이클을 수행하며,
153
- 각 TAG별로 다음을 수행합니다:
154
- 1. RED Phase: @TEST:ID 태그로 실패하는 테스트 작성
155
- 2. GREEN Phase: @CODE:ID 태그로 최소 구현
156
- 3. REFACTOR Phase: 코드 품질 개선
157
- 4. TAG 완료 조건 검증 및 다음 TAG로 진행
158
-
159
- 구현 대상: $ARGUMENTS"
160
- ```
161
-
162
- ## 🔗 언어별 TDD 최적화
163
-
164
- ### 프로젝트 언어 감지 및 최적 라우팅
165
-
166
- `tdd-implementer`는 프로젝트의 언어를 자동으로 감지하여 최적의 TDD 도구와 워크플로우를 선택합니다:
167
-
168
- - **언어 감지**: 프로젝트 파일(package.json, pyproject.toml, go.mod 등) 분석
169
- - **도구 선택**: 언어별 최적 테스트 프레임워크 자동 선택
170
- - **TAG 적용**: 코드 파일에 @TAG 주석 직접 작성
171
- - **사이클 실행**: RED → GREEN → REFACTOR 순차 진행
172
-
173
- ### TDD 도구 매핑
174
-
175
- #### 백엔드/시스템
176
-
177
- | SPEC 타입 | 구현 언어 | 테스트 프레임워크 | 성능 목표 | 커버리지 목표 |
178
- |-----------|-----------|-------------------|-----------|---------------|
179
- | **CLI/시스템** | TypeScript | Jest + ts-node | < 18ms | 95%+ |
180
- | **API/백엔드** | TypeScript | Jest + SuperTest | < 50ms | 90%+ |
181
- | **프론트엔드** | TypeScript | Jest + Testing Library | < 100ms | 85%+ |
182
- | **데이터 처리** | TypeScript | Jest + Mock | < 200ms | 85%+ |
183
- | **Python 프로젝트** | Python | pytest + mypy | 사용자 정의 | 85%+ |
184
-
185
- #### 모바일 프레임워크
186
-
187
- | SPEC 타입 | 구현 언어 | 테스트 프레임워크 | 성능 목표 | 커버리지 목표 |
188
- |-----------|-----------|-------------------|-----------|---------------|
189
- | **Flutter 앱** | Dart | flutter test + widget test | < 100ms | 85%+ |
190
- | **React Native** | TypeScript | Jest + RN Testing Library | < 100ms | 85%+ |
191
- | **iOS 앱** | Swift | XCTest + XCUITest | < 150ms | 80%+ |
192
- | **Android 앱** | Kotlin | JUnit + Espresso | < 150ms | 80%+ |
193
-
194
- ## 🚀 최적화된 에이전트 협업 구조
195
-
196
- - **Phase 1**: `implementation-planner` 에이전트가 SPEC 분석 및 구현 전략 수립
197
- - **Phase 2**: `tdd-implementer` 에이전트가 전체 TDD 사이클(Red-Green-Refactor)을 일괄 처리
198
- - **Phase 2.5**: `quality-gate` 에이전트가 TRUST 원칙 검증 및 품질 검증 (자동)
199
- - **Phase 3**: `git-manager` 에이전트가 TDD 완료 후 모든 커밋을 한 번에 처리
200
- - **단일 책임 원칙**: 각 에이전트는 자신의 전문 영역만 담당
201
- - **에이전트 간 호출 금지**: 각 에이전트는 독립적으로 실행, 커맨드 레벨에서만 순차 호출
202
-
203
- ## 🔄 2단계 워크플로우 실행 순서
204
-
205
- ### Phase 1: 분석 및 계획 단계
206
-
207
- `implementation-planner` 에이전트가 다음을 수행:
208
-
209
- 1. **SPEC 문서 분석**: 지정된 SPEC ID의 요구사항 추출 및 복잡도 평가
210
- 2. **라이브러리 선정**: WebFetch를 통한 최신 안정 버전 확인 및 호환성 검증
211
- 3. **TAG 체인 설계**: TAG 순서 및 의존성 결정
212
- 4. **구현 전략 수립**: 단계별 구현 계획 및 리스크 식별
213
- 5. **구현 계획서 작성**: 구조화된 계획서 생성 및 사용자 승인 대기
214
-
215
- ### Phase 2: TDD 구현 단계 (승인 후)
216
-
217
- `tdd-implementer` 에이전트가 사용자 승인 후 **TAG 단위로** 수행:
218
-
219
- 1. **RED Phase**: 실패하는 테스트 작성 (@TEST:ID 태그 추가) 및 실패 확인
220
- 2. **GREEN Phase**: 테스트를 통과하는 최소한의 코드 작성 (@CODE:ID 태그 추가)
221
- 3. **REFACTOR Phase**: 코드 품질 개선 (기능 변경 없이)
222
- 4. **TAG 완료 확인**: 각 TAG의 완료 조건 검증 및 다음 TAG로 진행
223
-
224
- ### Phase 2.5: 품질 검증 게이트 (자동 실행)
225
-
226
- TDD 구현 완료 후 `quality-gate` 에이전트가 **자동으로** 품질 검증을 수행합니다.
227
-
228
- **자동 실행 조건**:
229
- - TDD 구현 완료 시 자동 호출
230
- - 사용자 요청 시 수동 호출 가능
231
-
232
- **검증 항목**:
233
- - **TRUST 원칙 검증**: trust-checker 스크립트 실행 및 결과 파싱
234
- - T (Testable): 테스트 커버리지 ≥ 85%
235
- - R (Readable): 코드 가독성 (파일≤300 LOC, 함수≤50 LOC, 복잡도≤10)
236
- - U (Unified): 아키텍처 통합성
237
- - S (Secured): 보안 취약점 없음
238
- - T (Traceable): @TAG 체인 무결성
239
- - **코드 스타일**: 린터(ESLint/Pylint) 실행 및 검증
240
- - **테스트 커버리지**: 언어별 커버리지 도구 실행 및 목표 달성 확인
241
- - **TAG 체인 검증**: 고아 TAG, 누락된 TAG 확인
242
- - **의존성 검증**: 보안 취약점 확인
243
-
244
- **실행 방식**: Alfred가 TDD 구현 완료 시 자동으로 quality-gate 에이전트를 호출하여 품질 검증을 수행합니다.
245
-
246
- **검증 결과 처리**:
247
-
248
- ✅ **PASS (Critical 0개, Warning 5개 이하)**:
249
- - Phase 3 (Git 작업)로 진행
250
- - 품질 리포트 생성
251
-
252
- ⚠️ **WARNING (Critical 0개, Warning 6개 이상)**:
253
- - 경고 표시
254
- - 사용자 선택: "계속 진행" 또는 "수정 후 재검증"
255
-
256
- ❌ **CRITICAL (Critical 1개 이상)**:
257
- - Git 커밋 차단
258
- - 개선 필요 항목 상세 보고 (파일:라인 정보 포함)
259
- - tdd-implementer 재호출 권장
260
-
261
- **검증 생략 옵션**: 품질 검증을 건너뛰려면 `--skip-quality-check` 옵션을 사용합니다.
262
-
263
- ### Phase 3: Git 작업 (git-manager)
264
-
265
- `git-manager` 에이전트가 TDD 완료 후 **한 번에** 수행:
266
-
267
- 1. **체크포인트 생성**: TDD 시작 전 백업 포인트
268
- 2. **구조화된 커밋**: RED→GREEN→REFACTOR 단계별 커밋 생성
269
- 3. **최종 동기화**: 모드별 Git 전략 적용 및 원격 동기화
270
-
271
-
272
- ## 📋 STEP 1 실행 가이드: SPEC 분석 및 계획 수립
273
-
274
- ### 1. SPEC 문서 분석
275
-
276
- Alfred는 implementation-planner 에이전트를 호출하여 SPEC 문서를 확인하고 구현 계획을 수립합니다.
277
-
278
- #### 분석 체크리스트
279
-
280
- - [ ] **요구사항 명확성**: SPEC의 기능 요구사항이 구체적인가?
281
- - [ ] **기술적 제약**: 성능, 호환성, 보안 요구사항 확인
282
- - [ ] **의존성 분석**: 기존 코드와의 연결점 및 영향 범위
283
- - [ ] **복잡도 평가**: 구현 난이도 및 예상 작업량
284
-
285
- ### 2. 구현 전략 결정
286
-
287
- #### TypeScript 구현 기준
288
-
289
- | SPEC 특성 | 구현 언어 | 이유 |
290
- |-----------|-----------|------|
291
- | CLI/시스템 도구 | TypeScript | 고성능 (18ms), 타입 안전성, SQLite3 통합 |
292
- | API/백엔드 | TypeScript | Node.js 생태계, Express/Fastify 호환성 |
293
- | 프론트엔드 | TypeScript | React/Vue 네이티브 지원 |
294
- | 데이터 처리 | TypeScript | 고성능 비동기 처리, 타입 안전성 |
295
- | 사용자 Python 프로젝트 | Python 도구 지원 | MoAI-ADK가 Python 프로젝트 개발 도구 제공 |
296
-
297
- #### TDD 접근 방식
298
-
299
- - **Bottom-up**: 유틸리티 → 서비스 → API
300
- - **Top-down**: API → 서비스 → 유틸리티
301
- - **Middle-out**: 핵심 로직 → 양방향 확장
302
-
303
- ### 3. 구현 계획 보고서 생성
304
-
305
- 다음 형식으로 계획을 제시합니다:
306
-
307
- ```
308
- ## 구현 계획 보고서: [SPEC-ID]
309
-
310
- ### 📊 분석 결과
311
- - **복잡도**: [낮음/중간/높음]
312
- - **예상 작업시간**: [시간 산정]
313
- - **주요 기술 도전**: [기술적 어려움]
314
-
315
- ### 🎯 구현 전략
316
- - **선택 언어**: [Python/TypeScript + 이유]
317
- - **TDD 접근법**: [Bottom-up/Top-down/Middle-out]
318
- - **핵심 모듈**: [주요 구현 대상]
319
-
320
- ### 📦 라이브러리 버전 (필수 - 웹 검색 기반)
321
- **백엔드 의존성** (예시):
322
- | 패키지 | 최신 안정 버전 | 설치 명령 |
323
- |--------|--------------|----------|
324
- | FastAPI | 0.118.3 | fastapi>=0.118.3 |
325
- | SQLAlchemy | 2.0.43 | sqlalchemy>=2.0.43 |
326
-
327
- **프론트엔드 의존성** (예시):
328
- | 패키지 | 최신 안정 버전 | 설치 명령 |
329
- |--------|--------------|----------|
330
- | React | 18.3.1 | react@^18.3.1 |
331
- | Vite | 7.1.9 | vite@^7.1.9 |
332
-
333
- **중요 호환성 정보**:
334
- - [특정 버전 요구사항]
335
- - [알려진 호환성 이슈]
336
-
337
- ### ⚠️ 위험 요소
338
- - **기술적 위험**: [예상 문제점]
339
- - **의존성 위험**: [외부 의존성 이슈]
340
- - **일정 위험**: [지연 가능성]
341
-
342
- ### ✅ 품질 게이트
343
- - **테스트 커버리지**: [목표 %]
344
- - **성능 목표**: [구체적 지표]
345
- - **보안 체크포인트**: [검증 항목]
346
-
347
- ---
348
- **승인 요청**: 위 계획으로 진행하시겠습니까?
349
- ("진행", "수정 [내용]", "중단" 중 선택)
350
- ```
351
-
352
- ---
353
-
354
- ## 🚀 STEP 2 실행 가이드: TDD 구현 (승인 후)
355
-
356
- 사용자가 **"진행"** 또는 **"시작"**을 선택한 경우에만 Alfred는 tdd-implementer 에이전트를 호출하여 TDD 구현을 시작하고 RED-GREEN-REFACTOR 사이클을 수행합니다.
357
-
358
- ### TDD 단계별 가이드
359
-
360
- 1. **RED**: Given/When/Then 구조로 실패 테스트 작성. 언어별 테스트 파일 규칙을 따르고, 실패 로그를 간단히 기록합니다.
361
- 2. **GREEN**: 테스트를 통과시키는 최소한의 구현만 추가합니다. 최적화는 REFACTOR 단계로 미룹니다.
362
- 3. **REFACTOR**: 중복 제거, 명시적 네이밍, 구조화 로깅/예외 처리 보강. 필요 시 추가 커밋으로 분리합니다.
363
-
364
- **TRUST 5원칙 연계** (상세: `development-guide.md` - "TRUST 5원칙"):
365
- - **T (Test First)**: RED 단계에서 SPEC 기반 테스트 작성
366
- - **R (Readable)**: REFACTOR 단계에서 가독성 개선 (파일≤300 LOC, 함수≤50 LOC)
367
- - **T (Trackable)**: 모든 단계에서 @TAG 추적성 유지
368
-
369
- > TRUST 5원칙은 기본 권장치만 제공하므로, `simplicity_threshold`를 초과하는 구조가 필요하다면 SPEC 또는 ADR에 근거를 남기고 진행하세요.
370
-
371
- ## 에이전트 역할 분리
372
-
373
- ### implementation-planner 전담 영역
374
-
375
- - SPEC 문서 분석 및 요구사항 추출
376
- - 라이브러리 선정 및 버전 관리
377
- - TAG 체인 설계 및 순서 결정
378
- - 구현 전략 수립 및 리스크 식별
379
- - 구현 계획서 작성
380
-
381
- ### tdd-implementer 전담 영역
382
-
383
- - TDD Red-Green-Refactor 코드 구현
384
- - 테스트 작성 및 실행
385
- - TAG 주석 추가 및 관리
386
- - 코드 품질 개선 (리팩토링)
387
- - 언어별 린터/포매터 실행
388
-
389
- ### quality-gate 전담 영역
390
-
391
- - TRUST 원칙 검증
392
- - 코드 스타일 검증
393
- - 테스트 커버리지 확인
394
- - TAG 체인 무결성 검증
395
- - 의존성 보안 검증
396
-
397
- ### git-manager 전담 영역
398
-
399
- - 모든 Git 커밋 작업 (add, commit, push)
400
- - TDD 단계별 체크포인트 생성
401
- - 모드별 커밋 전략 적용
402
- - 깃 브랜치/태그 관리
403
- - 원격 동기화 처리
404
-
405
- ## 품질 게이트 체크리스트
406
-
407
- - 테스트 커버리지 ≥ `.moai/config.json.test_coverage_target` (기본 85%)
408
- - 린터/포매터 통과 (`ruff`, `eslint --fix`, `gofmt` 등)
409
- - 구조화 로깅 또는 관측 도구 호출 존재 확인
410
- - @TAG 업데이트 필요 변경 사항 메모 (다음 단계에서 doc-syncer가 사용)
411
-
412
- ---
413
-
414
- ## 🧠 Context Management (컨텍스트 관리)
415
-
416
- > 자세한 내용: `.moai/memory/development-guide.md` - "Context Engineering" 섹션 참조
417
-
418
- ### 이 커맨드의 핵심 전략
419
-
420
- **우선 로드**: `.moai/specs/SPEC-XXX/spec.md` (구현 대상 요구사항)
421
-
422
- **권장사항**: TDD 구현이 완료되었습니다. 다음 단계(`/alfred:3-sync`) 진행 전 `/clear` 또는 `/new` 명령으로 새로운 대화 세션을 시작하면 더 나은 성능과 컨텍스트 관리를 경험할 수 있습니다.
423
-
424
- ---
425
-
426
- ## 다음 단계
427
-
428
- **권장사항**: 다음 단계 진행 전 `/clear` 또는 `/new` 명령으로 새로운 대화 세션을 시작하면 더 나은 성능과 컨텍스트 관리를 경험할 수 있습니다.
429
-
430
- - TDD 구현 완료 후 `/alfred:3-sync`로 문서 동기화 진행
431
- - 모든 Git 작업은 git-manager 에이전트가 전담하여 일관성 보장
432
- - 에이전트 간 직접 호출 없이 커맨드 레벨 오케스트레이션만 사용
@@ -1,88 +0,0 @@
1
- #!/bin/bash
2
-
3
- # MoAI-ADK GitFlow Main Branch Advisory Hook
4
- # Purpose: Advisory warnings for main branch operations (not blocking)
5
- # Enforces: Best practices with flexibility
6
- #
7
- # This hook runs before any git push operation and provides advisories:
8
- # 1. Warns about direct push to main branch (but allows it)
9
- # 2. Warns about force-push to main branch (but allows it)
10
- # 3. Recommends GitFlow best practices
11
- #
12
- # Exit codes:
13
- # 0 - Push allowed (always)
14
-
15
- set -e
16
-
17
- # Colors for output
18
- RED='\033[0;31m'
19
- YELLOW='\033[1;33m'
20
- GREEN='\033[0;32m'
21
- BLUE='\033[0;34m'
22
- NC='\033[0m' # No Color
23
-
24
- # Read from stdin (git sends remote, local ref info)
25
- # Format: <local ref> <local oid> <remote ref> <remote oid>
26
- while read local_ref local_oid remote_ref remote_oid; do
27
- # Extract the remote branch name from the reference
28
- # remote_ref format: refs/heads/main
29
- remote_branch=$(echo "$remote_ref" | sed 's|refs/heads/||')
30
- local_branch=$(echo "$local_ref" | sed 's|refs/heads/||')
31
-
32
- # Check if attempting to push to main branch
33
- if [ "$remote_branch" = "main" ] || [ "$remote_branch" = "master" ]; then
34
- # Get the current branch to determine if this is the develop branch
35
- current_branch=$(git rev-parse --abbrev-ref HEAD)
36
-
37
- # Advisory: recommend develop -> main workflow
38
- if [ "$local_branch" != "develop" ] && [ "${local_branch#release/}" = "$local_branch" ]; then
39
- echo ""
40
- echo -e "${YELLOW}⚠️ ADVISORY: Non-standard GitFlow detected${NC}"
41
- echo ""
42
- echo -e "${BLUE}Current branch: ${local_branch}${NC}"
43
- echo -e "${BLUE}Target branch: ${remote_branch}${NC}"
44
- echo ""
45
- echo "Recommended GitFlow workflow:"
46
- echo " 1. Work on feature/SPEC-{ID} branch (created from develop)"
47
- echo " 2. Push to feature/SPEC-{ID} and create PR to develop"
48
- echo " 3. Merge into develop after code review"
49
- echo " 4. When develop is stable, create PR from develop to main"
50
- echo " 5. Release manager merges develop -> main with tag"
51
- echo ""
52
- echo -e "${GREEN}✓ Push will proceed (flexibility mode enabled)${NC}"
53
- echo ""
54
- fi
55
-
56
- # Check for delete operation
57
- if [ "$local_oid" = "0000000000000000000000000000000000000000" ]; then
58
- echo ""
59
- echo -e "${RED}⚠️ WARNING: Attempting to delete main branch${NC}"
60
- echo ""
61
- echo -e "${YELLOW}This operation is highly discouraged.${NC}"
62
- echo -e "${GREEN}✓ Push will proceed (flexibility mode enabled)${NC}"
63
- echo ""
64
- fi
65
-
66
- # Check for force push attempts to main
67
- if [ "$remote_branch" = "main" ] || [ "$remote_branch" = "master" ]; then
68
- # Check if remote_oid exists (non-zero means we're trying to update existing ref)
69
- if [ "$remote_oid" != "0000000000000000000000000000000000000000" ]; then
70
- # Verify this is a fast-forward merge (no force push)
71
- if ! git merge-base --is-ancestor "$remote_oid" "$local_oid" 2>/dev/null; then
72
- echo ""
73
- echo -e "${YELLOW}⚠️ ADVISORY: Force-push to main branch detected${NC}"
74
- echo ""
75
- echo "Recommended approach:"
76
- echo " - Use GitHub PR with proper code review"
77
- echo " - Ensure changes are merged via fast-forward"
78
- echo ""
79
- echo -e "${GREEN}✓ Push will proceed (flexibility mode enabled)${NC}"
80
- echo ""
81
- fi
82
- fi
83
- fi
84
- fi
85
- done
86
-
87
- # All checks passed (or advisory warnings shown)
88
- exit 0