Monorepo Management

Software development skill, available on Zeplik

Monorepo Management is a ready-to-run software development skill on Zeplik. Not for authoring CI pipelines themselves (use github-actions-templates). Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer.

The Monorepo Management skill loads automatically when your request matches it, or you can invoke it directly by typing /monorepo-management in any chat. It works with attachments, connectors, and any model that supports the task, so you get the same expert method every time without setting anything up.

What the Monorepo Management skill can do

Try these prompts on Zeplik

Pick a prompt to open it in the Zeplik app. If you are not signed in yet, your prompt is waiting for you the moment you do.

How the Monorepo Management skill works

/monorepo-management

Build efficient, scalable monorepos that enable code sharing, consistent tooling, and atomic changes across packages and apps. The user pastes their package.json, turbo.json, workspace layout, or error output; deliver corrected configs, package structures, and migration plans as chat artifacts. For writing the CI workflows that run in the monorepo, use github-actions-templates.

When to Use

  • Setting up new monorepo projects
  • Migrating from multi-repo to monorepo
  • Optimizing build and test performance
  • Managing shared dependencies
  • Implementing code sharing strategies
  • Versioning and publishing packages
  • Debugging monorepo-specific issues

Core Concepts

1. Why Monorepos?

Advantages: shared code and dependencies, atomic commits across projects, consistent tooling, easier refactoring, better code visibility.

Challenges: build performance at scale, CI/CD complexity, access control, large Git repository.

2. Monorepo Tools

Package Managers: pnpm workspaces (recommended), npm workspaces, Yarn workspaces.

Build Systems: Turborepo (recommended for most), Nx (feature-rich, complex), Lerna (older, maintenance mode).

Turborepo Setup

Initial Setup

# Create new monorepo
npx create-turbo@latest my-monorepo
cd my-monorepo

# Structure:
# apps/
#   web/          - Next.js app
#   docs/         - Documentation site
# packages/
#   ui/           - Shared UI components
#   config/       - Shared configurations
#   tsconfig/     - Shared TypeScript configs
# turbo.json      - Turborepo configuration
# package.json    - Root package.json

Configuration

// turbo.json
{
  "$schema": "https://turbo.build/schema.json",
  "globalDependencies": ["**/.env.*local"],
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**", "!.next/cache/**"]
    },
    "test": {
      "dependsOn": ["build"],
      "outputs": ["coverage/**"]
    },
    "lint": {
      "outputs": []
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "type-check": {
      "dependsOn": ["^build"],
      "outputs": []
    }
  }
}
// package.json (root)
{
  "name": "my-monorepo",
  "private": true,
  "workspaces": ["apps/*", "packages/*"],
  "scripts": {
    "build": "turbo run build",
    "dev": "turbo run dev",
    "test": "turbo run test",
    "lint": "turbo run lint",
    "format": "prettier --write \"**/*.{ts,tsx,md}\"",
    "clean": "turbo run clean && rm -rf node_modules"
  },
  "devDependencies": {
    "turbo": "^1.10.0",
    "prettier": "^3.0.0",
    "typescript": "^5.0.0"
  },
  "packageManager": "[email protected]"
}

Package Structure

// packages/ui/package.json
{
  "name": "@repo/ui",
  "version": "0.0.0",
  "private": true,
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "import": "./dist/index.js",
      "types": "./dist/index.d.ts"
    },
    "./button": {
      "import": "./dist/button.js",
      "types": "./dist/button.d.ts"
    }
  },
  "scripts": {
    "build": "tsup src/index.ts --format esm,cjs --dts",
    "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
    "lint": "eslint src/",
    "type-check": "tsc --noEmit"
  },
  "devDependencies": {
    "@repo/tsconfig": "workspace:*",
    "tsup": "^7.0.0",
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "react": "^18.2.0"
  }
}

Best Practices

  1. Consistent Versioning: Lock dependency versions across workspace
  2. Shared Configs: Centralize ESLint, TypeScript, Prettier configs
  3. Dependency Graph: Keep it acyclic, avoid circular dependencies
  4. Cache Effectively: Configure inputs/outputs correctly
  5. Type Safety: Share types between frontend/backend
  6. Testing Strategy: Unit tests in packages, E2E in apps
  7. Release Strategy: Use changesets for versioning

Common Pitfalls

  • Circular Dependencies: A depends on B, B depends on A
  • Phantom Dependencies: Using deps not in package.json
  • Incorrect Cache Inputs: Missing files in Turborepo inputs
  • Over-Sharing: Sharing code that should be separate
  • Under-Sharing: Duplicating code across packages
  • Large Monorepos: Without proper tooling, builds slow down

Publishing Packages

# Using Changesets
pnpm add -Dw @changesets/cli
pnpm changeset init

# Create changeset
pnpm changeset

# Version packages
pnpm changeset version

# Publish
pnpm changeset publish
# .github/workflows/release.yml
- name: Create Release Pull Request or Publish
  uses: changesets/action@v1
  with:
    publish: pnpm release
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Detailed Patterns and Worked Examples

Nx setup, remote caching, CI strategies for affected-only builds, and dependency graph tooling live in references/details.md. Read that file when the navigation tier above is insufficient.

Usage

/monorepo-management $ARGUMENTS

How to use the Monorepo Management skill

  1. Sign in to Zeplik

    Create a free Zeplik account or sign in. New accounts start with free credits, so you can try the Monorepo Management skill right away.

  2. Describe your software development task

    Ask in plain language, or type /monorepo-management to invoke the skill directly. Zeplik recognizes the Monorepo Management skill and applies its method.

  3. Review and refine the result

    Zeplik returns a clear, structured answer. Ask follow-ups in the same chat to refine it or take the next step.

Source and credit

Author
wshobson
License
MIT

Adapted from the open-source wshobson/agents project and tuned to run natively on Zeplik. View source on GitHub.

Frequently asked questions

What is the Monorepo Management skill?
Monorepo Management is a ready-to-run software development skill on Zeplik. Not for authoring CI pipelines themselves (use github-actions-templates). Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer.
How do I use Monorepo Management on Zeplik?
Sign in to Zeplik and ask in plain language, or type /monorepo-management in any chat to invoke it directly. The skill applies its method and returns a result you can refine in the same conversation.
Which AI model does the Monorepo Management skill use?
Any model you choose. Zeplik works across every model in one chat, so the Monorepo Management skill runs on your preferred model for the task.
Where does the Monorepo Management skill come from?
The Monorepo Management skill is adapted from the open-source wshobson/agents project (MIT) and tuned to run natively on Zeplik. The original source is linked on this page.
How much does the Monorepo Management skill cost?
Using the skill is free to start. You only spend Zeplik credits when the assistant runs, and new accounts begin with free credits.

Related software development skills

More on Zeplik

Try Monorepo Management on Zeplik

Every model, one chat. Bring the Monorepo Management skill into your next conversation and let the assistant do the work.

Browse all skills
Monorepo Management - Software development skill for Zeplik AI | Zeplik Chat