test-building-blocks
Skill by bartstc
Test building block catalog gives an AI assistant typed patterns for Storybook play-function tests, Vitest hook and unit tests, MSW handlers, and test data fixtures. It helps choose the right test type and follow the matching rule file.
Install test-building-blocks
Built from the published package, never by AI.
git clone --depth 1 https://github.com/bartstc/vite-ts-react-template /tmp/vite-ts-react-template && mkdir -p ~/.claude/skills && cp -r /tmp/vite-ts-react-template/.agents/skills/test-building-blocks ~/.claude/skills/test-building-blocksRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/bartstc/vite-ts-react-template /tmp/vite-ts-react-template && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/vite-ts-react-template/.agents/skills/test-building-blocks ~/.gemini/antigravity-cli/skills/test-building-blocksAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install test-building-blocks in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Test building block catalog is an agent skill that gives an AI assistant typed patterns for writing tests. It covers Storybook play-function tests, Vitest hook tests using renderHook, Vitest unit tests, MSW request handlers, and test data fixtures. For each block, the skill gives a fixed name, layer, composition rules and a canonical example in a rule file.
The skill also sets a testing approach. Storybook play-function tests are the primary layer for user-facing behavior, and hook tests and unit tests cover what needs dedicated checks. Mocking happens at the network boundary with MSW rather than by mocking lib/api exports, React Query or Zustand stores. It is aimed at developers working on this project's tests, including when they write, modify or review them.
Written from the project's SKILL.md and checked against it.
What it can do
- Test type routingDecides whether code should get a story test, hook test, unit test, or no test.
- component-story-testStorybook play-function tests for user-facing behavior, the primary verification layer.
- hook-testVitest tests using renderHook for edge cases, error and loading paths, and shared hooks.
- unit-testVitest tests for mappers, transformers, value objects, selectors and pure functions.
- msw-handlerOne request handler per endpoint, with optional resolvers for per-scenario overrides.
- fixtureDeterministic test data factories built with createFixture, with no randomness or Date.now.
- Mocking boundary rulesDefines when module-level mocks are allowed and when to use MSW at the network boundary.
- Test reviewSupports reviewing existing tests against the catalog's conformance rules.
Try asking
- Which kind of test should I write for this custom hook?
- Write a Storybook play-function test for this form component.
- Add an MSW handler and a fixture for the orders endpoint.
Good to know
- Describes conventions for one project's test suite.
- Fixtures, MSW handler factories and trivial glue should not get their own tests.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/test-building-blocks/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
README.md2 KB -
SKILL.md6 KB -
metadata.json586 B -
rules/component-story-test.md7 KB -
rules/fixture.md3 KB
Show all 8 files
-
rules/hook-test.md6 KB -
rules/msw-handler.md4 KB -
rules/unit-test.md3 KB
Alternatives to test-building-blocks
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
test-building-blocks: common questions
What test types does this skill cover?
It covers Storybook play-function tests, Vitest hook tests with renderHook, Vitest unit tests, MSW handlers and test data fixtures.
Should I mock lib/api or Zustand stores with this skill?
No. The skill says not to mock lib/api exports, React Query or Zustand stores, and to mock at the network boundary with MSW instead.
Does this skill write tests for fixtures and MSW handlers?
No. The skill says fixtures, MSW handler factories and trivial glue should not have tests, since they are support infrastructure.
How do I install test-building-blocks?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is test-building-blocks free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is test-building-blocks safe to use?
It scores 73 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to test-building-blocks?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
