Works with the AI Agents you already use
React Testing Library Test Writer
by Saizul Amin
This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice.
$4
React Testing Library Test Writer
Example session with this skill installed
Run the React Testing Library Test Writer skill on my project and give me a prioritised list of what to fix, with exact changes.
- Read your context and instructions
- Compiled the react testing library
Here is what the React Testing Library Test Writer skill produced.
Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.
Output
setup: runner=jest, react_testing_library=False, user_event=False, jest_dom=False, msw=False, playwright=False, dom_env=False
untested components/hooks: 3 (top 3 by risk)
10 component components/Modal.tsx (15 lines, 3 handlers, 2 hooks)
7 hook hooks/useCart.ts (7 lines, 0 handlers, 1 hooks)
0 component components/Button.tsx (4 lines, 0 handlers, 0 hooks)
test suite: 1 high, 3 medium, 5 low, 1 info
HIGH TST010 components/Header.test.tsx:4
describe.only: every other test in the file is skipped
fix: remove .only; add --allowOnly=false (vitest) or a lint rule in CI
MEDIUM TST012 components/Header.test.tsx:7
real-time sleep in a test (slow and flaky)
fix: await findBy*/waitFor, or vi.useFakeTimers() / jest.useFakeTimers()
MEDIUM TST002 package.json
@testing-library/react is not installed
MEDIUM TST003 package.json
no DOM environment (jsdom / happy-dom) installed
fix: npm i -D jsdom and set test.environment = 'jsdom'
LOW TST015 components/Header.test.tsx
snapshot-only test file (passes after any re-render)
fix: assert behaviour: visible text, roles, callbacks
LOW TST013 components/Header.test.tsx:8
container.querySelector ties the test to markup
fix: query by role/label: screen.getByRole('button', { name: /save/i })
LOW TST011 components/Header.test.tsx:10
1 skipped/todo test(s)
LOW TST004 package.json
@testing-library/user-event not installed
fix: user-event simulates real interactions (focus, keyboard) better than fireEvent
LOW TST005 package.json
@testing-library/jest-dom not installed
fix: adds toBeInTheDocument(), toHaveAccessibleName() ... ; import it in the setup file
INFO TST006 .
jest has no config file in the project root
What you do next
- Fix the highest-severity items first.
- Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
- Keep the skill installed and re-run it whenever the project changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Write and fix tests for React and Next.js with React Testing Library plus Vitest or Jest - project setup (jsdom, @vitejs/plugin-react, next/jest, jest-dom, user-event), accessible queries (getByRole, getByLabelText), async UI with findBy and waitFor, user-event interactions, mocking next/navigation, fetch with MSW, Server Actions and modules, testing hooks with renderHook, forms with useActionState, fake timers, and when to use Playwright instead (async Server Components, full flows). Includes a script that detects the test setup, lists untested components and hooks ranked by risk, and flags test smells such as .only, sleeps, container.querySelector and snapshot-only tests.
Who it's for
Use when the user asks to add tests, set up Vitest or Jest in Next.js, fix flaky or failing React tests, "test this component/hook/form", mock useRouter, or find what is not tested.
What's inside
- Tested, offline Python script(s): find_test_gaps.py (deterministic results, standard library only unless noted)
- Reference guides: recipes.md, setup.md
- Step-by-step agent instructions in SKILL.md covering: When to use; When not to use; Workflow; Query priority
Why it's worth it
Generic prompts guess. This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice. See the real demo below.
Works with every major AI agent
Built on the open SKILL.md standard: Claude Code, Codex CLI, Cursor, VS Code Copilot, Gemini CLI, Windsurf and 20+ other agents.
Requirements
- Python 3.8+ for the bundled scripts
- No API keys, no account, runs locally
Open source: saizul/nextjs-react-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
- vitest
Node.jsjestPlaywright
Python 3.8+
Permissions
Allowed Hosts