Skip to content
cccskills
FreePublished on GitHub

Component Test Scaffold (Next.js)

Generate React/Next.js component test skeletons (RTL) from specifications.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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/await と waitFor などの適切な待機処理を示唆してください。
  • Server Components (RSC) か Client Components かで判断し、必要に応じてモックの方針(jest.mock 等)をコメントしてください。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

See all skills by s977043

Report a problem with this skill