run-test-plan
Skill91 starsChanged 5 days agoApache-2.0View on GitHub
Execute YAML test plan, stop on first failure, output rich debug prompt
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ralphkrauss/agent-orchestratortheir own version, first seen May 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ralphkrauss/agent-orchestrator★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository85 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- agent-architecture-analysisSkill
- app-intents-code-reviewSkill
- artifact-analysisSkill
- axum-code-reviewSkill
- brainstorm-beagleSkill
- bubbletea-code-reviewSkill
- cloudkit-code-reviewSkill
- elixir-performance-reviewSkill
- elixir-security-reviewSkill
- elixir-writing-docsSkill
- exdoc-configSkill
- exunit-code-reviewSkill
- fastapi-code-reviewSkill
- fetch-pr-feedbackSkill
- ffi-code-reviewSkill
- fix-llm-artifactsSkill
- fowler-refactoringSkill
- gen-test-planSkill
- go-architectSkill
- go-code-reviewSkill
- go-data-persistenceSkill
- go-testing-code-reviewSkill
- healthkit-code-reviewSkill
- humanize-beagleSkill
- improve-docSkill
- ios-animation-code-reviewSkill
- liveview-code-reviewSkill
- llm-artifacts-detectionSkill
- llm-judgeSkill
- macros-code-reviewSkill
- phoenix-code-reviewSkill
- postgres-code-reviewSkill
- prfaq-beagleSkill
- prometheus-go-code-reviewSkill
- pytest-code-reviewSkill
- quick-planSkill
- react-flow-code-reviewSkill
- react-flowSkill
- react-router-code-reviewSkill
- react-router-v7Skill
- receive-feedbackSkill
- refactor-repoSkill
- resolve-beagleSkill
- respond-pr-feedbackSkill
- review-ai-writingSkill
- review-elixirSkill
- review-frontendSkill
- review-goSkill
- review-iosSkill
- review-llm-artifactsSkill
- review-planSkill
- review-pythonSkill
- review-remix-v2Skill
- review-rustSkill
- review-skillSkill
- review-structureSkill
- review-tuiSkill
- review-verification-protocolSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 11 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Read and validate the test plan:
- Very specific: line 46
If setup.prerequisites exists, verify each one:
- Very specific: line 55
If setup.env exists, export each variable.
- Very specific: line 64
If setup.build exists, execute build commands sequentially:
- Very specific: line 73
If setup.services exists, start long-running processes and wait for health checks:
- Very specific: line 105
If the plan uses the older flat format (setup.commands + setup.health_checks instead of prerequisites/build/services), fall back to …
- Distinctive: line 109
Do not start Step 4 until each condition you can check is true:
- Very specific: line 113
If not using --skip-setup: Every setup.prerequisites check that exists exited 0.
- Very specific: line 114
If using --skip-setup: Before TC-01, confirm anything the plan still needs is alive—at minimum one successful curl (or equivalent) to each …
- Distinctive: line 117
If any gate fails, stop, fix setup or flags, and do not execute tests.
- Very specific: line 192
Important: Always run agent-browser snapshot -i before interacting with elements to get valid refs, and re-snapshot after navigation or …
- Very specific: line 202
agent-browser steps: After any navigation or DOM change, a fresh agent-browser snapshot -i exists before asserting.
- Distinctive: line 206
Read the expected behavior description
- Distinctive: line 220
Stop immediately. Go to Step 6.
- Distinctive: line 257
When a test fails, generate rich debug output:
- Distinctive: line 366
Always output a summary table showing progress:
- Distinctive: line 398
Every test that ran has an explicit PASS or FAIL (not only “felt right”).
- Very specific: line 399
If any test failed: a failure artifact exists (docs/testing/evidence/<test.id>-failure.md or equivalent) or the debug report was emitted …
- Distinctive: line 421
Stop on first test failure (do not continue to other tests)
- Distinctive: line 422
Always capture evidence (screenshots, responses)
- Very specific: line 424
Use --skip-setup flag to re-run after fixing issues
- Distinctive: line 425
Never hardcode secrets - use environment variables
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
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>.pidFor 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
fi2e. 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}" > status_code.txt
# Capture response for evaluation
cat response.json
cat status_code.txtagent-browser CLI actions:
Steps starting with agent-browser are browser automation commands:
# Navigate
agent-browser open <url>
# Snapshot interactive elements (always do before interacting)
agent-browser snapshot -i
# Interact using refs from snapshot output (@e1, @e2, etc.)
agent-browser fill @<ref> "<value>"
agent-browser click @<ref>
# Wait for conditions
agent-browser wait --url "<pattern>"
agent-browser wait --text "<text>"
agent-browser wait --load load # Prefer wait @<ref> or wait --text for SPAs (networkidle can hang/time out on SSE/WebSockets/polling)
# Capture evidence
agent-browser screenshot docs/testing/evidence/<test.id>.pngImportant: Always run agent-browser snapshot -i before interacting with elements to get valid refs, and re-snapshot after navigation or significant DOM changes.
Save screenshots to docs/testing/evidence/<test.id>.png
4c. Evaluate Result
Gate — artifacts before PASS/FAIL:
run:steps: Stdout and stderr captured; exit code recorded (e.g.EXIT_CODE:line or equivalent).action: curlsteps: Response body and HTTP status captured to known paths (e.g.response.json,status_code.txtor paths the plan specifies).- agent-browser steps: After any navigation or DOM change, a fresh
agent-browser snapshot -iexists before asserting; if the test records evidence, the screenshot file path is created or failure is explicit.
Then, using agent reasoning, compare actual outcome against test.expected:
- Read the expected behavior description
- Compare with actual response/screenshot
- Determine PASS or FAIL
4d. On PASS
✓ TC-XX PASSED: <test.name>Continue to next test.
4e. On FAIL
Stop immediately. Go to Step 6.
Step 5: On All Tests Pass
## Test Results: ALL PASSED
| ID | Name | Result |
|----|------|--------|
| TC-01 | <name> | ✓ PASS |
| TC-02 | <name> | ✓ PASS |
| ... | ... | ... |
**Total:** N/N tests passed
### Evidence
Screenshots saved to `docs/testing/evidence/`
### Cleanup
Stopping background services...Clean up:
# Kill background services
for pidfile in .beagle/service-*.pid .beagle/dev-server.pid; do
if [ -f "$pidfile" ]; then
kill $(cat "$pidfile") 2>/dev/null
rm "$pidfile"
fi
doneStep 6: On Failure - Generate Debug Prompt
When a test fails, generate rich debug output:
6a. Gather Context
# Resolve base branch from metadata.base in $PLAN_PATH, falling back to main or master
BASE_BRANCH="$(python3 -c "import yaml; d = yaml.safe_load(open('$PLAN_PATH')) or {}; print((d.get('metadata') or {}).get('base') or '')" 2>/dev/null)"
BASE_BRANCH="${BASE_BRANCH:-$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo main || echo master)}"
MERGE_BASE="$(git merge-base HEAD "origin/${BASE_BRANCH}")"
# Get changed files relevant to the failure
git diff --name-only "${MERGE_BASE}"..HEAD
# Get recent changes in files mentioned in test.context
git diff "${MERGE_BASE}"..HEAD -- <relevant_files>6b. Output Debug Report
## Test Failure: TC-XX - <test.name>
### What Failed
**Test:** <test.name>
**Expected:**
<test.expected>
**Actual:**
<Describe what actually happened - response code, error message, screenshot description>
### Relevant Changes in This PR
<For each file mentioned in test.context or related to the failure:>
- `<file>` (lines X-Y) - <brief description of changes>
### Evidence
<If screenshot exists:>
- Screenshot: `docs/testing/evidence/<test.id>.png`
<If API response:>
- Status code: <code>
- Response body:
```json
<response>Error Details
<If error message in response or logs:>
```
<error message>
```Suggested Investigation
<Based on the error, suggest 2-3 specific things to check:>
<First thing to check based on error type><Second thing related to changed files>- <Third thing about environment/setup>
Debug Session Prompt
Copy this to start a new agent session:
I'm debugging a test failure in branch <branch>.
Test: <test.name>
Error: <brief error description>
<Summarize what the test was checking and what went wrong>Relevant files:
<List changed files related to this test>
Help me investigate why <specific failure reason>.
### 6c. Preserve Evidence
```bash
# Ensure evidence directory exists
mkdir -p docs/testing/evidence
# Save failure context
cat > docs/testing/evidence/<test.id>-failure.md << 'EOF'
# Failure Report: <test.id>
<Full debug report content>
EOF6d. Cleanup and Exit
# Kill background services
for pidfile in .beagle/service-*.pid .beagle/dev-server.pid; do
if [ -f "$pidfile" ]; then
kill $(cat "$pidfile") 2>/dev/null
rm "$pidfile"
fi
doneTest Results Summary Table
Always output a summary table showing progress:
## Test Results
| ID | Name | Result |
|----|------|--------|
| TC-01 | <name> | ✓ PASS |
| TC-02 | <name> | ✗ FAIL |
| TC-03 | <name> | - SKIP |
**Passed:** 1/3
**Failed:** TC-02Tests after a failure are marked as SKIP (not executed).
Verification
Before completing:
# Verify evidence directory exists
ls -la docs/testing/evidence/
# List captured evidence
ls docs/testing/evidence/*.png docs/testing/evidence/*.md 2>/dev/nullPass conditions (all must be true to call the run complete):
ls -la docs/testing/evidence/exits 0 (directory exists).- Every test that ran has an explicit PASS or FAIL (not only “felt right”).
- If any test failed: a failure artifact exists (
docs/testing/evidence/<test.id>-failure.mdor equivalent) or the debug report was emitted with expected vs actual. - Cleanup ran: no stale
.beagle/service-*.pidpointing at live processes you started, unless the plan says to leave them up.
Verification Checklist:
- Setup commands executed successfully (or
--skip-setupwith live dependencies confirmed) - Health checks passed before test execution (Step 3 gate)
- Each executed test has recorded result
- Evidence captured in
docs/testing/evidence/ - On failure: debug prompt includes expected vs actual
- On failure: relevant PR changes listed
- Background processes cleaned up
Gates (ordered)
- Plan valid: YAML parses; required keys for your branch (
setup/tests) are present. - Setup healthy: Step 3 pass conditions met before TC-01.
- Per-test artifacts: Step 4c gate satisfied before marking PASS.
- Stop on fail: First failure → Step 6; later tests = SKIP in the summary table.
- Cleanup: Step 5 or Step 6d executed so background PIDs from this run are released.
Rules
- Stop on first test failure (do not continue to other tests)
- Always capture evidence (screenshots, responses)
- Include file:line references in debug prompts when possible
- Use
--skip-setupflag to re-run after fixing issues - Never hardcode secrets - use environment variables
- Clean up background processes even on failure
- Preserve failure evidence for debugging
- Make debug prompts copy-paste ready for new sessions
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.

