frontend-testing

A skill for generating tests for React frontend code with Vitest and React Testing Library. It covers components, reusable hooks, and utility functions; unit tests check small pieces, while integration tests check how pieces work together.

In plain words
What is it for?
Use it to write or review tests for React components, hooks, and utilities, or to improve coverage. It is intended for Vitest and React Testing Library tests, not browser end-to-end tests such as Playwright.
Why use it?
It helps developers add useful test coverage without having to design every test pattern from scratch. It focuses on frontend behavior and follows the project's existing conventions where available.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/pageai-pro/ralph-loop/frontend-testing
Any agent
npx skills add PageAI-Pro/ralph-loop --skill frontend-testing
Clone the repo
git clone --depth 1 https://github.com/PageAI-Pro/ralph-loop

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,297 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00048 $0.02297
Opus 5 $0.00024 $0.01149
Sonnet 5 $0.00010 $0.00459
Haiku 4.5 $0.00005 $0.00230

Measured 2d ago against content hash fc56500f072f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

frontend-testing 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/hook-test.template.ts, assets/utility-test.template.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agent/skills/frontend-testing/SKILL.md · 317 lines

How it starts

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

This skill enables Claude to generate high-quality, comprehensive frontend tests following established conventions and best practices.

When to Apply This Skill

Apply this skill when the user:

  • Asks to write tests for a component, hook, or utility
  • Asks to review existing tests for completeness
  • Mentions Vitest, React Testing Library, RTL, or spec files
  • Requests test coverage improvement
  • Mentions testing, unit tests, or integration tests for frontend code
  • Wants to understand testing patterns in the frontend codebase

Do NOT apply when:

  • User is asking about E2E tests (Playwright)
  • User is only asking conceptual questions without code context

Quick Reference

Tech Stack

Tool Version Purpose
Vitest 4+ Test runner
React Testing Library 16+ Component testing
jsdom - Test environment
TypeScript 5+ Type safety

Note: keep this list up to date with the project's dependencies.

Key Commands

Always prefer running specific tests over the entire suite for faster feedback:

# Run ALL tests (avoid during development)
npx vitest run

# ✅ PREFERRED: Run specific file
npx vitest run src/components/Button.spec.tsx

# ✅ PREFERRED: Run tests matching a pattern
npx vitest run --grep "Button"
npx vitest run -t "should render"

# ✅ PREFERRED: Run specific describe block
npx vitest run --grep "Button > Rendering"

# ✅ Run tests in a directory
npx vitest run src/components/

# ✅ Run single test by name
npx vitest run -t "should disable button when loading"

Watch Mode (Background Testing)

Use watch mode for efficient iterative development:

# ✅ Watch mode - reruns on file changes
npx vitest

# ✅ Watch specific file
npx vitest src/components/Button.spec.tsx

# ✅ Watch tests matching pattern
npx vitest --grep "Button"

Read the full file on GitHub · 317 lines

Files

What ships with it

8 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. 2d ago First seen · 317 lines · 48 tokens per session scan A fc56500f072f

Subscribe to this mod's changes

frontend-testing is a skill published in the GitHub repository PageAI-Pro/ralph-loop (294 stars, last pushed 2mo ago), licensed MIT. It adds 48 tokens to every session and 2,297 once invoked, about $0.0002 per session on Opus 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

Other skills, from other repositories

test-component

Write React Testing Library tests for an existing component, following the project's RTL conventions (prefer role/label queries, mock at network boundary, no act()). Invoke when the user asks to test, add tests for, or cover a component.

MuhammadUsmanGM/claude-code-best-practices · 50 tokens

copilotkit-upgrade

Use when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to AG-UI protocol runtime, and resolving breaking API changes.

CopilotKit/CopilotKit · 48 tokens

python-testing

Guidelines for writing and running tests in the Agent Framework Python codebase. Use this when creating, modifying, or running tests.

microsoft/agent-framework · 29 tokens

react-core

@copilotkit/react-core — mount the CopilotKit provider (from @copilotkit/react-core/v2) in a Next.js App Router / React Router v7 / TanStack Start / SPA app, drop in CopilotChat/CopilotPopup/CopilotSidebar (v2 chat components ship from react-core/v2 — NOT react-ui, which is CSS-only in v2), access and subscribe to…

CopilotKit/CopilotKit · 191 tokens

vitest

Vitest unit testing patterns with React Testing Library. Trigger: When writing unit tests for React components, hooks, or utilities.

prowler-cloud/prowler · 28 tokens

writing-tests

How to write a Kiro Crew backend test that has NO side effects and does not flake. Use when adding, editing, reviewing, or debugging a pytest test in the Kiro Crew source repo: which conftest is under your file, what leaks (temp dirs, the real data home, /.kiro, cron, threads, child processes), how to tell which of…

kirodotdev/KiroCrew · 123 tokens