Monorepo Rules

    by mochalatte

    1

    Audit and optimize Turborepo and pnpm workspaces to fix cache misses, break cycles, and speed up CI.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLI+17 more

    See it in action

    You say

    Our build takes 15 minutes because every change rebuilds everything. We use Turbo and pnpm. I think there is a cycle between the 'auth' and 'api-client' packages.

    Your agent does

    Graph

    Applications depend on auth and api-client. auth and api-client import each other.

    Findings

    1. packages/auth - Dependency rule 1. Circular dependency with api-client prevents independent caching.
    2. turbo.json - Task rule 1. Missing caret in dependsOn causes stale builds.

    Change plan

    1. Extract shared types to packages/core.
    2. Update auth and api-client to import from core.
    3. Add caret to build dependsOn in turbo.json.

    Cache impact

    Breaking the cycle allows Turbo to hash these packages separately. Rebuilds will drop by ~60%.

    What you get

    Debug and fix Turborepo cache misses by auditing inputs and env keys.Resolve circular dependencies by planning package extractions.Optimize CI pipelines to build only affected workspace packages.Enforce strict package boundaries to prevent dependency leaking.

    About this skill

    The problem

    Monorepos often collapse under their own weight when package boundaries blur and dependency cycles emerge. You end up with 20-minute CI pipelines for one-line changes because the build tool cannot determine what is actually affected.

    What it does

    • Enforces package boundaries by detecting relative imports that bypass the workspace graph.
    • Audits turbo.json task pipelines to fix cache misses caused by missing inputs, outputs, or undeclared env variables.
    • Identifies and breaks circular dependencies that prevent independent package builds and caching.
    • Generates step-by-step plans for cross-package refactors and codemods to move symbols without breaking importers.
    • Optimizes CI configurations to correctly detect affected packages using merge-base comparisons.

    Frameworks & tools

    Designed for Turborepo and pnpm workspaces. Works with TypeScript, Next.js, and ESLint.

    Why this beats prompting it yourself

    Standard LLMs often suggest relative path fixes that compile but break monorepo isolation. This skill uses a strict trigger matrix to prioritize architectural integrity, like breaking cycles before fixing cache issues, ensuring your workspace remains scalable.

    Use cases

    • Fixing a "cache never hits" issue in Turborepo by auditing environment variables.
    • Extracting shared logic into a new workspace package without breaking the build.
    • Reducing CI times by implementing merge-base filtering for affected packages.
    • Mapping out a dependency graph to find and resolve complex circular imports.

    Known limitations

    Does not execute turbo commands, publish packages, or modify CI secrets. It provides configuration edits and CLI commands for the user to run manually.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Frequently Asked Questions

    Popular in DevOps & Deployment