test-building-blocks

test-building-blocks is a skill for Claude Code, Codex from bartstc/vite-ts-react-template. It costs 0 tokens per session (1,235 once invoked), scanned A, original, MIT.

A catalogue of typed patterns for testing Storybook components, Vitest hooks and units, mock network handlers, and test data fixtures.

In plain words
What is it for?
Use it when writing or changing component interaction tests, hook tests, unit tests, MSW request handlers, or test fixtures.
Why use it?
It helps developers choose the appropriate test layer and follow the project's established structure instead of inventing inconsistent tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when writing or changing component interaction tests, hook tests, unit tests, MSW request handlers, or test fixtures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bartstc/vite-ts-react-template/test-building-blocks
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.

Any agent
npx skills add bartstc/vite-ts-react-template --skill test-building-blocks
Clone the repo
git clone --depth 1 https://github.com/bartstc/vite-ts-react-template

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 test-building-blocks

README.md
[![agentmods](https://agentmods.dev/badge/skills/bartstc/vite-ts-react-template/test-building-blocks/github.svg)](https://agentmods.dev/skills/bartstc/vite-ts-react-template/test-building-blocks)
Your own site
<a href="https://agentmods.dev/skills/bartstc/vite-ts-react-template/test-building-blocks"><img src="https://agentmods.dev/badge/skills/bartstc/vite-ts-react-template/test-building-blocks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-building-blocks

Your own site · 80×15
<a href="https://agentmods.dev/skills/bartstc/vite-ts-react-template/test-building-blocks"><img src="https://agentmods.dev/badge/skills/bartstc/vite-ts-react-template/test-building-blocks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,235 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 49
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 57
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
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.1 $0.00000 $0.01235
Opus 5.5 $0.00000 $0.00494
Sonnet 5.5 $0.00000 $0.00247
Haiku 4.5 $0.00000 $0.00123

Measured 1mo ago against content hash c86d48cbda83, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-building-blocks 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 1mo 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.

.agents/skills/test-building-blocks/SKILL.md · 82 lines

How it starts

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

Test Building Blocks

Typed catalog of test-related 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.

Typical flow:

  1. Read this file to route to the right block.
  2. Read rules/{block-name}.md for the full pattern and canonical example.
  3. Read the implementation code (component, hook, module) you are testing.
  4. Write the test following the rule file's constraints.

Testing Philosophy

The project's testing philosophy allocates verification across three layers:

  • Storybook play-function tests are the primary verification layer for feature behavior. Focus on happy paths and the main user-observable states. Anything user-facing — components composing hooks, stores, providers — is verified here.
  • Vitest hook tests (renderHook) cover custom hooks that need dedicated verification — edge cases, error paths, loading states, and hooks with logic not tied to a single component. Use independently of component-story-test; the two do not need to cover the same ground.
  • Vitest unit tests are reserved for non-hook mechanics: mappers, transformers, value objects, selectors, and other pure logic.
  • No tests for fixtures, MSW handlers, or trivial glue — these are support infrastructure, not the thing being verified.

Coverage is behavior-covered, not file-mapped. Every user-observable state has a story or a hook-test scenario; not every file has a test.

Mocking Boundary

Mock at the network boundary, not the module boundary. MSW is the default for anything HTTP-backed. Do not mock lib/api/ exports, React Query, or Zustand stores — let the real code run and intercept at the wire.

Module-level mocking (vi.mock, vi.stubGlobal) is reserved for:

  • Non-determinism sources: Date.now, crypto.randomUUID, Math.random, timers.
  • Write-only side-effect sinks: analytics, logging, toasts — centralized as project-owned spies in test-lib/.
  • Pure utilities when unit-testing their direct caller.
  • XState actors/actions via machine.provide({ actors, actions }).

Read the full file on GitHub · 82 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 82 lines · 0 tokens per session scan A c86d48cbda83

Subscribe to this mod's changes

test-building-blocks is a skill published in the GitHub repository bartstc/vite-ts-react-template (123 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,235 tokens. 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.

Related

Other skills, from other repositories

verify-work

Verify feature, bug, UI, API, mobile, security, or deployment work against acceptance criteria.

HoangNguyen0403/agent-skills-standard · 23 tokens

authoring-data-quality-checks

Adds and runs data quality checks (dbt-test style assertions) on a project's warehouse tables and saved-query views, and HogQL catalog metrics: not-null, uniqueness, accepted values, referential integrity, row-count bounds, freshness, and custom HogQL. Metrics support custom SQL checks only. Use when asked to test a…

PostHog/posthog · 174 tokens

test-electron-app

Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser. Connect to the running app on port 9222, test desktop changes against a local Django stack, snapshot the accessibility tree, inspect network requests, and screenshot only when explicitly asked. Use when…

PostHog/posthog · 112 tokens

component-tester

Run Vitest tests for a specific component with coverage. Use when making changes to React components to ensure tests pass and coverage is maintained.

motormetrics/motormetrics · 31 tokens

systematic-debugging

4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.

DDS-Solutions/AI-TadPole-OS · 25 tokens

testing-patterns

Testing patterns and principles. Unit, integration, mocking strategies, Arrange-Act-Assert (AAA), and multi-ecosystem test runners.

DDS-Solutions/AI-TadPole-OS · 32 tokens