effect-react-composition

Guidance for building React components from smaller cooperating parts and managing shared state with Effect Atom. React is a JavaScript library for building user interfaces, and component composition means assembling complex screens from simpler components.

In plain words
What is it for?
Use it to design reusable React component libraries, refactor boolean-heavy props, compose complex interfaces, and connect multiple components to reactive Effect state.
Why use it?
It helps avoid components overloaded with configuration flags and gives shared UI state a structured place to live.

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

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,636 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.00043 $0.05636
Opus 5 $0.00022 $0.02818
Sonnet 5 $0.00009 $0.01127
Haiku 4.5 $0.00004 $0.00564

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

Security

Grade A, and why

effect-react-composition 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 3d 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.

harnesses/effect/skills/effect-react-composition/SKILL.md · 973 lines

How it starts

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

React Composition Skill

Build React UIs using compositional patterns, Effect Atom for state management, and the component module pattern. Use this skill when creating React applications that integrate with Effect's ecosystem.

Effect Source Reference

The Effect v4 source is available at ~/.cache/effect-v4/. Browse and read files there directly to look up APIs, types, and implementations.

Reference this for:

  • Atom reactivity: packages/effect/src/unstable/reactivity/
  • AsyncResult source: packages/effect/src/unstable/reactivity/AsyncResult.ts
  • Effect source: packages/effect/src/

When to Use This Skill

  • Building React components that integrate with Effect Atom state
  • Refactoring components away from boolean prop anti-patterns
  • Implementing complex UIs through composition of simple pieces
  • Creating reusable component libraries with flexible APIs
  • Managing shared state across multiple React components
  • Lifting state to appropriate levels in component trees

Core Principles

1. Composition over Configuration

Build complex UIs from simple, composable pieces rather than configuring behavior through props.

Anti-Pattern: Boolean Props

// L WRONG - Configuration through boolean props
interface FormProps {
	isUpdate?: boolean;
	hideWelcome?: boolean;
	showEmail?: boolean;
	redirectOnSuccess?: boolean;
	enableValidation?: boolean;
}

function UserForm({
	isUpdate,
	hideWelcome,
	showEmail,
	redirectOnSuccess,
	enableValidation
}: FormProps) {
	return (
		<form>
			{!hideWelcome && <WelcomeMessage />}
			<NameField />
			{showEmail && <EmailField />}
			<button type="submit">{isUpdate ? 'Update' : 'Create'}</button>
		</form>
	);
}

// Usage becomes unreadable
<UserForm isUpdate hideWelcome showEmail redirectOnSuccess />;

Correct Pattern: Composition

//  CORRECT - Compose specific forms from atomic pieces
export namespace UserForm {
	export const Frame: React.FC<{ children: React.ReactNode }> = ({
		children
	}) => <form className="user-form">{children}</form>;

	export const WelcomeMessage: React.FC = () => (
		<div className="welcome">Welcome!</div>
	);

	export const NameField: React.FC = () => (
		<input name="name" placeholder="Name" />
	);

	export const EmailField: React.FC = () => (
		<input type="email" name="email" placeholder="Email" />
	);

	export const SubmitButton: React.FC<{ children: React.ReactNode }> = ({
		children
	}) => <button type="submit">{children}</button>;
}

// Create specific forms through composition
function CreateUserForm() {
	return (
		<UserForm.Frame>
			<UserForm.WelcomeMessage />
			<UserForm.NameField />
			<UserForm.EmailField />
			<UserForm.SubmitButton>Create</UserForm.SubmitButton>
		</UserForm.Frame>
	);
}

function UpdateUserForm() {
	return (
		<UserForm.Frame>
			<UserForm.NameField />
			<UserForm.SubmitButton>Update</UserForm.SubmitButton>
		</UserForm.Frame>
	);
}

// Usage is clear and explicit (in JSX context):
// <CreateUserForm />
// <UpdateUserForm />

Read the full file on GitHub · 973 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. 3d ago First seen · 973 lines · 43 tokens per session scan A 451433b33b41

Subscribe to this mod's changes

effect-react-composition is a skill published in the GitHub repository mpsuesser/pi-effect-harness (23 stars, last pushed 2mo ago), licensed MIT. It adds 43 tokens to every session and 5,636 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-08-30.