moai-adk 0.5.2__py3-none-any.whl → 0.5.6__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 (63) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/cli/commands/backup.py +25 -1
  3. moai_adk/cli/commands/doctor.py +30 -4
  4. moai_adk/cli/commands/init.py +23 -2
  5. moai_adk/cli/commands/status.py +32 -2
  6. moai_adk/cli/commands/update.py +47 -8
  7. moai_adk/core/project/initializer.py +13 -11
  8. moai_adk/core/project/phase_executor.py +9 -4
  9. moai_adk/core/template/processor.py +60 -1
  10. moai_adk/templates/.claude/agents/alfred/cc-manager.md +8 -0
  11. moai_adk/templates/.claude/agents/alfred/debug-helper.md +18 -0
  12. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +18 -0
  13. moai_adk/templates/.claude/agents/alfred/git-manager.md +38 -2
  14. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +18 -0
  15. moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -0
  16. moai_adk/templates/.claude/agents/alfred/quality-gate.md +6 -0
  17. moai_adk/templates/.claude/agents/alfred/skill-factory.md +8 -0
  18. moai_adk/templates/.claude/agents/alfred/spec-builder.md +17 -0
  19. moai_adk/templates/.claude/agents/alfred/tag-agent.md +7 -1
  20. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +18 -0
  21. moai_adk/templates/.claude/agents/alfred/trust-checker.md +6 -0
  22. moai_adk/templates/.claude/commands/alfred/0-project.md +5 -1
  23. moai_adk/templates/.claude/commands/alfred/1-plan.md +5 -1
  24. moai_adk/templates/.claude/commands/alfred/2-run.md +6 -2
  25. moai_adk/templates/.claude/commands/alfred/3-sync.md +28 -7
  26. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +5 -1
  27. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +5 -1
  28. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +5 -1
  29. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +5 -1
  30. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +30 -273
  31. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +487 -129
  32. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +603 -70
  33. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +22 -2
  34. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +22 -2
  35. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +22 -2
  36. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +22 -2
  37. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +22 -2
  38. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +22 -2
  39. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +22 -2
  40. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +25 -5
  41. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +152 -547
  42. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +835 -878
  43. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +665 -1151
  44. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +138 -427
  45. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +61 -53
  46. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +99 -1181
  47. moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +541 -0
  48. moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +622 -0
  49. moai_adk/templates/.moai/config.json +5 -5
  50. moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md +208 -0
  51. moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md +369 -0
  52. moai_adk/templates/.moai/memory/CLAUDE-RULES.md +539 -0
  53. moai_adk/templates/.moai/memory/{development-guide.md → DEVELOPMENT-GUIDE.md} +3 -3
  54. moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md +218 -0
  55. moai_adk/templates/.moai/memory/config-schema.md +444 -0
  56. moai_adk/templates/CLAUDE.md +142 -702
  57. {moai_adk-0.5.2.dist-info → moai_adk-0.5.6.dist-info}/METADATA +294 -336
  58. {moai_adk-0.5.2.dist-info → moai_adk-0.5.6.dist-info}/RECORD +63 -56
  59. /moai_adk/templates/.moai/memory/{gitflow-protection-policy.md → GITFLOW-PROTECTION-POLICY.md} +0 -0
  60. /moai_adk/templates/.moai/memory/{spec-metadata.md → SPEC-METADATA.md} +0 -0
  61. {moai_adk-0.5.2.dist-info → moai_adk-0.5.6.dist-info}/WHEEL +0 -0
  62. {moai_adk-0.5.2.dist-info → moai_adk-0.5.6.dist-info}/entry_points.txt +0 -0
  63. {moai_adk-0.5.2.dist-info → moai_adk-0.5.6.dist-info}/licenses/LICENSE +0 -0
@@ -18,6 +18,24 @@ You are a TDD expert who strictly adheres to the RED-GREEN-REFACTOR cycle and ke
18
18
  **Role**: Executor who translates implementation plans into actual code
19
19
  **Goal**: 100% test coverage and compliance with TRUST principles Code generation
20
20
 
21
+ ## 🌍 Language Handling
22
+
23
+ **IMPORTANT**: You will ALWAYS receive prompts in **English**, regardless of user's original conversation language.
24
+
25
+ Alfred translates SPEC references and implementation requirements to English before invoking you. This ensures:
26
+ - ✅ Perfect skill trigger matching (English Skill names match English requests 100%)
27
+ - ✅ Consistent TDD cycle communication
28
+ - ✅ Global multilingual support
29
+
30
+ **Example**:
31
+ - User says (any language): Translated to "Implement JWT-based authentication following SPEC-AUTH-001"
32
+ - You receive (English): "Implement user authentication with JWT tokens, 30-minute expiry, email+password login"
33
+ - You implement entirely in English-documented code
34
+ - Test cases use English variable names and descriptions
35
+ - Alfred translates status updates back to user's language for response
36
+
37
+ **Do not try to infer user's original language.** Always work in English, use English in code comments, test descriptions, and commit messages.
38
+
21
39
  ## 🧰 Required Skills
22
40
 
23
41
  **Automatic Core Skills**
@@ -18,6 +18,12 @@ You are the agent responsible for the TRUST 5 principles, code standards, and se
18
18
  **Role**: QA lead who comprehensively verifies code quality, security, performance, and traceability based on TRUST 5 principles
19
19
  **Goal**: Differential scan Efficient and accurate quality assurance and improvement direction suggested through the system (Level 1→2→3)
20
20
 
21
+ ## 🌍 Language Handling
22
+
23
+ **IMPORTANT**: You will ALWAYS receive prompts in **English**, regardless of user's original conversation language.
24
+
25
+ Alfred translates quality verification requests to English before invoking you. Your reports use English terminology.
26
+
21
27
  ## 🧰 Required Skills
22
28
 
23
29
  **Automatic Core Skills**
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: alfred:0-project
3
- description: Initialize project document - create product/structure/tech.md and set optimization for each language
3
+ description: "Initialize project document - create product/structure/tech.md and set optimization for each language"
4
+ # Translations:
5
+ # - ko: "프로젝트 문서 초기화 - product/structure/tech.md 생성 및 언어별 최적화 설정"
6
+ # - ja: "プロジェクト文書の初期化 - product/structure/tech.mdの作成と言語別最適化設定"
7
+ # - zh: "初始化项目文档 - 创建product/structure/tech.md并设置语言优化"
4
8
  allowed-tools:
5
9
  - Read
6
10
  - Write
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: alfred:1-plan
3
- description: Planning (brainstorming, plan writing, design discussion) + Branch/PR creation
3
+ description: "Planning (brainstorming, plan writing, design discussion) + Branch/PR creation"
4
+ # Translations:
5
+ # - ko: "계획 수립 (브레인스토밍, 설계 논의) + 브랜치/PR 생성"
6
+ # - ja: "計画策定(ブレインストーミング、設計議論)+ ブランチ/PR作成"
7
+ # - zh: "规划(头脑风暴、设计讨论)+ 分支/PR创建"
4
8
  argument-hint: "Title 1 Title 2 ... | SPEC-ID modifications"
5
9
  allowed-tools:
6
10
  - Read
@@ -1,7 +1,11 @@
1
1
  ---
2
2
  name: alfred:2-run
3
- description: "Implement all SPECs with SPEC ID to implement (e.g. SPEC-001) or all - Execute planned work (TDD implementation, prototyping, documentation, etc.)"
4
- argument-hint: "SPEC-ID - All with SPEC ID to implement (e.g. SPEC-001) or all “SPEC Implementation”
3
+ description: "Execute planned work (TDD implementation, prototyping, documentation, etc.)"
4
+ # Translations:
5
+ # - ko: "계획된 작업 실행 (TDD 구현, 프로토타이핑, 문서화 등)"
6
+ # - ja: "計画されたタスクの実行(TDD実装、プロトタイピング、ドキュメント作成など)"
7
+ # - zh: "执行计划任务(TDD实现、原型开发、文档编写等)"
8
+ argument-hint: "SPEC-ID - All with SPEC ID to implement (e.g. SPEC-001) or all \"SPEC Implementation\""
5
9
  allowed-tools:
6
10
  - Read
7
11
  - Write
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: alfred:3-sync
3
- description: Document synchronization + PR Ready conversion
3
+ description: "Document synchronization + PR Ready conversion"
4
+ # Translations:
5
+ # - ko: "문서 동기화 + PR Ready 전환"
6
+ # - ja: "ドキュメント同期 + PR Ready変換"
7
+ # - zh: "文档同步 + PR Ready转换"
4
8
  argument-hint: "Mode target path - Mode: auto (default)|force|status|project, target path: Synchronization target path"
5
9
  allowed-tools:
6
10
  - Read
@@ -99,7 +103,9 @@ Users can run the command as follows:
99
103
 
100
104
  Analyze project status to determine synchronization scope, develop a systematic synchronization plan, and receive user confirmation.
101
105
 
102
- **The doc-syncer agent automatically scans the TAG chain and identifies and analyzes Git changes.**
106
+ **The tag-agent performs comprehensive TAG verification (full project scope), and doc-syncer analyzes Git changes and establishes synchronization plan.**
107
+
108
+ ⚠️ **Important**: Tag-agent must verify the ENTIRE PROJECT for TAG orphans, not just changed files. Full-project scope is MANDATORY.
103
109
 
104
110
  ### 🔍 TAG chain navigation (optional)
105
111
 
@@ -129,12 +135,27 @@ Invoking the Task tool (Explore agent):
129
135
  **In STEP 1, call doc-syncer and tag-agent using the Task tool**:
130
136
 
131
137
  ```
132
- 1. Tag-agent call (TAG verification):
138
+ 1. Tag-agent call (TAG verification - FULL PROJECT SCOPE):
133
139
  - subagent_type: "tag-agent"
134
- - description: "Verify TAG system"
135
- - prompt: "Please verify the integrity of the entire TAG chain.
136
- Please verify the integrity of @SPEC, @TEST, @CODE, @DOC TAGs
137
- and orphan TAGs.
140
+ - description: "Verify TAG system across entire project"
141
+ - prompt: "Please perform a COMPREHENSIVE TAG system verification across the ENTIRE PROJECT.
142
+
143
+ **Required scope**: Scan all source files, not just changed files.
144
+
145
+ **Verification items**:
146
+ 1. @SPEC TAGs in .moai/specs/ directory
147
+ 2. @TEST TAGs in tests/ directory
148
+ 3. @CODE TAGs in src/ directory
149
+ 4. @DOC TAGs in docs/ directory
150
+
151
+ **Orphan detection** (MANDATORY):
152
+ - Detect @CODE TAGs without matching @SPEC
153
+ - Detect @SPEC TAGs without matching @CODE
154
+ - Detect @TEST TAGs without matching @SPEC
155
+ - Detect @DOC TAGs without matching @SPEC/@CODE
156
+
157
+ **Output format**: Provide complete list of orphan TAGs with locations.
158
+
138
159
  (Optional) Explore results: $EXPLORE_RESULTS"
139
160
 
140
161
  2. doc-syncer call (synchronization plan):
@@ -118,7 +118,11 @@ def main() -> None:
118
118
  try:
119
119
  # Read JSON from stdin
120
120
  input_data = sys.stdin.read()
121
- data = json.loads(input_data)
121
+ # Handle empty stdin gracefully (return empty dict)
122
+ if not input_data or not input_data.strip():
123
+ data = {}
124
+ else:
125
+ data = json.loads(input_data)
122
126
 
123
127
  cwd = data.get("cwd", ".")
124
128
 
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: Agentic Coding
3
- description: Agent-based coding mode that integrates hands-on development and collaboration
3
+ description: "Agent-based coding mode that integrates hands-on development and collaboration"
4
+ # Translations:
5
+ # - ko: "실무 개발과 협업을 통합하는 에이전트 기반 코딩 모드"
6
+ # - ja: "実務開発とコラボレーションを統合するエージェントベースのコーディングモード"
7
+ # - zh: "集成实战开发和协作的基于代理的编码模式"
4
8
  ---
5
9
 
6
10
  # Agentic Coding
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: MoAI ADK Learning
3
- description: Learning mode to easily learn MoAI-ADK concepts and workflow
3
+ description: "Learning mode to easily learn MoAI-ADK concepts and workflow"
4
+ # Translations:
5
+ # - ko: "MoAI-ADK 개념과 워크플로우를 쉽게 학습하는 학습 모드"
6
+ # - ja: "MoAI-ADKの概念とワークフローを簡単に学習する学習モード"
7
+ # - zh: "轻松学习MoAI-ADK概念和工作流程的学习模式"
4
8
  ---
5
9
 
6
10
  # MoAI ADK Learning
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: Study with Alfred
3
- description: Learning mode to easily learn new skills with Alfred
3
+ description: "Learning mode to easily learn new skills with Alfred"
4
+ # Translations:
5
+ # - ko: "Alfred와 함께 새로운 기술을 쉽게 학습하는 학습 모드"
6
+ # - ja: "Alfredと一緒に新しいスキルを簡単に学習する学習モード"
7
+ # - zh: "与Alfred一起轻松学习新技能的学习模式"
4
8
  ---
5
9
 
6
10
  # Study with Alfred
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: moai-alfred-interactive-questions
3
- version: 3.0.0
3
+ version: 3.1.0
4
4
  created: 2025-10-22
5
- updated: 2025-10-23
5
+ updated: 2025-10-27
6
6
  status: active
7
7
  description: Guide Alfred sub-agents to actively invoke AskUserQuestion for ambiguous decisions.
8
8
  keywords: ['interactive', 'clarification', 'decision-making', 'AskUserQuestion']
@@ -17,7 +17,7 @@ allowed-tools:
17
17
  | Field | Value |
18
18
  | ----- | ----- |
19
19
  | **Skill Name** | moai-alfred-interactive-questions |
20
- | **Version** | 3.0.0 (2025-10-23) |
20
+ | **Version** | 3.1.0 (2025-10-27) |
21
21
  | **Core Tool** | `AskUserQuestion` (Claude Code built-in) |
22
22
  | **Auto-load** | When Alfred detects ambiguity in requests |
23
23
  | **Tier** | Alfred (Workflow Orchestration) |
@@ -82,9 +82,7 @@ Proceed with confirmed specifications
82
82
 
83
83
  ---
84
84
 
85
- ## AskUserQuestion API Reference
86
-
87
- ### Minimal Invocation
85
+ ## Quick Start: Minimal Invocation
88
86
 
89
87
  ```typescript
90
88
  const answer = await AskUserQuestion({
@@ -110,7 +108,9 @@ const answer = await AskUserQuestion({
110
108
  // Returns: { "Approach": "Option 1" }
111
109
  ```
112
110
 
113
- ### Key Constraints
111
+ ---
112
+
113
+ ## Key Constraints
114
114
 
115
115
  | Constraint | Reason |
116
116
  |-----------|--------|
@@ -121,292 +121,58 @@ const answer = await AskUserQuestion({
121
121
  | **Description required** | Enables informed choice |
122
122
  | **Auto "Other" option** | Always available for custom input |
123
123
 
124
- ### Question Types
125
-
126
- **Single-Select** (`multiSelect: false`):
127
- - Mutually exclusive: "Choose ONE database"
128
- - Returns: `{ "Header": "Selected Label" }`
129
-
130
- **Multi-Select** (`multiSelect: true`):
131
- - Independent options: "Which features to enable?" (check multiple)
132
- - Returns: `{ "Header": ["Label1", "Label2"] }`
133
-
134
124
  ---
135
125
 
136
- ## Usage Patterns (Top 5)
126
+ ## Top 5 Usage Patterns
137
127
 
138
128
  ### Pattern 1: Implementation Approach
139
-
140
129
  **Trigger**: "Add feature X" or "Build Y" without specifics
141
130
 
142
- ```typescript
143
- await AskUserQuestion({
144
- questions: [{
145
- question: "How should we implement this feature?",
146
- header: "Approach",
147
- multiSelect: false,
148
- options: [
149
- { label: "New standalone component", description: "Isolated, reusable." },
150
- { label: "Extend existing component", description: "Shared state, simpler." },
151
- { label: "Use environment flag", description: "Conditional visibility." }
152
- ]
153
- }]
154
- });
155
- ```
156
-
157
131
  ### Pattern 2: Confirmation (Risky Operations)
158
-
159
132
  **Trigger**: Destructive action (delete, migrate, reset)
160
133
 
161
- ```typescript
162
- await AskUserQuestion({
163
- questions: [{
164
- question: "This will permanently delete 50 records. Proceed?",
165
- header: "Confirm",
166
- multiSelect: false,
167
- options: [
168
- { label: "Yes, proceed", description: "Irreversible. Continue." },
169
- { label: "No, cancel", description: "Abort operation." }
170
- ]
171
- }]
172
- });
173
- ```
174
-
175
134
  ### Pattern 3: Multi-Option Feature Selection
176
-
177
135
  **Trigger**: "Which framework/library/approach?"
178
136
 
179
- ```typescript
180
- await AskUserQuestion({
181
- questions: [{
182
- question: "Which i18n library?",
183
- header: "Library",
184
- multiSelect: false,
185
- options: [
186
- { label: "next-intl", description: "Next.js 15+ native, best DX." },
187
- { label: "react-i18next", description: "Popular, flexible, more setup." },
188
- { label: "Format.js", description: "ICU format, powerful, complex." }
189
- ]
190
- }]
191
- });
192
- ```
193
-
194
137
  ### Pattern 4: Multi-Select (Independent Features)
195
-
196
138
  **Trigger**: "Which features to enable/include?"
197
139
 
198
- ```typescript
199
- await AskUserQuestion({
200
- questions: [{
201
- question: "Which testing frameworks?",
202
- header: "Test Tools",
203
- multiSelect: true, // Multiple selections allowed
204
- options: [
205
- { label: "Unit tests (Vitest)", description: "Fast, modern." },
206
- { label: "E2E tests (Playwright)", description: "Browser automation." },
207
- { label: "Visual regression", description: "Screenshot comparison." }
208
- ]
209
- }]
210
- });
211
- ```
212
-
213
140
  ### Pattern 5: Sequential Questions (Conditional Flow)
214
-
215
141
  **Trigger**: Dependent decisions (Q2 depends on Q1 answer)
216
142
 
217
- ```typescript
218
- // Question 1
219
- const q1 = await AskUserQuestion({
220
- questions: [{
221
- question: "Enable authentication?",
222
- header: "Auth",
223
- options: [
224
- { label: "Yes", description: "User login required." },
225
- { label: "No", description: "Public access." }
226
- ]
227
- }]
228
- });
143
+ > **Detailed examples and code**: See [examples.md](examples.md)
229
144
 
230
- // Question 2 (only if Q1 = "Yes")
231
- if (q1["Auth"] === "Yes") {
232
- const q2 = await AskUserQuestion({
233
- questions: [{
234
- question: "Which auth provider?",
235
- header: "Provider",
236
- options: [
237
- { label: "JWT + email", description: "Traditional." },
238
- { label: "OAuth", description: "Third-party." }
239
- ]
240
- }]
241
- });
242
- }
243
- ```
145
+ ---
146
+
147
+ ## Integration with Alfred Sub-agents
148
+
149
+ | Sub-agent | When to Ask | Example Trigger |
150
+ |-----------|-------------|-----------------|
151
+ | **spec-builder** (`/alfred:1-plan`) | SPEC title vague, scope undefined | "Add feature" without specifics |
152
+ | **code-builder** (`/alfred:2-run`) | Implementation approach unclear | Multiple valid implementation paths |
153
+ | **doc-syncer** (`/alfred:3-sync`) | Sync scope unclear | Full vs partial sync decision |
154
+
155
+ > **Detailed integration patterns**: See [reference.md](reference.md)
244
156
 
245
157
  ---
246
158
 
247
- ## Best Practices
159
+ ## Best Practices Summary
248
160
 
249
161
  ### ✅ DO
250
-
251
162
  - **Be specific**: "Which database type?" not "What should we use?"
252
163
  - **Provide context**: Include file names, scope, or impact
253
164
  - **Order logically**: General → Specific; safest option first
254
165
  - **Flag risks**: Use "NOT RECOMMENDED" or "CAUTION:" prefixes
255
166
  - **Explain trade-offs**: Mention time, resources, complexity
256
- - **Single-select for exclusive**: "Choose ONE"
257
- - **Multi-select for combinable**: "Check any that apply"
258
- - **Include descriptions**: Every option needs rationale
259
- - **Keep headers short**: "Approach" not "Implementation Strategy"
260
- - **Batch related questions**: Ask 2-3 at once if they flow naturally
261
167
 
262
168
  ### ❌ DON'T
263
-
264
169
  - **Overuse questions**: Only ask when ambiguous
265
170
  - **Too many options**: 2-4 per question max
266
171
  - **Vague labels**: "Option A", "Use tokens", "Option 2"
267
172
  - **Skip descriptions**: User needs rationale
268
173
  - **Hide trade-offs**: Always mention implications
269
- - **Make destructive default**: Risky option = NOT pre-selected
270
- - **Mix concerns**: One decision per question
271
- - **Manually add "Other"**: It's auto-provided
272
- - **Nest more than 2 levels deep**: Keep flow linear
273
-
274
- ---
275
174
 
276
- ## Integration with Alfred Sub-agents
277
-
278
- ### spec-builder (`/alfred:1-plan`)
279
-
280
- **When to ask**:
281
- - SPEC title is vague ("Add feature")
282
- - Scope undefined (what exactly?)
283
- - Domain prefix unclear (AUTH vs UI vs DATA?)
284
-
285
- **Example**:
286
- ```typescript
287
- if (titleIsAmbiguous(specTitle)) {
288
- const answer = await AskUserQuestion({
289
- questions: [{
290
- question: "Can you clarify what this SPEC should cover?",
291
- header: "Scope",
292
- options: [...]
293
- }]
294
- });
295
- specTitle = answer["Scope"];
296
- }
297
- ```
298
-
299
- ### code-builder (`/alfred:2-run`)
300
-
301
- **When to ask**:
302
- - Implementation approach unclear
303
- - Multiple valid paths exist
304
- - Error recovery needed (failing tests)
305
-
306
- **Example**:
307
- ```typescript
308
- if (multipleValidImplementationPaths) {
309
- const answer = await AskUserQuestion({
310
- questions: [{
311
- question: "How should we implement this?",
312
- header: "Approach",
313
- options: [...]
314
- }]
315
- });
316
- implementationStrategy = answer["Approach"];
317
- }
318
- ```
319
-
320
- ### doc-syncer (`/alfred:3-sync`)
321
-
322
- **When to ask**:
323
- - Sync scope unclear (full vs partial)
324
- - PR Ready status uncertain
325
- - Documentation coverage decision needed
326
-
327
- **Example**:
328
- ```typescript
329
- const syncMode = await AskUserQuestion({
330
- questions: [{
331
- question: "Which sync mode?",
332
- header: "Mode",
333
- options: [
334
- { label: "auto", description: "Smart detection." },
335
- { label: "force", description: "Regenerate all." }
336
- ]
337
- }]
338
- });
339
- ```
340
-
341
- ---
342
-
343
- ## Real-World Examples
344
-
345
- ### Example: Vague Feature Request
346
-
347
- **User**: "Add a completion page for the competition."
348
-
349
- **Alfred detects ambiguity**:
350
- - Where should it live? (new route vs modify existing)
351
- - Who can access it? (public vs authenticated)
352
- - What should it display? (results vs simple message)
353
-
354
- **AskUserQuestion invocation**:
355
- ```typescript
356
- const answer = await AskUserQuestion({
357
- questions: [
358
- {
359
- question: "How should the completion page be implemented?",
360
- header: "Approach",
361
- multiSelect: false,
362
- options: [
363
- { label: "New public route", description: "New page visible to all visitors." },
364
- { label: "Modify existing page", description: "Add conditional logic to /end page." },
365
- { label: "Environment flag", description: "Set NEXT_PUBLIC_COMPETITION_CLOSED=true." }
366
- ]
367
- },
368
- {
369
- question: "For logged-in participants?",
370
- header: "Behavior",
371
- multiSelect: false,
372
- options: [
373
- { label: "Show full results", description: "Redirect to /end page with history." },
374
- { label: "Show simple message", description: "Display 'Competition concluded' only." }
375
- ]
376
- }
377
- ]
378
- });
379
- ```
380
-
381
- **Result**: Alfred knows exactly what to build.
382
-
383
- ---
384
-
385
- ## Anti-Patterns to Avoid
386
-
387
- ### ❌ Too Many Options
388
- ```typescript
389
- // 8+ options = choice paralysis
390
- options: [
391
- { label: "PostgreSQL" }, { label: "MySQL" }, { label: "MariaDB" },
392
- { label: "SQLite" }, { label: "MongoDB" }, { label: "CouchDB" },
393
- { label: "Cassandra" }, { label: "Redis" }
394
- ]
395
- ```
396
-
397
- ### ✅ Group Options
398
- ```typescript
399
- // First ask: which TYPE? Then: specific within type
400
- questions: [{
401
- question: "Database type?",
402
- header: "DB Type",
403
- options: [
404
- { label: "Relational (SQL)", description: "PostgreSQL, MySQL, etc." },
405
- { label: "Document (NoSQL)", description: "MongoDB, CouchDB, etc." },
406
- { label: "Key-Value", description: "Redis, Memcached, etc." }
407
- ]
408
- }]
409
- ```
175
+ > **Complete best practices guide**: See [reference.md](reference.md)
410
176
 
411
177
  ---
412
178
 
@@ -427,35 +193,21 @@ try {
427
193
  const answer = await AskUserQuestion({...});
428
194
 
429
195
  if (answer["Header"] === "Other" || !VALID_OPTIONS.includes(answer["Header"])) {
430
- // Handle custom input validation
431
196
  validateCustomInput(answer["Header"]);
432
197
  }
433
198
  ```
434
199
 
435
200
  ---
436
201
 
437
- ## Performance Tips
438
-
439
- - **Batch questions**: Ask 2-3 related questions in one call
440
- - **Minimize calls**: Don't ask sequentially unless truly dependent
441
- - **Pre-generate options**: Analyze codebase once to generate all options
442
-
443
- ---
444
-
445
- ## References
446
-
447
- **Official Claude Code Documentation**:
448
- - AskUserQuestion tool (built-in Claude Code)
449
- - Interactive Prompting (CLAUDE.md § Clarification & Interactive Prompting)
202
+ ## Related Skills
450
203
 
451
- **Related Skills**:
452
204
  - `moai-alfred-spec-metadata-validation` (SPEC clarity)
453
205
  - `moai-alfred-ears-authoring` (requirement phrasing)
454
206
  - `moai-foundation-specs` (SPEC structure)
455
207
 
456
208
  ---
457
209
 
458
- ## Summary
210
+ ## Quick Reference
459
211
 
460
212
  **When to use**:
461
213
  - User intent is ambiguous
@@ -477,4 +229,9 @@ if (answer["Header"] === "Other" || !VALID_OPTIONS.includes(answer["Header"])) {
477
229
 
478
230
  ---
479
231
 
480
- **End of Skill** | Refactored 2025-10-23
232
+ **For detailed API specifications**: [reference.md](reference.md)
233
+ **For real-world examples**: [examples.md](examples.md)
234
+
235
+ ---
236
+
237
+ **End of Skill** | Refactored 2025-10-27