migrate-app-to-flows
MUST be used when migrating a legacy Dune app to the new Flows app hosting infrastructure. Orchestrates the full migration: audits current state, updates app.json to appsApi infra, delegates auth wiring to setup-flows-auth, creates or updates manifest.json network permissions, and updates deploy scr
By cognitedata · 1,663 installs
npx skills add cognitedata/builder-skills --skill migrate-app-to-flows
Source repository · Upstream listing
Migrate App to Flows Infrastructure
Orchestrates the full migration of a legacy Dune app to the new Flows app hosting ( appsApi ). Works through each area in order, skipping any already in the correct state.
Step 1 — Audit current state
Read app.json , package.json , vite.config.ts , and manifest.json (if present).
Report a concise summary before making any changes:
Then proceed through Steps 2–5.
Step 2 — Update app.json
If infra is already "appsApi" , skip this step. Otherwise:
Fix legacy deployment key format first. Many POC apps use "deployment" (singular, plain object). The CLI requires "deployments" (plural, array). If the file has the old format, rename the key and wrap the value in an array before proceeding:
Then add "infra": "appsApi" :
Step 3 — Set up Flows auth
Run the setup flows auth skill now. It handles everything auth related: package installation, Vite plugin updates, entry file changes, and wiring up connectToHostApp .
Step 4 — Create or update manifest.json
The Flows host uses manifest.json to enforce a Content Security Policy for the app. It must exist at the repo root.
Create if missing:
Populate network permissions by scanning for outbound calls to external domains:
For each group of external URLs found, add an entry to the network array using the sources / directives shape:
Rules:
Use full origin (scheme + hostname) in sources , not just the hostname.
"connect src" covers fetch / XMLHttpRequest . Use "img src" for image URLs, "font src" for fonts.
The CDF cluster URL is allowed automatically; do not list it.
If no external calls exist, leave "network": [] .
Flag any dynamic URLs the user needs to verify manually.
Step 5 — Update deploy scripts
Replace any dune deploy or npx @cognite/dune commands in package.json :
Keep all other scripts ( start , build , test , etc.) unchanged.
Step 6 — Final check
List any remaining hits for the user to resolve. Then report:
Then tell the user exactly what to do next: