wonder-blocks: Skill for Claude Code

.agents/skills/unit-tests/SKILL.md

unit-tests is a skill for Claude Code, Codex from Khan/wonder-blocks. It costs 34 tokens per session (3,941 once invoked), scanned A, original, MIT.

A set of guidelines for writing unit tests for React user interfaces with Jest and React Testing Library. Unit tests check small parts of a program in isolation.

In plain words
What is it for?
Use it when creating or editing TypeScript tests for React components and business logic, including arranging setup, performing an action, and checking the result.
Why use it?
It helps keep tests organized and directs attention to meaningful behavior and the real cause of failures.

Skill for Claude CodeCodex

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

This is Khan/wonder-blocks's own configuration. It tells Claude Code and Codex how to work on wonder-blocks itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything wonder-blocks configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Khan/wonder-blocks. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Khan/wonder-blocks/main/.agents/skills/unit-tests/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Khan/wonder-blocks

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 unit-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/khan/wonder-blocks/unit-tests/github.svg)](https://agentmods.dev/skills/khan/wonder-blocks/unit-tests)
Your own site
<a href="https://agentmods.dev/skills/khan/wonder-blocks/unit-tests"><img src="https://agentmods.dev/badge/skills/khan/wonder-blocks/unit-tests/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 unit-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/khan/wonder-blocks/unit-tests"><img src="https://agentmods.dev/badge/skills/khan/wonder-blocks/unit-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,941 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: 1 finding, 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 Agent Snooping · line 366
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
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.00034 $0.03941
Opus 5.5 $0.00014 $0.01576
Sonnet 5.5 $0.00007 $0.00788
Haiku 4.5 $0.00003 $0.00394

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

Security

Grade A, and why

unit-tests 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 2mo 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/unit-tests/SKILL.md · 486 lines

How it starts

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

Jest Testing Best Practices

This guide covers testing patterns and best practices for Jest and React Testing Library in the Wonder Blocks codebase.

Core Testing Principles

⚠️ Critical Setup Rules

Test Workflow Priority:

  • ✅ ALWAYS fix failing tests BEFORE fixing linting errors
  • ✅ Focus on underlying errors, not Unhandled console.error call messages
  • ⚠️ When tests fail with Unhandled console.error call, look for the root cause error (e.g., ReferenceError: window is not defined)
  • ⚠️ The console.error messages are symptoms, not the actual problem - fix the underlying issue

File Structure:

  • ✅ Name test files with .test.ts or .test.tsx suffix
  • ✅ Place in __tests__/ directory OR colocate with source files (follow local conventions)

Test Framework Setup:

  • ✅ Additional matchers from React Testing Library (RTL) and jest-extended are available
  • ✅ Use describe/it pattern for test organization
  • ✅ Use globalThis prefix when accessing global objects
  • ✅ Prioritize testing non-trivial business logic over trivial implementations

Arrange-Act-Assert Pattern

⚠️ ALWAYS use this three-section structure:

describe("Calculator", () => {
    it("should add two numbers correctly", () => {
        // Arrange
        const a = 5;
        const b = 3;

        // Act
        const result = add(a, b);

        // Assert
        expect(result).toBe(8);
    });
});

Rules:

  • ✅ ALWAYS divide tests into Arrange, Act, Assert sections with comments
  • ✅ Each section gets exactly one comment label (// Arrange, // Act, // Assert) — no additional comments within a section
  • ❌ NEVER combine sections (e.g., don't write // Act & Assert)
  • ❌ NEVER use multiple Act or Assert sections in a single test (split into separate tests instead)
  • ❌ NEVER remove Arrange, Act, Assert comments

Exception - Testing Thrown Errors:

When testing errors, use an underTest variable in the Act section:

Read the full file on GitHub · 486 lines

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. 2mo ago First seen · 486 lines · 34 tokens per session scan A 3e75ef5ee47b

Subscribe to this mod's changes

unit-tests is a skill published in the GitHub repository Khan/wonder-blocks (163 stars, last pushed yesterday), licensed MIT. It adds 34 tokens to every session and 3,941 once invoked, about $0.0001 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

unit-tests compared with skills from other repositories

unit-tests next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
unit-testsKhan/wonder-blocksSkill163yesterdayMITA34Claude Code, Codex
release-safetytamagui/tamaguiSkill14ktodayMITA0Claude Code
ui-componentsyonatangross/orchestkitSkill299yesterdayMITA44Claude Code
next-cache-components-optimizervercel/next.jsSkill143ktodayMITA123Claude Code
next-partial-prefetching-optimizervercel/next.jsSkill143ktodayMITA82Claude Code
react-patternsaffaan-m/ECCSkill298k4d agoMITA49Claude Code, Kiro
compiler-portreact/reactSkill252kyesterdayMITA35Claude Code