From b3d7b8a858ecf835052d0766ff8b87b2ccfc76fd Mon Sep 17 00:00:00 2001 From: Rohan Suresh Date: Wed, 3 Jun 2026 16:11:36 -0400 Subject: [PATCH] Document start/finalize two-step import handoff in skills --- .../skills/retool-import-lovable/SKILL.md | 36 ++++++++++--------- .../skills/retool-import/SKILL.md | 36 ++++++++++--------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/plugins/retool-import/skills/retool-import-lovable/SKILL.md b/plugins/retool-import/skills/retool-import-lovable/SKILL.md index d6a9d57..26f24ad 100644 --- a/plugins/retool-import/skills/retool-import-lovable/SKILL.md +++ b/plugins/retool-import/skills/retool-import-lovable/SKILL.md @@ -1,6 +1,6 @@ --- name: retool-import-lovable -description: Use this skill when the user wants to import a Lovable-generated React app (legacy Vite + Supabase) into Retool as a Retool React app. Detected by `lovable-tagger` in package.json or a `.lovable/` directory at the repo root. The skill skips vendor-agnostic discovery because Lovable's structure (Vite + react-router-dom + Supabase edge functions calling Lovable's connector gateway) is known up front; it pre-fills the import plan from structural facts, asks targeted HITL only for the choices that genuinely need a human (which Retool resource backs each Supabase edge function and migration), and hands a prepared import plan to Retool's React app sandbox agent via the `retool_submit_prepared_import` MCP tool. +description: Use this skill when the user wants to import a Lovable-generated React app (legacy Vite + Supabase) into Retool as a Retool React app. Detected by `lovable-tagger` in package.json or a `.lovable/` directory at the repo root. The skill skips vendor-agnostic discovery because Lovable's structure (Vite + react-router-dom + Supabase edge functions calling Lovable's connector gateway) is known up front; it pre-fills the import plan from structural facts, asks targeted HITL only for the choices that genuinely need a human (which Retool resource backs each Supabase edge function and migration), and hands a prepared import plan to Retool's React app sandbox agent via the two-step `retool_start_prepared_import` / `retool_finalize_prepared_import` MCP flow, falling back to the inline `retool_submit_prepared_import` tool only if that flow errors. --- # retool-import-lovable @@ -36,7 +36,7 @@ The skill runs these steps sequentially. Each has a fixed input, a fixed output, 3. Pre-fill — populate the structural facts table from the known Lovable layout (no discovery scan). 4. Targeted HITL — one prompt per Supabase edge function, one combined prompt per migration directory, one prompt for Supabase Auth if used. 5. Produce artifacts — cleaned source tree (shared filter + Lovable-specific drops) plus pre-populated IMPORT_PLAN.md. -6. Handoff — call `retool_submit_prepared_import` with the cleaned tree and plan. +6. Handoff — `retool_start_prepared_import` with the plan, PUT a zip of the cleaned tree to the returned upload URL, then `retool_finalize_prepared_import` — falling back to inline `retool_submit_prepared_import` only if a step errors. Do NOT skip steps. Do NOT pause for user input outside step 4. @@ -45,7 +45,7 @@ Do NOT skip steps. Do NOT pause for user input outside step 4. Same as the generic skill. Verify and stop with a clear error if either fails: 1. **React repo.** Read `package.json` at the repo root. The `dependencies` (or `devDependencies`) must include `react`. If not, stop and tell the user this skill targets React apps. -2. **Required MCP tools.** `retool_list_resources` and `retool_submit_prepared_import` must both be visible. If `retool_submit_prepared_import` is missing, stop with: "The retool-import-lovable skill requires `retool_submit_prepared_import`, which is gated by the `mcpServerRetoolImportEnabled` flag. Ask your Retool admin to enable that flag for your org." +2. **Required MCP tools.** `retool_list_resources` plus the import tools gated by the `mcpServerRetoolImportEnabled` flag. The preferred handoff uses `retool_start_prepared_import` + `retool_finalize_prepared_import`; if those aren't visible but `retool_submit_prepared_import` is, the skill uses the inline submit instead (see [Handoff](#6-handoff)). If none of the import tools are visible, stop with: "The retool-import-lovable skill requires the Retool import tools, gated by the `mcpServerRetoolImportEnabled` flag. Ask your Retool admin to enable that flag for your org." ## 2. Lovable signal validation @@ -79,7 +79,7 @@ Retool agent attempt the transformation itself — no structural pre-fill, no guided resource mapping. Reply "import anyway" to try, or stop here. ``` -If the user replies "import anyway": skip steps 3–4. Produce the cleaned source tree using the SHARED zip filter only (step 5a, *without* the Lovable-specific drops — those assume the legacy-Vite layout), then call `retool_submit_prepared_import` (step 6) with that tree and a minimal IMPORT_PLAN.md whose Overview states the import is unprepared and the Retool agent owns all transformation. Otherwise, stop. +If the user replies "import anyway": skip steps 3–4. Produce the cleaned source tree using the SHARED zip filter only (step 5a, *without* the Lovable-specific drops — those assume the legacy-Vite layout), then run the step 6 handoff (preferred two-step flow, inline submit as fallback) with that tree and a minimal IMPORT_PLAN.md whose Overview states the import is unprepared and the Retool agent owns all transformation. Otherwise, stop. ## 3. Pre-fill from structural facts @@ -261,7 +261,7 @@ In addition to the shared filter, drop these Lovable-specific paths (always): Stop and warn the user if the file count exceeds 5,000 or the aggregate size exceeds 50 MiB. Surface the offending paths and ask how to proceed. -Build a `Record` keyed by repo-relative path. This is the `files` payload for `retool_submit_prepared_import`. +Build a `Record` keyed by repo-relative path. This is the cleaned source tree — zipped and uploaded in the preferred two-step handoff, or passed as the inline `files` payload in the submit fallback (step 6). ### 5b. IMPORT_PLAN.md @@ -337,23 +337,27 @@ Above the table, place `