本文へ移動
cccskills
無料GitHub で公開日本語紹介

bat-adhoc

実際のAIエージェントからMCPツールを操作する受け入れテストを組み立て、実行結果や失敗内容を確認し、必要に応じてブランチ間の動作を比較するスキルです。

原文原文の説明を見る

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.

homeassistant-ai/ha-mcpスター 5,351(GitHub 5,351 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • PRのMCPツール変更を検証したいとき
  • エージェント視点で回帰を調べたいとき
  • ClaudeやGeminiで一連の動作を試したいとき
  • 基準ブランチと失敗内容を比較したいとき

日本語での紹介

できること

MCPツールが実際のAIエージェントから正しく使えるかを、シナリオを作って確認します。変更差分を見て検証対象を決め、必要な状態を準備する手順、エージェントに試させる依頼、後片付けの依頼を含むシナリオを作成し、tests/uat/run_uat.pyで実行します。エージェントごとの完了状況やツール呼び出しの成功・失敗を確認し、失敗時には詳細な出力を調べます。必要に応じて同じシナリオを基準ブランチでも実行し、動作を比較できます。

こんなときに便利

PRの変更がエージェント操作で機能するか確かめたいときや、ツール変更による回帰を調べたいときに向いています。単体の処理だけでなく、エージェントCLIからMCPツールまでの一連の動きを確認できます。

使い方の例

  • 「自動化を作成して時刻トリガーを変更するテストをして」
  • 「このツール変更をGemini CLIで検証して」
  • 「失敗したシナリオをmasterブランチと比較して」

注意点

uv run python tests/uat/run_uat.pyで実行します。ClaudeまたはGeminiなどのエージェントCLIと、シナリオ実行に必要な環境が必要です。シナリオの各フェーズでAPIクレジットを消費するため、原文では対象を絞った効率的な設計が勧められています。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

BAT - Bot Acceptance Testing

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.

When to Use BAT

  • PR validation: Test that tool changes work correctly from an agent's perspective
  • Regression detection: Compare behavior between branches
  • Integration verification: Ensure MCP tools work end-to-end with real agent CLIs

Workflow

  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

Output Structure

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
      }
    }
  }
}
  • Phase stats: num_turns, tool_stats (per phase) for fine-grained comparison
  • Aggregate stats: Total counts across all phases for overall efficiency comparison
  • Output: every phase includes output (plus tool_trace when tool calls were logged); a failed phase also includes stderr when it is not empty
  • Full results: raw JSON, complete output always available at results_file

Scenario Design Guidelines

  • setup_prompt: Create any entities/state the test needs
  • test_prompt: Exercise the tools being tested, ask the agent to report results clearly
  • teardown_prompt: Clean up created entities
  • Keep prompts focused - each scenario tests ONE behavior
  • Ask the agent to report: what succeeded, what failed, any unexpected behavior

Example: Testing Error Signaling

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."
}
EOF

Regression Comparison Workflow

Run 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):

  • Task completion: Did both pass? Any new failures?
  • Accuracy: Check agent output quality - did it understand the task correctly?
  • Tool success rate: Compare aggregate.total_tool_calls vs total_tool_fail

Secondary (report but don't decide on these alone):

  • Tool call count: Compare aggregate.total_tool_calls, aggregate.total_turns — directional signal, not conclusive (agent exploration varies between runs)
  • Duration: Compare aggregate.total_duration_ms — noisy due to network, cache misses, server load. Only flag large (>2x) regressions.

Robustness tip: Ask the same task in different ways (variation testing) to check if results are consistent across phrasings.

Cost Awareness

Each scenario invocation costs API credits (one per agent per phase). Design scenarios efficiently:

  • Combine related checks in a single test_prompt when possible
  • Only use setup/teardown when the test needs specific state
  • Start with one agent, expand to both only when cross-agent comparison matters

Handling Arguments

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.

Full Documentation

For complete CLI reference and output format, see tests/uat/README.md.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

bat-story-eval

無料概要あり

MCPツールの変更前後を、既存と独自のストーリーで複数のエージェントから検証し、実行結果やツール選択、コストの差を比較するスキルです。

  • リリース版と変更中の動作を比較したいとき
  • 変更箇所に合うテストストーリーを選びたいとき
  • 未カバーの回帰シナリオを作りたいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

contrib-pr-review

無料概要あり

外部からのGitHub PRを安全性、テスト状況、変更規模、目的との整合性から確認し、レビュー結果と投稿前のコメント案をまとめるスキルです。

  • 外部コントリビューターのPRをレビューしたいとき
  • 変更コードのテスト状況を確認したいとき
  • PRと関連Issueの整合性を見たいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

contributors-update

無料概要あり

READMEの貢献者一覧を確認し、更新以降にマージされたPRから未掲載の執筆者を探して、承認後に追加するスキルです。

  • PR執筆者の掲載漏れを探したいとき
  • 貢献者一覧の追加案を作りたいとき
  • READMEの貢献者欄を更新したいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

issue-analysis

無料概要あり

GitHub Issueに関連するコードを調べ、実装の選択肢や難易度、設計上の影響を整理して、ラベルと分析コメント案を作成します。

  • Issueの難易度を実装前に把握したいとき
  • 実装方針の選択肢を比較したいとき
  • Issueの分析コメント案を作成したいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

issue-to-pr-resolver

無料概要あり

GitHubのIssueを起点に、作業ブランチで実装とテストを行い、Draft PRの作成からCI失敗やレビューコメントの解消まで進めます。

  • GitHub Issueを実装からPRまで進めたいとき
  • IssueからDraft PRを作成したいとき
  • CI失敗やレビューコメントを解消したいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

my-pr-checker

無料概要あり

自分が作成したGitHub PRのCI、レビューコメント、未解決スレッドを確認し、指摘の修正から再チェックまで進めるスキルです。

  • 自分のPRのCI状況を確認したいとき
  • レビュー指摘を整理して修正したいとき
  • 修正後にレビュー項目を解決したいとき
homeassistant-ai/ha-mcp5,3512026年10月29日 更新

homeassistant-ai のスキルをすべて見る

このスキルの問題を報告する