Monorepo taste — Claude & Claude.ai prompt: monorepo rules
A prompt that hands the agent a fixed set of monorepo conventions: pnpm workspaces, Turborepo, package boundaries and shared configs. Useful when repo structure keeps drifting.
Open on GitHubWhat Monorepo taste does
This is a list of opinions from a platform engineer about how a monorepo should look. Every line carries a confidence score, from 0.95 for pnpm workspaces with a single lockfile at the root down to 0.70 for TypeScript project references. Handing that list to an agent settles the arguments in advance: where the lockfile lives, how packages are named, what belongs in the root package.json.
Twenty rules in total. Deployable apps sit in apps/, shared libraries in packages/. Internal packages are referenced with the workspace:* protocol and named under one npm scope such as @acme/. Turborepo orchestrates tasks with remote caching in CI, and CI runs only for packages touched by the change via turbo --filter with a git range. syncpack keeps one version of each external dependency, Changesets handles versioning and publishing of public packages.
Boundaries are part of the deal. Deep imports between packages are forbidden, only the declared exports map is allowed, and a lint rule stops apps from importing other apps. Circular dependencies get checked in CI. Node.js and pnpm versions are pinned with .nvmrc and the packageManager field. Nothing here installs itself — it is chat text, so it works exactly as far as the agent follows your instructions.
What it helps with
- give the agent one consistent monorepo style
- sort apps and libraries into apps/ and packages/
- run CI only for packages affected by a change
- keep one version of each external dependency across the repo
- block deep imports between packages
Example prompts for the agent
- Scaffold a monorepo following Monorepo taste: pnpm workspaces, apps/ and packages/
- Review our turbo.json and CI — do tasks run only for affected packages?
- Set up syncpack and CODEOWNERS the way the monorepo rules describe
How to install Monorepo taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Monorepo taste
How do I install Monorepo taste in Claude?
There is no install command — it is a prompt, so you paste it as the first message or put it in custom instructions. A dedicated chat for monorepo work keeps it handy.
What does Monorepo taste do?
It gives the agent a set of monorepo conventions: pnpm workspaces with one lockfile, Turborepo, a single npm scope for internal packages, a shared tsconfig and dependency boundary checks.
What do the confidence scores mean?
They show how strongly the author holds each rule: 0.95 for pnpm workspaces, 0.70 for TypeScript project references. That tells the agent where it can bend a rule and where it should not.
Source text
prompts.csv · CC0-1.0
# Monorepo taste of a platform engineer - Use pnpm workspaces with a single lockfile at the repository root. Confidence: 0.95 - Put deployable apps in apps/ and shared libraries in packages/. Confidence: 0.90 - Orchestrate tasks with Turborepo and enable remote caching in CI. Confidence: 0.85 - Reference internal packages with the workspace:* protocol. Confidence: 0.90 - Scope every internal package name under one npm scope such as @acme/. Confidence: 0.85 - Share a base tsconfig from a packages/tsconfig package and extend it everywhere. Confidence: 0.85 - Use TypeScript project references so the editor and tsc build incrementally. Confidence: 0.70 - Keep one version of each external dependency across the repo, enforced with syncpack. Confidence: 0.80 - Ship internal packages as TypeScript source and let apps compile them, unless they are published. Confidence: 0.75 - Version and publish public packages with Changesets. Confidence: 0.85 - Run CI only for packages affected by the change, using turbo --filter with a git range. Confidence: 0.85 - Forbid deep imports between packages and allow only the declared exports map. Confidence: 0.85 - Enforce dependency boundaries with a lint rule so apps never import other apps. Confidence: 0.90 - Keep the root package.json free of runtime dependencies. Confidence: 0.80 - Assign owners per directory with a CODEOWNERS file. Confidence: 0.80 - Pin the Node.js and pnpm versions with .nvmrc and the packageManager field. Confidence: 0.90 - Prefer one root lint and format config over a copy in every package. Confidence: 0.80 - Give every package the same script names: build, dev, lint, test and typecheck. Confidence: 0.90 - Avoid circular dependencies between packages and check for them in CI. Confidence: 0.85 - Split a package out only when a second consumer actually needs it. Confidence: 0.75
© f · CC0-1.0 · f/prompts.chat