Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    JS TypeScript Monorepo Setup with Turborepo Nx and pnpm

    1

    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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    JS TypeScript Monorepo Setup with Turborepo Nx and pnpm

    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

    PackageTypeDepends on
    apps/web (Next.js)app@acme/ui
    apps/api (Express)app@acme/ui (types only)
    packages/uicompiled (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: packages apps/*, packages/*; catalog for typescript, zod, react (versions taken from the existing lockfiles)
    • turbo.json: tasks for build, check-types, lint, test, dev
    • packages/tsconfig/{base,nextjs,node-lib}.json: each package now extends one
    • .github/workflows/ci.yml: full-history checkout, pnpm store cache, --affected
    • apps/web/Dockerfile: turbo prune web --docker multi-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

    CommandResult
    pnpm install --frozen-lockfilenot run (paste output to confirm)
    pnpm turbo run build (x2)not run
    pnpm turbo run build --affected --drynot run

    Issues and fixes (priority order)

    1. web uses zod 3.x, api uses zod 4.x: pick one in the catalog; check api call sites first.
    2. Add TURBO_TOKEN / TURBO_TEAM as CI secrets for remote cache.
    3. Remove the three old lockfiles only after the new install passes.

    Assumed (please confirm)

    • Default branch is main in all three repos.
    Turborepo, because you have 3 packages driven by package.json

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Git
    Node.js
    pnpm or npm or Yarn or Bun

    Permissions

    Terminal / Shell
    Write Files
    Listed29 days ago

    What's inside

    Frequently Asked Questions

    A SKILL.md with the step-by-step procedure, the rule for choosing a task runner, verdict rules, an output template and a checklist, plus references/monorepo-facts.md with checked facts on Turborepo, pnpm workspaces, catalogs and deploy, Nx, changesets and git filter-repo, with source links.

    Any agent that reads the SKILL.md format, such as Claude Code, Codex CLI, Cursor, VS Code Copilot and Gemini CLI.

    Unzip the folder into your agent's skills directory (for example .claude/skills/ for Claude Code), then ask for a monorepo setup, conversion or audit in your repo.

    It covers JavaScript/TypeScript workspaces with pnpm, npm, yarn or bun plus Turborepo or Nx. It does not cover Bazel, Rush or polyglot build systems. Tool versions change fast, so it checks current docs when web access is available.

    It follows a fixed order (take stock, choose runner, layout, pipeline, CI, Docker, migration, verify), uses facts checked against official docs, such as the tasks key, the shallow-clone affected behavior and pnpm deploy version rules, and reports real command results or marks them not run.

    The skill decides from your repo. Turborepo suits teams that mainly want cached builds and affected-only CI driven by package.json scripts. Nx suits larger repos that need a project graph, generators or module-boundary rules. Very small repos may need neither, just pnpm workspaces.

    New in DevOps & Cloud