Skip to main content
rule CX Codex

composition · devin-axis — Claude Code rule: what it does, how to install

Enforces component composition patterns: wraps list items in groups, requires modal titles for accessibility, and swaps custom divs for UI primitives.

LicenseRef-Proprietary ★ 7,523 updated 2026-10-29

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

What composition does

The rule guides coding agents through strict UI composition patterns. Dropdown and menu elements such as SelectItem or CommandItem must live inside their corresponding group wrappers like SelectGroup or CommandGroup. Similarly, TabsTrigger requires a TabsList parent, and Avatar must include an AvatarFallback element.

It explicitly stops the agent from guessing non-existent isLoading or isPending flags on buttons. Loading indicators must use a nested Spinner paired with the standard disabled attribute. Overlay components like Dialog, Sheet, and Drawer strictly require a title element, relying on sr-only classes when hidden visually.

Without a Radix-style UI library and sonner present in the project, the generated imports and markup will break your build.

What it helps with

  • stop agents from adding imaginary loading props to buttons
  • enforce accessible title elements on dialogs and sheets
  • nest dropdown and select items inside proper group parents
  • replace raw divider lines and custom badges with design system primitives

Example prompts for the agent

  • Build an account settings modal using the Dialog component
  • Create a team member overview card with header and footer actions
  • Set up a project category filter using Select

How to install composition

Manually: put the files in place

.claude/rules/composition.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 composition

How do I install composition in Claude Code?

Save the rule file to .claude/rules/composition.md in your repository root.

What does the composition rule do?

It stops the model from writing malformed UI hierarchies, enforcing group wrappers, proper card sections, and accessible dialog headers.

How does this rule handle pending states on buttons?

It disables the button and embeds a Spinner component with data-icon="inline-start" instead of passing boolean loading flags.

Similar IDE rules

All IDE rules for Frontend and UI →

composition by other authors comes first.

composition maxtrigify The composition rule for Claude Code guides the breakdown of complex UI components into small, focused parts. It serves when building component libraries or flexible interfaces. CX Codex +1 ★ 141repo stars animated-component-libraries freshtechbro animated-component-libraries helps AI coding agents integrate pre-built animated React components from Magic UI and React Bits. Useful for building landing pages and dashboards without writing custom motion scripts. CX Codex +1 3,200installs json-render-shadcn vercel-labs json-render-shadcn is a Claude Code skill that adds ready-made shadcn/ui components to json-render catalogs and web UIs. It activates for work with @json-render/shadcn. CX Codex +1 257installs ask-sonner emilkowalski ask-sonner — a skill for Claude Code that assists with configuring Sonner notifications in React projects. It answers questions about integration, styling, and troubleshooting toast rendering issues. CX Codex +1 191,600installs islandcn opencoredev islandcn — a Claude Code skill that integrates an open-source Dynamic Island into React apps. Triggers when building top-of-screen status pills, timers, or live activity feeds. CX Codex +1 ★ 836repo stars ui-styling claudekit ui-styling — a skill that helps your agent build accessible interfaces with shadcn/ui and Tailwind CSS: components, themes, dark mode, responsive layouts and canvas design. CX Codex +1 52,100installs shadcn-ui giuseppe-trisciuoglio Tells the agent how to install and configure shadcn/ui components: buttons, dialogs, tables, and forms with React Hook Form and Zod. CX Codex +1 22,800installs

From the same set42

The whole set →
voiceover The voiceover skill writes the demo narration before any code exists, then carries the feature through to a pull request with frame-by-frame proof attached. Useful when the team should agree on what a viewer sees first. CX Codex +1 ★ 7,523repo stars image-generation image-generation generates image assets through the iPolloWork service for slide decks and web pages. Operates directly in chat without opening Image Studio. CX Codex +1 ★ 7,523repo stars ipollowork-template-generation The ipollowork-template-generation skill builds and revises reusable iPolloWork templates for design, presentations, editable PPT, and HyperFrames Video. Use it to validate and save template packages. CX Codex +1 ★ 7,523repo stars styling Rule for consistent React component styling: semantic color tokens instead of raw Tailwind values, built-in component variants, conditional classes via cn(). Prevents improper Tailwind usage and ensures light and dark theme support. CX Codex +1 ★ 7,523repo stars forms This rule standardizes form structure, input groups, option sets, and validation states. Use it when building interfaces with several kinds of controls. CX Codex +1 ★ 7,523repo stars agent-first-screenshots The agent-first-screenshots agent drives the live app over CDP and keeps a frame only after structural, pixel and vision checks pass. Built for landing pages, newsletters and decks. CX Codex +1 ★ 7,523repo stars create-plugin create-plugin scaffolds TypeScript plugins for iPolloWork and OpenCode. Sets up tool definitions, runtime hooks, and registers the file in your project configuration. CX Codex +1 ★ 7,523repo stars daytona-dev daytona-dev — a skill for Claude Code and Codex that sets up a Daytona cloud sandbox running an XFCE/noVNC desktop. The iPolloWork Electron app becomes accessible through the browser at port 6080. CX Codex +1 ★ 7,523repo stars

Project sponsors

Companies that keep this analytics open