Component Test Scaffold (Next.js)

Component Test Scaffold (Next.js) is a skill for Claude Code, Codex from s977043/river-review. It costs 22 tokens per session (850 once invoked), scanned A, original, MIT.

A generator for Next.js and React component test skeletons using React Testing Library. It turns component and user-interface requirements into a starting set of tests.

In plain words
What is it for?
Use it to outline tests for Next.js or React components, including clicks, text entry, and changing display states. It does not cover full end-to-end user journeys.
Why use it?
It helps you plan checks for rendered content and user interactions before filling in the test details, while keeping the focus on individual components.

Skill for Claude CodeCodex

Part of the river-review plugin — 140 skills, 15 commands, 5 agents, 2 hooks shipped together

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/s977043/river-review/code-nextjs
Any agent
npx skills add s977043/river-review --skill code-nextjs
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code, Codex.

Or install river-review, the plugin that ships this one along with the rest of its 140 skills, 15 commands, 5 agents, 2 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 (Next.js)

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/code-nextjs.svg)](https://agentmods.dev/skills/s977043/river-review/code-nextjs)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/code-nextjs"><img src="https://agentmods.dev/badge/skills/s977043/river-review/code-nextjs.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 850 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.1 $0.00022 $0.00850
Opus 5 $0.00011 $0.00425
Sonnet 5 $0.00004 $0.00170
Haiku 4.5 $0.00002 $0.00085

Measured yesterday against content hash 052a51e5acbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

Component Test Scaffold (Next.js) 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 yesterday.

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-nextjs/SKILL.md · 83 lines

What it actually says

Pattern declaration

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

Role

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

Non-goals / 扱わないこと

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

Pre-execution Gate / 実行前ゲート

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

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

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

False-positive guards / 抑制条件

  • 仕様に明記されていない要件を推測で追加しない。
  • テスト対象外と明記された領域(例: 外部APIモック不可など)への指摘は行わない。

Output Format

TypeScript (.tsx) のコードブロック。 render, screen を使用したテストケースを作成します。 ユーザーインタラクション(クリック、入力)や表示状態の検証を // TODO で記述してください。

Example

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

describe('LoginForm', () => {
  it('renders email and password inputs', () => {
    render(<LoginForm />);
    // TODO: Assert inputs are in the document
  });

  it('shows error message on invalid submission', async () => {
    render(<LoginForm />);
    // TODO: Setup userEvent
    // TODO: Fill invalid data
    // TODO: Click submit (use userEvent)
    // TODO: Assert error message appears
  });
});

Constraints

  • 実装詳細(クラス名や内部state)ではなく、ユーザーから見た振る舞い(アクセシビリティロール、テキスト、ラベル)で要素を取得する方針(getByRole, getByLabelText 等)を推奨してください。
  • 非同期処理(APIコールなど)が含まれる場合は async/awaitwaitFor などの適切な待機処理を示唆してください。
  • Server Components (RSC) か Client Components かで判断し、必要に応じてモックの方針(jest.mock 等)をコメントしてください。
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. yesterday First seen · 83 lines · 22 tokens per session scan A 052a51e5acbd

Subscribe to this mod's changes

Component Test Scaffold (Next.js) is a skill published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 850 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.

Related

Other skills, from other repositories

server-side-calls

Call tRPC procedures directly from server code using t.createCallerFactory() and router.createCaller(context) for integration testing, internal server logic, and custom API endpoints. Catch TRPCError and extract HTTP status with getHTTPStatusCodeFromError(). Error handling via onError option.

trpc/trpc · 61 tokens

testing

Skill "testing" from udecode/plate-playground-template, covering testing goal, core rules, seam selection, fixtures and assertions and quick reference.

udecode/plate-playground-template · 5 tokens

laravel-testing

Use when testing controllers, services, or models, or implementing TDD on Laravel 13 with Pest 4 / PHPUnit 12.

fusengine/agents · 31 tokens

testing-react

Writes React/TypeScript tests using Vitest and React Testing Library. Use when "write react tests", "vitest", "component test", "hook test", "RTL", "testing library", "snapshot test", or testing React components, hooks, and utilities.

iliaal/whetstone · 57 tokens

stitch-react-native-components

Converts a Stitch mobile screen, a local HTML file, or a URL into React Native / Expo components — TypeScript, StyleSheet, Expo Router, dark mode via useColorScheme, and proper touch targets. Cross-platform iOS and Android. Only the Stitch route needs an API key.

gabelul/stitch-kit · 65 tokens

stitch-nextjs-components

Converts a Stitch screen, a local HTML file, or a URL into production-ready Next.js 15 App Router components — Server vs Client split, dark mode via CSS variables, TypeScript strict, ARIA, and responsive mobile-first layout. Only the Stitch route needs an API key.

gabelul/stitch-kit · 64 tokens