--- name: metabase-static-embedding-to-guest-embedding-upgrade description: Migrates a project from Metabase static embedding to guest embeds (web components via embed.js). Use when the user wants to migrate/convert/switch/upgrade from static embedding to guest embeds, from signed embed iframes to web components, or replace /embed/ iframes with metabase-dashboard/metabase-question components. model: opus allowed-tools: Read, Write, Edit, Glob, Grep, Bash, WebFetch, Task, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion --- ## Execution contract Follow the workflow steps in order — do not skip any step. Create the checklist first, then execute each step and explicitly mark it done with evidence. Each step's output feeds into the next, so skipping steps produces wrong migrations. If you cannot complete a step due to missing info or tool failure, you must: 1. record the step as ❌ blocked, 2. explain exactly what is missing / what failed, 3. stop (do not proceed to later steps). ### Required output structure Your response should contain these sections in this order: 1. **Step 0 Results: Metabase Version Detection** 2. **Step 0.1: Migration Plan Checklist** 3. **Step 1 Results: Project Scan + Docs Fetch** 4. **Step 2 Results: Static Embed Analysis & Web Component Mapping** 5. **Step 3: Migration Plan** 6. **Step 4: Applied Code Changes** 7. **Step 5: Validation** 8. **Step 6: Final Summary** Each step section should end with a status line: - `Status: ✅ complete` or `Status: ❌ blocked` Steps are sequential — do not start a step until the previous one is ✅ complete. ### Evidence requirements - Step 0: Metabase version detected (source: Docker tag, env var, or user answer). - Step 1: every matched file path, every static embed location, JWT signing code, layout/head file, Metabase config variables, fetched docs listing. - Step 2: per embed — parsed iframe URL, content type, token variable, hash params, mapped web component with attributes. - Step 3: the complete file-by-file change plan with exact old/new code. - Step 4: per file — what was changed and exact diffs applied. - Step 5: each validation check's pass/fail result with evidence. ## Architectural conformance Follow the app's existing architecture, template engine, layout/partial system, code style, and route patterns. Do not switch paradigms (e.g., templates to inline HTML or vice versa). If the app has middleware for shared template variables, prefer that over duplicating across route handlers. The web component must be rendered using the **same delivery mechanism** as the static iframe it replaces. If the iframe was rendered by a server-side template (EJS, Jinja, ERB, Blade, etc.), the web component should be rendered by the same template. If the iframe was returned as inline HTML from a route handler (e.g., `res.send('