run-test-plan
БесплатноБез исполняемых скриптовНе проверенExecute YAML test plan, stop on first failure, output rich debug prompt
от existential-birds★ 92 звезды на GitHubОб этом скилле
Run Test Plan
Execute a YAML test plan, run setup commands, health checks, and each test sequentially. Stop on first failure with rich debug output.
Prerequisites
- agent-browser CLI: Browser tests require the
agent-browsercommand-line tool to be available onPATH
Arguments
--plan <path>: Path to test plan (default:docs/testing/test-plan.yaml)--skip-setup: Skip setup commands and health checks (for re-running after failure)
Step 1: Parse Test Plan
Read and validate the test plan:
# Resolve plan path from --plan (default shown)
PLAN_PATH="${PLAN_PATH:-docs/testing/test-plan.yaml}"
# Check file exists
ls "$PLAN_PATH" || { echo "Error: Test plan not found: $PLAN_PATH"; exit 1; }
# Validate YAML
python3 -c "import yaml; yaml.safe_load(open('$PLAN_PATH'))" || { echo "Error: Invalid YAML: $PLAN_PATH"; exit 1; }
Extract from the YAML:
setup.prerequisites: Prerequisites to check before running testssetup.env: Environment variables to exportsetup.build: Build commands to executesetup.services: Long-running services andhealth_checkURLs to start and poll- (Legacy format)
setup.commands/setup.health_checksifprerequisites/build/servicesare absent tests: Array of test cases
Step 2: Run Setup (unless --skip-setup)
2a. Check Prerequisites
If setup.prerequisites exists, verify each one:
# For each prerequisite in setup.prerequisites
<prerequisite.check> || { echo "Prerequisite not met: <prerequisite.name>"; exit 1; }
2b. Set Environment Variables
If setup.env exists, export each variable. Variables using ${VAR} syntax should be resolved from the current environment:
# For each key/value in setup.env
export <key>="<value>"
2c. Build
If setup.build exists, execute build commands sequentially:
# For each command in setup.build
<command> || { echo "Build failed: <command>"; exit 1; }
2d. Start Services
If setup.services exists, start long-running processes and wait for health checks:
# For each service in setup.services
nohup <service.command> > .beagle/service-<index>.log 2>&1 &
echo $! > .beagle/service-<index>.pid
For each service with a health_check, poll until ready:
timeout=<service.health_check.timeout or 30>
url=<service.health_check.url>
elapsed=0
while [ $elapsed -lt $timeout ]; do
if curl -s -o /dev/null -w "%{http_code}" "$url" | grep -qE "^(200|301|302)"; then
echo "✓ Health check passed: $url"
break
fi
sleep 2
elapsed=$((elapsed + 2))
done
if [ $elapsed -ge $timeout ]; then
echo "✗ Health check timeout: $url"
exit 1
fi
2e. Legacy Setup Format
If the plan uses the older flat format (setup.commands + setup.health_checks instead of prerequisites/build/services), fall back to executing setup.commands sequentially and polling setup.health_checks as before.
Step 3: Gate — setup ready before tests
Do not start Step 4 until each condition you can check is true:
- Plan load: The file from
--plan(defaultdocs/testing/test-plan.yaml) exists and parses as YAML (same checks as Step 1). - Setup branch:
- If not using
--skip-setup: Everysetup.prerequisitescheck that exists exited 0; everysetup.buildcommand succeeded; every servicehealth_checkreached HTTP 200, 301, or 302 within its timeout or legacysetup.health_checkspassed aftersetup.commands. - If using
--skip-setup: Before TC-01, confirm anything the plan still needs is alive—at minimum one successfulcurl(or equivalent) to each URL insetup.health_checksor eachsetup.services[].health_check.urlthat the tests depend on.
- If not using
- Evidence path:
mkdir -p docs/testing/evidencesucceeds and the directory exists.
If any gate fails, stop, fix setup or flags, and do not execute tests.
Step 4: Execute Tests Sequentially
For each test in the plan:
4a. Log Test Start
## Running: TC-XX - <test.name>
Context: <test.context>
4b. Execute Steps
For each step in test.steps, determine the step type and execute accordingly:
Shell commands (run: steps):
The most common step type. Execute the command in the shell and capture stdout, stderr, and exit code:
# Execute the command, capture output and exit code
<command> 2>&1
echo "EXIT_CODE: $?"
Capture all output for evaluation in step 4c. Shell steps cover:
- CLI binary invocations (e.g.,
./target/debug/myapp status --all) - Database queries (e.g.,
psql "${DATABASE_URL}" -c "SELECT ...") - File inspection (e.g.,
ls -la /path/to/expected/output) - Process lifecycle checks (e.g.,
timeout 5 ./myapp 2>&1 || true) - Any other command a human would type in a terminal
curl actions (action: curl steps):
curl -X <method> \
-H "Content-Type: application/json" \
<additional headers> \
-d '<body>' \
"<url>" \
-o response.json \
-w "%{http_code}" > statu
Установить run-test-plan в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл run-test-plan?
Execute YAML test plan, stop on first failure, output rich debug prompt
Как установить скилл run-test-plan?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл run-test-plan запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic