test-building-blocks

test-building-blocks is a skill for Claude Code, Codex from bartstc/vite-ts-react-template. It costs 100 tokens per session (1,949 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 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,949 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.00100 $0.01949
Opus 5.5 $0.00040 $0.00780
Sonnet 5.5 $0.00020 $0.00390
Haiku 4.5 $0.00010 $0.00195

Measured 7d ago against content hash c127e5b6d30a, 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 7d 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 · 118 lines

How it starts

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

Test Building Blocks

Catalog of the test building blocks used in this project. Block names are stable identifiers, so plans and reviews can refer to them as `name` (block-type).

The rationale — tiers, why MSW is the mocking seam, when a stub is justified, design-smell signals — is in docs/tests/README.md. When the doc, this file and a rule file disagree, fix whichever is wrong.

How to use

Read the rule file of each block you are about to write or change. The summaries below are for routing only; the rule files hold the constraints, examples and anti-patterns.

  • Writing a test: route with the steps below, read that rule file, read the code under test, write the test.
  • Filling a gap: name the block and the behaviour, e.g. `useAddToCart` (hook-test) — missing the product-not-available case.
  • Reviewing: check each test against its block's rule file and against the mocking boundary below.

Production code that cannot be tested cleanly is a finding about the production code, not a licence to loosen the test. Say so and name what is missing — usually a seam in lib/ or a provider in test-lib/. When nothing here fits, say so and write the plainest Vitest test that covers the behaviour; do not force a near match.

Catalog

Tests

Block Subject Rule
component-story-test A component or composition in a real browser: its states per args/handlers, and what the user's actions do. rules/component-story-test.md
hook-test A hook with a contract of its own, via renderHook. rules/hook-test.md
api-test A lib/api/ factory's mutationFn / queryFn: the request it sends and the domain error each failure maps to. rules/api-test.md
unit-test Pure logic and XState machines — mappers, value objects, selectors, date math. rules/unit-test.md
visual-story A story state opted into screenshot comparison with the visual tag. rules/visual-story.md

Read the full file on GitHub · 118 lines

Files

What ships with it

9 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. 7d ago Changed c127e5b6d30a
  2. 22d ago Changed · +1 lines cdad67390f4d
  3. 24d ago Changed · -1 tokens per session b56ab96470a1
  4. 25d ago Changed · +35 lines · +101 tokens per session b73aa86c5a73
  5. 3mo 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 (126 stars, last pushed 8d ago), licensed MIT. It adds 100 tokens to every session and 1,949 once invoked, about $0.0004 per session on Opus 5.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.

Related

test-building-blocks compared with skills from other repositories

test-building-blocks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-building-blocksbartstc/vite-ts-react-templateSkill1268d agoMITA100Claude Code, Codex
verify-workHoangNguyen0403/agent-skills-standardSkill597todayMITA23Codex
authoring-data-quality-checksPostHog/posthogSkill41ktodaynoneA174Claude Code, Codex
test-electron-appPostHog/posthogSkill41ktodaynoneA112Claude Code
running-mobile-demo-flowsPostHog/posthogSkill41ktodaynoneA103Claude Code, Codex
weapp-vite-react-best-practicesweapp-vite/weapp-viteSkill534todayMITA103Codex
authoring-benchmarksNVIDIA/elementsSkill124todayApache-2.0A105Claude Code, Codex