moai-adk 0.8.2__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 (39) hide show
  1. moai_adk/core/config/migration.py +1 -1
  2. moai_adk/core/issue_creator.py +7 -3
  3. moai_adk/core/tags/__init__.py +23 -24
  4. moai_adk/core/tags/ci_validator.py +3 -5
  5. moai_adk/core/tags/cli.py +2 -2
  6. moai_adk/core/tags/pre_commit_validator.py +5 -5
  7. moai_adk/core/tags/reporter.py +3 -5
  8. moai_adk/core/tags/validator.py +3 -3
  9. moai_adk/templates/.claude/commands/alfred/1-plan.md +65 -15
  10. moai_adk/templates/.claude/commands/alfred/2-run.md +65 -15
  11. moai_adk/templates/.claude/commands/alfred/3-sync.md +68 -14
  12. moai_adk/templates/.claude/hooks/alfred/core/project.py +750 -0
  13. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +1 -1
  14. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +111 -33
  15. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +3 -3
  16. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +330 -0
  17. moai_adk/templates/README.md +256 -0
  18. {moai_adk-0.8.2.dist-info → moai_adk-0.9.0.dist-info}/METADATA +347 -48
  19. {moai_adk-0.8.2.dist-info → moai_adk-0.9.0.dist-info}/RECORD +22 -36
  20. moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +0 -9
  21. moai_adk/templates/.claude/hooks/alfred/README.md +0 -343
  22. moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +0 -471
  23. moai_adk/templates/.github/workflows/tag-report.yml +0 -261
  24. moai_adk/templates/.github/workflows/tag-validation.yml +0 -176
  25. moai_adk/templates/.moai/docs/quick-issue-creation-guide.md +0 -219
  26. moai_adk/templates/.moai/hooks/install.sh +0 -79
  27. moai_adk/templates/.moai/hooks/pre-commit.sh +0 -66
  28. moai_adk/templates/.moai/memory/CONFIG-SCHEMA.md +0 -444
  29. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
  30. moai_adk/templates/src/moai_adk/core/__init__.py +0 -5
  31. moai_adk/templates/src/moai_adk/core/tags/__init__.py +0 -87
  32. moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +0 -435
  33. moai_adk/templates/src/moai_adk/core/tags/cli.py +0 -283
  34. moai_adk/templates/src/moai_adk/core/tags/pre_commit_validator.py +0 -355
  35. moai_adk/templates/src/moai_adk/core/tags/reporter.py +0 -959
  36. moai_adk/templates/src/moai_adk/core/tags/validator.py +0 -897
  37. {moai_adk-0.8.2.dist-info → moai_adk-0.9.0.dist-info}/WHEEL +0 -0
  38. {moai_adk-0.8.2.dist-info → moai_adk-0.9.0.dist-info}/entry_points.txt +0 -0
  39. {moai_adk-0.8.2.dist-info → moai_adk-0.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -34,7 +34,7 @@ def migrate_config_to_nested_structure(config: dict[str, Any]) -> dict[str, Any]
34
34
  if "conversation_language" in config and "language" not in config:
35
35
  # Extract conversation language from legacy location
36
36
  conversation_language = config.pop("conversation_language", "en")
37
- locale = config.pop("locale", None)
37
+ config.pop("locale", None) # Remove legacy locale field
38
38
 
39
39
  # Map language codes to language names
40
40
  language_names = {
@@ -214,7 +214,7 @@ class GitHubIssueCreator:
214
214
  footer += f"**Priority**: {config.priority.value} \n"
215
215
  if config.category:
216
216
  footer += f"**Category**: {config.category} \n"
217
- footer += f"**Created via**: `/alfred:9-feedback`"
217
+ footer += "**Created via**: `/alfred:9-feedback`"
218
218
 
219
219
  return body + footer
220
220
 
@@ -276,7 +276,9 @@ class IssueCreatorFactory:
276
276
  )
277
277
 
278
278
  @staticmethod
279
- def create_feature_issue(title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM) -> IssueConfig:
279
+ def create_feature_issue(
280
+ title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM
281
+ ) -> IssueConfig:
280
282
  """Create a feature request issue configuration."""
281
283
  return IssueConfig(
282
284
  issue_type=IssueType.FEATURE,
@@ -287,7 +289,9 @@ class IssueCreatorFactory:
287
289
  )
288
290
 
289
291
  @staticmethod
290
- def create_improvement_issue(title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM) -> IssueConfig:
292
+ def create_improvement_issue(
293
+ title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM
294
+ ) -> IssueConfig:
291
295
  """Create an improvement issue configuration."""
292
296
  return IssueConfig(
293
297
  issue_type=IssueType.IMPROVEMENT,
@@ -14,43 +14,42 @@ This module provides TAG validation functionality for:
14
14
  """
15
15
 
16
16
  # Component 1: Pre-commit validator
17
+ # Component 2: CI/CD validator
18
+ from .ci_validator import CIValidator
17
19
  from .pre_commit_validator import (
18
20
  PreCommitValidator,
19
- ValidationResult,
20
21
  ValidationError,
22
+ ValidationResult,
21
23
  ValidationWarning,
22
24
  )
23
25
 
24
- # Component 2: CI/CD validator
25
- from .ci_validator import CIValidator
26
-
27
- # Component 3: Central validation system
28
- from .validator import (
29
- ValidationConfig,
30
- TagValidator,
31
- DuplicateValidator,
32
- OrphanValidator,
33
- ChainValidator,
34
- FormatValidator,
35
- CentralValidator,
36
- CentralValidationResult,
37
- ValidationIssue,
38
- ValidationStatistics,
39
- )
40
-
41
26
  # Component 4: Documentation & Reporting
42
27
  from .reporter import (
43
- TagInventory,
44
- TagMatrix,
28
+ CoverageAnalyzer,
29
+ CoverageMetrics,
45
30
  InventoryGenerator,
46
31
  MatrixGenerator,
47
- CoverageAnalyzer,
48
- StatisticsGenerator,
49
32
  ReportFormatter,
50
33
  ReportGenerator,
51
- CoverageMetrics,
52
- StatisticsReport,
53
34
  ReportResult,
35
+ StatisticsGenerator,
36
+ StatisticsReport,
37
+ TagInventory,
38
+ TagMatrix,
39
+ )
40
+
41
+ # Component 3: Central validation system
42
+ from .validator import (
43
+ CentralValidationResult,
44
+ CentralValidator,
45
+ ChainValidator,
46
+ DuplicateValidator,
47
+ FormatValidator,
48
+ OrphanValidator,
49
+ TagValidator,
50
+ ValidationConfig,
51
+ ValidationIssue,
52
+ ValidationStatistics,
54
53
  )
55
54
 
56
55
  __all__ = [
@@ -13,15 +13,13 @@ Used by GitHub Actions workflow to validate TAGs on every PR.
13
13
 
14
14
  import json
15
15
  import os
16
- from pathlib import Path
17
- from typing import List, Dict, Any, Optional, Tuple
16
+ from typing import Any, Dict, List, Optional
17
+
18
18
  import requests
19
19
 
20
20
  from .pre_commit_validator import (
21
21
  PreCommitValidator,
22
22
  ValidationResult,
23
- ValidationError,
24
- ValidationWarning,
25
23
  )
26
24
 
27
25
 
@@ -357,8 +355,8 @@ class CIValidator(PreCommitValidator):
357
355
 
358
356
  def main():
359
357
  """CLI entry point for CI/CD validation"""
360
- import sys
361
358
  import argparse
359
+ import sys
362
360
 
363
361
  parser = argparse.ArgumentParser(
364
362
  description="Validate TAG annotations in GitHub PR"
moai_adk/core/tags/cli.py CHANGED
@@ -15,15 +15,15 @@ Usage:
15
15
  moai-adk validate-tags --no-duplicates --no-orphans
16
16
  """
17
17
 
18
- import sys
19
18
  import argparse
19
+ import sys
20
20
  from pathlib import Path
21
21
  from typing import Optional
22
22
 
23
23
  from .validator import (
24
+ CentralValidationResult,
24
25
  CentralValidator,
25
26
  ValidationConfig,
26
- CentralValidationResult,
27
27
  )
28
28
 
29
29
 
@@ -15,7 +15,7 @@ import re
15
15
  import subprocess
16
16
  from dataclasses import dataclass, field
17
17
  from pathlib import Path
18
- from typing import List, Tuple, Dict, Set, Optional
18
+ from typing import Dict, List, Optional, Tuple
19
19
 
20
20
 
21
21
  @dataclass
@@ -160,7 +160,7 @@ class PreCommitValidator:
160
160
  for tag, locations in tag_locations.items():
161
161
  if len(locations) > 1:
162
162
  errors.append(ValidationError(
163
- message=f"Duplicate TAG found",
163
+ message="Duplicate TAG found",
164
164
  tag=tag,
165
165
  locations=locations
166
166
  ))
@@ -220,7 +220,7 @@ class PreCommitValidator:
220
220
  if domain not in tags_by_type["TEST"]:
221
221
  for filepath, line_num in locations:
222
222
  warnings.append(ValidationWarning(
223
- message=f"CODE TAG without corresponding TEST",
223
+ message="CODE TAG without corresponding TEST",
224
224
  tag=f"@CODE:{domain}",
225
225
  location=(filepath, line_num)
226
226
  ))
@@ -230,7 +230,7 @@ class PreCommitValidator:
230
230
  if domain not in tags_by_type["CODE"]:
231
231
  for filepath, line_num in locations:
232
232
  warnings.append(ValidationWarning(
233
- message=f"TEST TAG without corresponding CODE",
233
+ message="TEST TAG without corresponding CODE",
234
234
  tag=f"@TEST:{domain}",
235
235
  location=(filepath, line_num)
236
236
  ))
@@ -302,8 +302,8 @@ class PreCommitValidator:
302
302
 
303
303
  def main():
304
304
  """CLI entry point for pre-commit hook"""
305
- import sys
306
305
  import argparse
306
+ import sys
307
307
 
308
308
  parser = argparse.ArgumentParser(
309
309
  description="Validate TAG annotations in git staged files"
@@ -23,14 +23,12 @@ Usage:
23
23
  print(f"Generated reports: {result.inventory_path}, {result.matrix_path}")
24
24
  """
25
25
 
26
- import re
27
26
  import json
27
+ import re
28
28
  from dataclasses import dataclass, field
29
- from pathlib import Path
30
- from typing import List, Dict, Set, Tuple, Optional, Any
31
29
  from datetime import datetime
32
- import fnmatch
33
-
30
+ from pathlib import Path
31
+ from typing import Dict, List, Set
34
32
 
35
33
  # ============================================================================
36
34
  # Data Models
@@ -22,14 +22,14 @@ Usage:
22
22
  report = validator.create_report(result, format="json")
23
23
  """
24
24
 
25
- import re
26
25
  import json
26
+ import re
27
27
  import time
28
28
  from abc import ABC, abstractmethod
29
29
  from dataclasses import dataclass, field
30
- from pathlib import Path
31
- from typing import List, Dict, Set, Tuple, Optional, Any
32
30
  from datetime import datetime
31
+ from pathlib import Path
32
+ from typing import Any, Dict, List, Optional, Set, Tuple
33
33
 
34
34
 
35
35
  @dataclass
@@ -109,13 +109,59 @@ Users can run commands like this:
109
109
 
110
110
  ## 🔍 STEP 1: Project analysis and planning
111
111
 
112
- Analyze project documents to propose SPEC candidates, establish implementation strategies, and receive user confirmation.
112
+ STEP 1 consists of **two independent phases** to provide flexible workflow based on user request clarity:
113
113
 
114
- **The spec-builder agent automatically loads and analyzes the required documents.**
114
+ ### 📋 STEP 1 Workflow Overview
115
115
 
116
- ### 🔍 Explore the codebase (optional)
116
+ ```
117
+ ┌─────────────────────────────────────────────────────────────┐
118
+ │ STEP 1: Project Analysis & Planning │
119
+ ├─────────────────────────────────────────────────────────────┤
120
+ │ │
121
+ │ Phase A (OPTIONAL) │
122
+ │ ┌─────────────────────────────────────────┐ │
123
+ │ │ 🔍 Explore Agent │ │
124
+ │ │ • Find relevant files by keywords │ │
125
+ │ │ • Locate existing SPEC documents │ │
126
+ │ │ • Identify implementation patterns │ │
127
+ │ └─────────────────────────────────────────┘ │
128
+ │ ↓ │
129
+ │ (exploration results) │
130
+ │ ↓ │
131
+ │ Phase B (REQUIRED) │
132
+ │ ┌─────────────────────────────────────────┐ │
133
+ │ │ ⚙️ spec-builder Agent │ │
134
+ │ │ • Analyze project documents │ │
135
+ │ │ • Propose SPEC candidates │ │
136
+ │ │ • Design EARS structure │ │
137
+ │ │ • Request user approval │ │
138
+ │ └─────────────────────────────────────────┘ │
139
+ │ ↓ │
140
+ │ (user approval via AskUserQuestion) │
141
+ │ ↓ │
142
+ │ PROCEED TO STEP 2 │
143
+ └─────────────────────────────────────────────────────────────┘
144
+ ```
145
+
146
+ **Key Points**:
147
+ - **Phase A is optional** - Skip if user provides clear SPEC title
148
+ - **Phase B is required** - Always runs to analyze project and create SPEC
149
+ - **Results flow forward** - Exploration results (if any) are passed to spec-builder
150
+
151
+ ---
152
+
153
+ ### 🔍 Phase A: Codebase Exploration (OPTIONAL)
154
+
155
+ **Use the Explore agent when user request is unclear or needs context.**
156
+
157
+ #### When to use Phase A:
117
158
 
118
- **If the user request is unclear or requires understanding of existing code** Use the Explore agent first:
159
+ - User uses vague keywords ("where is...", "find me...", "related to...")
160
+ - ✅ Need to understand existing code structure before planning
161
+ - ✅ Feature spans multiple files or modules
162
+ - ❌ User provides clear SPEC title (skip to Phase B)
163
+
164
+ #### How to invoke Explore agent:
119
165
 
120
166
  ```
121
167
  Invoking the Task tool (Explore agent):
@@ -125,18 +171,20 @@ Invoking the Task tool (Explore agent):
125
171
  - File location (src/, tests/, docs/)
126
172
  - Relevant SPEC document (.moai/specs/)
127
173
  - Existing implementation code
128
- thoroughness level: medium"
174
+ thoroughness level: medium"
129
175
  ```
130
176
 
131
- **Criteria for using the Explore Agent**:
132
- - ✅ Users use keywords like “where am”, “find me”, etc.
133
- - ✅ Need to understand existing code structure
134
- - ✅ Investigate features across multiple files
135
- - ❌ Given a clear SPEC title (straight into spec-builder)
177
+ **Note**: If user provides clear SPEC title, skip Phase A and proceed directly to Phase B.
136
178
 
137
- ### ⚙️ How to call an agent
179
+ ---
180
+
181
+ ### ⚙️ Phase B: SPEC Planning (REQUIRED)
138
182
 
139
- **STEP 1 calls the spec-builder agent using the Task tool**:
183
+ **Call the spec-builder agent to analyze project and create SPEC documents.**
184
+
185
+ This phase is **always required** regardless of whether Phase A was executed.
186
+
187
+ #### How to invoke spec-builder:
140
188
 
141
189
  ```
142
190
  Call the Task tool:
@@ -172,6 +220,8 @@ User input: $ARGUMENTS
172
220
  (Optional) Explore results: $EXPLORE_RESULTS"""
173
221
  ```
174
222
 
223
+ **Note**: If Phase A was executed, pass the exploration results via `$EXPLORE_RESULTS` variable.
224
+
175
225
  ### Plan analysis progress
176
226
 
177
227
  1. **Project document analysis**
@@ -427,7 +477,7 @@ priority: high
427
477
  You must include a HISTORY section **right after the YAML Front Matter**:
428
478
 
429
479
  ```markdown
430
- # @SPEC:AUTH-001: JWT-based authentication system
480
+ # @SPEC:DOMAIN-NNN: JWT-based authentication system
431
481
 
432
482
  ## HISTORY
433
483
 
@@ -473,7 +523,7 @@ updated: 2025-09-15
473
523
  author: @username
474
524
  ---
475
525
 
476
- # @SPEC:AUTH-001: [SPEC title]
526
+ # @SPEC:DOMAIN-NNN: [SPEC title]
477
527
 
478
528
  ## HISTORY
479
529
  [Change history by version – see example above]
@@ -501,7 +551,7 @@ author: @username
501
551
  - IF [condition], the system must [respond appropriately with error handling or quality gates]
502
552
 
503
553
  ## Traceability (@TAG)
504
- - **SPEC**: @SPEC:AUTH-001
554
+ - **SPEC**: @SPEC:DOMAIN-NNN
505
555
  - **TEST**: tests/auth/test_service.py
506
556
  - **CODE**: src/auth/service.py
507
557
  - **DOC**: docs/api/authentication.md
@@ -96,13 +96,59 @@ Users can run commands as follows:
96
96
 
97
97
  ## 🔍 STEP 1: SPEC analysis and execution plan establishment
98
98
 
99
- First, the specified SPEC is analyzed to establish an action plan and receive user confirmation.
99
+ STEP 1 consists of **two independent phases** to provide flexible workflow based on task complexity:
100
100
 
101
- **The implementation-planner agent automatically loads and analyzes the required documents.**
101
+ ### 📋 STEP 1 Workflow Overview
102
102
 
103
- ### 🔍 Browse the code base (recommended)
103
+ ```
104
+ ┌─────────────────────────────────────────────────────────────┐
105
+ │ STEP 1: SPEC Analysis & Planning │
106
+ ├─────────────────────────────────────────────────────────────┤
107
+ │ │
108
+ │ Phase A (OPTIONAL) │
109
+ │ ┌─────────────────────────────────────────┐ │
110
+ │ │ 🔍 Explore Agent │ │
111
+ │ │ • Browse existing codebase │ │
112
+ │ │ • Find similar implementations │ │
113
+ │ │ • Identify patterns & architecture │ │
114
+ │ └─────────────────────────────────────────┘ │
115
+ │ ↓ │
116
+ │ (exploration results) │
117
+ │ ↓ │
118
+ │ Phase B (REQUIRED) │
119
+ │ ┌─────────────────────────────────────────┐ │
120
+ │ │ ⚙️ implementation-planner Agent │ │
121
+ │ │ • Analyze SPEC requirements │ │
122
+ │ │ • Design execution strategy │ │
123
+ │ │ • Create implementation plan │ │
124
+ │ │ • Request user approval │ │
125
+ │ └─────────────────────────────────────────┘ │
126
+ │ ↓ │
127
+ │ (user approval via AskUserQuestion) │
128
+ │ ↓ │
129
+ │ PROCEED TO STEP 2 │
130
+ └─────────────────────────────────────────────────────────────┘
131
+ ```
132
+
133
+ **Key Points**:
134
+ - **Phase A is optional** - Skip if you don't need to explore existing code
135
+ - **Phase B is required** - Always runs to analyze SPEC and create execution plan
136
+ - **Results flow forward** - Exploration results (if any) are passed to implementation-planner
137
+
138
+ ---
139
+
140
+ ### 🔍 Phase A: Codebase Exploration (OPTIONAL)
141
+
142
+ **Use the Explore agent when you need to understand existing code before planning.**
143
+
144
+ #### When to use Phase A:
104
145
 
105
- **If you need to understand existing code structure or find similar patterns** Use the Explore agent first:
146
+ - Need to understand existing code structure/patterns
147
+ - ✅ Need to find similar function implementations for reference
148
+ - ✅ Need to understand project architectural rules
149
+ - ✅ Need to check libraries and versions being used
150
+
151
+ #### How to invoke Explore agent:
106
152
 
107
153
  ```
108
154
  Invoking the Task tool (Explore agent):
@@ -112,35 +158,39 @@ Invoking the Task tool (Explore agent):
112
158
  - Similar function implementation code (src/)
113
159
  - Test patterns for reference (tests/)
114
160
  - Architectural patterns and design patterns
115
- - Use Current libraries and versions (package.json, requirements.txt)
161
+ - Current libraries and versions (package.json, requirements.txt)
116
162
  thoroughness level: medium"
117
163
  ```
118
164
 
119
- **When to use the Explore Agent**:
120
- - ✅ When you need to understand the existing code structure/pattern
121
- - ✅ When you need to refer to how a similar function is implemented
122
- - ✅ When you need to understand the architectural rules of the project
123
- - ✅ Check the library and version being used
165
+ **Note**: If you skip Phase A, proceed directly to Phase B.
124
166
 
125
- ### ⚙️ How to call an agent
167
+ ---
168
+
169
+ ### ⚙️ Phase B: Execution Planning (REQUIRED)
126
170
 
127
- **In STEP 1, we call the implementation-planner agent using the Task tool**:
171
+ **Call the implementation-planner agent to analyze SPEC and establish execution strategy.**
172
+
173
+ This phase is **always required** regardless of whether Phase A was executed.
174
+
175
+ #### How to invoke implementation-planner:
128
176
 
129
177
  ```
130
- Task tool call example:
178
+ Task tool call:
131
179
  - subagent_type: "implementation-planner"
132
180
  - description: "SPEC analysis and establishment of execution strategy"
133
181
  - prompt: "Please analyze the SPEC of $ARGUMENTS and establish an execution plan.
134
182
  It must include the following:
135
183
  1. SPEC requirements extraction and complexity assessment
136
184
  2. Library and tool selection (using WebFetch)
137
- 3. TAG chain design
185
+ 3. TAG chain design
138
186
  4. Step-by-step execution plan
139
187
  5. Risks and response plans
140
- 6. Create action plan and use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` to confirm the next action with the user
188
+ 6. Create action plan and use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` to confirm the next action with the user
141
189
  (Optional) Explore results: $EXPLORE_RESULTS"
142
190
  ```
143
191
 
192
+ **Note**: If Phase A was executed, pass the exploration results via `$EXPLORE_RESULTS` variable.
193
+
144
194
  ### SPEC analysis in progress
145
195
 
146
196
  1. **SPEC document analysis**
@@ -102,15 +102,60 @@ Users can run the command as follows:
102
102
 
103
103
  ## 🔍 STEP 1: Analyze synchronization scope and establish plan
104
104
 
105
- Analyze project status to determine synchronization scope, develop a systematic synchronization plan, and receive user confirmation.
105
+ STEP 1 consists of **two independent phases** to provide flexible workflow based on project complexity:
106
106
 
107
- **The tag-agent performs comprehensive TAG verification (full project scope), and doc-syncer analyzes Git changes and establishes synchronization plan.**
107
+ ### 📋 STEP 1 Workflow Overview
108
108
 
109
- ⚠️ **Important**: Tag-agent must verify the ENTIRE PROJECT for TAG orphans, not just changed files. Full-project scope is MANDATORY.
109
+ ```
110
+ ┌─────────────────────────────────────────────────────────────┐
111
+ │ STEP 1: Synchronization Analysis & Planning │
112
+ ├─────────────────────────────────────────────────────────────┤
113
+ │ │
114
+ │ Phase A (OPTIONAL) │
115
+ │ ┌─────────────────────────────────────────┐ │
116
+ │ │ 🔍 Explore Agent │ │
117
+ │ │ • Navigate complex TAG chains │ │
118
+ │ │ • Scan entire TAG system │ │
119
+ │ │ • Identify orphan TAGs │ │
120
+ │ └─────────────────────────────────────────┘ │
121
+ │ ↓ │
122
+ │ (exploration results) │
123
+ │ ↓ │
124
+ │ Phase B (REQUIRED) │
125
+ │ ┌─────────────────────────────────────────┐ │
126
+ │ │ ⚙️ tag-agent + doc-syncer Agents │ │
127
+ │ │ • Verify TAG integrity (full project) │ │
128
+ │ │ • Analyze Git changes │ │
129
+ │ │ • Create synchronization plan │ │
130
+ │ │ • Request user approval │ │
131
+ │ └─────────────────────────────────────────┘ │
132
+ │ ↓ │
133
+ │ (user approval via AskUserQuestion) │
134
+ │ ↓ │
135
+ │ PROCEED TO STEP 2 │
136
+ └─────────────────────────────────────────────────────────────┘
137
+ ```
138
+
139
+ **Key Points**:
140
+ - **Phase A is optional** - Skip for simple single-SPEC changes
141
+ - **Phase B is required** - Always runs to verify TAGs and plan sync
142
+ - **Results flow forward** - Exploration results (if any) are passed to tag-agent
143
+ - **⚠️ Important**: tag-agent verifies ENTIRE PROJECT, not just changed files
144
+
145
+ ---
110
146
 
111
- ### 🔍 TAG chain navigation (optional)
147
+ ### 🔍 Phase A: TAG Chain Navigation (OPTIONAL)
148
+
149
+ **Use the Explore agent for complex or extensive TAG chains.**
150
+
151
+ #### When to use Phase A:
152
+
153
+ - ✅ Large projects (100+ files)
154
+ - ✅ Need comprehensive TAG chain integrity verification
155
+ - ✅ Changes span multiple SPECs or modules
156
+ - ❌ Simple changes to a single SPEC (skip to Phase B)
112
157
 
113
- **If your TAG chain is complex or extensive**, utilize the Explore agent first:
158
+ #### How to invoke Explore agent:
114
159
 
115
160
  ```
116
161
  Invoking the Task tool (Explore agent):
@@ -120,20 +165,22 @@ Invoking the Task tool (Explore agent):
120
165
  - @SPEC TAG location (.moai/specs/)
121
166
  - @TEST TAG location (tests/)
122
167
  - @CODE TAG location (src/)
123
- - @DOC TAG location (docs/)
168
+ - @DOC TAG location (docs/)
124
169
  - Detect orphan TAGs and broken references
125
- Thoroughness level: very thorough"
170
+ thoroughness level: very thorough"
126
171
  ```
127
172
 
128
- **Explore Agent When to Use**:
129
- - ✅ Large projects (100+ files)
130
- - ✅ When TAG chain integrity verification is required
131
- - ✅ Changes across multiple SPECs
132
- - Simple changes to a single SPEC
173
+ **Note**: For simple changes, skip Phase A and proceed directly to Phase B.
174
+
175
+ ---
176
+
177
+ ### ⚙️ Phase B: TAG Verification & Sync Planning (REQUIRED)
133
178
 
134
- ### ⚙️ How to call an agent
179
+ **Call tag-agent and doc-syncer to verify TAG integrity and plan synchronization.**
135
180
 
136
- **In STEP 1, call doc-syncer and tag-agent using the Task tool**:
181
+ This phase is **always required** and runs **two agents sequentially**:
182
+
183
+ #### How to invoke agents:
137
184
 
138
185
  ```
139
186
  1. Tag-agent call (TAG verification - FULL PROJECT SCOPE):
@@ -189,6 +236,13 @@ $ARGUMENTS
189
236
  (Optional) TAG validation results: $TAG_VALIDATION_RESULTS"""
190
237
  ```
191
238
 
239
+ **Note**:
240
+ - **Sequential execution**: Run tag-agent first, then doc-syncer
241
+ - **Results flow**: TAG validation results from tag-agent are passed to doc-syncer via `$TAG_VALIDATION_RESULTS`
242
+ - **Phase A results**: If Phase A was executed, exploration results are passed to tag-agent via `$EXPLORE_RESULTS`
243
+
244
+ ---
245
+
192
246
  ### Synchronization analysis in progress
193
247
 
194
248
  1. **Check project status**