一键导入
react-testing
WHEN testing React components/hooks/context with React Testing Library; NOT e2e; covers renderHook, providers, forms, and anti-patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
WHEN testing React components/hooks/context with React Testing Library; NOT e2e; covers renderHook, providers, forms, and anti-patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
WHEN scraping iOS/macOS App Store data (apps, reviews, ratings, search); NOT for installing or testing apps; retrieves structured JSON data using iTunes/App Store APIs with curl and jq formatting
Comprehensive guide for implementing on-device AI models on iOS using Foundation Models and MLX Swift frameworks. Use WHEN building iOS apps with (1) Local LLM inference, (2) Vision Language Models (VLMs), (3) Text embeddings, (4) Image generation, (5) Tool/function calling, (6) Multi-turn conversations, (7) Custom model integration, or (8) Structured generation.
WHEN building ChatGPT apps using the OpenAI Apps SDK and MCP; create conversational, composable experiences with proper UX, UI, state management, and server patterns.
WHEN building SwiftUI views, managing state, setting up shared services, or making architectural decisions; NOT for UIKit or legacy patterns; provides pure SwiftUI data flow without ViewModels using @State, @Binding, @Observable, and @Environment.
WHEN building design systems or component libraries with Tailwind CSS; covers design tokens, CVA patterns and dark mode.
WHEN building React components/pages/apps; enforces scalable architecture, state management, API layer, performance patterns.
| name | react-testing |
| description | WHEN testing React components/hooks/context with React Testing Library; NOT e2e; covers renderHook, providers, forms, and anti-patterns. |
This skill focuses on React-specific testing patterns. For general DOM testing patterns (queries, userEvent, async, accessibility), load the frontend-testing skill. For TDD workflow, load the tdd skill.
React components are functions - Test them like functions: inputs (props) → output (rendered DOM).
Test behavior, not implementation:
Modern RTL handles cleanup automatically:
act() for render, userEvent, or async queriescleanup() - it's automaticbeforeEach| Topic | Guide |
|---|---|
| Testing components, props, and conditional rendering | components.md |
| Testing custom hooks with renderHook | hooks.md |
| Testing context providers and consumers | context.md |
| Testing form inputs, submissions, and validation | forms.md |
| Common React testing mistakes to avoid | anti-patterns.md |
| Loading states, error boundaries, portals, Suspense | advanced.md |
Use components.md when you need:
Use hooks.md when you need:
renderHookresult.current, act(), and rerender()Use context.md when you need:
wrapper option with providersUse forms.md when you need:
Use anti-patterns.md when you need:
act() wrappingcleanup() is unnecessarybeforeEach render patternsUse advanced.md when you need:
React-specific checks:
render() from @testing-library/react (not enzyme's shallow/mount)renderHook() for custom hookswrapper option for context providersact() calls (RTL handles it)cleanup() calls (automatic)beforeEach rendertdd skill)frontend-testing skill)