Monorepo Architect logo

Monorepo Architect

Community
roedyrustam
monorepo-architect

Scalable monorepo architecture with Turborepo and pnpm workspaces / Arsitektur monorepo skalabel dengan Turborepo dan pnpm workspaces.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill namemonorepo-architect
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Monorepo Architect AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/monorepo-architect
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/monorepo-architect .claude/skills/monorepo-architect
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Monorepo Architect in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Monorepo Architect on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Monorepo Architect is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Monorepo Architect (Turborepo 2.x / Moon Edition)

English | Bahasa Indonesia


English

Orchestration & Integration

  • Upstream & Project Topology: zero-to-prod-orchestrator (Phase 2 project foundation), brainstorming, session-memory-manager.
  • AST & Codebase Intelligence: living-codebase-ast-graph (cross-package dependency topology & DAG sorting), typescript-expert (composite projects & isolated declarations).
  • CI/CD & Deployment: ci-cd-devops-architect (monorepo cache pipelines), github-actions-expert (matrix testing & sparse checkout), cloud-hosting-expert (multi-app deployments).
  • Shared Design & Components: design-system-architect (shared packages/ui tokens), senior-frontend / js-backend-expert (shared packages consumption), micro-frontend-architect (federated micro-apps), composable-mach-architect (composable multi-app packages), dependency-upgrade-migrator (monorepo-wide dependency upgrades).

Description

Expert guide for designing and managing scalable monorepos. Covers Turborepo 2.x (the 2026 standard for JS/TS monorepos), moon (polyglot task runner for teams mixing JS + Rust + Go), pnpm workspaces, shared package design, incremental builds, remote caching, and CI/CD pipeline optimization.

Trigger Conditions

  • Managing a codebase with multiple apps and shared packages.
  • Setting up a monorepo for a SaaS with separate web, admin, api, and packages.
  • Optimizing build and test times with remote caching.
  • Sharing TypeScript types, UI components, or utility functions across apps.
  • Migrating from a multi-repo setup to a monorepo.

Tool Selection Guide (2026)

ToolBest ForLanguage Agnostic
Turborepo 2.xJS/TS monorepos (Next.js, Vite, Node)❌ (JS focused)
moonPolyglot teams (JS + Go + Rust + Python)✅
NxEnterprise, Angular/React, plugin ecosystem❌ (JS focused)
BazelVery large orgs, hermetic builds✅

Turborepo 2.x — Standard JS Monorepo

Repository Structure
my-saas/
├── apps/
│   ├── web/          # Next.js 15 main app
│   ├── admin/        # Next.js 15 super admin (subdomain)
│   └── api/          # Hono/Fastify backend
├── packages/
│   ├── ui/           # Shared Tailwind v4 components
│   ├── db/           # Drizzle ORM schema + queries
│   ├── auth/         # Auth utilities (session, JWT)
│   ├── email/        # Email templates (React Email)
│   └── tsconfig/     # Shared TypeScript configs
├── turbo.json
├── pnpm-workspace.yaml
└── package.json
turbo.json (v2 Syntax)
json
{
  "$schema": "https://turbo.build/schema.json",
  "ui": "tui",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": [".next/**", "!.next/cache/**", "dist/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "test": {
      "dependsOn": ["^build"],
      "inputs": ["src/**", "test/**", "vitest.config.*"]
    },
    "lint": {
      "inputs": ["src/**", "*.config.*", ".eslintrc*"]
    },
    "typecheck": {
      "dependsOn": ["^build"]
    },
    "db:generate": {
      "cache": false
    }
  }
}
pnpm-workspace.yaml
yaml
packages:
  - "apps/*"
  - "packages/*"
Remote Caching (Vercel Remote Cache)
bash
# Authenticate with Vercel Remote Cache
npx turbo login
npx turbo link

# Or self-hosted with Turborepo Remote Cache
TURBO_TEAM=my-team TURBO_TOKEN=xxx turbo build
Shared UI Package (packages/ui)
json
// packages/ui/package.json
{
  "name": "@myapp/ui",
  "version": "0.0.0",
  "private": true,
  "exports": {
    "./button": {
      "import": "./src/button.tsx",
      "types": "./src/button.tsx"
    },
    "./card": {
      "import": "./src/card.tsx",
      "types": "./src/card.tsx"
    }
  },
  "peerDependencies": {
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  }
}
Internal Package Pattern (No Build Step)

Use "exports" pointing to source files directly — Turborepo compiles them as part of the consuming app:

json
// packages/db/package.json
{
  "name": "@myapp/db",
  "exports": {
    ".": {
      "import": "./src/index.ts",
      "types": "./src/index.ts"
    }
  },
  "devDependencies": {
    "drizzle-orm": "latest",
    "drizzle-kit": "latest"
  }
}

moon — Polyglot Task Runner

For teams mixing JavaScript, Go, Rust, and Python in one repo:

yaml
# .moon/workspace.yml
projects:
  - "apps/*"
  - "packages/*"
  - "services/*"   # Go/Rust microservices

vcs:
  manager: "git"
  defaultBranch: "main"
yaml
# apps/api/moon.yml (Go service)
language: "go"
type: "application"

tasks:
  build:
    command: "go build -o ./bin/api ./cmd/api"
    inputs: ["src/**/*.go", "go.mod"]
    outputs: ["bin/api"]
  test:
    command: "go test ./..."

CI/CD Optimization

yaml
# .github/workflows/ci.yml
- name: Build & Test (Turborepo)
  run: |
    npx turbo run build test lint typecheck \
      --filter="...[origin/main]" \  # Only changed packages
      --cache-dir=".turbo"
  env:
    TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
    TURBO_TEAM: ${{ vars.TURBO_TEAM }}

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec monorepo-architect <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

  • Hulu & Topologi Proyek: zero-to-prod-orchestrator (Pondasi proyek Fase 2), brainstorming, session-memory-manager.
  • AST & Inteligensi Basis Kode: living-codebase-ast-graph (topologi dependensi lintas paket & DAG sorting), typescript-expert (composite project & isolated declarations).
  • CI/CD & Deployment: ci-cd-devops-architect (pipeline cache monorepo), github-actions-expert (pengujian matriks & sparse checkout), cloud-hosting-expert (deployment multi-aplikasi).
  • Desain Bersama & Komponen: design-system-architect (token shared packages/ui), senior-frontend / js-backend-expert (konsumsi paket bersama).

Deskripsi

Panduan ahli untuk merancang dan mengelola monorepo yang skalabel. Mencakup Turborepo 2.x (standar 2026 untuk monorepo JS/TS), moon (task runner poliglot untuk tim yang memadukan JS + Rust + Go), pnpm workspaces, desain shared package, incremental build, remote caching, dan optimasi pipeline CI/CD.

Kondisi Pemicu

  • Mengelola codebase dengan banyak aplikasi dan shared package.
  • Menyiapkan monorepo untuk SaaS dengan web, admin, api, dan packages terpisah.
  • Mengoptimalkan waktu build dan test dengan remote caching.
  • Berbagi TypeScript types, komponen UI, atau utilitas antar aplikasi.
  • Migrasi dari multi-repo ke monorepo.

Panduan Pemilihan Tool (2026)

  • Turborepo 2.x: Standar untuk monorepo JS/TS — cepat, zero-config, remote cache bawaan.
  • moon: Untuk tim poliglot yang memadukan JS, Go, Rust, Python dalam satu repo.
  • Nx: Untuk enterprise dengan ekosistem plugin yang kaya.

Struktur Repositori

Pisahkan apps/ (aplikasi yang dapat di-deploy) dari packages/ (shared library internal):

  • apps/web — Next.js utama
  • apps/admin — Dashboard Super Admin (subdomain terpisah)
  • apps/api — Backend API
  • packages/ui — Komponen UI bersama (Tailwind v4)
  • packages/db — Skema Drizzle ORM + query
  • packages/auth — Utilitas auth

Turborepo 2.x — Sintaksis Baru

Turborepo 2.x memperkenalkan TUI interaktif ("ui": "tui"), sintaksis tasks yang lebih ekspresif, dan caching yang lebih granular dengan inputs/outputs.

Pola Internal Package (Tanpa Build Step)

Arahkan exports langsung ke file sumber TypeScript — Turborepo mengkompilasi sebagai bagian dari aplikasi yang mengonsumsinya. Ini menghilangkan kebutuhan langkah build terpisah untuk setiap package.

moon — Task Runner Poliglot

Moon mendukung proyek dalam bahasa yang berbeda (Go, Rust, JS) dalam satu workspace, masing-masing dengan konfigurasi moon.yml-nya sendiri.

Optimasi CI/CD

Gunakan flag --filter="...[origin/main]" Turborepo untuk hanya membangun dan menguji package yang berubah sejak commit terakhir. Gunakan remote cache Vercel atau self-hosted untuk berbagi cache antar runner CI.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec monorepo-architect <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Monorepo Architect AI skill do?

Scalable monorepo architecture with Turborepo and pnpm workspaces / Arsitektur monorepo skalabel dengan Turborepo dan pnpm workspaces.

Why use Monorepo Architect on TypingMind?

Because you install it once and use it with any model. Monorepo Architect is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Monorepo Architect in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/monorepo-architect. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Monorepo Architect?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Monorepo Architect?

As many as you like. As long as a model supports skills, you can use Monorepo Architect with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Monorepo Architect AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇