moai-adk 0.12.1__py3-none-any.whl → 0.13.0__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 (24) hide show
  1. moai_adk/core/project/detector.py +13 -103
  2. moai_adk/core/tags/ci_validator.py +1 -1
  3. moai_adk/core/tags/pre_commit_validator.py +1 -1
  4. moai_adk/core/tags/validator.py +1 -1
  5. moai_adk/templates/.claude/commands/alfred/0-project.md +96 -8
  6. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +1 -3
  7. moai_adk/templates/.claude/hooks/alfred/core/project.py +1 -3
  8. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +0 -1
  9. moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +2 -1
  10. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +2 -1
  11. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +2 -1
  12. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +2 -1
  13. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +7 -4
  14. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +1 -3
  15. moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +2 -1
  16. moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +2 -1
  17. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +1 -1
  18. {moai_adk-0.12.1.dist-info → moai_adk-0.13.0.dist-info}/METADATA +1 -1
  19. {moai_adk-0.12.1.dist-info → moai_adk-0.13.0.dist-info}/RECORD +22 -24
  20. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -330
  21. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  22. {moai_adk-0.12.1.dist-info → moai_adk-0.13.0.dist-info}/WHEEL +0 -0
  23. {moai_adk-0.12.1.dist-info → moai_adk-0.13.0.dist-info}/entry_points.txt +0 -0
  24. {moai_adk-0.12.1.dist-info → moai_adk-0.13.0.dist-info}/licenses/LICENSE +0 -0
@@ -118,107 +118,6 @@ class LanguageDetector:
118
118
 
119
119
  return False
120
120
 
121
- # @CODE:LANG-002 | SPEC: SPEC-LANGUAGE-DETECTION-001.md | TEST: tests/unit/test_detector.py
122
- def detect_package_manager(self, path: str | Path = ".") -> str:
123
- """Detect JavaScript/TypeScript package manager.
124
-
125
- Checks for lock files in priority order (highest to lowest):
126
- 1. bun.lockb (Bun) - fastest runtime
127
- 2. pnpm-lock.yaml (pnpm) - efficient disk usage
128
- 3. yarn.lock (Yarn) - Facebook's package manager
129
- 4. package-lock.json (npm) - default Node.js package manager
130
-
131
- Priority order reflects modern best practices and performance characteristics.
132
-
133
- Args:
134
- path: Project root directory to inspect. Defaults to current directory.
135
-
136
- Returns:
137
- Package manager name: 'bun' | 'pnpm' | 'yarn' | 'npm'
138
-
139
- Example:
140
- >>> detector = LanguageDetector()
141
- >>> detector.detect_package_manager("/path/to/project")
142
- 'pnpm'
143
- """
144
- path = Path(path)
145
-
146
- # Check in priority order (Bun → pnpm → Yarn → npm)
147
- if (path / "bun.lockb").exists():
148
- return "bun"
149
- elif (path / "pnpm-lock.yaml").exists():
150
- return "pnpm"
151
- elif (path / "yarn.lock").exists():
152
- return "yarn"
153
- else:
154
- # Default to npm (most common, works everywhere)
155
- return "npm"
156
-
157
- # @CODE:LANG-002 | SPEC: SPEC-LANGUAGE-DETECTION-001.md | TEST: tests/unit/test_detector.py
158
- def get_workflow_template_path(self, language: str) -> str:
159
- """Get workflow template path for detected language.
160
-
161
- Returns the relative path to the language-specific GitHub Actions workflow template.
162
- These templates are pre-configured with language-specific testing tools, linting,
163
- and coverage reporting.
164
-
165
- Args:
166
- language: Detected language name (lowercase).
167
- Supported: 'python', 'javascript', 'typescript', 'go'
168
-
169
- Returns:
170
- Relative path to workflow template (e.g., 'workflows/python-tag-validation.yml')
171
-
172
- Raises:
173
- ValueError: If language doesn't have a dedicated workflow template
174
-
175
- Example:
176
- >>> detector = LanguageDetector()
177
- >>> detector.get_workflow_template_path("python")
178
- 'workflows/python-tag-validation.yml'
179
- """
180
- # Language-to-template mapping (add new languages here)
181
- template_mapping = {
182
- "python": "python-tag-validation.yml",
183
- "javascript": "javascript-tag-validation.yml",
184
- "typescript": "typescript-tag-validation.yml",
185
- "go": "go-tag-validation.yml",
186
- }
187
-
188
- if language not in template_mapping:
189
- supported = ", ".join(sorted(template_mapping.keys()))
190
- raise ValueError(
191
- f"Language '{language}' does not have a dedicated workflow template. "
192
- f"Supported languages: {supported}"
193
- )
194
-
195
- template_filename = template_mapping[language]
196
- # Return path relative to templates directory
197
- return f"workflows/{template_filename}"
198
-
199
- # @CODE:LANG-002 | SPEC: SPEC-LANGUAGE-DETECTION-001.md | TEST: tests/unit/test_detector.py
200
- def get_supported_languages_for_workflows(self) -> list[str]:
201
- """Get list of languages with dedicated workflow templates.
202
-
203
- Returns languages that have pre-built GitHub Actions workflow templates
204
- with language-specific testing, linting, and coverage configuration.
205
-
206
- Returns:
207
- List of supported language names (lowercase)
208
-
209
- Example:
210
- >>> detector = LanguageDetector()
211
- >>> detector.get_supported_languages_for_workflows()
212
- ['python', 'javascript', 'typescript', 'go']
213
-
214
- Note:
215
- While LanguageDetector can detect 20+ languages, only these 4
216
- have dedicated CI/CD workflow templates. Other languages fall back
217
- to generic workflows.
218
- """
219
- return ["python", "javascript", "typescript", "go"]
220
-
221
-
222
121
  def get_workflow_template_path(self, language: str) -> str:
223
122
  """Get the GitHub Actions workflow template path for a language.
224
123
 
@@ -306,9 +205,20 @@ class LanguageDetector:
306
205
  if (path / "pyproject.toml").exists():
307
206
  return "pip"
308
207
 
309
- # JavaScript/TypeScript
208
+ # JavaScript/TypeScript (check in priority order)
310
209
  if (path / "package.json").exists():
311
- return "npm"
210
+ # Check for package managers in priority order
211
+ if (path / "bun.lockb").exists():
212
+ return "bun"
213
+ elif (path / "pnpm-lock.yaml").exists():
214
+ return "pnpm"
215
+ elif (path / "yarn.lock").exists():
216
+ return "yarn"
217
+ elif (path / "package-lock.json").exists():
218
+ return "npm"
219
+ else:
220
+ # Default to npm for package.json without lock files
221
+ return "npm"
312
222
 
313
223
  # Go
314
224
  if (path / "go.mod").exists():
@@ -290,7 +290,7 @@ class CIValidator(PreCommitValidator):
290
290
  tag = error.tag
291
291
  message = error.message
292
292
  locations = ', '.join([
293
- f"`{f}:{l}`" for f, l in error.locations[:3]
293
+ f"`{f}:{line}`" for f, line in error.locations[:3]
294
294
  ])
295
295
  if len(error.locations) > 3:
296
296
  locations += f" (+{len(error.locations) - 3} more)"
@@ -26,7 +26,7 @@ class ValidationError:
26
26
  locations: List[Tuple[str, int]] = field(default_factory=list)
27
27
 
28
28
  def __str__(self) -> str:
29
- loc_str = ", ".join([f"{f}:{l}" for f, l in self.locations])
29
+ loc_str = ", ".join([f"{f}:{line}" for f, line in self.locations])
30
30
  return f"{self.message}: {self.tag} at {loc_str}"
31
31
 
32
32
 
@@ -85,7 +85,7 @@ class ValidationIssue:
85
85
  "tag": self.tag,
86
86
  "message": self.message,
87
87
  "locations": [
88
- {"file": f, "line": l} for f, l in self.locations
88
+ {"file": f, "line": line} for f, line in self.locations
89
89
  ],
90
90
  "suggestion": self.suggestion
91
91
  }
@@ -110,9 +110,28 @@ MoAI-ADK의 SuperAgent로서 당신의 프로젝트를 함께 만들어갈 준
110
110
  먼저 기본 설정을 진행하겠습니다.
111
111
  ```
112
112
 
113
- ### 0.1 배치 설계: 언어 선택 + 사용자 닉네임 수집 (1회 호출)
113
+ ### 0.1 배치 설계: 언어 선택 + 사용자 닉네임 + GitHub 설정 확인 (1-3회 호출)
114
114
 
115
- Alfred가 `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` 를 사용하여 **단일 배치 호출**로 언어와 닉네임을 동시에 수집합니다:
115
+ Alfred가 `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` 를 사용하여 **배치 호출**로 필수 정보를 수집합니다:
116
+
117
+ **기본 배치 (항상 실행)**:
118
+ - 언어 선택
119
+ - 사용자 닉네임
120
+
121
+ **추가 배치 (팀 모드 감지 시)**:
122
+ - GitHub "Automatically delete head branches" 설정 확인
123
+
124
+ #### 0.1.1 팀 모드 감지
125
+
126
+ ```bash
127
+ # config.json에서 mode 확인
128
+ grep "mode" .moai/config.json
129
+
130
+ # 결과: "mode": "team" → 추가 질문 포함
131
+ # "mode": "personal" → 기본 질문만 실행
132
+ ```
133
+
134
+ #### 0.1.2 기본 배치: 언어 선택 + 닉네임
116
135
 
117
136
  **Example AskUserQuestion Call**:
118
137
  ```python
@@ -156,6 +175,42 @@ AskUserQuestion(
156
175
  )
157
176
  ```
158
177
 
178
+ #### 0.1.3 팀 모드 추가 배치: GitHub 설정 확인 (팀 모드만)
179
+
180
+ **조건**: `config.json`에서 `"mode": "team"` 감지 시 실행
181
+
182
+ **Example AskUserQuestion Call**:
183
+ ```python
184
+ AskUserQuestion(
185
+ questions=[
186
+ {
187
+ "question": "[Team Mode] Is 'Automatically delete head branches' enabled in your GitHub repository settings?",
188
+ "header": "GitHub Branch Settings",
189
+ "multiSelect": false,
190
+ "options": [
191
+ {
192
+ "label": "✅ Yes, already enabled",
193
+ "description": "PR merge 후 자동으로 원격 브랜치 삭제됨"
194
+ },
195
+ {
196
+ "label": "❌ No, not enabled (Recommended: Enable)",
197
+ "description": "Settings → General → '자동 삭제' 체크박스 확인 필요"
198
+ },
199
+ {
200
+ "label": "🤔 Not sure / Need to check",
201
+ "description": "GitHub Settings → General 확인 후 다시 진행"
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ )
207
+ ```
208
+
209
+ **응답 처리**:
210
+ - **"Yes, already enabled"** → `auto_delete_branches: true` 저장
211
+ - **"No, not enabled"** → `auto_delete_branches: false` + 권장사항 저장
212
+ - **"Not sure"** → `auto_delete_branches: null` + 경고 메시지
213
+
159
214
  **User Response Example**:
160
215
  ```
161
216
  Selected Language: 🇰🇷 한국어
@@ -164,22 +219,55 @@ Selected Nickname: GOOS (typed via "Other" option)
164
219
 
165
220
  ### 0.2 사용자 정보 저장
166
221
 
167
- Alfred가 선택된 언어와 닉네임을 다음과 같이 저장합니다:
222
+ Alfred가 선택된 언어, 닉네임, 그리고 팀 모드 설정을 다음과 같이 저장합니다:
223
+
224
+ #### 0.2.1 기본 정보 저장 (항상)
168
225
 
169
226
  ```json
170
227
  {
171
- "conversation_language": "ko",
172
- "conversation_language_name": "한국어",
173
- "user_nickname": "GOOS",
174
- "selected_at": "2025-10-23T12:34:56Z"
228
+ "language": {
229
+ "conversation_language": "ko",
230
+ "conversation_language_name": "한국어"
231
+ },
232
+ "user": {
233
+ "nickname": "GOOS",
234
+ "selected_at": "2025-10-23T12:34:56Z"
235
+ }
175
236
  }
176
237
  ```
177
238
 
239
+ #### 0.2.2 GitHub 설정 저장 (팀 모드만)
240
+
241
+ **팀 모드 감지 시 추가 저장**:
242
+ ```json
243
+ {
244
+ "github": {
245
+ "auto_delete_branches": true,
246
+ "checked_at": "2025-10-23T12:34:56Z",
247
+ "recommendation": "Branch cleanup will be automated after PR merge"
248
+ }
249
+ }
250
+ ```
251
+
252
+ **또는 (미활성화 상태)**:
253
+ ```json
254
+ {
255
+ "github": {
256
+ "auto_delete_branches": false,
257
+ "checked_at": "2025-10-23T12:34:56Z",
258
+ "recommendation": "Enable 'Automatically delete head branches' in GitHub Settings → General for better GitFlow workflow"
259
+ }
260
+ }
261
+ ```
262
+
263
+ #### 0.2.3 저장된 정보 활용
264
+
178
265
  이 정보는:
179
266
  - 모든 sub-agents 에게 컨텍스트 파라미터로 전달됨
180
- - `.moai/config.json` 의 `language` `user` 필드에 저장됨
267
+ - `.moai/config.json` 의 `language`, `user`, `github` 필드에 저장됨
181
268
  - CLAUDE.md의 `{{CONVERSATION_LANGUAGE}}` 및 `{{USER_NICKNAME}}` 변수로 치환됨
182
269
  - 모든 Alfred 대화에서 사용됨
270
+ - **팀 모드**: git-manager가 GitHub 설정 상태를 참고하여 브랜치 정리 전략 수립
183
271
 
184
272
  **설정 완료 출력 예시**:
185
273
  ```markdown
@@ -53,6 +53,7 @@ Setup sys.path for package imports
53
53
  """
54
54
 
55
55
  import json
56
+ import signal
56
57
  import sys
57
58
  from pathlib import Path
58
59
  from typing import Any
@@ -77,9 +78,6 @@ if str(HOOKS_DIR) not in sys.path:
77
78
  sys.path.insert(0, str(HOOKS_DIR))
78
79
 
79
80
 
80
- pass
81
-
82
-
83
81
  def _hook_timeout_handler(signum, frame):
84
82
  """Signal handler for global hook timeout"""
85
83
  raise HookTimeoutError("Hook execution exceeded 5-second timeout")
@@ -8,8 +8,6 @@ import json
8
8
  import socket
9
9
  import subprocess
10
10
  from contextlib import contextmanager
11
-
12
- from .timeout import CrossPlatformTimeout, TimeoutError as PlatformTimeoutError
13
11
  from pathlib import Path
14
12
  from typing import Any
15
13
 
@@ -607,7 +605,7 @@ def get_package_version_info(cwd: str = ".") -> dict[str, Any]:
607
605
  else:
608
606
  # Skip caching if module can't be loaded
609
607
  version_cache_class = None
610
- except (ImportError, OSError) as e:
608
+ except (ImportError, OSError):
611
609
  # Graceful degradation: skip caching on import errors
612
610
  version_cache_class = None
613
611
 
@@ -22,7 +22,6 @@ import threading
22
22
  import time
23
23
  from typing import Any, Callable, Optional, TypeVar
24
24
 
25
-
26
25
  T = TypeVar('T')
27
26
 
28
27
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-NOTIF | SPEC: Individual hook files for better UX
3
3
  """Notification Hook: Handle System Notifications
4
4
 
5
5
  Claude Code Event: Notification
@@ -26,6 +26,7 @@ from handlers import handle_notification
26
26
 
27
27
 
28
28
 
29
+
29
30
  def main() -> None:
30
31
  """Main entry point for Notification hook
31
32
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-LOG | SPEC: Individual hook files for better UX
3
3
  """PostToolUse Hook: Log Tool Usage and Changes
4
4
 
5
5
  Claude Code Event: PostToolUse
@@ -27,6 +27,7 @@ from handlers import handle_post_tool_use
27
27
 
28
28
 
29
29
 
30
+
30
31
  def main() -> None:
31
32
  """Main entry point for PostToolUse hook
32
33
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-CKPT | SPEC: Individual hook files for better UX
3
3
  """PreToolUse Hook: Automatic Safety Checkpoint Creation
4
4
 
5
5
  Claude Code Event: PreToolUse
@@ -32,6 +32,7 @@ from handlers import handle_pre_tool_use
32
32
 
33
33
 
34
34
 
35
+
35
36
  def main() -> None:
36
37
  """Main entry point for PreToolUse hook
37
38
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-CLEAN | SPEC: Individual hook files for better UX
3
3
  """SessionEnd Hook: Session Cleanup and Finalization
4
4
 
5
5
  Claude Code Event: SessionEnd
@@ -26,6 +26,7 @@ from handlers import handle_session_end
26
26
 
27
27
 
28
28
 
29
+
29
30
  def main() -> None:
30
31
  """Main entry point for SessionEnd hook
31
32
 
@@ -11,10 +11,10 @@ Output: System message with formatted project summary
11
11
 
12
12
  import json
13
13
  import sys
14
- from pathlib import Path
15
- from typing import Any
16
-
14
+ from pathlib import
17
15
  from utils.timeout import CrossPlatformTimeout, TimeoutError as PlatformTimeoutError
16
+ Path
17
+ from typing import Any
18
18
 
19
19
  # Setup import path for shared modules
20
20
  HOOKS_DIR = Path(__file__).parent
@@ -25,6 +25,9 @@ if str(SHARED_DIR) not in sys.path:
25
25
  from handlers import handle_session_start
26
26
 
27
27
 
28
+ pass
29
+
30
+
28
31
 
29
32
  def main() -> None:
30
33
  """Main entry point for SessionStart hook
@@ -41,7 +44,7 @@ def main() -> None:
41
44
  """
42
45
  # Set 5-second timeout
43
46
  timeout = CrossPlatformTimeout(5)
44
- timeout.start()
47
+ timeout.start()
45
48
 
46
49
  try:
47
50
  # Read JSON payload from stdin
@@ -5,9 +5,7 @@ Notification, Stop, SubagentStop event handling
5
5
  """
6
6
 
7
7
  import json
8
- from datetime import datetime, timedelta
9
-
10
- from utils.timeout import CrossPlatformTimeout, TimeoutError as PlatformTimeoutError
8
+ from datetime import datetime
11
9
  from pathlib import Path
12
10
 
13
11
  from core import HookPayload, HookResult
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-STOP | SPEC: Individual hook files for better UX
3
3
  """Stop Hook: Handle Execution Interruption
4
4
 
5
5
  Claude Code Event: Stop
@@ -26,6 +26,7 @@ from handlers import handle_stop
26
26
 
27
27
 
28
28
 
29
+
29
30
  def main() -> None:
30
31
  """Main entry point for Stop hook
31
32
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-SUBAGENT | SPEC: Individual hook files for better UX
3
3
  """SubagentStop Hook: Handle Sub-agent Termination
4
4
 
5
5
  Claude Code Event: SubagentStop
@@ -26,6 +26,7 @@ from handlers import handle_subagent_stop
26
26
 
27
27
 
28
28
 
29
+
29
30
  def main() -> None:
30
31
  """Main entry point for SubagentStop hook
31
32
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- # @CODE:HOOKS-CLARITY-001 | SPEC: Individual hook files for better UX
2
+ # @CODE:HOOKS-CLARITY-DOCS | SPEC: Individual hook files for better UX
3
3
  """UserPromptSubmit Hook: Just-In-Time Document Loading
4
4
 
5
5
  Claude Code Event: UserPromptSubmit
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moai-adk
3
- Version: 0.12.1
3
+ Version: 0.13.0
4
4
  Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent & Complete Skills v2.0
5
5
  Project-URL: Homepage, https://github.com/modu-ai/moai-adk
6
6
  Project-URL: Repository, https://github.com/modu-ai/moai-adk
@@ -27,7 +27,7 @@ moai_adk/core/git/manager.py,sha256=pNqdW4ZON5OCXyrNxynR-ewzIDHYm9_NrgM9aOAOLKg,
27
27
  moai_adk/core/project/__init__.py,sha256=w_VdJ6lJDkTMdYYEwj0Io6Ay3ekqsLO3qXInSfXX7Vs,134
28
28
  moai_adk/core/project/backup_utils.py,sha256=-zEXIhGsM-MdX1voUIpKxLlR57Y-lqLEZSi8noeKV1E,1775
29
29
  moai_adk/core/project/checker.py,sha256=B94mGLHDZkjQnFDgV8sknJDms5oIiHeyKcgxWI87-f8,9523
30
- moai_adk/core/project/detector.py,sha256=V9TsIA3ST5YrOI7eimZAvZflB17kc1uBeMXiE9wuemE,13813
30
+ moai_adk/core/project/detector.py,sha256=hEtS6VI7Q_3dYk1Sf_ddhljGEuJKt9qphAMDxOsjxq4,10275
31
31
  moai_adk/core/project/initializer.py,sha256=yqxePuCO2ednzCOpDZLczyCP079J6Io4pvtynTp4J6w,6724
32
32
  moai_adk/core/project/phase_executor.py,sha256=qMUXiFfMVbziuKYXOUcIkhovdobDcvFYDX_TqqlJQpc,11158
33
33
  moai_adk/core/project/validator.py,sha256=gH9ywTMQTwqtqBVrMWj5_bPYFrVzjHuFoU4QdeVa1O4,5756
@@ -36,16 +36,16 @@ moai_adk/core/quality/trust_checker.py,sha256=CN067AiublAH46IBAKEV_I-8Wc0bNaR2dM
36
36
  moai_adk/core/quality/validators/__init__.py,sha256=Q53sqQFOK7GnwshPVi0HvUSq_VCvHEL28-V5J_L9LoE,189
37
37
  moai_adk/core/quality/validators/base_validator.py,sha256=8Fk5casPdfRtnlEfslIK6mOYsZeZLWIK_MAebWCrNw4,437
38
38
  moai_adk/core/tags/__init__.py,sha256=nmZKs4eblrOzPg8JOHNkoaRzhPcUDGmMwvnUcyMZwGY,1985
39
- moai_adk/core/tags/ci_validator.py,sha256=I9EM9Ymzob3jhrdjMEq_LyPis0In-0jmTmfqwvZOOUc,14660
39
+ moai_adk/core/tags/ci_validator.py,sha256=7YwCTihbK2iWiF04-5WYe8LkGkxmra5_XvcRbPrsF-8,14666
40
40
  moai_adk/core/tags/cli.py,sha256=1VWRT1k62FS5Yyzllat-nyLR3jqvGdyDkj1uOwPfavA,7344
41
41
  moai_adk/core/tags/generator.py,sha256=xVopAAez8K5pNSHWZOGZXEWYIre53lTtfHUlR7i-vNE,3407
42
42
  moai_adk/core/tags/inserter.py,sha256=_1lsMTyyrjGidAKqi4y925msHxK6gHLAsu3O8-O2vFM,2823
43
43
  moai_adk/core/tags/mapper.py,sha256=ldcfMFzsk-ESKpXAptYydqx2NZ951utqKOXZVTHMeIE,3955
44
44
  moai_adk/core/tags/parser.py,sha256=3LpNcL47xT3u4b3Fdf9wYnltChDrNAEV4EtnHqLN1MA,2098
45
- moai_adk/core/tags/pre_commit_validator.py,sha256=Y1G8qtuRjCaHGjQ-Nxn8k2UGOcHRd3EfdZrSqCqHAY4,10230
45
+ moai_adk/core/tags/pre_commit_validator.py,sha256=h6wXm105cwxoTsWTgZPTuX0C5r_3ZTEkrK1enAZZpSs,10236
46
46
  moai_adk/core/tags/reporter.py,sha256=fn9kc0FNNvaep5cXbA2RkYxbJsw7eq2PHbrZ_XFB1Wc,29301
47
47
  moai_adk/core/tags/tags.py,sha256=Fylt030vrDqhSWivwRbxxwu_uQhilei0SFk_xVzy9UI,4248
48
- moai_adk/core/tags/validator.py,sha256=B3xUDubfyT5RlPM3GLYktfe1EQTEdxOrDhD230_etoA,31138
48
+ moai_adk/core/tags/validator.py,sha256=3_IQS93WAra1R_J0Oqy-Gl6XYnYMUA_61eUtshOGIaA,31144
49
49
  moai_adk/core/template/__init__.py,sha256=BB65Zkar2Oywt1_RFtQKIup6HXq20VNQrYqXD_Qp1_g,354
50
50
  moai_adk/core/template/backup.py,sha256=44y3QGCKsYqrRPbzkB1xNM9qtpG6kNNMcWR8DnAcPiQ,3228
51
51
  moai_adk/core/template/config.py,sha256=ZJU9UKSGF2tkPiwSFReoCkAHGQ0aN2jKmIIQt88x5-o,3532
@@ -69,23 +69,23 @@ moai_adk/templates/.claude/agents/alfred/spec-builder.md,sha256=duYOXS1-VPLpFVZU
69
69
  moai_adk/templates/.claude/agents/alfred/tag-agent.md,sha256=oQIPS_Pa-VGiTZn4DH1TWgpk2EFwfTvn38S3zF4OL1M,10579
70
70
  moai_adk/templates/.claude/agents/alfred/tdd-implementer.md,sha256=W0PwBgmdOhG_tb3dl-G-nFJtdL_0uLxjkGe1PLtUick,10691
71
71
  moai_adk/templates/.claude/agents/alfred/trust-checker.md,sha256=ISdkXhZvwEYCBKVIHYyMGAHInr4ToLf4zVvNSwRVABA,14583
72
- moai_adk/templates/.claude/commands/alfred/0-project.md,sha256=HNFoQQ7Dc6k9NbcWCBCPSu1bGXxagQwLaQVpvK4OwYo,47086
72
+ moai_adk/templates/.claude/commands/alfred/0-project.md,sha256=awp6rBLkhlWl3AqlU1i1E2QttXmJTFf6Ko7cDPFrQ9U,49643
73
73
  moai_adk/templates/.claude/commands/alfred/1-plan.md,sha256=RJleHlBtTTp-W-8mEtCF9WjElww6kdlNoqZb_J378m4,29485
74
74
  moai_adk/templates/.claude/commands/alfred/2-run.md,sha256=tHsDRxEq_VfHmoiUsM-9YIPyeeRLWsStOuiVGV6XuaI,24800
75
75
  moai_adk/templates/.claude/commands/alfred/3-sync.md,sha256=NkKl98-3HUlTKLyH0g3Aev-ky251S6mqZj_4hHDBlbA,27057
76
76
  moai_adk/templates/.claude/commands/alfred/9-feedback.md,sha256=VMaKo-ZODHun87uUfiihtHGf8eT4vrEWwxXdQ9RAz3k,3764
77
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py,sha256=g2zwhOJSVRyFDGdrKRTmGcjq6qbHNmustqPZ8ew8Wr0,9222
78
- moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py,sha256=bWJ1_pS9MALQ9X41Az2JCWTvkg1N4tvq2et13lAj5qs,2733
79
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py,sha256=r3we1chcrPzHENivfvsOmD_fp6XAXu7KlfhepNi-I6c,2761
80
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py,sha256=7XUOOre2D6KMt9_qLYpBck0H0FI62uPhCRHlFsAMZxQ,3207
81
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py,sha256=n1tDFdsDupcgGkjowewrhpnU-BE-LMcpHfBGDZkOm4E,2708
82
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py,sha256=qS7ivLFB1AwNn5TvH1J7NEqDyiA3RFrCOiDFlwcXQog,2730
83
- moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py,sha256=-WcMB1NgpZZ_rbL8mWKDRijqjYgzEKz9f28GaupzMys,2685
84
- moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py,sha256=l1FebPbicNhhBFI6REEw4fXjsshWxVtto7pqNILk7SQ,2780
85
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py,sha256=7I6BSKoTRThE1ps5cbIqIpvVX5w9IxjxZ4uvv7zHXas,3409
86
- moai_adk/templates/.claude/hooks/alfred/core/project.py,sha256=_TBtWe0tlyq-B5HZuc5Nnc13KuBHSjhb62vjjCzzb40,27040
77
+ moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py,sha256=yP1jtT8CI6WE-Ul5xTfiG4TaGDZl-qVxTr8iar790Sc,9225
78
+ moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py,sha256=Kwm433O4lOvIGJ405YkDJO_uRmG8hmgx1c60JCfM3vU,2736
79
+ moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py,sha256=Wq3Z71J17w8Gz2Xpf-wb-fexEtRBpHn26dh3XppHcB4,2762
80
+ moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py,sha256=UKhKu4uyCXdePoy6JxaeTmgvMK3hnYZ54wJTvwxN0Qk,3209
81
+ moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py,sha256=HsvxsepYN-cMb5eGoNGYwejZolMFccjXQvytHOCHvhw,2711
82
+ moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py,sha256=SVOc8PCDnk_2pHGhoEe0pC-oV67L_tLpkoc84BLqTcE,2737
83
+ moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py,sha256=2cXJTduBxmzY2CiElWvshjEp098mT9pIK2HTKL5ITxk,2687
84
+ moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py,sha256=UV53G1yq7wxMG19-IjLP8LLS6TUQrLsxMGsLeXOoHpo,2786
85
+ moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py,sha256=5v63DcDSxbLdpp03_7_4zUYZ5pfXMGW4MQ5b-svyF7k,3410
86
+ moai_adk/templates/.claude/hooks/alfred/core/project.py,sha256=AqHVZzSStJEpalxxhDhnh_KnJWhHO1o7ZlXhlyN7NT4,26954
87
87
  moai_adk/templates/.claude/hooks/alfred/core/timeout.py,sha256=rIvdz6cLhLeDmZeb90PgslKOlLFRh8_jD_0Ck5ZYKdQ,4046
88
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py,sha256=4xMGGdrvVJSigrpcL71k6twVWn1nefZWzfl_Su9tgcM,3411
88
+ moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py,sha256=uPyHn7GPVIY1XwB2rYFrkjFhoXS4SE9_wF5U40tvYfQ,3410
89
89
  moai_adk/templates/.claude/hooks/alfred/core/version_cache.py,sha256=zUStwuF4n2NY4hDyu0IXcEl1eDAauVScCZGCz9kGoNY,5967
90
90
  moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py,sha256=zr1PEfYRlTYA7GWUPgTP-USSGYh4pGyPiDUkjcltJ7A,6379
91
91
  moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py,sha256=dsvFDSXQNSQlaQLpvhqFbytGOrOivyovi43Y18EmNeI,8483
@@ -94,7 +94,7 @@ moai_adk/templates/.claude/hooks/alfred/shared/core/project.py,sha256=3mGIeFea_3
94
94
  moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py,sha256=l5JexIG4qXu32f2VCpQ1tTJVsbbsLVvP_unEj8o9vAs,6721
95
95
  moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py,sha256=KKsndAwJpHx5Jo1Xbv0-BB3qENjbPgFgDHsV7VWhhjY,5965
96
96
  moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py,sha256=j5L7nayKt7tnFQOZuO5sWiie815vmbmYJOn2VRiidLY,569
97
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py,sha256=1dmVJBsKXCeRer2Hd59enj1COKjElU-x_Kgxyxfea8s,4919
97
+ moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py,sha256=SFWpOOHRH3dA9SJgburGNm4-lUvjWQ43taSrlGw-6v4,4822
98
98
  moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py,sha256=ynM2y21NG3l4bZeUuhZJJ2qQ5YCL35Iv7R3P3zCbNt0,7183
99
99
  moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py,sha256=B5lRqbOb50QugN5LPAMrLy-hqqltC8EbfVUruwUG7DQ,3339
100
100
  moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py,sha256=okgzK5qwGjl_i2O4IWoH-7GaxQ2Q_kutjhnVnk0eDzE,2107
@@ -305,10 +305,8 @@ moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md,sha256=37Qj5DYcyUniLM1g8I
305
305
  moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md,sha256=Tf3q68X1DiA3MkIBYu7AMXoeparYrDRpyqVI5Nw92OY,12653
306
306
  moai_adk/templates/.moai/memory/CLAUDE-RULES.md,sha256=S9GODGRzwwleOmROVtBDa471Ok5NyQLWIkaO_4peHhU,19783
307
307
  moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md,sha256=SAcue1J5-DEJpygDnTgp_ex-ok2E4lbcykBuBiC7tGs,14534
308
- moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md,sha256=UABdUWcA_085dZaQk7gaW2-ze3DV-BX399kKtbF1kGI,10401
309
308
  moai_adk/templates/.moai/memory/ISSUE-LABEL-MAPPING.md,sha256=bKzC2v1ZZWyng0eHSj9oFQ9w9xCbadPe9T9IYWub7wM,3824
310
309
  moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md,sha256=uMEFi6uojnpO_MGGtwhakYQzVF2yzVV9ZzfQe5tB0Hk,7823
311
- moai_adk/templates/.moai/memory/SPEC-METADATA.md,sha256=Ha4ATMxyH2PgQdVbS1fYwVH0PnIkfqk4hfuB5ksMFFk,9702
312
310
  moai_adk/templates/.moai/memory/gitflow-protection-policy.md,sha256=UABdUWcA_085dZaQk7gaW2-ze3DV-BX399kKtbF1kGI,10401
313
311
  moai_adk/templates/.moai/memory/spec-metadata.md,sha256=Ha4ATMxyH2PgQdVbS1fYwVH0PnIkfqk4hfuB5ksMFFk,9702
314
312
  moai_adk/templates/.moai/project/product.md,sha256=IrRSqhu0o5KNfn453DUWoUKzdoO3m6013iYCwaHYCxM,5166
@@ -323,8 +321,8 @@ moai_adk/templates/workflows/typescript-tag-validation.yml,sha256=-hPbfW4ZlMp7Nz
323
321
  moai_adk/utils/__init__.py,sha256=VnVfQzzKHvKw4bNdEw5xdscnRQYFrnr-v_TOBr3naPs,225
324
322
  moai_adk/utils/banner.py,sha256=znppKd5yo-tTqgyhgPVJjstrTrfcy_v3X1_RFQxP4Fk,1878
325
323
  moai_adk/utils/logger.py,sha256=g-m07PGKjK2bKRIInfSn6m-024Bedai-pV_WjZKDeu8,5064
326
- moai_adk-0.12.1.dist-info/METADATA,sha256=U4PtelM5EGeiKaGGv4ErHcjf_xYYgd3pmOPTp8CthP8,96417
327
- moai_adk-0.12.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
328
- moai_adk-0.12.1.dist-info/entry_points.txt,sha256=P9no1794UipqH72LP-ltdyfVd_MeB1WKJY_6-JQgV3U,52
329
- moai_adk-0.12.1.dist-info/licenses/LICENSE,sha256=M1M2b07fWcSWRM6_P3wbZKndZvyfHyYk_Wu9bS8F7o8,1069
330
- moai_adk-0.12.1.dist-info/RECORD,,
324
+ moai_adk-0.13.0.dist-info/METADATA,sha256=st-VF-l9LLkgLwc8yOJXBgrOFhR4oaM7EGYigi1_ieM,96417
325
+ moai_adk-0.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
326
+ moai_adk-0.13.0.dist-info/entry_points.txt,sha256=P9no1794UipqH72LP-ltdyfVd_MeB1WKJY_6-JQgV3U,52
327
+ moai_adk-0.13.0.dist-info/licenses/LICENSE,sha256=M1M2b07fWcSWRM6_P3wbZKndZvyfHyYk_Wu9bS8F7o8,1069
328
+ moai_adk-0.13.0.dist-info/RECORD,,
@@ -1,330 +0,0 @@
1
- # GitFlow Protection Policy
2
-
3
- **Document ID**: @DOC:GITFLOW-POLICY-ALIAS
4
- **Published**: 2025-10-17
5
- **Updated**: 2025-10-29
6
- **Status**: **Enforced via GitHub Branch Protection** (v0.8.3+)
7
- **Scope**: Personal and Team modes
8
-
9
- ---
10
-
11
- ## Overview
12
-
13
- MoAI-ADK **enforces** a GitFlow-inspired workflow through GitHub Branch Protection. As of v0.8.3, the `main` branch is protected and requires Pull Requests for all changes, including from administrators.
14
-
15
- **What Changed**: Previously (v0.3.5-v0.8.2), we used an advisory approach with warnings. Now we enforce proper GitFlow to ensure code quality and prevent accidental direct pushes to main.
16
-
17
- ## Key Requirements (Enforced)
18
-
19
- ### 1. Main Branch Access (Enforced)
20
-
21
- | Requirement | Summary | Enforcement |
22
- |-------------|---------|-------------|
23
- | **Merge via develop** | MUST merge `develop` into `main` | ✅ Enforced |
24
- | **Feature branches off develop** | MUST branch from `develop` and raise PRs back to `develop` | ✅ Enforced |
25
- | **Release process** | Release flow: `develop` → `main` (PR required) | ✅ Enforced |
26
- | **Force push** | Blocked on `main` | ✅ Blocked |
27
- | **Direct push** | Blocked on `main` (PR required) | ✅ Blocked |
28
-
29
- ### 2. Git Workflow (Required)
30
-
31
- ```
32
- ┌─────────────────────────────────────────────────────────┐
33
- │ ENFORCED GITFLOW │
34
- │ (GitHub Branch Protection Active) │
35
- └─────────────────────────────────────────────────────────┘
36
-
37
- develop (required base branch)
38
- ↑ ↓
39
- ┌─────────────────┐
40
- │ │
41
- │ developer work │
42
- │ │
43
- ↓ ↑
44
- feature/SPEC-{ID} [PR: feature -> develop]
45
- [code review + approval]
46
- [Merge to develop]
47
-
48
- develop (stable)
49
-
50
- │ (release manager prepares)
51
-
52
- [PR: develop -> main]
53
- [Code review + approval REQUIRED]
54
- [All discussions resolved]
55
- [CI/CD validation]
56
- [tag creation]
57
-
58
- main (protected release)
59
- ```
60
-
61
- **Enforcement**: Direct pushes to `main` are **blocked** via GitHub Branch Protection. All changes must go through Pull Requests.
62
-
63
- ## Technical Implementation
64
-
65
- ### Pre-push Hook (Advisory Mode)
66
-
67
- **Location**: `.git/hooks/pre-push`
68
- **Purpose**: Warn on `main` branch pushes without blocking them
69
-
70
- ```bash
71
- # When attempting to push to main:
72
- ⚠️ ADVISORY: Non-standard GitFlow detected
73
-
74
- Current branch: feature/SPEC-123
75
- Target branch: main
76
-
77
- Recommended GitFlow workflow:
78
- 1. Work on feature/SPEC-{ID} branch (created from develop)
79
- 2. Push to feature/SPEC-{ID} and create PR to develop
80
- 3. Merge into develop after code review
81
- 4. When develop is stable, create PR from develop to main
82
- 5. Release manager merges develop -> main with tag
83
-
84
- ✓ Push will proceed (flexibility mode enabled)
85
- ```
86
-
87
- ### Force Push Advisory
88
-
89
- ```bash
90
- ⚠️ ADVISORY: Force-push to main branch detected
91
-
92
- Recommended approach:
93
- - Use GitHub PR with proper code review
94
- - Ensure changes are merged via fast-forward
95
-
96
- ✓ Push will proceed (flexibility mode enabled)
97
- ```
98
-
99
- ---
100
-
101
- ## Workflow Examples
102
-
103
- ### Scenario 1: Standard Feature Development (Recommended)
104
-
105
- ```bash
106
- # 1. Sync latest code from develop
107
- git checkout develop
108
- git pull origin develop
109
-
110
- # 2. Create a feature branch (from develop)
111
- git checkout -b feature/SPEC-001-new-feature
112
-
113
- # 3. Implement the change
114
- # ... write code and tests ...
115
-
116
- # 4. Commit
117
- git add .
118
- git commit -m "..."
119
-
120
- # 5. Push
121
- git push origin feature/SPEC-001-new-feature
122
-
123
- # 6. Open a PR: feature/SPEC-001-new-feature -> develop
124
-
125
- # 7. Merge into develop after review and approval
126
- ```
127
-
128
- ### Scenario 2: Fast Hotfix (Flexible)
129
-
130
- ```bash
131
- # When an urgent fix is required:
132
-
133
- # Option 1: Recommended (via develop)
134
- git checkout develop
135
- git checkout -b hotfix/critical-bug
136
- # ... apply fix ...
137
- git push origin hotfix/critical-bug
138
- # Open PRs: hotfix -> develop -> main
139
-
140
- # Option 2: Direct fix on main (allowed, not recommended)
141
- git checkout main
142
- # ... apply fix ...
143
- git commit -m "Fix critical bug"
144
- git push origin main # ⚠️ Advisory warning appears but push continues
145
- ```
146
-
147
- ### Scenario 3: Release (Standard or Flexible)
148
-
149
- ```bash
150
- # Standard approach (recommended):
151
- git checkout develop
152
- gh pr create --base main --head develop --title "Release v1.0.0"
153
-
154
- # Direct push (allowed):
155
- git checkout develop
156
- git push origin main # ⚠️ Advisory warning appears but push continues
157
- git tag -a v1.0.0 -m "Release v1.0.0"
158
- git push origin v1.0.0
159
- ```
160
-
161
- ---
162
-
163
- ## Policy Modes
164
-
165
- ### Strict Mode (Active, v0.8.3+) ✅ ENFORCED
166
-
167
- **GitHub Branch Protection Enabled**:
168
- - ✅ **enforce_admins: true** - Administrators must follow all rules
169
- - ✅ **required_pull_request_reviews** - 1 approval required
170
- - ✅ **required_conversation_resolution** - All discussions must be resolved
171
- - ✅ **Block direct pushes to `main`** - PR required for all users
172
- - ✅ **Block force pushes** - Prevents history rewriting
173
- - ✅ **Block branch deletion** - Protects main from accidental deletion
174
-
175
- **What This Means**:
176
- - ❌ No one (including admins) can push directly to `main`
177
- - ✅ All changes must go through Pull Requests
178
- - ✅ PRs require code review approval
179
- - ✅ All code discussions must be resolved before merge
180
- - ✅ Enforces proper GitFlow: feature → develop → main
181
-
182
- ### Advisory Mode (Legacy, v0.3.5 - v0.8.2)
183
-
184
- - ⚠️ Warned but allowed direct pushes to `main`
185
- - ⚠️ Warned but allowed force pushes
186
- - ⚠️ Recommended best practices while preserving flexibility
187
- - ❌ **Deprecated** - Replaced by Strict Mode for better quality control
188
-
189
- ---
190
-
191
- ## Recommended Checklist
192
-
193
- Every contributor should ensure:
194
-
195
- - [ ] `.git/hooks/pre-push` exists and is executable (755)
196
- - [ ] Feature branches fork from `develop`
197
- - [ ] Pull requests target `develop`
198
- - [ ] Releases merge `develop` → `main`
199
-
200
- **Verification Commands**:
201
- ```bash
202
- ls -la .git/hooks/pre-push
203
- git branch -vv
204
- ```
205
-
206
- ---
207
-
208
- ## FAQ
209
-
210
- **Q: Can we merge into `main` from branches other than `develop`?**
211
- A: Yes. You will see an advisory warning, but the merge proceeds. The recommended path remains `develop` → `main`.
212
-
213
- **Q: Are force pushes allowed?**
214
- A: Yes. You receive a warning, but the push succeeds. Use with caution.
215
-
216
- **Q: Can we commit/push directly to `main`?**
217
- A: Yes. Expect an advisory warning, yet the push continues.
218
-
219
- **Q: Can I disable the hook entirely?**
220
- A: Yes. Remove `.git/hooks/pre-push` or strip its execute permission.
221
-
222
- **Q: Why switch to Advisory Mode?**
223
- A: Advisory Mode was used in v0.3.5-v0.8.2. As of v0.8.3, we've switched to Strict Mode with GitHub Branch Protection for better quality control.
224
-
225
- **Q: What if develop falls behind main?**
226
- A: This can happen when hotfixes or releases go directly to main. Regularly sync main → develop to prevent divergence. See "Maintaining develop-main Sync" section below.
227
-
228
- **Q: Can I bypass branch protection in emergencies?**
229
- A: No. Even administrators must follow the PR process. For true emergencies, temporarily disable protection via GitHub Settings (requires admin access), but re-enable immediately after.
230
-
231
- ---
232
-
233
- ## Maintaining develop-main Sync
234
-
235
- ### ⚠️ Critical Rule: develop Must Stay Current
236
-
237
- **Problem**: When main receives direct commits (hotfixes, emergency releases) without syncing back to develop, GitFlow breaks:
238
-
239
- ```
240
- ❌ BAD STATE:
241
- develop: 3 commits ahead, 29 commits behind main
242
- - develop has outdated dependencies
243
- - New features branch from old code
244
- - Merge conflicts multiply over time
245
- ```
246
-
247
- ### Signs of Drift
248
-
249
- Monitor for these warnings:
250
- - `git status` shows "Your branch is X commits behind main"
251
- - Feature branches conflict with main during PR
252
- - CI/CD failures due to dependency mismatches
253
- - Version numbers in develop don't match main
254
-
255
- ### Recovery Procedure
256
-
257
- When develop falls behind main:
258
-
259
- 1. **Assess the Gap**
260
- ```bash
261
- git log --oneline develop..main # Commits in main but not develop
262
- git log --oneline main..develop # Commits in develop but not main
263
- ```
264
-
265
- 2. **Sync Strategy: Merge main into develop (Recommended)**
266
- ```bash
267
- git checkout develop
268
- git pull origin develop # Get latest develop
269
- git merge main # Merge main into develop
270
- # Resolve conflicts if any (prefer main for version/config files)
271
- git push origin develop
272
- ```
273
-
274
- 3. **Emergency Only: Reset develop to main (Destructive)**
275
- ```bash
276
- # ⚠️ ONLY if develop's unique commits are unwanted
277
- git checkout develop
278
- git reset --hard main
279
- git push origin develop --force
280
- ```
281
-
282
- ### Prevention: Regular Sync Schedule
283
-
284
- **After every main release** (REQUIRED):
285
- ```bash
286
- # Immediately after merging develop → main:
287
- git checkout develop
288
- git merge main
289
- git push origin develop
290
- ```
291
-
292
- **Weekly maintenance** (for active projects):
293
- ```bash
294
- # Every Monday morning:
295
- git checkout develop
296
- git pull origin main
297
- git push origin develop
298
- ```
299
-
300
- ### Real-World Case Study (2025-10-29)
301
-
302
- **Situation**: develop was 29 commits behind main due to:
303
- - v0.8.2, v0.8.3 released directly to main
304
- - No reverse sync to develop
305
- - Feature branches contained outdated code
306
-
307
- **Resolution**:
308
- - Merged main → develop (14 file conflicts)
309
- - Resolved conflicts prioritizing main's versions
310
- - TAG validation bypassed for merge commit
311
- - Enabled Strict Mode to prevent future direct pushes
312
-
313
- **Lesson**: With Strict Mode active, this won't happen again. All releases must go through develop → main PR flow.
314
-
315
- ---
316
-
317
- ## Policy Change Log
318
-
319
- | Date | Change | Owner |
320
- |------|------|--------|
321
- | 2025-10-17 | Initial policy drafted (Strict Mode) | git-manager |
322
- | 2025-10-17 | Switched to Advisory Mode (warnings only) | git-manager |
323
- | 2025-10-29 | **Enabled GitHub Branch Protection (Strict Mode)** | Alfred |
324
- | 2025-10-29 | Added develop-main sync guidelines and real-world case study | Alfred |
325
- | 2025-10-29 | Enforced `enforce_admins`, `required_conversation_resolution` | Alfred |
326
-
327
- ---
328
-
329
- **This policy is advisory—adapt it to fit your project needs.**
330
- **Reach out to the team lead or release engineer for questions or suggestions.**
@@ -1,356 +0,0 @@
1
- # SPEC Metadata Structure Guide
2
-
3
- > **MoAI-ADK SPEC Metadata Standard**
4
- >
5
- > Every SPEC document must follow this structure.
6
-
7
- ---
8
-
9
- ## 📋 Metadata Overview
10
-
11
- SPEC metadata contains **7 required fields** and **9 optional fields**.
12
-
13
- ### Full Example
14
-
15
- ```yaml
16
- ---
17
- # Required Fields (7)
18
- id: AUTH-001 # Unique SPEC ID
19
- version: 0.0.1 # Semantic version (v0.0.1 = INITIAL, draft start)
20
- status: draft # draft|active|completed|deprecated
21
- created: 2025-09-15 # Creation date (YYYY-MM-DD)
22
- updated: 2025-09-15 # Last updated (YYYY-MM-DD; initially same as created)
23
- author: @Goos # Author (single GitHub handle)
24
- priority: high # low|medium|high|critical
25
-
26
- # Optional Fields – Classification/Meta
27
- category: security # feature|bugfix|refactor|security|docs|perf
28
- labels: # Tags for search and grouping
29
- - authentication
30
- - jwt
31
-
32
- # Optional Fields – Relationships (Dependency Graph)
33
- depends_on: # SPECs this one depends on (optional)
34
- - USER-001
35
- blocks: # SPECs blocked by this one (optional)
36
- - AUTH-002
37
- related_specs: # Related SPECs (optional)
38
- - TOKEN-002
39
- related_issue: "https://github.com/modu-ai/moai-adk/issues/123"
40
-
41
- # Optional Fields – Scope/Impact
42
- scope:
43
- packages: # Impacted packages
44
- - src/core/auth
45
- files: # Key files (optional)
46
- - auth-service.ts
47
- - jwt-manager.ts
48
- ---
49
- ```
50
-
51
- ---
52
-
53
- ## Required Fields
54
-
55
- ### 1. `id` – Unique SPEC Identifier
56
- - **Type**: string
57
- - **Format**: `<DOMAIN>-<NUMBER>`
58
- - **Examples**: `AUTH-001`, `INSTALLER-SEC-001`
59
- - **Rules**:
60
- - Immutable once assigned
61
- - Use three digits (001–999)
62
- - Domain in uppercase; hyphens allowed
63
- - Directory name: `.moai/specs/SPEC-{ID}/` (e.g., `.moai/specs/SPEC-AUTH-001/`)
64
-
65
- ### 2. `version` – Semantic Version
66
- - **Type**: string (`MAJOR.MINOR.PATCH`)
67
- - **Default**: `0.0.1` (all SPECs start here, status: draft)
68
- - **Version Lifecycle**:
69
- - **v0.0.1**: INITIAL – SPEC first draft (status: draft)
70
- - **v0.0.x**: Draft refinements (increment PATCH when editing the SPEC)
71
- - **v0.1.0**: TDD implementation complete (status: completed, updated via `/alfred:3-sync`)
72
- - **v0.1.x**: Bug fixes or doc improvements (PATCH increment)
73
- - **v0.x.0**: Feature additions or major enhancements (MINOR increment)
74
- - **v1.0.0**: Stable release (production ready, explicit stakeholder approval required)
75
-
76
- ### 3. `status` – Progress State
77
- - **Type**: enum
78
- - **Values**:
79
- - `draft`: Authoring in progress
80
- - `active`: Implementation underway
81
- - `completed`: Implementation finished
82
- - `deprecated`: Planned for retirement
83
-
84
- ### 4. `created` – Creation Date
85
- - **Type**: date string
86
- - **Format**: `YYYY-MM-DD`
87
- - **Example**: `2025-10-06`
88
-
89
- ### 5. `updated` – Last Modified Date
90
- - **Type**: date string
91
- - **Format**: `YYYY-MM-DD`
92
- - **Rule**: Update whenever the SPEC content changes.
93
-
94
- ### 6. `author` – Primary Author
95
- - **Type**: string
96
- - **Format**: `@{GitHub ID}`
97
- - **Example**: `@Goos`
98
- - **Rules**:
99
- - Single value only (no `authors` array)
100
- - Prefix the GitHub handle with `@`
101
- - Additional contributors belong in the HISTORY section
102
-
103
- ### 7. `priority` – Work Priority
104
- - **Type**: enum
105
- - **Values**:
106
- - `critical`: Immediate attention (security, severe defects)
107
- - `high`: Major feature work
108
- - `medium`: Enhancements
109
- - `low`: Optimizations or documentation
110
-
111
- ---
112
-
113
- ## Optional Fields
114
-
115
- ### Classification / Meta
116
-
117
- #### 8. `category` – Change Type
118
- - **Type**: enum
119
- - **Values**:
120
- - `feature`: New functionality
121
- - `bugfix`: Defect resolution
122
- - `refactor`: Structural improvements
123
- - `security`: Security enhancements
124
- - `docs`: Documentation updates
125
- - `perf`: Performance optimizations
126
-
127
- #### 9. `labels` – Classification Tags
128
- - **Type**: array of strings
129
- - **Purpose**: Search, filtering, grouping
130
- - **Example**:
131
- ```yaml
132
- labels:
133
- - installer
134
- - template
135
- - security
136
- ```
137
-
138
- ### Relationship Fields (Dependency Graph)
139
-
140
- #### 10. `depends_on` – Required SPECs
141
- - **Type**: array of strings
142
- - **Meaning**: SPECs that must be completed first
143
- - **Example**:
144
- ```yaml
145
- depends_on:
146
- - USER-001
147
- - AUTH-001
148
- ```
149
- - **Use Case**: Determines execution order and parallelization.
150
-
151
- #### 11. `blocks` – Blocked SPECs
152
- - **Type**: array of strings
153
- - **Meaning**: SPECs that cannot proceed until this one is resolved
154
- - **Example**:
155
- ```yaml
156
- blocks:
157
- - PAYMENT-003
158
- ```
159
-
160
- #### 12. `related_specs` – Associated SPECs
161
- - **Type**: array of strings
162
- - **Meaning**: Related items without direct dependencies
163
- - **Example**:
164
- ```yaml
165
- related_specs:
166
- - TOKEN-002
167
- - SESSION-001
168
- ```
169
-
170
- #### 13. `related_issue` – Linked GitHub Issue
171
- - **Type**: string (URL)
172
- - **Format**: Full GitHub issue URL
173
- - **Example**:
174
- ```yaml
175
- related_issue: "https://github.com/modu-ai/moai-adk/issues/123"
176
- ```
177
-
178
- ### Scope Fields (Impact Analysis)
179
-
180
- #### 14. `scope.packages` – Impacted Packages
181
- - **Type**: array of strings
182
- - **Meaning**: Packages or modules touched by the SPEC
183
- - **Example**:
184
- ```yaml
185
- scope:
186
- packages:
187
- - moai-adk-ts/src/core/installer
188
- - moai-adk-ts/src/core/git
189
- ```
190
-
191
- #### 15. `scope.files` – Key Files
192
- - **Type**: array of strings
193
- - **Meaning**: Primary files involved (for reference)
194
- - **Example**:
195
- ```yaml
196
- scope:
197
- files:
198
- - template-processor.ts
199
- - template-security.ts
200
- ```
201
-
202
- ---
203
-
204
- ## Metadata Validation
205
-
206
- ### Required Field Checks
207
- ```bash
208
- # Verify that every SPEC includes the required fields
209
- rg "^(id|version|status|created|updated|author|priority):" .moai/specs/SPEC-*/spec.md
210
-
211
- # Identify SPECs missing the priority field
212
- rg -L "^priority:" .moai/specs/SPEC-*/spec.md
213
- ```
214
-
215
- ### Format Checks
216
- ```bash
217
- # Ensure the author field uses @Handle format
218
- rg "^author: @[A-Z]" .moai/specs/SPEC-*/spec.md
219
-
220
- # Ensure the version field follows 0.x.y
221
- rg "^version: 0\.\d+\.\d+" .moai/specs/SPEC-*/spec.md
222
- ```
223
-
224
- ---
225
-
226
- ## Migration Guide
227
-
228
- ### Updating Existing SPECs
229
-
230
- #### 1. Add the `priority` Field
231
- Add it if missing:
232
- ```yaml
233
- priority: medium # or low|high|critical
234
- ```
235
-
236
- #### 2. Normalize the `author` Field
237
- - `authors: ["@goos"]` → `author: @Goos`
238
- - Convert lowercase handles to the canonical casing.
239
-
240
- #### 3. Add Optional Fields (Recommended)
241
- ```yaml
242
- category: refactor
243
- labels:
244
- - code-quality
245
- - maintenance
246
- ```
247
-
248
- ### Updating config.json for Language Support (v0.4.2+)
249
-
250
- **Background**: MoAI-ADK v0.4.2 introduces conversation language selection in `/alfred:0-project`. Existing projects need to add language metadata to `.moai/config.json`.
251
-
252
- #### Migration Steps
253
-
254
- **For Existing Projects** (before v0.4.2):
255
-
256
- Current config.json structure:
257
- ```json
258
- {
259
- "project": {
260
- "locale": "en",
261
- "mode": "personal",
262
- "language": "python"
263
- }
264
- }
265
- ```
266
-
267
- **Updated Structure** (v0.4.2+):
268
- ```json
269
- {
270
- "project": {
271
- "locale": "en",
272
- "mode": "personal",
273
- "language": "python",
274
- "conversation_language": "en",
275
- "conversation_language_name": "English",
276
- "codebase_languages": ["python"]
277
- }
278
- }
279
- ```
280
-
281
- #### New Fields
282
-
283
- | Field | Type | Required | Description | Example |
284
- |-------|------|----------|-------------|---------|
285
- | `conversation_language` | string (ISO 639-1 code) | ✅ Yes | Two-letter language code for Alfred dialogs | `"ko"`, `"en"`, `"ja"`, `"zh"` |
286
- | `conversation_language_name` | string | ✅ Yes | Display name of conversation language | `"Korean"`, `"English"` |
287
- | `codebase_languages` | array of strings | ✅ Yes | List of programming languages detected | `["python"]`, `["typescript", "python"]` |
288
-
289
- #### Manual Update Process
290
-
291
- 1. Open `.moai/config.json`
292
- 2. Add the three new fields under `project`:
293
- ```json
294
- "conversation_language": "en",
295
- "conversation_language_name": "English",
296
- "codebase_languages": ["python"]
297
- ```
298
- 3. Save and commit:
299
- ```bash
300
- git add .moai/config.json
301
- git commit -m "chore: add language metadata to config.json for v0.4.2+"
302
- ```
303
-
304
- #### Automated Update (via `/alfred:0-project`)
305
-
306
- Running `/alfred:0-project` on an existing project will:
307
- 1. Detect current language settings
308
- 2. Add new fields automatically
309
- 3. Preserve existing values
310
-
311
- **No manual action required if running `/alfred:0-project` after upgrade.**
312
-
313
- #### Field Mapping (Legacy → New)
314
-
315
- | Old Field | New Field | Migration Rule |
316
- |-----------|-----------|-----------------|
317
- | `locale` | `conversation_language` | Keep as-is (or run `/alfred:0-project` to re-select) |
318
- | (none) | `conversation_language_name` | Auto-populate from locale mapping |
319
- | `language` | `codebase_languages` | Wrap in array: `"python"` → `["python"]` |
320
-
321
- #### Backward Compatibility
322
-
323
- - ✅ Projects without new fields will continue working
324
- - ⚠️ New language features (multilingual documentation) unavailable without migration
325
- - ✅ `/alfred:0-project` automatically migrates on next run
326
- - ✅ Auto-detection will prefer new fields if present
327
-
328
- ---
329
-
330
- ## Design Principles
331
-
332
- ### 1. DRY (Don't Repeat Yourself)
333
- - ❌ **Remove**: the `reference` field (every SPEC referenced the same master plan)
334
- - ✅ **Instead**: document project-level resources in README.md
335
-
336
- ### 2. Context-Aware
337
- - Include only the necessary context.
338
- - Use optional fields only when they add value.
339
-
340
- ### 3. Traceable
341
- - Use `depends_on`, `blocks`, and `related_specs` to map dependencies.
342
- - Automated tooling can detect cyclic references.
343
-
344
- ### 4. Maintainable
345
- - Every field must be machine-verifiable.
346
- - Maintain consistent formatting for easy parsing.
347
-
348
- ### 5. Simple First
349
- - Keep complexity low.
350
- - Limit to 7 required + 9 optional fields.
351
- - Expand gradually when justified.
352
-
353
- ---
354
-
355
- **Last Updated**: 2025-10-06
356
- **Author**: @Alfred