npx skills add ...
npx skills add supatest-ai/alan-skills --skill alan-test-feature
Scope coverage, build a testing strategy, test the feature with agent-browser, capture screenshots/video (always mandatory), upload to S3, and create a structured test report (never skip)
npx skills add supatest-ai/alan-skills --skill alan-test-feature
Analyze the current branch's changes, scope the coverage level with the user, build an explicit testing strategy, start the app's dev server, test the feature in a real browser using agent-browser, capture screenshots and video (always — no exceptions), upload everything to S3, and generate a structured test report (always — never skip).
Use the active task context when it is present in the prompt. Otherwise:
ALAN_TASK_ID environment variable.ALAN_SESSION_ID environment variable.teamId with Alan MCP context/tools before creating the report.When calling create_test_report, always pass taskId, conversationId, and teamId explicitly. Do not substitute one ID for another.
agent-browser is a CLI tool by Vercel Labs (npm: agent-browser) — it is NOT a skill or MCP tool. It provides headless browser automation via bash commands (open, click, fill, screenshot, record). In sandboxes it is pre-installed by runtime-bootstrap.ts.
If missing, install it:
If installation fails (e.g. no network, no npm), STOP and tell the user:
"agent-browser is not available and could not be installed. Install it manually:
npm install -g agent-browser && agent-browser install"
Do NOT proceed to Phase 2 without a working agent-browser — all browser testing depends on it.
All captures (screenshots, videos) MUST be written to /tmp/alan-captures/.
CRITICAL — file path rules:
- ONLY write capture files to
/tmp/alan-captures/. Never anywhere else.- NEVER write to
.claude/, project directories,reports/, or any path inside the repo..claude/is a sensitive system directory — writing to it will be blocked and will abort the test run.- If you are tempted to create a
reports/orscreenshots/folder anywhere other than/tmp/, stop and use/tmp/alan-captures/instead.
Never skip this phase. You must understand what the user wants before writing a single test step.
Use AskUserQuestion to ask the user:
Wait for the response before continuing.
Based on the feature (which you may not know yet — do a quick git diff --stat first to get a hint), use AskUserQuestion to ask 1–3 targeted follow-up questions. Examples:
Do not skip questions if context is unclear. Ask. A well-scoped test is 10× more valuable than a blind one.
After gathering answers, summarize back to the user (no tool call needed — just a short message):
Only proceed to Phase 1 after this confirmation.
Run these commands to understand what changed:
Read the actual diff to understand the feature or bug fix. Identify:
Look at the project to figure out how to run it:
package.json — check scripts.dev, scripts.start, scripts.servedocker-compose.yml / docker-compose.yaml / compose.ymlMakefile (look for dev or serve targets)Procfile, .env, Pipfile, requirements.txt, Gemfilenext.config.*, vite.config.*, nuxt.config.*, angular.json, manage.py, config/routes.rbStart the dev server in the background. Common patterns:
Poll until the server is responding:
Check common ports if unclear: 3000, 5173, 8080, 4200, 8000, 4000, 3001, 8888.
.env or .env.local for PORT or VITE_PORT or similarcurl -sf http://localhost:PORT >/dev/nullAskUserQuestionTell the user:
Before opening the browser, you must have an explicit plan. Do not improvise test steps on the fly.
Based on:
Write out the full test plan as a structured list. For each scenario, note:
Coverage requirements by level:
Non-happy path examples to consider:
Use TodoWrite to create a todo entry for each test scenario so progress is tracked. Each todo should be the scenario name.
Output the full testing strategy as a numbered list before proceeding. The user should be able to see exactly what will be tested before Phase 2 starts.
agent-browseris a CLI tool — invoke it via bash, not as an MCP tool or skill. Docs: https://github.com/vercel-labs/agent-browser Key commands:open,snapshot,click,fill,screenshot,record,wait,find,close
Always start a video recording before any interaction. No exceptions.
If video recording fails for technical reasons, note the failure but continue — screenshots are still required.
Always capture the initial page state before any interaction.
Work through every scenario defined in Phase 1.5. For each scenario:
agent-browser snapshot -i to discover interactive elementsagent-browser click @eN, agent-browser fill @eN "text", etc. to interactagent-browser wait --load networkidle or agent-browser wait 1500 between actionsstep-02-form-filled.png, step-03-submit-clicked.png, step-04-success-state.pngMandatory coverage checklist (execute ALL that apply to the coverage level chosen):
Happy path (always required):
Non-happy paths (required for standard + comprehensive):
Error states (required for standard + comprehensive):
Visual & navigation (required for comprehensive):
Keep the recording under 2 minutes. If the feature requires more exploration, split into multiple recordings (e.g. happy-path.webm, error-states.webm).
WebM files recorded by agent-browser often have duration = Infinity in the container header — the video player then shows 0:00. Fix every .webm file by remuxing it through ffmpeg, which reads the entire file, computes the real duration, and writes it into the output header:
If ffmpeg is not available, skip this step and continue — the video will still play, it just won't show the correct duration in the player.
For each captured file, use the mcp__alan__get_upload_url MCP tool to get a presigned S3 URL, then curl PUT the file directly to S3.
Get the file size (needed by the MCP tool):
Call the MCP tool to get a presigned upload URL:
Returns: { "uploadUrl": "https://...", "s3Key": "sandbox-captures/..." }
Upload the file to S3 using the presigned URL:
Save the s3Key — you will pass it to create_test_report in Phase 4.
Repeat for each screenshot and video file. Common MIME types:
image/pngvideo/webmIf uploads fail: Continue to Phase 4 anyway — omit the screenshotUrl, videoUrl, and screenshotUrls fields. The structured report is still valuable without media.
CRITICAL: You MUST call mcp__alan__create_test_report to complete this skill. This is non-negotiable.
If uploads failed in Phase 3, create the report anyway — omit the media URLs but include all steps, issues, and summary text.
Call the mcp__alan__create_test_report MCP tool with structured data from your testing.
Gather all the data from the previous phases and call the tool:
s3Key field returned by get_upload_url, not the uploadUrl. Omit if no uploads succeeded.After calling mcp__alan__create_test_report, tell the user:
/teams/<teamId>/docs?artifactId=<artifactId>)Do not lead with a raw UUID. Only include the artifact/report ID as secondary debug context if no usable title or link is available.
Do NOT render the full report as markdown. The MCP tool call creates the report as a structured artifact that the UI displays interactively.
mkdir -p /tmp/alan-capturesWhat level of test coverage do you want for this feature?
- light — Happy path only. Quick smoke test to verify the main flow works.
- standard — Happy path + key edge cases + basic error states. (Default)
- comprehensive — Full coverage: happy path, all edge cases, error states, non-happy paths, boundary values, accessibility, responsiveness.
Also: are there any specific flows, known bugs, or risky areas you want me to focus on?git log main..HEAD --oneline 2>/dev/null || git log HEAD~5..HEAD --oneline
git diff main...HEAD --stat 2>/dev/null || git diff HEAD~1 --stat# Node.js
npm run dev &
# or: pnpm dev &, yarn dev &, npx next dev &, npx vite &
# Python
python manage.py runserver &
# or: flask run &, uvicorn main:app &
# Ruby
bundle exec rails server &
# Docker
docker compose up -d# Replace PORT with the discovered port
for i in $(seq 1 30); do
curl -sf http://localhost:PORT >/dev/null 2>&1 && break
sleep 2
doneagent-browser --session test-feature open http://localhost:PORT
agent-browser --session test-feature wait --load networkidleagent-browser --session test-feature record start /tmp/alan-captures/happy-path.webmagent-browser --session test-feature screenshot /tmp/alan-captures/step-00-initial-state.png