development-monorepo-pnpm skill: initial import
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>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# development-monorepo-pnpm
|
||||
|
||||
Agent Skill for full-stack monorepos built on **pnpm workspaces** and **Turborepo**, where the
|
||||
front/back split is expressed in the top-level directory names:
|
||||
|
||||
```text
|
||||
applications-backend/ # deployable services — NestJS by default
|
||||
applications-frontend/ # deployable browser apps — React + IBM Carbon by default
|
||||
packages-backend/ # libraries consumed by services
|
||||
packages-frontend/ # libraries consumed by browser apps
|
||||
```
|
||||
|
||||
Framework defaults are defaults, not mandates — a project's stated architecture always wins.
|
||||
|
||||
The skill is self-contained: it covers both halves of the stack, from workspace globs and the
|
||||
Turborepo pipeline through to container images and Helm charts.
|
||||
|
||||
## Layout
|
||||
|
||||
```text
|
||||
development-monorepo-pnpm/
|
||||
├── SKILL.md # Entry point — repo shape, defaults, shared rules
|
||||
├── references/
|
||||
│ ├── applications-backend.md # NestJS layout, config, ports, health, service image
|
||||
│ ├── applications-frontend.md # React + Carbon, Module Federation, nginx image
|
||||
│ ├── packages.md # Which root, package tiers, public API, changesets
|
||||
│ ├── workspace-and-tooling.md # Globs, turbo.json, root scripts, overrides
|
||||
│ └── containers-and-helm.md # turbo prune images, charts, values, secrets
|
||||
└── assets/
|
||||
└── example-shared-package/ # Minimal shared TypeScript package
|
||||
```
|
||||
|
||||
## The rule worth knowing up front
|
||||
|
||||
Frontend workspaces must not import from `packages-backend/*` and vice versa — with one
|
||||
exception: **API contract types**. Contracts are owned by the service that defines them, so
|
||||
they live in `packages-backend/<domain>-contracts`, export types only, and are imported by
|
||||
frontend consumers with `import type`. A value import from the same package pulls server code
|
||||
into the browser bundle, and nothing in the build will flag it.
|
||||
|
||||
See [SKILL.md](SKILL.md).
|
||||
Reference in New Issue
Block a user