- Home
- Skills
- DevOps & Cloud
- JS TypeScript Monorepo Setup with Turborepo Nx and pnpm
Works with the AI Agents you already use
JS TypeScript Monorepo Setup with Turborepo Nx and pnpm
Set up or merge JS/TS repos into a pnpm workspace monorepo with Turborepo or Nx, affected-only CI and per-app Docker builds. Verdict HEALTHY / FRICTION / TANGLED.
$5
JS TypeScript Monorepo Setup with Turborepo Nx and pnpm
Example session with this skill installed
Merge our three repos (web: Next.js, api: Express, ui: shared React components) into one pnpm monorepo and keep their git history. Should we use Turborepo or Nx? We deploy web as a Docker image and use GitHub Actions.
- Read your context and instructions
- Compiled the js typescript monorepo
Monorepo report: acme (convert)
Verdict: FRICTION. Merged and building in graph order, but web and api pin different React/zod versions and CI has no remote cache yet.
Runner: Turborepo, because you have 3 packages driven by package.json scripts and want CI caching with little config; you did not ask for generators or boundary rules.
Layout
| Package | Type | Depends on |
|---|---|---|
| apps/web (Next.js) | app | @acme/ui |
| apps/api (Express) | app | @acme/ui (types only) |
| packages/ui | compiled (tsc to dist) | none |
ui is compiled, not just-in-time, because api runs on Node without a bundler.
Files written or changed
pnpm-workspace.yaml: packagesapps/*,packages/*; catalog fortypescript,zod,react(versions taken from the existing lockfiles)turbo.json:tasksfor build, check-types, lint, test, devpackages/tsconfig/{base,nextjs,node-lib}.json: each package nowextendsone.github/workflows/ci.yml: full-history checkout, pnpm store cache,--affectedapps/web/Dockerfile:turbo prune web --dockermulti-stage build
Pipeline
{
"$schema": "https://turborepo.dev/schema.json",
"tasks": {
"build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"], "env": ["NEXT_PUBLIC_API_URL"] },
"check-types": { "dependsOn": ["^check-types"] },
"test": { "dependsOn": ["^build"], "outputs": ["coverage/**"] },
"dev": { "cache": false, "persistent": true }
}
}
History migration (run on fresh clones only)
git clone ../web web-rewrite && cd web-rewrite
git filter-repo --to-subdirectory-filter apps/web --tag-rename '':'web-'
cd ../acme && git remote add web ../web-rewrite && git fetch web
git merge --allow-unrelated-histories web/main && git remote remove web
Verification
| Command | Result |
|---|---|
| pnpm install --frozen-lockfile | not run (paste output to confirm) |
| pnpm turbo run build (x2) | not run |
| pnpm turbo run build --affected --dry | not run |
Issues and fixes (priority order)
webuses zod 3.x,apiuses zod 4.x: pick one in the catalog; checkapicall sites first.- Add
TURBO_TOKEN/TURBO_TEAMas CI secrets for remote cache. - Remove the three old lockfiles only after the new install passes.
Assumed (please confirm)
- Default branch is
mainin all three repos.
Connects securely to your tools. The creator never sees your data.
About this skill
Monorepo setups often go wrong in the same places: build order that only works by luck, cache hits that restore nothing because outputs are missing, CI that rebuilds every package on every pull request, Docker images that copy the whole repo, and merged repos that lose their git history. This skill gives your coding agent a checked procedure for creating, converting or auditing a JavaScript/TypeScript monorepo.
What it does:
- Takes stock of the repo first: package.json files, lockfiles, tsconfigs, lint configs, CI files and duplicate dependency versions
- Helps you pick no task runner, Turborepo or Nx using a stated rule, and explains the choice
- Writes pnpm-workspace.yaml with catalogs for shared versions, workspace: dependencies and exports maps
- Chooses just-in-time or compiled internal packages and sets up shared tsconfig, ESLint or Biome and Prettier configs
- Writes turbo.json using the tasks key, or nx.json with targetDefaults and namedInputs
- Adds changesets only if packages are published
- Writes CI that runs only affected packages, with full-history checkout and caching
- Builds a single app image with turbo prune --docker or pnpm deploy
- Merges repos with git filter-repo or git subtree on fresh clones, and never force-pushes over the original repos
- Ends with a HEALTHY, FRICTION or TANGLED verdict and a table of verification results
Who it's for: developers and tech leads starting a monorepo, merging several repos into one, or fixing a slow or flaky workspace.
Honesty note: the facts in the reference file were checked against turborepo.dev, nx.dev, pnpm.io, the changesets docs and the git-filter-repo README in October 2026. The skill does not invent versions or timings, and it marks any command it could not run as "not run".
Built for JavaScript/TypeScript workspaces. It writes configs and commands but cannot run them without terminal access; results it could not run are marked as such. Version-specific behavior (pnpm deploy, Turborepo flags, Nx options) was checked in October 2026 and should be re-checked against current docs for newer releases.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 29 days ago
Requires