composition-patterns

composition-patterns is a skill for Claude Code, Codex from clubpay/ronykit. It costs 58 tokens per session (1,766 once invoked), scanned A, original, BSD-3-Clause.

A guide for designing reusable React component interfaces through composition. Composition means combining small components instead of adding many mode-setting switches to one component.

In plain words
What is it for?
Use it when building component libraries, reviewing component architecture, or simplifying components with many mode or feature flags.
Why use it?
It prevents boolean props and conditional branches from multiplying into difficult-to-maintain combinations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building component libraries, reviewing component architecture, or simplifying components with many mode or feature flags.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clubpay/ronykit/composition-patterns
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.

Any agent
npx skills add clubpay/ronykit --skill composition-patterns
Clone the repo
git clone --depth 1 https://github.com/clubpay/ronykit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for composition-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/clubpay/ronykit/composition-patterns/github.svg)](https://agentmods.dev/skills/clubpay/ronykit/composition-patterns)
Your own site
<a href="https://agentmods.dev/skills/clubpay/ronykit/composition-patterns"><img src="https://agentmods.dev/badge/skills/clubpay/ronykit/composition-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for composition-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/clubpay/ronykit/composition-patterns"><img src="https://agentmods.dev/badge/skills/clubpay/ronykit/composition-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00058 $0.01766
Opus 5.5 $0.00023 $0.00706
Sonnet 5.5 $0.00012 $0.00353
Haiku 4.5 $0.00006 $0.00177

Measured 1mo ago against content hash 6d0919cf78fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 1mo 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.

ronyup/internal/skeleton/skills/composition-patterns/SKILL.md · 225 lines

How it starts

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

React Composition Patterns

Build components by composition, not configuration. As a component grows, the temptation is to add another boolean prop. Each one doubles the possible states and breeds conditional logic until the component is unmaintainable. Compose small pieces instead — explicit, self-documenting, and easy for both humans and agents to extend. Adapted from Vercel Engineering's composition-patterns (MIT).

When to use

  • A component is accumulating boolean/mode props (isThread, isEditing, isDM, showFooter…) or deeply nested conditional rendering.
  • Designing a reusable component or a component library API.
  • Reviewing component architecture for flexibility and maintainability.

This governs how you design your own components; shadcn governs using its components, and react-performance governs runtime speed. They don't overlap.

1. Avoid boolean-prop proliferation (the core rule)

Don't customize behavior with boolean flags — each flag multiplies states and creates impossible combinations. Split into composed pieces instead.

// Avoid: every new mode adds a flag and a branch
<Composer isThread isEditing={false} channelId="abc" showFormatting />

// Prefer: explicit composition, no conditionals to reason about
<Composer.Frame>
  <Composer.Input />
  <AlsoSendToChannelField id={channelId} />
  <Composer.Footer>
    <Composer.Formatting />
    <Composer.Submit />
  </Composer.Footer>
</Composer.Frame>

2. Compound components with a shared context

Structure a complex component as a set of subcomponents that read shared state from context — not from props drilled through a monolithic parent. Consumers compose only the pieces they need.

const ComposerContext = createContext<ComposerContextValue | null>(null);

function ComposerInput() {
  const { state, actions, meta } = use(ComposerContext);
  return (
    <TextInput
      ref={meta.inputRef}
      value={state.input}
      onChangeText={(t) => actions.update((s) => ({ ...s, input: t }))}
    />
  );
}

// Export the pieces as one namespaced object
const Composer = {
  Provider: ComposerProvider,
  Frame: ComposerFrame,
  Input: ComposerInput,
  Footer: ComposerFooter,
  Submit: ComposerSubmit,
};

Read the full file on GitHub · 225 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. 1mo ago First seen · 225 lines · 58 tokens per session scan A 6d0919cf78fa

Subscribe to this mod's changes

composition-patterns is a skill published in the GitHub repository clubpay/ronykit (38 stars, last pushed today), licensed BSD-3-Clause. It adds 58 tokens to every session and 1,766 once invoked, about $0.0002 per session on Opus 5.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

procedure

Vovk.ts procedures in depth (base already has a complete endpoint, validation, errors and status codes) — atomic unit of server-side logic in Vovk project. Use whenever user asks to build ANYTHING producing or consuming data on server — page loading data ("users page", "dashboard", "product list"), endpoint, API…

finom/vovk · 354 tokens

tools

Building LLM tools with Vovk.ts — deriveTools() (procedures → tools) returning a StandardToolV0[] array, standalone tools via the standard-tool package, @operation.tool({ name, title, description, hidden, meta }) decorator, x-tool metadata, ToModelOutput formatters (DEFAULT, MCP, RAW), the merged inputSchema, the meta…

finom/vovk · 259 tokens

rpc

Vovk.ts RPC client — how vovk generate turns controllers into type-safe client modules, composed vs segmented clients, call shape (apiRoot, params, body, query, meta, init, disableClientValidation, validateOnClient, interpretAs, transform, fetcher), customizing generation via outputConfig.imports.fetcher +…

finom/vovk · 347 tokens

base

Vovk.ts essentials — ALWAYS load first for any Vovk.ts task, including building a back end or API in a project that has vovk.config. or .vovk-schema/. Holds what a typical build needs, checked against vovk 4's code - project layout, a complete endpoint, how requests, validation and errors behave, status codes, a…

finom/vovk · 123 tokens

decorators

Vovk.ts decorators — built-in (@prefix, @operation, @get/@post/@put/@patch/@del, .auto()) and custom via createDecorator. Covers authorization / auth decorators, middleware-style wrapping (pre-handler + post-handler logic), req.vovk.meta() for cross-decorator state, stacking order, and the local (.fn()) vs HTTP…

finom/vovk · 207 tokens

jsonlines

Vovk.ts JSON Lines streaming — generator handlers (function, async function), the iteration validation option, validateEachIteration, the JSONLinesResponder manual API, progressive responses via progressive(), consuming streams from the RPC client (async iteration, using, asPromise, onIterate, abortController), and…

finom/vovk · 222 tokens