Skip to main content
rule CX Codex

imports-design-system-folder — Claude Code rule: what it does

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.

AGPL-3.0 ★ 88 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/imports-design-system-folder.md
Open on GitHub

What imports-design-system-folder does

The rule requires UI components to be re-exported from a designated design system folder instead of being pulled straight from packages like react-native. Application screens import strictly from internal paths.

Components start as plain re-exports or thin wrappers where Pick limits exposed props. Later adjustments happen inside that central folder without touching call sites across the codebase.

What it helps with

  • block direct external UI library imports across application screens
  • isolate UI package dependencies inside a design system directory
  • narrow component props down with Pick utility types
  • swap UI component packages without altering screen imports

Example prompts for the agent

  • Create a button wrapper in the design system folder re-exporting from @ui/button
  • Check the profile screen for direct react-native imports and redirect them to @/components

How to install imports-design-system-folder

Manually: put the files in place

.claude/rules/imports-design-system-folder.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 imports-design-system-folder

How to install imports-design-system-folder in Claude Code?

Save the rule content to .claude/rules/imports-design-system-folder.md in your repository root.

What does imports-design-system-folder do?

It instructs the agent to route all component imports through an internal design system directory instead of pulling directly from third-party packages.

Why use Pick on component props?

Narrowing down accepted properties keeps component interfaces minimal, preventing external library details from leaking across the project.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set47

The whole set →
monorepo-single-dependency-versions 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. 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 ui-pressable ui-pressable is a Claude Code rule for choosing touch components in React Native. It applies when an agent adds or edits buttons and list items. CX Codex +1 ★ 88repo stars ui-safe-area-scroll ui-safe-area-scroll is a Claude Code rule that enforces native iOS safe area handling in React Native ScrollViews. It stops layout jumping during keyboard transitions. CX Codex +1 ★ 88repo stars design-system-compound-components design-system-compound-components is a Claude Code rule that forbids raw string children in non-text components. It enforces compound structures like ButtonText and ButtonIcon across the design system. CX Codex +1 ★ 88repo stars ui-expo-image ui-expo-image is a Claude Code rule that swaps React Native's default Image for expo-image. It guides code generation toward blurhash placeholders, disk caching, and list recycling. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open