moai-adk 0.5.4__py3-none-any.whl → 0.5.8__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.
- moai_adk/__init__.py +1 -1
- moai_adk/cli/commands/init.py +4 -2
- moai_adk/cli/commands/status.py +4 -2
- moai_adk/cli/commands/update.py +4 -5
- moai_adk/core/project/initializer.py +13 -11
- moai_adk/core/project/phase_executor.py +10 -3
- moai_adk/core/template/processor.py +60 -1
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +8 -0
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +18 -0
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +18 -0
- moai_adk/templates/.claude/agents/alfred/git-manager.md +38 -2
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +18 -0
- moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -0
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +6 -0
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +8 -0
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +17 -0
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +7 -1
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +18 -0
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +6 -0
- moai_adk/templates/.claude/commands/alfred/0-project.md +5 -1
- moai_adk/templates/.claude/commands/alfred/1-plan.md +18 -14
- moai_adk/templates/.claude/commands/alfred/2-run.md +6 -2
- moai_adk/templates/.claude/commands/alfred/3-sync.md +5 -1
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +5 -1
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +5 -1
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +5 -1
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +5 -1
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +30 -273
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +487 -129
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +603 -70
- moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +22 -2
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +25 -5
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +152 -547
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +835 -878
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +665 -1151
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +138 -427
- moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +61 -53
- moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +99 -1181
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +541 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +622 -0
- moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +176 -0
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +167 -0
- moai_adk/templates/.moai/config.json +5 -5
- moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md +208 -0
- moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md +369 -0
- moai_adk/templates/.moai/memory/CLAUDE-RULES.md +539 -0
- moai_adk/templates/.moai/memory/{development-guide.md → DEVELOPMENT-GUIDE.md} +3 -3
- moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md +218 -0
- moai_adk/templates/.moai/memory/config-schema.md +444 -0
- moai_adk/templates/CLAUDE.md +149 -845
- {moai_adk-0.5.4.dist-info → moai_adk-0.5.8.dist-info}/METADATA +407 -336
- {moai_adk-0.5.4.dist-info → moai_adk-0.5.8.dist-info}/RECORD +63 -54
- /moai_adk/templates/.moai/memory/{gitflow-protection-policy.md → GITFLOW-PROTECTION-POLICY.md} +0 -0
- /moai_adk/templates/.moai/memory/{spec-metadata.md → SPEC-METADATA.md} +0 -0
- {moai_adk-0.5.4.dist-info → moai_adk-0.5.8.dist-info}/WHEEL +0 -0
- {moai_adk-0.5.4.dist-info → moai_adk-0.5.8.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.5.4.dist-info → moai_adk-0.5.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
name: 📋 SPEC Document
|
|
2
|
+
description: Create a new SPEC document for feature planning
|
|
3
|
+
title: "[SPEC-] "
|
|
4
|
+
labels: ["spec", "planning"]
|
|
5
|
+
assignees: []
|
|
6
|
+
|
|
7
|
+
body:
|
|
8
|
+
- type: markdown
|
|
9
|
+
attributes:
|
|
10
|
+
value: |
|
|
11
|
+
## 📋 SPEC Metadata
|
|
12
|
+
|
|
13
|
+
Fill out the SPEC details below. This will be synchronized with the SPEC document and GitHub Issue.
|
|
14
|
+
|
|
15
|
+
- type: input
|
|
16
|
+
id: spec-id
|
|
17
|
+
attributes:
|
|
18
|
+
label: SPEC ID
|
|
19
|
+
description: "Format: DOMAIN-###. Example: AUTH-001, API-DESIGN-001"
|
|
20
|
+
placeholder: "AUTH-001"
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: input
|
|
25
|
+
id: spec-title
|
|
26
|
+
attributes:
|
|
27
|
+
label: SPEC Title
|
|
28
|
+
description: "Brief description of the specification"
|
|
29
|
+
placeholder: "JWT-based authentication system"
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
|
|
33
|
+
- type: dropdown
|
|
34
|
+
id: priority
|
|
35
|
+
attributes:
|
|
36
|
+
label: Priority
|
|
37
|
+
description: "Feature priority level"
|
|
38
|
+
options:
|
|
39
|
+
- "critical"
|
|
40
|
+
- "high"
|
|
41
|
+
- "medium"
|
|
42
|
+
- "low"
|
|
43
|
+
validations:
|
|
44
|
+
required: true
|
|
45
|
+
|
|
46
|
+
- type: dropdown
|
|
47
|
+
id: category
|
|
48
|
+
attributes:
|
|
49
|
+
label: Category
|
|
50
|
+
description: "SPEC category"
|
|
51
|
+
options:
|
|
52
|
+
- "API"
|
|
53
|
+
- "Backend"
|
|
54
|
+
- "Frontend"
|
|
55
|
+
- "Infrastructure"
|
|
56
|
+
- "Security"
|
|
57
|
+
- "Testing"
|
|
58
|
+
- "DevOps"
|
|
59
|
+
- "Documentation"
|
|
60
|
+
- "Performance"
|
|
61
|
+
- "Other"
|
|
62
|
+
validations:
|
|
63
|
+
required: true
|
|
64
|
+
|
|
65
|
+
- type: textarea
|
|
66
|
+
id: ubiquitous-requirements
|
|
67
|
+
attributes:
|
|
68
|
+
label: "Ubiquitous Requirements"
|
|
69
|
+
description: "Statements that apply universally to the system"
|
|
70
|
+
placeholder: |
|
|
71
|
+
- The system must provide JWT-based authentication
|
|
72
|
+
- The system must support token expiration
|
|
73
|
+
value: "### Ubiquitous\n"
|
|
74
|
+
validations:
|
|
75
|
+
required: true
|
|
76
|
+
|
|
77
|
+
- type: textarea
|
|
78
|
+
id: event-requirements
|
|
79
|
+
attributes:
|
|
80
|
+
label: "Event-driven Requirements (WHEN)"
|
|
81
|
+
description: "Event-triggered requirements in EARS format"
|
|
82
|
+
placeholder: |
|
|
83
|
+
- WHEN the user submits login credentials, the system must validate them against the database
|
|
84
|
+
- WHEN credentials are valid, the system must issue a JWT token with expiration
|
|
85
|
+
value: "### Event-driven (WHEN)\n"
|
|
86
|
+
validations:
|
|
87
|
+
required: false
|
|
88
|
+
|
|
89
|
+
- type: textarea
|
|
90
|
+
id: state-requirements
|
|
91
|
+
attributes:
|
|
92
|
+
label: "State-driven Requirements (WHILE)"
|
|
93
|
+
description: "State-based requirements in EARS format"
|
|
94
|
+
placeholder: |
|
|
95
|
+
- WHILE the token is unexpired, the system must allow access to protected resources
|
|
96
|
+
- WHILE the user is logged in, the system must track the session
|
|
97
|
+
value: "### State-driven (WHILE)\n"
|
|
98
|
+
validations:
|
|
99
|
+
required: false
|
|
100
|
+
|
|
101
|
+
- type: textarea
|
|
102
|
+
id: optional-requirements
|
|
103
|
+
attributes:
|
|
104
|
+
label: "Optional Requirements (WHERE)"
|
|
105
|
+
description: "Optional features and capabilities"
|
|
106
|
+
placeholder: |
|
|
107
|
+
- WHERE the user requests token refresh, the system can issue a new token
|
|
108
|
+
- WHERE OAuth2 is available, the system can support social login
|
|
109
|
+
value: "### Optional (WHERE)\n"
|
|
110
|
+
validations:
|
|
111
|
+
required: false
|
|
112
|
+
|
|
113
|
+
- type: textarea
|
|
114
|
+
id: constraints
|
|
115
|
+
attributes:
|
|
116
|
+
label: "Constraints (IF)"
|
|
117
|
+
description: "System constraints and conditions"
|
|
118
|
+
placeholder: |
|
|
119
|
+
- IF the token has expired, the system must return 401 Unauthorized
|
|
120
|
+
- IF the password is incorrect, the system must reject the login attempt
|
|
121
|
+
value: "### Constraints (IF)\n"
|
|
122
|
+
validations:
|
|
123
|
+
required: false
|
|
124
|
+
|
|
125
|
+
- type: textarea
|
|
126
|
+
id: acceptance-criteria
|
|
127
|
+
attributes:
|
|
128
|
+
label: "Acceptance Criteria (Given-When-Then)"
|
|
129
|
+
description: "At least 2-3 test scenarios"
|
|
130
|
+
placeholder: |
|
|
131
|
+
**Scenario 1: Successful Login**
|
|
132
|
+
- Given a user with valid credentials exists
|
|
133
|
+
- When the user submits their credentials
|
|
134
|
+
- Then the system returns a valid JWT token
|
|
135
|
+
|
|
136
|
+
**Scenario 2: Token Expiration**
|
|
137
|
+
- Given a user with an expired token
|
|
138
|
+
- When the user tries to access a protected resource
|
|
139
|
+
- Then the system returns a 401 Unauthorized response
|
|
140
|
+
value: "## Acceptance Criteria\n\n"
|
|
141
|
+
validations:
|
|
142
|
+
required: true
|
|
143
|
+
|
|
144
|
+
- type: textarea
|
|
145
|
+
id: dependencies
|
|
146
|
+
attributes:
|
|
147
|
+
label: "Dependencies"
|
|
148
|
+
description: "Related SPECs, tasks, or blockers"
|
|
149
|
+
placeholder: |
|
|
150
|
+
- Related: SPEC-SECURITY-001
|
|
151
|
+
- Blocks: SPEC-API-DESIGN-001
|
|
152
|
+
- Depends on: SPEC-DATABASE-001
|
|
153
|
+
validations:
|
|
154
|
+
required: false
|
|
155
|
+
|
|
156
|
+
- type: textarea
|
|
157
|
+
id: notes
|
|
158
|
+
attributes:
|
|
159
|
+
label: "Additional Notes"
|
|
160
|
+
description: "Technical notes, assumptions, or context"
|
|
161
|
+
placeholder: |
|
|
162
|
+
- Consider token refresh token rotation
|
|
163
|
+
- JWT payload should be minimal for performance
|
|
164
|
+
- Consider rate limiting on login attempts
|
|
165
|
+
validations:
|
|
166
|
+
required: false
|
|
167
|
+
|
|
168
|
+
- type: markdown
|
|
169
|
+
attributes:
|
|
170
|
+
value: |
|
|
171
|
+
## 📚 Reference
|
|
172
|
+
|
|
173
|
+
- **SPEC Metadata Guide**: See `.moai/memory/spec-metadata.md`
|
|
174
|
+
- **EARS Syntax Guide**: See `.moai/memory/development-guide.md`
|
|
175
|
+
- **Acceptance Criteria**: Use Given-When-Then (Gherkin) format
|
|
176
|
+
- **@TAG System**: @SPEC, @TEST, @CODE, @DOC traceability
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: 📋 SPEC Issue Sync
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- '.moai/specs/SPEC-*/spec.md'
|
|
7
|
+
types: [opened, synchronize]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
issues: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
sync-spec-to-issue:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
name: 🔄 Sync SPEC to GitHub Issue
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
25
|
+
|
|
26
|
+
- name: Find and parse SPEC file
|
|
27
|
+
id: spec
|
|
28
|
+
run: |
|
|
29
|
+
set -x # Enable debug mode
|
|
30
|
+
|
|
31
|
+
# Debug: Show current directory and files
|
|
32
|
+
echo "=== Debug: Current directory ==="
|
|
33
|
+
pwd
|
|
34
|
+
ls -la
|
|
35
|
+
|
|
36
|
+
echo "=== Debug: Looking for .moai/specs ==="
|
|
37
|
+
ls -la .moai/ 2>&1 || echo ".moai/ directory not found"
|
|
38
|
+
|
|
39
|
+
# Find SPEC files in the PR
|
|
40
|
+
echo "=== Debug: Searching for SPEC files ==="
|
|
41
|
+
find . -name "spec.md" -type f 2>&1 || echo "find command failed"
|
|
42
|
+
|
|
43
|
+
spec_file=$(find .moai/specs -name "spec.md" -type f 2>&1 | head -1)
|
|
44
|
+
echo "Found spec_file: [$spec_file]"
|
|
45
|
+
|
|
46
|
+
if [ -z "$spec_file" ]; then
|
|
47
|
+
echo "⚠️ No SPEC file found in .moai/specs"
|
|
48
|
+
echo "Exiting gracefully (this is expected if no SPEC files changed)"
|
|
49
|
+
exit 0
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
echo "✅ Found SPEC file: $spec_file"
|
|
53
|
+
echo "spec_file=$spec_file" >> $GITHUB_OUTPUT
|
|
54
|
+
|
|
55
|
+
# Extract YAML metadata using grep
|
|
56
|
+
spec_id=$(grep "^id:" "$spec_file" | sed 's/^id: *//' | tr -d ' "')
|
|
57
|
+
spec_version=$(grep "^version:" "$spec_file" | sed 's/^version: *//' | tr -d ' "')
|
|
58
|
+
spec_status=$(grep "^status:" "$spec_file" | sed 's/^status: *//' | tr -d ' "')
|
|
59
|
+
spec_priority=$(grep "^priority:" "$spec_file" | sed 's/^priority: *//' | tr -d ' "')
|
|
60
|
+
|
|
61
|
+
# Extract title from H1 heading
|
|
62
|
+
spec_title=$(grep "^# @SPEC:" "$spec_file" | sed 's/^# @SPEC:[^:]*: //')
|
|
63
|
+
|
|
64
|
+
echo "✅ Extracted SPEC metadata:"
|
|
65
|
+
echo " ID: $spec_id"
|
|
66
|
+
echo " Title: $spec_title"
|
|
67
|
+
echo " Version: $spec_version"
|
|
68
|
+
echo " Status: $spec_status"
|
|
69
|
+
echo " Priority: $spec_priority"
|
|
70
|
+
|
|
71
|
+
echo "spec_id=$spec_id" >> $GITHUB_OUTPUT
|
|
72
|
+
echo "spec_version=$spec_version" >> $GITHUB_OUTPUT
|
|
73
|
+
echo "spec_status=$spec_status" >> $GITHUB_OUTPUT
|
|
74
|
+
echo "spec_priority=$spec_priority" >> $GITHUB_OUTPUT
|
|
75
|
+
echo "spec_title=$spec_title" >> $GITHUB_OUTPUT
|
|
76
|
+
|
|
77
|
+
- name: Create GitHub Issue
|
|
78
|
+
if: steps.spec.outputs.spec_id
|
|
79
|
+
id: create-issue
|
|
80
|
+
env:
|
|
81
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
82
|
+
run: |
|
|
83
|
+
spec_id="${{ steps.spec.outputs.spec_id }}"
|
|
84
|
+
spec_version="${{ steps.spec.outputs.spec_version }}"
|
|
85
|
+
spec_title="${{ steps.spec.outputs.spec_title }}"
|
|
86
|
+
spec_status="${{ steps.spec.outputs.spec_status }}"
|
|
87
|
+
spec_priority="${{ steps.spec.outputs.spec_priority }}"
|
|
88
|
+
spec_file="${{ steps.spec.outputs.spec_file }}"
|
|
89
|
+
|
|
90
|
+
# Read SPEC content (skip YAML frontmatter: 9 lines + 1 blank = 10 lines total)
|
|
91
|
+
# Start reading from line 11
|
|
92
|
+
spec_content=$(tail -n +11 "$spec_file")
|
|
93
|
+
|
|
94
|
+
# Create issue body using GitHub Actions recommended pattern
|
|
95
|
+
# Reference: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
|
|
96
|
+
{
|
|
97
|
+
echo "## SPEC Metadata"
|
|
98
|
+
echo ""
|
|
99
|
+
echo "| Field | Value |"
|
|
100
|
+
echo "|-------|-------|"
|
|
101
|
+
echo "| **ID** | $spec_id |"
|
|
102
|
+
echo "| **Version** | $spec_version |"
|
|
103
|
+
echo "| **Status** | $spec_status |"
|
|
104
|
+
echo "| **Priority** | $spec_priority |"
|
|
105
|
+
echo ""
|
|
106
|
+
echo "## SPEC Document"
|
|
107
|
+
echo ""
|
|
108
|
+
echo "$spec_content"
|
|
109
|
+
echo ""
|
|
110
|
+
echo "---"
|
|
111
|
+
echo ""
|
|
112
|
+
echo "📎 **Branch**: \`feature/$spec_id\`"
|
|
113
|
+
echo "🔗 **PR**: #${{ github.event.pull_request.number }}"
|
|
114
|
+
echo "📝 **Auto-synced**: This issue is automatically synchronized from the SPEC document"
|
|
115
|
+
} > /tmp/issue_body.txt
|
|
116
|
+
|
|
117
|
+
echo "📋 Creating GitHub Issue..."
|
|
118
|
+
echo " Title: [SPEC-$spec_id] $spec_title (v$spec_version)"
|
|
119
|
+
echo " Body file: /tmp/issue_body.txt"
|
|
120
|
+
wc -l /tmp/issue_body.txt
|
|
121
|
+
|
|
122
|
+
# Create issue with labels using body-file
|
|
123
|
+
issue_output=$(gh issue create \
|
|
124
|
+
--title "[SPEC-$spec_id] $spec_title (v$spec_version)" \
|
|
125
|
+
--body-file /tmp/issue_body.txt \
|
|
126
|
+
--label "spec" \
|
|
127
|
+
--label "planning" \
|
|
128
|
+
--label "$spec_priority" 2>&1)
|
|
129
|
+
|
|
130
|
+
echo "$issue_output" | tee /tmp/issue_output.txt
|
|
131
|
+
|
|
132
|
+
# Extract issue number from output
|
|
133
|
+
issue_num=$(echo "$issue_output" | grep -oE '/issues/[0-9]+' | grep -oE '[0-9]+' | head -1)
|
|
134
|
+
|
|
135
|
+
if [ -z "$issue_num" ]; then
|
|
136
|
+
echo "⚠️ Could not extract issue number from output"
|
|
137
|
+
echo "Full output:"
|
|
138
|
+
cat /tmp/issue_output.txt
|
|
139
|
+
exit 1
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
echo "issue_number=$issue_num" >> $GITHUB_OUTPUT
|
|
143
|
+
echo "✅ Created issue #$issue_num"
|
|
144
|
+
|
|
145
|
+
- name: Add PR comment
|
|
146
|
+
if: steps.create-issue.outputs.issue_number
|
|
147
|
+
env:
|
|
148
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
149
|
+
run: |
|
|
150
|
+
issue_num="${{ steps.create-issue.outputs.issue_number }}"
|
|
151
|
+
spec_id="${{ steps.spec.outputs.spec_id }}"
|
|
152
|
+
spec_title="${{ steps.spec.outputs.spec_title }}"
|
|
153
|
+
|
|
154
|
+
# Create PR comment body using same pattern
|
|
155
|
+
{
|
|
156
|
+
echo "✅ **SPEC GitHub Issue Created**"
|
|
157
|
+
echo ""
|
|
158
|
+
echo "This SPEC has been synchronized to GitHub Issue."
|
|
159
|
+
echo ""
|
|
160
|
+
echo "📋 **Issue**: [#$issue_num - SPEC-$spec_id: $spec_title](../issues/$issue_num)"
|
|
161
|
+
echo "🔗 **SPEC File**: \`.moai/specs/SPEC-$spec_id/spec.md\`"
|
|
162
|
+
echo ""
|
|
163
|
+
echo "The issue will be automatically updated as you modify the SPEC document."
|
|
164
|
+
} > /tmp/pr_comment.txt
|
|
165
|
+
|
|
166
|
+
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/pr_comment.txt
|
|
167
|
+
echo "✅ Added PR comment linking to issue #$issue_num"
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"current_stage": "initialized"
|
|
57
57
|
},
|
|
58
58
|
"project": {
|
|
59
|
-
"
|
|
59
|
+
"name": "{{PROJECT_NAME}}",
|
|
60
60
|
"description": "{{PROJECT_DESCRIPTION}}",
|
|
61
|
-
"initialized": true,
|
|
62
|
-
"locale": "en",
|
|
63
61
|
"mode": "{{PROJECT_MODE}}",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
62
|
+
"locale": "{{CONVERSATION_LANGUAGE}}",
|
|
63
|
+
"language": "{{CODEBASE_LANGUAGE}}",
|
|
64
|
+
"created_at": "{{CREATION_TIMESTAMP}}",
|
|
65
|
+
"initialized": true,
|
|
66
66
|
"optimized": false
|
|
67
67
|
},
|
|
68
68
|
"tags": {
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# CLAUDE-AGENTS-GUIDE.md
|
|
2
|
+
|
|
3
|
+
> MoAI-ADK Agent Architecture & Decision Guide
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## For Alfred: Why This Document Matters
|
|
8
|
+
|
|
9
|
+
When Alfred reads this document:
|
|
10
|
+
|
|
11
|
+
1. Upon receiving a new task - Decide "Which Sub-agent should I invoke?"
|
|
12
|
+
2. When complex tasks are required - Determine sequence and collaboration patterns among multiple agents
|
|
13
|
+
3. When reviewing team structure - Verify responsibility scope of each agent
|
|
14
|
+
|
|
15
|
+
Alfred's Decision Making:
|
|
16
|
+
|
|
17
|
+
- "Should this task be handled by spec-builder or code-builder?"
|
|
18
|
+
- "When should I invoke the Explore agent and when should I not?"
|
|
19
|
+
- "Is the Haiku model sufficient for this task, or do I need Sonnet?"
|
|
20
|
+
|
|
21
|
+
After reading this document:
|
|
22
|
+
|
|
23
|
+
- Clearly understand the responsibility scope of 19 Sub-agents
|
|
24
|
+
- Grasp how 55 Skills are organized by tier
|
|
25
|
+
- Master Agent collaboration principles (Command Precedence, Single Responsibility, etc.)
|
|
26
|
+
- Learn Haiku vs Sonnet model selection criteria
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
→ Related Documents:
|
|
31
|
+
|
|
32
|
+
- [For Alfred's decision-making rules, see CLAUDE-RULES.md](./CLAUDE-RULES.md#skill-invocation-rules)
|
|
33
|
+
- [For actual Agent invocation examples, see CLAUDE-PRACTICES.md](./CLAUDE-PRACTICES.md#practical-workflow-examples)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 4-Layer Architecture
|
|
38
|
+
|
|
39
|
+
| Layer | Owner | Purpose | Examples |
|
|
40
|
+
| --------------- | ------------------ | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| **Commands** | User ↔ Alfred | Workflow entry points that establish the Plan → Run → Sync cadence | `/alfred:0-project`, `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync` |
|
|
42
|
+
| **Sub-agents** | Alfred | Deep reasoning and decision making for each phase | project-manager, spec-builder, code-builder pipeline, doc-syncer |
|
|
43
|
+
| **Skills (55)** | Claude Skills | Reusable knowledge capsules loaded just-in-time | Foundation (TRUST/TAG/Git), Essentials (debug/refactor/review), Alfred workflow, Domain & Language packs |
|
|
44
|
+
| **Hooks** | Runtime guardrails | Fast validation + JIT context hints (<100 ms) | SessionStart status card, PreToolUse destructive-command blocker |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Core Sub-agent Roster
|
|
49
|
+
|
|
50
|
+
> Alfred + 10 core sub-agents + 6 zero-project specialists + 2 built-in Claude agents = **19-member team**
|
|
51
|
+
>
|
|
52
|
+
> **Note on Counting**: The "code-builder pipeline" is counted as 1 conceptual agent but implemented as 2 physical files (`implementation-planner` + `tdd-implementer`) for sequential RED → GREEN → REFACTOR execution. This maintains the 19-member team concept while acknowledging that 20 distinct agent files exist in `.claude/agents/alfred/`.
|
|
53
|
+
|
|
54
|
+
| Sub-agent | Model | Phase | Responsibility | Trigger |
|
|
55
|
+
| ---------------------------- | ------ | ----------- | ---------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
56
|
+
| **project-manager** 📋 | Sonnet | Init | Project bootstrap, metadata interview, mode selection | `/alfred:0-project` |
|
|
57
|
+
| **spec-builder** 🏗️ | Sonnet | Plan | Plan board consolidation, EARS-based SPEC authoring | `/alfred:1-plan` |
|
|
58
|
+
| **code-builder pipeline** 💎 | Sonnet | Run | Phase 1 `implementation-planner` → Phase 2 `tdd-implementer` to execute RED → GREEN → REFACTOR | `/alfred:2-run` |
|
|
59
|
+
| **doc-syncer** 📖 | Haiku | Sync | Living documentation, README/CHANGELOG updates | `/alfred:3-sync` |
|
|
60
|
+
| **tag-agent** 🏷️ | Haiku | Sync | TAG inventory, orphan detection, chain repair | `@agent-tag-agent` |
|
|
61
|
+
| **git-manager** 🚀 | Haiku | Plan · Sync | GitFlow automation, Draft→Ready PR, auto-merge policy | `@agent-git-manager` |
|
|
62
|
+
| **debug-helper** 🔍 | Sonnet | Run | Failure diagnosis, fix-forward guidance | `@agent-debug-helper` |
|
|
63
|
+
| **trust-checker** ✅ | Haiku | All phases | TRUST 5 principle enforcement and risk flags | `@agent-trust-checker` |
|
|
64
|
+
| **quality-gate** 🛡️ | Haiku | Sync | Coverage delta review, release gate validation | Auto during `/alfred:3-sync` |
|
|
65
|
+
| **cc-manager** 🛠️ | Sonnet | Ops | Claude Code session tuning, Skill lifecycle management | `@agent-cc-manager` |
|
|
66
|
+
|
|
67
|
+
The **code-builder pipeline** runs two Sonnet specialists in sequence: **implementation-planner** (strategy, libraries, TAG design) followed by **tdd-implementer** (RED → GREEN → REFACTOR execution).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Zero-project Specialists
|
|
72
|
+
|
|
73
|
+
| Sub-agent | Model | Focus | Trigger |
|
|
74
|
+
| -------------------------- | ------ | ----------------------------------------------------------- | ------------------------------- |
|
|
75
|
+
| **language-detector** 🔍 | Haiku | Stack detection, language matrix | Auto during `/alfred:0-project` |
|
|
76
|
+
| **backup-merger** 📦 | Sonnet | Backup restore, checkpoint diff | `@agent-backup-merger` |
|
|
77
|
+
| **project-interviewer** 💬 | Sonnet | Requirement interviews, persona capture | `/alfred:0-project` Q&A |
|
|
78
|
+
| **document-generator** 📝 | Haiku | Project docs seed (`product.md`, `structure.md`, `tech.md`) | `/alfred:0-project` |
|
|
79
|
+
| **feature-selector** 🎯 | Haiku | Skill pack recommendation | `/alfred:0-project` |
|
|
80
|
+
| **template-optimizer** ⚙️ | Haiku | Template cleanup, migration helpers | `/alfred:0-project` |
|
|
81
|
+
|
|
82
|
+
> **Implementation Note**: Zero-project specialists may be embedded within other agents (e.g., functionality within `project-manager`) or implemented as dedicated Skills (e.g., `moai-alfred-language-detection`). For example, `language-detector` functionality is provided by the `moai-alfred-language-detection` Skill during `/alfred:0-project` initialization.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Built-in Claude Agents
|
|
87
|
+
|
|
88
|
+
| Agent | Model | Specialty | Invocation |
|
|
89
|
+
| ------------------- | ------ | --------------------------------------------- | ---------------- |
|
|
90
|
+
| **Explore** 🔍 | Haiku | Repository-wide search & architecture mapping | `@agent-Explore` |
|
|
91
|
+
| **general-purpose** | Sonnet | General assistance | Automatic |
|
|
92
|
+
|
|
93
|
+
### Explore Agent Guide
|
|
94
|
+
|
|
95
|
+
The **Explore** agent excels at navigating large codebases.
|
|
96
|
+
|
|
97
|
+
**Use cases**:
|
|
98
|
+
|
|
99
|
+
- ✅ **Code analysis** (understand complex implementations, trace dependencies, study architecture)
|
|
100
|
+
- ✅ Search for specific keywords or patterns (e.g., "API endpoints", "authentication logic")
|
|
101
|
+
- ✅ Locate files (e.g., `src/components/**/*.tsx`)
|
|
102
|
+
- ✅ Understand codebase structure (e.g., "explain the project architecture")
|
|
103
|
+
- ✅ Search across many files (Glob + Grep patterns)
|
|
104
|
+
|
|
105
|
+
**Recommend Explore when**:
|
|
106
|
+
|
|
107
|
+
- 🔍 You need to understand a complex structure
|
|
108
|
+
- 🔍 The implementation spans multiple files
|
|
109
|
+
- 🔍 You want the end-to-end flow of a feature
|
|
110
|
+
- 🔍 Dependency relationships must be analyzed
|
|
111
|
+
- 🔍 You're planning a refactor and need impact analysis
|
|
112
|
+
|
|
113
|
+
**Usage**: Use `Task(subagent_type="Explore", ...)` for deep codebase analysis. Declare `thoroughness: quick|medium|very thorough` in the prompt.
|
|
114
|
+
|
|
115
|
+
**Examples**:
|
|
116
|
+
|
|
117
|
+
- Deep analysis: "Analyze TemplateProcessor class and its dependencies" (thoroughness: very thorough)
|
|
118
|
+
- Domain search: "Find all AUTH-related files in SPEC/tests/src/docs" (thoroughness: medium)
|
|
119
|
+
- Natural language: "Where is JWT authentication implemented?" → Alfred auto-delegates
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Claude Skills (55 packs)
|
|
124
|
+
|
|
125
|
+
Alfred relies on 55 Claude Skills grouped by tier. Skills load via Progressive Disclosure: metadata is available at session start, full `SKILL.md` content loads when a sub-agent references it, and supporting templates stream only when required.
|
|
126
|
+
|
|
127
|
+
**Skills Distribution by Tier**:
|
|
128
|
+
|
|
129
|
+
| Tier | Count | Purpose |
|
|
130
|
+
| --------------- | ------ | -------------------------------------------- |
|
|
131
|
+
| Foundation | 6 | Core TRUST/TAG/SPEC/Git/EARS/Lang principles |
|
|
132
|
+
| Essentials | 4 | Debug/Perf/Refactor/Review workflows |
|
|
133
|
+
| Alfred | 11 | Internal workflow orchestration |
|
|
134
|
+
| Domain | 10 | Specialized domain expertise |
|
|
135
|
+
| Language | 23 | Language-specific best practices |
|
|
136
|
+
| Claude Code Ops | 1 | Session management |
|
|
137
|
+
| **Total** | **55** | Complete knowledge capsule library |
|
|
138
|
+
|
|
139
|
+
**Foundation Tier (6)**: `moai-foundation-trust`, `moai-foundation-tags`, `moai-foundation-specs`, `moai-foundation-ears`, `moai-foundation-git`, `moai-foundation-langs` (TRUST/TAG/SPEC/EARS/Git/language detection)
|
|
140
|
+
|
|
141
|
+
**Essentials Tier (4)**: `moai-essentials-debug`, `moai-essentials-perf`, `moai-essentials-refactor`, `moai-essentials-review` (Debug/Perf/Refactor/Review workflows)
|
|
142
|
+
|
|
143
|
+
**Alfred Tier (11)**: `moai-alfred-code-reviewer`, `moai-alfred-debugger-pro`, `moai-alfred-ears-authoring`, `moai-alfred-git-workflow`, `moai-alfred-language-detection`, `moai-alfred-performance-optimizer`, `moai-alfred-refactoring-coach`, `moai-alfred-spec-metadata-validation`, `moai-alfred-tag-scanning`, `moai-alfred-trust-validation`, `moai-alfred-interactive-questions` (code review, debugging, EARS, Git, language detection, performance, refactoring, metadata, TAG scanning, trust validation, interactive questions)
|
|
144
|
+
|
|
145
|
+
**Domain Tier (10)** — `moai-domain-backend`, `web-api`, `frontend`, `mobile-app`, `security`, `devops`, `database`, `data-science`, `ml`, `cli-tool`.
|
|
146
|
+
|
|
147
|
+
**Language Tier (23)** — Python, TypeScript, Go, Rust, Java, Kotlin, Swift, Dart, C/C++, C#, Scala, Haskell, Elixir, Clojure, Lua, Ruby, PHP, JavaScript, SQL, Shell, Julia, R, plus supporting stacks.
|
|
148
|
+
|
|
149
|
+
**Claude Code Ops (1)** — `moai-claude-code` manages session settings, output styles, and Skill deployment.
|
|
150
|
+
|
|
151
|
+
Skills keep the core knowledge lightweight while allowing Alfred to assemble the right expertise for each request.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Agent Collaboration Principles
|
|
156
|
+
|
|
157
|
+
- **Command precedence**: Command instructions outrank agent guidelines; follow the command if conflicts occur.
|
|
158
|
+
- **Single responsibility**: Each agent handles only its specialty.
|
|
159
|
+
- **Zero overlapping ownership**: When unsure, hand off to the agent with the most direct expertise.
|
|
160
|
+
- **Confidence reporting**: Always share confidence levels and identified risks when completing a task.
|
|
161
|
+
- **Escalation path**: When blocked, escalate to Alfred with context, attempted steps, and suggested next actions.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Model Selection Guide
|
|
166
|
+
|
|
167
|
+
| Model | Primary use cases | Representative sub-agents | Why it fits |
|
|
168
|
+
| --------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
169
|
+
| **Claude 4.5 Haiku** | Documentation sync, TAG inventory, Git automation, rule-based checks | doc-syncer, tag-agent, git-manager, trust-checker, quality-gate, Explore | Fast, deterministic output for patterned or string-heavy work |
|
|
170
|
+
| **Claude 4.5 Sonnet** | Planning, implementation, troubleshooting, session ops | Alfred, project-manager, spec-builder, code-builder pipeline, debug-helper, cc-manager | Deep reasoning, multi-step synthesis, creative problem solving |
|
|
171
|
+
|
|
172
|
+
**Guidelines**:
|
|
173
|
+
|
|
174
|
+
- Default to **Haiku** when the task is pattern-driven or requires rapid iteration; escalate to **Sonnet** for novel design, architecture, or ambiguous problem solving.
|
|
175
|
+
- Record any manual model switch in the task notes (who, why, expected benefit).
|
|
176
|
+
- Combine both models when needed: e.g., Sonnet plans a refactor, Haiku formats and validates the resulting docs.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Agent Selection Decision Tree
|
|
181
|
+
|
|
182
|
+
| Situation | Recommended Agent | Reason |
|
|
183
|
+
| --------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
184
|
+
| Need codebase understanding | **Explore** | Specialized in rapid analysis of large projects. Understand entire structure with Glob + Grep patterns |
|
|
185
|
+
| Write SPEC for new feature | **spec-builder** | Expert in EARS syntax + SPEC structure. Auto-manage YAML metadata + HISTORY |
|
|
186
|
+
| Analyze bug causes | **debug-helper** | Expert in stack trace + error pattern analysis. Recommends fix-forward vs rollback |
|
|
187
|
+
| Code implementation (TDD) | **code-builder pipeline** | Automates RED → GREEN → REFACTOR. Sequential execution of implementation-planner + tdd-implementer |
|
|
188
|
+
| Need document sync | **doc-syncer** | Automates Living Documents. Generates README + CHANGELOG, verifies TAG chain |
|
|
189
|
+
| Git/PR management | **git-manager** | Automates GitFlow + Draft→Ready. Creates feature branches + PRs |
|
|
190
|
+
| Version release | **git-manager** | Automates releases. Generates CHANGELOG + creates tags + merges PR |
|
|
191
|
+
| Verify TAG integrity | **tag-agent** | Specializes in TAG chain verification. Detects orphan TAGs + recommends fixes |
|
|
192
|
+
| Verify code quality | **trust-checker** | Verifies TRUST 5 principles. Checks Test/Readable/Unified/Secured/Trackable |
|
|
193
|
+
| Verify release gate | **quality-gate** | Coverage delta + security scan. Final verification before release |
|
|
194
|
+
| Project initialization | **project-manager** | Metadata interview + mode selection. Dedicated to `/alfred:0-project` |
|
|
195
|
+
| Claude Code session mgmt | **cc-manager** | Skill lifecycle + output style management. Specialized in session tuning |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
**Usage Examples**:
|
|
200
|
+
|
|
201
|
+
- "User requests 'Add login feature'" → **spec-builder** (Write SPEC) → **code-builder pipeline** (Implement) → **doc-syncer** (Document)
|
|
202
|
+
- "Tests are failing" → **debug-helper** (Analyze cause) → **code-builder pipeline** (Fix) → **trust-checker** (Re-verify quality)
|
|
203
|
+
- "Prepare for release" → **quality-gate** (Final verification) → **git-manager** (PR merge + tag)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Last Updated**: 2025-10-27
|
|
208
|
+
**Document Version**: v1.0.0
|