Full-stack pnpm + Turborepo monorepo skill, independent of the separate backend and frontend monorepo skills it draws on. Repository shape is split four ways at the top level: applications-backend, applications-frontend, packages-backend, packages-frontend — so a path states which runtime a file ends up in. Defaults: NestJS for backend services, React with IBM Carbon Design for browser applications; the project's stated architecture overrides both. Covers workspace globs, the Turborepo pipeline, filtered validation, blast-radius checks, Module Federation, turbo prune image builds, and Helm. Documents one sanctioned cross-boundary dependency: API contract types owned by the backend, imported type-only by the frontend. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
example-shared-package — @ca/example-utils
Complete minimal shared TypeScript package for a pnpm + Turborepo monorepo. Copy it as the starting point for a new package and rename the scope to match your repository.
It goes under packages-backend/ or packages-frontend/ depending on who consumes
it — the root matches the consumers, never the author. See references/packages.md §1.
The package itself is environment-neutral: no Node built-ins, no DOM APIs. That is what makes
it a safe template for either root. Adding fs, path, or crypto makes it backend-only;
adding DOM APIs makes it frontend-only.
Structure
packages-backend/example-utils/ # or packages-frontend/example-utils/
├── .eslintrc.cjs
├── package.json
├── tsconfig.json
└── src/
├── index.ts # Public barrel — re-exports types and utils
├── types.ts # Shared TypeScript types
└── example-utils.ts # Utility functions
Key conventions
"type": "module"with ESM output underdist/.exportsmaps the package root todist/index.jsanddist/index.d.ts.tsconfig.jsonextends the sharedtypescript-configpreset — onlyoutDirandrootDirare local..eslintrc.cjsextends the sharedeslint-configpreset.- Internal imports carry the
.jsextension — required for ESM TypeScript. files: ["dist"]keeps sources out of the published payload.- Workspace dependencies use
workspace:*. src/index.tsis the entire public API; nothing else is importable by consumers.- Script names (
build,check-types,lint) match the tasks inturbo.json, or Turborepo skips the workspace silently.
Contract packages
A package that shares API types across the front/back boundary is a variant of this template:
name it <domain>-contracts, place it under packages-backend/, export types only, and
keep it free of runtime dependencies. Frontend consumers import it with import type.
Validation commands
pnpm check-types --filter="@ca/example-utils"
pnpm lint --filter="@ca/example-utils"
pnpm build --filter="@ca/example-utils"