Component Test Scaffold (React)

Component Test Scaffold (React) is a skill for Claude Code from s977043/river-review. It costs 19 tokens per session (800 once invoked), scanned A, original, MIT.

A generator for React component test skeletons using React Testing Library, a tool for testing user-visible component behavior. It creates tests from written specifications.

In plain words
What is it for?
Use it to outline tests for framework-independent React components, such as buttons, forms, and conditional UI. The output is a starting point rather than implemented test logic.
Why use it?
It provides a structure for checking rendered content, props, event handlers, and changing display states without covering the whole application or browser journeys.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river-review plugin — 138 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit Use it to outline tests for framework-independent React components, such as buttons, forms, and conditional UI. The output is a starting point rather than implemented test logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s977043/river-review/code-react
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 s977043/river-review --skill code-react
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 138 skills, 18 commands, 5 agents, 3 hooks.

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 Component Test Scaffold (React)

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/code-react.svg)](https://agentmods.dev/skills/s977043/river-review/code-react)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/code-react"><img src="https://agentmods.dev/badge/skills/s977043/river-review/code-react.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 800 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.
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.00019 $0.00800
Opus 5 $0.00010 $0.00400
Sonnet 5 $0.00004 $0.00160
Haiku 4.5 $0.00002 $0.00080

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

Security

Grade A, and why

Component Test Scaffold (React) 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 5d 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.

skills/upstream/code-react/SKILL.md · 79 lines

What it actually says

Pattern declaration

Primary pattern: Generator Secondary patterns: Inversion Why: 仕様書からReactコンポーネントテストの足場を生成するジェネレーターであり、仕様の抜けをテスト観点から逆照射する。

Role

あなたは熟練したReact開発者です。 仕様書で定義されたUIコンポーネントの要件を満たすための「React Testing Libraryを用いたテストコード」を作成してください。

Non-goals / 扱わないこと

  • 実装コードのロジックや最適化方針を記述しない。
  • E2E/統合テストの網羅は対象外とし、コンポーネント単位の足場に限定する。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分に仕様書(docs/**/*.md または specs/**/*.md)が含まれている
  • 仕様書にReactコンポーネントに関する記述がある
  • inputContextにfullFileが含まれている

ゲート不成立時の出力: NO_REVIEW: code-react — 対象となるReactコンポーネント仕様が差分に含まれていない

False-positive guards / 抑制条件

  • 仕様に明示されていない要件を推測で追加しない。
  • 対象外と明記された領域(例: 外部API連携の実装詳細)への指摘は行わない。

Output Format

TypeScript (.tsx) のコードブロック。 render, screen, userEvent を使用したテストケースを作成します。 フレームワーク(Next.js/Remix)に依存しない、純粋なコンポーネントの振る舞い(Props受け渡し、イベントハンドラ呼び出し、表示切り替え)に注目してください。

Example

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Button } from './Button';

describe('Button', () => {
  it('calls onClick handler when clicked', async () => {
    const handleClick = vi.fn(); // or jest.fn()
    render(<Button onClick={handleClick}>Click Me</Button>);

    await userEvent.click(screen.getByRole('button', { name: /click me/i }));

    expect(handleClick).toHaveBeenCalledTimes(1);
  });
});

Constraints

  • getByRole, getByLabelText などのアクセシビリティを意識したクエリを優先してください。
  • userEvent を使用して、実際のユーザー操作に近いイベント発火を行ってください。
  • テストランナーは Vitest または Jest どちらでも動作する標準的な書き方を心がけてください。
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. 5d ago First seen · 79 lines · 19 tokens per session scan A be61437f58b1

Subscribe to this mod's changes

Component Test Scaffold (React) is a skill published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 800 once invoked, about $0.0001 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-09-03.