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.

mattnigh/skills_collection0installs24stars

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 mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
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