skill-monorepo-architect
Skill0 starsChanged 3 months agoMITView on GitHub
Expert polyglot and domain-driven monorepo architecture guidance (Python UV workspaces, PNPM workspaces, Turborepo). Use when initializing, structuring, refactoring, or managing monorepos, shared core libraries, dependency graphs, or cross-package build pipelines.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- core/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- avoid-ai-writingSkill
- c-cpp-systemsSkill
- doubt-driven-developmentSkill
- marketing-copywritingSkill
- mempalace-recallSkill
- mempalaceSkill
- mempalace-taskSkill
- retro-emulation-engineeringSkill
- seo-optimization-and-auditSkill
- skill-ai-mlSkill
- skill-backend-architectSkill
- skill-codebase-onboardingSkill
- skill-code-reviewSkill
- skill-context-engineeringSkill
- skill-creative-designSkill
- skill-data-analysisSkill
- skill-data-scienceSkill
- skill-design-engineeringSkill
- skill-devops-cloudSkill
- skill-emulator-wasmSkill
- skill-frontend-architectSkill
- skill-graph-analyticsSkill
- skill-graphics-webglSkill
- skill-low-level-programmingSkill
- skill-master-orchestratorSkill
- skill-mcp-builderSkill
- skill-osint-engineeringSkill
- skill-plugin-architectureSkill
- skill-qa-engineerSkill
- skill-researchSkill
- skill-resume-tailorSkill
- skill-stealth-scrapingSkill
- skill-system-diagnosticsSkill
- skill-web-architectureSkill
- skill-web-performanceSkill
- spec-driven-developmentSkill
- spec-minerSkill
- wasm-emscriptenSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Every large system or toolkit MUST be designed around a standalone core domain library before introducing network layers (APIs) or user …
- Very specific: line 86
Use modern uv workspace declarations in root pyproject.toml:
- Distinctive: line 148
When creating a new monorepo from scratch, follow this exact sequence:
- Very specific: line 151
Create root configuration files (pyproject.toml, pnpm-workspace.yaml).
- Distinctive: line 154
Write immutable schemas (Pydantic models) and domain exceptions.
- Distinctive: line 155
Write unit tests for core logic (TDD).
- Distinctive: line 158
Verify terminal execution end-to-end without Docker.
- Distinctive: line 170
Before approving or committing monorepo changes:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Monorepo Architect Skill
This skill defines deterministic standards and architectural blueprints for building scalable, high-performance, polyglot monorepos without dependency chaos, premature microservices overhead, or circular imports.
1. Core Philosophy: The Shared-Core-First Pattern
Every large system or toolkit MUST be designed around a standalone core domain library before introducing network layers (APIs) or user interfaces (Web/Desktop):
┌─────────────────────────────────────────┐
│ packages/core (Pure Domain) │
│ - Domain Models (Pydantic / Zod) │
│ - Orchestrator Engine │
│ - Storage Interfaces & Business Logic │
└────────────────────┬────────────────────┘
│ (Direct Import / Zero Network Hop)
┌───────────────────────────────┼───────────────────────────────┐
▼ ▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐
│ apps/cli │ │ packages/plugins │ │ apps/api │
│ - Instant Terminal UX │ │ - Extensible Toolkits │ │ - REST / WebSockets │
│ - No Docker Required │ │ - Implements BasePlugin│ │ - Exposes Core over Net│
└─────────────────────────┘ └─────────────────────────┘ └────────────┬────────────┘
│ (HTTP/WS)
▼
┌─────────────────────────┐
│ apps/web │
│ - Nuxt / Next.js UI │
└─────────────────────────┘Invariants:
- CLI Never Requires Running Containers: The CLI directly imports
packages/coreand runs locally. It stores state in SQLite or JSON files. - API is a Thin Adapter:
apps/apisimply wrapspackages/corein HTTP/WebSocket handlers. It introduces NO business logic that cannot be called from the CLI. - No Circular Package Dependencies: Dependencies flow strictly downward:
apps/->packages/plugins->packages/core.
2. Polyglot Workspace Layout
A standard polyglot monorepo (Python + TypeScript) follows this root structure:
my-monorepo/
├── pyproject.toml # UV Workspace Root configuration
├── uv.lock # Universal Python lockfile
├── pnpm-workspace.yaml # PNPM Workspace configuration (if TS present)
├── package.json # Root JS/TS scripts
├── turbo.json # Turborepo task pipeline (build, test, lint)
├── Makefile / task.sh # Global developer ergonomics
│
├── packages/
│ ├── core/ # Shared domain engine (Python package)
│ │ ├── pyproject.toml
│ │ └── src/core/
│ ├── plugins/ # Modular extensions & tool runners
│ │ ├── pyproject.toml
│ │ └── src/plugins/
│ └── ui/ # Shared web components (if TS present)
│ ├── package.json
│ └── src/
│
└── apps/
├── cli/ # CLI executable app (Typer/Click)
│ ├── pyproject.toml
│ └── src/cli/
├── api/ # Server backend (FastAPI/Express)
│ ├── pyproject.toml
│ └── src/api/
└── web/ # Frontend client (Nuxt/Next/Vite)
├── package.json
└── src/3. Python Workspaces via uv
Use modern uv workspace declarations in root pyproject.toml:
[tool.uv.workspace]
members = ["packages/*", "apps/cli", "apps/api"]
[tool.uv.sources]
core = { workspace = true }
plugins = { workspace = true }
[project]
name = "monorepo-root"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = []Package Inter-Dependency Example (apps/cli/pyproject.toml):
[project]
name = "cli"
version = "0.1.0"
dependencies = [
"core",
"plugins",
"typer>=0.9.0",
"rich>=13.0.0",
]4. TypeScript Workspaces via pnpm + turborepo
pnpm-workspace.yaml:
packages:
- 'packages/*'
- 'apps/web'turbo.json:
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", ".output/**"]
},
"test": {
"dependsOn": ["^build"]
},
"lint": {}
}
}5. Greenfield Step-by-Step Monorepo Construction
When creating a new monorepo from scratch, follow this exact sequence:
- Step 1: Workspace Skeleton & Manifests
- Create root configuration files (
pyproject.toml,pnpm-workspace.yaml). - Define exact Python and Node version gates.
- Create root configuration files (
- Step 2: Core Domain Modeling (
packages/core)- Write immutable schemas (Pydantic models) and domain exceptions.
- Write unit tests for core logic (TDD).
- Step 3: Standalone CLI (
apps/cli)- Implement CLI commands importing
core. - Verify terminal execution end-to-end without Docker.
- Implement CLI commands importing
- Step 4: Plugins & Tool Runners (
packages/plugins)- Implement standard
BasePlugininterfaces.
- Implement standard
- Step 5: API Layer (
apps/api)- Expose core operations over REST / SSE / WebSockets.
- Step 6: Web Dashboard (
apps/web)- Connect frontend to API.
6. Monorepo Quality Gates
Before approving or committing monorepo changes:
- Root dependencies run synchronously across all workspaces (
uv sync/pnpm install). - No package imports code from sibling packages without a formal workspace dependency declared.
- CLI runs standalone without external daemon requirements.
- All unit and integration test suites pass (
pytest,vitest).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

