React Composition Patterns
vercel-labs/openreview
Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.
Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/building-blocks .claude/skills/building-blocks && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .claude/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocksType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/building-blocks .agents/skills/building-blocks && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .agents/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/building-blocks .cursor/skills/building-blocks && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .cursor/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/bartstc/vite-ts-react-template.git --path .agents/skills/building-blocks--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/building-blocks .gemini/skills/building-blocks && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .gemini/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install bartstc/vite-ts-react-template building-blocksInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/building-blocks .github/skills/building-blocks && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .github/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/building-blocks .opencode/skills/building-blocks && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "building-blocks" agent skill from https://github.com/bartstc/vite-ts-react-template/tree/core/.agents/skills/building-blocks into .opencode/skills/building-blocks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "building-blocks", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
building-blocksFrontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.
Building Blocks is an agent skill from bartstc/vite-ts-react-template. Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models. ALWAYS read the relevant rule file before creating or modifying any building block in src/features/ or src/lib/. This includes spec implementation (read rule files for every block in the Building Blocks Diff), new feature work, refactoring, and architectural decisions.
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 24 other files (for example `README.md`, `metadata.json` and `rules/composer.md`).
It sits in Frontend & Design, covering Refactoring. It works with React. The repository describes itself as: This project provides a basic dev setup intended for Single Page Application (SPA) development. It contains key tools, settings for seamless DX, and an demo app presenting good… The licence is MIT.
Read from SKILL.md and the folder at commit 6aa5c9c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Building Blocks loads about 2.1k tokens when it runs. Until then it costs about 99 tokens; SKILL.md has 549 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from bartstc/vite-ts-react-template at commit 6aa5c9c, republished under its MIT licence (© bartstc). 549 words, ~2,089 tokens.
.claude/skills/building-blocks/SKILL.md (or your agent's skills folder). This skill also uses 23 other files; get the full folder from GitHub.Typed catalog of building blocks used in this project. Each block has a fixed name, layer, composition rules, and canonical example.
Read the rule file for each block you are about to implement. The summaries below are for routing — the rule files contain the full pattern.
Composition is a ladder. Default to the bottom rung; climb only when a concrete, named pain appears. Each rung buys flexibility and costs indirection.
| Rung | Block | Reach for it when… |
|---|---|---|
| 1 | pure-component | default — reusable UI is a function of its props. |
| 2 | compound-component | a component grows a prop per shape, or callers need a layout the props did not anticipate. |
| 3 | composer | one piece of UI must render data from swappable/deferred sources, or you want a fixture source for tests. |
| 4 | composer | state must cross a component boundary (callbacks drilled to a leaf) and the layout should stay pure. |
Do not climb for uniformity, for a single source with no alternative in sight, or for state that never leaves its component.
| Block | Layer | Summary | File |
|---|---|---|---|
mutation-options-factory | lib/api/ | Reusable mutationOptions() factories with domain error translation. Composed by mutation-hook in providers/. | rules/mutation-options-factory.md |
mutation-hook | providers/ | Server write via useMutation composed from mutation-options-factory, with cache invalidation. Returns [handler, isPending]. | rules/mutation-hook.md |
query-options-factory | lib/api/ | Reusable queryOptions() factories — no hooks, no useQuery. Hook composition belongs in providers/. | rules/query-options-factory.md |
query-keys-factory | lib/api/ | Hierarchical as const key tuples per resource. Single source of truth for cache invalidation. | rules/query-keys-factory.md |
dto-model | lib/api/ | TypeScript interfaces mirroring the raw API wire format. No transformations. | rules/dto-model.md |
| Block | Layer | Summary | File |
|---|---|---|---|
store | application/ | Zustand store — small, focused, selector-only subscriptions. Actions live inside the store. | rules/store.md |
machine | application/ | XState machine for multi-step async flows. Discriminated-union context; actors wrap the slice's own providers; typed ErrorActorEvent rejections; emits events outward. | rules/machine.md |
provider | providers/ | Thin React Context wrapper for dependency injection. No logic — delivers state, doesn't manage it. | rules/provider.md |
| Block | Layer | Summary | File |
|---|---|---|---|
use-case-hook | application/ | Orchestrates mutation + notification into one feature-level operation. | rules/use-case-hook.md |
| Block | Layer | Summary | File |
|---|---|---|---|
notification-hook | application/ | Maps operation outcomes to toast notifications. One hook per use case. | rules/notification-hook.md |
pure-component | components/ | Props in, JSX out. No side effects, no internal state beyond useMemo. | rules/pure-component.md |
compound-component | components/ | Dot-notation sub-components. Composition over configuration — no boolean prop toggles. | rules/compound-component.md |
composer | components/ | Consumes a { state, meta } / { state, actions } contract; swappable + fixture source Providers fill it. Top of the ladder. | rules/composer.md |
form | components/ | Context-driven form via useForm + FormProvider + field components. | rules/form.md |
hoc | components/ | Component in → enhanced component out. For render-level decisions (auth gates, suspense wrappers). | rules/hoc.md |
error-boundary | components/ | Scoped error handling for a feature component with its own query. | rules/error-boundary.md |
page | pages/ | Route-level orchestrator. Only place where router coupling is acceptable. | rules/page.md |
facade-hook | components/ | Private logic extraction for a single component. Defined below the component, not exported. | rules/facade-hook.md |
named-effect | components/ | Named function expressions in useEffect. Intent visible at a glance. | rules/named-effect.md |
| Block | Layer | Summary | File |
|---|---|---|---|
frontend-model | models/ | UI-friendly domain objects mapped from DTOs. Skip if DTO shape is identical. | rules/frontend-model.md |
value-object | application/ | Static-method classes grouping domain logic for a single concept. Namespace, not instance. | rules/value-object.md |
rules/ — one file per block.© bartstc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 23 other files in .agents/skills/building-blocks of bartstc/vite-ts-react-template.
Open the folder on GitHubat commit 6aa5c9c
Building Blocks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Building Blocks this skillbartstc/vite-ts-react-template | 122 | — | ~2.1k | Automated safety check: Pass | MIT | |
| React Composition Patternsvercel-labs/openreview | 1.7k | 58 repos | ~721 | Automated safety check: Pass | MIT | |
| Vercel React Best Practicessanity-io/sanity | 6.4k | 130 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Frontend Module Standardssiteboon/claudecodeui | 14k | — | ~2.6k | Automated safety check: Pass | AGPL-3.0 | |
| Dify Component Writing Guidelanggenius/dify | 158k | — | ~626 | Automated safety check: Pass | Custom licence | |
| React Best Practicesmastra-ai/mastra | 29k | — | ~1.9k | Automated safety check: Pass | Custom licence |
vercel-labs/openreview
Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.
sanity-io/sanity
React and Next.js performance optimization guidelines from Vercel Engineering.
siteboon/claudecodeui
Enforces one repository's React and TypeScript module layout for code under src/: source-root imports, feature barrels, deliberate exports and no deep imports.
langgenius/dify
Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…
mastra-ai/mastra
React performance optimization guidelines from Mastra Engineering.
udecode/plate
Build new shadcn-style components for Plate's registry and editor surfaces.
bartstc/vite-ts-react-template
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications.
bartstc/vite-ts-react-template
Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits).
bartstc/vite-ts-react-template
A skill your agent uses when creating page objects or refactoring Playwright E2E tests for better maintainability with Page Object Model patterns.
bartstc/vite-ts-react-template
Collaboratively write a feature spec with the developer. An agent skill from bartstc/vite-ts-react-template.
bartstc/vite-ts-react-template
Explains code with visual diagrams and analogies. An agent skill from bartstc/vite-ts-react-template.
bartstc/vite-ts-react-template
Test building block catalog — typed patterns for Storybook play-function tests, Vitest hook tests, Vitest unit tests, MSW handlers, and test data fixtures.
Works with
Categories
Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models. Building Blocks is an agent skill from bartstc/vite-ts-react-template. Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.
Building Blocks fits situations like: tasks that involve Refactoring.
Run `npx skills add bartstc/vite-ts-react-template --skill building-blocks -a claude-code`. Or copy the skill folder (.agents/skills/building-blocks in bartstc/vite-ts-react-template) into .claude/skills/building-blocks in your project. Claude Code loads it when a task matches its description.
Run `npx skills add bartstc/vite-ts-react-template --skill building-blocks -a codex`. Or copy the skill folder (.agents/skills/building-blocks in bartstc/vite-ts-react-template) into .agents/skills/building-blocks in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bartstc/vite-ts-react-template --skill building-blocks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/building-blocks, .gemini/skills/building-blocks, .github/skills/building-blocks and .opencode/skills/building-blocks in your project.
SKILL.md names no scripts, command-line tools or credentials: Building Blocks is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Building Blocks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Building Blocks: React Composition Patterns (vercel-labs/openreview, 1.7k stars), Vercel React Best Practices (sanity-io/sanity, 6.4k stars), Frontend Module Standards (siteboon/claudecodeui, 14k stars) and Dify Component Writing Guide (langgenius/dify, 158k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
bartstc (a GitHub user) maintains it in bartstc/vite-ts-react-template, which has 122 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 6, 2026.
Source: bartstc/vite-ts-react-template on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.