test-my-bot
Run the CopperHead bot protocol test suite against a bot file to verify it follows the server protocol correctly.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run the CopperHead bot protocol test suite against a bot file to verify it follows the server protocol correctly.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | test-my-bot |
| description | Run the CopperHead bot protocol test suite against a bot file to verify it follows the server protocol correctly. |
Use this skill when the user asks to test, validate, or check their bot.
Examples:
Run the bot protocol test suite (tests/test_bot_protocol.py) against the user's bot file. The test suite launches a local CopperHead server, runs the bot against it, and checks protocol compliance.
copperhead-server repo must exist at ../copperhead-server (sibling directory of copperhead-bot).pip install -r requirements.txtDetermine which bot file to test. If the user specifies a file (e.g., "test snake_bot.py"), use that. Otherwise, default to mybot.py.
Verify the bot file exists.
Test-Path <bot_file>
Install bot dependencies if needed.
Set-Location <copperhead-bot directory>
pip install -q -r requirements.txt
Kill any leftover test server processes to avoid port conflicts.
Get-NetTCPConnection -LocalPort 18765,18766 -ErrorAction SilentlyContinue |
ForEach-Object { Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue }
Run the test suite. Use sync mode with a long initial_wait (tests take 2-3 minutes). Wait for the command to complete fully — do not respond until you have the final output.
Set-Location <copperhead-bot directory>
python tests/test_bot_protocol.py --bot <bot_file>
Once the tests finish, display the full results summary to the user. The output ends with a clearly formatted block between ====== lines — show this entire block (from TEST RESULTS SUMMARY through the final --- line) in your response so the user can see each test's PASS/FAIL status. If any tests failed, explain what went wrong and suggest fixes.
18765 (and 18766 for one test) — not the standard 8765 — to avoid conflicts with a running game server.--bot argument accepts any Python bot file that follows the CopperHead bot CLI conventions (--server, --name, --difficulty arguments).