react18-test-guardian

react18-test-guardian is an agent for Claude Code from github/awesome-copilot. It costs 81 tokens per session (2,878 once invoked), scanned A, original, MIT.

A test-maintenance agent for React 18 migrations that fixes failing tests caused by changed rendering, asynchronous updates, StrictMode, or testing-library APIs. It can also replace Enzyme tests, where needed, with React Testing Library tests.

In plain words
What is it for?
Use it to establish test failures, migrate Enzyme tests, update React Testing Library usage, handle async act behavior and batching changes, and confirm the suite passes.
Why use it?
A React upgrade can break tests even when the application code looks correct. This agent addresses the differences and repeatedly runs the suite to verify the repairs.

Agent for Claude Code ✓ vendor

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions subagents; Copilot chat-mode frontmatter (tools: vscode/*).

Good fit Use it to establish test failures, migrate Enzyme tests, update React Testing Library usage, handle async act behavior and batching changes, and confirm the suite passes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/github/awesome-copilot/react18-test-guardian
About the project

Awesome GitHub Copilot is a community collection of custom agents, instructions, skills, hooks, workflows, plugins, and configuration for GitHub Copilot. It helps Copilot users customize coding and development tasks. Catalogue entries are individual Copilot add-ons from this collection.

github/awesome-copilot · 38,691 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/github/awesome-copilot

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react18-test-guardian

README.md
[![agentmods](https://agentmods.dev/badge/agents/github/awesome-copilot/react18-test-guardian.svg)](https://agentmods.dev/agents/github/awesome-copilot/react18-test-guardian)
Your own site
<a href="https://agentmods.dev/agents/github/awesome-copilot/react18-test-guardian"><img src="https://agentmods.dev/badge/agents/github/awesome-copilot/react18-test-guardian.svg" alt="Measured on agentmods" height="20"></a>
Per session 81 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,878 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02878
Opus 5 $0.00041 $0.01439
Sonnet 5 $0.00016 $0.00576
Haiku 4.5 $0.00008 $0.00288

Measured 3d ago against content hash b225f96af049, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

react18-test-guardian scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

agents/react18-test-guardian.agent.md · 368 lines

How it starts

The opening of the file, as written. The whole thing — 368 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React 18 Test Guardian - React 18 Test Migration Specialist

You are the React 18 Test Guardian. You fix every failing test after the React 18 upgrade. You handle the full range of React 18 test failures: RTL v14 API changes, automatic batching behavior, StrictMode double-invoke changes, act() async semantics, and Enzyme rewrites if required. You do not stop until zero failures.

Memory Protocol

Read prior state:

#tool:memory read repository "react18-test-state"

Write after each file and each run:

#tool:memory write repository "react18-test-state" "file:[name]:status:fixed"
#tool:memory write repository "react18-test-state" "run-[N]:failures:[count]"

Boot Sequence

# Get all test files
find src/ \( -name "*.test.js" -o -name "*.test.jsx" -o -name "*.spec.js" -o -name "*.spec.jsx" \) | sort

# Check for Enzyme (must handle first if present)
grep -rl "from 'enzyme'" src/ --include="*.test.*" 2>/dev/null | wc -l

# Baseline run
npm test -- --watchAll=false --passWithNoTests --forceExit 2>&1 | tail -30

Record baseline failure count in memory: baseline:[N]-failures


CRITICAL FIRST STEP - Enzyme Detection & Rewrite

If Enzyme files were found:

grep -rl "from 'enzyme'\|require.*enzyme" src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

Enzyme has NO React 18 support. Every Enzyme test must be rewritten in RTL.

Enzyme → RTL Rewrite Guide

// ENZYME: shallow render
import { shallow } from 'enzyme';
const wrapper = shallow(<MyComponent prop="value" />);

// RTL equivalent:
import { render, screen } from '@testing-library/react';
render(<MyComponent prop="value" />);
// ENZYME: find + simulate
const button = wrapper.find('button');
button.simulate('click');
expect(wrapper.find('.result').text()).toBe('Clicked');

// RTL equivalent:
import { render, screen, fireEvent } from '@testing-library/react';
render(<MyComponent />);
fireEvent.click(screen.getByRole('button'));
expect(screen.getByText('Clicked')).toBeInTheDocument();

Read the full file on GitHub · 368 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 368 lines · 81 tokens per session scan A b225f96af049

Subscribe to this mod's changes

react18-test-guardian is an agent published in the GitHub repository github/awesome-copilot (38,691 stars, last pushed today), licensed MIT. It adds 81 tokens to every session and 2,878 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

react-testing

React component testing with Testing Library — anti-patterns, hook testing, behavior-first assertions.

bdfinst/agentic-dev-team · 20 tokens

frontend-runtime-verifier

Runtime verification specialist that boots a web frontend headlessly, drives it to the changed surface, and captures pixel, console, and network evidence to return a PASS/FAIL verdict with the one screenshot a reviewer needs.

pjt222/agent-almanac · 46 tokens

staff-frontend

Staff frontend engineer expert in React 19, JavaScript, Tailwind CSS v4, Storybook, Playwright E2E testing, HTML, CSS, and API integration. Use proactively for frontend implementation, component development, styling, and frontend testing.

ATTCKDigital/smith · 55 tokens

ts-tester

Write concise, resilient, modern Unit, Component, and Hook tests using Vitest and React Testing Library for Next.js project. Use when asked to test, write tests, add coverage, verify a module, lock a bug with a regression test, or after implementation changes need test coverage. Also use when the user mentions Vitest…

sergeyklay/.agents · 127 tokens

test-engineer

Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.

ashrafmusa/agenticana · 49 tokens

angular-validator

Phase 6 — run Angular frontend validation gates (lint, typecheck, unit tests, build, e2e) and merge results into validation artifacts. Use when running /validate for features that change Angular source.

loiane/specs-driven-development-spring-angular · 46 tokens