🔧Tool Prompts/system
Ask User Question Tool
src/tools/AskUserQuestionTool/prompt.ts
Prompt Engineering Insight
The AskUserQuestion prompt uses tool-use guidance to establish the UX pattern — always having an 'Other' escape hatch, marking recommendations with '(Recommended)', and supporting visual previews for comparing alternatives. The plan mode note is a critical disambiguation that prevents the model from using this tool for plan approval (which is ExitPlanMode's job). The note about users not seeing the plan until ExitPlanMode is called prevents a subtle UX bug where the model references something invisible to the user.
Techniques Used
tool-use-guidancebehavioral-constraintsscope-limitingconditional-logicstructured-output
prompt
Asks the user multiple choice questions to gather information, clarify ambiguity, understand preferences, make decisions or offer them choices.
Use this tool when you need to ask the user questions during execution. This allows you to:
- 1. Gather user preferences or requirements
- 2. Clarify ambiguous instructions
- 3. Get decisions on implementation choices as you work
- 4. Offer choices to the user about what direction to take.
Usage notes:
- Users will always be able to select "Other" to provide custom text input
- Use multiSelect: true to allow multiple answers to be selected for a question
- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label
Preview feature:
Use the optional
preview field on options when presenting concrete artifacts that users need to visually compare:- ASCII mockups of UI layouts or components
- Code snippets showing different implementations
- Diagram variations
- Configuration examples
Preview content is rendered as markdown in a monospace box. Do not use previews for simple preference questions where labels and descriptions suffice. Previews are only supported for single-select questions (not multiSelect).
Plan mode note: In plan mode, use this tool to clarify requirements or choose between approaches BEFORE finalizing your plan. Do NOT use this tool to ask "Is my plan ready?" or "Should I proceed?" - use ExitPlanMode for plan approval. IMPORTANT: Do not reference "the plan" in your questions (e.g., "Do you have feedback about the plan?", "Does the plan look good?") because the user cannot see the plan in the UI until you call ExitPlanMode. If you need plan approval, use ExitPlanMode instead.
Tags
user-interactionquestionsmultiple-choiceclarificationpreferencespreview