bat-story-eval
Skill4.9k starsChanged 2 months agoMITView on GitHub
Compare MCP tool behavior between target and baseline versions using pre-built and custom stories with diff-based triage.
Trending
Quiet since October.about the whole repository
Who's talking about homeassistant-ai/ha-mcp
- pail23/stiebel_eltron_isg_component“State class removed from _today energy sensors after updating to 2026.8”GitHub · Aug 14, 2026 · 6 reactions
- @syshack.ch“So cool - I installed claude code in the SSH core app (curl -fsSL claude.ai/install.sh | bash) and linked …”Bluesky · Aug 8, 2026 · 4 likes
- @burnsie.com“Absolutely! This thing is awesome and I use it for all sorts of @homeassistant.bsky.social tasks …”Bluesky · Mar 23, 2026 · 3 likes
- @bradsjm.bsky.social“Connecting Codex CLI using GPT 5.2 with this very powerful MCP server (github.com/homeassistan...) is a …”Bluesky · Dec 25, 2025 · 3 likes
- A Hacker News story“The Unofficial and Home Assistant MCP Server”Hacker News · Jun 16, 2026 · 2 points
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub, Bluesky and Hacker News (46 times).
On GitHub · 40
- Aug 14, 2026State class removed from _today energy sensors after updating to 2026.8 — pail23/stiebel_eltron_isg_component6 reactions · 4 comments
- Sep 27, 2026Enhancement: ha-mcp style in-process MCP onboarding for zero-config agent setup — ruaan-deysel/unraid-management-agent1 reaction · 3 comments
- May 12, 2026install for home-assistant only https://github.com/homeassistant-ai/ha-mcp — jeffborg/home-network1 reaction
- May 6, 2026Extend Assist with home management help, starting with documentation — OpenHomeFoundation/roadmap1 reaction · 6 comments
- Oct 4, 2026Add home assistant mcp — d-buckner/bloud0 reactions
35 more on GitHub
- Oct 3, 2026agent-skills.github.homeassistant-ai.ha-mcp: 8.5.0 → 8.6.0 — sudosubin/agents.nix0 reactions
- Oct 3, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp to v8.6.0 — Stormcargo/k8s-gitops0 reactions · 1 comment
- Oct 1, 2026Energy counters stay at 0 since mid-August (device reports Electric: 0 while running) — blues-sechseck/Mitsubishi-WF-RAC-Integration0 reactions · 1 comment
- Sep 30, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.5.0 ➔ 8.6.0) — tscibilia/home-ops0 reactions · 1 comment
- Sep 30, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.5.0 → 8.6.0) — joryirving/home-ops0 reactions · 2 comments
- Sep 30, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.5.0 ➔ 8.6.0) — drag0n141/home-ops0 reactions · 1 comment
- Sep 28, 2026agent-skills.github.homeassistant-ai.ha-mcp: init at 8.5.0 — sudosubin/agents.nix0 reactions
- Sep 19, 2026[vote] hacs/homeassistant-ai/ha-mcp: 8.4.3 -> 8.5.0 — HA-Update-Manager/community-votes0 reactions · 1 comment
- Sep 19, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp to v8.5.0 — Stormcargo/k8s-gitops0 reactions · 1 comment
- Sep 16, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.5.0 in /config/homeassistant — tun0/frigate-reid0 reactions
- Sep 16, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.3 ➔ 8.5.0) — drag0n141/home-ops0 reactions · 1 comment
- Sep 9, 2026python3Packages.ha-mcp: 8.4.0 -> 8.4.3 — NixOS/nixpkgs0 reactions · 1 comment
- Sep 7, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.4.3 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Sep 5, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.2 ➔ 8.4.3) — tscibilia/home-ops0 reactions · 1 comment
- Sep 5, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.2 ➔ 8.4.3) — drag0n141/home-ops0 reactions · 1 comment
- Sep 4, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.4.2 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Sep 4, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.1 ➔ 8.4.2) — drag0n141/home-ops0 reactions · 1 comment
- Sep 4, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.1 ➔ 8.4.2) — tscibilia/home-ops0 reactions · 1 comment
- Sep 4, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.1 → 8.4.2) — joryirving/home-ops0 reactions · 2 comments
- Sep 2, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.4.1 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Sep 2, 2026fix(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.4.0 ➔ 8.4.1) — drag0n141/home-ops0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Consolidate CI lanes — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Add Traditional Chinese locale — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Document ha_call_service parameters — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Reduce CI runner contention without losing coverage — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Discover HA-MCP natively inside Home Assistant — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Let agents clean up blueprints reported as unused — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Sep 1, 2026[FIXTURE] Support safely removing unused blueprints — homeassistant-ai/ha-mcp-workflows-dev0 reactions · 1 comment
- Aug 31, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.4.0 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Aug 29, 2026feat(container): update image ghcr.io/homeassistant-ai/ha-mcp (8.3.0 ➔ 8.4.0) — drag0n141/home-ops0 reactions · 1 comment
- Aug 24, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.3.0 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Aug 15, 2026MCP write tool calls rejected: Unexpected keyword argument arguments / tool_call requires a name argument (reads work) — NousResearch/hermes-agent0 reactions · 2 comments
- Aug 13, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.2.0 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Aug 10, 2026build(deps): bump homeassistant-ai/ha-mcp from 7.8.1 to 8.1.1 in /config/homeassistant — tun0/frigate-reid0 reactions · 1 comment
- Aug 5, 2026NR-65D 보일러 제보 입니다 — ripe-avocado/navien_smart_ha0 reactions · 1 comment
On Bluesky · 5
- Aug 8, 2026So cool - I installed claude code in the SSH core app (curl -fsSL claude.ai/install.sh | bash) and linked it with the… — @syshack.ch4 likes and reposts · 7 replies
- Mar 23, 2026Absolutely! This thing is awesome and I use it for all sorts of @homeassistant.bsky.social tasks github.com/homeassistan... — @burnsie.com3 likes and reposts · 1 reply
- Dec 25, 2025Connecting Codex CLI using GPT 5.2 with this very powerful MCP server (github.com/homeassistan...) is a game changer for my #homeassistant.… — @bradsjm.bsky.social3 likes and reposts · 1 reply
- Mar 4, 2026Claude is the way to configure Home Assistant: github.com/homeassistan... — @denovich.com1 likes and repost
- Dec 6, 2025github.com/homeassistan... — @rewse.jp0 likes and reposts · 1 reply
On Hacker News · 1
- Jun 16, 2026The Unofficial and Home Assistant MCP Server2 points
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- homeassistant-addon-webhook-proxy/AGENTS.mdAGENTS.md
- homeassistant-addon-webhook-proxy-dev/AGENTS.mdAGENTS.md
- site/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- homeassistant-addon-webhook-proxy/CLAUDE.mdCLAUDE.md
- homeassistant-addon-webhook-proxy-dev/CLAUDE.mdCLAUDE.md
- site/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- bat-adhocSkill
- contrib-pr-reviewSkill
- contributors-updateSkill
- issue-analysisSkill
- issue-to-pr-resolverSkill
- my-pr-checkerSkill
- wtSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
If $ARGUMENTS is --help or missing --baseline, show usage and stop:
- Very specific: line 45
No src/ changes: only tests/docs/config — select 2 smoke-test stories
- Distinctive: line 51
Read the diff from 0a
- Very specific: line 52
Read all story YAMLs in tests/uat/stories/catalog/s*.yaml (title, description, prompt, setup)
- Distinctive: line 55
Do any of those overlap with what changed?
- Distinctive: line 59
No src/ changes -> 2 representative stories as smoke test
- Distinctive: line 64
Read the diff carefully. Your job is to catch regressions.
- Distinctive: line 66
Guidelines: Always create at least 1 custom story.
- Very specific: line 68
Write each as /tmp/custom_c<NN>.yaml using the standard story format:
- Very specific: line 127
After each story, verify via ha_query.py using the story's verify.questions:
- Distinctive: line 140
Run remaining pre-built stories on the same container:
- Distinctive: line 148
Verify each immediately after running.
- Very specific: line 159
Verify each via ha_query.py using the custom story's verify.questions.
- Very specific: line 163
Stop only the container kept in step 1a.
- Distinctive: line 213
All expected tools used? (High weight)
- Very specific: line 324
If any trend = decreased:
- Distinctive: line 331
When a story has >30% more billable tokens vs baseline, check for KV-cache misses:
- Distinctive: line 370
Run pre-built stories BEFORE custom stories (cleanest state)
- Very specific: line 371
ALWAYS verify each story via ha_query.py before running the next
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.
Files
BAT Story Evaluation
You are the evaluator. Run the steps in order; each one uses the output of the step before it.
Parse Arguments
From $ARGUMENTS, extract:
--baseline: REQUIRED. Git tag/branch of the released version (e.g.,v6.6.1).--agents: Agent list (default:gemini). Comma-separated.--stories: Force specific pre-built story IDs (e.g.,s01,s02). Overrides triage selection.--all-stories: Skip triage, run ALL pre-built stories.--keep-container: Keep HA containers alive after run for manual inspection.--model: Model for Claude agent (e.g.,haiku,sonnet).
If $ARGUMENTS is --help or missing --baseline, show usage and stop:
/bat-story-eval --baseline v6.6.1
/bat-story-eval --baseline v6.6.1 --agents gemini,claude
/bat-story-eval --baseline v6.6.1 --stories s01,s02
/bat-story-eval --baseline v6.6.1 --all-stories --agents claude --model haikuStep 0: Triage (Diff Analysis + Custom Story Design)
0a. Compute Diff
cd "$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/worktree/uat-stories"
git diff <baseline>..HEAD -- src/ha_mcp/ --stat
git diff <baseline>..HEAD -- src/ha_mcp/ --name-onlyClassify changed files:
- Tool modules (
tools/tools_*.py): specific tool implementations changed - Core code (
client/,server.py,errors.py,tools/util_helpers.py): affects all tools - Utilities (
utils/,resources/): may affect all tools - No src/ changes: only tests/docs/config — select 2 smoke-test stories
0b. Select Pre-built Stories
Skip if --stories or --all-stories was passed.
- Read the diff from 0a
- Read all story YAMLs in
tests/uat/stories/catalog/s*.yaml(title, description, prompt, setup) - For each story, reason about whether the diff could affect its outcome:
- What tools/code paths would this story exercise?
- Do any of those overlap with what changed?
- Rules:
- Story likely exercises changed code -> selected
- Core code changed (
client/,server.py,errors.py) -> all stories selected - No src/ changes -> 2 representative stories as smoke test
- Report which stories were selected and why (one sentence per story)
0c. Design Custom Stories (at least 1)
Read the diff carefully. Your job is to catch regressions. For each changed code path NOT covered by selected pre-built stories, ask: "could this break something a user would notice?" If yes, design a custom story to test that hypothesis.
Guidelines: Always create at least 1 custom story. Each must test a distinct regression hypothesis — don't create stories that overlap. Stop when you've covered the risky gaps.
Write each as /tmp/custom_c<NN>.yaml using the standard story format:
id: c01
title: "Short description of what is being tested"
category: custom
weight: 5
description: >
Rationale: [what changed in the diff and why this scenario tests it]
setup:
- tool: ha_config_set_helper
args:
helper_type: "input_boolean"
name: "Test Entity Name"
prompt: >
[Natural language request a real user would make that exercises the changed code]
teardown: []
verify:
questions:
- "Did the agent achieve the expected outcome?"
- "Did it use the expected tools?"
expected:
tools_should_use:
- ha_search
description: >
[What a correct agent should do]Design principles:
- Focus on code paths that changed in the diff
- Plausible user scenarios, not synthetic edge cases
- Setup creates realistic HA state via FastMCP in-memory steps
- Prompts are what a real user would type
- At least 1. Each tests a distinct regression hypothesis. Stop when gaps are covered.
Step 1: Run Baseline Version
For EACH agent, run all stories against the baseline version. One container per agent, reused across all stories.
1a. Start container with first story
cd "$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/worktree/uat-stories"
uv run python tests/uat/stories/run_story.py \
tests/uat/stories/catalog/<first_story>.yaml \
--agents <agent> --keep-container \
--branch <baseline> \
--results-file local/uat-results.jsonlCAPTURE from stderr: HA URL (e.g., http://localhost:32771), token, session file path.
1b. Verify, then run remaining pre-built stories
After each story, verify via ha_query.py using the story's verify.questions:
uv run python tests/uat/stories/scripts/ha_query.py \
--ha-url http://localhost:PORT --ha-token TOKEN \
--agent <agent> \
"Does an automation with alias 'Sunset Porch Light' exist?"Record each answer as confirmed / denied / unclear. A non-zero exit
from ha_query.py means the query itself failed (the output carries an
[exit N] marker; [exit 124] is a timeout) — that is not one of the three
outcomes; re-run it, and if it keeps failing record the story as unverified
(Step 5) rather than scoring it. See references/evaluation-protocol.md.
Run remaining pre-built stories on the same container:
uv run python tests/uat/stories/run_story.py \
tests/uat/stories/catalog/<next_story>.yaml \
--agents <agent> --ha-url http://localhost:PORT --ha-token TOKEN \
--branch <baseline> \
--results-file local/uat-results.jsonlVerify each immediately after running.
1c. Run custom stories on same container
uv run python tests/uat/stories/run_story.py \
/tmp/custom_c01.yaml \
--agents <agent> --ha-url http://localhost:PORT --ha-token TOKEN \
--branch <baseline> \
--results-file local/uat-results.jsonlVerify each via ha_query.py using the custom story's verify.questions.
1d. Stop container
Stop only the container kept in step 1a. PORT is the host port in its Container kept alive: http://localhost:PORT line:
docker stop $(docker ps -q --filter "publish=PORT")Step 2: Run Target Version
Repeat Step 1 for the target (local code). Same stories, same order, fresh container.
The only difference: omit --branch so run_story.py uses local code.
uv run python tests/uat/stories/run_story.py \
tests/uat/stories/catalog/<first_story>.yaml \
--agents <agent> --keep-container \
--results-file local/uat-results.jsonlSame container reuse for remaining stories (--ha-url). Same verification after each.
Step 3: White-Box Analysis
For each story on each version, read the session file captured during the run.
Gemini sessions (JSON):
python3 -c "
import json, sys
data = json.load(open(sys.argv[1]))
for msg in data.get('messages', []):
for tc in msg.get('toolCalls', []):
print(f\" {tc['name']} ({tc.get('status', '?')})\")
" /path/to/session.jsonClaude sessions (JSONL):
python3 -c "
import json, sys
for line in open(sys.argv[1]):
entry = json.loads(line)
if entry.get('type') == 'assistant':
for b in entry.get('message', {}).get('content', []):
if b.get('type') == 'tool_use':
print(f\" {b['name']}\")
" /path/to/session.jsonlCompare against expected.tools_should_use:
- All expected tools used? (High weight)
- Tool failures with recovery? (Medium weight)
- Total tool call count (Low weight, note it)
Step 4: Score & Compare
Scoring Matrix
| Black-Box | White-Box | Score |
| Entity correct + right structure | Right tools | pass |
| Entity correct + right structure | Wrong tools or recovered errors | pass (with notes) |
| Entity correct + wrong structure | Any | partial |
| Entity not created | Any | fail |
Metrics
Primary metrics (decide pass/fail on these):
- Black-box score (entity correct, structure correct)
- White-box tool selection (expected tools used)
- Error recovery (failures handled gracefully)
Secondary metrics (report but don't decide on these alone):
- Billable tokens — directional cost signal, flag >30% increase for investigation but don't auto-fail
- Cached tokens / cache hit ratio — useful context for cost analysis, but varies based on provider-side KV-cache behavior
- Tool call count / turns — varies between runs due to agent exploration
- Duration — noisy (network, KV-cache misses, server load), only flag large (>2x) outliers
- Tool description size delta (Step 8)
Extracting Billable Tokens
# Gemini: input includes cached, so subtract
billable = (input - cached) + output + thoughts
# Claude: input_tokens is already non-cached
billable = input + outputTrend (target vs baseline)
For each story+agent:
- Both pass -> stable
- Target pass, baseline fail -> improved
- Target fail, baseline pass -> decreased (REGRESSION)
- Custom story, first run -> new
- Billable tokens >30% higher -> cost investigation (even if pass — check Step 7 for KV-cache misses before concluding regression)
Step 5: Update JSONL
Append eval results as NEW lines (never modify existing):
record["eval_score"] = "pass" # or "partial", "fail", or "unverified"
record["eval_notes"] = "Entity created, triggers verified"
record["eval_trend"] = "stable" # or "new", "improved", "decreased"
# "unverified" is for a story whose verification query itself failed — it is
# not a result, so it carries no trend and is not compared to the baseline.Step 6: Report
Triage Summary
Diff: <baseline>..HEAD — N files changed in src/ha_mcp/
Selected pre-built: s01, s03, s05 (3 stories — tools_automation.py, tools_search.py changed)
Custom stories: c01, c02 (2 stories — covering error handling, fuzzy search threshold)
Skipped: s02, s04, s06-s12 (tools unchanged)Pre-built Story Results
Also read the model and quantization fields from each JSONL record (written
by run_story.py) and show them as columns. Results vary by model, and the same
base model at different quants behaves very differently, so a report naming only
the agent is ambiguous after the fact. (Quant is - for cloud backends that
don't expose it.)
| Story | Agent | Model | Quant | Baseline | Target | Trend | Baseline Tokens | Target Tokens | Delta |
|-------|--------|------------------|-------|----------|--------|--------|-----------------|---------------|-------|
| s01 | claude | claude-sonnet-4-6| - | pass | pass | stable | 36,262 | 34,100 | -6% |
| s03 | claude | claude-sonnet-4-6| - | pass | pass | stable | 42,000 | 41,500 | -1% |Custom Story Details
For EACH custom story, output a full section:
#### c01: [Title]
**Rationale**: [What changed in the diff and why this tests it]
**Setup**:
- Created input_boolean "Sophisticated Kitchen Sensor" via FastMCP
**Test prompt**: "[The exact prompt sent to the agent]"
**Verification**:
| Question | Baseline | Target |
|----------|----------|--------|
| Found the entity? | confirmed | confirmed |
| Used ha_search? | confirmed | confirmed |
**Score**: baseline=pass, target=pass, trend=stable
**Tokens**: baseline=28,500, target=27,200 (-5%)Regressions
If any trend = decreased:
- Flag prominently
- Suggest re-run to check flakiness
- Show relevant section of
git diff <baseline>..HEAD
Step 7: Investigate Outliers
When a story has >30% more billable tokens vs baseline, check for KV-cache misses:
for i, msg in enumerate(data["messages"]):
tok = msg.get("tokens", {})
cached = tok.get("cached", 0)
total = tok.get("input", 0)
print(f"Turn {i+1}: input={total:,} cached={cached:,} non-cached={total-cached:,}")A turn with cached=0 after a non-cold-start turn = KV-cache miss (provider-side, not a code regression).
Step 8: Tool Description Size
Compare tool description sizes between versions:
uv run python tests/uat/stories/scripts/measure_tools.py \
--output local/tool-sizes-target.json
uv run python tests/uat/stories/scripts/measure_tools.py \
--output local/tool-sizes-baseline.json --branch <baseline>Flag >5% total size increase (directly impacts token cost per turn).
Key Files
| File | Purpose |
tests/uat/stories/run_story.py | Story runner (container, setup, agent CLI) |
tests/uat/stories/scripts/ha_query.py | Query live HA via agent+MCP for verification |
tests/uat/stories/catalog/s*.yaml | Pre-built story definitions |
local/uat-results.jsonl | Historical results (gitignored) |
references/evaluation-protocol.md | Scoring rules, verification questions, cross-agent checks |
references/regression-protocol.md | Regression classification and flaky handling |
Important Notes
--baselineis required: it's both the diff source and the control group- Run pre-built stories BEFORE custom stories (cleanest state)
- ALWAYS verify each story via ha_query.py before running the next
- Reuse containers: first story starts it (
--keep-container), rest use--ha-url - Custom story YAMLs go to
/tmp/(ephemeral); full details reported in Step 6 - See "Metrics" section in Step 4 for primary vs secondary metric classification
- The working directory MUST be the
worktree/uat-storiesworktree root (wherepyproject.tomllives) foruv run
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
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.

