moai-adk 0.4.7__py3-none-any.whl → 0.4.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/templates/.claude/agents/alfred/cc-manager.md +188 -954
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +4 -5
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +2 -2
- moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +3 -3
- moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -6
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +4 -6
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +36 -36
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +2 -2
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +2 -2
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +3 -3
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +5 -5
- moai_adk/templates/.claude/commands/alfred/0-project.md +98 -42
- moai_adk/templates/.claude/commands/alfred/1-plan.md +7 -7
- moai_adk/templates/.claude/commands/alfred/2-run.md +36 -36
- moai_adk/templates/.claude/commands/alfred/3-sync.md +10 -10
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +14 -1
- moai_adk/templates/.claude/hooks/alfred/core/__init__.py +115 -33
- moai_adk/templates/.claude/hooks/alfred/handlers/session.py +8 -9
- moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +6 -6
- moai_adk/templates/.claude/hooks/alfred/handlers/user.py +5 -4
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +1 -1
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +1 -1
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +1 -1
- moai_adk/templates/.claude/settings.json +42 -2
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +480 -0
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +257 -0
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +120 -0
- moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +249 -0
- moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +278 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +287 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +232 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +179 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +296 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +243 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +271 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +261 -35
- moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +15 -15
- moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +33 -33
- moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +438 -42
- moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +129 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +1300 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
- moai_adk/templates/CLAUDE.md +101 -93
- {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/METADATA +537 -146
- {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/RECORD +63 -73
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -635
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -992
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +0 -801
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -121
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +0 -30
- {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.7.dist-info → moai_adk-0.4.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# moai-alfred-interactive-questions - Working Examples
|
|
2
|
+
|
|
3
|
+
_Last updated: 2025-10-23_
|
|
4
|
+
|
|
5
|
+
## Example 1: Simple Confirmation
|
|
6
|
+
|
|
7
|
+
**Scenario**: Destructive operation (delete 50 user records)
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
const answer = await AskUserQuestion({
|
|
11
|
+
questions: [{
|
|
12
|
+
question: "This will permanently delete 50 user records. Continue?",
|
|
13
|
+
header: "Confirm",
|
|
14
|
+
multiSelect: false,
|
|
15
|
+
options: [
|
|
16
|
+
{ label: "Yes, proceed", description: "Irreversible operation. Delete now." },
|
|
17
|
+
{ label: "No, cancel", description: "Abort and return." }
|
|
18
|
+
]
|
|
19
|
+
}]
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (answer["Confirm"] === "Yes, proceed") {
|
|
23
|
+
// Execute deletion
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Example 2: Implementation Approach
|
|
30
|
+
|
|
31
|
+
**Scenario**: "Add a completion page" (vague)
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
const answer = await AskUserQuestion({
|
|
35
|
+
questions: [
|
|
36
|
+
{
|
|
37
|
+
question: "How should the completion page be implemented?",
|
|
38
|
+
header: "Approach",
|
|
39
|
+
multiSelect: false,
|
|
40
|
+
options: [
|
|
41
|
+
{ label: "New public route", description: "Separate page at /competition-closed" },
|
|
42
|
+
{ label: "Modify /end page", description: "Add conditional logic to existing page" },
|
|
43
|
+
{ label: "Environment flag", description: "Use NEXT_PUBLIC_COMPETITION_CLOSED" }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
question: "For logged-in participants?",
|
|
48
|
+
header: "Behavior",
|
|
49
|
+
multiSelect: false,
|
|
50
|
+
options: [
|
|
51
|
+
{ label: "Show results", description: "Redirect to /end with full history" },
|
|
52
|
+
{ label: "Show message", description: "'Competition concluded' only" }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const approach = answer["Approach"];
|
|
59
|
+
const behavior = answer["Behavior"];
|
|
60
|
+
// Proceed with confirmed specifications
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Example 3: Multi-Select (Independent Features)
|
|
66
|
+
|
|
67
|
+
**Scenario**: "Which testing frameworks?"
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
const answer = await AskUserQuestion({
|
|
71
|
+
questions: [{
|
|
72
|
+
question: "Which testing frameworks to include?",
|
|
73
|
+
header: "Test Tools",
|
|
74
|
+
multiSelect: true, // User can select multiple
|
|
75
|
+
options: [
|
|
76
|
+
{ label: "Unit tests (Vitest)", description: "Fast unit testing." },
|
|
77
|
+
{ label: "E2E tests (Playwright)", description: "Browser automation." },
|
|
78
|
+
{ label: "Visual regression", description: "Screenshot comparison." }
|
|
79
|
+
]
|
|
80
|
+
}]
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const selectedTools = answer["Test Tools"]; // ["Unit tests (Vitest)", "E2E tests (Playwright)"]
|
|
84
|
+
// Install selected frameworks
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Example 4: Sequential Questions (Conditional)
|
|
90
|
+
|
|
91
|
+
**Scenario**: Q2 depends on Q1 answer
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
// Question 1
|
|
95
|
+
const q1 = await AskUserQuestion({
|
|
96
|
+
questions: [{
|
|
97
|
+
question: "Enable authentication?",
|
|
98
|
+
header: "Auth",
|
|
99
|
+
options: [
|
|
100
|
+
{ label: "Yes", description: "User login required." },
|
|
101
|
+
{ label: "No", description: "Public access." }
|
|
102
|
+
]
|
|
103
|
+
}]
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Question 2 (only if Q1 = "Yes")
|
|
107
|
+
if (q1["Auth"] === "Yes") {
|
|
108
|
+
const q2 = await AskUserQuestion({
|
|
109
|
+
questions: [{
|
|
110
|
+
question: "Which auth provider?",
|
|
111
|
+
header: "Provider",
|
|
112
|
+
options: [
|
|
113
|
+
{ label: "JWT + email", description: "Traditional email/password." },
|
|
114
|
+
{ label: "OAuth", description: "Third-party login (Google, GitHub)." }
|
|
115
|
+
]
|
|
116
|
+
}]
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const provider = q2["Provider"];
|
|
120
|
+
// Setup authentication
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Example 5: Feature Selection
|
|
127
|
+
|
|
128
|
+
**Scenario**: "Which i18n library?"
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
const answer = await AskUserQuestion({
|
|
132
|
+
questions: [{
|
|
133
|
+
question: "Which i18n library?",
|
|
134
|
+
header: "Library",
|
|
135
|
+
multiSelect: false,
|
|
136
|
+
options: [
|
|
137
|
+
{ label: "next-intl", description: "Next.js 15+ native, best DX." },
|
|
138
|
+
{ label: "react-i18next", description: "Popular, flexible, more setup." },
|
|
139
|
+
{ label: "Format.js", description: "ICU format, complex but powerful." }
|
|
140
|
+
]
|
|
141
|
+
}]
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const library = answer["Library"]; // "next-intl"
|
|
145
|
+
// Install and configure library
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Example 6: Error Recovery
|
|
151
|
+
|
|
152
|
+
**Scenario**: 3 tests failed, ask how to proceed
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
const answer = await AskUserQuestion({
|
|
156
|
+
questions: [{
|
|
157
|
+
question: "3 tests failed in auth.test.ts. How should we proceed?",
|
|
158
|
+
header: "Test Failure",
|
|
159
|
+
multiSelect: false,
|
|
160
|
+
options: [
|
|
161
|
+
{ label: "Debug immediately", description: "Stop and fix now." },
|
|
162
|
+
{ label: "Skip tests", description: "NOT RECOMMENDED - continues with failing tests." },
|
|
163
|
+
{ label: "Rollback changes", description: "Revert to last passing commit." }
|
|
164
|
+
]
|
|
165
|
+
}]
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
if (answer["Test Failure"] === "Debug immediately") {
|
|
169
|
+
// Trigger debug workflow
|
|
170
|
+
} else if (answer["Test Failure"] === "Rollback changes") {
|
|
171
|
+
// Rollback git changes
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Example 7: /alfred:1-plan Integration
|
|
178
|
+
|
|
179
|
+
**Scenario**: spec-builder detects ambiguous SPEC title
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
// Inside spec-builder
|
|
183
|
+
function shouldAskForClarification(title: string): boolean {
|
|
184
|
+
return title.length < 20 || title.includes("feature/add/implement");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (shouldAskForClarification(userTitle)) {
|
|
188
|
+
const answer = await AskUserQuestion({
|
|
189
|
+
questions: [{
|
|
190
|
+
question: "Can you clarify what this SPEC should cover?",
|
|
191
|
+
header: "Scope",
|
|
192
|
+
options: [
|
|
193
|
+
{ label: "Authentication system", description: "User login, JWT tokens, refresh logic." },
|
|
194
|
+
{ label: "UI components", description: "Reusable components library." },
|
|
195
|
+
{ label: "API endpoints", description: "REST API implementation." }
|
|
196
|
+
]
|
|
197
|
+
}]
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
specTitle = answer["Scope"];
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Example 8: /alfred:2-run Integration
|
|
207
|
+
|
|
208
|
+
**Scenario**: code-builder detects multiple implementation paths
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
// Inside code-builder
|
|
212
|
+
if (multipleValidImplementationPaths) {
|
|
213
|
+
const answer = await AskUserQuestion({
|
|
214
|
+
questions: [{
|
|
215
|
+
question: "How should we implement JWT storage?",
|
|
216
|
+
header: "Storage",
|
|
217
|
+
options: [
|
|
218
|
+
{ label: "HttpOnly cookie", description: "Most secure, no JS access." },
|
|
219
|
+
{ label: "LocalStorage", description: "Accessible but vulnerable to XSS." },
|
|
220
|
+
{ label: "Memory + refresh", description: "Balance between security and UX." }
|
|
221
|
+
]
|
|
222
|
+
}]
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
const storageStrategy = answer["Storage"];
|
|
226
|
+
implementWithStrategy(storageStrategy);
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Example 9: /alfred:3-sync Integration
|
|
233
|
+
|
|
234
|
+
**Scenario**: doc-syncer asks about sync mode
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
// Inside doc-syncer
|
|
238
|
+
const answer = await AskUserQuestion({
|
|
239
|
+
questions: [{
|
|
240
|
+
question: "Which sync mode?",
|
|
241
|
+
header: "Mode",
|
|
242
|
+
multiSelect: false,
|
|
243
|
+
options: [
|
|
244
|
+
{ label: "auto", description: "Smart detection, sync affected docs only." },
|
|
245
|
+
{ label: "force", description: "Regenerate all docs from scratch." },
|
|
246
|
+
{ label: "status", description: "Show status without making changes." }
|
|
247
|
+
]
|
|
248
|
+
}]
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
const syncMode = answer["Mode"];
|
|
252
|
+
runSync(syncMode);
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
For detailed guidance, see **SKILL.md** and **reference.md**
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# moai-alfred-interactive-questions - Quick Reference
|
|
2
|
+
|
|
3
|
+
_Last updated: 2025-10-23_
|
|
4
|
+
|
|
5
|
+
## AskUserQuestion API Essentials
|
|
6
|
+
|
|
7
|
+
### Minimal Template
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
const answer = await AskUserQuestion({
|
|
11
|
+
questions: [
|
|
12
|
+
{
|
|
13
|
+
question: "Your question here?",
|
|
14
|
+
header: "Short label", // max 12 chars
|
|
15
|
+
multiSelect: false, // or true for multi-select
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
label: "Option 1", // 1-5 words
|
|
19
|
+
description: "Why you'd pick this option."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "Option 2",
|
|
23
|
+
description: "Alternative with different implications."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Access result
|
|
31
|
+
const choice = answer["Short label"]; // "Option 1" or ["Option 1", "Option 2"]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## When to Ask (Checklist)
|
|
37
|
+
|
|
38
|
+
- [ ] User intent is ambiguous
|
|
39
|
+
- [ ] Multiple valid implementation paths exist
|
|
40
|
+
- [ ] Trade-off decision (speed vs quality, simple vs complete)
|
|
41
|
+
- [ ] Risky/destructive operation needs approval
|
|
42
|
+
- [ ] Feature scope needs definition
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Top 5 Patterns
|
|
47
|
+
|
|
48
|
+
| Pattern | Use When | Example |
|
|
49
|
+
|---------|----------|---------|
|
|
50
|
+
| **Implementation Approach** | "Add feature X" without specifics | New component vs extend existing |
|
|
51
|
+
| **Confirmation** | Destructive action (delete, migrate) | "Delete 50 records. Proceed?" |
|
|
52
|
+
| **Feature Selection** | "Which framework/library?" | next-intl vs react-i18next |
|
|
53
|
+
| **Multi-Select** | Independent combinable features | Unit + E2E + Visual tests |
|
|
54
|
+
| **Sequential** | Dependent questions (Q2 depends on Q1) | Enable auth? → Which provider? |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Key Constraints
|
|
59
|
+
|
|
60
|
+
| What | Max | Why |
|
|
61
|
+
|------|-----|-----|
|
|
62
|
+
| Questions | 4 | Avoid fatigue |
|
|
63
|
+
| Options | 4 | Prevent choice paralysis |
|
|
64
|
+
| Header length | 12 chars | TUI layout |
|
|
65
|
+
| Label length | 5 words | Quick scanning |
|
|
66
|
+
| Nesting depth | 2 levels | Keep linear flow |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Integration Points
|
|
71
|
+
|
|
72
|
+
### spec-builder (`/alfred:1-plan`)
|
|
73
|
+
Ask when SPEC title/scope is vague
|
|
74
|
+
|
|
75
|
+
### code-builder (`/alfred:2-run`)
|
|
76
|
+
Ask when implementation approach unclear or multiple paths exist
|
|
77
|
+
|
|
78
|
+
### doc-syncer (`/alfred:3-sync`)
|
|
79
|
+
Ask when sync mode or documentation scope unclear
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Error Handling
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
// User cancels (ESC)
|
|
87
|
+
try {
|
|
88
|
+
const answer = await AskUserQuestion({...});
|
|
89
|
+
} catch (error) {
|
|
90
|
+
// Fallback or abort
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Validate custom input ("Other" option)
|
|
94
|
+
if (!VALID_OPTIONS.includes(answer["Header"])) {
|
|
95
|
+
validateCustomInput(answer["Header"]);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Best Practices (Quick)
|
|
102
|
+
|
|
103
|
+
✅ **DO**:
|
|
104
|
+
- Be specific ("Which database?" not "What should we use?")
|
|
105
|
+
- Provide context (file names, scope, impact)
|
|
106
|
+
- Explain trade-offs
|
|
107
|
+
- Order logically (safest first)
|
|
108
|
+
- Batch related questions
|
|
109
|
+
|
|
110
|
+
❌ **DON'T**:
|
|
111
|
+
- Overuse (only when ambiguous)
|
|
112
|
+
- Too many options (2-4 max)
|
|
113
|
+
- Skip descriptions
|
|
114
|
+
- Hide implications
|
|
115
|
+
- Make destructive default
|
|
116
|
+
- Manually add "Other" (auto-provided)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
For full details, see **SKILL.md**
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Creating and Managing Sub-agents in Claude Code"
|
|
3
|
+
description: "Design agent personas, define proactive triggers, set tool permissions, structure agent files. Use when building specialized agents for code review, debugging, architecture, or domain-specific tasks."
|
|
4
|
+
allowed-tools: "Read, Write, Edit, Glob, Bash"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Creating and Managing Sub-agents
|
|
8
|
+
|
|
9
|
+
Sub-agents are specialized Claude instances with independent context, custom prompts, and restricted tool access. They handle deep analysis, parallel work, and autonomous tasks.
|
|
10
|
+
|
|
11
|
+
## Agent File Structure
|
|
12
|
+
|
|
13
|
+
**Location**: `.claude/agents/`
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
---
|
|
17
|
+
name: agent-name
|
|
18
|
+
description: Use PROACTIVELY for [specific trigger conditions]
|
|
19
|
+
tools: Read, Write, Edit, Glob, Grep, Bash(git:*)
|
|
20
|
+
model: sonnet
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Agent Name — Specialist Role
|
|
24
|
+
|
|
25
|
+
Brief description of agent expertise.
|
|
26
|
+
|
|
27
|
+
## Core Mission
|
|
28
|
+
|
|
29
|
+
- Primary responsibility
|
|
30
|
+
- Scope boundaries
|
|
31
|
+
- Success criteria
|
|
32
|
+
|
|
33
|
+
## Proactive Triggers
|
|
34
|
+
|
|
35
|
+
- When to activate automatically
|
|
36
|
+
- Specific conditions for invocation
|
|
37
|
+
- Integration with workflow
|
|
38
|
+
|
|
39
|
+
## Workflow Steps
|
|
40
|
+
|
|
41
|
+
1. Input validation
|
|
42
|
+
2. Task execution
|
|
43
|
+
3. Output verification
|
|
44
|
+
4. Handoff to next agent (if applicable)
|
|
45
|
+
|
|
46
|
+
## Constraints
|
|
47
|
+
|
|
48
|
+
- What NOT to do
|
|
49
|
+
- Delegation rules
|
|
50
|
+
- Quality gates
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Agent Persona Design Pattern
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
---
|
|
57
|
+
name: code-reviewer
|
|
58
|
+
description: Use PROACTIVELY for code review requests, PR analysis, or quality checks
|
|
59
|
+
tools: Read, Glob, Grep, Bash(git:*)
|
|
60
|
+
model: sonnet
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# Code Reviewer — Quality Expert
|
|
64
|
+
|
|
65
|
+
Specialized in identifying code quality issues, security risks, and architecture concerns.
|
|
66
|
+
|
|
67
|
+
## Core Mission
|
|
68
|
+
|
|
69
|
+
- Review code for SOLID principles
|
|
70
|
+
- Identify code smells and anti-patterns
|
|
71
|
+
- Verify security best practices
|
|
72
|
+
- Suggest improvements with rationale
|
|
73
|
+
|
|
74
|
+
## Proactive Triggers
|
|
75
|
+
|
|
76
|
+
- When user mentions "review", "quality", "audit"
|
|
77
|
+
- After significant code changes
|
|
78
|
+
- Before PR merge
|
|
79
|
+
|
|
80
|
+
## Workflow Steps
|
|
81
|
+
|
|
82
|
+
1. **Analyze**: Read changed files, understand context
|
|
83
|
+
2. **Evaluate**: Check against TRUST 5 principles
|
|
84
|
+
3. **Report**: List findings with severity & fix suggestions
|
|
85
|
+
4. **Recommend**: Suggest refactoring or architectural improvements
|
|
86
|
+
|
|
87
|
+
## Constraints
|
|
88
|
+
|
|
89
|
+
- No direct edits (only suggestions)
|
|
90
|
+
- Focus on maintainability, not style
|
|
91
|
+
- Respect existing architecture decisions
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## High-Freedom: Agent Principles
|
|
95
|
+
|
|
96
|
+
### Autonomy & Expertise
|
|
97
|
+
- Each agent owns 1 specialization (not 3+)
|
|
98
|
+
- Define clear "when to activate" triggers
|
|
99
|
+
- Agents should make decisions independently
|
|
100
|
+
|
|
101
|
+
### Tool Access Minimization
|
|
102
|
+
- Grant only necessary tools per role
|
|
103
|
+
- Restrict Bash to specific commands: `Bash(git:*)`, `Bash(python:*)`
|
|
104
|
+
- Never grant `Bash(*)`; always specify pattern
|
|
105
|
+
|
|
106
|
+
### Handoff & Collaboration
|
|
107
|
+
- Agent A completes → hands off to Agent B
|
|
108
|
+
- Use clear "next agent" instructions
|
|
109
|
+
- No circular dependencies
|
|
110
|
+
|
|
111
|
+
## Medium-Freedom: Common Agent Patterns
|
|
112
|
+
|
|
113
|
+
### Pattern 1: Debugger Agent
|
|
114
|
+
```yaml
|
|
115
|
+
name: debugger
|
|
116
|
+
description: Use PROACTIVELY for error diagnosis, test failures, exception analysis
|
|
117
|
+
tools: Read, Grep, Glob, Bash(pytest:*), Bash(git:*)
|
|
118
|
+
model: sonnet
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Mission**: Diagnose errors, provide fix-forward guidance
|
|
122
|
+
**Triggers**: `error`, `failed`, `exception`, `debug`
|
|
123
|
+
**Output**: Root cause + suggested fixes
|
|
124
|
+
|
|
125
|
+
### Pattern 2: Architect Agent
|
|
126
|
+
```yaml
|
|
127
|
+
name: architect
|
|
128
|
+
description: Use PROACTIVELY for system design, refactoring, scalability concerns
|
|
129
|
+
tools: Read, Glob, Grep, Bash(ls:*), Bash(find:*)
|
|
130
|
+
model: sonnet
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Mission**: Design systems, propose architectures
|
|
134
|
+
**Triggers**: `architecture`, `refactor`, `design`, `scalability`
|
|
135
|
+
**Output**: Design document + implementation roadmap
|
|
136
|
+
|
|
137
|
+
### Pattern 3: Security Agent
|
|
138
|
+
```yaml
|
|
139
|
+
name: security-auditor
|
|
140
|
+
description: Use PROACTIVELY for vulnerability assessment, OWASP checks, secrets detection
|
|
141
|
+
tools: Read, Glob, Grep
|
|
142
|
+
model: sonnet
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Mission**: Find security issues, verify OWASP compliance
|
|
146
|
+
**Triggers**: `security`, `audit`, `vulnerability`, `secrets`
|
|
147
|
+
**Output**: Risk assessment + remediation steps
|
|
148
|
+
|
|
149
|
+
## Low-Freedom: Tool Permission Patterns
|
|
150
|
+
|
|
151
|
+
### Principle of Least Privilege
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
# ❌ Too permissive
|
|
155
|
+
tools: Read, Write, Edit, Bash(*)
|
|
156
|
+
|
|
157
|
+
# ✅ Appropriate
|
|
158
|
+
tools: Read, Glob, Grep # Read-only analysis
|
|
159
|
+
|
|
160
|
+
# ✅ Appropriate
|
|
161
|
+
tools: Read, Edit, Bash(black:*), Bash(pytest:*) # Formatter + tests only
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Bash Command Restrictions
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
# Allowed patterns:
|
|
168
|
+
Bash(git:*) # All git commands
|
|
169
|
+
Bash(npm run:*) # Only npm run scripts
|
|
170
|
+
Bash(python:*) # Python interpreter
|
|
171
|
+
Bash(pytest:*) # Pytest runner
|
|
172
|
+
|
|
173
|
+
# Denied patterns:
|
|
174
|
+
Bash(rm:*) # Dangerous deletion
|
|
175
|
+
Bash(sudo:*) # Privilege escalation
|
|
176
|
+
Bash(curl:*) # Arbitrary downloads
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Agent Execution Modes
|
|
180
|
+
|
|
181
|
+
### Mode 1: Inline (main context)
|
|
182
|
+
```bash
|
|
183
|
+
/role security
|
|
184
|
+
"Check this project for vulnerabilities"
|
|
185
|
+
# Runs in main session context
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Mode 2: Sub-agent (isolated context)
|
|
189
|
+
```bash
|
|
190
|
+
/role security --agent
|
|
191
|
+
"Perform comprehensive security audit"
|
|
192
|
+
# Runs in independent context, can work in parallel
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Mode 3: Parallel Multi-role
|
|
196
|
+
```bash
|
|
197
|
+
/multi-role security,performance,qa --agent
|
|
198
|
+
"Analyze security, performance, and quality"
|
|
199
|
+
# All roles run in parallel, results merged
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Agent Registration & Discovery
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# List available agents
|
|
206
|
+
/agents
|
|
207
|
+
|
|
208
|
+
# Create new agent interactively
|
|
209
|
+
/agents create
|
|
210
|
+
|
|
211
|
+
# View specific agent
|
|
212
|
+
/agents view security-auditor
|
|
213
|
+
|
|
214
|
+
# Edit agent
|
|
215
|
+
/agents edit security-auditor
|
|
216
|
+
|
|
217
|
+
# Delete agent
|
|
218
|
+
/agents delete security-auditor
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Agent Validation Checklist
|
|
222
|
+
|
|
223
|
+
- [ ] `name` is kebab-case (e.g., `code-reviewer`)
|
|
224
|
+
- [ ] `description` includes "Use PROACTIVELY for"
|
|
225
|
+
- [ ] `tools` list only necessary tools
|
|
226
|
+
- [ ] No `Bash(*)` wildcard; specific patterns only
|
|
227
|
+
- [ ] `model` is `haiku` or `sonnet`
|
|
228
|
+
- [ ] `Proactive Triggers` section clearly defined
|
|
229
|
+
- [ ] No overlapping responsibilities with other agents
|
|
230
|
+
- [ ] YAML frontmatter is valid
|
|
231
|
+
|
|
232
|
+
## Best Practices
|
|
233
|
+
|
|
234
|
+
✅ **DO**:
|
|
235
|
+
- Design agents around specific expertise
|
|
236
|
+
- Use `--agent` flag for large analyses
|
|
237
|
+
- Combine multiple agents for complex tasks
|
|
238
|
+
- Name agents descriptively
|
|
239
|
+
|
|
240
|
+
❌ **DON'T**:
|
|
241
|
+
- Create overpowered agents with all tools
|
|
242
|
+
- Allow direct file modifications without approval
|
|
243
|
+
- Overlap agent responsibilities
|
|
244
|
+
- Use `Bash(*)` without specific patterns
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
**Reference**: Claude Code Sub-agents documentation
|
|
249
|
+
**Version**: 1.0.0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-name
|
|
3
|
+
description: Use PROACTIVELY for [specific trigger conditions]
|
|
4
|
+
tools: Read, Glob, Grep, Bash(git:*)
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Agent Name — Specialist Role
|
|
9
|
+
|
|
10
|
+
Brief description of agent expertise.
|
|
11
|
+
|
|
12
|
+
## Core Mission
|
|
13
|
+
|
|
14
|
+
- Primary responsibility
|
|
15
|
+
- Scope boundaries
|
|
16
|
+
- Success criteria
|
|
17
|
+
|
|
18
|
+
## Proactive Triggers
|
|
19
|
+
|
|
20
|
+
- When to activate automatically
|
|
21
|
+
- Specific conditions for invocation
|
|
22
|
+
|
|
23
|
+
## Workflow Steps
|
|
24
|
+
|
|
25
|
+
1. Input validation
|
|
26
|
+
2. Task execution
|
|
27
|
+
3. Output verification
|
|
28
|
+
|
|
29
|
+
## Constraints
|
|
30
|
+
|
|
31
|
+
- What NOT to do
|
|
32
|
+
- Delegation rules
|