ワンクリックで
frontend-testing
React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | frontend-testing |
| description | React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files. |
Components publish observable state through raw data-* attributes. Tests consume that contract through DOM-first helpers.
No role/text queries, no assertions on formatted text, no CSS/class assertions.
Components with tests publish data-component="kebab-name" on the root element.
Observable state becomes raw data-* attributes:
Pass values directly unless conversion is genuinely required by the source value. Do not stringify booleans or numbers manually. Do not turn absence into null, "null", "undefined", or "".
data-active={response.active}
data-id={response?.id}
Visual formatting stays in JSX. Tests assert on raw dataset values.
Use entity-specific IDs: data-media-id, data-download-id, data-release-id. Never data-id.
Interactive children publish data-slot="semantic-name" scoped by the parent.
Only publish attributes a test consumes. Add a new attribute in the same change as the test that uses it. If the last consumer disappears, remove the attribute.
Use the project DOM helpers, usually get, query, and slot from tests/web/dom.ts.
get(component, filters?): returns exactly one element or throws.query(component, filters?): returns one element, null, or throws on many.slot(parent, name): returns a named child slot.DOM attributes are strings in filters: { ratio: "0.65" }, not { ratio: 0.65 }.
Use the project testing-library wrapper, usually tests/web/testing-library.ts. It should expose only approved APIs such as render, renderHook, waitFor, fireEvent, userEvent, cleanup, and act.
Do not import directly from @testing-library/react or @testing-library/user-event.
Harnesses provide context, not behavior: providers, router, query client, stores, seeded data, and boundary HTTP.
Do not duplicate production ownership in a harness. If behavior belongs to a hook, route, store, or parent, test through that owner. Test a leaf directly only for behavior the leaf owns.
HTTP mocking is project-specific. Use the project boundary strategy.
Do not use:
document.querySelector / document.querySelectorAllscreen.*getByRole, findByText, getByLabelText, or any *By* queryIf you miss a *By* query, the component is missing an observable data-* contract.
See examples.md for component, flow, hook, waiting, absence, and multiple-element examples.
Skill writing principles. Use when creating, editing, or reviewing any SKILL.md.
Skill rule extraction and creation. Use when the user says /learn.
Kysely database queries. Use when writing, reviewing, or debugging Kysely selects, mutations, joins, transactions, filters, or aggregates.
Frontend components and Tailwind. Use when creating, reviewing, refactoring, splitting, or organizing React components, shared components, component folders, or Tailwind classes.
TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks.
Lint and optimize existing skills. Use when the user says /skill-linter.