← ClaudeAtlas

monorepo-sync-typeslisted

Regenerate backend types and re-export them via packages/shared/types/ in a turborepo monorepo so both apps/web/ and apps/mobile/ consume a single typed surface. Supports Supabase (via supabase gen types typescript), neon-drizzle (via drizzle-kit introspect/pull + InferSelectModel/InferInsertModel re-exports — the default DB stack), tRPC (via inference from the server router import), and custom REST (via a manual or zod-derived schema). Reads .workflow/meta.json with stack.framework="monorepo" and stack.{auth,db} populated. Use when "rigenera i tipi da Supabase", "sync DB schema to packages/shared/types", "il backend è cambiato, aggiorna i tipi", "sync types from tRPC", "sync Drizzle types after a schema change". Not for: creating shared packages from scratch (use monorepo-add-shared-package), wiring the backend client itself (use module-add or rn-module-add).
lukedj78/dev-flow · ★ 4 · API & Backend · score 77
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/`