ask-user
Pattern for asking the user structured questions and gating execution on their response. Use whenever the agent needs a choice, confirmation, or free-text answer before it can proceed. Renders an interactive widget in the web UI and TUI, and falls back to stdin on the console.
- License 许可
- MIT
- 所属仓库
- blouargant/omnis
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ask-user
- metadata
- { "tags": "user input, decision gate, interaction pattern, questions, interactive", "triggers": "ask the user, ask user, ask questions, question the user, gather user input, need user input, interactive planning, present options, ask before proceeding, choice gate, user decision, clarify with user, confirm with user, collect user preferences" }
- description
- Pattern for asking the user structured questions and gating execution on their response. Use whenever the agent needs a choice, confirmation, or free-text answer before it can proceed. Renders an interactive widget in the web UI and TUI, and falls back to stdin on the console.
03 SKILL.md 正文
Ask User — Choice Gate Pattern
How to Ask
Call the AskUserQuestion tool. It blocks until the user responds and returns the
answer as a structured tool result. Do not attempt to simulate a question by
writing prose — use the tool.
Tool parameters
| Field | Type | Required | Notes |
|---|---|---|---|
kind |
string | ✓ | "single", "multi", "text", or "confirm" |
prompt |
string | ✓ | The question to show the user |
choices |
[]string | see below | Required for single/confirm/multi; optional for text |
allow_text |
bool | – | Add a free-text field to a multi question |
default |
string | – | Pre-selected value hint (display only) |
timeout_seconds |
int | – | Bound the wait. By default there is no timeout — the question waits until the user answers (or the turn is aborted). Set a positive value to auto-cancel after N seconds |
Kind semantics
| Kind | Widget | Choices | Result fields used |
|---|---|---|---|
single |
Radio buttons | 2-4 required | selected[0] |
confirm |
Radio buttons | Exactly 2 required (Yes/No) | selected[0] |
multi |
Checkboxes (+ optional text) | ≥1 required | selected[], text |
text |
Text area | Optional hint choices ignored | text |
Cancelled result
If the user clicks Skip/Cancel (or an explicit timeout_seconds you set
elapses), cancelled: true is set in the result. Fall back to the safest default
and note what was assumed. With no timeout_seconds the question simply waits for
the user — it is not auto-cancelled on a timer.
Editorial policy
Infer before asking
Before calling AskUserQuestion, run these checks:
- Scan conversation history — did the user already answer this implicitly?
- Check stated preferences — does a loaded skill supply a default?
- Estimate cost of a wrong default — if low, pick the safest default and note it.
Only gate when the three checks leave the answer genuinely ambiguous.
Constraints
| Check | Requirement |
|---|---|
| Option count | 2–4 choices max. More than 4 creates decision paralysis. |
| Labels | Self-explanatory labels. Action verb + brief qualifier, not "Option 1". |
| Escape hatch | Always include an escape hatch (e.g. "Skip" or "Cancel") as the last choice. |
| Question scope | One AskUserQuestion call per turn. Never stack multiple calls sequentially before reading results. |
| Safety ordering | Safest/reversible option first for destructive ops. |
| Blocking order | Ask the most blocking question first when multiple unknowns exist. |
How to gate (CRITICAL)
After calling AskUserQuestion, the tool blocks — the LLM turn does not end until the
user answers. Do not speculatively continue planning inside the same turn while
waiting. Read the tool result, acknowledge briefly, then branch.
If the result has cancelled: true, fall back to the safest default and
continue with a note about the assumption.
Non-blocking exception
If the gate blocks only one branch of a parallelizable plan and unrelated
independent work exists, you MAY call other tools for that unrelated work
before calling AskUserQuestion for the blocked branch, and state what you are
doing in parallel.
Example calls
Single choice
AskUserQuestion({
"kind": "single",
"prompt": "Which branch should I target?",
"choices": ["main", "develop", "feature/my-branch", "Skip — I'll tell you later"]
})
Confirmation
AskUserQuestion({
"kind": "confirm",
"prompt": "This will delete 47 files. Proceed?",
"choices": ["No, cancel", "Yes, delete them"]
})
Multi-select
AskUserQuestion({
"kind": "multi",
"prompt": "Which test suites should I run?",
"choices": ["unit", "integration", "e2e", "lint"],
"allow_text": false
})
Free text
AskUserQuestion({
"kind": "text",
"prompt": "What should I name the new branch?"
})
04 同仓库更多 Skills
skill-creator
Create or update a skill playbook (SKILL.md) for the agent. Use when the user wants to create a new skill, add a skill, define a new agent capability, update an existing skill, edit a skill, refine a skill playbook, or specialise the agent for a new domain.
review
Review a body of work (source code, configuration, documents, infra manifests, …) for correctness, clarity, and obvious risks. Use this skill whenever the user asks for a review, audit or critique.
Fallback PDF text extractor using pdftotext (poppler). Use ONLY when the preferred `liteparse` skill is unavailable or for a quick plain-text dump of a simple text PDF — for the best PDF parsing (scanned, multi-column, layout-heavy, or non-PDF formats) prefer the `liteparse` skill.
pandoc
This skill should be used when converting documents between formats (Markdown, DOCX, PDF, HTML, LaTeX, etc.) using pandoc. Use for format conversion, document generation, and preparing markdown for Google Docs or other word processors.
liteparse
Preferred local parser for extracting text from PDFs, images, and scanned/layout-heavy documents (OCR, screenshots, complex PDFs) — far better than pdftotext. Use this FIRST for any PDF, image, or OCR text-extraction or conversion task. NOTE for Office documents (DOCX, PPTX, XLSX, ODT) — for plain text extraction prefer the `pandoc` skill, which needs no LibreOffice; only use LiteParse for Office docs when you need its layout/OCR/screenshot output. The `pdf` skill (pdftotext) is only a fallback for when LiteParse cannot be installed.
linux-admin
Safely make a change to a Linux workstation — install/remove packages, manage systemd services and timers, edit and validate configuration files, manage users/permissions and networking. Detect the distro and package manager, determine whether the target is package-managed or hand-maintained, preview or simulate every change, back up configs before editing, and prefer the package manager and drop-in overrides so the host stays consistent and secure. Use whenever a change to the local Linux host is required (install, remove, enable, disable, start, stop, edit a config, add a user, change permissions or networking).