/fx-dev:verify-web-changefrom fx-dev
Verifies pull request changes in a running web application using Playwright browser automation. Analyzes git diff, checks Docker, and runs Playwright tests.
Ships in fx-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Verify that pull request changes work correctly in a running web application using browser automation.
Playwright MCP is MANDATORY. This skill cannot function without it.
Execute these steps in order. Do not skip steps.
MUST exit if this step fails.
Test Playwright MCP by attempting to list browser tabs:
mcp__playwright__browser_tabs
action: "list"
If this tool:
❌ VERIFICATION FAILED: Playwright MCP server is not installed.
To install:
1. Run: npx @anthropic-ai/mcp-server-playwright
2. Configure in Claude Code MCP settings
3. Restart Claude Code
Do NOT proceed if Playwright MCP is unavailable.
Before launching the application, understand what to verify.
git diff main --name-only
git diff main --stat
Read the changed files and related context to understand:
# Check for existing Playwright/E2E tests
find . -name "*.spec.ts" -o -name "*.test.ts" -o -name "*.e2e.ts" | head -20
ls -la tests/ e2e/ playwright/ __tests__/ 2>/dev/null || true
If Playwright tests exist, read them to understand:
Create a mental checklist of what must be verified:
Before launching any services, check if the project needs Docker and ensure the daemon is running.
COMPOSE_FILE=""
for f in docker-compose.yml docker-compose.yaml compose.yml compose.yaml; do
if [[ -f "$f" ]]; then
COMPOSE_FILE="$f"
break
fi
done
echo "Compose file: ${COMPOSE_FILE:-none}"
If no compose file is found, skip to Step 4.
docker info > /dev/null 2>&1
If this fails, the Docker daemon is not running. Try to start it:
# Check current status
service docker status 2>/dev/null || systemctl status docker 2>/dev/null || true
If the daemon is stopped, start it:
# Try without sudo first
service docker start 2>/dev/null \
|| systemctl start docker 2>/dev/null \
|| sudo service docker start 2>/dev/null \
|| sudo systemctl start docker 2>/dev/null
Wait for Docker to be ready after starting:
for i in $(seq 1 10); do
docker info > /dev/null 2>&1 && break
echo "Waiting for Docker daemon... ($i/10)"
sleep 2
done
# Final check
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker daemon failed to start. Start it manually and retry."
echo " Try: sudo systemctl start docker"
echo " Or: sudo service docker start"
# Continue without Docker — the app may still work without services
fi
# Prefer `docker compose` (v2 plugin) over `docker-compose` (standalone)
if docker compose version > /dev/null 2>&1; then
docker compose up -d
else
docker-compose up -d
fi
Wait for services to be healthy — don't just sleep:
# If compose services define healthchecks, wait for them
if docker compose version > /dev/null 2>&1; then
# Check if any services have healthchecks
if docker compose ps --format json 2>/dev/null | grep -q '"Health"'; then
echo "Waiting for healthy services..."
for i in $(seq 1 30); do
UNHEALTHY=$(docker compose ps --format json 2>/dev/null | grep -c '"starting"\|"unhealthy"' || true)
if [[ "$UNHEALTHY" -eq 0 ]]; then
echo "All services healthy."
break
fi
echo " Waiting for $UNHEALTHY service(s)... ($i/30)"
sleep 2
done
else
# No healthchecks — fall back to a brief wait
echo "No healthchecks defined. Waiting 5s for services..."
sleep 5
fi
fi
After compose services start, check that critical ports are actually listening:
# Common service ports — check whatever the compose file exposes
docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}" 2>/dev/null || docker-compose ps
If a database or API service failed to start, report it and decide whether to continue.
if [[ -f "bun.lockb" ]] || [[ -f "bun.lock" ]]; then
PM="bun"
elif [[ -f "pnpm-lock.yaml" ]]; then
PM="pnpm"
elif [[ -f "yarn.lock" ]]; then
PM="yarn"
else
PM="npm"
fi
echo "Package manager: $PM"
Many apps won't start without environment configuration:
# Check for env templates that need to be copied
for tmpl in .env.example .env.template .env.sample; do
if [[ -f "$tmpl" ]] && [[ ! -f ".env" ]] && [[ ! -f ".env.local" ]]; then
echo "⚠️ Found $tmpl but no .env or .env.local — copying $tmpl to .env"
cp "$tmpl" .env
break
fi
done
# Check if required env files exist
if [[ -f ".env.local" ]] || [[ -f ".env" ]] || [[ -f ".env.development" ]]; then
echo "Environment file found."
else
echo "⚠️ No .env file detected. App may fail if it requires environment variables."
fi
[[ -d "node_modules" ]] || $PM install
Detect the port BEFORE starting the server so we know where to navigate:
PORT=""
# 1. Check vite.config.ts / vite.config.js (most common for bun/vite stacks)
for cfg in vite.config.ts vite.config.js vite.config.mts; do
if [[ -f "$cfg" ]]; then
# Look for server.port or preview.port
VITE_PORT=$(grep -oP 'port\s*:\s*\K\d+' "$cfg" | head -1)
if [[ -n "$VITE_PORT" ]]; then
PORT="$VITE_PORT"
echo "Port $PORT detected from $cfg"
fi
break
fi
done
# 2. Check package.json scripts for --port flags
if [[ -z "$PORT" ]] && [[ -f "package.json" ]]; then
SCRIPT_PORT=$(grep -oP '"dev"\s*:\s*"[^"]*--port\s+\K\d+' package.json || true)
if [[ -n "$SCRIPT_PORT" ]]; then
PORT="$SCRIPT_PORT"
echo "Port $PORT detected from package.json dev script"
fi
fi
# 3. Check next.config.js/ts for custom port (rare)
if [[ -z "$PORT" ]]; then
for cfg in next.config.js next.config.ts next.config.mjs; do
if [[ -f "$cfg" ]]; then
PORT="3000" # Next.js default
echo "Next.js detected, using default port $PORT"
break
fi
done
fi
# 4. Check nuxt.config.ts
if [[ -z "$PORT" ]] && [[ -f "nuxt.config.ts" ]]; then
NUXT_PORT=$(grep -oP 'port\s*:\s*\K\d+' nuxt.config.ts | head -1)
PORT="${NUXT_PORT:-3000}"
echo "Nuxt detected, using port $PORT"
fi
# 5. Fall back to framework defaults
if [[ -z "$PORT" ]]; then
if [[ -f "vite.config.ts" ]] || [[ -f "vite.config.js" ]] || [[ -f "vite.config.mts" ]]; then
PORT="5173"
elif [[ -f "svelte.config.js" ]]; then
PORT="5173"
else
PORT="3000"
fi
echo "Using default port $PORT"
fi
echo "Will verify at: http://localhost:$PORT"
DEV_CMD="dev" # default
if [[ -f "package.json" ]]; then
if grep -q '"dev"' package.json; then
DEV_CMD="dev"
elif grep -q '"start"' package.json; then
DEV_CMD="start"
elif grep -q '"serve"' package.json; then
DEV_CMD="serve"
fi
fi
Start the server in background and capture its PID for reliable cleanup:
$PM run $DEV_CMD > /tmp/dev-server.log 2>&1 &
DEV_PID=$!
echo "Dev server started (PID: $DEV_PID)"
echo "$DEV_PID" > /tmp/dev-server.pid
Do NOT use a fixed sleep. Poll until the server responds:
echo "Waiting for server at http://localhost:$PORT..."
for i in $(seq 1 30); do
if curl -s -o /dev/null -w '%{http_code}' "http://localhost:$PORT" 2>/dev/null | grep -qE '^[23]'; then
echo "Server is ready! (attempt $i)"
break
fi
# Check if the process died
if ! kill -0 "$DEV_PID" 2>/dev/null; then
echo "❌ Dev server exited unexpectedly. Last output:"
tail -20 /tmp/dev-server.log
exit 1
fi
echo " Not ready yet... ($i/30)"
sleep 2
done
# Final readiness check
if ! curl -s -o /dev/null "http://localhost:$PORT" 2>/dev/null; then
echo "⚠️ Server may not be ready. Last output:"
tail -10 /tmp/dev-server.log
echo "Proceeding anyway — Playwright navigate may trigger lazy startup."
fi
mcp__playwright__browser_navigate
url: "http://localhost:$PORT"
Use the PORT detected in Step 4.4.
mcp__playwright__browser_snapshot
mcp__playwright__browser_console_messages
level: "error"
If critical errors exist, report them and investigate.
Confirm the application loads and shows expected content. If it doesn't load:
tail -30 /tmp/dev-server.logkill -0 $(cat /tmp/dev-server.pid) 2>/dev/null && echo "running" || echo "dead"This is the core verification step. Based on the PR changes identified in Step 2:
If the change affects a specific route/page:
mcp__playwright__browser_navigate
url: "http://localhost:$PORT/affected-route"
mcp__playwright__browser_snapshot
Check the snapshot for:
For interactive changes, test the interaction:
mcp__playwright__browser_click
element: "description of element"
ref: "ref-from-snapshot"
Then snapshot again to verify the result:
mcp__playwright__browser_snapshot
If the codebase has Playwright tests covering the changed area, run them against the already-running dev server:
# Check if Playwright test config exists
if [[ -f "playwright.config.ts" ]] || [[ -f "playwright.config.js" ]]; then
echo "Running existing Playwright tests..."
# Point tests at the running dev server
BASE_URL="http://localhost:$PORT" npx playwright test --reporter=line 2>&1 | tail -30
fi
If tests fail, note the failures in the report. If no test suite exists, rely on the manual verification from 6.1-6.3.
The ONLY success criteria is: The actual changes made in the PR are verified to be present and working in the running application.
✅ VERIFICATION PASSED
Changes Verified:
- [specific change 1]: ✅ Working
- [specific change 2]: ✅ Working
- [specific change N]: ✅ Working
Evidence:
- [what was observed that confirms each change]
❌ VERIFICATION FAILED
Expected: [what should have been observed]
Actual: [what was actually observed]
Details:
- [specific issue 1]
- [specific issue 2]
Console Errors: [if any]
Dev Server Logs: [relevant lines from /tmp/dev-server.log]
Stop processes using tracked PIDs — do NOT use greedy pkill patterns:
# Kill dev server by PID
if [[ -f /tmp/dev-server.pid ]]; then
DEV_PID=$(cat /tmp/dev-server.pid)
if kill -0 "$DEV_PID" 2>/dev/null; then
kill "$DEV_PID" 2>/dev/null || true
# Wait briefly, then force-kill if still running
sleep 1
kill -0 "$DEV_PID" 2>/dev/null && kill -9 "$DEV_PID" 2>/dev/null || true
fi
rm -f /tmp/dev-server.pid
fi
rm -f /tmp/dev-server.log
# Stop docker services if we started them
if [[ -n "${COMPOSE_FILE:-}" ]]; then
if docker compose version > /dev/null 2>&1; then
docker compose down 2>/dev/null || true
else
docker-compose down 2>/dev/null || true
fi
fi
For detailed Playwright MCP tool documentation, see: references/playwright-mcp.md
scripts/launch-app-stack.sh - Detect and launch application stack (standalone usage)scripts/check-playwright-mcp.sh - Verify Playwright MCP availability| Framework | Default Port | Config File |
|---|---|---|
| Vite | 5173 | vite.config.ts |
| Next.js | 3000 | next.config.js |
| Create React App | 3000 | — |
| TanStack Start | 3000 | app.config.ts |
| Remix | 5173 | vite.config.ts |
| Nuxt | 3000 | nuxt.config.ts |
| SvelteKit | 5173 | vite.config.ts |
| Angular | 4200 | angular.json |
| Astro | 4321 | astro.config.mjs |
# Check status
service docker status 2>/dev/null || systemctl status docker 2>/dev/null
# Start (try without sudo first)
service docker start 2>/dev/null || sudo service docker start
systemctl start docker 2>/dev/null || sudo systemctl start docker
# Verify
docker info > /dev/null 2>&1 && echo "Docker is running"
docker compose logs or docker-compose logsss -tlnp | grep <port>docker compose pullInstall the MCP server and configure it in Claude Code settings.
tail -30 /tmp/dev-server.logss -tlnp | grep $PORTdocker compose ps.env.examplevite.config.ts for server.portpackage.json dev script for --port flagPORT env var in .env filesbrowser_wait_forWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fx/cc --plugin fx-dev25 skills in this plugin
/coderabbit-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Handles CodeRabbit's PR-level review as an optional review adapter with Scope Brief triage and rate-limit degradation./codex-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Runs a scoped one-shot Codex CLI branch review as an external review adapter./copilot-feedback-resolverExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Processes and resolves existing GitHub Copilot review threads without creating PR-level comments./copilot-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Requests, waits for, inspects, and settles a head-scoped GitHub Copilot review./devExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Runs the complete attended SDLC lifecycle through requirements, implementation, review, CI, and finalization./fixExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Runs a test-first bug-fix lifecycle and then enters the explicitly requested SDLC workflow.Other plugins' skills for the same job