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.
npx agentmods add skills/lerianstudio/ring/applying-composition-patternsnpx skills add LerianStudio/ring --skill applying-composition-patternsgit clone --depth 1 https://github.com/LerianStudio/ringWhat 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.
| Model | Per session | Once 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 |
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.
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
Related
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
- Component Architecture — HIGH
- State Management — MEDIUM
- Implementation Patterns — MEDIUM
- React 19 APIs — MEDIUM
1. Component Architecture
Impact: HIGH
Fundamental patterns for structuring components to avoid prop proliferation and enable flexible composition.
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.
- 2d ago First seen · 946 lines · 68 tokens per session scan A 65b9dbc40214
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.
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…
recipe-front-review
Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.
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.
nextjs-idioms
Next.js App Router, RSC, Server Actions, ISR. For React see react-idioms. For TypeScript see typescript-idioms.
t-init
Initialize a full-stack project skeleton with Rust backend (Axum + SeaORM + Redis) and React frontend (TypeScript + TanStack + Tailwind).
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.