Skip to main content
rule CX Codex

monorepo-single-dependency-versions — Claude Code rule

monorepo-single-dependency-versions is a Claude Code rule that pins identical dependency versions across monorepo packages. It stops bundle bloat and runtime version clashes.

AGPL-3.0 ★ 88 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/monorepo-single-dependency-versions.md
Open on GitHub

What monorepo-single-dependency-versions does

The rule instructs the coding agent to drop semver ranges like ^ and ~ in favor of exact release numbers. Discrepancies between workspace packages duplicate library code inside distribution builds and cause runtime behavior conflicts.

Enforcing this policy relies on tools such as syncpack or root-level overrides in npm and pnpm, as well as resolutions in yarn. Without pinned root declarations, nested subpackages quickly drift out of alignment.

What it helps with

  • prevent duplicate packages in production bundles
  • pin exact dependency versions without semver ranges
  • align shared module versions across workspace packages
  • configure package manager overrides in root package.json

Example prompts for the agent

  • Add react-native-reanimated to packages/app and packages/ui with a single pinned version
  • Audit all package.json files and strip caret and tilde version prefixes
  • Set up root pnpm overrides to enforce uniform dependency releases

How to install monorepo-single-dependency-versions

Manually: put the files in place

.claude/rules/monorepo-single-dependency-versions.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about monorepo-single-dependency-versions

How to install monorepo-single-dependency-versions in Claude Code?

Place the rule file at .claude/rules/monorepo-single-dependency-versions.md in your project.

What does monorepo-single-dependency-versions do?

It guides the assistant to apply uniform, exact package versions across every workspace package, avoiding version ranges.

How does the rule resolve version conflicts?

It suggests checking versions with syncpack or adding root overrides and resolutions to package.json to lock a single version.

Similar IDE rules

All IDE rules for Code review and refactoring →

From the same set47

The whole set →
monorepo-native-deps-in-app monorepo-native-deps-in-app is a Claude Code rule that enforces adding native packages directly to the mobile app manifest. It prevents build failures caused by missed autolinking in monorepos. CX Codex +1 ★ 88repo stars react-compiler-reanimated-shared-values react-compiler-reanimated-shared-values is a Claude Code rule for handling Reanimated shared values with React Compiler enabled. It directs code to use .get() and .set() rather than .value. CX Codex +1 ★ 88repo stars react-compiler-destructure-functions react-compiler-destructure-functions is a Claude Code rule that enforces extracting hook functions early in render scope. It targets projects running the React Compiler. CX Codex +1 ★ 88repo stars ui-scrollview-content-inset ui-scrollview-content-inset is a Claude Code rule for changing ScrollView spacing when keyboards, toolbars, or content alter the available space. CX Codex +1 ★ 88repo stars animation-derived-value animation-derived-value is a Claude Code rule for computing one animated shared value from another. It applies to React Native Reanimated code that derives values. CX Codex +1 ★ 88repo stars fonts-config-plugin fonts-config-plugin is a Claude Code rule that embeds Expo fonts at build time. It directs the assistant to configure the expo-font plugin instead of runtime loaders. CX Codex +1 ★ 88repo stars list-performance-images list-performance-images is a Claude Code rule for loading appropriately sized images in lists. It applies when editing interfaces that display image thumbnails. CX Codex +1 ★ 88repo stars imports-design-system-folder imports-design-system-folder is a Claude Code rule that forbids importing UI packages directly into application code. All components must pass through a local design system directory. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open