bat-story-eval
Compare MCP tool behavior between target and baseline versions using pre-built and custom stories with diff-based triage.
Run bot acceptance tests to validate MCP tools work correctly from a real AI agent's perspective. Use when testing PRs, detecting regressions, or verifying tool changes end-to-end with Claude/Gemini CLIs.
Claude Code
$ npx -y skills add homeassistant-ai/ha-mcp --skill bat-adhoc --agent claude-code
Codex
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a codex -y
Cursor
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a cursor -y
Gemini CLI
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a gemini-cli -y
GitHub Copilot
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a github-copilot -y
OpenCode
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a opencode -y
Windsurf
$ npx skills add homeassistant-ai/ha-mcp --skill bat-adhoc -a windsurf -y
name: bat-adhoc description: Run bot acceptance tests to validate MCP tools work correctly from a real AI agent's perspective. Use when testing PRs, detecting regressions, or verifying tool changes end-to-end with Claude/Gemini CLIs. disable-model-invocation: true argument-hint: [scenario-description or --help] allowed-tools: Bash, Read, Write
Bot acceptance testing validates that MCP tools work correctly from a real AI agent's perspective. You design test scenarios dynamically, run them via `tests/uat/run_uat.py`, and evaluate results.
1. **Analyze the change**: Read the diff, identify which tools are affected 2. **Design scenario**: Generate a scenario JSON with setup/test/teardown prompts 3. **Run the script**: Pipe the scenario to `uv run python tests/uat/run_uat.py` 4. **Evaluate summary**: Check `all_passed` per agent. If true, you're done. 5. **Dig deeper on failure**: Read `results_file` for full output, stderr, raw JSON 6. **Regression check**: If test fails, re-run with `--branch master` to compare
The runner returns a **concise summary** to stdout (saves context when all passes):
{
"results_file": "/tmp/bat_results_abc123.json",
"agents": {
"gemini": {
"all_passed": true,
"test": {
"completed": true,
"duration_ms": 8100,
"exit_code": 0,
"num_turns": 5,
"tool_stats": { "totalCalls": 4, "totalSuccess": 4, "totalFail": 0 }
},
"aggregate": {
"total_duration_ms": 15300,
"total_turns": 12,
"total_tool_calls": 9,
"total_tool_success": 9,
"total_tool_fail": 0
}
}
}
}cat <<'EOF' | uv run python tests/uat/run_uat.py --agents gemini
{
"setup_prompt": "Create a test automation called 'bat_error_test' with a time trigger at 23:59 and action to turn on light.bed_light.",
"test_prompt": "Try to get automation 'automation.nonexistent_xyz'. Report if the tool signaled an error or returned a normal response. Then get automation 'automation.bat_error_test' and report its structure.",
"teardown_prompt": "Delete automation 'bat_error_test' if it exists."
}
EOFRun the same scenario twice from the branch checkout and compare stats. `--branch master` installs ha-mcp from `master` on GitHub; omitting `--branch` runs the local code, which also covers unpushed commits:
# Baseline: master uv run python tests/uat/run_uat.py --scenario-file <scenario.json> --branch master --agents gemini # Target: local code uv run python tests/uat/run_uat.py --scenario-file <scenario.json> --agents gemini
To compare a pushed branch that is not checked out, pass `--branch <branch>` for the target run too.
**Compare these metrics:**
*Primary (decide pass/fail on these):*
*Secondary (report but don't decide on these alone):*
**Robustness tip:** Ask the same task in different ways (variation testing) to check if results are consistent across phrasings.
Each scenario invocation costs API credits (one per agent per phase). Design scenarios efficiently:
When `/bat-adhoc` is invoked with arguments:
**If arguments contain a scenario description**, generate the JSON scenario and run it:
/bat-adhoc test automation create with sunrise trigger then modify to sunset
→ Generate appropriate scenario JSON and execute
**If `--help` or no arguments**, show this help text.
**Otherwise**, treat `$ARGUMENTS` as instructions for what to test and design+run the scenario accordingly.
For complete CLI reference and output format, see `tests/uat/README.md`.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with Home Assistant. Using natural language, control smart home devices, query states, execute services and manage your automations.
Compare MCP tool behavior between target and baseline versions using pre-built and custom stories with diff-based triage.
Review a contribution PR for safety, quality, and readiness. Checks for security concerns, test coverage, size appropriateness,…
Find merged PR authors missing from README and update the contributors list after approval
Deep analysis of a single GitHub issue with codebase exploration, implementation planning, and architectural assessment. Use when…
Implement a GitHub issue end-to-end — create a worktree branch, implement the feature with tests, create a draft PR, then…
Manage your own GitHub pull requests — check CI status, inline review comments, PR-level comments, resolve review threads, fix…
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…