effect-react-composition

Build composable React components with Effect Atom reactive state management.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-react-composition-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-react-composition
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-react-composition
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-react-composition-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React codebases often accumulate boolean-prop configuration, misplaced state, and unnecessary useEffect calls, making components hard to reuse and maintain. This Skill provides concrete patterns for building React UIs through composition and integrating Effect Atom for reactive state. ## Core Features & Use Cases - Composition over Configuration: Replace boolean prop anti-patterns with namespace-organized compound components that compose into specific features. - Effect Atom State Management: Create atoms, derived atoms, and atom families with runtime-wrapped async operations returning AsyncResult types. - State Lifting and Context Patterns: Lift state above all consumers and use component-scoped Context for local state versus Atoms for app-wide state. - Use Case: When building a shopping cart UI, define a cart atom with derived item-count atoms, then compose CartView, CartBadge, and AddToCartButton components that all reactively update without prop drilling. ## Quick Start Use the effect-react-composition skill to refactor my UserForm component away from boolean props into composable namespace components with Effect Atom state.

Frequently Asked Questions about effect-react-composition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage React state with Effect Atom?

Create atoms with Atom.make for base state, derive values with Atom.map, and define mutations with Atom.fn wrapping Effect generators. Components read atoms via useAtomValue and write via useAtomSet from @effect/atom-react, updating reactively across the tree.

How to avoid boolean props in React components?

Replace boolean configuration props with composition by exporting atomic sub-components from a namespace, such as UserForm.Frame, UserForm.NameField, and UserForm.SubmitButton. Compose specific variants like CreateUserForm and UpdateUserForm from these pieces instead of toggling flags.

When should I use React Context versus Effect Atom?

Use Context for component-scoped state shared within a compound component tree, like Tabs or Composer state. Use Effect Atom for app-wide state that many unrelated components read or write, avoiding deep provider nesting.

Does Effect Atom support async data fetching in React?

Yes, use Atom.runtime with a service layer and Atom.family to create keyed async atoms. The runtime wraps results as AsyncResult, which components render with AsyncResult.matchWithWaiting to handle loading, error, defect, and success states explicitly.

When is useEffect appropriate in React with Effect?

Use useEffect only for synchronizing with external systems like WebSockets or DOM APIs and for subscription cleanup. For derived values, calculate during render or use useMemo; for resetting state on prop change, use the key prop instead.