moai-adk 0.3.11__tar.gz → 0.3.13__tar.gz

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 (90) hide show
  1. {moai_adk-0.3.11 → moai_adk-0.3.13}/PKG-INFO +14 -3
  2. {moai_adk-0.3.11 → moai_adk-0.3.13}/README.md +13 -2
  3. {moai_adk-0.3.11 → moai_adk-0.3.13}/pyproject.toml +1 -1
  4. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/__init__.py +1 -1
  5. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/doctor.py +51 -1
  6. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/prompts/init_prompts.py +11 -0
  7. moai_adk-0.3.13/src/moai_adk/core/diagnostics/__init__.py +19 -0
  8. moai_adk-0.3.13/src/moai_adk/core/diagnostics/slash_commands.py +160 -0
  9. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/detector.py +14 -2
  10. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/commands/alfred/2-build.md +1 -1
  11. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/handlers/session.py +33 -0
  12. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/settings.json +0 -11
  13. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/memory/development-guide.md +3 -0
  14. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/CLAUDE.md +1 -1
  15. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/utils/banner.py +6 -6
  16. {moai_adk-0.3.11 → moai_adk-0.3.13}/.gitignore +0 -0
  17. {moai_adk-0.3.11 → moai_adk-0.3.13}/LICENSE +0 -0
  18. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/__main__.py +0 -0
  19. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/__init__.py +0 -0
  20. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/__init__.py +0 -0
  21. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/backup.py +0 -0
  22. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/init.py +0 -0
  23. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/status.py +0 -0
  24. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/commands/update.py +0 -0
  25. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/main.py +0 -0
  26. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/cli/prompts/__init__.py +0 -0
  27. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/__init__.py +0 -0
  28. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/__init__.py +0 -0
  29. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/branch.py +0 -0
  30. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/branch_manager.py +0 -0
  31. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/checkpoint.py +0 -0
  32. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/commit.py +0 -0
  33. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/event_detector.py +0 -0
  34. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/git/manager.py +0 -0
  35. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/__init__.py +0 -0
  36. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/backup_utils.py +0 -0
  37. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/checker.py +0 -0
  38. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/initializer.py +0 -0
  39. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/phase_executor.py +0 -0
  40. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/project/validator.py +0 -0
  41. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/quality/__init__.py +0 -0
  42. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/quality/trust_checker.py +0 -0
  43. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/quality/validators/__init__.py +0 -0
  44. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/quality/validators/base_validator.py +0 -0
  45. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/__init__.py +0 -0
  46. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/backup.py +0 -0
  47. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/config.py +0 -0
  48. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/languages.py +0 -0
  49. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/merger.py +0 -0
  50. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/core/template/processor.py +0 -0
  51. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -0
  52. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -0
  53. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -0
  54. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -0
  55. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -0
  56. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -0
  57. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -0
  58. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -0
  59. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -0
  60. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -0
  61. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -0
  62. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/commands/alfred/0-project.md +0 -0
  63. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -0
  64. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -0
  65. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/README.md +0 -0
  66. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -0
  67. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/core/__init__.py +0 -0
  68. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +0 -0
  69. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/core/context.py +0 -0
  70. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/core/project.py +0 -0
  71. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +0 -0
  72. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +0 -0
  73. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +0 -0
  74. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/hooks/alfred/handlers/user.py +0 -0
  75. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -0
  76. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -0
  77. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -0
  78. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  79. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.github/workflows/moai-gitflow.yml +0 -0
  80. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.gitignore +0 -0
  81. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/config.json +0 -0
  82. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/hooks/pre-push.sample +0 -0
  83. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -0
  84. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/memory/spec-metadata.md +0 -0
  85. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/project/product.md +0 -0
  86. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/project/structure.md +0 -0
  87. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/.moai/project/tech.md +0 -0
  88. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/templates/__init__.py +0 -0
  89. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/utils/__init__.py +0 -0
  90. {moai_adk-0.3.11 → moai_adk-0.3.13}/src/moai_adk/utils/logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moai-adk
3
- Version: 0.3.11
3
+ Version: 0.3.13
4
4
  Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent
5
5
  Project-URL: Homepage, https://github.com/modu-ai/moai-adk
6
6
  Project-URL: Repository, https://github.com/modu-ai/moai-adk
@@ -395,6 +395,10 @@ uv --version
395
395
  #### 2. moai-adk 설치 (10초)
396
396
 
397
397
  ```bash
398
+ # 권장: uv tool 모드 (샌드박스 격리, 전역 접근)
399
+ uv tool install moai-adk
400
+
401
+ # 대안: 현재 가상 환경에 설치
398
402
  uv pip install moai-adk
399
403
 
400
404
  # 설치 확인
@@ -1283,7 +1287,10 @@ Alfred가 모든 코드에 자동으로 적용하는 품질 기준입니다.
1283
1287
  ```bash
1284
1288
  moai-adk update
1285
1289
 
1286
- # 또는
1290
+ # 또는 (tool 모드 - 권장)
1291
+ uv tool upgrade moai-adk
1292
+
1293
+ # 또는 (pip 모드 - 레거시)
1287
1294
  uv pip install --upgrade moai-adk
1288
1295
  ```
1289
1296
 
@@ -1437,7 +1444,11 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
1437
1444
  # Windows:
1438
1445
  powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
1439
1446
 
1440
- # moai-adk 재설치
1447
+ # moai-adk 재설치 (tool 모드 - 권장)
1448
+ uv tool uninstall moai-adk
1449
+ uv tool install moai-adk
1450
+
1451
+ # 또는 (pip 모드 - 레거시)
1441
1452
  uv pip install moai-adk --force-reinstall
1442
1453
  ```
1443
1454
 
@@ -357,6 +357,10 @@ uv --version
357
357
  #### 2. moai-adk 설치 (10초)
358
358
 
359
359
  ```bash
360
+ # 권장: uv tool 모드 (샌드박스 격리, 전역 접근)
361
+ uv tool install moai-adk
362
+
363
+ # 대안: 현재 가상 환경에 설치
360
364
  uv pip install moai-adk
361
365
 
362
366
  # 설치 확인
@@ -1245,7 +1249,10 @@ Alfred가 모든 코드에 자동으로 적용하는 품질 기준입니다.
1245
1249
  ```bash
1246
1250
  moai-adk update
1247
1251
 
1248
- # 또는
1252
+ # 또는 (tool 모드 - 권장)
1253
+ uv tool upgrade moai-adk
1254
+
1255
+ # 또는 (pip 모드 - 레거시)
1249
1256
  uv pip install --upgrade moai-adk
1250
1257
  ```
1251
1258
 
@@ -1399,7 +1406,11 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
1399
1406
  # Windows:
1400
1407
  powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
1401
1408
 
1402
- # moai-adk 재설치
1409
+ # moai-adk 재설치 (tool 모드 - 권장)
1410
+ uv tool uninstall moai-adk
1411
+ uv tool install moai-adk
1412
+
1413
+ # 또는 (pip 모드 - 레거시)
1403
1414
  uv pip install moai-adk --force-reinstall
1404
1415
  ```
1405
1416
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "moai-adk"
3
- version = "0.3.11"
3
+ version = "0.3.13"
4
4
  description = "MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -4,5 +4,5 @@
4
4
  SPEC-First TDD Framework with Alfred SuperAgent
5
5
  """
6
6
 
7
- __version__ = "0.3.11"
7
+ __version__ = "0.3.13"
8
8
  __all__ = ["__version__"]
@@ -1,4 +1,5 @@
1
1
  # @CODE:CLI-001 | SPEC: SPEC-CLI-001.md | TEST: tests/unit/test_doctor.py
2
+ # @CODE:CLAUDE-COMMANDS-001:CLI | SPEC: SPEC-CLAUDE-COMMANDS-001.md | TEST: tests/unit/test_slash_commands.py
2
3
  """MoAI-ADK doctor command
3
4
 
4
5
  System diagnostics command:
@@ -6,6 +7,7 @@ System diagnostics command:
6
7
  - Verify Git installation
7
8
  - Validate project structure
8
9
  - Inspect language-specific tool chains
10
+ - Diagnose slash command loading issues (--check-commands)
9
11
  """
10
12
 
11
13
  import json
@@ -27,7 +29,8 @@ console = Console()
27
29
  @click.option("--fix", is_flag=True, help="Suggest fixes for missing tools")
28
30
  @click.option("--export", type=click.Path(), help="Export diagnostics to JSON file")
29
31
  @click.option("--check", type=str, help="Check specific tool only")
30
- def doctor(verbose: bool, fix: bool, export: str | None, check: str | None) -> None:
32
+ @click.option("--check-commands", is_flag=True, help="Diagnose slash command loading issues")
33
+ def doctor(verbose: bool, fix: bool, export: str | None, check: str | None, check_commands: bool) -> None:
31
34
  """Check system requirements and project health
32
35
 
33
36
  Verifies:
@@ -37,6 +40,11 @@ def doctor(verbose: bool, fix: bool, export: str | None, check: str | None) -> N
37
40
  - Language-specific tool chains (20+ languages)
38
41
  """
39
42
  try:
43
+ # Handle --check-commands option first
44
+ if check_commands:
45
+ _check_slash_commands()
46
+ return
47
+
40
48
  console.print("[cyan]Running system diagnostics...[/cyan]\n")
41
49
 
42
50
  # Run basic environment checks
@@ -182,3 +190,45 @@ def _export_diagnostics(export_path: str, data: dict) -> None:
182
190
  console.print(f"\n[green]✓ Diagnostics exported to {export_path}[/green]")
183
191
  except Exception as e:
184
192
  console.print(f"\n[red]✗ Failed to export diagnostics: {e}[/red]")
193
+
194
+
195
+ def _check_slash_commands() -> None:
196
+ """Check slash command loading issues (helper)"""
197
+ from moai_adk.core.diagnostics.slash_commands import diagnose_slash_commands
198
+
199
+ console.print("[cyan]Running slash command diagnostics...[/cyan]\n")
200
+
201
+ result = diagnose_slash_commands()
202
+
203
+ # Handle error case
204
+ if "error" in result:
205
+ console.print(f"[red]✗ {result['error']}[/red]")
206
+ return
207
+
208
+ # Build results table
209
+ table = Table(show_header=True, header_style="bold magenta")
210
+ table.add_column("Command File", style="dim", width=40)
211
+ table.add_column("Status", justify="center", width=10)
212
+ table.add_column("Issues", style="yellow")
213
+
214
+ for detail in result["details"]:
215
+ icon = "✓" if detail["valid"] else "✗"
216
+ color = "green" if detail["valid"] else "red"
217
+ issues = ", ".join(detail["errors"]) if detail["errors"] else "-"
218
+
219
+ table.add_row(detail["file"], f"[{color}]{icon}[/{color}]", issues)
220
+
221
+ console.print(table)
222
+ console.print()
223
+
224
+ # Summary
225
+ total = result["total_files"]
226
+ valid = result["valid_commands"]
227
+
228
+ if valid == total and total > 0:
229
+ console.print(f"[green]✓ {valid}/{total} command files are valid[/green]")
230
+ elif total == 0:
231
+ console.print("[yellow]⚠ No command files found in .claude/commands/[/yellow]")
232
+ else:
233
+ console.print(f"[yellow]⚠ Only {valid}/{total} command files are valid[/yellow]")
234
+ console.print("[dim]Fix the issues above to enable slash commands[/dim]")
@@ -123,9 +123,20 @@ def prompt_project_setup(
123
123
  "Java",
124
124
  "Go",
125
125
  "Rust",
126
+ "Ruby",
126
127
  "Dart",
127
128
  "Swift",
128
129
  "Kotlin",
130
+ "PHP",
131
+ "C#",
132
+ "C",
133
+ "C++",
134
+ "Elixir",
135
+ "Scala",
136
+ "Clojure",
137
+ "Haskell",
138
+ "Lua",
139
+ "OCaml",
129
140
  "Generic",
130
141
  ],
131
142
  ).ask()
@@ -0,0 +1,19 @@
1
+ """Diagnostics module for MoAI-ADK
2
+
3
+ Provides diagnostic tools for:
4
+ - Slash command validation
5
+ - System health checks
6
+ - Environment verification
7
+ """
8
+
9
+ from moai_adk.core.diagnostics.slash_commands import (
10
+ diagnose_slash_commands,
11
+ scan_command_files,
12
+ validate_command_file,
13
+ )
14
+
15
+ __all__ = [
16
+ "diagnose_slash_commands",
17
+ "scan_command_files",
18
+ "validate_command_file",
19
+ ]
@@ -0,0 +1,160 @@
1
+ # @CODE:CLAUDE-COMMANDS-001:DIAGNOSTIC | SPEC: SPEC-CLAUDE-COMMANDS-001.md | TEST: tests/unit/test_slash_commands.py
2
+ """Slash command diagnostics
3
+
4
+ Diagnose and validate Claude Code slash command loading issues.
5
+
6
+ Functions:
7
+ - validate_command_file: Validate YAML front matter and required fields
8
+ - scan_command_files: Recursively scan for .md files
9
+ - diagnose_slash_commands: Comprehensive diagnostic report
10
+ """
11
+
12
+ from pathlib import Path
13
+
14
+ import yaml
15
+
16
+
17
+ def validate_command_file(file_path: Path) -> dict:
18
+ """Validate slash command file format
19
+
20
+ Checks:
21
+ 1. File exists and readable
22
+ 2. YAML front matter present (starts with ---)
23
+ 3. Valid YAML syntax
24
+ 4. Required fields: name, description
25
+
26
+ Args:
27
+ file_path: Path to command file (.md)
28
+
29
+ Returns:
30
+ dict with 'valid' (bool) and optional 'errors' (list[str])
31
+
32
+ Example:
33
+ >>> result = validate_command_file(Path("cmd.md"))
34
+ >>> if result["valid"]:
35
+ ... print("Valid command file")
36
+ ... else:
37
+ ... print(f"Errors: {result['errors']}")
38
+ """
39
+ try:
40
+ # Check file exists
41
+ if not file_path.exists():
42
+ return {"valid": False, "errors": ["File not found"]}
43
+
44
+ # Read file content
45
+ content = file_path.read_text(encoding="utf-8")
46
+
47
+ # Check front matter delimiter
48
+ if not content.startswith("---"):
49
+ return {
50
+ "valid": False,
51
+ "errors": ["Missing YAML front matter (must start with ---)"],
52
+ }
53
+
54
+ # Split by --- delimiter
55
+ parts = content.split("---", 2)
56
+ if len(parts) < 3:
57
+ return {
58
+ "valid": False,
59
+ "errors": ["Invalid front matter format (missing closing ---)"],
60
+ }
61
+
62
+ # Parse YAML
63
+ try:
64
+ metadata = yaml.safe_load(parts[1])
65
+ except yaml.YAMLError as e:
66
+ return {"valid": False, "errors": [f"YAML parsing error: {e}"]}
67
+
68
+ # Check required fields
69
+ required_fields = ["name", "description"]
70
+ missing_fields = [field for field in required_fields if field not in metadata]
71
+
72
+ if missing_fields:
73
+ return {
74
+ "valid": False,
75
+ "errors": [f"Missing required field: {', '.join(missing_fields)}"],
76
+ }
77
+
78
+ return {"valid": True}
79
+
80
+ except Exception as e:
81
+ return {"valid": False, "errors": [str(e)]}
82
+
83
+
84
+ def scan_command_files(commands_dir: Path) -> list[Path]:
85
+ """Scan directory for all .md files
86
+
87
+ Recursively searches for .md files in the given directory.
88
+
89
+ Args:
90
+ commands_dir: Directory to scan (e.g., .claude/commands)
91
+
92
+ Returns:
93
+ List of Path objects for found .md files
94
+
95
+ Example:
96
+ >>> files = scan_command_files(Path(".claude/commands"))
97
+ >>> print(f"Found {len(files)} command files")
98
+ """
99
+ if not commands_dir.exists():
100
+ return []
101
+
102
+ try:
103
+ return list(commands_dir.glob("**/*.md"))
104
+ except Exception:
105
+ return []
106
+
107
+
108
+ def diagnose_slash_commands() -> dict:
109
+ """Diagnose slash command loading issues
110
+
111
+ Comprehensive diagnostic that:
112
+ 1. Checks if .claude/commands directory exists
113
+ 2. Scans for all .md files
114
+ 3. Validates each file's format
115
+ 4. Returns detailed report
116
+
117
+ Returns:
118
+ dict with diagnostic results:
119
+ - total_files: Number of .md files found
120
+ - valid_commands: Number of valid command files
121
+ - details: List of per-file validation results
122
+ OR
123
+ - error: Error message if directory not found
124
+
125
+ Example:
126
+ >>> result = diagnose_slash_commands()
127
+ >>> if "error" in result:
128
+ ... print(f"Error: {result['error']}")
129
+ ... else:
130
+ ... print(f"{result['valid_commands']}/{result['total_files']} valid")
131
+ """
132
+ commands_dir = Path(".claude/commands")
133
+
134
+ # Check if directory exists
135
+ if not commands_dir.exists():
136
+ return {"error": "Commands directory not found"}
137
+
138
+ # Scan for .md files
139
+ md_files = scan_command_files(commands_dir)
140
+
141
+ # Validate each file
142
+ details = []
143
+ for file_path in md_files:
144
+ validation = validate_command_file(file_path)
145
+ details.append(
146
+ {
147
+ "file": str(file_path.relative_to(commands_dir)),
148
+ "valid": validation["valid"],
149
+ "errors": validation.get("errors", []),
150
+ }
151
+ )
152
+
153
+ # Count valid commands
154
+ valid_count = sum(1 for detail in details if detail["valid"])
155
+
156
+ return {
157
+ "total_files": len(md_files),
158
+ "valid_commands": valid_count,
159
+ "details": details,
160
+ }
@@ -1,4 +1,5 @@
1
1
  # @CODE:CORE-PROJECT-001 | SPEC: SPEC-CORE-PROJECT-001.md | TEST: tests/unit/test_language_detector.py
2
+ # @CODE:LANG-DETECT-001 | SPEC: SPEC-LANG-DETECT-001.md | TEST: tests/unit/test_detector.py
2
3
  """Language detector module.
3
4
 
4
5
  Automatically detects 20 programming languages.
@@ -8,9 +9,21 @@ from pathlib import Path
8
9
 
9
10
 
10
11
  class LanguageDetector:
11
- """Automatically detect up to 20 programming languages."""
12
+ """Automatically detect up to 20 programming languages.
13
+
14
+ Prioritizes framework-specific files (e.g., Laravel, Django) over
15
+ generic language files to improve accuracy in mixed-language projects.
16
+ """
12
17
 
13
18
  LANGUAGE_PATTERNS = {
19
+ # PHP moved to top for priority (Laravel detection)
20
+ "php": [
21
+ "*.php",
22
+ "composer.json",
23
+ "artisan", # Laravel: CLI tool (unique identifier)
24
+ "app/", # Laravel: application directory
25
+ "bootstrap/laravel.php" # Laravel: bootstrap file
26
+ ],
14
27
  "python": ["*.py", "pyproject.toml", "requirements.txt", "setup.py"],
15
28
  "typescript": ["*.ts", "tsconfig.json"],
16
29
  "javascript": ["*.js", "package.json"],
@@ -21,7 +34,6 @@ class LanguageDetector:
21
34
  "swift": ["*.swift", "Package.swift"],
22
35
  "kotlin": ["*.kt", "build.gradle.kts"],
23
36
  "csharp": ["*.cs", "*.csproj"],
24
- "php": ["*.php", "composer.json"],
25
37
  "ruby": ["*.rb", "Gemfile"],
26
38
  "elixir": ["*.ex", "mix.exs"],
27
39
  "scala": ["*.scala", "build.sbt"],
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: alfred:2-build
3
- description: 구현할 SPEC ID (예: SPEC-001) 또는 all로 모든 SPEC 구현: 언어별 최적화된 TDD 구현 (Red-Green-Refactor) with SQLite3 tags.db
3
+ description: "구현할 SPEC ID (예: SPEC-001) 또는 all로 모든 SPEC 구현 - 언어별 최적화된 TDD 구현 (Red-Green-Refactor) with SQLite3 tags.db"
4
4
  argument-hint: "SPEC-ID - 구현할 SPEC ID (예: SPEC-001) 또는 all로 모든 SPEC 구현"
5
5
  allowed-tools:
6
6
  - Read
@@ -4,6 +4,10 @@
4
4
  SessionStart, SessionEnd 이벤트 처리
5
5
  """
6
6
 
7
+ import os
8
+ import time
9
+ from pathlib import Path
10
+
7
11
  from core import HookPayload, HookResult
8
12
  from core.checkpoint import list_checkpoints
9
13
  from core.project import count_specs, detect_language, get_git_info
@@ -29,14 +33,43 @@ def handle_session_start(payload: HookPayload) -> HookResult:
29
33
  SPEC Progress: {완료}/{전체} ({퍼센트}%)
30
34
  Checkpoints: {개수} available (최신 3개 표시)
31
35
 
36
+ Note:
37
+ - Claude Code는 SessionStart를 여러 번 호출할 수 있음
38
+ - 상태 파일 기반 중복 방지 메커니즘 사용
39
+ - 5초 이내 재호출은 무시 (같은 세션으로 간주)
40
+
32
41
  TDD History:
33
42
  - RED: 세션 시작 메시지 형식 테스트
34
43
  - GREEN: helper 함수 조합하여 상태 메시지 생성
35
44
  - REFACTOR: 메시지 포맷 개선, 가독성 향상, checkpoint 목록 추가
45
+ - FIX: 상태 파일 기반 중복 출력 방지 메커니즘 도입
36
46
 
37
47
  @TAG:CHECKPOINT-EVENT-001
38
48
  """
49
+ # 상태 파일 기반 중복 방지
39
50
  cwd = payload.get("cwd", ".")
51
+ # cwd가 "."인 경우 절대 경로로 변환하여 프로젝트명 추출
52
+ project_dir = Path(cwd).resolve()
53
+ session_file = Path("/tmp") / f"moai-session-{project_dir.name}.lock"
54
+
55
+ # 기존 세션 파일이 있고 5초 이내면 중복 실행으로 간주
56
+ if session_file.exists():
57
+ file_age = time.time() - session_file.stat().st_mtime
58
+ if file_age < 5.0:
59
+ return HookResult() # 중복 실행 방지
60
+
61
+ # 세션 파일 생성/갱신
62
+ session_file.touch()
63
+
64
+ # 1시간 이상 된 세션 파일 자동 정리
65
+ if session_file.parent.exists():
66
+ for old_file in session_file.parent.glob("moai-session-*.lock"):
67
+ try:
68
+ if time.time() - old_file.stat().st_mtime > 3600:
69
+ old_file.unlink()
70
+ except Exception:
71
+ pass # 정리 실패는 무시
72
+
40
73
  language = detect_language(cwd)
41
74
  git_info = get_git_info(cwd)
42
75
  specs = count_specs(cwd)
@@ -6,17 +6,6 @@
6
6
  "PYTHON_ENV": "{{PROJECT_MODE}}"
7
7
  },
8
8
  "hooks": {
9
- "SessionStart": [
10
- {
11
- "hooks": [
12
- {
13
- "command": "uv run .claude/hooks/alfred/alfred_hooks.py SessionStart",
14
- "type": "command"
15
- }
16
- ],
17
- "matcher": "*"
18
- }
19
- ],
20
9
  "PreToolUse": [
21
10
  {
22
11
  "hooks": [
@@ -106,6 +106,7 @@ MoAI-ADK는 Anthropic의 "Effective Context Engineering for AI Agents" 원칙을
106
106
  - **Java**: JUnit + SPEC 어노테이션 (행동 주도 테스트)
107
107
  - **Go**: go test + SPEC 테이블 주도 테스트 (인터페이스 준수)
108
108
  - **Rust**: cargo test + SPEC 문서 테스트 (trait 검증)
109
+ - **Ruby**: RSpec + SPEC 기반 BDD 테스트 (행동 명세 우선)
109
110
 
110
111
  각 테스트는 @TEST:ID → @CODE:ID 참조를 통해 특정 SPEC 요구사항과 연결한다.
111
112
 
@@ -125,6 +126,7 @@ MoAI-ADK는 Anthropic의 "Effective Context Engineering for AI Agents" 원칙을
125
126
  - **Java**: SPEC 구성요소 구현 클래스 + 강한 타이핑
126
127
  - **Go**: SPEC 요구사항 충족 인터페이스 + gofmt
127
128
  - **Rust**: SPEC 안전 요구사항을 구현하는 타입 + rustfmt
129
+ - **Ruby**: SPEC 행동을 반영하는 duck typing + RuboCop 검증
128
130
 
129
131
  모든 코드 요소는 @TAG 주석을 통해 SPEC까지 추적 가능하다.
130
132
 
@@ -320,6 +322,7 @@ rg "### v[0-9]" .moai/specs/SPEC-AUTH-001.md | head -3
320
322
  - **Java**: JUnit (테스트), Maven/Gradle (빌드)
321
323
  - **Go**: go test (테스트), gofmt (포맷)
322
324
  - **Rust**: cargo test (테스트), rustfmt (포맷)
325
+ - **Ruby**: RSpec (테스트), RuboCop (린터+포맷), Bundler (패키지 관리)
323
326
 
324
327
  ## 변수 역할 참고
325
328
 
@@ -461,7 +461,7 @@ def handle_pre_tool_use(payload):
461
461
  - **SPEC-First**: 명세 없이는 코드 없음
462
462
  - **TDD-First**: 테스트 없이는 구현 없음
463
463
  - **GitFlow 지원**: Git 작업 자동화, Living Document 동기화, @TAG 추적성
464
- - **다중 언어 지원**: Python, TypeScript, Java, Go, Rust, Dart, Swift, Kotlin 등 모든 주요 언어
464
+ - **다중 언어 지원**: Python, TypeScript, Java, Go, Rust, Ruby, Dart, Swift, Kotlin 등 20개 주요 언어
465
465
  - **모바일 지원**: Flutter, React Native, iOS (Swift), Android (Kotlin)
466
466
  - **CODE-FIRST @TAG**: 코드 직접 스캔 방식 (중간 캐시 없음)
467
467
 
@@ -9,12 +9,12 @@ from rich.console import Console
9
9
  console = Console()
10
10
 
11
11
  MOAI_BANNER = """
12
- ███╗ ███╗ ██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗ ██╗
13
- ████╗ ████║██╔═══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║ ██╔╝
14
- ██╔████╔██║██║ ██║███████║██║█████╗███████║██║ ██║█████╔╝
15
- ██║╚██╔╝██║██║ ██║██╔══██║██║╚════╝██╔══██║██║ ██║██╔═██╗
16
- ██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ██║ ██║██████╔╝██║ ██╗
17
- ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝
12
+ ███╗ ███╗ █████╗ ██╗ █████╗ ██████╗ ██╗ ██╗
13
+ ████╗ ████║ █████╗ ██╔══██╗██║ ██╔══██╗██╔══██╗██║ ██╔╝
14
+ ██╔████╔██║ ██╔══██╗███████║██║█████╗███████║██║ ██║█████╔╝
15
+ ██║╚██╔╝██║ ██║ ██║██╔══██║██║╚════╝██╔══██║██║ ██║██╔═██╗
16
+ ██║ ╚═╝ ██║ ╚█████╔╝██║ ██║██║ ██║ ██║██████╔╝██║ ██╗
17
+ ╚═╝ ╚═╝ ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝
18
18
  """
19
19
 
20
20
 
File without changes
File without changes