Agent skill

Building Blocks

by bartstc in bartstc/vite-ts-react-template

Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.

MITAuto-check passedFrontend & Design

Install Building Blocks

skills CLI
$ npx skills add bartstc/vite-ts-react-template --skill building-blocks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bartstc/vite-ts-react-template building-blocks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
building-blocks
GitHub stars
122
Token cost
~2.1k tokens
SKILL.md length
549 words
Files
24
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.

  • Tasks that involve Refactoring
  • SKILL.md covers How to Use, Composition ladder, Block Catalog and Rules
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

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.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/building-blocks”

What it can do on your machine

Read from SKILL.md and the folder at commit 6aa5c9c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from bartstc/vite-ts-react-template at commit 6aa5c9c, republished under its MIT licence (© bartstc). 549 words, ~2,089 tokens.

Download SKILL.mdSave it as .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.
name
building-blocks
description
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.

Frontend Building Blocks

Typed catalog of building blocks used in this project. Each block has a fixed name, layer, composition rules, and canonical example.

How to Use

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 ladder

Composition is a ladder. Default to the bottom rung; climb only when a concrete, named pain appears. Each rung buys flexibility and costs indirection.

RungBlockReach for it when…
1pure-componentdefault — reusable UI is a function of its props.
2compound-componenta component grows a prop per shape, or callers need a layout the props did not anticipate.
3composerone piece of UI must render data from swappable/deferred sources, or you want a fixture source for tests.
4composerstate 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 Catalog

Data Fetching
BlockLayerSummaryFile
mutation-options-factorylib/api/Reusable mutationOptions() factories with domain error translation. Composed by mutation-hook in providers/.rules/mutation-options-factory.md
mutation-hookproviders/Server write via useMutation composed from mutation-options-factory, with cache invalidation. Returns [handler, isPending].rules/mutation-hook.md
query-options-factorylib/api/Reusable queryOptions() factories — no hooks, no useQuery. Hook composition belongs in providers/.rules/query-options-factory.md
query-keys-factorylib/api/Hierarchical as const key tuples per resource. Single source of truth for cache invalidation.rules/query-keys-factory.md
dto-modellib/api/TypeScript interfaces mirroring the raw API wire format. No transformations.rules/dto-model.md
State Management
BlockLayerSummaryFile
storeapplication/Zustand store — small, focused, selector-only subscriptions. Actions live inside the store.rules/store.md
machineapplication/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
providerproviders/Thin React Context wrapper for dependency injection. No logic — delivers state, doesn't manage it.rules/provider.md
App Orchestration
BlockLayerSummaryFile
use-case-hookapplication/Orchestrates mutation + notification into one feature-level operation.rules/use-case-hook.md
Show full SKILL.md (214 more words)Show less
Component Patterns
BlockLayerSummaryFile
notification-hookapplication/Maps operation outcomes to toast notifications. One hook per use case.rules/notification-hook.md
pure-componentcomponents/Props in, JSX out. No side effects, no internal state beyond useMemo.rules/pure-component.md
compound-componentcomponents/Dot-notation sub-components. Composition over configuration — no boolean prop toggles.rules/compound-component.md
composercomponents/Consumes a { state, meta } / { state, actions } contract; swappable + fixture source Providers fill it. Top of the ladder.rules/composer.md
formcomponents/Context-driven form via useForm + FormProvider + field components.rules/form.md
hoccomponents/Component in → enhanced component out. For render-level decisions (auth gates, suspense wrappers).rules/hoc.md
error-boundarycomponents/Scoped error handling for a feature component with its own query.rules/error-boundary.md
pagepages/Route-level orchestrator. Only place where router coupling is acceptable.rules/page.md
facade-hookcomponents/Private logic extraction for a single component. Defined below the component, not exported.rules/facade-hook.md
named-effectcomponents/Named function expressions in useEffect. Intent visible at a glance.rules/named-effect.md
Data Modeling
BlockLayerSummaryFile
frontend-modelmodels/UI-friendly domain objects mapped from DTOs. Skip if DTO shape is identical.rules/frontend-model.md
value-objectapplication/Static-method classes grouping domain logic for a single concept. Namespace, not instance.rules/value-object.md

Rules

  • Block files live in rules/ — one file per block.
  • Each file contains: description, constraints, and a canonical code example.
  • Block names are stable identifiers referenced in specs and task breakdowns.

© bartstc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 23 other files in .agents/skills/building-blocks of bartstc/vite-ts-react-template.

  • SKILL.md
  • README.md
  • metadata.json
  • rules/composer.md
  • rules/compound-component.md
  • rules/dto-model.md
  • rules/error-boundary.md
  • rules/facade-hook.md
  • rules/form.md
  • rules/frontend-model.md
  • rules/hoc.md
  • rules/machine.md
  • rules/mutation-hook.md
  • rules/mutation-options-factory.md
  • rules/named-effect.md
  • rules/notification-hook.md
  • rules/page.md
  • rules/provider.md
  • rules/pure-component.md
  • rules/query-keys-factory.md
  • … and 4 more

Open the folder on GitHubat commit 6aa5c9c

Compare with similar skills

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.

Building Blocks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Building Blocks this skillbartstc/vite-ts-react-template122—~2.1kAutomated safety check: PassMIT
React Composition Patternsvercel-labs/openreview1.7k58 repos~721Automated safety check: PassMIT
Vercel React Best Practicessanity-io/sanity6.4k130 repos~1.6kAutomated safety check: PassMIT
Frontend Module Standardssiteboon/claudecodeui14k—~2.6kAutomated safety check: PassAGPL-3.0
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
React Best Practicesmastra-ai/mastra29k—~1.9kAutomated safety check: PassCustom licence

Similar skills

  • React Composition Patterns

    vercel-labs/openreview

    Official

    Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.

    1.7k GitHub starsUsed in 58 repos~721 tokens
    Frontend & DesignAuto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 130 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • Frontend Module Standards

    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.

    14k GitHub stars~2.6k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • React Best Practices

    mastra-ai/mastra

    React performance optimization guidelines from Mastra Engineering.

    29k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Plate UI

    udecode/plate

    Build new shadcn-style components for Plate's registry and editor surfaces.

    17k GitHub stars~2.6k tokensUpdated today
    Frontend & DesignAuto-check passed

More from bartstc/vite-ts-react-template

  • GitHub Actions Templates

    bartstc/vite-ts-react-template

    Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications.

    122 GitHub starsUsed in 13 repos~1.9k tokens
    Auto-check passed
  • Commit Work

    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).

    122 GitHub starsUsed in 3 repos~623 tokens
    Auto-check passed
  • Playwright Page Objects

    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.

    122 GitHub stars~1k tokensUpdated yesterday
    Auto-check: notes
  • Writing Spec

    bartstc/vite-ts-react-template

    Collaboratively write a feature spec with the developer. An agent skill from bartstc/vite-ts-react-template.

    122 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Explaining Code

    bartstc/vite-ts-react-template

    Explains code with visual diagrams and analogies. An agent skill from bartstc/vite-ts-react-template.

    122 GitHub starsUsed in 2 repos~154 tokens
    Auto-check passed
  • Test Building Blocks

    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.

    122 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Building Blocks

What does Building Blocks do?

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.

When should I use Building Blocks?

Building Blocks fits situations like: tasks that involve Refactoring.

How do I install Building Blocks in Claude Code?

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.

How do I install Building Blocks in Codex?

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.

Can I use Building Blocks in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Building Blocks need to run?

SKILL.md names no scripts, command-line tools or credentials: Building Blocks is instructions for the agent only.

Does Building Blocks access the network?

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.

Is Building Blocks safe to install?

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.

What licence does Building Blocks use?

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.

How many tokens does Building Blocks use?

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.

What are the alternatives to Building Blocks?

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.

Who maintains Building Blocks?

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.