Override id if needed: override val id: String = "custom_id". Default: fully qualified class name.
Initial Step
Set isInitial = true on exactly one step. That step runs when the wizard starts.
Related Skills
build-wizard-flow — Full wizard flow overview
add-wizard-handler — Configure @WizardHandler (trigger, scope, state managers)
Reference
WizardStep.kt
WizardActivity.kt
TestWizard.kt
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: vendelieu-telegram-bot-add-wizard-step3description: Add Wizard Step4---56# Add Wizard Step78## Structure910Extend `WizardStep`. Override `onEntry` (required) and optionally `validate`, `store`, `onRetry`.1112```kotlin13object NameStep : WizardStep(isInitial = true) {14 override suspend fun onEntry(ctx: WizardContext) {15 message("What's your name?").send(ctx.user, ctx.bot)16 }17 override suspend fun validate(ctx: WizardContext): Transition {18 val text = (ctx.update as? MessageUpdate)?.message?.text ?: return Transition.Retry()19 return if (text.isNotBlank()) Transition.Next else Transition.Retry("Invalid")20 }21 override suspend fun store(ctx: WizardContext): String? =22 (ctx.update as? MessageUpdate)?.message?.text23}24```2526## Lifecycle Methods2728| Method | Required | Purpose |29|--------|----------|---------|30| `onEntry(ctx)` | Yes | Called when entering step. Send prompts, set keyboards. |31| `validate(ctx)` | No | Return `Transition` based on input. Default: `Transition.Next` |32| `store(ctx)` | No | Return value to persist. Type must match a state manager. Default: `null` |33| `onRetry(ctx, reason)` | No | Called when validation returns `Transition.Retry`. Default: no-op |3435## Transitions3637| Transition | Effect |38|------------|--------|39| `Transition.Next` | Move to next step in sequence |40| `Transition.JumpTo(Step::class)` | Jump to specific step |41| `Transition.Retry()` or `Transition.Retry("reason")` | Stay on step; `onRetry` is called |42| `Transition.Finish` | End wizard |4344## WizardContext4546- `ctx.user`, `ctx.update`, `ctx.bot`47- `ctx.getState(Step::class)`, `ctx.setState(Step::class, value)`, `ctx.delState(Step::class)` — KSP generates type-safe accessors per step4849## Step ID5051Override `id` if needed: `override val id: String = "custom_id"`. Default: fully qualified class name.5253## Initial Step5455Set `isInitial = true` on exactly one step. That step runs when the wizard starts.5657## Related Skills5859- **build-wizard-flow** — Full wizard flow overview60- **add-wizard-handler** — Configure @WizardHandler (trigger, scope, state managers)6162## Reference6364- [WizardStep.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/chain/WizardStep.kt)65- [WizardActivity.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/chain/WizardActivity.kt)66- [TestWizard.kt](telegram-bot/src/jvmTest/kotlin/eu/vendeli/fixtures/TestWizard.kt)6768---69> Converted and distributed by [TomeVault](https://tomevault.io/claim/vendelieu) — claim your Tome and manage your conversions.70<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/vendelieu-telegram-bot-add-wizard-step in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Add Wizard Step It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.