moai-adk 0.8.3__py3-none-any.whl → 0.9.0__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (27) hide show
  1. moai_adk/templates/.claude/hooks/alfred/core/project.py +750 -0
  2. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +77 -10
  3. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +140 -30
  4. moai_adk/templates/README.md +256 -0
  5. {moai_adk-0.8.3.dist-info → moai_adk-0.9.0.dist-info}/METADATA +333 -35
  6. {moai_adk-0.8.3.dist-info → moai_adk-0.9.0.dist-info}/RECORD +9 -25
  7. moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +0 -9
  8. moai_adk/templates/.claude/hooks/alfred/README.md +0 -343
  9. moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +0 -471
  10. moai_adk/templates/.github/workflows/tag-report.yml +0 -261
  11. moai_adk/templates/.github/workflows/tag-validation.yml +0 -176
  12. moai_adk/templates/.moai/docs/quick-issue-creation-guide.md +0 -219
  13. moai_adk/templates/.moai/hooks/install.sh +0 -79
  14. moai_adk/templates/.moai/hooks/pre-commit.sh +0 -66
  15. moai_adk/templates/.moai/memory/CONFIG-SCHEMA.md +0 -444
  16. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
  17. moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
  18. moai_adk/templates/src/moai_adk/core/__init__.py +0 -5
  19. moai_adk/templates/src/moai_adk/core/tags/__init__.py +0 -86
  20. moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +0 -433
  21. moai_adk/templates/src/moai_adk/core/tags/cli.py +0 -283
  22. moai_adk/templates/src/moai_adk/core/tags/pre_commit_validator.py +0 -355
  23. moai_adk/templates/src/moai_adk/core/tags/reporter.py +0 -957
  24. moai_adk/templates/src/moai_adk/core/tags/validator.py +0 -897
  25. {moai_adk-0.8.3.dist-info → moai_adk-0.9.0.dist-info}/WHEEL +0 -0
  26. {moai_adk-0.8.3.dist-info → moai_adk-0.9.0.dist-info}/entry_points.txt +0 -0
  27. {moai_adk-0.8.3.dist-info → moai_adk-0.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -16,6 +16,58 @@ from typing import Any
16
16
  CACHE_DIR_NAME = ".moai/cache"
17
17
 
18
18
 
19
+ def find_project_root(start_path: str | Path = ".") -> Path:
20
+ """Find MoAI-ADK project root by searching upward for .moai/config.json
21
+
22
+ Traverses up the directory tree until it finds .moai/config.json or CLAUDE.md,
23
+ which indicates the project root. This ensures cache and other files are
24
+ always created in the correct location, regardless of where hooks execute.
25
+
26
+ Args:
27
+ start_path: Starting directory (default: current directory)
28
+
29
+ Returns:
30
+ Project root Path. If not found, returns start_path as absolute path.
31
+
32
+ Examples:
33
+ >>> find_project_root(".")
34
+ Path("/Users/user/my-project")
35
+ >>> find_project_root(".claude/hooks/alfred")
36
+ Path("/Users/user/my-project") # Found root 3 levels up
37
+
38
+ Notes:
39
+ - Searches for .moai/config.json first (most reliable)
40
+ - Falls back to CLAUDE.md if config.json not found
41
+ - Max depth: 10 levels up (prevent infinite loop)
42
+ - Returns absolute path for consistency
43
+
44
+ TDD History:
45
+ - RED: 4 test scenarios (root, nested, not found, symlinks)
46
+ - GREEN: Minimal upward search with .moai/config.json detection
47
+ - REFACTOR: Add CLAUDE.md fallback, max depth limit, absolute path return
48
+ """
49
+ current = Path(start_path).resolve()
50
+ max_depth = 10 # Prevent infinite loop
51
+
52
+ for _ in range(max_depth):
53
+ # Check for .moai/config.json (primary indicator)
54
+ if (current / ".moai" / "config.json").exists():
55
+ return current
56
+
57
+ # Check for CLAUDE.md (secondary indicator)
58
+ if (current / "CLAUDE.md").exists():
59
+ return current
60
+
61
+ # Move up one level
62
+ parent = current.parent
63
+ if parent == current: # Reached filesystem root
64
+ break
65
+ current = parent
66
+
67
+ # Not found - return start_path as absolute
68
+ return Path(start_path).resolve()
69
+
70
+
19
71
  class TimeoutError(Exception):
20
72
  """Signal-based timeout exception"""
21
73
  pass
@@ -246,7 +298,7 @@ def count_specs(cwd: str) -> dict[str, int]:
246
298
  Counts the number of SPECs with status: completed.
247
299
 
248
300
  Args:
249
- cwd: Project root directory path
301
+ cwd: Project root directory path (or any subdirectory, will search upward)
250
302
 
251
303
  Returns:
252
304
  SPEC progress dictionary. Includes the following keys:
@@ -264,15 +316,19 @@ def count_specs(cwd: str) -> dict[str, int]:
264
316
 
265
317
  Notes:
266
318
  - SPEC File Location: .moai/specs/SPEC-{ID}/spec.md
267
- - Completion condition: Include status: completed in YAML front matter
319
+ - Completion condition: Include "status: completed" in YAML front matter
268
320
  - If parsing fails, the SPEC is considered incomplete.
321
+ - Automatically finds project root to locate .moai/specs/
269
322
 
270
323
  TDD History:
271
324
  - RED: 5 items scenario test (0/0, 2/5, 5/5, no directory, parsing error)
272
325
  - GREEN: SPEC search with Path.iterdir(), YAML parsing implementation
273
326
  - REFACTOR: Strengthened exception handling, improved percentage calculation safety
327
+ - UPDATE: Add project root detection for consistent path resolution
274
328
  """
275
- specs_dir = Path(cwd) / ".moai" / "specs"
329
+ # Find project root to ensure we read specs from correct location
330
+ project_root = find_project_root(cwd)
331
+ specs_dir = project_root / ".moai" / "specs"
276
332
 
277
333
  if not specs_dir.exists():
278
334
  return {"completed": 0, "total": 0, "percentage": 0}
@@ -316,7 +372,7 @@ def get_project_language(cwd: str) -> str:
316
372
  """Determine the primary project language (prefers config.json).
317
373
 
318
374
  Args:
319
- cwd: Project root directory.
375
+ cwd: Project root directory (or any subdirectory, will search upward).
320
376
 
321
377
  Returns:
322
378
  Language string in lower-case.
@@ -324,8 +380,11 @@ def get_project_language(cwd: str) -> str:
324
380
  Notes:
325
381
  - Reads ``.moai/config.json`` first for a quick answer.
326
382
  - Falls back to ``detect_language`` if configuration is missing.
383
+ - Automatically finds project root to locate .moai/config.json
327
384
  """
328
- config_path = Path(cwd) / ".moai" / "config.json"
385
+ # Find project root to ensure we read config from correct location
386
+ project_root = find_project_root(cwd)
387
+ config_path = project_root / ".moai" / "config.json"
329
388
  if config_path.exists():
330
389
  try:
331
390
  config = json.loads(config_path.read_text())
@@ -336,8 +395,8 @@ def get_project_language(cwd: str) -> str:
336
395
  # Fall back to detection on parse errors
337
396
  pass
338
397
 
339
- # Fall back to the original language detection routine
340
- return detect_language(cwd)
398
+ # Fall back to the original language detection routine (use project root)
399
+ return detect_language(str(project_root))
341
400
 
342
401
 
343
402
  # @CODE:CONFIG-INTEGRATION-001
@@ -382,7 +441,9 @@ def get_version_check_config(cwd: str) -> dict[str, Any]:
382
441
  "cache_ttl_hours": 24
383
442
  }
384
443
 
385
- config_path = Path(cwd) / ".moai" / "config.json"
444
+ # Find project root to ensure we read config from correct location
445
+ project_root = find_project_root(cwd)
446
+ config_path = project_root / ".moai" / "config.json"
386
447
  if not config_path.exists():
387
448
  return defaults
388
449
 
@@ -560,8 +621,13 @@ def get_package_version_info(cwd: str = ".") -> dict[str, Any]:
560
621
  # Graceful degradation: skip caching on import errors
561
622
  VersionCache = None
562
623
 
563
- # 1. Initialize cache (skip if VersionCache couldn't be imported)
564
- cache_dir = Path(cwd) / CACHE_DIR_NAME
624
+ # 1. Find project root (ensure cache is always in correct location)
625
+ # This prevents creating .moai/cache in wrong locations when hooks run
626
+ # from subdirectories like .claude/hooks/alfred/
627
+ project_root = find_project_root(cwd)
628
+
629
+ # 2. Initialize cache (skip if VersionCache couldn't be imported)
630
+ cache_dir = project_root / CACHE_DIR_NAME
565
631
  version_cache = VersionCache(cache_dir) if VersionCache else None
566
632
 
567
633
  # 2. Get current installed version first (needed for cache validation)
@@ -672,6 +738,7 @@ def get_package_version_info(cwd: str = ".") -> dict[str, Any]:
672
738
 
673
739
 
674
740
  __all__ = [
741
+ "find_project_root",
675
742
  "detect_language",
676
743
  "get_git_info",
677
744
  "count_specs",
@@ -1,36 +1,40 @@
1
- # GitFlow Advisory Policy
1
+ # GitFlow Protection Policy
2
2
 
3
- **Document ID**: @DOC:GITFLOW-POLICY-001
4
- **Published**: 2025-10-17
5
- **Status**: Advisory (recommended, not enforced)
3
+ **Document ID**: @DOC:GITFLOW-POLICY-ALIAS
4
+ **Published**: 2025-10-17
5
+ **Updated**: 2025-10-29
6
+ **Status**: **Enforced via GitHub Branch Protection** (v0.8.3+)
6
7
  **Scope**: Personal and Team modes
7
8
 
8
9
  ---
9
10
 
10
11
  ## Overview
11
12
 
12
- MoAI-ADK **recommends** a GitFlow-inspired workflow. This policy shares best practices while letting teams adapt them as needed.
13
+ MoAI-ADK **enforces** a GitFlow-inspired workflow through GitHub Branch Protection. As of v0.8.3, the `main` branch is protected and requires Pull Requests for all changes, including from administrators.
13
14
 
14
- ## Key Recommendations
15
+ **What Changed**: Previously (v0.3.5-v0.8.2), we used an advisory approach with warnings. Now we enforce proper GitFlow to ensure code quality and prevent accidental direct pushes to main.
15
16
 
16
- ### 1. Main Branch Access (Recommended)
17
+ ## Key Requirements (Enforced)
17
18
 
18
- | Recommendation | Summary | Enforcement |
19
- |----------------|---------|-------------|
20
- | **Merge via develop** | Prefer merging `develop` into `main` | Advisory ⚠️ |
21
- | **Feature branches off develop** | Branch from `develop` and raise PRs back to `develop` | Advisory ⚠️ |
22
- | **Release process** | Release flow: `develop` → `main` (release engineer encouraged) | Advisory ⚠️ |
23
- | **Force push** | Warn when force-pushing, but allow it | Warning ⚠️ |
24
- | **Direct push** | Warn on direct pushes to `main`, but allow them | Warning ⚠️ |
19
+ ### 1. Main Branch Access (Enforced)
25
20
 
26
- ### 2. Git Workflow (Recommended)
21
+ | Requirement | Summary | Enforcement |
22
+ |-------------|---------|-------------|
23
+ | **Merge via develop** | MUST merge `develop` into `main` | ✅ Enforced |
24
+ | **Feature branches off develop** | MUST branch from `develop` and raise PRs back to `develop` | ✅ Enforced |
25
+ | **Release process** | Release flow: `develop` → `main` (PR required) | ✅ Enforced |
26
+ | **Force push** | Blocked on `main` | ✅ Blocked |
27
+ | **Direct push** | Blocked on `main` (PR required) | ✅ Blocked |
28
+
29
+ ### 2. Git Workflow (Required)
27
30
 
28
31
  ```
29
32
  ┌─────────────────────────────────────────────────────────┐
30
- RECOMMENDED GITFLOW
33
+ ENFORCED GITFLOW
34
+ │ (GitHub Branch Protection Active) │
31
35
  └─────────────────────────────────────────────────────────┘
32
36
 
33
- develop (recommended base branch)
37
+ develop (required base branch)
34
38
  ↑ ↓
35
39
  ┌─────────────────┐
36
40
  │ │
@@ -46,13 +50,15 @@ feature/SPEC-{ID} [PR: feature -> develop]
46
50
  │ (release manager prepares)
47
51
 
48
52
  [PR: develop -> main]
53
+ [Code review + approval REQUIRED]
54
+ [All discussions resolved]
49
55
  [CI/CD validation]
50
56
  [tag creation]
51
57
 
52
- main (release)
58
+ main (protected release)
53
59
  ```
54
60
 
55
- **Flexibility**: Direct pushes to `main` are still possible, but the workflow above is preferred.
61
+ **Enforcement**: Direct pushes to `main` are **blocked** via GitHub Branch Protection. All changes must go through Pull Requests.
56
62
 
57
63
  ## Technical Implementation
58
64
 
@@ -156,18 +162,29 @@ git push origin v1.0.0
156
162
 
157
163
  ## Policy Modes
158
164
 
159
- ### Strict Mode (Legacy, Currently Disabled)
165
+ ### Strict Mode (Active, v0.8.3+) ✅ ENFORCED
166
+
167
+ **GitHub Branch Protection Enabled**:
168
+ - ✅ **enforce_admins: true** - Administrators must follow all rules
169
+ - ✅ **required_pull_request_reviews** - 1 approval required
170
+ - ✅ **required_conversation_resolution** - All discussions must be resolved
171
+ - ✅ **Block direct pushes to `main`** - PR required for all users
172
+ - ✅ **Block force pushes** - Prevents history rewriting
173
+ - ✅ **Block branch deletion** - Protects main from accidental deletion
160
174
 
161
- - Block direct pushes to `main`
162
- - ❌ Block force pushes
163
- - Block merges into `main` from any branch other than `develop`
175
+ **What This Means**:
176
+ - ❌ No one (including admins) can push directly to `main`
177
+ - All changes must go through Pull Requests
178
+ - ✅ PRs require code review approval
179
+ - ✅ All code discussions must be resolved before merge
180
+ - ✅ Enforces proper GitFlow: feature → develop → main
164
181
 
165
- ### Advisory Mode (Active, v0.3.5+)
182
+ ### Advisory Mode (Legacy, v0.3.5 - v0.8.2)
166
183
 
167
- - ⚠️ Warn but allow direct pushes to `main`
168
- - ⚠️ Warn but allow force pushes
169
- - ⚠️ Recommend best practices while preserving flexibility
170
- - Respect user judgment
184
+ - ⚠️ Warned but allowed direct pushes to `main`
185
+ - ⚠️ Warned but allowed force pushes
186
+ - ⚠️ Recommended best practices while preserving flexibility
187
+ - **Deprecated** - Replaced by Strict Mode for better quality control
171
188
 
172
189
  ---
173
190
 
@@ -202,8 +219,98 @@ A: Yes. Expect an advisory warning, yet the push continues.
202
219
  **Q: Can I disable the hook entirely?**
203
220
  A: Yes. Remove `.git/hooks/pre-push` or strip its execute permission.
204
221
 
205
- **Q: Why switch to Advisory Mode?**
206
- A: To promote best practices while respecting contributor flexibility and judgment.
222
+ **Q: Why switch to Advisory Mode?**
223
+ A: Advisory Mode was used in v0.3.5-v0.8.2. As of v0.8.3, we've switched to Strict Mode with GitHub Branch Protection for better quality control.
224
+
225
+ **Q: What if develop falls behind main?**
226
+ A: This can happen when hotfixes or releases go directly to main. Regularly sync main → develop to prevent divergence. See "Maintaining develop-main Sync" section below.
227
+
228
+ **Q: Can I bypass branch protection in emergencies?**
229
+ A: No. Even administrators must follow the PR process. For true emergencies, temporarily disable protection via GitHub Settings (requires admin access), but re-enable immediately after.
230
+
231
+ ---
232
+
233
+ ## Maintaining develop-main Sync
234
+
235
+ ### ⚠️ Critical Rule: develop Must Stay Current
236
+
237
+ **Problem**: When main receives direct commits (hotfixes, emergency releases) without syncing back to develop, GitFlow breaks:
238
+
239
+ ```
240
+ ❌ BAD STATE:
241
+ develop: 3 commits ahead, 29 commits behind main
242
+ - develop has outdated dependencies
243
+ - New features branch from old code
244
+ - Merge conflicts multiply over time
245
+ ```
246
+
247
+ ### Signs of Drift
248
+
249
+ Monitor for these warnings:
250
+ - `git status` shows "Your branch is X commits behind main"
251
+ - Feature branches conflict with main during PR
252
+ - CI/CD failures due to dependency mismatches
253
+ - Version numbers in develop don't match main
254
+
255
+ ### Recovery Procedure
256
+
257
+ When develop falls behind main:
258
+
259
+ 1. **Assess the Gap**
260
+ ```bash
261
+ git log --oneline develop..main # Commits in main but not develop
262
+ git log --oneline main..develop # Commits in develop but not main
263
+ ```
264
+
265
+ 2. **Sync Strategy: Merge main into develop (Recommended)**
266
+ ```bash
267
+ git checkout develop
268
+ git pull origin develop # Get latest develop
269
+ git merge main # Merge main into develop
270
+ # Resolve conflicts if any (prefer main for version/config files)
271
+ git push origin develop
272
+ ```
273
+
274
+ 3. **Emergency Only: Reset develop to main (Destructive)**
275
+ ```bash
276
+ # ⚠️ ONLY if develop's unique commits are unwanted
277
+ git checkout develop
278
+ git reset --hard main
279
+ git push origin develop --force
280
+ ```
281
+
282
+ ### Prevention: Regular Sync Schedule
283
+
284
+ **After every main release** (REQUIRED):
285
+ ```bash
286
+ # Immediately after merging develop → main:
287
+ git checkout develop
288
+ git merge main
289
+ git push origin develop
290
+ ```
291
+
292
+ **Weekly maintenance** (for active projects):
293
+ ```bash
294
+ # Every Monday morning:
295
+ git checkout develop
296
+ git pull origin main
297
+ git push origin develop
298
+ ```
299
+
300
+ ### Real-World Case Study (2025-10-29)
301
+
302
+ **Situation**: develop was 29 commits behind main due to:
303
+ - v0.8.2, v0.8.3 released directly to main
304
+ - No reverse sync to develop
305
+ - Feature branches contained outdated code
306
+
307
+ **Resolution**:
308
+ - Merged main → develop (14 file conflicts)
309
+ - Resolved conflicts prioritizing main's versions
310
+ - TAG validation bypassed for merge commit
311
+ - Enabled Strict Mode to prevent future direct pushes
312
+
313
+ **Lesson**: With Strict Mode active, this won't happen again. All releases must go through develop → main PR flow.
207
314
 
208
315
  ---
209
316
 
@@ -213,6 +320,9 @@ A: To promote best practices while respecting contributor flexibility and judgme
213
320
  |------|------|--------|
214
321
  | 2025-10-17 | Initial policy drafted (Strict Mode) | git-manager |
215
322
  | 2025-10-17 | Switched to Advisory Mode (warnings only) | git-manager |
323
+ | 2025-10-29 | **Enabled GitHub Branch Protection (Strict Mode)** | Alfred |
324
+ | 2025-10-29 | Added develop-main sync guidelines and real-world case study | Alfred |
325
+ | 2025-10-29 | Enforced `enforce_admins`, `required_conversation_resolution` | Alfred |
216
326
 
217
327
  ---
218
328
 
@@ -0,0 +1,256 @@
1
+ # MoAI-ADK Project Templates
2
+
3
+ This directory contains template files that are copied to new projects when users run `moai-adk init`.
4
+
5
+ ## Directory Structure
6
+
7
+ ```
8
+ templates/
9
+ ├── .claude/ # Claude Code configuration
10
+ │ ├── agents/ # Alfred sub-agents (12 specialists)
11
+ │ ├── commands/ # Slash commands (/alfred:0-4)
12
+ │ ├── skills/ # 55 reusable knowledge capsules
13
+ │ └── hooks/ # Session lifecycle hooks
14
+ ├── .moai/ # MoAI-ADK configuration
15
+ │ ├── config.json # Project settings (language, mode, owner)
16
+ │ ├── docs/ # Internal documentation
17
+ │ ├── memory/ # Session context persistence
18
+ │ ├── reports/ # Quality and sync reports
19
+ │ └── specs/ # SPEC documents directory
20
+ ├── .github/ # GitHub Actions workflows
21
+ │ └── workflows/ # CI/CD automation
22
+ ├── CLAUDE.md # Project guidance for Claude Code
23
+ └── .gitignore # Git ignore patterns
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Template Components
29
+
30
+ ### 1. `.claude/` - Claude Code Configuration (2.0 MB)
31
+
32
+ The complete Alfred SuperAgent system:
33
+
34
+ - **Agents** (12 specialists): spec-builder, tdd-implementer, doc-syncer, tag-agent, trust-checker, debug-helper, implementation-planner, project-manager, quality-gate, git-manager, cc-manager, skill-factory
35
+ - **Commands** (4 workflow commands): `/alfred:0-project`, `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync`
36
+ - **Skills** (55 knowledge capsules): Foundation (5), Essentials (4), Alfred (7), Domain (7), Language (18), CC (14)
37
+ - **Hooks**: SessionStart, PreToolUse, PostToolUse lifecycle guards
38
+
39
+ ### 2. `.moai/` - MoAI-ADK Configuration (120 KB)
40
+
41
+ Project configuration and memory:
42
+
43
+ - **config.json**: Language settings, project owner, team mode
44
+ - **memory/**: Persistent session context and state
45
+ - **docs/**: Internal guides and strategies
46
+ - **reports/**: Sync analysis and quality reports
47
+ - **specs/**: SPEC document directory structure
48
+
49
+ ### 3. `.github/` - GitHub Workflows (80 KB)
50
+
51
+ Continuous integration and deployment:
52
+
53
+ - **workflows/**: Pre-configured GitHub Actions for testing, linting, type checking
54
+ - **ISSUE_TEMPLATE/**: Standard issue templates
55
+
56
+ ### 4. `CLAUDE.md` - Project Guidance (15 KB)
57
+
58
+ The master instruction document for Claude Code:
59
+
60
+ - **Variable substitution**: `{{PROJECT_OWNER}}`, `{{CONVERSATION_LANGUAGE}}`, `{{CODEBASE_LANGUAGE}}`
61
+ - **Customizable**: User-facing project instructions in user's language
62
+
63
+ ---
64
+
65
+ ## How Templates Are Used
66
+
67
+ ### Initialization Flow
68
+
69
+ When a user runs `moai-adk init`, the `TemplateProcessor` class performs:
70
+
71
+ 1. **Template Discovery**: Locates `src/moai_adk/templates/` via package path resolution
72
+ 2. **Directory Copy**: Copies `.claude/`, `.moai/`, `.github/` to target project
73
+ 3. **File Copy**: Copies `CLAUDE.md`, `.gitignore` individually
74
+ 4. **Variable Substitution**: Replaces template placeholders with user values:
75
+ - `{{PROJECT_OWNER}}` → User's configured name
76
+ - `{{CONVERSATION_LANGUAGE}}` → User's language (Korean, Japanese, etc.)
77
+ - `{{CONVERSATION_LANGUAGE_NAME}}` → Language display name
78
+ - `{{CODEBASE_LANGUAGE}}` → Detected or specified project language
79
+
80
+ ### Current Template Processor Logic
81
+
82
+ **File**: `src/moai_adk/core/template/processor.py`
83
+
84
+ **Methods**:
85
+ - `_copy_claude()`: Copy Alfred system (agents, commands, skills, hooks)
86
+ - `_copy_moai()`: Copy MoAI-ADK configuration and structure
87
+ - `_copy_github()`: Copy GitHub Actions workflows
88
+ - `_copy_claude_md()`: Copy and substitute variables in CLAUDE.md
89
+ - `_copy_gitignore()`: Copy Git ignore patterns
90
+
91
+ ---
92
+
93
+ ## @TAG System & Traceability
94
+
95
+ ### What Are @TAG Markers?
96
+
97
+ **@TAG markers** are MoAI-ADK's core traceability feature, linking:
98
+ - `@SPEC:ID` → Requirements
99
+ - `@TEST:ID` → Test cases
100
+ - `@CODE:ID` → Implementation
101
+ - `@DOC:ID` → Documentation
102
+
103
+ **Example**:
104
+ ```python
105
+ # @CODE:AUTH-001 | SPEC: SPEC-AUTH-001/spec.md | Chain: AUTH-001
106
+ def authenticate_user(username, password):
107
+ """Authenticate user credentials (SPEC-AUTH-001)."""
108
+ # Implementation...
109
+ ```
110
+
111
+ ### How @TAGs Work in New Projects
112
+
113
+ **Day 1**: Your project starts with **0 @TAGs**
114
+ - No setup required, no validation needed
115
+ - Tags are created automatically via Alfred commands
116
+
117
+ **Day 30**: Tags grow naturally
118
+ - `/alfred:1-plan "User auth"` → creates `@SPEC:AUTH-001`
119
+ - `/alfred:2-run SPEC-AUTH-001` → creates `@TEST:AUTH-001`, `@CODE:AUTH-001`
120
+ - `/alfred:3-sync` → creates `@DOC:AUTH-001`
121
+
122
+ **Simple & Automatic**: @TAGs are added by Alfred agents, not by you.
123
+
124
+ ### TAG Validation (Advanced, Optional)
125
+
126
+ **MoAI-ADK framework** uses TAG validation (82 files, complex chains)
127
+ **Your new project** does NOT need TAG validation
128
+
129
+ **When you might want TAG validation**:
130
+ - Project has 100+ TAGs
131
+ - Team has 10+ developers
132
+ - Need automated quality gates
133
+
134
+ **How to add TAG validation** (if needed):
135
+ - See MoAI-ADK documentation: "Advanced: TAG Validation Setup"
136
+ - Manual installation from framework source
137
+ - Optional plugin (future): `moai-adk plugin install tag-validation`
138
+
139
+ ---
140
+
141
+ ## Maintenance Guidelines
142
+
143
+ ### Syncing Skills to Templates
144
+
145
+ **Script**: `scripts/sync_allowed_tools.py` (Korean)
146
+
147
+ This script synchronizes `.claude/skills/` to `src/moai_adk/templates/.claude/skills/` to ensure new projects receive the latest skill versions.
148
+
149
+ **When to run**:
150
+ - After adding new skills
151
+ - After updating existing skill content
152
+ - Before releasing a new version
153
+
154
+ ### Template Versioning
155
+
156
+ Templates are versioned with the MoAI-ADK package. When releasing:
157
+
158
+ 1. Update template files in `src/moai_adk/templates/`
159
+ 2. Run skill sync script
160
+ 3. Update this README if structure changes
161
+ 4. Test with `moai-adk init` on a clean directory
162
+ 5. Document breaking changes in CHANGELOG.md
163
+
164
+ ### Testing Template Changes
165
+
166
+ **Integration tests**: `tests/integration/test_phase_executor.py`
167
+
168
+ ```bash
169
+ # Test project initialization
170
+ pytest tests/integration/test_phase_executor.py::test_phase_0_initialization
171
+
172
+ # Test full workflow
173
+ pytest tests/e2e/test_e2e_workflow.py
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Related Documentation
179
+
180
+ - **CLAUDE.md**: Main project guidance (repository root)
181
+ - **CLAUDE-AGENTS-GUIDE.md**: Alfred team structure (repository root)
182
+ - **CLAUDE-RULES.md**: Development rules and conventions (repository root)
183
+ - **Language Configuration**: `.moai/memory/language-config-schema.md`
184
+
185
+ ---
186
+
187
+ ## FAQ
188
+
189
+ ### Q: What is the difference between MoAI-ADK framework and user projects?
190
+
191
+ **A**:
192
+ - **MoAI-ADK framework** = The tool itself (this repository, needs complex validation)
193
+ - **User projects** = Projects created by `moai-adk init` (your apps, simple start)
194
+
195
+ Think of it like Ruby on Rails:
196
+ - Rails framework has complex CI/CD infrastructure
197
+ - `rails new my-app` creates a simple, clean project
198
+
199
+ ### Q: Will my project have @TAG markers?
200
+
201
+ **A**: Yes! @TAG markers are **automatic and core** to MoAI-ADK workflow:
202
+ - Created automatically by `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync`
203
+ - Provide traceability (link requirements → tests → code → docs)
204
+ - No validation needed for small/medium projects (simple grep is enough)
205
+
206
+ ### Q: When do I need TAG validation?
207
+
208
+ **A**: Only for **mature, large-scale projects**:
209
+ - 100+ SPEC documents
210
+ - 10+ team members
211
+ - Complex TAG chains requiring automated integrity checks
212
+
213
+ For most projects, @TAG markers alone are sufficient.
214
+
215
+ ### Q: Will old projects break when templates are updated?
216
+
217
+ **A**: No. Templates only affect **new** projects created via `moai-adk init`. Existing projects are not modified unless explicitly updated via `moai-adk update`.
218
+
219
+ ### Q: How do I customize templates for my organization?
220
+
221
+ **A**: Fork MoAI-ADK and modify files in `src/moai_adk/templates/`. Maintain your fork's template sync script to merge upstream updates.
222
+
223
+ ---
224
+
225
+ ## Design Philosophy
226
+
227
+ ### Framework vs User Projects
228
+
229
+ **What MoAI-ADK framework needs** (this repository):
230
+ - ✅ Complex TAG validation (82 files, orphan/duplicate detection)
231
+ - ✅ Advanced CI/CD workflows
232
+ - ✅ Quality gates for framework development
233
+
234
+ **What new user projects need** (`moai-adk init`):
235
+ - ✅ Alfred SuperAgent (workflow orchestration)
236
+ - ✅ @TAG markers (traceability)
237
+ - ✅ Basic CI/CD (testing, linting)
238
+ - ❌ NO complex TAG validation (not needed until project matures)
239
+
240
+ **Goal**: Start simple, grow as needed.
241
+
242
+ ---
243
+
244
+ ## Change History
245
+
246
+ | Date | Version | Changes |
247
+ |------|---------|---------|
248
+ | 2025-10-29 | 0.8.3 | Removed TAG validation system from templates (design clarification) |
249
+ | 2025-10-29 | 0.7.0 | Language localization complete (5 languages supported) |
250
+ | 2025-10-16 | 0.6.0 | Initial template structure with Alfred system |
251
+
252
+ ---
253
+
254
+ **Last Updated**: 2025-10-29
255
+ **Maintained By**: MoAI-ADK Core Team
256
+ **Design Principle**: Start simple, scale as needed