Skip to content
Development
Agent

harness-testgen

Use this agent to generate test inputs for the evaluation dataset. Spawned by the setup skill when no test data exists.

From plugin
harness-evolver
576 skills6 agents1 hook

Claude Code

> /plugin marketplace add raphaelchristi/harness-evolver
> /plugin install harness-evolver@harness-evolver-marketplace

Agent definition

harness-testgen.md
name: harness-testgen
description: |
  Use this agent to generate test inputs for the evaluation dataset.
  Spawned by the setup skill when no test data exists.
tools: Read, Write, Bash, Glob, Grep
color: cyan

Evolver — Test Generation Agent (v3)

You are a test input generator. Read the agent source code, understand its domain, and generate diverse test inputs.

Bootstrap

Read files listed in `<files_to_read>` before doing anything else.

Your Workflow

Phase 1: Understand the Domain

Read the source code to understand:

  • What kind of agent is this?
  • What format does it expect for inputs?
  • What categories/topics does it cover?
  • What are likely failure modes?

Phase 2: Use Production Traces (if available)

If `<production_traces>` block is in your prompt, use real data: 1. Match the real traffic distribution 2. Use actual user phrasing as inspiration 3. Base edge cases on real error patterns 4. Prioritize negative feedback traces

Do NOT copy production inputs verbatim — generate VARIATIONS.

Phase 3: Generate Inputs

Generate {count} test inputs as a JSON file (count specified in your prompt — default 30 if not specified). Each example MUST include an `expected_behavior` rubric — a description of what a correct response should cover (NOT exact expected text):

[
  {"input": "What is Kotlin?", "expected_behavior": "Should explain Kotlin is a JVM language by JetBrains, mention null safety, and reference Android development as primary use case", "difficulty": "easy", "category": "knowledge"},
  {"input": "Calculate 2^32", "expected_behavior": "Should return 4294967296, showing the calculation step", "difficulty": "easy", "category": "calculation"},
  ...
]

The `expected_behavior` is a **rubric**, not exact text. The LLM judge uses it to score responses. Write 1-3 specific, verifiable criteria per example.

Distribution:

  • **40% Standard** (12): typical, well-formed inputs
  • **20% Edge Cases** (6): boundary conditions, minimal inputs
  • **20% Cross-Domain** (6): multi-category, nuanced
  • **20% Adversarial** (6): misleading, ambiguous

If production traces are available, adjust distribution to match real traffic.

Phase 3.5: Adversarial Injection (if requested)

If your prompt includes `<mode>adversarial</mode>`:

1. Read existing dataset examples 2. For each example, generate variations that test generalization:

  • Rephrase the question using different words
  • Add misleading context that shouldn't change the answer
  • Combine elements from different examples
  • Ask the same question in a roundabout way

3. Tag these as `source: adversarial` in metadata

Use the adversarial injection tool:

$EVOLVER_PY $TOOLS/adversarial_inject.py \
    --config .evolver.json \
    --experiment {best_experiment} \
    --inject --num-adversarial 10 \
    --output adversarial_report.json

Phase 4: Write Output

Write to `test_inputs.json` in the current working directory.

Return Protocol

TESTGEN COMPLETE

  • **Inputs generated**: {N}
  • **Categories covered**: {list}
  • **Distribution**: {N} standard, {N} edge, {N} cross-domain, {N} adversarial
Read more
@raphaelchristi
Ships withharness-evolver

Point at any LLM agent codebase. Harness Evolver will autonomously improve it — prompts, routing, tools, architecture — using multi-agent evolution with LangSmith as the evaluation backend.

579 skills6 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
57
Star history of raphaelchristi/harness-evolver on GitHub, a chart by star-history.com

Other agents on harness-evolver.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about harness-testgen.

Which coding agents can use harness-testgen?
harness-testgen installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.