ring:applying-composition-patterns

A set of React component design patterns for replacing many behavior-controlling boolean props with composition and shared state. React is a JavaScript library for building user interfaces.

In plain words
What is it for?
Refactoring complex React components, designing reusable component libraries, using compound components, and separating state management from presentation.
Why use it?
It makes flexible components easier to maintain when conditional branches, render props, or boolean options begin multiplying.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lerianstudio/ring/applying-composition-patterns
Any agent
npx skills add LerianStudio/ring --skill applying-composition-patterns
Clone the repo
git clone --depth 1 https://github.com/LerianStudio/ring

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,393 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.05393
Opus 5 $0.00034 $0.02697
Sonnet 5 $0.00014 $0.01079
Haiku 4.5 $0.00007 $0.00539

Measured 2d ago against content hash 65b9dbc40214, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ring:applying-composition-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

dev-team/skills/applying-composition-patterns/SKILL.md · 946 lines

How it starts

The opening of the file, as written. The whole thing — 946 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Applying Composition Patterns

When to use

  • Refactoring components with boolean prop proliferation
  • Building flexible, reusable component libraries
  • Architecture review of React component hierarchies
  • Component has grown to 3+ boolean props controlling behavior
  • Multiple render props or conditional rendering branches

Skip when

  • Simple components with 1-2 props and no conditional rendering
  • Non-React code
  • Prototype or throwaway code where flexibility doesn't matter
  • Component is leaf-level with no composition concerns

Complementary: ring:checking-frontend-quality — validate component quality after refactoring


Abstract

Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.


Table of Contents

  1. Component ArchitectureHIGH
  2. State ManagementMEDIUM
  3. Implementation PatternsMEDIUM
  4. React 19 APIsMEDIUM

1. Component Architecture

Impact: HIGH

Fundamental patterns for structuring components to avoid prop proliferation and enable flexible composition.

Read the full file on GitHub · 946 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 946 lines · 68 tokens per session scan A 65b9dbc40214

Subscribe to this mod's changes

ring:applying-composition-patterns is a skill published in the GitHub repository LerianStudio/ring (210 stars, last pushed 13d ago), licensed Apache-2.0. It adds 68 tokens to every session and 5,393 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API ( component, addTransitionType, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components…

zhukunpenglinyutong/desktop-cc-gui · 127 tokens

recipe-front-review

Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.

shinpr/claude-code-workflows · 29 tokens

typescript-rules

React/TypeScript frontend development rules including type safety, component design, state management, and error handling. Use when implementing React components, TypeScript code, or frontend features.

shinpr/claude-code-workflows · 39 tokens

nextjs-idioms

Next.js App Router, RSC, Server Actions, ISR. For React see react-idioms. For TypeScript see typescript-idioms.

irahardianto/awesome-agv · 37 tokens

t-init

Initialize a full-stack project skeleton with Rust backend (Axum + SeaORM + Redis) and React frontend (TypeScript + TanStack + Tailwind).

timzaak/web-dev-skills · 34 tokens

state-management

React Query and Zustand patterns for state management. Use when implementing data fetching, caching, mutations, or client-side state. Triggers on tasks involving useQuery, useMutation, Zustand stores, caching, or state management.

AsyrafHussin/agent-skills · 47 tokens