Skip to content

Instantly share code, notes, and snippets.

@possibilities
Created March 31, 2026 21:42
Show Gist options
  • Select an option

  • Save possibilities/f7d49a3005d5c01561e41cd2d49a8820 to your computer and use it in GitHub Desktop.

Select an option

Save possibilities/f7d49a3005d5c01561e41cd2d49a8820 to your computer and use it in GitHub Desktop.
Wizard forms kitchen sink demo — static spec emitted by behavior + accumulated state from interaction
# Wizard accumulated state after completing all 5 steps
#
# This is what gets stored in wizard_states.values_json as the human
# clicks through each step. On completion, these values are piped as
# YAML to the on_complete command's stdin.
#
# Step 1 (select): picked "great"
# Step 2 (confirm): picked "yes" → step 3 is NOT skipped
# Step 3 (multi_select): toggled "work" and "creative", then hit Done
# Step 4 (paginated_list): paged to page 2, picked "Indigo"
# Step 5 (toggle_group): switched to Film tab, picked "Sci-Fi"
mood: great
want_details: "yes"
details_tags:
- work
- creative
color: Indigo
genre: Sci-Fi
---
# If the human had picked "no" at step 2 (confirm), the condition
# "want_details == yes" would be false, step 3 would be skipped,
# and the final state would look like:
mood: bad
want_details: "no"
# details_tags: skipped — condition not met
color: Teal
genre: Classical
text: Wizard Kitchen Sink Demo
wizard:
on_complete:
command: botctl behavior wizard-demo-complete
success_text: All done!
steps:
- field:
options:
- label: Great
value: great
- label: Good
value: good
- label: Meh
value: meh
- label: Bad
value: bad
type: select
name: mood
prompt: How are you feeling?
- field:
type: confirm
name: want_details
prompt: Want to tell me more?
- condition: want_details == yes
field:
options:
- label: Work stuff
value: work
- label: Health
value: health
- label: Social life
value: social
- label: Creative projects
value: creative
- label: Other
value: other
type: multi_select
name: details_tags
prompt: 'Pick all that apply:'
- field:
options:
- Red
- Orange
- Yellow
- Green
- Blue
- Indigo
- Violet
- Cyan
- Magenta
- Teal
- Coral
- Salmon
type: paginated_list
name: color
prompt: 'Pick a color (page through them):'
- field:
tabs:
- label: Music
name: music
options:
- Jazz
- Electronic
- Classical
- Rock
- label: Film
name: film
options:
- Sci-Fi
- Comedy
- Drama
- Horror
- label: Books
name: books
options:
- Fiction
- Non-Fiction
- Poetry
- Comics
type: toggle_group
name: genre
prompt: 'Pick a genre (try the tabs):'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment