← ClaudeAtlas

monorepo-add-shared-packagelisted

Extract logic from apps/web/ or apps/mobile/ into a new or existing shared package under packages/ in a turborepo monorepo, OR create a fresh empty shared package skeleton. Reads .workflow/meta.json with stack.framework="monorepo". Adds the package to pnpm-workspace.yaml (already covered by the wildcard), updates tsconfig.base.json path aliases, registers as workspace:* in both apps. Use to "estrai questa logica in shared", "spostala in packages/shared", "create a shared @<slug>/foo package", "factor X out of the apps". Not for: scaffolding the whole monorepo (use monorepo-bootstrap), backend modules (use module-add or rn-module-add — they install into packages/api/ automatically), generating types from a backend schema (use monorepo-sync-types).
lukedj78/dev-flow · ★ 4 · AI & Automation · score 77
Install: claude install-skill lukedj78/dev-flow
# monorepo-add-shared-package — factor shared logic into packages/ ## Contract See `references/contracts.md` (vendored from `dev-flow`). Key facts: - Reads `<project-root>/.workflow/meta.json#stack.framework` — must be `"monorepo"`. - Requires `meta.json#phase ≥ "scaffolded"`. - Adds entries to: - `tsconfig.base.json#paths` (new alias `@<slug>/<pkg-name>/*`) - `apps/web/package.json#dependencies` AND `apps/mobile/package.json#dependencies` (as `workspace:*`) - `meta.json#stack_config.shared_packages` array - Does NOT modify `phase`. ## When this skill applies - User says: "estrai questa logica in shared", "create a shared @<slug>/foo package", "spostala in packages/shared", "factor X out of the apps". - Orchestrator does NOT route here automatically — invoked on demand. ## Knowledge dependencies - `monorepo-bootstrap/references/structure.md` — for the canonical layout. - `monorepo-bootstrap/references/patterns.md` — for the workspace protocol + import conventions. ## Workflow ### Step 1 — Verify preconditions Read `.workflow/meta.json`. Abort with clear message if: - `stack.framework != "monorepo"` → "This skill is monorepo-only. For non-monorepo projects use plain TS path aliases inside the app." - `phase < "scaffolded"` → "Need at least scaffolded — run monorepo-bootstrap first." Read `meta.json#project_slug` for the namespace. ### Step 2 — Determine the package name Ask the user (one round-trip): > "Package name (without namespace)? E.g. 'shared', 'desig