agentsclimarketplace

Testing agents with subagents

Skill notque/vexjoy-agent/skills/testing/testing-agents-with-subagents

VexJoy AI Agent with Intelligent Routing - /do routes plain-English requests to the right specialist agent and gates the work with reviews, tests, and a learning loop.

Install
npx -y skills add notque/vexjoy-agent --skill testing-agents-with-subagents

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Test agents via subagents: known inputs, captured outputs, verification.

SKILL.md

7.1 KB, as published. Nobody here has run it

Testing Agents With Subagents

Overview

This skill applies TDD methodology to agent development — RED (observe failures), GREEN (fix agent definition), REFACTOR (edge cases and robustness) — with subagent dispatch as the execution mechanism.

Test what the agent DOES, not what the prompt SAYS. Evidence-based verification only: capture exact outputs from subagent dispatch, verify every prompt change through testing. Always test via the Task tool, always test via the Task tool rather than reading prompts.

Minimum test counts vary by agent type: Reviewer agents need 6 cases (2 real issues, 2 clean, 1 edge, 1 ambiguous), Implementation agents 5 cases (2 typical, 1 complex, 1 minimal, 1 error), Analysis agents 4 cases (2 standard, 1 edge, 1 malformed), Routing/orchestration 4 cases (2 correct route, 1 ambiguous, 1 invalid). No agent is simple enough to skip testing — get human confirmation before exempting any agent.

Each test runs in a fresh subagent to avoid context pollution. After any fix, re-run ALL test cases to catch regressions. One fix at a time — you cannot determine what changed the outcome with multiple simultaneous fixes.


Reference Loading Table

SignalLoad These FilesWhy
example-driven tasks, errorsexamples-and-errors.mdLoads detailed guidance from examples-and-errors.md.
dispatch-and-capture, negative, consistency, A/B, and routing-verification test patternstesting-patterns.mdLoads detailed guidance from testing-patterns.md.

Instructions

Phase 0: PREPARE — Understand the Agent

Goal: Read the agent definition and understand what it claims to do before writing tests.

Step 1: Read the agent file

# Read agent definition
cat agents/{agent-name}.md

# Read any referenced skills
cat skills/{skill-name}/SKILL.md

Step 2: Identify testable claims

Extract concrete, testable behaviors from the agent definition:

  • What inputs does it accept?
  • What output structure does it produce?
  • What routing triggers should activate it?
  • What error conditions does it handle?
  • What skills does it invoke?

Step 3: Determine minimum test count

Agent TypeMinimum TestsRequired Coverage
Reviewer agents62 real issues, 2 clean, 1 edge, 1 ambiguous
Implementation agents52 typical, 1 complex, 1 minimal, 1 error
Analysis agents42 standard, 1 edge, 1 malformed
Routing/orchestration42 correct route, 1 ambiguous, 1 invalid

No gate — this phase is preparation. Move directly to Phase 1.

Phase 1: RED — Observe Current Behavior

Goal: Run agent with test inputs and document exact current behavior before any changes.

Step 1: Define test plan

Write the test plan to a file before executing — this creates a reproducible baseline. See ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md for the Test Plan template.

Step 2: Dispatch subagent with test inputs

Use the Task tool to dispatch the agent (see dispatch template in references/examples-and-errors.md). Each test runs in a fresh subagent — this prevents context pollution from earlier tests affecting later ones.

Step 3: Capture results verbatim

Document exact agent outputs. See the verbatim result capture template in references/examples-and-errors.md.

Step 4: Identify failure patterns

  • Which test categories fail (happy path, error, edge)?
  • Are failures structural (missing sections) or behavioral (wrong answers)?
  • Do failures correlate with input characteristics?

Gate: All test cases executed. Exact outputs captured verbatim. Failures documented with specific issues identified. Proceed only when gate passes.

Phase 2: GREEN — Fix Agent Definition

Goal: Update agent definition until all test cases pass. One fix at a time.

Step 1: Prioritize failures

Triage failures by severity — see the Failure Severity table in ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md (Critical/High/Medium/Low).

Step 2: Diagnose root cause

Map the failure type to a fix approach — see the Root Cause → Fix Approach table in references/examples-and-errors.md.

Step 3: Make one fix at a time

Change one thing in the agent definition. Re-run ALL test cases. Document which tests now pass/fail.

Make one fix at a time — you cannot determine which change was effective. Same debugging principle: one variable at a time.

Step 4: Iterate until green

Repeat Step 3 until all test cases pass. If a fix causes a previously passing test to fail, revert and try a different approach. Track fix iterations using the Fix Log template in references/examples-and-errors.md.

Gate: All test cases pass. No regressions from previously passing tests. Can explain what each fix changed and why. Proceed only when gate passes.

Phase 3: REFACTOR — Edge Cases and Robustness

Goal: Verify agent handles boundary conditions and produces consistent outputs.

Step 1: Add edge case tests

See the Edge Case Categories table in ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md (Empty / Large / Unusual / Ambiguous inputs).

Step 2: Run consistency tests

Run the same input 3 times. Outputs should be consistent:

  • Same structure
  • Same key findings (for analysis agents)
  • Acceptable variation in phrasing only

If inconsistent: add more explicit instructions to the agent definition. Re-test.

Step 3: Run regression suite

Re-run ALL test cases (original + edge cases) to confirm nothing broke during refactoring.

Step 4: Document final test report

See the Test Report template in ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md.

Gate: Edge cases handled. Consistency verified. Full suite green. Test report documented. Fix is complete.


Error Handling

See ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md for error cases: agent-type-not-found, inconsistent-outputs, subagent-timeout, agent-asks-questions.


Examples

See ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md for worked examples: testing a new reviewer agent, testing after agent modification, testing routing logic.


References

Integration

  • agent-comparison: A/B test agent variants
  • agent-evaluation: Structural quality checks
  • test-driven-development: TDD principles applied to agents

Reference Files

  • ${CLAUDE_SKILL_DIR}/references/testing-patterns.md: Dispatch patterns, test scenarios, eval harness integration
  • ${CLAUDE_SKILL_DIR}/references/examples-and-errors.md: Worked examples (new reviewer, modification, routing) and error handling (agent-not-found, inconsistency, timeout, question-asking)

Gives 0 of the 12 instructions most test skills give

Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-06

  • close the browser when donein 55 of 964, across 12 files
  • wait for network idle statein 51 of 964, across 6 files
  • launch chromium in headless modein 49 of 964, across 6 files
  • use descriptive selectors for elementsin 49 of 964, across 6 files
  • run provided scripts with help flag firstin 49 of 964, across 6 files
  • add appropriate explicit waitsin 48 of 964, across 5 files
  • use bundled scripts as black boxesin 46 of 964, across 3 files
  • do not read script source codein 46 of 964, across 3 files
  • use sync playwright for scriptsin 46 of 964, across 3 files
  • inspect dom before executing actionsin 46 of 964, across 3 files
  • run the full test suitein 36 of 964, across 34 files
  • write the failing test firstin 25 of 964, across 18 files

Said here and by no other author read

  • Test what the agent does, not what the prompt says
  • Test via the Task tool instead of reading prompts
  • Get human confirmation before exempting any agent from testing
  • Capture exact subagent outputs verbatim
  • Re-run all test cases after any fix
  • Run the same input 3 times to verify consistency

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.