moai-adk-main/src/moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/SKILL.md
Enterprise interactive survey orchestrator with AskUserQuestion tool integration, multi-select support, conditional branching, error recovery, and production-grade decision automation across all Alfred workflows; activates for requirement clarification, architectural decisions, risky operations, feature selection, and complex multi-step user interactions
npx skillsauth add ajbcoding/claude-skill-eval moai-alfred-ask-user-questionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Field | Value |
| ----- | ----- |
| Skill Name | moai-alfred-ask-user-questions |
| Version | 4.0.0 Enterprise (2025-11-12) |
| Core Tool | AskUserQuestion (Claude Code built-in) |
| Auto-load | When Alfred detects ambiguity in requests |
| Tier | Alfred (Workflow Orchestration) |
| Allowed tools | AskUserQuestion |
| Lines of Content | 850+, with 10+ production examples |
| Progressive Disclosure | 3-level (quick-reference, patterns, advanced) |
Purpose: Empower Alfred sub-agents to actively conduct enterprise-grade surveys for requirement clarification, architectural decisions, and complex decision automation.
Leverages Claude Code's native AskUserQuestion tool to collect explicit, structured user input that transforms vague requests into precise specifications with guaranteed UX quality across all models.
Enterprise Capabilities:
Vague noun phrases: "Add dashboard", "Refactor auth", "Improve performance"
Missing scope definition: No specification of WHERE, WHO, WHAT, HOW, WHEN
Multiple valid paths: ≥2 reasonable implementation approaches
Trade-off decisions: Performance vs reliability, cost vs features
Risky operations: Destructive actions (delete, migrate, reset)
Architectural decisions: Technology selection, API design, database choice
Golden Rule: When in doubt, ask the user instead of assuming.
Why:
Pattern:
Ambiguous request detected
↓
Call AskUserQuestion({questions: [...]})
↓
User selects from clear options
↓
Proceed with confirmed specifications
Single-Select Pattern:
const answer = await AskUserQuestion({
questions: [
{
question: "How should we implement this?",
header: "Approach", // max 12 chars
multiSelect: false,
options: [
{
label: "Option 1", // 1-5 words
description: "What it does and why you'd pick it."
},
{
label: "Option 2",
description: "Alternative with different trade-offs."
}
]
}
]
});
// Returns: { "Approach": "Option 1" }
Multi-Select Pattern (independent features):
const answer = await AskUserQuestion({
questions: [
{
question: "Which features should we enable?",
header: "Features",
multiSelect: true,
options: [
{ label: "Feature A", description: "..." },
{ label: "Feature B", description: "..." },
{ label: "Feature C", description: "..." }
]
}
]
});
// Returns: { "Features": ["Feature A", "Feature C"] }
Batch Questions (related decisions):
const answer = await AskUserQuestion({
questions: [
{
question: "Which database technology?",
header: "Database",
options: [
{ label: "PostgreSQL", description: "Relational, ACID, mature" },
{ label: "MongoDB", description: "Document, flexible schema" }
]
},
{
question: "Cache strategy?",
header: "Caching",
options: [
{ label: "Redis", description: "In-memory, fast" },
{ label: "Memcached", description: "Distributed cache" }
]
}
]
});
Conditional Flow (dependent decisions):
let questions = [
{
question: "What type of deployment?",
header: "Deployment Type",
options: [
{ label: "Docker", description: "Containerized" },
{ label: "Kubernetes", description: "Orchestrated" },
{ label: "Serverless", description: "Functions-as-a-Service" }
]
}
];
const initialAnswer = await AskUserQuestion({ questions });
// Follow-up based on initial choice
if (initialAnswer["Deployment Type"] === "Kubernetes") {
const kubeAnswer = await AskUserQuestion({
questions: [
{
question: "Which cluster provider?",
header: "K8s Provider",
options: [
{ label: "AWS EKS", description: "Amazon Elastic Kubernetes" },
{ label: "GCP GKE", description: "Google Kubernetes Engine" },
{ label: "Self-Managed", description: "On-premises cluster" }
]
}
]
});
}
Custom Input Validation ("Other" option):
const answer = await AskUserQuestion({
questions: [
{
question: "Which framework?",
header: "Framework",
options: [
{ label: "React", description: "UI library" },
{ label: "Vue", description: "Progressive framework" },
{ label: "Other", description: "Custom framework or library" }
]
}
]
});
// Validate custom input
if (answer["Framework"] === "Other" ||
!VALID_FRAMEWORKS.includes(answer["Framework"])) {
const customAnswer = validateCustomInput(answer["Framework"]);
if (!customAnswer) {
// Re-ask with guidance
return retryWithGuidance();
}
}
Error Recovery:
try {
const answer = await AskUserQuestion({...});
} catch (error) {
if (error.type === "UserCancelled") {
// User pressed ESC - use default or abort
return fallbackToDefault();
} else if (error.type === "InvalidInput") {
// Validate and retry
return retryWithValidation();
}
}
Risky Operation Confirmation:
const answer = await AskUserQuestion({
questions: [
{
question: "This will DELETE 15 branches and merge to main. Continue?",
header: "Destructive Op",
options: [
{
label: "Proceed",
description: "Delete branches (CANNOT BE UNDONE)"
},
{
label: "Dry Run",
description: "Show what would be deleted"
},
{
label: "Cancel",
description: "Abort entire process"
}
]
}
]
});
if (answer["Destructive Op"] === "Proceed") {
// Require additional final confirmation
const final = await AskUserQuestion({
questions: [
{
question: "Type DELETE to confirm irreversible action:",
header: "Final Confirmation"
}
]
});
if (final["Final Confirmation"] === "DELETE") {
executeDeletion();
}
}
| Constraint | Reason | Example | |-----------|--------|---------| | 1-4 questions max | Avoid user fatigue | Use follow-up surveys instead | | 2-4 options per Q | Prevent choice overload | Avoid 5+ options (decision paralysis) | | Header ≤12 chars | TUI layout fit | "DB Choice" not "Which Database Technology" | | Label 1-5 words | Quick scanning | "PostgreSQL" not "SQL Database by PostgreSQL" | | Description required | Enables informed choice | Always explain trade-offs | | Auto "Other" option | Always available | System adds automatically for custom input | | No HTML/markdown | Plain text TUI | Use formatting sparingly | | Language matching | User experience | Always match configured conversation_language |
| Sub-agent | When to Ask | Example Trigger | Questions |
|-----------|-------------|-----------------|-----------|
| spec-builder (/alfred:1-plan) | SPEC title vague, scope undefined | "Add feature" without specifics | "Feature type?", "Scope?", "Users affected?" |
| tdd-implementer (/alfred:2-run) | Implementation approach unclear | Multiple valid implementation paths | "Architecture?", "Libraries?", "Constraints?" |
| doc-syncer (/alfred:3-sync) | Sync scope unclear | Full vs partial sync decision | "Full sync?", "Which files?", "Auto-commit?" |
| qa-validator | Review depth unclear | Quick vs comprehensive check | "Review level?", "Security focus?", "Performance?" |
Trigger: "Add dashboard feature" without specifics
Question: "Which dashboard type: Analytics, Admin, or Profile?"
Outcome: Narrowed scope → faster implementation
Trigger: Multiple valid tech choices
Question: "JWT tokens, session-based, or OAuth?"
Outcome: Locked architecture → deterministic development
Trigger: Destructive action (delete, migrate, reset)
Question: "This will delete X. Proceed?" with retry confirmation
Outcome: Explicit consent + audit trail
Trigger: "Which features to enable?"
Question: Multi-select of independent features
Outcome: Precise feature set → no scope creep
Trigger: Dependent choices (Q2 depends on Q1)
Question: First survey → follow-up based on answer
Outcome: Progressive narrowing → precise specification
Trigger: "Build with what stack?"
Question: Database, cache, queue, API type
Outcome: Full stack locked → team alignment
Trigger: Trade-off between conflicting goals
Question: "Optimize for speed, reliability, or cost?"
Outcome: Explicit requirements → informed trade-offs
Trigger: "Other" option selected
Question: "Please describe..." with validation
Outcome: Unexpected inputs handled gracefully
Trigger: Unclear target audience
Question: "Beginner, intermediate, or advanced?"
Outcome: Content adapted to expertise level
Trigger: Major decision needs consensus
Question: Multi-team approval with options
Outcome: Documented decision with stakeholder buy-in
moai-alfred-personas (Communication styles by user level)moai-alfred-spec-authoring (SPEC clarity & structure)moai-foundation-specs (SPEC format & requirements)moai-alfred-language-detection (Conversation language handling)| Scenario | Action | Key Points | |----------|--------|-----------| | Vague request | Ask for clarification | 1-4 questions max | | Multiple approaches | Let user choose | Show trade-offs clearly | | Risky operation | Get explicit consent | Require final confirmation | | Feature selection | Use multi-select | Independent options only | | Dependent decisions | Use sequential surveys | Ask follow-ups based on answers | | Custom input | Validate carefully | Re-ask if invalid | | Accessibility | Plain text UI | No complex formatting |
For detailed API specifications: reference.md
For real-world examples: examples.md
Last Updated: 2025-11-12
Status: Production Ready (Enterprise v4.0.0)
content-media
Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.
development
Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.
tools
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
tools
Replace with description of the skill and when Claude should use it.