moai-adk 0.9.1__py3-none-any.whl → 0.10.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 (26) 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 +97 -24
  3. moai_adk/templates/.git-hooks/pre-push +143 -0
  4. moai_adk/templates/.github/workflows/tag-validation.yml +4 -0
  5. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +140 -30
  6. moai_adk/templates/CLAUDE.md +58 -0
  7. moai_adk/templates/README.md +256 -0
  8. {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/METADATA +714 -79
  9. {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/RECORD +12 -23
  10. moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +0 -9
  11. moai_adk/templates/.claude/hooks/alfred/README.md +0 -343
  12. moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +0 -471
  13. moai_adk/templates/.github/workflows/tag-report.yml +0 -261
  14. moai_adk/templates/.moai/docs/quick-issue-creation-guide.md +0 -219
  15. moai_adk/templates/.moai/hooks/install.sh +0 -79
  16. moai_adk/templates/.moai/hooks/pre-commit.sh +0 -66
  17. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
  18. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  19. moai_adk/templates/src/moai_adk/core/__init__.py +0 -5
  20. moai_adk/templates/src/moai_adk/core/tags/__init__.py +0 -86
  21. moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +0 -433
  22. moai_adk/templates/src/moai_adk/core/tags/cli.py +0 -283
  23. moai_adk/templates/src/moai_adk/core/tags/validator.py +0 -897
  24. {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/WHEEL +0 -0
  25. {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/entry_points.txt +0 -0
  26. {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,261 +0,0 @@
1
- # @CODE:DOC-TAG-004 | Component 4: Automated TAG reporting workflow
2
- name: TAG Report Generation
3
-
4
- on:
5
- # Scheduled: Daily at 09:00 UTC
6
- schedule:
7
- - cron: '0 9 * * *'
8
-
9
- # Event: Push to main/develop
10
- push:
11
- branches:
12
- - main
13
- - develop
14
-
15
- # Manual: Workflow dispatch
16
- workflow_dispatch:
17
- inputs:
18
- output_format:
19
- description: 'Report format (all|inventory|matrix|statistics)'
20
- required: false
21
- default: 'all'
22
-
23
- jobs:
24
- generate-tag-reports:
25
- name: Generate TAG Reports
26
- runs-on: ubuntu-latest
27
-
28
- permissions:
29
- contents: write # Required to commit reports back to repo
30
- pull-requests: write # Required to comment on PRs
31
-
32
- steps:
33
- - name: Checkout repository
34
- uses: actions/checkout@v4
35
- with:
36
- fetch-depth: 0 # Full history for accurate file modification times
37
-
38
- - name: Setup Python
39
- uses: actions/setup-python@v5
40
- with:
41
- python-version: '3.11'
42
- cache: 'pip'
43
-
44
- - name: Install MoAI-ADK
45
- run: |
46
- python -m pip install --upgrade pip
47
- pip install -e .
48
-
49
- - name: Create reports directory
50
- run: |
51
- mkdir -p docs/reports
52
- echo "Reports will be generated in docs/reports/"
53
-
54
- - name: Generate TAG Inventory
55
- run: |
56
- python -c "
57
- from moai_adk.core.tags.reporter import ReportGenerator
58
-
59
- generator = ReportGenerator()
60
- inventory = generator.generate_inventory_report('.')
61
-
62
- with open('docs/reports/tag-inventory.md', 'w') as f:
63
- f.write(inventory)
64
-
65
- print('✅ Generated tag-inventory.md')
66
- "
67
-
68
- - name: Generate TAG Coverage Matrix
69
- run: |
70
- python -c "
71
- from moai_adk.core.tags.reporter import ReportGenerator
72
-
73
- generator = ReportGenerator()
74
- matrix = generator.generate_matrix_report('.')
75
-
76
- with open('docs/reports/tag-matrix.md', 'w') as f:
77
- f.write(matrix)
78
-
79
- print('✅ Generated tag-matrix.md')
80
- "
81
-
82
- - name: Generate TAG Statistics
83
- run: |
84
- python -c "
85
- from moai_adk.core.tags.reporter import ReportGenerator
86
-
87
- generator = ReportGenerator()
88
- stats = generator.generate_statistics_report('.')
89
-
90
- with open('docs/reports/tag-statistics.json', 'w') as f:
91
- f.write(stats)
92
-
93
- print('✅ Generated tag-statistics.json')
94
- "
95
-
96
- - name: Generate combined report
97
- run: |
98
- python -c "
99
- from moai_adk.core.tags.reporter import ReportGenerator
100
- from pathlib import Path
101
- import json
102
-
103
- generator = ReportGenerator()
104
- result = generator.generate_all_reports('.', 'docs/reports')
105
-
106
- if result.success:
107
- print(f'✅ All reports generated successfully')
108
- print(f' - Inventory: {result.inventory_path}')
109
- print(f' - Matrix: {result.matrix_path}')
110
- print(f' - Statistics: {result.statistics_path}')
111
-
112
- # Read statistics for summary
113
- stats = json.loads(result.statistics_path.read_text())
114
- print(f'')
115
- print(f'📊 Summary:')
116
- print(f' - Total TAGs: {stats[\"total_tags\"]}')
117
- print(f' - By Type: SPEC={stats[\"by_type\"].get(\"SPEC\", 0)}, CODE={stats[\"by_type\"].get(\"CODE\", 0)}, TEST={stats[\"by_type\"].get(\"TEST\", 0)}, DOC={stats[\"by_type\"].get(\"DOC\", 0)}')
118
- print(f' - Coverage: {stats[\"coverage\"].get(\"overall_percentage\", 0)}%')
119
- else:
120
- print(f'❌ Report generation failed: {result.error_message}')
121
- exit(1)
122
- "
123
-
124
- - name: Check for changes
125
- id: git_status
126
- run: |
127
- if [ -n "$(git status --porcelain docs/reports/)" ]; then
128
- echo "changes=true" >> $GITHUB_OUTPUT
129
- echo "📝 TAG reports have changed"
130
- else
131
- echo "changes=false" >> $GITHUB_OUTPUT
132
- echo "✅ TAG reports unchanged (no commit needed)"
133
- fi
134
-
135
- - name: Commit reports
136
- if: steps.git_status.outputs.changes == 'true'
137
- run: |
138
- git config --global user.name 'github-actions[bot]'
139
- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
140
- git add docs/reports/
141
- git commit -m "docs(tags): Update TAG reports [automated]
142
-
143
- - Updated tag-inventory.md
144
- - Updated tag-matrix.md
145
- - Updated tag-statistics.json
146
-
147
- Generated by: GitHub Actions workflow (tag-report.yml)
148
- Triggered: ${{ github.event_name }}
149
- Commit: ${{ github.sha }}
150
-
151
- 🤖 Generated with MoAI-ADK TAG Reporting System
152
- "
153
- git push
154
-
155
- - name: Create GitHub Release Notes
156
- if: github.ref == 'refs/heads/main' && steps.git_status.outputs.changes == 'true'
157
- run: |
158
- echo "📊 TAG System Health Report" > report_summary.md
159
- echo "" >> report_summary.md
160
- echo "Generated: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" >> report_summary.md
161
- echo "" >> report_summary.md
162
-
163
- # Extract key metrics from statistics
164
- python -c "
165
- import json
166
- from pathlib import Path
167
-
168
- stats = json.loads(Path('docs/reports/tag-statistics.json').read_text())
169
-
170
- print(f'## Summary')
171
- print(f'')
172
- print(f'- **Total TAGs**: {stats[\"total_tags\"]}')
173
- print(f'- **By Type**:')
174
- print(f' - SPEC: {stats[\"by_type\"].get(\"SPEC\", 0)}')
175
- print(f' - CODE: {stats[\"by_type\"].get(\"CODE\", 0)}')
176
- print(f' - TEST: {stats[\"by_type\"].get(\"TEST\", 0)}')
177
- print(f' - DOC: {stats[\"by_type\"].get(\"DOC\", 0)}')
178
- print(f'')
179
- print(f'## Coverage')
180
- print(f'')
181
- print(f'- **Overall**: {stats[\"coverage\"].get(\"overall_percentage\", 0)}%')
182
- print(f'- **SPEC → CODE**: {stats[\"coverage\"].get(\"spec_to_code\", 0)}%')
183
- print(f'- **CODE → TEST**: {stats[\"coverage\"].get(\"code_to_test\", 0)}%')
184
- print(f'')
185
- print(f'## Issues')
186
- print(f'')
187
- print(f'- **Orphan TAGs**: {stats[\"issues\"].get(\"orphan_count\", 0)}')
188
- print(f'- **Incomplete Chains**: {stats[\"issues\"].get(\"incomplete_chains\", 0)}')
189
- print(f'')
190
- print(f'## Reports')
191
- print(f'')
192
- print(f'- [TAG Inventory](./docs/reports/tag-inventory.md)')
193
- print(f'- [Coverage Matrix](./docs/reports/tag-matrix.md)')
194
- print(f'- [Statistics (JSON)](./docs/reports/tag-statistics.json)')
195
- " >> report_summary.md
196
-
197
- cat report_summary.md
198
-
199
- - name: Upload reports as artifacts
200
- uses: actions/upload-artifact@v4
201
- with:
202
- name: tag-reports-${{ github.sha }}
203
- path: docs/reports/
204
- retention-days: 90
205
-
206
- - name: Post summary to GitHub Actions UI
207
- run: |
208
- echo "## 📊 TAG Report Generation Complete" >> $GITHUB_STEP_SUMMARY
209
- echo "" >> $GITHUB_STEP_SUMMARY
210
-
211
- python -c "
212
- import json
213
- from pathlib import Path
214
-
215
- stats = json.loads(Path('docs/reports/tag-statistics.json').read_text())
216
-
217
- print(f'### Summary')
218
- print(f'')
219
- print(f'| Metric | Value |')
220
- print(f'|--------|-------|')
221
- print(f'| Total TAGs | {stats[\"total_tags\"]} |')
222
- print(f'| SPEC | {stats[\"by_type\"].get(\"SPEC\", 0)} |')
223
- print(f'| CODE | {stats[\"by_type\"].get(\"CODE\", 0)} |')
224
- print(f'| TEST | {stats[\"by_type\"].get(\"TEST\", 0)} |')
225
- print(f'| DOC | {stats[\"by_type\"].get(\"DOC\", 0)} |')
226
- print(f'| Overall Coverage | {stats[\"coverage\"].get(\"overall_percentage\", 0)}% |')
227
- print(f'| Orphan TAGs | {stats[\"issues\"].get(\"orphan_count\", 0)} |')
228
- print(f'| Incomplete Chains | {stats[\"issues\"].get(\"incomplete_chains\", 0)} |')
229
- print(f'')
230
- print(f'### Generated Files')
231
- print(f'')
232
- print(f'- ✅ tag-inventory.md')
233
- print(f'- ✅ tag-matrix.md')
234
- print(f'- ✅ tag-statistics.json')
235
- " >> $GITHUB_STEP_SUMMARY
236
-
237
- - name: Fail workflow if issues detected (optional)
238
- if: always()
239
- run: |
240
- python -c "
241
- import json
242
- from pathlib import Path
243
- import sys
244
-
245
- stats = json.loads(Path('docs/reports/tag-statistics.json').read_text())
246
-
247
- orphan_count = stats['issues'].get('orphan_count', 0)
248
- incomplete_count = stats['issues'].get('incomplete_chains', 0)
249
-
250
- # Optional: Fail workflow if too many issues
251
- # Uncomment to enable strict validation
252
- # if orphan_count > 10 or incomplete_count > 10:
253
- # print(f'❌ Too many TAG issues detected!')
254
- # print(f' Orphans: {orphan_count}')
255
- # print(f' Incomplete: {incomplete_count}')
256
- # sys.exit(1)
257
-
258
- print(f'✅ TAG system health check passed')
259
- print(f' Orphans: {orphan_count}')
260
- print(f' Incomplete: {incomplete_count}')
261
- "
@@ -1,219 +0,0 @@
1
- # 🎯 Quick Issue Creation Guide
2
-
3
- > **MoAI-ADK v0.7.0+** - Create GitHub Issues instantly with `/alfred:9-feedback` interactive dialog
4
-
5
- ## Overview
6
-
7
- The Quick Issue Creation system allows developers to report bugs, request features, suggest improvements, and ask questions directly to GitHub Issues without leaving their development context.
8
-
9
- **Key Benefit**: Convert problems into tracked GitHub Issues in seconds, maintaining development flow.
10
-
11
- ---
12
-
13
- ## 🚀 Quick Start
14
-
15
- ### Basic Usage
16
-
17
- ```bash
18
- # Report a bug
19
- /alfred:9-help --bug 'Login button not responding on homepage'
20
-
21
- # Request a feature
22
- /alfred:9-help --feature 'Add dark mode theme support'
23
-
24
- # Suggest an improvement
25
- /alfred:9-help --improvement 'Optimize database query in UserService'
26
-
27
- # Ask a question
28
- /alfred:9-help --question 'What is the recommended approach for API versioning?'
29
- ```
30
-
31
- ### What Happens Next
32
-
33
- 1. **Parsing**: Alfred extracts issue type and content
34
- 2. **Priority Selection**: You select issue priority (critical/high/medium/low)
35
- 3. **Issue Creation**: GitHub Issue is created with:
36
- - Formatted title (with emoji and type indicator)
37
- - Your description
38
- - Automatic labels based on type and priority
39
- - Metadata footer
40
- 4. **Confirmation**: You receive the issue URL for immediate sharing
41
-
42
- **Example Output**:
43
- ```
44
- ✅ GitHub Issue #456 created successfully
45
- 📋 Title: 🐛 [BUG] Login button not responding on homepage
46
- 🔴 Priority: High
47
- 🏷️ Labels: bug, reported, priority-high
48
- 🔗 URL: https://github.com/owner/repo/issues/456
49
- ```
50
-
51
- ---
52
-
53
- ## 📋 Issue Types & Labels
54
-
55
- ### 🐛 Bug Reports (`--bug`)
56
-
57
- Use this when you discover a problem or unexpected behavior.
58
-
59
- **Automatic Labels**: `bug`, `reported`
60
-
61
- **Example**:
62
- ```bash
63
- /alfred:9-help --bug 'Payment form crashes when credit card has < 4 digits'
64
- ```
65
-
66
- ---
67
-
68
- ### ✨ Feature Requests (`--feature`)
69
-
70
- Use this to propose new functionality.
71
-
72
- **Automatic Labels**: `feature-request`, `enhancement`
73
-
74
- **Example**:
75
- ```bash
76
- /alfred:9-help --feature 'Add webhook support for payment notifications'
77
- ```
78
-
79
- ---
80
-
81
- ### ⚡ Improvement Suggestions (`--improvement`)
82
-
83
- Use this to suggest enhancements to existing features.
84
-
85
- **Automatic Labels**: `improvement`, `enhancement`
86
-
87
- **Example**:
88
- ```bash
89
- /alfred:9-help --improvement 'Reduce database queries in checkout process by 50%'
90
- ```
91
-
92
- ---
93
-
94
- ### ❓ Questions & Discussions (`--question`)
95
-
96
- Use this to ask questions or start discussions.
97
-
98
- **Automatic Labels**: `question`, `help-wanted`
99
-
100
- **Example**:
101
- ```bash
102
- /alfred:9-help --question 'Should we migrate from Sequelize to Prisma ORM?'
103
- ```
104
-
105
- ---
106
-
107
- ## 🎯 Priority Levels
108
-
109
- When you create an issue, you'll be prompted to select a priority:
110
-
111
- | Level | Emoji | Label | When to Use |
112
- |-------|-------|-------|------------|
113
- | 🔴 Critical | 🔴 | `priority-critical` | System down, data loss risk, security breach |
114
- | 🟠 High | 🟠 | `priority-high` | Major feature broken, significant impact |
115
- | 🟡 Medium | 🟡 | `priority-medium` | Normal bugs, typical features, default |
116
- | 🟢 Low | 🟢 | `priority-low` | Minor issues, nice-to-have features |
117
-
118
- ---
119
-
120
- ## 💡 Real-World Examples
121
-
122
- ### Example 1: Emergency Bug Report
123
-
124
- **Scenario**: During production support, you find that users cannot reset their passwords.
125
-
126
- ```bash
127
- /alfred:9-help --bug 'Password reset email not being sent after clicking "Forgot Password"'
128
- ```
129
-
130
- **Result**: Issue #234 created and visible to team immediately with critical priority.
131
-
132
- ### Example 2: Feature Request from Code Review
133
-
134
- **Scenario**: During code review, you think of a feature that would improve the codebase.
135
-
136
- ```bash
137
- /alfred:9-help --feature 'Add request rate limiting middleware to prevent abuse'
138
- ```
139
-
140
- **Result**: Issue #235 created for backlog planning.
141
-
142
- ### Example 3: Performance Improvement Suggestion
143
-
144
- **Scenario**: You notice slow database queries in the user service.
145
-
146
- ```bash
147
- /alfred:9-help --improvement 'Add database index on users.email for faster lookups'
148
- ```
149
-
150
- **Result**: Issue #236 created for technical debt backlog.
151
-
152
- ### Example 4: Architecture Question
153
-
154
- **Scenario**: You're uncertain about the best approach for API design.
155
-
156
- ```bash
157
- /alfred:9-help --question 'Should we use REST or GraphQL for the new mobile API?'
158
- ```
159
-
160
- **Result**: Issue #237 created for team discussion.
161
-
162
- ---
163
-
164
- ## 🔧 Prerequisites
165
-
166
- ### Required
167
-
168
- 1. **GitHub CLI installed**
169
- ```bash
170
- # macOS
171
- brew install gh
172
-
173
- # Ubuntu/Debian
174
- sudo apt install gh
175
-
176
- # Or visit: https://cli.github.com
177
- ```
178
-
179
- 2. **Authenticated with GitHub**
180
- ```bash
181
- gh auth login
182
- ```
183
-
184
- 3. **Git repository initialized**
185
- ```bash
186
- git init
187
- git remote add origin https://github.com/owner/repo.git
188
- ```
189
-
190
- ---
191
-
192
- ## 🔄 Related Commands
193
-
194
- | Command | Purpose |
195
- |---------|---------|
196
- | `/alfred:0-project` | Initialize project |
197
- | `/alfred:1-plan` | Create SPEC documents |
198
- | `/alfred:2-run` | Implement features |
199
- | `/alfred:3-sync` | Sync documentation |
200
- | `/alfred:9-help` | **Create issues (this command)** |
201
-
202
- ---
203
-
204
- ## ✨ Summary
205
-
206
- The `/alfred:9-help` command enables:
207
-
208
- - ✅ **Fast issue creation** - Seconds, not minutes
209
- - ✅ **Standardized format** - Consistent labels and metadata
210
- - ✅ **Priority management** - Clear issue prioritization
211
- - ✅ **Team visibility** - Issues immediately visible and discussable
212
- - ✅ **Workflow integration** - Works with MoAI-ADK specs and planning
213
-
214
- **Start using it now**:
215
- ```bash
216
- /alfred:9-help --bug 'Describe the issue you just found'
217
- ```
218
-
219
- Happy issue reporting! 🎉
@@ -1,79 +0,0 @@
1
- #!/bin/bash
2
- # @CODE:DOC-TAG-004 | Component 1: Pre-commit hook installer
3
- #
4
- # This script installs the TAG validation pre-commit hook into .git/hooks/
5
- #
6
- # Usage:
7
- # ./install.sh # Install hook
8
- # ./install.sh --uninstall # Remove hook
9
-
10
- set -e
11
-
12
- # Colors
13
- GREEN='\033[0;32m'
14
- YELLOW='\033[1;33m'
15
- RED='\033[0;31m'
16
- NC='\033[0m'
17
-
18
- # Get repository root
19
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
20
- HOOK_SOURCE="${REPO_ROOT}/.moai/hooks/pre-commit.sh"
21
- HOOK_TARGET="${REPO_ROOT}/.git/hooks/pre-commit"
22
-
23
- # Function to install hook
24
- install_hook() {
25
- echo "🔧 Installing TAG validation pre-commit hook..."
26
-
27
- # Check if source exists
28
- if [ ! -f "$HOOK_SOURCE" ]; then
29
- echo -e "${RED}Error: Hook source not found at $HOOK_SOURCE${NC}"
30
- exit 1
31
- fi
32
-
33
- # Check if target already exists
34
- if [ -f "$HOOK_TARGET" ]; then
35
- echo -e "${YELLOW}Warning: Pre-commit hook already exists.${NC}"
36
- echo "Backing up existing hook to ${HOOK_TARGET}.backup"
37
- cp "$HOOK_TARGET" "${HOOK_TARGET}.backup"
38
- fi
39
-
40
- # Create .git/hooks directory if it doesn't exist
41
- mkdir -p "$(dirname "$HOOK_TARGET")"
42
-
43
- # Copy hook
44
- cp "$HOOK_SOURCE" "$HOOK_TARGET"
45
- chmod +x "$HOOK_TARGET"
46
-
47
- echo -e "${GREEN}✓ Pre-commit hook installed successfully!${NC}"
48
- echo ""
49
- echo "The hook will now validate TAG annotations on every commit."
50
- echo ""
51
- echo "To uninstall: $0 --uninstall"
52
- }
53
-
54
- # Function to uninstall hook
55
- uninstall_hook() {
56
- echo "🔧 Uninstalling TAG validation pre-commit hook..."
57
-
58
- if [ ! -f "$HOOK_TARGET" ]; then
59
- echo -e "${YELLOW}No pre-commit hook installed.${NC}"
60
- exit 0
61
- fi
62
-
63
- # Check if backup exists
64
- if [ -f "${HOOK_TARGET}.backup" ]; then
65
- echo "Restoring backup..."
66
- mv "${HOOK_TARGET}.backup" "$HOOK_TARGET"
67
- echo -e "${GREEN}✓ Backup restored.${NC}"
68
- else
69
- rm "$HOOK_TARGET"
70
- echo -e "${GREEN}✓ Pre-commit hook removed.${NC}"
71
- fi
72
- }
73
-
74
- # Parse command line arguments
75
- if [ "$1" = "--uninstall" ]; then
76
- uninstall_hook
77
- else
78
- install_hook
79
- fi
@@ -1,66 +0,0 @@
1
- #!/bin/bash
2
- # @CODE:DOC-TAG-004 | Component 1: Pre-commit hook for TAG validation
3
- #
4
- # This hook validates TAG annotations in staged files before commit.
5
- # It checks:
6
- # - TAG format (@DOC:DOMAIN-TYPE-NNN)
7
- # - Duplicate TAG detection
8
- # - Orphan TAG detection (warnings only)
9
- #
10
- # Exit codes:
11
- # 0 - Validation passed
12
- # 1 - Validation failed (duplicates or format errors)
13
-
14
- set -e # Exit on error
15
-
16
- # Colors for output
17
- RED='\033[0;31m'
18
- GREEN='\033[0;32m'
19
- YELLOW='\033[1;33m'
20
- NC='\033[0m' # No Color
21
-
22
- # Get repository root
23
- REPO_ROOT=$(git rev-parse --show-toplevel)
24
-
25
- # Check if Python module is available
26
- if ! python3 -c "import moai_adk.core.tags.pre_commit_validator" 2>/dev/null; then
27
- echo -e "${YELLOW}Warning: moai_adk TAG validator not found.${NC}"
28
- echo "Skipping TAG validation. Install moai_adk to enable validation."
29
- exit 0
30
- fi
31
-
32
- # Get staged files
33
- STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
34
-
35
- if [ -z "$STAGED_FILES" ]; then
36
- echo -e "${GREEN}No staged files to validate.${NC}"
37
- exit 0
38
- fi
39
-
40
- echo "🔍 Validating TAG annotations in staged files..."
41
-
42
- # Run TAG validation
43
- # Pass staged files as arguments to validator
44
- python3 -m moai_adk.core.tags.pre_commit_validator \
45
- --files $STAGED_FILES
46
-
47
- VALIDATION_RESULT=$?
48
-
49
- # Check result
50
- if [ $VALIDATION_RESULT -eq 0 ]; then
51
- echo -e "${GREEN}✓ TAG validation passed.${NC}"
52
- exit 0
53
- else
54
- echo -e "${RED}✗ TAG validation failed.${NC}"
55
- echo ""
56
- echo "Commit blocked due to TAG validation errors."
57
- echo ""
58
- echo "To fix:"
59
- echo " 1. Fix duplicate TAGs or format errors shown above"
60
- echo " 2. Stage your changes with 'git add'"
61
- echo " 3. Try committing again"
62
- echo ""
63
- echo "To skip this validation (not recommended):"
64
- echo " git commit --no-verify"
65
- exit 1
66
- fi