test

A context-aware test runner that selects tests based on the project's current state and the work being done.

In plain words
What is it for?
Use it to run focused tests during development, investigate failed tests, or run the full test suite with linting, type checks, and coverage before a commit.
Why use it?
It avoids running an unnecessarily broad or narrow set of checks by considering changed files, earlier failures, recent commands, and whether the code is ready to commit.

Command

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 commands/brennercruvinel/ccplugins/test
Clone the repo
git clone --depth 1 https://github.com/brennercruvinel/CCPlugins
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 1,216 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.01216
Opus 5 $0.00000 $0.00608
Sonnet 5 $0.00000 $0.00243
Haiku 4.5 $0.00000 $0.00122

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

Security

Grade A, and why

test 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 2d 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.

commands/test.md · 168 lines

How it starts

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

Smart Test Runner - Context Aware

I'll intelligently run tests based on your current context and actively help fix failures.

Context Detection First: Let me understand what context I'm in:

  1. Cold Start (no previous context):

    • Run full test suite with coverage
    • Generate complete health report
    • Identify chronic failures
  2. Active Session (you're implementing features):

    • Check git diff for modified files
    • Read CLAUDE.md for session goals
    • Test ONLY what you've been working on
    • Incremental testing as you code
  3. Post-Command Context:

    • After /scaffold: Test the new component
    • After /fix-todos: Test modified files
    • After /fix-imports: Re-run previously failed tests
    • After /security-scan: Security-focused tests
    • After /format: Quick smoke tests only
  4. Debug Context (previous test failures):

    • Focus on failed tests with verbose output
    • Add strategic debug logging
    • Run in isolation mode
  5. Pre-Commit Context:

    • Full suite + lint + typecheck
    • Coverage report for PR
    • No skipped tests allowed

Phase 1: Deep Project Analysis Using native tools to understand your testing setup:

  • Glob to find configuration files in project root
  • Read test configurations and CI/CD workflows
  • Grep test patterns to understand testing style
  • Read documentation for test instructions

I'll detect:

  • Test frameworks and runners
  • Test file patterns and locations
  • Coverage requirements
  • Integration vs unit test separation
  • CI/CD test commands

Phase 2: Intelligent Test Execution I'll run tests with appropriate flags for maximum insight based on your project's testing framework, using verbose output and fail-fast when available to quickly identify issues.

Build & Compilation Check:

  • Verify project builds successfully before running tests
  • Watch console output for compilation errors
  • Capture and analyze build warnings that might affect tests
  • Check for missing dependencies or version conflicts

Real-time Monitoring:

# Monitor test execution with timestamps
# Capture both stdout and stderr
# Watch for timeout patterns
# Track memory usage if tests hang

Phase 3: Failure Analysis & Auto-Fix When tests fail, I'll:

  1. Parse failure output to understand exact issues
  2. Read failing test to understand expectations
  3. Read implementation to find the bug
  4. Analyze patterns from similar tests that pass
  5. Apply fixes when confident

Common fixes I'll attempt:

  • Async/await timing issues
  • Mock/stub configuration
  • Import path problems
  • Type mismatches
  • Null/undefined handling
  • Off-by-one errors
  • Environment variable issues

Phase 4: Advanced Diagnostics For complex failures:

  • Run single test in isolation
  • Add debug logging strategically
  • Check test dependencies and setup/teardown
  • Verify test data and fixtures
  • Analyze flaky test patterns

Log Analysis:

  • Read test output logs for hidden errors
  • Grep for common error patterns in console output
  • Analyze stack traces to pinpoint exact failure location
  • Check for environment-specific issues in logs
  • Identify resource conflicts (ports, files, databases)

Console Pattern Detection:

  • Memory leaks ("JavaScript heap out of memory")
  • Port conflicts ("address already in use")
  • Permission errors ("EACCES", "Permission denied")
  • Timeout issues ("Timeout - Async callback")
  • Module resolution failures
  • Database connection issues

Phase 5: Coverage & Quality After fixing tests:

  • Run coverage report if available
  • Identify untested code paths
  • Suggest critical missing tests
  • Check for test anti-patterns

When I find multiple issues, I'll create a todo list to fix them systematically.

Build Failure Recovery: If build fails before tests:

  • Analyze compilation errors in detail
  • Check for missing dependencies
  • Verify environment setup
  • Suggest specific fixes based on error patterns
  • Offer to install missing packages if detected

Read the full file on GitHub · 168 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. 2d ago First seen · 168 lines · 0 tokens per session scan A 35ac3da76a76

Subscribe to this mod's changes

test is a command published in the GitHub repository brennercruvinel/CCPlugins (2,780 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,216 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.