본문으로 건너뛰기
cccskills
무료GitHub에 공개

typescript-testing-frontend

Use when writing or reviewing TypeScript frontend tests — Jest unit/integration tests for React components and hooks built with Chakra UI, React Query, Zustand, and Next.js App Router. Triggers on edits to `*.test.tsx`, React component/hook test files (`.tsx`, not `.ts`) under `**/__tests__/`, custom test render helpers, or mentions of "frontend test", "component test", "hook test", "React test", "UI test".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(9)

  • SKILL.md5.3 KB
  • references/component-testing.md2.7 KB
  • references/coverage-and-policy.md972 B
  • references/framework-and-setup.md1.4 KB
  • references/hook-testing.md2.0 KB
  • references/mocking-patterns.md3.1 KB
  • references/queries-and-async.md1.3 KB
  • references/structure-and-naming.md1.6 KB
  • references/test-utilities.md1.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

TypeScript Testing — Frontend

You are operating as a frontend test engineer. Test what the user sees and does — accessibility-first queries, real interactions, no implementation-detail assertions.

Reference stack: Jest 29 with @swc/jest, React Testing Library 16, jest-dom matchers, jest-canvas-mock, in jsdom. All tests import from a custom render helper (e.g. @/test-utils/render) that wraps children in ChakraProvider + QueryClientProvider (with retries disabled). Tests are co-located in __tests__/ folders next to source files.

Mock Zustand stores via the selector pattern, services at the module boundary, and Next.js next/link / next/image / next/navigation modules. Prefer accessibility-first queries.

Universal Rules

  1. Import from your custom render helper — never directly from @testing-library/react.
  2. React Query retries disabled in test wrappers — prevents flaky async behavior.
  3. Accessibility-first queries — getByRole > getByText > getByLabelText > getByTestId.
  4. userEvent.setup() over fireEvent for realistic interactions.
  5. Mock at the module boundary — services, stores, Next.js modules.
  6. Use const React = require('react') inside jest.mock() factories.
  7. waitFor() for async, act() for sync state updates — never sleep().
  8. No snapshot tests — behavioral assertions only.
  9. Never test.skip() — fix or delete.
  10. Every it() asserts at least one observable behavior.
  11. Tests-only default — unless the user explicitly asked for production work, change tests only (no refactors, no public API or prop-surface changes, no new exports). When testability pain appears, capture it under Refactor opportunities (not in scope) (see below); do not implement those ideas unless instructed.

Tests-only default and refactor callouts

When writing or reviewing tests, default scope is tests only. Unless the user explicitly asks you to refactor production code or change public contracts (props, exports, module APIs), ship tests only. Do not rename props, split components, extract hooks, or change runtime behavior as part of test work.

Hard-to-test UI remains a useful design feedback signal — but feedback belongs in your response, not in silent production edits. When you notice testability issues, add a final section in your response titled Refactor opportunities (not in scope) with short bullets (what you observed, what would help). Omit the section if nothing is worth flagging.

Examples of when to flag: untestable or awkward seams (no stable boundary to mock/fake); heavy or nested mocks to assert one behavior; large wrapper/setup cost for a supposedly small unit; missing stable accessible names (roles, labels) so tests depend on getByTestId or brittle copy; business logic or I/O bundled in a component or hook so focused assertions are awkward.

Do not implement those refactors in the same turn unless instructed — hand off for follow-up. Record the signal; acting on it is a separate, explicit scope.

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when adversarially reviewing a document that makes formal or technical claims — math derivations, physics papers, statistical analyses, benchmark reports, whitepapers. Inventories every equation and quantitative claim, verifies each AS NAMED in the text (never a paraphrase or a neighboring statement), and classifies VERIFIED / REFUTED / UNVERIFIABLE / VACUOUS. Triggers on "check this paper", "verify these claims", "is this derivation right", "review this proof", "audit this benchmark", "does the math hold up". For source-code review see code-review-and-quality; for skill/agent library audits see skill-library-review; for content quality scoring see content-ops.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

Run Karpathy-style autoresearch optimization on any content. Generates 50+ variants, scores with a 5-expert simulated panel, evolves winners through multiple rounds, outputs optimized version + full experiment log. Use when optimizing landing pages, email sequences, ad copy, headlines, form pages, CTA text, or any conversion-focused content. Triggers on "optimize this page", "run autoresearch", "score these variants", "A/B test this copy".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

Tests in real browsers. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data via Chrome DevTools MCP.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

Conducts multi-axis code review across correctness, readability, architecture, security, and performance. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Triggers on "review my PR", "review this diff", "code review", "review this changeset", "is this ready to merge", "pre-merge review".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

Estimate the full development cost of an existing codebase from lines of code, architectural complexity, and team-composition overhead. Use for 'how much would this cost to build', 'what did this codebase cost', development-cost or build-cost estimates, calendar-time estimates, and Claude/AI ROI on a delivered codebase. Estimates by measured LOC and complexity, not by ticket volume.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

Auto-assembles a domain-specific expert panel (7–10 experts), scores any content or strategy artifact against a typed rubric, and iterates until the aggregate hits 90+ (max 3 rounds). Use as a quality gate on copy, email sequences, landing-page drafts, strategy docs, charts, titles, or recruiting evaluations — or when another skill needs a final review gate on its output. Triggers on "expert panel this", "score this", "rate these variants", "quality check this", "panel review", "expert score", "evaluate this copy/strategy/page". For variant generation and multi-round conversion optimization see autoresearch; for live-URL CRO auditing see conversion-ops; for the scripted content-production pipeline see content-pipeline.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

LazyIsEfficient/agentic-os172026년 7월 17일 업데이트

LazyIsEfficient의 스킬 모두 보기

이 스킬의 문제 신고