composition-patterns

composition-patterns is a skill for Claude Code, Codex from itallstartedwithaidea/agent-skills. It costs 34 tokens per session (1,217 once invoked), scanned A, original, MIT.

Composition Patterns teaches agents to build flexible, maintainable React components using compound components, state lifting, internal composition, and the elimination of boolean prop proliferation.

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/itallstartedwithaidea/agent-skills/composition-patterns
Any agent
npx skills add itallstartedwithaidea/agent-skills --skill composition-patterns
Clone the repo
git clone --depth 1 https://github.com/itallstartedwithaidea/agent-skills

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/itallstartedwithaidea/agent-skills/composition-patterns.svg)](https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/composition-patterns)
Your own site
<a href="https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/composition-patterns"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/composition-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00034 $0.01217
Opus 5 $0.00017 $0.00609
Sonnet 5 $0.00007 $0.00243
Haiku 4.5 $0.00003 $0.00122

Measured today against content hash 5798c363e0f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 today.

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.

skills/web-frontend/composition-patterns/SKILL.md · 153 lines

How it starts

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

Composition Patterns

Part of Agent Skills™ by googleadsagent.ai™

Description

Composition Patterns teaches agents to build flexible, maintainable React components using compound components, state lifting, internal composition, and the elimination of boolean prop proliferation. These patterns replace rigid, prop-heavy APIs with composable interfaces that scale gracefully as requirements evolve.

The most common agent mistake in React is building monolithic components with dozens of boolean props: showHeader, showFooter, isCompact, isLoading, hasSearch, enableDarkMode. Each boolean doubles the component's state space, creating an exponential testing surface and making the component impossible to extend without modifying its internals. Composition patterns replace these booleans with structural composition, where the consumer assembles the component from smaller pieces.

This skill addresses four complementary patterns: compound components for related UI families, state lifting for shared cross-component state, internal composition for encapsulated sub-rendering, and render delegation for maximum consumer flexibility. Applied together, these patterns produce components that are simple to use, powerful to customize, and trivial to test.

Use When

  • A component has more than 3 boolean configuration props
  • Related components need to share implicit state (tabs, accordions, selects)
  • The consumer needs to control layout or ordering of sub-elements
  • A component needs to support use cases not anticipated at design time
  • Refactoring a "god component" into composable pieces
  • Building a component library or design system

How It Works

graph TD
    A[Component Design Request] --> B{Pattern Selection}
    B --> C[Compound: Related UI Family]
    B --> D[State Lifting: Shared State]
    B --> E[Internal Composition: Sub-render]
    B --> F[Render Delegation: Consumer Control]
    C --> G[Parent provides context]
    G --> H[Children consume context]
    D --> I[State lives in nearest common ancestor]
    E --> J[Component composes internally]
    F --> K[Consumer passes render function]

Read the full file on GitHub · 153 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. today First seen · 153 lines · 34 tokens per session scan A 5798c363e0f2

Subscribe to this mod's changes

composition-patterns is a skill published in the GitHub repository itallstartedwithaidea/agent-skills (36 stars, last pushed 4mo ago), licensed MIT. It adds 34 tokens to every session and 1,217 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

form-submissions

Form submission patterns using useDynamicSubmitter, await submitJson, and formAction. Use when implementing forms, handling form submissions, or processing form data in React Router routes.

firtoz/cf-multiworker-starter-kit · 39 tokens

generate-component

Generate production-ready React code using UI Kit components. Use when the user asks to "build", "create", "make", "generate" a UI, page, form, dashboard, or component composition. Produces working TSX with correct imports, props, and Aurora Fluid styling.

annondeveloper/ui-kit · 60 tokens

routing

React Router v8 routing patterns and environment variable configuration. Use whenever you touch React Router–related code (routes, links, params, loaders, actions, route config, middleware, or env in route context).

firtoz/cf-multiworker-starter-kit · 44 tokens

component-organization

Component organization patterns for React applications. Use when creating components, organizing files, or structuring routes. ALWAYS keep 1 component per file and routes simple.

firtoz/cf-multiworker-starter-kit · 35 tokens

react-patterns

React patterns for callbacks, event handlers, JSX handler typing, and module-level constants. Use when writing React components, implementing event handlers, typing JSX handlers, or defining constants.

firtoz/cf-multiworker-starter-kit · 39 tokens

ask-sonner

Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear…

stvlynn/dsh.fish · 97 tokens