---
name: loomi-scenario-blueprint
description: Generate manual Bloomreach Engagement scenario blueprints from approved segmentation recommendations. Use when the user approves one or more segments and wants a tailored scenario, journey, automation flow, lifecycle campaign, trigger/wait/condition/action design, measurement plan, or implementation checklist.
---

# Loomi Scenario Blueprint

Use this skill after the user approves one or more segment ideas.

## Workflow

1. Confirm the approved segment IDs or infer the top segment if the user says to continue.
2. Use `docs/agent-context/router.md` for scenario task loading.
3. Read relevant local context and supplied `projectContextJson`.
4. If working from a named existing scenario and Bloomreach CLI context exists, read the matching scenario card and selected raw `context/scenarios.json#<id>` only when exact node or payload detail is missing.
5. Build or update the task packet with exact IDs, loaded facts, scope, assumptions, and missing context.
6. Call `generate_scenario_from_segments`.
7. Present the scenario as a manual Bloomreach implementation blueprint.
8. Ask for feedback before generating final node content.

## Scenario Requirements

Every scenario blueprint must include:

- goal and selected segment logic
- trigger or scheduled entry
- eligibility gate
- consent and frequency checks
- suppression and recent-conversion exits
- contentgen API webhook for email structure and copy
- `webhook.available` and generated-cache checks
- `webhook.cache_key` storage in `customer.customer_variant`
- dynamic email send from the `aiagent` catalog
- waits and conversion re-checks
- content nodes with keys, channels, and purposes
- measurement plan
- manual implementation checklist

## Safety Rules

- Do not create or update Bloomreach assets directly.
- Keep the scenario inactive until QA is complete.
- Require exact project event names, property names, consent category IDs, and frequency policy IDs before launch.
- Avoid claiming uplift without a holdout, control group, or defensible baseline.

## Tool Input

Pass:

```json
{
  "segmentationSetJson": "<stringified segmentation recommendations>",
  "selectedSegmentIdsJson": "[\"segment-id\"]",
  "request": "Generate an email scenario",
  "projectContextJson": "{}",
  "teamContext": "",
  "industry": "ecommerce"
}
```
