monorepo-sync-typeslisted
Install: claude install-skill lukedj78/dev-flow
# monorepo-sync-types — regenerate + propagate backend types across the monorepo
## Contract
See `references/contracts.md` (vendored from `dev-flow`). Key facts:
- Reads `<project-root>/.workflow/meta.json#stack.framework` — must be `"monorepo"`.
- Reads `meta.json#stack.db` and `stack.auth` to determine the source of truth:
- `"supabase"` → run `supabase gen types typescript` against the linked project.
- `"neon-drizzle"` → introspect/pull via `drizzle-kit` and re-export `InferSelectModel`/`InferInsertModel` from the Drizzle schema (this is the default DB for most projects — see `module-add/references/module-db.md`).
- `"trpc"` → re-import the server router type and re-export it.
- `"firebase"` → no auto-gen, but normalize fixed types from Firestore rules (limited).
- `"custom-rest"` → ask the user where the schema lives (Zod / OpenAPI / TS source).
- Writes generated types into `packages/shared/src/types/` (NOT into `packages/api/`, because `packages/shared` is consumed by BOTH apps including for non-backend code).
- Idempotent: regenerating overwrites; no-diff prints "already in sync".
- Does NOT modify `phase`.
## When this skill applies
- User says: "rigenera i tipi", "sync DB schema", "supabase types update", "the backend changed, update types".
- Orchestrator does NOT route here automatically — invoked on demand (e.g., after a backend migration).
## Knowledge dependencies
- `monorepo-bootstrap/references/structure.md` — for `packages/shared/src/types/`