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

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

Potentially problematic release.


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

Files changed (141) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +1 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/doctor.py +2 -2
  5. moai_adk/cli/commands/init.py +10 -5
  6. moai_adk/cli/commands/status.py +1 -1
  7. moai_adk/cli/commands/update.py +210 -8
  8. moai_adk/cli/prompts/init_prompts.py +15 -19
  9. moai_adk/core/__init__.py +1 -1
  10. moai_adk/core/diagnostics/slash_commands.py +1 -1
  11. moai_adk/core/git/branch.py +1 -1
  12. moai_adk/core/git/manager.py +1 -1
  13. moai_adk/core/project/backup_utils.py +1 -0
  14. moai_adk/core/project/phase_executor.py +3 -1
  15. moai_adk/core/project/validator.py +3 -2
  16. moai_adk/core/quality/__init__.py +1 -1
  17. moai_adk/core/quality/trust_checker.py +1 -1
  18. moai_adk/core/quality/validators/__init__.py +1 -1
  19. moai_adk/core/quality/validators/base_validator.py +1 -1
  20. moai_adk/core/template/__init__.py +1 -1
  21. moai_adk/core/template/backup.py +12 -3
  22. moai_adk/core/template/config.py +24 -0
  23. moai_adk/core/template/languages.py +1 -1
  24. moai_adk/core/template/merger.py +74 -4
  25. moai_adk/core/template/processor.py +62 -14
  26. moai_adk/templates/.claude/agents/alfred/cc-manager.md +765 -191
  27. moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
  28. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
  29. moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
  30. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
  31. moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
  32. moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
  33. moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
  34. moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
  35. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
  36. moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
  37. moai_adk/templates/.claude/commands/alfred/0-project.md +856 -355
  38. moai_adk/templates/.claude/commands/alfred/1-plan.md +572 -0
  39. moai_adk/templates/.claude/commands/alfred/2-run.md +470 -0
  40. moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
  41. moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
  42. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
  43. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
  44. moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
  45. moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
  46. moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
  47. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
  48. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
  49. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +30 -51
  50. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
  51. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
  52. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
  53. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
  54. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
  55. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
  67. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +94 -0
  68. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
  69. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +433 -0
  70. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
  71. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
  72. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +363 -0
  73. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +595 -0
  74. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +496 -0
  75. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +99 -0
  76. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +95 -0
  77. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +98 -0
  78. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +100 -0
  79. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +100 -0
  80. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +99 -0
  81. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +99 -0
  82. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +93 -0
  83. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +105 -0
  84. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -0
  85. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +102 -0
  86. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +104 -0
  87. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +96 -0
  88. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +112 -0
  89. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +98 -0
  90. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +90 -0
  91. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +94 -0
  92. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +93 -0
  93. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +86 -0
  94. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +86 -0
  95. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +100 -0
  96. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +100 -0
  97. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +102 -0
  98. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +100 -0
  99. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +98 -0
  100. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +99 -0
  101. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +100 -0
  102. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +100 -0
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +98 -0
  104. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +96 -0
  105. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +98 -0
  106. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +99 -0
  107. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +98 -0
  108. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +98 -0
  109. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +96 -0
  110. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +99 -0
  111. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +99 -0
  112. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +100 -0
  113. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +100 -0
  114. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +100 -0
  115. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +100 -0
  116. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +99 -0
  117. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +96 -0
  118. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
  120. moai_adk/templates/.moai/config.json +9 -6
  121. moai_adk/templates/.moai/memory/development-guide.md +220 -221
  122. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
  123. moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
  124. moai_adk/templates/.moai/project/product.md +90 -90
  125. moai_adk/templates/.moai/project/structure.md +85 -85
  126. moai_adk/templates/.moai/project/tech.md +117 -117
  127. moai_adk/templates/CLAUDE.md +354 -573
  128. moai_adk/templates/__init__.py +1 -1
  129. moai_adk/utils/__init__.py +1 -1
  130. moai_adk/utils/banner.py +7 -7
  131. moai_adk/utils/logger.py +1 -1
  132. moai_adk-0.4.1.dist-info/METADATA +303 -0
  133. moai_adk-0.4.1.dist-info/RECORD +152 -0
  134. moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -532
  135. moai_adk/templates/.claude/commands/alfred/2-build.md +0 -432
  136. moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
  137. moai_adk-0.3.13.dist-info/METADATA +0 -1586
  138. moai_adk-0.3.13.dist-info/RECORD +0 -90
  139. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
  140. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
  141. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,201 +1,201 @@
1
- # {{PROJECT_NAME}} 개발 가이드
1
+ # {{PROJECT_NAME}} Development Guide
2
2
 
3
- > "명세 없으면 코드 없다. 테스트 없으면 구현 없다."
3
+ > "No spec, no code. No tests, no implementation."
4
4
 
5
- MoAI-ADK 범용 개발 툴킷을 사용하는 모든 에이전트와 개발자를 위한 통합 가드레일이다. Python 기반으로 구축된 툴킷은 모든 주요 프로그래밍 언어를 지원하며, @TAG 추적성을 통한 SPEC 우선 TDD 방법론을 따른다. 한국어가 기본 소통 언어다.
5
+ This unified guardrail applies to every agent and developer who uses the MoAI-ADK universal development toolkit. The Python-based toolkit supports all major programming languages and enforces a SPEC-first TDD methodology with @TAG traceability. English is the default working language.
6
6
 
7
7
  ---
8
8
 
9
- ## SPEC 우선 TDD 워크플로우
9
+ ## SPEC-First TDD Workflow
10
10
 
11
- ### 핵심 개발 루프 (3단계)
11
+ ### Core Development Loop (3 Steps)
12
12
 
13
- 1. **SPEC 작성** (`/alfred:1-spec`) → 명세 없이는 코드 없음
14
- 2. **TDD 구현** (`/alfred:2-build`) → 테스트 없이는 구현 없음
15
- 3. **문서 동기화** (`/alfred:3-sync`) → 추적성 없이는 완성 없음
13
+ 1. **Write the SPEC** (`/alfred:1-plan`) → no code without a spec
14
+ 2. **Implement with TDD** (`/alfred:2-run`) → no implementation without tests
15
+ 3. **Sync Documentation** (`/alfred:3-sync`) → no completion without traceability
16
16
 
17
- ### 온디맨드 지원
17
+ ### On-Demand Support
18
18
 
19
- - **디버깅**: `@agent-debug-helper` 오류 발생 시 호출
20
- - **CLI 명령어**: init, doctor, status, update, restore, help, version
21
- - **시스템 진단**: 언어별 도구 자동 감지 요구사항 검증
19
+ - **Debugging**: summon `@agent-debug-helper` when failures occur
20
+ - **CLI Commands**: init, doctor, status, update, restore, help, version
21
+ - **System Diagnostics**: auto-detect language tooling and verify prerequisites
22
22
 
23
- 모든 변경사항은 @TAG 시스템, SPEC 기반 요구사항, 언어별 TDD 관행을 따른다.
23
+ Every change must comply with the @TAG system, SPEC-derived requirements, and language-specific TDD practices.
24
24
 
25
- ### EARS 요구사항 작성법
25
+ ### EARS Requirement Authoring
26
26
 
27
- **EARS (Easy Approach to Requirements Syntax)**: 체계적인 요구사항 작성 방법론
27
+ **EARS (Easy Approach to Requirements Syntax)** provides a disciplined method for writing requirements.
28
28
 
29
- #### EARS 5가지 구문
30
- 1. **기본 요구사항 (Ubiquitous)**: 시스템은 [기능]을 제공해야 한다
31
- 2. **이벤트 기반 (Event-driven)**: WHEN [조건]이면, 시스템은 [동작]해야 한다
32
- 3. **상태 기반 (State-driven)**: WHILE [상태] 때, 시스템은 [동작]해야 한다
33
- 4. **선택적 기능 (Optional)**: WHERE [조건]이면, 시스템은 [동작]할 수 있다
34
- 5. **제약사항 (Constraints)**: IF [조건]이면, 시스템은 [제약]해야 한다
29
+ #### Five EARS Patterns
30
+ 1. **Ubiquitous Requirements**: The system shall provide [capability].
31
+ 2. **Event-driven Requirements**: WHEN [condition], the system shall [behaviour].
32
+ 3. **State-driven Requirements**: WHILE [state], the system shall [behaviour].
33
+ 4. **Optional Features**: WHERE [condition], the system may [behaviour].
34
+ 5. **Constraints**: IF [condition], the system shall enforce [constraint].
35
35
 
36
- #### 실제 작성 예시
36
+ #### Practical Example
37
37
  ```markdown
38
- ### Ubiquitous Requirements (기본 요구사항)
39
- - 시스템은 사용자 인증 기능을 제공해야 한다
38
+ ### Ubiquitous Requirements (Baseline)
39
+ - The system shall provide user authentication.
40
40
 
41
- ### Event-driven Requirements (이벤트 기반)
42
- - WHEN 사용자가 유효한 자격증명으로 로그인하면, 시스템은 JWT 토큰을 발급해야 한다
43
- - WHEN 토큰이 만료되면, 시스템은 401 에러를 반환해야 한다
41
+ ### Event-driven Requirements
42
+ - WHEN a user logs in with valid credentials, the system shall issue a JWT token.
43
+ - WHEN a token expires, the system shall return a 401 error.
44
44
 
45
- ### State-driven Requirements (상태 기반)
46
- - WHILE 사용자가 인증된 상태일 때, 시스템은 보호된 리소스 접근을 허용해야 한다
45
+ ### State-driven Requirements
46
+ - WHILE the user remains authenticated, the system shall allow access to protected resources.
47
47
 
48
- ### Optional Features (선택적 기능)
49
- - WHERE 리프레시 토큰이 제공되면, 시스템은 새로운 액세스 토큰을 발급할 있다
48
+ ### Optional Features
49
+ - WHERE a refresh token is present, the system may issue a new access token.
50
50
 
51
- ### Constraints (제약사항)
52
- - IF 잘못된 토큰이 제공되면, 시스템은 접근을 거부해야 한다
53
- - 액세스 토큰 만료시간은 15분을 초과하지 않아야 한다
51
+ ### Constraints
52
+ - IF an invalid token is supplied, the system shall deny access.
53
+ - Access tokens shall not exceed a 15-minute lifetime.
54
54
  ```
55
55
 
56
56
  ---
57
57
 
58
- ## Context Engineering (컨텍스트 엔지니어링)
58
+ ## Context Engineering
59
59
 
60
- MoAI-ADK Anthropic "Effective Context Engineering for AI Agents" 원칙을 기반으로 효율적인 컨텍스트 관리를 구현합니다.
60
+ MoAI-ADK follows Anthropic's principles from “Effective Context Engineering for AI Agents to keep context lean and relevant.
61
61
 
62
62
  ### 1. JIT (Just-in-Time) Retrieval
63
63
 
64
- **원칙**: 필요한 순간에만 문서를 로드하여 초기 컨텍스트 부담을 최소화
64
+ **Principle**: Load documents only when needed to minimize initial context load.
65
65
 
66
- **Alfred JIT 전략**:
66
+ **Alfred’s JIT Strategy**:
67
67
 
68
- | 커맨드 | 필수 로드 | 선택적 로드 | 로드 타이밍 |
69
- |--------|----------|------------|------------|
70
- | `/alfred:1-spec` | product.md | structure.md, tech.md | SPEC 후보 발굴 |
71
- | `/alfred:2-build` | SPEC-XXX/spec.md | development-guide.md | TDD 구현 시작 |
72
- | `/alfred:3-sync` | sync-report.md | TAG 체인 검증 (`rg` 스캔) | 문서 동기화 |
68
+ | Command | Required Load | Optional Load | Timing |
69
+ | ---------------- | ---------------- | -------------------------------- | ---------------------------------- |
70
+ | `/alfred:1-plan` | product.md | structure.md, tech.md | While discovering SPEC candidates |
71
+ | `/alfred:2-run` | SPEC-XXX/spec.md | development-guide.md | At the start of TDD implementation |
72
+ | `/alfred:3-sync` | sync-report.md | TAG chain validation (`rg` scan) | During documentation sync |
73
73
 
74
- **구현 방법**:
75
- - Alfred 커맨드 실행 시점에 필요한 문서만 `Read` 도구로 로드
76
- - 에이전트는 자신의 작업에 필요한 문서만 요청
77
- - CLAUDE.md "메모리 전략" 섹션에 명시된 5개 문서는 항상 로드
74
+ **Implementation Notes**:
75
+ - Alfred uses the `Read` tool to load only the necessary documents at command time.
76
+ - Agents request only the documents relevant to their current task.
77
+ - The five documents listed in CLAUDE.md “Memory Strategy” are always loaded.
78
78
 
79
- ### Context Engineering 체크리스트
79
+ ### Context Engineering Checklist
80
80
 
81
- **커맨드 설계 시**:
82
- - [ ] JIT: 필요한 문서만 로드하는가?
83
- - [ ] 선택적 로드: 조건부로 문서를 로드하는가?
81
+ **When designing commands**:
82
+ - [ ] JIT: Do we load only the required documents?
83
+ - [ ] Optional Load: Do we load documents conditionally?
84
84
 
85
- **에이전트 설계 시**:
86
- - [ ] 최소 도구: 필요한 도구만 YAML frontmatter 선언했는가?
87
- - [ ] 명확한 역할: 단일 책임 원칙을 준수하는가?
85
+ **When designing agents**:
86
+ - [ ] Minimum tools: Does the YAML frontmatter declare only the needed tools?
87
+ - [ ] Clear roles: Does each agent maintain a single responsibility?
88
88
 
89
89
  ---
90
90
 
91
- ## TRUST 5원칙
91
+ ## TRUST Principles (5 Pillars)
92
92
 
93
- ### T - 테스트 주도 개발 (SPEC 기반)
93
+ ### T – Test-Driven Development (SPEC-Aligned)
94
94
 
95
- **SPEC → Test → Code 사이클**:
95
+ **SPEC → Test → Code Cycle**:
96
96
 
97
- - **SPEC**: `@SPEC:ID` 태그가 포함된 상세 SPEC 우선 작성 (EARS 방식)
98
- - **RED**: `@TEST:ID` - SPEC 요구사항 기반 실패하는 테스트 작성 실패 확인
99
- - **GREEN**: `@CODE:ID` - 테스트를 통과하고 SPEC을 충족하는 최소한의 코드 구현
100
- - **REFACTOR**: `@CODE:ID` - SPEC 준수를 유지하면서 코드 품질 개선, `@DOC:ID` 문서화
97
+ - **SPEC**: Author detailed specifications first with `@SPEC:ID` tags (EARS format).
98
+ - **RED**: `@TEST:ID` write failing tests tied to SPEC requirements and confirm failure.
99
+ - **GREEN**: `@CODE:ID` implement the minimal code that passes the tests and satisfies the SPEC.
100
+ - **REFACTOR**: `@CODE:ID` improve the code while preserving SPEC compliance, then document with `@DOC:ID`.
101
101
 
102
- **언어별 TDD 구현**:
102
+ **Language-Specific TDD Tooling**:
103
103
 
104
- - **Python**: pytest + SPEC 기반 테스트 케이스 (mypy 타입 힌트)
105
- - **TypeScript**: Vitest + SPEC 기반 테스트 스위트 (strict typing)
106
- - **Java**: JUnit + SPEC 어노테이션 (행동 주도 테스트)
107
- - **Go**: go test + SPEC 테이블 주도 테스트 (인터페이스 준수)
108
- - **Rust**: cargo test + SPEC 문서 테스트 (trait 검증)
109
- - **Ruby**: RSpec + SPEC 기반 BDD 테스트 (행동 명세 우선)
104
+ - **Python**: pytest + SPEC-based test cases (with mypy type hints)
105
+ - **TypeScript**: Vitest + SPEC-driven suites (strict typing)
106
+ - **Java**: JUnit + SPEC annotations (behaviour-driven tests)
107
+ - **Go**: go test + SPEC table-driven tests (interface adherence)
108
+ - **Rust**: cargo test + SPEC doc tests (trait validation)
109
+ - **Ruby**: RSpec + SPEC-based BDD scenarios
110
110
 
111
- 테스트는 @TEST:ID → @CODE:ID 참조를 통해 특정 SPEC 요구사항과 연결한다.
111
+ Each test links SPEC requirements to implementations via `@TEST:ID → @CODE:ID`.
112
112
 
113
- ### R - 요구사항 주도 가독성
113
+ ### R – Requirement-Driven Readability
114
114
 
115
- **SPEC 정렬 클린 코드**:
115
+ **SPEC-Aligned Clean Code**:
116
116
 
117
- - 함수는 SPEC 요구사항을 직접 구현 (함수당 ≤ 50 LOC)
118
- - 변수명은 SPEC 용어와 도메인 언어를 반영
119
- - 코드 구조는 SPEC 설계 결정을 반영
120
- - 주석은 SPEC 설명과 @TAG 참조만 허용
117
+ - Functions implement SPEC requirements directly (≤ 50 LOC per function).
118
+ - Names mirror SPEC terminology and domain language.
119
+ - Code structure reflects SPEC design decisions.
120
+ - Comments are limited to SPEC clarifications and @TAG references.
121
121
 
122
- **언어별 SPEC 구현**:
122
+ **Language-Specific SPEC Implementation**:
123
123
 
124
- - **Python**: SPEC 인터페이스를 반영하는 타입 힌트 + mypy 검증
125
- - **TypeScript**: SPEC 계약과 일치하는 엄격한 인터페이스
126
- - **Java**: SPEC 구성요소 구현 클래스 + 강한 타이핑
127
- - **Go**: SPEC 요구사항 충족 인터페이스 + gofmt
128
- - **Rust**: SPEC 안전 요구사항을 구현하는 타입 + rustfmt
129
- - **Ruby**: SPEC 행동을 반영하는 duck typing + RuboCop 검증
124
+ - **Python**: Type hints mirroring SPEC interfaces + mypy validation
125
+ - **TypeScript**: Strict interfaces that match SPEC contracts
126
+ - **Java**: Classes implementing SPEC components with strong typing
127
+ - **Go**: Interfaces that satisfy SPEC requirements + gofmt
128
+ - **Rust**: Types enforcing SPEC safety requirements + rustfmt
129
+ - **Ruby**: Behaviour reflecting SPEC narratives + RuboCop validation
130
130
 
131
- 모든 코드 요소는 @TAG 주석을 통해 SPEC까지 추적 가능하다.
131
+ Every code element must remain traceable back to the SPEC via @TAG comments.
132
132
 
133
- ### U - 통합 SPEC 아키텍처
133
+ ### U Unified SPEC Architecture
134
134
 
135
- - **SPEC 기반 복잡도 관리**: SPEC은 복잡도 임계값을 정의한다. 초과 새로운 SPEC 또는 명확한 근거가 있는 면제가 필요하다.
136
- - **SPEC 구현 단계**: SPEC 작성과 구현을 분리하며, TDD 사이클 SPEC 수정하지 않는다.
137
- - **언어 SPEC 준수**: Python(모듈), TypeScript(인터페이스), Java(패키지), Go(패키지), Rust(크레이트) 언어별 경계를 SPEC이 정의한다.
138
- - **SPEC 기반 아키텍처**: 도메인 경계는 언어 관례가 아닌 SPEC에 의해 정의되며, @TAG 시스템으로 언어 추적성을 유지한다.
135
+ - **SPEC-Driven Complexity**: Each SPEC defines its complexity threshold. Exceeding it requires a new SPEC or a documented exception.
136
+ - **SPEC vs. Implementation**: Keep authoring and implementation separate; never edit the SPEC mid-TDD cycle.
137
+ - **Language Boundaries**: SPECs define boundaries across languages (Python modules, TypeScript interfaces, Java packages, Go packages, Rust crates, etc.).
138
+ - **SPEC-Guided Architecture**: Domain boundaries follow the SPEC, not language conventions, with the @TAG system ensuring cross-language traceability.
139
139
 
140
- ### S - SPEC 준수 보안
140
+ ### S SPEC-Compliant Security
141
141
 
142
- - **SPEC 보안 요구사항**: 모든 SPEC 보안 요구사항, 데이터 민감도, 접근 제어를 명시적으로 정의한다.
143
- - **보안 by 설계**: 보안 제어는 완료 추가하는 것이 아니라 TDD 단계에서 구현한다.
144
- - **언어 무관 보안 패턴**:
145
- - SPEC 인터페이스 정의 기반 입력 검증
146
- - SPEC 정의 중요 작업에 대한 감사 로깅
147
- - SPEC 권한 모델을 따르는 접근 제어
148
- - SPEC 환경 요구사항별 비밀 관리
142
+ - **Security Requirements**: Every SPEC explicitly defines security needs, data sensitivity, and access control.
143
+ - **Security by Design**: Implement security controls during the TDD cycle, not after completion.
144
+ - **Language-Agnostic Security Patterns**:
145
+ - Input validation based on SPEC interface definitions
146
+ - Audit logging for SPEC-defined critical operations
147
+ - Access controls aligned with the SPEC permission model
148
+ - Secret management tailored to SPEC environment requirements
149
149
 
150
- ### T - SPEC 추적성
150
+ ### T SPEC Traceability
151
151
 
152
- - **SPEC-코드 추적성**: 모든 코드 변경은 @TAG 시스템을 통해 SPEC ID와 특정 요구사항을 참조한다.
153
- - **3단계 워크플로우 추적**:
154
- - `/alfred:1-spec`: `@SPEC:ID` 태그로 SPEC 작성 (.moai/specs/)
155
- - `/alfred:2-build`: `@TEST:ID` (tests/) → `@CODE:ID` (src/) TDD 구현
156
- - `/alfred:3-sync`: `@DOC:ID` (docs/) 문서 동기화, 전체 TAG 검증
157
- - **코드 스캔 기반 추적성**: 중간 캐시 없이 `rg '@(SPEC|TEST|CODE|DOC):' -n`으로 코드를 직접 스캔하여 TAG 추적성 보장한다.
152
+ - **Spec-to-Code Traceability**: Every code change references SPEC IDs and requirements through the @TAG system.
153
+ - **Three-Stage Workflow Trace**:
154
+ - `/alfred:1-plan`: Write SPECs with `@SPEC:ID` tags (`.moai/specs/`)
155
+ - `/alfred:2-run`: Implement via TDD with `@TEST:ID` (tests/) → `@CODE:ID` (src/)
156
+ - `/alfred:3-sync`: Sync documentation using `@DOC:ID` (docs/) and validate TAG coverage
157
+ - **Code Scan Verification**: Guarantee TAG traceability by scanning the codebase directly with `rg '@(SPEC|TEST|CODE|DOC):' -n`, without intermediate caches.
158
158
 
159
159
  ---
160
160
 
161
- ## SPEC 우선 사고방식
161
+ ## SPEC-First Mindset
162
162
 
163
- 1. **SPEC 기반 의사결정**: 모든 기술적 결정은 기존 SPEC을 참조하거나 새로운 SPEC을 만든다. 명확한 요구사항 없이는 구현하지 않는다.
164
- 2. **SPEC 맥락 읽기**: 코드 변경 전에 관련 SPEC 문서를 읽고, @TAG 관계를 파악하고, 준수를 검증한다.
165
- 3. **SPEC 소통**: 한국어가 기본 소통 언어다. 모든 SPEC 문서는 기술 용어는 영어로, 설명은 명확한 한국어로 작성한다.
163
+ 1. **SPEC-Led Decisions**: Reference an existing SPEC or author a new one before making any technical decision. Never implement without clear requirements.
164
+ 2. **SPEC Context Review**: Read the relevant SPEC documents before changing code, understand the @TAG relationships, and confirm compliance.
165
+ 3. **SPEC Communication**: Default to English for collaboration. SPEC documents should use precise technical terminology and plain, unambiguous explanations.
166
166
 
167
- ## SPEC-TDD 워크플로우
167
+ ## SPEC-TDD Workflow
168
168
 
169
- 1. **SPEC 우선**: 코드 작성 전에 SPEC 생성하거나 참조한다. `/alfred:1-spec`을 사용하여 요구사항, 설계, 작업을 명확히 정의한다.
170
- 2. **TDD 구현**: Red-Green-Refactor 엄격히 따른다. 언어별 적절한 테스트 프레임워크와 함께 `/alfred:2-build`를 사용한다.
171
- 3. **추적성 동기화**: `/alfred:3-sync`를 실행하여 문서를 업데이트하고 SPEC과 코드 @TAG 관계를 유지한다.
169
+ 1. **Start with the SPEC**: Author or reference a SPEC before writing code. Use `/alfred:1-plan` to clarify requirements, design, and tasks.
170
+ 2. **Implement with TDD**: Follow the RedGreenRefactor loop rigorously using `/alfred:2-run` with language-appropriate testing frameworks.
171
+ 3. **Maintain Traceability**: Run `/alfred:3-sync` to update documentation and preserve @TAG relationships between SPECs and code.
172
172
 
173
- ## @TAG 시스템
173
+ ## @TAG System
174
174
 
175
- ### 핵심 체계
175
+ ### Core Chain
176
176
 
177
177
  ```text
178
178
  @SPEC:ID → @TEST:ID → @CODE:ID → @DOC:ID
179
179
  ```
180
180
 
181
- **TDD 완벽 정렬**:
182
- - `@SPEC:ID` (사전 준비) - EARS 방식 요구사항 명세
183
- - `@TEST:ID` (RED) - 실패하는 테스트 작성
184
- - `@CODE:ID` (GREEN + REFACTOR) - 구현 리팩토링
185
- - `@DOC:ID` (문서화) - Living Document 생성
181
+ **Perfect TDD Alignment**:
182
+ - `@SPEC:ID` (Preparation) requirements authored with the EARS pattern
183
+ - `@TEST:ID` (RED) failing tests derived from the SPEC
184
+ - `@CODE:ID` (GREEN + REFACTOR) implementation and refactoring
185
+ - `@DOC:ID` (Documentation) live documents that capture the outcome
186
186
 
187
- ### TAG BLOCK 템플릿
187
+ ### TAG Block Template
188
188
 
189
- > **📋 SPEC 메타데이터 표준 (SSOT)**: `spec-metadata.md`
189
+ > **📋 SPEC Metadata Standard (SSOT)**: see `spec-metadata.md`
190
190
 
191
- **모든 SPEC 문서는 YAML Front Matter + HISTORY 섹션을 포함**해야 합니다:
192
- - **필수 필드 7개**: id, version, status, created, updated, author, priority
193
- - **선택 필드 9개**: category, labels, depends_on, blocks, related_specs, related_issue, scope
194
- - **HISTORY 섹션**: 모든 버전 변경 이력 기록 (필수)
191
+ **Every SPEC document must include YAML front matter and a HISTORY section**:
192
+ - **Required Fields (7)**: id, version, status, created, updated, author, priority
193
+ - **Optional Fields (9)**: category, labels, depends_on, blocks, related_specs, related_issue, scope
194
+ - **HISTORY Section**: log every version change (mandatory)
195
195
 
196
- **전체 템플릿, 필드 상세 설명, 검증 방법**: `spec-metadata.md` 참조
196
+ Find the complete template, field descriptions, and validation commands in `spec-metadata.md`.
197
197
 
198
- **간단한 참조 예시**:
198
+ **Quick Reference Example**:
199
199
  ```yaml
200
200
  ---
201
201
  id: AUTH-001
@@ -207,139 +207,138 @@ author: @Goos
207
207
  priority: high
208
208
  ---
209
209
 
210
- # @SPEC:AUTH-001: JWT 인증 시스템
210
+ # @SPEC:AUTH-001: JWT Authentication System
211
211
 
212
212
  ## HISTORY
213
213
  ### v0.0.1 (2025-09-15)
214
- - **INITIAL**: JWT 기반 인증 시스템 명세 작성
214
+ - **INITIAL**: Authored the JWT authentication system SPEC
215
215
  ...
216
216
  ```
217
217
 
218
- **소스 코드 (src/)**:
218
+ **Source Code (`src/`)**:
219
219
  ```text
220
220
  # @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/auth/service.test.ts
221
221
  ```
222
222
 
223
- **테스트 코드 (tests/)**:
223
+ **Test Code (`tests/`)**:
224
224
  ```text
225
225
  # @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
226
226
  ```
227
227
 
228
- ### @CODE 서브 카테고리 (주석 레벨)
229
-
230
- 구현 세부사항은 `@CODE:ID` 내부에 주석으로 표기:
231
- - `@CODE:ID:API` - REST API, GraphQL 엔드포인트
232
- - `@CODE:ID:UI` - 컴포넌트, 뷰, 화면
233
- - `@CODE:ID:DATA` - 데이터 모델, 스키마, 타입
234
- - `@CODE:ID:DOMAIN` - 비즈니스 로직, 도메인 규칙
235
- - `@CODE:ID:INFRA` - 인프라, 데이터베이스, 외부 연동
236
-
237
- ### TAG 사용 규칙
238
-
239
- - **TAG ID**: `<도메인>-<3자리>` (예: `AUTH-003`) - **영구 불변**
240
- - **디렉토리 명명 규칙**: `.moai/specs/SPEC-{ID}/` (필수)
241
- - ✅ **올바른 예**: `SPEC-AUTH-001/`, `SPEC-REFACTOR-001/`, `SPEC-UPDATE-REFACTOR-001/`
242
- - ❌ **잘못된 예**: `AUTH-001/`, `SPEC-001-auth/`, `SPEC-AUTH-001-jwt/`
243
- - **복합 도메인**: 하이픈으로 연결 가능 (예: `UPDATE-REFACTOR-001`)
244
- - **경고**: 하이픈 3개 이상 연결 단순화 권장
245
- - **TAG 내용**: 자유롭게 수정 가능 (HISTORY에 기록 필수)
246
- - **버전 관리**: Semantic Versioning (v0.0.1 → v0.1.0 → v1.0.0)
247
- - 상세 버전 체계: `spec-metadata.md#버전-체계` 참조
248
- - **새 TAG 생성 전 중복 확인**: `rg "@SPEC:{ID}" -n .moai/specs/` (필수)
249
- - **TAG 검증**: `rg '@(SPEC|TEST|CODE|DOC):' -n .moai/specs/ tests/ src/ docs/`
250
- - **SPEC 버전 일치성 확인**: `rg "SPEC-{ID}.md v" -n`
251
- - **CODE-FIRST 원칙**: TAG의 진실은 코드 자체에만 존재
252
-
253
- ### HISTORY 작성 가이드
254
-
255
- **변경 유형 태그**:
256
- - `INITIAL`: 최초 작성 (v1.0.0)
257
- - `ADDED`: 기능/요구사항 추가Minor 버전 증가
258
- - `CHANGED`: 기존 내용 수정 Patch 버전 증가
259
- - `FIXED`: 버그/오류 수정Patch 버전 증가
260
- - `REMOVED`: 기능/요구사항 제거Major 버전 증가
261
- - `BREAKING`: 하위 호환성 깨지는 변경 Major 버전 증가
262
- - `DEPRECATED`: 향후 제거 예정 표시
263
-
264
- **필수 메타데이터**:
265
- - `AUTHOR`: 작성자/수정자 (GitHub ID)
266
- - `REVIEW`: 리뷰어 승인 상태
267
- - `REASON`: 변경 이유 (선택사항, 중요 변경 권장)
268
- - `RELATED`: 관련 이슈/PR 번호 (선택사항)
269
-
270
- **HISTORY 검색 예시**:
228
+ ### @CODE Subcategories (Comment Level)
229
+
230
+ Document implementation details inside `@CODE:ID` blocks:
231
+ - `@CODE:ID:API` REST APIs, GraphQL endpoints
232
+ - `@CODE:ID:UI` UI components, views, screens
233
+ - `@CODE:ID:DATA` data models, schemas, types
234
+ - `@CODE:ID:DOMAIN` business logic, domain rules
235
+ - `@CODE:ID:INFRA` infrastructure, databases, integrations
236
+
237
+ ### TAG Usage Rules
238
+
239
+ - **TAG ID Format**: `<DOMAIN>-<3 digits>` (e.g., `AUTH-003`) immutable once created.
240
+ - **Directory Naming**: `.moai/specs/SPEC-{ID}/` (required)
241
+ - ✅ Valid: `SPEC-AUTH-001/`, `SPEC-REFACTOR-001/`, `SPEC-UPDATE-REFACTOR-001/`
242
+ - ❌ Invalid: `AUTH-001/`, `SPEC-001-auth/`, `SPEC-AUTH-001-jwt/`
243
+ - **Composite Domains**: hyphenated combinations allowed (e.g., `UPDATE-REFACTOR-001`)
244
+ - **Guideline**: Prefer fewer than three hyphen segments for clarity
245
+ - **TAG Contents**: May evolve freely; always record the rationale in HISTORY.
246
+ - **Versioning**: Semantic Versioning (v0.0.1 → v0.1.0 → v1.0.0)
247
+ - See `spec-metadata.md#versioning` for details.
248
+ - **Duplicate Check**: Run `rg "@SPEC:{ID}" -n .moai/specs/` before creating a new TAG.
249
+ - **TAG Validation**: `rg '@(SPEC|TEST|CODE|DOC):' -n .moai/specs/ tests/ src/ docs/`
250
+ - **Version Alignment**: `rg "SPEC-{ID}.md v" -n`
251
+ - **Code-First Principle**: The source of truth for TAGs lives in the codebase.
252
+
253
+ ### HISTORY Authoring Guide
254
+
255
+ **Change Type Tags**:
256
+ - `INITIAL`: First release (v1.0.0)
257
+ - `ADDED`: New requirement or capability increment MINOR
258
+ - `CHANGED`: Adjusted behaviourincrement PATCH
259
+ - `FIXED`: Bug or defect fix increment PATCH
260
+ - `REMOVED`: Removed capabilityincrement MAJOR
261
+ - `BREAKING`: Backward-incompatible changeincrement MAJOR
262
+ - `DEPRECATED`: Marked for future removal
263
+
264
+ **Required Metadata**:
265
+ - `AUTHOR`: Contributor (GitHub ID)
266
+ - `REVIEW`: Reviewer and approval status
267
+ - `REASON`: Why the change was made (optional but recommended for significant updates)
268
+ - `RELATED`: Linked issues/PRs (optional)
269
+
270
+ **HISTORY Search Examples**:
271
271
  ```bash
272
- # 특정 TAG의 전체 변경 이력 조회
272
+ # View the full change log for a TAG
273
273
  rg -A 20 "# @SPEC:AUTH-001" .moai/specs/SPEC-AUTH-001.md
274
274
 
275
- # HISTORY 섹션만 추출
275
+ # Extract only the HISTORY section
276
276
  rg -A 50 "## HISTORY" .moai/specs/SPEC-AUTH-001.md
277
277
 
278
- # 최근 변경 사항만 확인
278
+ # Check the latest entries
279
279
  rg "### v[0-9]" .moai/specs/SPEC-AUTH-001.md | head -3
280
280
  ```
281
281
 
282
-
283
282
  ---
284
283
 
285
- ## 개발 원칙
284
+ ## Development Principles
286
285
 
287
- ### 코드 제약
286
+ ### Code Constraints
288
287
 
289
- - 파일당 300 LOC 이하
290
- - 함수당 50 LOC 이하
291
- - 매개변수 5 이하
292
- - 복잡도 10 이하
288
+ - 300 LOC per file
289
+ - 50 LOC per function
290
+ - 5 parameters per function
291
+ - Cyclomatic complexity ≤ 10
293
292
 
294
- ### 품질 기준
293
+ ### Quality Benchmarks
295
294
 
296
- - 테스트 커버리지 85% 이상
297
- - 의도 드러내는 이름 사용
298
- - 가드절 우선 사용
299
- - 언어별 표준 도구 활용
295
+ - 85% test coverage
296
+ - Use intention-revealing names
297
+ - Prefer guard clauses
298
+ - Leverage language-standard tooling
300
299
 
301
- ### 리팩토링 규칙
300
+ ### Refactoring Rules
302
301
 
303
- - **3회 반복 규칙**: 패턴의 3번째 반복 리팩토링 계획
304
- - **준비 리팩토링**: 변경을 쉽게 만드는 환경 준비 변경 적용
305
- - **즉시 정리**: 작은 문제는 즉시 수정, 범위 확대 별도 작업으로 분리
302
+ - **Rule of Three**: Plan refactoring when the same pattern appears a third time.
303
+ - **Preparatory Refactoring**: Shape the code for easy change before applying the change.
304
+ - **Tidy as You Go**: Fix small issues immediately; when scope expands, split into a dedicated effort.
306
305
 
307
- ## 예외 처리
306
+ ## Exception Handling
308
307
 
309
- 권장사항을 초과하거나 벗어날 Waiver를 작성하여 PR/Issue/ADR에 첨부한다.
308
+ When deviating from recommendations, document a waiver and attach it to the relevant PR, issue, or ADR.
310
309
 
311
- **Waiver 필수 포함 사항**:
310
+ **Waiver Checklist**:
312
311
 
313
- - 이유와 검토한 대안
314
- - 위험과 완화 방안
315
- - 임시/영구 상태
316
- - 만료 조건과 승인자
312
+ - Justification and evaluated alternatives
313
+ - Risks and mitigation plan
314
+ - Temporary vs. permanent status
315
+ - Expiry conditions and approver
317
316
 
318
- ## 언어별 도구 매핑
317
+ ## Language Tooling Map
319
318
 
320
- - **Python**: pytest (테스트), mypy (타입 검사), black (포맷)
321
- - **TypeScript**: Vitest (테스트), Biome (린터+포맷)
322
- - **Java**: JUnit (테스트), Maven/Gradle (빌드)
323
- - **Go**: go test (테스트), gofmt (포맷)
324
- - **Rust**: cargo test (테스트), rustfmt (포맷)
325
- - **Ruby**: RSpec (테스트), RuboCop (린터+포맷), Bundler (패키지 관리)
319
+ - **Python**: pytest (tests), mypy (type checks), black (formatting)
320
+ - **TypeScript**: Vitest (tests), Biome (lint + format)
321
+ - **Java**: JUnit (tests), Maven/Gradle (build)
322
+ - **Go**: go test (tests), gofmt (format)
323
+ - **Rust**: cargo test (tests), rustfmt (format)
324
+ - **Ruby**: RSpec (tests), RuboCop (lint + format), Bundler (packages)
326
325
 
327
- ## 변수 역할 참고
326
+ ## Variable Role Reference
328
327
 
329
- | Role | Description | Example |
330
- | ------------------ | ----------------------------------- | ------------------------------------- |
331
- | Fixed Value | Constant after initialization | `const MAX_SIZE = 100` |
332
- | Stepper | Changes sequentially | `for (let i = 0; i < n; i++)` |
333
- | Flag | Boolean state indicator | `let isValid = true` |
334
- | Walker | Traverses a data structure | `while (node) { node = node.next; }` |
335
- | Most Recent Holder | Holds the most recent value | `let lastError` |
336
- | Most Wanted Holder | Holds optimal/maximum value | `let bestScore = -Infinity` |
337
- | Gatherer | Accumulator | `sum += value` |
338
- | Container | Stores multiple values | `const list = []` |
339
- | Follower | Previous value of another variable | `prev = curr; curr = next;` |
340
- | Organizer | Reorganizes data | `const sorted = array.sort()` |
341
- | Temporary | Temporary storage | `const temp = a; a = b; b = temp;` |
328
+ | Role | Description | Example |
329
+ | ------------------ | ---------------------------------- | ------------------------------------ |
330
+ | Fixed Value | Constant after initialization | `const MAX_SIZE = 100` |
331
+ | Stepper | Changes sequentially | `for (let i = 0; i < n; i++)` |
332
+ | Flag | Boolean state indicator | `let isValid = true` |
333
+ | Walker | Traverses a data structure | `while (node) { node = node.next; }` |
334
+ | Most Recent Holder | Holds the most recent value | `let lastError` |
335
+ | Most Wanted Holder | Holds optimal/maximum value | `let bestScore = -Infinity` |
336
+ | Gatherer | Accumulator | `sum += value` |
337
+ | Container | Stores multiple values | `const list = []` |
338
+ | Follower | Previous value of another variable | `prev = curr; curr = next;` |
339
+ | Organizer | Reorganizes data | `const sorted = array.sort()` |
340
+ | Temporary | Temporary storage | `const temp = a; a = b; b = temp;` |
342
341
 
343
342
  ---
344
343
 
345
- 가이드는 MoAI-ADK 3단계 파이프라인을 실행하는 표준을 제공한다.
344
+ This guide defines the standards for executing the three-stage MoAI-ADK pipeline.