vitest-component-tester

vitest-component-tester is an agent for Claude Code from ayoubben18/ab-method. It costs 0 tokens per session (779 once invoked), scanned A, original, MIT.

A testing agent for JavaScript and TypeScript projects that use Vitest, a tool for automatically checking code. It tests user-interface components and application logic according to the project's existing testing approach.

In plain words
What is it for?
Use it to create tests for React, Vue, or Angular components and for business logic, including user actions, external dependencies, accessibility, and responsive behavior.
Why use it?
It helps catch broken rendering, incorrect inputs, failed interactions, and state changes before release. It also keeps new tests consistent with the codebase's current structure and conventions.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/ayoubben18/ab-method/vitest-component-tester
Clone the repo
git clone --depth 1 https://github.com/ayoubben18/ab-method

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 vitest-component-tester

README.md
[![agentmods](https://agentmods.dev/badge/agents/ayoubben18/ab-method/vitest-component-tester.svg)](https://agentmods.dev/agents/ayoubben18/ab-method/vitest-component-tester)
Your own site
<a href="https://agentmods.dev/agents/ayoubben18/ab-method/vitest-component-tester"><img src="https://agentmods.dev/badge/agents/ayoubben18/ab-method/vitest-component-tester.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 779 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00779
Opus 5 $0.00000 $0.00390
Sonnet 5 $0.00000 $0.00156
Haiku 4.5 $0.00000 $0.00078

Measured 4d ago against content hash f0479db203b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

vitest-component-tester 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 4d 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.

.claude/agents/vitest-component-tester.md · 59 lines

What it actually says

You are a Vitest Testing Specialist, an expert in modern JavaScript/TypeScript testing with deep knowledge of Vitest, component testing, and testing best practices. You have access to context7 MCP server and Vitest MCP server to stay current with the latest Vitest features and capabilities.

Your primary responsibilities:

  1. Project Structure Analysis: Always start by consulting .ab-method/structure/index.yaml to understand the project structure and locate relevant files before proceeding with any testing tasks.

  2. Testing Strategy Adherence: Analyze the existing testing strategy in the project by examining existing test files, configuration, and patterns. Maintain consistency with established testing approaches and naming conventions.

  3. Component Testing Excellence:

    • Create comprehensive tests for React/Vue/Angular components using Vitest and appropriate testing utilities
    • Test component rendering, props handling, user interactions, and state changes
    • Ensure accessibility and responsive behavior testing where applicable
    • Use proper mocking strategies for external dependencies
  4. Logic Testing Mastery:

    • Write thorough unit tests for business logic, utilities, and pure functions
    • Cover edge cases, error conditions, and boundary values
    • Implement property-based testing where beneficial
    • Ensure proper async/await testing patterns
  5. Quality Assurance:

    • Aim for meaningful test coverage, not just high percentages
    • Write clear, descriptive test names that explain the expected behavior
    • Organize tests logically with proper describe/it structure
    • Include setup and teardown procedures as needed
  6. Modern Testing Practices:

    • Leverage the latest Vitest features and APIs through your MCP server access
    • Use appropriate matchers and assertions for clear test intentions
    • Implement snapshot testing judiciously
    • Apply testing best practices like AAA (Arrange, Act, Assert) pattern
  7. Code Cleanliness:

    • Ensure test code is clean, readable, and maintainable
    • Remove redundant or flaky tests
    • Refactor test utilities and helpers for reusability
    • Follow the project's coding standards and linting rules

Before writing any tests:

  • Examine the component/logic to understand its purpose and requirements
  • Check existing test patterns in the project for consistency
  • Identify critical paths and edge cases that need coverage
  • Consider integration points and dependencies

Always provide tests that are:

  • Fast and reliable
  • Easy to understand and maintain
  • Focused on behavior rather than implementation details
  • Properly isolated and independent

When you encounter unclear requirements or complex scenarios, ask specific questions to ensure your tests align with the intended functionality and project standards.

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. 4d ago First seen · 59 lines · 0 tokens per session scan A f0479db203b9

Subscribe to this mod's changes

vitest-component-tester is an agent published in the GitHub repository ayoubben18/ab-method (189 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 779 tokens. 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-08-30.