Add retool-import-lovable sibling skill#3
Draft
rsuresh-retool wants to merge 1 commit into
Draft
Conversation
Sibling skill that specializes the import flow for legacy-Vite Lovable projects (lovable-tagger or .lovable/ at repo root). Skips the generic vendor-agnostic discovery scan because Lovable's structure is known up front — Vite + react-router-dom + Supabase edge functions calling the connector-gateway proxy — and pre-fills IMPORT_PLAN.md from structural facts. Targeted HITL: one prompt per Supabase edge function (mapping the connector-gateway service to a Retool resource) and one combined prompt per migrations directory. Generic retool-import skill gains a Phase 0 source-tool detection step that delegates to this sibling via the Skill tool when Lovable signals are present. Phase 0 is structural (signal files only) — Phases 1-4 of the generic skill remain strictly vendor-agnostic. TanStack Start Lovable projects (post-April 2026 format) are explicitly out of scope and the skill refuses them with a clear message.
justinpchen94
approved these changes
May 20, 2026
justinpchen94
left a comment
There was a problem hiding this comment.
2/3 of these comments are kind of in jest but without personal expertise on lovable, this all tracks
| @@ -0,0 +1,364 @@ | |||
| --- | |||
| 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 an R^2 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 R^2 sandbox agent via the `retool_submit_prepared_import` MCP tool. | |||
|
|
||
| ## Why this exists | ||
|
|
||
| The generic `retool-import` skill is vendor-agnostic by design: it runs a closed-taxonomy discovery scan against an arbitrary React repo. That works for any source tool, but it's wasted work for projects with predictable structure. A legacy-Vite Lovable project ALWAYS has: |
There was a problem hiding this comment.
what is "legacy-Vite" in this case?
|
|
||
| ## Scope | ||
|
|
||
| This skill handles **legacy Vite Lovable projects** only. Lovable began emitting TanStack Start projects (with `@tanstack/react-start`, `src/app/__root.tsx`, file-based routing, SSR) around April 2026. Those projects have a different entry shape and routing model and are NOT supported here. See [TanStack guard](#tanstack-guard) below for the refuse behavior. |
There was a problem hiding this comment.
ah i see now nvm. does this add a wrinkle to our ability to say "we support importing lovable apps"?
| (it just won't pre-fill from Lovable structural knowledge). | ||
| ``` | ||
|
|
||
| Do NOT attempt a best-effort import on TanStack projects. |
There was a problem hiding this comment.
we should find a good opportunity to give instructions on where to redirect a user if they attempt an unsupported app type
| | `src/components/ui/*.tsx` | shadcn primitives | DROP — R2 has these baked at `/frontend/lib/shadcn/` | | ||
| | `src/hooks/use-toast.ts`, `src/hooks/use-mobile.tsx` | shadcn hook duplicates | DROP — R2 baked | | ||
| | `src/hooks/<other>.{ts,tsx}` | user hooks | PORT to `/frontend/hooks/` | | ||
| | `src/lib/utils.ts` | `cn()` helper | DROP — R2 baked has it | |
| - "Resource matching is currently name + type only; host metadata isn't yet surfaced by `retool_list_resources`." | ||
| - For every `USE_MOCK_DATA` resolution: "<service name> is mocked during import; wire to a real resource later." | ||
| - If Supabase Auth was detected and resolved to MAP_TO_RETOOL_SESSION: "R2 will attempt a best-effort substitution of `useAuth()` / `supabase.auth.*` calls with `useCurrentUser()`. Some code paths may require manual review." | ||
| - If any RLS policies were detected in the migrations: "RLS policies in the original schema are NOT translated. R2 will apply at the application layer if you specify per-row permissions; otherwise the Retool resource's access controls apply." |
| - For every `USE_MOCK_DATA` resolution: "<service name> is mocked during import; wire to a real resource later." | ||
| - If Supabase Auth was detected and resolved to MAP_TO_RETOOL_SESSION: "R2 will attempt a best-effort substitution of `useAuth()` / `supabase.auth.*` calls with `useCurrentUser()`. Some code paths may require manual review." | ||
| - If any RLS policies were detected in the migrations: "RLS policies in the original schema are NOT translated. R2 will apply at the application layer if you specify per-row permissions; otherwise the Retool resource's access controls apply." | ||
| - If any edge function's category was `unknown`: "<function name> couldn't be classified from the gateway URL or imports. R2 will need to determine the right backend-function shape." |
| - If any RLS policies were detected in the migrations: "RLS policies in the original schema are NOT translated. R2 will apply at the application layer if you specify per-row permissions; otherwise the Retool resource's access controls apply." | ||
| - If any edge function's category was `unknown`: "<function name> couldn't be classified from the gateway URL or imports. R2 will need to determine the right backend-function shape." | ||
|
|
||
| **Phased build order** — leave the `<!-- TODO: R2 fills this in -->` marker. R2 derives this in Phase M. |
|
|
||
| ## Summary for the user | ||
|
|
||
| This skill imports a legacy-Vite Lovable + Supabase project into Retool as an R^2 app. It skips the generic vendor-agnostic discovery scan because Lovable's structure is well-known: it pre-fills the import plan from structural facts, asks one HITL prompt per Supabase edge function (mapping each to a Retool resource) plus one combined prompt per migration directory, packages your source tree with secrets and vendor-specific configs stripped, and hands the prepared plan to Retool's R^2 sandbox agent. You'll get an editor URL when R^2 finishes generating the app. |
| | --------------- | ----------- | ------------- | | ||
| | `lovable-tagger` in `devDependencies` OR `.lovable/` directory exists at repo root | Lovable (legacy Vite) | `retool-import:retool-import-lovable` | | ||
|
|
||
| (Future entries — v0, Replit, Bolt — land here as their specializations ship.) |
There was a problem hiding this comment.
do we want to encode these names into the skill?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plugins/retool-import/skills/retool-import-lovable/SKILL.md— a sibling skill that specializes the R^2 import flow for legacy-Vite Lovable projects (Vite + React + react-router-dom + Supabase + Lovable connector-gateway).retool-importSKILL.md. On positive match it delegates to the sibling via the Skill tool and stops; on no match the existing vendor-agnostic flow continues unchanged.Why
The generic
retool-importskill is vendor-agnostic by design — its Phase 2 discovery scan classifies external services into a closed taxonomy regardless of source tool. That works on any React app, but it's wasted work for projects with predictable shape. A legacy-Vite Lovable project ALWAYS has the same backbone:src/main.tsx→src/App.tsx,react-router-dom, shadcn primitives,supabase/functions/*edge functions callingconnector-gateway.lovable.dev/<service>, andsupabase/migrations/*.sql. Specializing lets us skip discovery, pre-fill the IMPORT_PLAN.md from structural facts, and ask HITL only for the choices that genuinely need a human (which Retool resource backs each Supabase function / schema).What's in the Lovable sibling skill
connector-gateway.lovable.dev/<service>URLs, infers category (e.g.linear→http_api,aws_s3→object_storage), callsretool_list_resourceswith the compatible-types filter, presents top-3 candidates.CREATE TABLEstatements, picks one Retool Postgres resource. Migrations are NOT auto-applied; surfaced as an open question.supabase.auth.*calls are found.references/filter-constants.tsplus Lovable-specific drops (vite.config.ts,components.json,src/components/ui/,.lovable/,lovable-tagger-loading configs, etc.).references/IMPORT_PLAN.template.md, with theclasscolumn in the Source → target mapping table left blank (R2 fills it in Phase M classification).What's in the generic skill update
Phase 0 — Source-tool detectionsection between Prerequisites and Phase 1.Out of scope (deferred)
Test plan
lovable-taggerin devDependencies → delegates..lovable/directory → delegates.@tanstack/react-startin deps → refuses with clear message.supabase/functions/<name>/and surface the gateway service.vite.config.ts,components.json,src/components/ui/,.lovable/, etc.<plan_state>status=prepared_by_mcp</plan_state>and pre-populated rows in Source → target mapping with blankclass.retool_submit_prepared_importis called and the editor URL is surfaced.Stacked on
rohansuresh/retool-import-skill(Add retool-import skill content)rohansuresh/plugin-marketplace-scaffold(Add plugin marketplace scaffold)