react18-test-guardian

react18-test-guardian is an agent for Claude Code from archubbuck/workspace-architect. It costs 81 tokens per session (2,878 once invoked), scanned A, a copy of react18-test-guardian, ISC.

A test migration and verification agent for React 16 or 17 projects moving to React 18.3.1. It updates tests for React 18 behavior, including async act(), automatic batching, Strict Mode, and Enzyme replacements.

In plain words
What is it for?
It finds test files, records a baseline, rewrites Enzyme tests to React Testing Library when needed, and verifies the final test results.
Why use it?
React 18 can change when updates happen and how often development code runs, causing existing tests to fail. The agent fixes these failures and reruns the suite until it passes.

Agent for Claude Code

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

Good fit It finds test files, records a baseline, rewrites Enzyme tests to React Testing Library when needed, and verifies the final test results.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/archubbuck/workspace-architect/react18-test-guardian
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/archubbuck/workspace-architect

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/archubbuck/workspace-architect/react18-test-guardian.svg)](https://agentmods.dev/agents/archubbuck/workspace-architect/react18-test-guardian)
Your own site
<a href="https://agentmods.dev/agents/archubbuck/workspace-architect/react18-test-guardian"><img src="https://agentmods.dev/badge/agents/archubbuck/workspace-architect/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 100% copy Near-identical to another mod 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

This is a copy

100% identical to react18-test-guardian — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

assets/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 archubbuck/workspace-architect (18 stars, last pushed 3d ago), licensed ISC. 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. It is 100% identical to react18-test-guardian, differing in 0 lines, and is treated as a copy.

Related

Other agents, from other repositories

react18-test-guardian

Test suite fixer and verifier for React 16/17 → 18.3.1 migration. Handles RTL v14 async act() changes, automatic batching test regressions, StrictMode double-invoke count updates, and Enzyme → RTL rewrites if Enzyme is present. Loops until zero test failures. Invoked as subagent by react18-commander.

github/awesome-copilot · 81 tokens

react19-test-guardian

Test suite fixer and verification specialist. Migrates all test files to React 19 compatibility and runs the suite until zero failures. Uses memory to track per-file fix progress and failure history. Does not stop until npm test reports 0 failures. Invoked as a subagent by react19-commander.

github/awesome-copilot · 67 tokens

react18-dep-surgeon

Dependency upgrade specialist for React 16/17 → 18.3.1. Pins to 18.3.1 exactly (not 18.x latest). Upgrades RTL to v14, Apollo 3.8+, Emotion 11.10+, react-router v6. Detects and blocks on Enzyme (no React 18 support). Returns GO/NO-GO to commander.

github/awesome-copilot · 87 tokens

react19-dep-surgeon

Dependency upgrade specialist. Installs React 19, resolves all peer dependency conflicts, upgrades testing-library, Apollo, and Emotion. Uses memory to log each upgrade step. Returns GO/NO-GO to the commander. Invoked as a subagent by react19-commander.

github/awesome-copilot · 63 tokens

prism

Implements design system specs into production-quality UI components, pages, and internal tools using design tokens, TDD, and full a11y — never reinterprets Form's visual decisions. Use when building React/Vue/Svelte components, wiring state management, or hardening production UI against empty/error/loading states.…

jeremylongshore/tons-of-skills-marketplace · 78 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