Package and install an app
Goal
Package a custom/apps/<slug>/ directory as an npm package and install it into a Spine project — files copied, apps row upserted, migrations run, seeds applied. Field-level manifest semantics are in App manifest reference and Seeds reference.
Steps
- Author
manifest.json. Required fields the installer validates:slug(must equal the directory name and match^[a-z][a-z0-9-]*$), plusname,route_prefix,renderer,min_role/required_roles,nav_items,config,registration. See App manifest reference for every field. Author seed files. The
seedblock is a list of{ file, table, conflict, inject_app_id?, ignore_duplicates?, permissions_patch? }entries, each pointing at a JSON file of rows (.framework/cli/commands/install-app.ts):conflict— theonConflictcolumn list for the upsert. Types useconflict: "kind,slug"withinject_app_id: false— types are global, not duplicated per install.inject_app_id— stampsapp_idon each seeded row (defaulttrue); setfalsefor global tables liketypes.ignore_duplicates—ignoreDuplicateson the upsert;typesrows always get it (.framework/cli/commands/install-app.ts).permissions_patch— a types-table entry that mergesrecord_permissionsinto existing design schemas instead of overwriting; ranks just aftertypesin apply order.- If no
seedarray is declared, the conventional filesseed/roles.json,seed/types.json,seed/link-types.jsonare used (.framework/cli/commands/install-app.ts). Seeds apply in dependency order —roles,types,link_types,actions,ai_agents,prompt_configs,pipelines,triggers— regardless of declaration order (.framework/cli/commands/install-app.ts). Pipeline seeds are validated againstpublic.actionsstage slugs, and trigger seeds resolvepipeline_slug→pipeline_id.
- Package it. Ship the app directory as an npm package — declare every shippable entry in
package.json'sfilesarray (npm packs nothing else). Includeindex.tsx,manifest.json, and optionallypages/,components/,hooks/,utils/,functions/,seed/,public/— the installer copies a fixed allowlist (APP_COPY_ENTRIESin.framework/cli/commands/install-app.ts: those dirs pluslib/,views/,docs/,api/,installer/,mcp/,migrations*,tests/,standalone.config.json,agent/).agent/is staged —agent/skills/lands atcustom/.devin/skills/(requiresmanifest.agent.skill_prefix) andagent/instructions/lands atcustom/apps/<slug>/src/instructions/; see App manifest reference. Validate locally withnpx spine-framework validate-app. Install.
npx spine-framework install-app <package>Flow:
npm install <package>→ resolve slug → copy files tocustom/apps/<slug>/(a reinstall preserves the localmanifest.json) →runMigrations→seedApp→ sync theregistrationblock intoapps.configandspine.config.json(.framework/cli/commands/install-app.ts). RequiresSUPABASE_URL+SUPABASE_DB_PASSWORD+SUPABASE_SERVICE_ROLE_KEY;--no-seedskips all DB work.Update paths.
update-app <package>—npm install @latest+ copy files + sync registration. It does not re-run migrations or seeds.update-db-app <slug>— upserts theappsrow from the localmanifest.jsonand syncs registration; no npm, no file changes.seed-app <slug>— re-runs just the seed block for a local app;--reconcile-owned-typesinteractively updatesmanifest.owned_typesslugs whose DBdesign_schemadrifted from the seed.
- Uninstall.
uninstall-app <package>removescustom/apps/<slug>/, removes the app's skills (custom/.devin/skills/<prefix>_*whenmanifest.agent.skill_prefixis declared), and runsnpm uninstall— and nothing else. The--keep-dataflag is parsed but never read: seeded rows are not deleted either way (.framework/cli/commands/install-app.ts).
Verify
npx spine-framework statuslists the installed app and version.GET /api/apps?action=get&slug=<slug>shows the upserted row;migrations statusshows migration state.- Seeded rows exist:
GET /api/types?action=list(or the seeded table's endpoint) includes the app's types/roles.
Common mistakes
- Types not global. Forgetting
inject_app_id: falseon a types seed injectsapp_idinto global type rows — andconflict: "kind,slug"means a second app with the same slug silently skips or errors on schema drift. Prefix slugs. - Expecting
uninstall --keep-datato matter — it is a no-op; seeded rows always survive uninstall. update-appdoesn't re-seed — new seed rows in the package never reach the DB; runseed-app <slug>orupdate-db-appafter.- Seed rows referencing unseeded slugs —
owned_types,pipeline_slug, andsend_notificationrecipients are validated fail-closed before any DB writes; fix the manifest, don't retry. SUPABASE_URLmust be a hostedhttps://<ref>.supabase.coURL — unlessSUPABASE_DB_URLis set, which carries the full connection itself (and enables localsupabase startstacks); without it the migrator derives the host fromSUPABASE_URLand rejects other shapes (.framework/cli/commands/migrate.ts).