web-test-cleanup
Skill1 starsChanged 10 months agoMITView on GitHub
Clean up test sessions - kill browsers, stop dev servers, free ports, and optionally remove test data. Use this BEFORE starting new tests or AFTER completing tests.
- Deletes or force-pushes
In this repository7 other files it gives its agents.
- web-test-case-genSkill
- web-test-reportSkill
- web-test-researchSkill
- web-testSkill
- web-test-wallet-connectSkill
- web-test-wallet-setupSkill
- web-test-wallet-signSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
BEFORE starting new tests: - Run without --keep-data to get a clean slate
- Very specific: line 19
AFTER completing tests: - Run with --keep-data to preserve test artifacts for review
- Distinctive: line 39
Only kills the specific process we started, NOT other processes on common ports
- Distinctive: line 42
Test browser processes (Chrome/Chromium using test-output profile)
- Distinctive: line 47
Does NOT kill other processes on common ports to avoid affecting unrelated services
- Distinctive: line 68
Before starting a new test session, run full cleanup:
- Distinctive: line 78
No stale browser windows interfering with tests
- Distinctive: line 79
No blocked ports preventing server startup
- Very specific: line 84
After completing tests, run cleanup with --keep-data:
- Distinctive: line 101
If the cleanup script is not available, you can run these commands manually:
- Distinctive: line 129
Always run cleanup before starting new test sessions
- Very specific: line 130
Use --keep-data when you need to review test results
- Distinctive: line 132
Test data is stored in the project directory, not the skill directory
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Test Cleanup
Clean up test sessions by closing browsers, stopping dev servers, freeing ports, and optionally removing test data.
When to Use This Skill
- BEFORE starting new tests - Run without
--keep-datato get a clean slate - AFTER completing tests - Run with
--keep-datato preserve test artifacts for review - When tests are stuck - Kill hanging browser or server processes
- When ports are blocked - Free common dev ports (3000, 5173, 8080, 4200, 4321)
Quick Start
SKILL_DIR="<path-to-this-skill>"
# Full cleanup (removes test-output folder)
$SKILL_DIR/scripts/cleanup.sh
# Keep test data (screenshots, wallet config, etc.)
$SKILL_DIR/scripts/cleanup.sh --keep-dataWhat Gets Cleaned Up
Dev Server Stopped
- Reads
test-output/.dev-server.jsonto find and stop the dev server process started by web-test - Only kills the specific process we started, NOT other processes on common ports
Processes Killed
- Test browser processes (Chrome/Chromium using test-output profile)
- Browsers using remote-debugging-port 9222
Ports Freed
- The port used by our dev server (as recorded in
.dev-server.json) - Does NOT kill other processes on common ports to avoid affecting unrelated services
State Files Cleaned
.browser-cdp.json- Browser CDP connection info.browser-state.json- Browser state.dev-server.json- Dev server process info
Files Removed (unless --keep-data)
<project-root>/test-output/
├── screenshots/ # Test screenshots
├── chrome-profile/ # Browser state, wallet data
├── extensions/ # Downloaded wallet extensions
├── console-logs.txt # Browser console output
└── test-report-YYYYMMDD-HHMMSS.md # Generated test report (timestamped)Instructions
Pre-Test Cleanup (Fresh Start)
Before starting a new test session, run full cleanup:
SKILL_DIR="<path-to-this-skill>"
# Kill all processes and remove test data
$SKILL_DIR/scripts/cleanup.shThis ensures:
- No stale browser windows interfering with tests
- No blocked ports preventing server startup
- Clean test-output folder for new artifacts
Post-Test Cleanup (Preserve Data)
After completing tests, run cleanup with --keep-data:
SKILL_DIR="<path-to-this-skill>"
# Kill processes but keep test artifacts
$SKILL_DIR/scripts/cleanup.sh --keep-dataThis:
- Closes all browser windows
- Stops dev servers
- Preserves screenshots and reports for review
- Keeps wallet configuration for future tests
Manual Cleanup Commands
If the cleanup script is not available, you can run these commands manually:
# Stop dev server using saved PID (only kills our process)
DEV_PID=$(node -e "console.log(require('./test-output/.dev-server.json').pid)" 2>/dev/null)
kill -9 $DEV_PID 2>/dev/null
# Kill browser processes (only test browsers)
pkill -f "Google Chrome.*test-output"
pkill -f "chromium.*test-output"
pkill -f "remote-debugging-port=9222"
# Remove state files
rm -f ./test-output/.dev-server.json
rm -f ./test-output/.browser-cdp.json
rm -f ./test-output/.browser-state.json
# Remove test data
rm -rf ./test-output/Exit Codes
0- Cleanup completed successfully1- Cleanup failed (check error message)
Notes
- Always run cleanup before starting new test sessions
- Use
--keep-datawhen you need to review test results - The cleanup script is in this skill's
scripts/directory - Test data is stored in the project directory, not the skill directory
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.

