moai-adk 0.4.4__py3-none-any.whl → 0.4.7__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 (191) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/core/project/initializer.py +12 -5
  3. moai_adk/templates/.claude/agents/alfred/skill-factory.md +829 -0
  4. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +78 -77
  5. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +29 -0
  6. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +28 -0
  7. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +87 -77
  8. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +29 -0
  9. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +28 -0
  10. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +76 -66
  11. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +29 -0
  12. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +28 -0
  13. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +86 -59
  14. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +29 -0
  15. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +29 -0
  16. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
  17. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
  18. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
  19. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +87 -79
  20. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +29 -0
  21. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +28 -0
  22. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +87 -71
  23. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +29 -0
  24. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +28 -0
  25. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +78 -62
  26. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +29 -0
  27. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +28 -0
  28. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +78 -55
  29. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +29 -0
  30. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +28 -0
  31. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +78 -64
  32. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +29 -0
  33. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +28 -0
  34. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +604 -56
  35. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +974 -44
  36. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +801 -0
  37. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +88 -61
  38. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +16 -500
  39. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +15 -420
  40. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
  41. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
  42. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
  43. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
  44. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
  45. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
  46. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
  47. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
  48. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
  49. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
  50. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
  51. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
  52. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
  53. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
  54. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
  55. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +98 -73
  56. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
  57. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
  58. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
  59. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
  60. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
  61. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
  62. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
  63. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
  64. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
  65. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
  66. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
  67. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
  68. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
  69. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
  70. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +656 -60
  71. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1107 -0
  72. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1533 -0
  73. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
  74. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
  75. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
  76. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
  77. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
  78. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
  79. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
  80. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
  81. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
  82. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +77 -62
  83. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
  84. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
  85. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +88 -56
  86. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
  87. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
  88. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
  89. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
  90. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
  91. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
  92. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
  93. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
  94. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
  95. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
  96. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
  97. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
  98. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  99. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
  100. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
  101. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
  102. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
  103. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +97 -74
  104. moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +29 -0
  105. moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +30 -0
  106. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
  107. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
  108. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
  109. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +97 -74
  110. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
  111. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
  112. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +86 -61
  113. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
  114. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
  115. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +98 -73
  116. moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +29 -0
  117. moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +31 -0
  118. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +98 -74
  119. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
  120. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
  121. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +98 -74
  122. moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +29 -0
  123. moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +31 -0
  124. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +87 -61
  125. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
  126. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
  127. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +88 -59
  128. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
  129. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
  130. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +86 -61
  131. moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +29 -0
  132. moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +30 -0
  133. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +98 -73
  134. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
  135. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
  136. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +86 -61
  137. moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +29 -0
  138. moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +30 -0
  139. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +86 -61
  140. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
  141. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
  142. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +388 -53
  143. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
  144. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
  145. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
  146. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
  147. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
  148. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
  149. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
  150. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
  151. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +98 -74
  152. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
  153. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
  154. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +97 -74
  155. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
  156. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
  157. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
  158. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
  159. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
  160. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
  161. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
  162. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
  163. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +97 -73
  164. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
  165. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
  166. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +90 -59
  167. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
  168. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
  169. moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +482 -0
  170. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +52 -0
  171. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
  172. moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +477 -0
  173. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
  174. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +560 -0
  175. moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +583 -0
  176. moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +526 -0
  177. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +69 -0
  178. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +328 -0
  179. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +312 -0
  180. moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
  181. moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +285 -0
  182. moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +278 -0
  183. moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +303 -0
  184. moai_adk/templates/CLAUDE.md +43 -11
  185. moai_adk-0.4.7.dist-info/METADATA +1162 -0
  186. moai_adk-0.4.7.dist-info/RECORD +275 -0
  187. moai_adk-0.4.4.dist-info/METADATA +0 -369
  188. moai_adk-0.4.4.dist-info/RECORD +0 -152
  189. {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/WHEEL +0 -0
  190. {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/entry_points.txt +0 -0
  191. {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/licenses/LICENSE +0 -0
@@ -1,87 +1,635 @@
1
1
  ---
2
-
3
2
  name: moai-alfred-tui-survey
4
- description: Standardizes Claude Code Tools AskUserQuestion TUI menus for surveys, branching approvals, and option picking across Alfred workflows. Use when gathering approvals or decisions via Alfred’s TUI menus.
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.
5
4
  allowed-tools:
5
+ - AskUserQuestion
6
6
  - Read
7
- - Write
8
- - Edit
9
- - TodoWrite
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']
10
13
  ---
11
14
 
12
15
  # Alfred TUI Survey Skill
13
16
 
14
17
  ## Skill Metadata
18
+
15
19
  | Field | Value |
16
20
  | ----- | ----- |
17
- | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), TodoWrite (todo_write) |
18
- | Auto-load | On demand when AskUserQuestion menus are built |
19
- | Trigger cues | Branch approvals, survey menus, decision gating via AskUserQuestion. |
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
20
85
 
21
- ## What it does
86
+ **Solution**: Present concrete options upfront, capture explicit choices, execute with certainty.
22
87
 
23
- Provides ready-to-use patterns for Claude Code's AskUserQuestion TUI selector so Alfred agents can gather user choices, approvals, or survey answers with structured menus instead of ad-hoc text prompts.
88
+ ### 2. Context-Aware Question Generation
24
89
 
25
- ## When to use
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)
26
95
 
27
- - Activates when Alfred needs to gather structured choices through the TUI selector.
28
- - Need confirmation before advancing to a risky/destructive step.
29
- - Choosing between alternative implementation paths or automation levels.
30
- - Collecting survey-like answers (persona, tech stack, priority, risk level).
31
- - Any time a branched workflow depends on user-selected options rather than free-form text.
96
+ ### 3. Progressive Clarification
32
97
 
33
- ## How it works
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
34
143
 
35
- 1. **Detect gate** Pause at steps that require explicit user choice.
36
- 2. **Shape options** Offer 2–5 focused choices with concise labels.
37
- 3. **Render menu** Emit the `AskUserQuestion({...})` block for the selector.
38
- 4. **Map follow-ups** – Note how each option alters the next action/agent.
39
- 5. **Fallback** – Provide plain-text instructions when the UI cannot render.
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
40
147
 
41
- ### Templates & examples
148
+ 3. Use environment-based gating
149
+ • Set NEXT_PUBLIC_COMPETITION_CLOSED=true
150
+ • PRO: Runtime configuration | CON: Requires env management
151
+ ```
42
152
 
43
- - [Single-select deployment decision](examples.md#single-select-template)
44
- - [Multi-select diagnostics checklist](examples.md#multi-select-variation)
45
- - [Follow-up drill-down prompt](examples.md#follow-up-prompt-for-deeper-detail)
153
+ ### Pattern 2: Feature Scope Survey
46
154
 
47
- ## Best Practices
48
- - Reduce context switching by putting questions, options, and follow-up actions on one screen.
49
- - Options are sorted according to comparison criteria such as risk and priority.
50
- - If safety measures are required, such as approval/suspension/cancellation, attach a warning message.
51
- - Submission results are recorded for reuse in the Sync step or reports.
155
+ **Use when**: Feature scope is unclear or has multiple valid extents
52
156
 
53
- ## Inputs
54
- - Decision scenarios and candidate options collected by Alfred workflows.
55
- - Definition of follow-up actions for each option (next command, subagent, TODO, etc.).
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
+ ```
56
180
 
57
- ## Outputs
58
- - AskUserQuestion block and choice → follow-up action mapping.
59
- - Summary of selection results and TODO items that require further confirmation.
181
+ ### Pattern 3: Technical Choice Survey
60
182
 
61
- ## Failure Modes
62
- - Ambiguous or duplicate options cause selection delays.
63
- - It is difficult to judge priorities when all options look the same.
64
- - AskUserQuestion does not work in a TUI-inactive environment, so plan B is needed.
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
+ ```
65
323
 
66
- ## Dependencies
67
- - Works with the main `/alfred:*` command and schedules follow-up actions with TodoWrite when necessary.
68
- - When combined with moai-foundation-ears · moai-foundation-tags, requirements → options → TAG records are connected.
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
+ ---
69
605
 
70
606
  ## References
71
- - Jakubovic, J. "Designing Effective CLI Dialogs." ACM Queue, 2021.
72
- - NCurses. "Programming Guide." https://invisible-island.net/ncurses/man/ncurses.3x.html (accessed 2025-03-29).
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
+ ---
73
624
 
74
625
  ## Changelog
75
- - 2025-03-29: Added input/output/failure response to Alfred-specific skills.
76
626
 
77
- ## Works well with
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
78
629
 
79
- - `moai-foundation-ears` – Combine structured requirement patterns with menu-driven confirmations.
80
- - `moai-alfred-git-workflow` – Use menus to choose branch/worktree strategies.
81
- - `moai-alfred-code-reviewer` – Capture reviewer focus areas through guided selection.
630
+ ---
82
631
 
83
- ## Examples
84
- ```markdown
85
- - In the `/alfred:1-plan` step, user priorities are collected and the results are written to the PLAN board.
86
- - Check user approval before high-risk operations while running `/alfred:2-run`.
87
- ```
632
+ **Version**: 2.0.0
633
+ **Last Updated**: 2025-10-22
634
+ **Status**: Production-ready
635
+ **Framework**: MoAI-ADK + Alfred workflow orchestration