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

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

Potentially problematic release.


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

Files changed (125) hide show
  1. moai_adk/__init__.py +1 -8
  2. moai_adk/cli/commands/init.py +10 -5
  3. moai_adk/cli/commands/update.py +274 -118
  4. moai_adk/cli/prompts/init_prompts.py +14 -18
  5. moai_adk/core/diagnostics/slash_commands.py +1 -1
  6. moai_adk/core/project/backup_utils.py +1 -0
  7. moai_adk/core/project/phase_executor.py +3 -1
  8. moai_adk/core/project/validator.py +3 -2
  9. moai_adk/core/template/backup.py +11 -3
  10. moai_adk/core/template/merger.py +16 -3
  11. moai_adk/core/template/processor.py +22 -3
  12. moai_adk/templates/.claude/agents/alfred/cc-manager.md +443 -424
  13. moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
  14. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
  15. moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
  16. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
  17. moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
  18. moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
  19. moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
  20. moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
  21. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
  22. moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
  23. moai_adk/templates/.claude/commands/alfred/0-project.md +673 -640
  24. moai_adk/templates/.claude/commands/alfred/1-plan.md +342 -333
  25. moai_adk/templates/.claude/commands/alfred/2-run.md +295 -285
  26. moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
  27. moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
  28. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
  29. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
  30. moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
  31. moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
  32. moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
  33. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
  34. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
  35. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +27 -27
  36. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
  37. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
  38. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
  39. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
  40. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
  41. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
  42. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
  43. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
  44. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
  45. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
  46. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
  47. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
  48. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
  49. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
  50. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
  51. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
  52. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
  53. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +70 -43
  54. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +141 -141
  55. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +179 -165
  56. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +78 -78
  57. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +90 -90
  58. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +39 -25
  59. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +117 -74
  60. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +131 -134
  61. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +43 -12
  62. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +43 -12
  63. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +43 -12
  64. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +43 -12
  65. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +43 -12
  66. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +43 -12
  67. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +43 -11
  68. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +43 -12
  69. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +43 -12
  70. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +43 -12
  71. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +47 -11
  72. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +47 -11
  73. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +51 -14
  74. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +46 -10
  75. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +62 -25
  76. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +44 -17
  77. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +44 -14
  78. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +45 -13
  79. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +46 -14
  80. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +48 -8
  81. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +44 -12
  82. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +44 -12
  83. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +44 -11
  84. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +44 -11
  85. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +44 -12
  86. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +44 -11
  87. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +44 -11
  88. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +44 -11
  89. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +44 -12
  90. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +44 -12
  91. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +44 -12
  92. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +44 -12
  93. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +44 -11
  94. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +44 -11
  95. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +44 -12
  96. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +44 -11
  97. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +44 -11
  98. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +44 -12
  99. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +44 -12
  100. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +44 -11
  101. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +44 -12
  102. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +44 -12
  103. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +44 -12
  104. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
  105. moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
  106. moai_adk/templates/.moai/config.json +9 -6
  107. moai_adk/templates/.moai/memory/development-guide.md +220 -221
  108. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
  109. moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
  110. moai_adk/templates/.moai/project/product.md +90 -90
  111. moai_adk/templates/.moai/project/structure.md +85 -85
  112. moai_adk/templates/.moai/project/tech.md +117 -117
  113. moai_adk/templates/CLAUDE.md +350 -722
  114. moai_adk-0.4.1.dist-info/METADATA +303 -0
  115. moai_adk-0.4.1.dist-info/RECORD +152 -0
  116. moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -31
  117. moai_adk/templates/.claude/commands/alfred/2-build.md +0 -30
  118. moai_adk/templates/.claude/skills/scripts/standardize_skills.py +0 -166
  119. moai_adk/templates/.claude/skills/scripts/verify_standardization.sh +0 -43
  120. moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
  121. moai_adk-0.4.0.dist-info/METADATA +0 -1816
  122. moai_adk-0.4.0.dist-info/RECORD +0 -145
  123. {moai_adk-0.4.0.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
  124. {moai_adk-0.4.0.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
  125. {moai_adk-0.4.0.dist-info → moai_adk-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  """Event-Driven Checkpoint system
3
3
 
4
- 위험한 작업 감지 자동 Checkpoint 생성
4
+ Detect risky tasks and create automatic checkpoints
5
5
  @TAG:CHECKPOINT-EVENT-001
6
6
  """
7
7
 
@@ -12,7 +12,7 @@ from datetime import datetime
12
12
  from pathlib import Path
13
13
  from typing import Any
14
14
 
15
- # MoAI-ADK 지원 언어별 스크립트 실행 패턴
15
+ # Script execution pattern for each language supported by MoAI-ADK
16
16
  # Python, TypeScript, Java, Go, Rust, Dart, Swift, Kotlin + Shell
17
17
  SCRIPT_EXECUTION_PATTERN = re.compile(
18
18
  r"\b("
@@ -39,25 +39,25 @@ SCRIPT_EXECUTION_PATTERN = re.compile(
39
39
 
40
40
 
41
41
  def detect_risky_operation(tool_name: str, tool_args: dict[str, Any], cwd: str) -> tuple[bool, str]:
42
- """위험한 작업 감지 (Event-Driven Checkpoint)
42
+ """Risk task detection (for Event-Driven Checkpoint)
43
43
 
44
- Claude Code tool 사용 위험한 작업을 자동으로 감지합니다.
45
- 위험 감지 자동으로 checkpoint 생성하여 롤백 가능하게 합니다.
44
+ Claude Code tool automatically detects dangerous tasks before use.
45
+ When a risk is detected, a checkpoint is automatically created to enable rollback.
46
46
 
47
47
  Args:
48
- tool_name: Claude Code tool 이름 (Bash, Edit, Write, MultiEdit)
49
- tool_args: Tool 인자 딕셔너리
50
- cwd: 프로젝트 루트 디렉토리 경로
48
+ tool_name: Name of the Claude Code tool (Bash, Edit, Write, MultiEdit)
49
+ tool_args: Tool argument dictionary
50
+ cwd: Project root directory path
51
51
 
52
52
  Returns:
53
- (is_risky, operation_type) 튜플
54
- - is_risky: 위험한 작업 여부 (bool)
55
- - operation_type: 작업 유형 (str: delete, merge, script, critical-file, refactor)
53
+ (is_risky, operation_type) tuple
54
+ - is_risky: Whether the operation is dangerous (bool)
55
+ - operation_type: operation type (str: delete, merge, script, critical-file, refactor)
56
56
 
57
57
  Risky Operations:
58
58
  - Bash tool: rm -rf, git merge, git reset --hard, git rebase, script execution
59
59
  - Edit/Write tool: CLAUDE.md, config.json, .moai/memory/*.md
60
- - MultiEdit tool: ≥10 파일 동시 수정
60
+ - MultiEdit tool: Edit ≥10 items File simultaneously
61
61
  - Script execution: Python, Node, Java, Go, Rust, Dart, Swift, Kotlin, Shell scripts
62
62
 
63
63
  Examples:
@@ -69,29 +69,29 @@ def detect_risky_operation(tool_name: str, tool_args: dict[str, Any], cwd: str)
69
69
  (False, '')
70
70
 
71
71
  Notes:
72
- - False Positive 최소화: 안전한 작업은 무시
73
- - 성능: 가벼운 문자열 매칭 (< 1ms)
74
- - 확장성: patterns 딕셔너리로 쉽게 추가 가능
72
+ - Minimize false positives: ignore safe operations
73
+ - Performance: lightweight string matching (< 1ms)
74
+ - Extensibility: Easily added to the patterns dictionary
75
75
 
76
76
  @TAG:CHECKPOINT-EVENT-001
77
77
  """
78
- # Bash tool: 위험한 명령어 감지
78
+ # Bash tool: Detect dangerous commands
79
79
  if tool_name == "Bash":
80
80
  command = tool_args.get("command", "")
81
81
 
82
- # 대규모 삭제
82
+ # Mass Delete
83
83
  if any(pattern in command for pattern in ["rm -rf", "git rm"]):
84
84
  return (True, "delete")
85
85
 
86
- # Git 병합/리셋/리베이스
86
+ # Git merge/reset/rebase
87
87
  if any(pattern in command for pattern in ["git merge", "git reset --hard", "git rebase"]):
88
88
  return (True, "merge")
89
89
 
90
- # 외부 스크립트 실행 (파괴적 가능성)
90
+ # Execute external script (potentially destructive)
91
91
  if any(command.startswith(prefix) for prefix in ["python ", "node ", "bash ", "sh "]):
92
92
  return (True, "script")
93
93
 
94
- # Edit/Write tool: 중요 파일 감지
94
+ # Edit/Write tool: Detect important files
95
95
  if tool_name in ("Edit", "Write"):
96
96
  file_path = tool_args.get("file_path", "")
97
97
 
@@ -106,7 +106,7 @@ def detect_risky_operation(tool_name: str, tool_args: dict[str, Any], cwd: str)
106
106
  if any(cf in file_path for cf in critical_files):
107
107
  return (True, "critical-file")
108
108
 
109
- # MultiEdit tool: 대규모 수정 감지
109
+ # MultiEdit tool: Detect large edits
110
110
  if tool_name == "MultiEdit":
111
111
  edits = tool_args.get("edits", [])
112
112
  if len(edits) >= 10:
@@ -116,32 +116,32 @@ def detect_risky_operation(tool_name: str, tool_args: dict[str, Any], cwd: str)
116
116
 
117
117
 
118
118
  def create_checkpoint(cwd: str, operation_type: str) -> str:
119
- """Checkpoint 생성 (Git local branch)
119
+ """Create checkpoint (Git local branch)
120
120
 
121
- 위험한 작업 자동으로 checkpoint를 생성합니다.
122
- Git local branch로 생성하여 원격 저장소 오염을 방지합니다.
121
+ Automatically creates checkpoints before dangerous operations.
122
+ Prevent remote repository contamination by creating a Git local branch.
123
123
 
124
124
  Args:
125
- cwd: 프로젝트 루트 디렉토리 경로
126
- operation_type: 작업 유형 (delete, merge, script )
125
+ cwd: Project root directory path
126
+ operation_type: operation type (delete, merge, script, etc.)
127
127
 
128
128
  Returns:
129
- checkpoint_branch: 생성된 브랜치명
130
- 실패 "checkpoint-failed" 반환
129
+ checkpoint_branch: Created branch name
130
+ Returns "checkpoint-failed" on failure
131
131
 
132
132
  Branch Naming:
133
133
  before-{operation}-{YYYYMMDD-HHMMSS}
134
- 예: before-delete-20251015-143000
134
+ Example: before-delete-20251015-143000
135
135
 
136
136
  Examples:
137
137
  >>> create_checkpoint(".", "delete")
138
138
  'before-delete-20251015-143000'
139
139
 
140
140
  Notes:
141
- - Local branch 생성 (원격 push 안 함)
142
- - Git 오류 fallback (무시하고 계속 진행)
143
- - Dirty working directory 체크 (커밋 된 변경사항 허용)
144
- - Checkpoint 로그 자동 기록 (.moai/checkpoints.log)
141
+ - Create only local branch (no remote push)
142
+ - Fallback in case of Git error (ignore and continue)
143
+ - Do not check dirty working directory (allow uncommitted changes)
144
+ - Automatically record checkpoint logs (.moai/checkpoints.log)
145
145
 
146
146
  @TAG:CHECKPOINT-EVENT-001
147
147
  """
@@ -149,8 +149,8 @@ def create_checkpoint(cwd: str, operation_type: str) -> str:
149
149
  branch_name = f"before-{operation_type}-{timestamp}"
150
150
 
151
151
  try:
152
- # 현재 브랜치에서 local branch 생성 (체크아웃 )
153
- result = subprocess.run(
152
+ # Create a new local branch from the current branch (without checking out)
153
+ subprocess.run(
154
154
  ["git", "branch", branch_name],
155
155
  cwd=cwd,
156
156
  check=True,
@@ -159,38 +159,38 @@ def create_checkpoint(cwd: str, operation_type: str) -> str:
159
159
  timeout=2,
160
160
  )
161
161
 
162
- # Checkpoint 로그 기록
162
+ # Checkpoint log records
163
163
  log_checkpoint(cwd, branch_name, operation_type)
164
164
 
165
165
  return branch_name
166
166
 
167
167
  except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError):
168
- # Git 오류 fallback (무시)
168
+ # Fallback (ignore) in case of Git error
169
169
  return "checkpoint-failed"
170
170
 
171
171
 
172
172
  def log_checkpoint(cwd: str, branch_name: str, operation_type: str) -> None:
173
- """Checkpoint 로그 기록 (.moai/checkpoints.log)
173
+ """Checkpoint log records (.moai/checkpoints.log)
174
174
 
175
- Checkpoint 생성 이력을 JSON Lines 형식으로 기록합니다.
176
- SessionStart에서 로그를 읽어 checkpoint 목록을 표시합니다.
175
+ Checkpoint creation history is recorded in JSON Lines format.
176
+ SessionStart reads this log to display a list of checkpoints.
177
177
 
178
178
  Args:
179
- cwd: 프로젝트 루트 디렉토리 경로
180
- branch_name: 생성된 checkpoint 브랜치명
181
- operation_type: 작업 유형
179
+ cwd: Project root directory path
180
+ branch_name: Created checkpoint branch name
181
+ operation_type: operation type
182
182
 
183
183
  Log Format (JSON Lines):
184
184
  {"timestamp": "2025-10-15T14:30:00", "branch": "before-delete-...", "operation": "delete"}
185
185
 
186
186
  Examples:
187
187
  >>> log_checkpoint(".", "before-delete-20251015-143000", "delete")
188
- # .moai/checkpoints.log에 1줄 추가
188
+ # Add 1 line to .moai/checkpoints.log
189
189
 
190
190
  Notes:
191
- - 파일 없으면 자동 생성
192
- - append 모드로 기록 (기존 로그 보존)
193
- - 실패 무시 (critical하지 않음)
191
+ - If the file does not exist, it is automatically created.
192
+ - Record in append mode (preserve existing logs)
193
+ - Ignored in case of failure (not critical)
194
194
 
195
195
  @TAG:CHECKPOINT-EVENT-001
196
196
  """
@@ -209,22 +209,22 @@ def log_checkpoint(cwd: str, branch_name: str, operation_type: str) -> None:
209
209
  f.write(json.dumps(log_entry) + "\n")
210
210
 
211
211
  except (OSError, PermissionError):
212
- # 로그 실패는 무시 (critical하지 않음)
212
+ # Ignore log failures (not critical)
213
213
  pass
214
214
 
215
215
 
216
216
  def list_checkpoints(cwd: str, max_count: int = 10) -> list[dict[str, str]]:
217
- """Checkpoint 목록 조회 (.moai/checkpoints.log 파싱)
217
+ """Checkpoint list (parsing .moai/checkpoints.log)
218
218
 
219
- 최근 생성된 checkpoint 목록을 반환합니다.
220
- SessionStart, /alfred:0-project restore 커맨드에서 사용합니다.
219
+ Returns a list of recently created checkpoints.
220
+ Used in the SessionStart, /alfred:0-project restore command.
221
221
 
222
222
  Args:
223
- cwd: 프로젝트 루트 디렉토리 경로
224
- max_count: 반환할 최대 개수 (기본 10)
223
+ cwd: Project root directory path
224
+ max_count: Maximum number to return (default 10 items)
225
225
 
226
226
  Returns:
227
- Checkpoint 목록 (최신순)
227
+ Checkpoint list (most recent)
228
228
  [{"timestamp": "...", "branch": "...", "operation": "..."}, ...]
229
229
 
230
230
  Examples:
@@ -235,9 +235,9 @@ def list_checkpoints(cwd: str, max_count: int = 10) -> list[dict[str, str]]:
235
235
  ]
236
236
 
237
237
  Notes:
238
- - 로그 파일 없으면 리스트 반환
239
- - JSON 파싱 실패한 줄은 무시
240
- - 최신 max_count개만 반환
238
+ - If there is no log file, an empty list is returned.
239
+ - Ignore lines where JSON parsing fails
240
+ - Return only the latest max_count
241
241
 
242
242
  @TAG:CHECKPOINT-EVENT-001
243
243
  """
@@ -254,12 +254,12 @@ def list_checkpoints(cwd: str, max_count: int = 10) -> list[dict[str, str]]:
254
254
  try:
255
255
  checkpoints.append(json.loads(line.strip()))
256
256
  except json.JSONDecodeError:
257
- # 파싱 실패한 무시
257
+ # Ignore lines where parsing failed
258
258
  pass
259
259
  except (OSError, PermissionError):
260
260
  return []
261
261
 
262
- # 최근 max_count개만 반환 (최신순)
262
+ # Return only the most recent max_count items (in order of latest)
263
263
  return checkpoints[-max_count:]
264
264
 
265
265
 
@@ -8,26 +8,26 @@ from pathlib import Path
8
8
 
9
9
 
10
10
  def get_jit_context(prompt: str, cwd: str) -> list[str]:
11
- """프롬프트 기반 JIT Context Retrieval
11
+ """JIT Context Retrieval based on prompt.
12
12
 
13
- 사용자 프롬프트를 분석하여 관련 문서를 자동으로 추천합니다.
14
- Alfred 커맨드, 키워드 기반 패턴 매칭으로 필요한 문서만 로드합니다.
13
+ Analyze user prompts and automatically recommend relevant documents.
14
+ Alfred commands and keyword-based pattern matching load only the documents you need.
15
15
 
16
16
  Args:
17
- prompt: 사용자 입력 프롬프트 (대소문자 무관)
18
- cwd: 프로젝트 루트 디렉토리 경로
17
+ prompt: Prompt for user input (case is irrelevant)
18
+ cwd: Project root directory path
19
19
 
20
20
  Returns:
21
- 추천 문서 경로 리스트 (상대 경로).
22
- 매칭되는 패턴이 없거나 파일이 없으면 리스트 []
21
+ List of recommended document paths (relative paths).
22
+ If there is no matching pattern or file, an empty list []
23
23
 
24
24
  Patterns:
25
- - "/alfred:1-spec" → .moai/memory/spec-metadata.md
26
- - "/alfred:2-build" → .moai/memory/development-guide.md
27
- - "test" → tests/ (디렉토리가 존재하는 경우)
25
+ - "/alfred:1-plan" → .moai/memory/spec-metadata.md
26
+ - "/alfred:2-run" → .moai/memory/development-guide.md
27
+ - "test" → tests/ (if directory exists)
28
28
 
29
29
  Examples:
30
- >>> get_jit_context("/alfred:1-spec", "/project")
30
+ >>> get_jit_context("/alfred:1-plan", "/project")
31
31
  ['.moai/memory/spec-metadata.md']
32
32
  >>> get_jit_context("implement test", "/project")
33
33
  ['tests/']
@@ -35,22 +35,22 @@ def get_jit_context(prompt: str, cwd: str) -> list[str]:
35
35
  []
36
36
 
37
37
  Notes:
38
- - Context Engineering: JIT Retrieval 원칙 준수
39
- - 필요한 문서만 로드하여 초기 컨텍스트 부담 최소화
40
- - 파일 존재 여부 확인 반환
38
+ - Context Engineering: Compliance with JIT Retrieval principles
39
+ - Minimize initial context burden by loading only necessary documents
40
+ - Return after checking whether file exists
41
41
 
42
42
  TDD History:
43
- - RED: 18 시나리오 테스트 (커맨드 매칭, 키워드, 결과)
44
- - GREEN: 패턴 매칭 딕셔너리 기반 구현
45
- - REFACTOR: 확장 가능한 패턴 구조, 파일 존재 검증 추가
43
+ - RED: 18 items scenario testing (command matching, keywords, empty results)
44
+ - GREEN: Pattern matching dictionary-based implementation
45
+ - REFACTOR: Expandable pattern structure, file existence validation added
46
46
  """
47
47
  context_files = []
48
48
  cwd_path = Path(cwd)
49
49
 
50
50
  # Pattern matching
51
51
  patterns = {
52
- "/alfred:1-spec": [".moai/memory/spec-metadata.md"],
53
- "/alfred:2-build": [".moai/memory/development-guide.md"],
52
+ "/alfred:1-plan": [".moai/memory/spec-metadata.md"],
53
+ "/alfred:2-run": [".moai/memory/development-guide.md"],
54
54
  "test": ["tests/"],
55
55
  }
56
56
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  """Project metadata utilities
3
3
 
4
- 프로젝트 정보 조회 (언어, Git, SPEC 진행도 )
4
+ Project information inquiry (language, Git, SPEC progress, etc.)
5
5
  """
6
6
 
7
7
  import json
@@ -11,18 +11,18 @@ from typing import Any
11
11
 
12
12
 
13
13
  def detect_language(cwd: str) -> str:
14
- """프로젝트 언어 감지 (20 언어 지원)
14
+ """Detect project language (supports 20 items languages)
15
15
 
16
- 파일 시스템을 탐색하여 프로젝트의 개발 언어를 감지합니다.
17
- pyproject.toml, tsconfig.json 등의 설정 파일을 우선 검사하며,
18
- TypeScript 우선 원칙을 적용합니다 (tsconfig.json 존재 시).
16
+ Browse the File system to detect your project's main development language.
17
+ First, check configuration files such as pyproject.toml and tsconfig.json.
18
+ Apply TypeScript first principles (if tsconfig.json exists).
19
19
 
20
20
  Args:
21
- cwd: 프로젝트 루트 디렉토리 경로 (절대/상대 경로 모두 가능)
21
+ cwd: Project root directory path (both absolute and relative paths are possible)
22
22
 
23
23
  Returns:
24
- 감지된 언어명 (소문자). 감지 실패 "Unknown Language" 반환.
25
- 지원 언어: python, typescript, javascript, java, go, rust,
24
+ Detected language name (lowercase). If detection fails, "Unknown Language" is returned.
25
+ Supported languages: python, typescript, javascript, java, go, rust,
26
26
  dart, swift, kotlin, php, ruby, elixir, scala,
27
27
  clojure, cpp, c, csharp, haskell, shell, lua
28
28
 
@@ -35,9 +35,9 @@ def detect_language(cwd: str) -> str:
35
35
  'Unknown Language'
36
36
 
37
37
  TDD History:
38
- - RED: 21 언어 감지 테스트 작성 (20 언어 + 1 unknown)
39
- - GREEN: 20 언어 + unknown 구현, 모든 테스트 통과
40
- - REFACTOR: 파일 검사 순서 최적화, TypeScript 우선 원칙 적용
38
+ - RED: Write a 21 items language detection test (20 items language + 1 items unknown)
39
+ - GREEN: 20 items language + unknown implementation, all tests passed
40
+ - REFACTOR: Optimize file inspection order, apply TypeScript priority principle
41
41
  """
42
42
  cwd_path = Path(cwd)
43
43
 
@@ -89,22 +89,22 @@ def detect_language(cwd: str) -> str:
89
89
 
90
90
 
91
91
  def _run_git_command(args: list[str], cwd: str, timeout: int = 2) -> str:
92
- """Git 명령어 실행 헬퍼 함수
92
+ """Git command execution helper function
93
93
 
94
- Git 명령어를 안전하게 실행하고 출력을 반환합니다.
95
- 코드 중복을 제거하고 일관된 에러 처리를 제공합니다.
94
+ Safely execute Git commands and return output.
95
+ Eliminates code duplication and provides consistent error handling.
96
96
 
97
97
  Args:
98
- args: Git 명령어 인자 리스트 (git 자동 추가)
99
- cwd: 실행 디렉토리 경로
100
- timeout: 타임아웃 (초, 기본 2)
98
+ args: Git command argument list (git adds automatically)
99
+ cwd: Execution directory path
100
+ timeout: Timeout (seconds, default 2 seconds)
101
101
 
102
102
  Returns:
103
- Git 명령어 출력 (stdout, 앞뒤 공백 제거)
103
+ Git command output (stdout, removing leading and trailing spaces)
104
104
 
105
105
  Raises:
106
- subprocess.TimeoutExpired: 타임아웃 초과
107
- subprocess.CalledProcessError: Git 명령어 실패
106
+ subprocess.TimeoutExpired: Timeout exceeded
107
+ subprocess.CalledProcessError: Git command failed
108
108
 
109
109
  Examples:
110
110
  >>> _run_git_command(["branch", "--show-current"], ".")
@@ -122,22 +122,22 @@ def _run_git_command(args: list[str], cwd: str, timeout: int = 2) -> str:
122
122
 
123
123
 
124
124
  def get_git_info(cwd: str) -> dict[str, Any]:
125
- """Git 리포지토리 정보 수집
125
+ """Gather Git repository information
126
126
 
127
- Git 리포지토리의 현재 상태를 조회합니다.
128
- 브랜치명, 커밋 해시, 변경사항 개수를 반환하며,
129
- Git 리포지토리가 아닌 경우 딕셔너리를 반환합니다.
127
+ View the current status of a Git repository.
128
+ Returns the branch name, commit hash, and number of changes.
129
+ If it is not a Git repository, it returns an empty dictionary.
130
130
 
131
131
  Args:
132
- cwd: 프로젝트 루트 디렉토리 경로
132
+ cwd: Project root directory path
133
133
 
134
134
  Returns:
135
- Git 정보 딕셔너리. 다음 키를 포함:
136
- - branch: 현재 브랜치명 (str)
137
- - commit: 현재 커밋 해시 (str, full hash)
138
- - changes: 변경된 파일 개수 (int, staged + unstaged)
135
+ Git information dictionary. Includes the following keys:
136
+ - branch: Current branch name (str)
137
+ - commit: Current commit hash (str, full hash)
138
+ - changes: Number of changed files (int, staged + unstaged)
139
139
 
140
- Git 리포지토리가 아니거나 조회 실패 딕셔너리 {}
140
+ Empty dictionary {} if it is not a Git repository or the query fails.
141
141
 
142
142
  Examples:
143
143
  >>> get_git_info("/path/to/git/repo")
@@ -146,14 +146,14 @@ def get_git_info(cwd: str) -> dict[str, Any]:
146
146
  {}
147
147
 
148
148
  Notes:
149
- - 타임아웃: Git 명령어 2초
150
- - 보안: subprocess.run(shell=False)로 안전한 실행
151
- - 에러 처리: 모든 예외 딕셔너리 반환
149
+ - Timeout: 2 seconds for each Git command
150
+ - Security: Safe execution with subprocess.run(shell=False)
151
+ - Error handling: Returns an empty dictionary in case of all exceptions
152
152
 
153
153
  TDD History:
154
- - RED: 3 시나리오 테스트 (Git 리포, Git, 에러)
155
- - GREEN: subprocess 기반 Git 명령어 실행 구현
156
- - REFACTOR: 타임아웃 추가 (2), 예외 처리 강화, 헬퍼 함수로 중복 제거
154
+ - RED: 3 items scenario test (Git repo, non-Git, error)
155
+ - GREEN: Implementation of subprocess-based Git command execution
156
+ - REFACTOR: Add timeout (2 seconds), strengthen exception handling, remove duplicates with helper function
157
157
  """
158
158
  try:
159
159
  # Check if it's a git repository
@@ -176,21 +176,21 @@ def get_git_info(cwd: str) -> dict[str, Any]:
176
176
 
177
177
 
178
178
  def count_specs(cwd: str) -> dict[str, int]:
179
- """SPEC 파일 카운트 진행도 계산
179
+ """SPEC File count and progress calculation
180
180
 
181
- .moai/specs/ 디렉토리를 탐색하여 SPEC 파일 개수와
182
- 완료 상태(status: completed)인 SPEC 개수를 집계합니다.
181
+ Browse the .moai/specs/ directory to find the number of SPEC Files and
182
+ Counts the number of SPECs with status: completed.
183
183
 
184
184
  Args:
185
- cwd: 프로젝트 루트 디렉토리 경로
185
+ cwd: Project root directory path
186
186
 
187
187
  Returns:
188
- SPEC 진행도 딕셔너리. 다음 키를 포함:
189
- - completed: 완료된 SPEC 개수 (int)
190
- - total: 전체 SPEC 개수 (int)
191
- - percentage: 완료율 (int, 0~100)
188
+ SPEC progress dictionary. Includes the following keys:
189
+ - completed: Number of completed SPECs (int)
190
+ - total: total number of SPECs (int)
191
+ - percentage: completion percentage (int, 0~100)
192
192
 
193
- .moai/specs/ 디렉토리가 없으면 모두 0
193
+ All 0 if .moai/specs/ directory does not exist
194
194
 
195
195
  Examples:
196
196
  >>> count_specs("/path/to/project")
@@ -199,14 +199,14 @@ def count_specs(cwd: str) -> dict[str, int]:
199
199
  {'completed': 0, 'total': 0, 'percentage': 0}
200
200
 
201
201
  Notes:
202
- - SPEC 파일 위치: .moai/specs/SPEC-{ID}/spec.md
203
- - 완료 조건: YAML front matter에 "status: completed" 포함
204
- - 파싱 실패 해당 SPEC 미완료로 간주
202
+ - SPEC File Location: .moai/specs/SPEC-{ID}/spec.md
203
+ - Completion condition: Include status: completed in YAML front matter
204
+ - If parsing fails, the SPEC is considered incomplete.
205
205
 
206
206
  TDD History:
207
- - RED: 5 시나리오 테스트 (0/0, 2/5, 5/5, 디렉토리 없음, 파싱 에러)
208
- - GREEN: Path.iterdir() SPEC 탐색, YAML 파싱 구현
209
- - REFACTOR: 예외 처리 강화, 퍼센트 계산 안전성 개선
207
+ - RED: 5 items scenario test (0/0, 2/5, 5/5, no directory, parsing error)
208
+ - GREEN: SPEC search with Path.iterdir(), YAML parsing implementation
209
+ - REFACTOR: Strengthened exception handling, improved percentage calculation safety
210
210
  """
211
211
  specs_dir = Path(cwd) / ".moai" / "specs"
212
212
 
@@ -236,7 +236,7 @@ def count_specs(cwd: str) -> dict[str, int]:
236
236
  if "status: completed" in yaml_content:
237
237
  completed += 1
238
238
  except (OSError, UnicodeDecodeError):
239
- # 파일 읽기 실패 또는 인코딩 오류 - 미완료로 간주
239
+ # File read failure or encoding error - considered incomplete
240
240
  pass
241
241
 
242
242
  percentage = int(completed / total * 100) if total > 0 else 0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  """Event handlers for Alfred Hooks
3
3
 
4
- Claude Code 이벤트 핸들러들
4
+ Claude Code Event Handlers
5
5
  """
6
6
 
7
7
  from .notification import handle_notification, handle_stop, handle_subagent_stop
@@ -1,24 +1,24 @@
1
1
  #!/usr/bin/env python3
2
2
  """Notification and control handlers
3
3
 
4
- Notification, Stop, SubagentStop 이벤트 처리
4
+ Notification, Stop, SubagentStop event handling
5
5
  """
6
6
 
7
7
  from core import HookPayload, HookResult
8
8
 
9
9
 
10
10
  def handle_notification(payload: HookPayload) -> HookResult:
11
- """Notification 이벤트 핸들러 (기본 구현)"""
11
+ """Notification event handler (default implementation)"""
12
12
  return HookResult()
13
13
 
14
14
 
15
15
  def handle_stop(payload: HookPayload) -> HookResult:
16
- """Stop 이벤트 핸들러 (기본 구현)"""
16
+ """Stop event handler (default implementation)"""
17
17
  return HookResult()
18
18
 
19
19
 
20
20
  def handle_subagent_stop(payload: HookPayload) -> HookResult:
21
- """SubagentStop 이벤트 핸들러 (기본 구현)"""
21
+ """SubagentStop event handler (default implementation)"""
22
22
  return HookResult()
23
23
 
24
24