---
name: ironbee-sync-scenario
description: >
  Re-validate saved IronBee verification scenarios against the current code and repair MECHANICAL
  drift, by delegating to the ironbee-scenario custom agent (operation sync). Use when the user types
  `$ironbee-sync-scenario`. A leading `check` token = dry-run (report drift, no repair).
---

# IronBee — Sync scenario(s)

> **Delegate** — spawn the **`ironbee-scenario` custom agent** via `spawn_agent` with
> `agent_type="ironbee-scenario"` **and `fork_turns="none"`** (the default `fork_turns="all"` silently
> drops the agent_type → a generic toolless agent). The sub-agent owns the `scenario-*` tools.

Re-validate + repair saved verification **scenarios**. This is NOT a verification cycle.

## Steps
1. **Resolve the mode + target**: strip a leading `check` token (→ dry-run) and a leading `force` token
   (→ sync ALL scenarios, not just stale); remainder = `all` (stale ones; `force` = every one) or a
   name / description (one). Empty → `all`.
2. **Spawn** `spawn_agent` with `agent_type="ironbee-scenario"` and `fork_turns="none"`, passing in
   `message`:
   > Operation: sync
   > Target: \<`all`, or the name / description>
   > Force: \<include `Force: all` ONLY if the request began with `force`>
   > Mode: \<include `Mode: check` ONLY if the request began with `check`; otherwise OMIT>
   The sub-agent runs each target against the live app, classifies (still-fresh / mechanical drift →
   repair the SCRIPT only / real defect → STOP + report / expectation changed → ask), and on a
   non-check run stamps repaired scenarios current. **It repairs MECHANICS, never what a scenario
   verifies. Wait for the sub-agent in the same turn.**
3. **Relay** the summary (per scenario: repaired / still-fresh / defect-reported / needs decision).

(To just *detect* staleness without running anything, use `ironbee scenario status`.)
