agentleFS
ArtesianaArtesiana/agent2/.github/skills/agent-qa/SKILL.md

agent-qa

Skill36 starsChanged 7 months agoMITView on GitHub

End-to-end QA testing for Agent2 agents. Starts the agent service, sends real API requests from eval datasets, validates responses against the output schema, and generates a health report with confidence stats. Use when asked to "test this agent", "QA the agent", "does this agent work", or "run agent health check".

  • Sends data out

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After generating a new agent with /brain-clone or /creating-agents

    line 12
  2. Distinctive:

    After changing an agent's prompt, tools, or schema

    line 13
  3. Distinctive:

    Before shipping an agent to production

    line 14
  4. Distinctive:

    When debugging unexpected agent behavior

    line 15
  5. Distinctive:

    Ask which agent to test if not obvious from context:

    line 21
  6. Distinctive:

    Check for existing eval datasets:

    line 29
  7. Very specific:

    If NO_EVAL_DATASET: generate test cases from the agent's example cases in config.yaml and the prompt in agent.py.

    line 42
  8. Distinctive:

    If the agent has operational learnings, show them:

    line 115
  9. Distinctive:

    If we started the agent in Step 3:

    line 129

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent QA

End-to-end testing for a deployed or locally running Agent2 agent.

When to Use

  • After generating a new agent with /brain-clone or /creating-agents
  • After changing an agent's prompt, tools, or schema
  • Before shipping an agent to production
  • When debugging unexpected agent behavior

Workflow

Step 1: Identify the agent

Ask which agent to test if not obvious from context:

ls agents/*/config.yaml 2>/dev/null | sed 's|agents/||;s|/config.yaml||'

Step 2: Load test cases

Check for existing eval datasets:

AGENT_NAME="<agent-name>"
EVAL_FILE="tests/promptfoo/$AGENT_NAME/dataset.json"
if [ -f "$EVAL_FILE" ]; then
  echo "EVAL_FOUND: $EVAL_FILE"
  cat "$EVAL_FILE"
else
  echo "NO_EVAL_DATASET"
fi

If NO_EVAL_DATASET: generate test cases from the agent's example cases in config.yaml and the prompt in agent.py. Create at least 3 cases:

  1. A case that should return the primary complete outcome
  2. An empty/incomplete case that should trigger needs_clarification
  3. A case with a defect that should trigger rejected (if applicable)

Step 3: Start the agent

# Check if already running
AGENT_PORT=$(grep "port:" "agents/$AGENT_NAME/config.yaml" | awk '{print $2}')
curl -s "http://localhost:$AGENT_PORT/health" 2>/dev/null && echo "ALREADY_RUNNING" || echo "NEEDS_START"

If NEEDS_START:

uv run agent2 serve "$AGENT_NAME" &
AGENT_PID=$!
sleep 3
curl -s "http://localhost:$AGENT_PORT/health"

Step 4: Run test cases

For each test case, send a real POST /tasks request:

curl -s -X POST "http://localhost:$AGENT_PORT/tasks?mode=sync" \
  -H "Authorization: Bearer dev-token-change-me" \
  -H "Content-Type: application/json" \
  -d '{"input": <test-case-input>}'

For each response, validate:

  1. HTTP status is 200
  2. Response contains "status": "completed"
  3. result is present and contains the expected schema fields
  4. result.status matches expected outcome (if specified in test case)
  5. result.confidence is a number between 0 and 1
  6. result.reasoning is non-empty
  7. result.review_steps is a non-empty list
  8. Schema consistency: no contradictory fields (e.g., complete + rejection_reason)

Step 5: Generate health report

AGENT QA REPORT: {agent-name}
═══════════════════════════════════════

Tests run:     {total}
Passed:        {passed}
Failed:        {failed}

| # | Case | Expected | Got | Confidence | Pass |
|---|------|----------|-----|------------|------|
| 1 | ... | complete | complete | 0.87 | ✓ |
| 2 | ... | clarification | clarification | 0.65 | ✓ |
| 3 | ... | rejected | complete | 0.45 | ✗ |

Confidence stats:
  Mean:   {mean}
  Min:    {min}
  Max:    {max}
  <0.85:  {count} ({pct}%)

Issues found:
  - {issue description}

Recommendation: {SHIP / FIX_BEFORE_SHIP / NEEDS_WORK}

Step 6: Check learnings

If the agent has operational learnings, show them:

LEARN_FILE="$HOME/.agent2/learnings/$AGENT_NAME.jsonl"
if [ -f "$LEARN_FILE" ]; then
  echo "LEARNINGS:"
  tail -10 "$LEARN_FILE"
else
  echo "No learnings yet (agent hasn't processed real cases)"
fi

Step 7: Cleanup

If we started the agent in Step 3:

kill $AGENT_PID 2>/dev/null

Completion Status

Report status as:

  • PASS — all tests passed, confidence healthy
  • PASS_WITH_CONCERNS — tests passed but confidence is low or edge cases untested
  • FAIL — test failures found, list what's broken
  • BLOCKED — agent couldn't start or API unreachable

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.