Skip to content
moai-alfred-ask-user-questions logo

Alfred Ask User Questions - Skill Guide

moai-alfred-ask-user-questions

Guide Alfred sub-agents to actively invoke AskUserQuestion for ambiguous decisions.

SKILL.md

Full skill instructions

Alfred Ask User Questions - Skill Guide

Skill Metadata

FieldValue
Skill Namemoai-alfred-ask-user-questions
Version3.1.0 (2025-10-27)
Core ToolAskUserQuestion (Claude Code built-in)
Auto-loadWhen Alfred detects ambiguity in requests
TierAlfred (Workflow Orchestration)

What It Does

Purpose: Empower Alfred sub-agents to actively ask clarifying questions whenever user intent is ambiguous, rather than guessing.

Leverages Claude Code's native AskUserQuestion tool to collect explicit, structured user input that transforms vague requests into precise specifications.

Key capabilities:

  • ✅ Single-select & multi-select option types
  • ✅ 1-4 questions per survey (avoid fatigue)
  • ✅ 2-4 options per question (prevent choice overload)
  • ✅ Automatic "Other" option for custom input
  • ✅ Conditional branching based on answers
  • ✅ Integration across all Alfred commands (Plan/​Run/​Sync)
  • ✅ Reduces ambiguity → fewer iterations → faster execution

When to Ask (Trigger Patterns)

✅ ASK when user intent is ambiguous:

  1. Vague noun phrases: "Add dashboard", "Refactor auth", "Improve performance"
  2. Missing scope: No specification of WHERE, WHO, WHAT, HOW, WHEN
  3. Multiple valid paths: ≥2 reasonable implementation approaches
  4. Trade-off decisions: Speed vs quality, simple vs comprehensive, etc.
  5. Risky operations: Destructive actions needing explicit consent

❌ DON'T ask when:

  • User explicitly specified exact requirements
  • Decision is automatic (no choices)
  • Single obvious path exists
  • Quick yes/​no confirmation only (maybe, but keep it brief)

Core Principle: Just Ask!

Golden Rule: When in doubt, ask the user instead of guessing.

Why:

  • ✅ User sees exactly what you'll do → no surprises
  • ✅ Single interaction vs 3-5 rounds of back-and-forth
  • ✅ Fast → execute with certainty
  • ✅ Reduces "vibe coding" frustration

Pattern:

Ambiguous request detected
         ↓
Call AskUserQuestion({questions: [...]})
         ↓
User selects from clear options
         ↓
Proceed with confirmed specifications

Quick Start: Minimal Invocation

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" }

Key Constraints

ConstraintReason
1-4 questions maxAvoid user fatigue
2-4 options per QPrevent choice overload
Header ≤12 charsTUI layout fit
Label 1-5 wordsQuick scanning
Description requiredEnables informed choice
Auto "Other" optionAlways available for custom input

Top 5 Usage Patterns

Pattern 1: Implementation Approach

Trigger: "Add feature X" or "Build Y" without specifics

Pattern 2: Confirmation (Risky Operations)

Trigger: Destructive action (delete, migrate, reset)

Pattern 3: Multi-Option Feature Selection

Trigger: "Which framework/​library/​approach?"

Pattern 4: Multi-Select (Independent Features)

Trigger: "Which features to enable/​include?"

Pattern 5: Sequential Questions (Conditional Flow)

Trigger: Dependent decisions (Q2 depends on Q1 answer)

Detailed examples and code: See examples.md


Integration with Alfred Sub-agents

Sub-agentWhen to AskExample Trigger
spec-builder (/​alfred:1-plan)SPEC title vague, scope undefined"Add feature" without specifics
code-builder (/​alfred:2-run)Implementation approach unclearMultiple valid implementation paths
doc-syncer (/​alfred:3-sync)Sync scope unclearFull vs partial sync decision

Detailed integration patterns: See reference.md


Best Practices Summary

✅ DO

  • Be specific: "Which database type?" not "What should we use?"
  • Provide context: Include file names, scope, or impact
  • Order logically: General → Specific; safest option first
  • Flag risks: Use "NOT RECOMMENDED" or "CAUTION:" prefixes
  • Explain trade-offs: Mention time, resources, complexity

❌ DON'T

  • Overuse questions: Only ask when ambiguous
  • Too many options: 2-4 per question max
  • Vague labels: "Option A", "Use tokens", "Option 2"
  • Skip descriptions: User needs rationale
  • Hide trade-offs: Always mention implications

Complete best practices guide: See reference.md


Error Handling

User Cancels (ESC key)

try {
  const answer = await AskUserQuestion({...});
} catch (error) {
  console.log("User cancelled survey");
  // Fall back to default or abort
}

Validate Custom Input ("Other" option)

const answer = await AskUserQuestion({...});

if (answer["Header"] === "Other" || !VALID_OPTIONS.includes(answer["Header"])) {
  validateCustomInput(answer["Header"]);
}

Related Skills

  • moai-alfred-spec-metadata-validation (SPEC clarity)
  • moai-alfred-ears-authoring (requirement phrasing)
  • moai-foundation-specs (SPEC structure)

Quick Reference

When to use:

  • User intent is ambiguous
  • Multiple valid approaches exist
  • Architectural decisions with trade-offs
  • Approvals needed before risky ops

How:

  1. Detect ambiguity (vague request, multiple paths, etc.)
  2. Call AskUserQuestion({ questions: [...] })
  3. User selects from clear options
  4. Proceed with confirmed specifications

Benefits:

  • ✅ Certainty instead of guessing
  • ✅ Single interaction vs 3-5 iterations
  • ✅ Faster, happier users
  • ✅ Less "vibe coding" frustration

For detailed API specifications: reference.md
For real-world examples: examples.md


End of Skill | Refactored 2025-10-27

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View