moai-adk 0.4.7__py3-none-any.whl → 0.4.10__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 (103) hide show
  1. moai_adk/templates/.claude/agents/alfred/cc-manager.md +188 -954
  2. moai_adk/templates/.claude/agents/alfred/debug-helper.md +4 -5
  3. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +2 -2
  4. moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
  5. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +3 -3
  6. moai_adk/templates/.claude/agents/alfred/project-manager.md +6 -6
  7. moai_adk/templates/.claude/agents/alfred/quality-gate.md +4 -6
  8. moai_adk/templates/.claude/agents/alfred/skill-factory.md +36 -36
  9. moai_adk/templates/.claude/agents/alfred/spec-builder.md +2 -2
  10. moai_adk/templates/.claude/agents/alfred/tag-agent.md +2 -2
  11. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +3 -3
  12. moai_adk/templates/.claude/agents/alfred/trust-checker.md +5 -5
  13. moai_adk/templates/.claude/commands/alfred/0-project.md +98 -42
  14. moai_adk/templates/.claude/commands/alfred/1-plan.md +7 -7
  15. moai_adk/templates/.claude/commands/alfred/2-run.md +36 -36
  16. moai_adk/templates/.claude/commands/alfred/3-sync.md +10 -10
  17. moai_adk/templates/.claude/hooks/alfred/HOOK_SCHEMA_VALIDATION.md +313 -0
  18. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +14 -1
  19. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +117 -33
  20. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +8 -9
  21. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +6 -6
  22. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +5 -4
  23. moai_adk/templates/.claude/hooks/alfred/test_hook_output.py +175 -0
  24. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +1 -1
  25. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +1 -1
  26. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +1 -1
  27. moai_adk/templates/.claude/settings.json +42 -2
  28. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +480 -0
  29. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +257 -0
  30. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +120 -0
  31. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +249 -0
  32. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  33. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +278 -0
  34. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  35. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +287 -0
  36. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  37. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +232 -0
  38. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  39. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  40. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  41. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +179 -0
  42. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  43. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +296 -0
  44. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  45. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +243 -0
  46. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  47. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +271 -0
  48. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  49. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +261 -35
  50. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +15 -15
  51. moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  52. moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  53. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  54. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +33 -33
  55. moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  56. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +438 -42
  57. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +129 -0
  58. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +1300 -0
  59. moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
  60. moai_adk/templates/CLAUDE.md +111 -92
  61. {moai_adk-0.4.7.dist-info → moai_adk-0.4.10.dist-info}/METADATA +542 -150
  62. {moai_adk-0.4.7.dist-info → moai_adk-0.4.10.dist-info}/RECORD +65 -73
  63. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +0 -113
  64. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +0 -29
  65. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +0 -28
  66. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -113
  67. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +0 -29
  68. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +0 -28
  69. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -113
  70. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +0 -29
  71. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +0 -28
  72. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -113
  73. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +0 -29
  74. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +0 -28
  75. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -635
  76. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -992
  77. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +0 -801
  78. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -121
  79. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -29
  80. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -28
  81. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
  82. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
  83. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
  84. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
  85. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
  86. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -123
  87. moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +0 -29
  88. moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +0 -30
  89. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -124
  90. moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +0 -29
  91. moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +0 -31
  92. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -124
  93. moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +0 -29
  94. moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +0 -31
  95. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -123
  96. moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +0 -29
  97. moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +0 -30
  98. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -123
  99. moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +0 -29
  100. moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +0 -30
  101. {moai_adk-0.4.7.dist-info → moai_adk-0.4.10.dist-info}/WHEEL +0 -0
  102. {moai_adk-0.4.7.dist-info → moai_adk-0.4.10.dist-info}/entry_points.txt +0 -0
  103. {moai_adk-0.4.7.dist-info → moai_adk-0.4.10.dist-info}/licenses/LICENSE +0 -0
@@ -1,635 +0,0 @@
1
- ---
2
- name: moai-alfred-tui-survey
3
- description: Standardizes Claude Code AskUserQuestion TUI menus for surveys, approvals, and option picking. Use when gathering user decisions, clarifying ambiguous requirements, or presenting implementation choices through interactive terminal menus.
4
- allowed-tools:
5
- - AskUserQuestion
6
- - Read
7
- - Bash
8
- version: 2.0.0
9
- created: 2025-10-22
10
- updated: 2025-10-22
11
- status: active
12
- keywords: ['tui', 'survey', 'interactive', 'questions', 'menus', 'user-input', 'clarification', 'approval']
13
- ---
14
-
15
- # Alfred TUI Survey Skill
16
-
17
- ## Skill Metadata
18
-
19
- | Field | Value |
20
- | ----- | ----- |
21
- | **Skill Name** | moai-alfred-tui-survey |
22
- | **Version** | 2.0.0 (2025-10-22) |
23
- | **Allowed tools** | AskUserQuestion (interactive surveys), Read (context), Bash (validation) |
24
- | **Auto-load** | On demand when ambiguity detected or approval needed |
25
- | **Tier** | Alfred |
26
-
27
- ---
28
-
29
- ## What It Does
30
-
31
- The **moai-alfred-tui-survey** Skill standardizes interactive user engagement through Claude Code's AskUserQuestion tool, transforming vague requests into precise specifications through structured TUI (Terminal User Interface) surveys.
32
-
33
- **Core Capabilities**:
34
- - Interactive clarification of ambiguous requirements
35
- - Structured decision-making for architectural choices
36
- - User approval workflows for critical operations
37
- - Multi-option selection menus with clear trade-offs
38
- - Context-aware question generation based on codebase analysis
39
- - Progressive disclosure of implementation options
40
-
41
- **Key Innovation**: Instead of AI guessing user intent from incomplete instructions ("Vibe Coding"), this Skill enables AI to present concrete options with clear trade-offs via terminal UI menus, capturing explicit user choices before execution.
42
-
43
- ---
44
-
45
- ## When to Use
46
-
47
- ### Automatic Triggers
48
-
49
- This Skill activates automatically when:
50
- - **Ambiguity detected**: Multiple valid implementation approaches exist
51
- - **Architectural decisions**: Choice affects system design or data flow
52
- - **Breaking changes**: Operation may impact existing functionality
53
- - **User experience decisions**: Multiple UX patterns are viable
54
- - **Security/compliance**: Explicit approval required before proceeding
55
-
56
- ### Manual Invocation
57
-
58
- Invoke explicitly when:
59
- - Planning complex features with trade-offs
60
- - Refactoring with multiple migration strategies
61
- - Designing APIs with competing patterns
62
- - Selecting libraries or frameworks
63
- - Clarifying high-level requirements like "Add a dashboard" or "Optimize performance"
64
-
65
- ### Example Scenarios
66
-
67
- | User Request | Why TUI Survey Needed | Clarification Required |
68
- |--------------|----------------------|------------------------|
69
- | "Add a dashboard" | Multiple layout patterns exist | Layout type, data sources, authentication |
70
- | "Optimize performance" | Many bottlenecks possible | Target metric, acceptable trade-offs, profiling approach |
71
- | "Refactor auth system" | Multiple migration paths | Scope, backwards compatibility, deployment strategy |
72
- | "Add multi-language support" | Implementation varies widely | Scope (UI only vs full i18n), default language, library choice |
73
-
74
- ---
75
-
76
- ## Core Principles
77
-
78
- ### 1. Reduce Ambiguity, Don't Guess
79
-
80
- **Problem**: Traditional "Vibe Coding" forces AI to infer intent from incomplete instructions, leading to:
81
- - Ambiguous implementations
82
- - Unnecessary code modifications
83
- - Multiple refinement rounds
84
- - Wasted developer time
85
-
86
- **Solution**: Present concrete options upfront, capture explicit choices, execute with certainty.
87
-
88
- ### 2. Context-Aware Question Generation
89
-
90
- Survey questions are derived from:
91
- - Existing codebase patterns (`Read` tool analysis)
92
- - Current project structure (`Glob` for similar features)
93
- - Domain best practices (skill knowledge)
94
- - SPEC and TAG references (traceability context)
95
-
96
- ### 3. Progressive Clarification
97
-
98
- Start with high-level choices, drill down based on selections:
99
- ```
100
- Question 1: Implementation approach (architectural decision)
101
-
102
- Question 2: User experience details (UX decision)
103
-
104
- Question 3: Data handling strategy (technical decision)
105
-
106
- Review: Summary of all selections with "Go back" option
107
- ```
108
-
109
- ### 4. Always Provide Review Step
110
-
111
- Before executing, show summary:
112
- - All selected options
113
- - Implications of choices
114
- - Option to revise any answer
115
- - Clear "Submit" vs "Go back" actions
116
-
117
- ---
118
-
119
- ## TUI Survey Patterns
120
-
121
- ### Pattern 1: Architectural Decision Survey
122
-
123
- **Use when**: Multiple system design approaches are viable
124
-
125
- **Structure**:
126
- ```
127
- Question: "How should the [feature] be implemented?"
128
- Options:
129
- - Approach A (description + trade-offs)
130
- - Approach B (description + trade-offs)
131
- - Approach C (description + trade-offs)
132
- - [Other] (custom input)
133
- ```
134
-
135
- **Example**:
136
- ```
137
- Question: "How should the completion page be implemented?"
138
- Options:
139
- 1. Create new public page (/competition-closed)
140
- • Unguarded route, visible to all visitors
141
- • No authentication required
142
- • PRO: Simple, clear separation | CON: Additional route
143
-
144
- 2. Modify existing /end page with conditional logic
145
- • Check if competition is active before showing results
146
- • PRO: Reuses existing code | CON: Adds complexity
147
-
148
- 3. Use environment-based gating
149
- • Set NEXT_PUBLIC_COMPETITION_CLOSED=true
150
- • PRO: Runtime configuration | CON: Requires env management
151
- ```
152
-
153
- ### Pattern 2: Feature Scope Survey
154
-
155
- **Use when**: Feature scope is unclear or has multiple valid extents
156
-
157
- **Structure**:
158
- ```
159
- Question: "What scope should [feature] cover?"
160
- Options:
161
- - Minimal (core functionality only)
162
- - Standard (common use cases)
163
- - Comprehensive (full feature set)
164
- - [Other] (custom scope definition)
165
- ```
166
-
167
- **Example**:
168
- ```
169
- Question: "What scope should multi-language support cover?"
170
- Options:
171
- 1. UI labels only (buttons, menus, navigation)
172
- • Scope: Frontend i18n | Effort: 2-3 days
173
-
174
- 2. UI + static content (about pages, help docs)
175
- • Scope: Frontend + CMS integration | Effort: 5-7 days
176
-
177
- 3. Full i18n (UI, content, backend messages, emails)
178
- • Scope: Full-stack internationalization | Effort: 10-14 days
179
- ```
180
-
181
- ### Pattern 3: Technical Choice Survey
182
-
183
- **Use when**: Multiple libraries, frameworks, or tools can solve the problem
184
-
185
- **Structure**:
186
- ```
187
- Question: "Which [tool/library] should be used for [purpose]?"
188
- Options:
189
- - Option A (maturity, ecosystem, trade-offs)
190
- - Option B (maturity, ecosystem, trade-offs)
191
- - Option C (maturity, ecosystem, trade-offs)
192
- - [Other] (specify alternative)
193
- ```
194
-
195
- **Example**:
196
- ```
197
- Question: "Which state management library should be used?"
198
- Options:
199
- 1. Redux Toolkit (v2.x)
200
- • Maturity: Industry standard | Ecosystem: Extensive
201
- • PRO: DevTools, middleware | CON: Boilerplate
202
-
203
- 2. Zustand (v5.x)
204
- • Maturity: Stable, modern | Ecosystem: Growing
205
- • PRO: Simple API, minimal boilerplate | CON: Fewer resources
206
-
207
- 3. Jotai (v2.x)
208
- • Maturity: Modern atomic approach | Ecosystem: Niche
209
- • PRO: Fine-grained reactivity | CON: Paradigm shift
210
- ```
211
-
212
- ### Pattern 4: Migration Strategy Survey
213
-
214
- **Use when**: Refactoring or upgrading with multiple migration paths
215
-
216
- **Structure**:
217
- ```
218
- Question: "What migration strategy should be used?"
219
- Options:
220
- - Big bang (full rewrite, single deployment)
221
- - Incremental (gradual migration, feature flags)
222
- - Parallel run (new + old systems coexist)
223
- - [Other] (custom strategy)
224
- ```
225
-
226
- **Example**:
227
- ```
228
- Question: "How should the auth system be refactored?"
229
- Options:
230
- 1. Big bang migration (full rewrite)
231
- • Timeline: 2-3 weeks | Risk: High
232
- • PRO: Clean slate | CON: Risky deployment
233
-
234
- 2. Incremental with feature flags
235
- • Timeline: 4-6 weeks | Risk: Medium
236
- • PRO: Gradual rollout | CON: Code duplication
237
-
238
- 3. Parallel run (adapter pattern)
239
- • Timeline: 6-8 weeks | Risk: Low
240
- • PRO: Safe rollback | CON: Complex maintenance
241
- ```
242
-
243
- ### Pattern 5: Approval Workflow Survey
244
-
245
- **Use when**: Explicit approval needed before executing
246
-
247
- **Structure**:
248
- ```
249
- Question: "Review the proposed changes. Proceed?"
250
- Options:
251
- - Approve and execute
252
- - Approve with modifications (specify)
253
- - Reject and reconsider
254
- ```
255
-
256
- **Example**:
257
- ```
258
- Question: "This will delete 50 unused files. Proceed?"
259
- Details:
260
- - 50 files identified as unused (last modified >6 months ago)
261
- - Backup created at .moai-backups/pre-cleanup-2025-10-22
262
- - Reversible via Git checkout
263
-
264
- Options:
265
- 1. Approve and execute cleanup
266
- 2. Review file list first (show details)
267
- 3. Cancel operation
268
- ```
269
-
270
- ---
271
-
272
- ## Question Design Best Practices
273
-
274
- ### Structure Each Question
275
-
276
- ```yaml
277
- question: "Clear, specific question ending with ?"
278
- header: "Short label (max 12 chars)" # e.g., "Auth method", "Library"
279
- multiSelect: false # or true for checkboxes
280
- options:
281
- - label: "Option 1 name"
282
- description: "What this option means and its implications"
283
- - label: "Option 2 name"
284
- description: "What this option means and its implications"
285
- ```
286
-
287
- ### Writing Effective Questions
288
-
289
- **DO**:
290
- - ✅ Be specific: "How should the completion page be implemented?"
291
- - ✅ Provide context: Include current state, constraints, implications
292
- - ✅ Show trade-offs: PRO/CON, effort estimates, risk levels
293
- - ✅ Limit options: 2-4 main choices (avoid analysis paralysis)
294
- - ✅ Include "Other" option: Allow custom input
295
- - ✅ Use present tense: "How should...", "Which...", "What..."
296
-
297
- **DON'T**:
298
- - ❌ Be vague: "What do you want?" (too open-ended)
299
- - ❌ Use jargon without explanation: Assume user knowledge level
300
- - ❌ Omit implications: Show what each choice affects
301
- - ❌ Overload options: >4 options cause decision fatigue
302
- - ❌ Force choices: Always provide escape hatch
303
- - ❌ Use past tense: "How did you want...?" (sounds passive)
304
-
305
- ### Option Design Patterns
306
-
307
- **Good Option Format**:
308
- ```
309
- Option Label (concise, 3-7 words)
310
- • Description of what this option does
311
- • PRO: Key advantage | CON: Key limitation
312
- • Effort: Time estimate | Risk: High/Medium/Low
313
- ```
314
-
315
- **Example**:
316
- ```
317
- Create new microservice
318
- • Separate service with own database and API
319
- • PRO: Full isolation, independent scaling
320
- • CON: Operational overhead, network latency
321
- • Effort: 2-3 weeks | Risk: Medium
322
- ```
323
-
324
- ### Multi-Select vs Single-Select
325
-
326
- **Single-Select** (default):
327
- - Use for mutually exclusive choices
328
- - Architecture patterns (can't be both monolith AND microservices)
329
- - Migration strategies (pick one path)
330
- - Primary library selection
331
-
332
- **Multi-Select** (`multiSelect: true`):
333
- - Use for independent, combinable options
334
- - Feature toggles (enable multiple features)
335
- - Validation rules (apply multiple checks)
336
- - Testing strategies (unit + integration + e2e)
337
-
338
- ---
339
-
340
- ## Integration with MoAI Workflow
341
-
342
- ### Phase 1: Plan (`/alfred:1-plan`)
343
-
344
- **Use TUI Survey for**:
345
- - SPEC scope clarification ("What should this feature include?")
346
- - EARS pattern selection ("Which requirement type fits?")
347
- - TAG domain assignment ("Which domain does this belong to?")
348
-
349
- **Example**:
350
- ```
351
- User: "/alfred:1-plan Add notification system"
352
-
353
- TUI Survey: "What type of notifications?"
354
- - In-app only
355
- - Email notifications
356
- - Push notifications (mobile)
357
- - All of the above
358
-
359
- TUI Survey: "Real-time or batch?"
360
- - Real-time (WebSocket/SSE)
361
- - Batch (scheduled jobs)
362
- - Hybrid approach
363
- ```
364
-
365
- ### Phase 2: Run (`/alfred:2-run`)
366
-
367
- **Use TUI Survey for**:
368
- - Library/framework selection
369
- - Implementation approach (TDD RED → GREEN → REFACTOR)
370
- - Error handling strategy
371
- - Data validation approach
372
-
373
- **Example**:
374
- ```
375
- User: "/alfred:2-run SPEC-001"
376
-
377
- TUI Survey: "Which validation library?"
378
- - Zod (TypeScript-first)
379
- - Yup (JSON schema)
380
- - Joi (Node.js standard)
381
-
382
- Execute TDD cycle with selected library
383
- ```
384
-
385
- ### Phase 3: Sync (`/alfred:3-sync`)
386
-
387
- **Use TUI Survey for**:
388
- - Documentation language/format
389
- - Changelog structure
390
- - PR title/description style
391
- - Merge strategy
392
-
393
- **Example**:
394
- ```
395
- User: "/alfred:3-sync"
396
-
397
- TUI Survey: "PR is ready. Merge strategy?"
398
- - Squash and merge (clean history)
399
- - Merge commit (preserve commits)
400
- - Rebase and merge (linear history)
401
-
402
- Execute Git operations with selected strategy
403
- ```
404
-
405
- ---
406
-
407
- ## AskUserQuestion Tool Specification
408
-
409
- ### Tool Parameters
410
-
411
- ```typescript
412
- {
413
- questions: [
414
- {
415
- question: string, // The question to ask
416
- header: string, // Short label (max 12 chars)
417
- multiSelect: boolean, // Allow multiple selections?
418
- options: [
419
- {
420
- label: string, // Option display text
421
- description: string // Explanation of option
422
- }
423
- ]
424
- }
425
- ]
426
- }
427
- ```
428
-
429
- ### Response Format
430
-
431
- ```typescript
432
- {
433
- answers: {
434
- [questionIndex: string]: string | string[]
435
- }
436
- }
437
- ```
438
-
439
- ### Example Invocation
440
-
441
- ```typescript
442
- AskUserQuestion({
443
- questions: [
444
- {
445
- question: "How should the API authentication be implemented?",
446
- header: "Auth method",
447
- multiSelect: false,
448
- options: [
449
- {
450
- label: "JWT with refresh tokens",
451
- description: "Stateless auth with short-lived access tokens and long-lived refresh tokens"
452
- },
453
- {
454
- label: "Session-based with cookies",
455
- description: "Server-side sessions stored in Redis, client receives httpOnly cookie"
456
- },
457
- {
458
- label: "OAuth2 with third-party provider",
459
- description: "Delegate authentication to Google/GitHub/etc., receive tokens"
460
- }
461
- ]
462
- },
463
- {
464
- question: "Which security features should be enabled?",
465
- header: "Security",
466
- multiSelect: true,
467
- options: [
468
- {
469
- label: "Rate limiting",
470
- description: "Prevent abuse with request rate limits per user/IP"
471
- },
472
- {
473
- label: "CSRF protection",
474
- description: "Protect against cross-site request forgery attacks"
475
- },
476
- {
477
- label: "XSS prevention headers",
478
- description: "Set Content-Security-Policy and X-Frame-Options headers"
479
- }
480
- ]
481
- }
482
- ]
483
- })
484
- ```
485
-
486
- ---
487
-
488
- ## Failure Modes & Mitigation
489
-
490
- ### Failure Mode 1: User Selects "Other" Without Details
491
-
492
- **Symptom**: User chooses "Other" but provides vague custom input
493
-
494
- **Mitigation**:
495
- - Follow up with clarifying questions
496
- - Provide examples of what details are needed
497
- - Show similar patterns from codebase for reference
498
-
499
- **Example**:
500
- ```
501
- User selects: "Other: Something with webhooks"
502
-
503
- Follow-up TUI Survey:
504
- "Could you clarify the webhook approach?"
505
- - Outgoing webhooks (send events to external services)
506
- - Incoming webhooks (receive events from external services)
507
- - Bidirectional webhook system
508
- ```
509
-
510
- ### Failure Mode 2: Too Many Nested Questions
511
-
512
- **Symptom**: Survey becomes overwhelming with 5+ sequential questions
513
-
514
- **Mitigation**:
515
- - Limit to 3-4 questions per survey
516
- - Group related choices into single multi-select
517
- - Split complex decisions into multiple phases
518
-
519
- **Example**:
520
- ```
521
- ❌ BAD: 7 sequential questions about feature details
522
-
523
- ✅ GOOD:
524
- Phase 1: High-level approach (1-2 questions)
525
- → Execute initial setup
526
- Phase 2: Detailed configuration (1-2 questions)
527
- → Finalize implementation
528
- ```
529
-
530
- ### Failure Mode 3: Options Not Mutually Exclusive
531
-
532
- **Symptom**: User wants to combine options marked as single-select
533
-
534
- **Mitigation**:
535
- - Review if multi-select is more appropriate
536
- - Add "Hybrid" or "Combination" option
537
- - Explain why options are mutually exclusive in descriptions
538
-
539
- **Example**:
540
- ```
541
- Question: "Authentication strategy?"
542
- - JWT only
543
- - Session only
544
- - Hybrid (JWT for API, sessions for web) ← Add this option
545
- ```
546
-
547
- ### Failure Mode 4: Insufficient Context in Questions
548
-
549
- **Symptom**: User can't make informed decision due to missing information
550
-
551
- **Mitigation**:
552
- - Always analyze codebase context before presenting survey (`Read` tool)
553
- - Include current state in question description
554
- - Show examples from existing code patterns
555
-
556
- **Example**:
557
- ```
558
- Question: "How should error handling be implemented?"
559
- Context: "Current codebase uses try/catch blocks in 15 files,
560
- Result<T, E> pattern in 5 files (services layer)."
561
- Options:
562
- - Expand Result pattern (align with existing services)
563
- - Standardize on try/catch (align with majority)
564
- - Introduce error boundary pattern (new approach)
565
- ```
566
-
567
- ---
568
-
569
- ## Best Practices Checklist
570
-
571
- ### Before Creating Survey
572
-
573
- - [ ] Analyze codebase context (existing patterns, similar features)
574
- - [ ] Identify specific ambiguity or decision point
575
- - [ ] Verify that decision requires user input (not deterministic)
576
- - [ ] Check if similar decisions have been made before (consistency)
577
-
578
- ### During Survey Design
579
-
580
- - [ ] Limit to 3-4 questions maximum
581
- - [ ] Each option has clear label + description
582
- - [ ] Trade-offs (PRO/CON) are visible when relevant
583
- - [ ] "Other" option is included for flexibility
584
- - [ ] Multi-select is used only for independent choices
585
- - [ ] Headers are concise (≤12 characters)
586
-
587
- ### After Capturing Responses
588
-
589
- - [ ] Show review summary of all selections
590
- - [ ] Provide "Go back" option to revise
591
- - [ ] Confirm understanding with brief echo: "You selected [X], which means [Y]"
592
- - [ ] Log selections for future reference (SPEC, docs)
593
-
594
- ---
595
-
596
- ## Examples
597
-
598
- See [examples.md](examples.md) for complete real-world scenarios:
599
- 1. **Competition Completion Page** - Architectural decision with scope clarification
600
- 2. **State Management Library Selection** - Technical choice with trade-off analysis
601
- 3. **Auth System Refactor** - Migration strategy with risk assessment
602
- 4. **Feature Approval Workflow** - Explicit approval before destructive operation
603
-
604
- ---
605
-
606
- ## References
607
-
608
- See [reference.md](reference.md) for:
609
- - Complete AskUserQuestion API specification
610
- - TUI interaction patterns from popular frameworks
611
- - Decision tree templates for common scenarios
612
- - Integration points with Alfred sub-agents
613
-
614
- ---
615
-
616
- ## Works Well With
617
-
618
- - **moai-alfred-spec-metadata-validation**: Clarify SPEC scope during `/alfred:1-plan`
619
- - **moai-alfred-ears-authoring**: Select EARS patterns interactively
620
- - **moai-alfred-refactoring-coach**: Choose refactoring strategies
621
- - **moai-foundation-specs**: Confirm SPEC metadata choices
622
-
623
- ---
624
-
625
- ## Changelog
626
-
627
- - **v2.0.0** (2025-10-22): Complete rewrite with TUI survey patterns, question design best practices, codebase context integration, failure mode analysis, and extensive examples
628
- - **v1.0.0** (2025-03-29): Initial Skill release with basic AskUserQuestion integration
629
-
630
- ---
631
-
632
- **Version**: 2.0.0
633
- **Last Updated**: 2025-10-22
634
- **Status**: Production-ready
635
- **Framework**: MoAI-ADK + Alfred workflow orchestration