From saurun
Use when validating implemented User Flows against product spec, generating demo videos for stakeholders, or running pre-release E2E QA. Triggers: spec complete with User Flows section, need to verify user journeys work end-to-end, or preparing demo artifacts.
npx claudepluginhub fiatkongen/saurun-marketplace --plugin saurunThis skill uses the workspace's default tool permissions.
Run Playwright E2E tests against User Flows from a product spec. Self-contained lifecycle: detects project → starts app → runs tests → tears down. Auto-fix loop with up to 3 attempts per failing test.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Run Playwright E2E tests against User Flows from a product spec. Self-contained lifecycle: detects project → starts app → runs tests → tears down. Auto-fix loop with up to 3 attempts per failing test.
## User Flows section ready to validatedata-testid attributesdata-testid coverage## User Flows sectiondata-testid attributes on interactive elementsRun project detection per references/project-detection.md.
This establishes all config variables used in subsequent steps:
{FRONTEND_DIR}, {BACKEND_DIR} — project directories{FRONTEND_START_CMD}, {BACKEND_START_CMD} — start commands{HEALTH_ENDPOINT} — backend readiness check{DEFAULT_FRONTEND_PORT}, {DEFAULT_BACKEND_PORT} — port defaults{TEST_DIR} — Playwright test directory{RESULTS_DIR} — output directory for reports and artifactsLog detected config to stdout. If detection fails on any critical item, warn and ask the user for clarification. In autonomous mode (invoked by another skill), make best guess.
After backend starts, verify the reset endpoint is available:
curl -X POST http://localhost:$E2E_BACKEND_PORT/api/test/reset
If 404 or no response → WARN: "Backend does not expose /api/test/reset. Tests may have state pollution. Ensure backend registers this endpoint when E2E_TESTING=true."
If argument provided:
spec_path = argument
Else:
Search in order:
_docs/specs/*-spec.md, _docs/specs/*.md (exclude *-architecture.md)
docs/specs/*.md
docs/*.spec.md
specs/*.md
*.spec.md (project root)
Use most recently modified match.
Parse the ## User Flows section from the spec file. Each flow has:
Check if Playwright is configured:
# If playwright.config.ts doesn't exist in {FRONTEND_DIR}
cd {FRONTEND_DIR} && npm install -D @playwright/test && npx playwright install chromium
Create or update {FRONTEND_DIR}/playwright.config.ts using the template in references/playwright-config.md.
For each User Flow, generate a Playwright test file in {TEST_DIR}.
See references/test-generation.md for mapping rules.
Example output:
// {TEST_DIR}/create-recipe.spec.ts
import { test, expect } from '@playwright/test';
test('Create Recipe flow', async ({ page }) => {
// Step 1: User clicks "New Recipe" button
await page.goto('/');
await page.getByTestId('navbar-new-recipe').click();
// Step 2: User fills in title, description, cook time
await page.getByTestId('recipe-form-title').fill('Test Recipe');
await page.getByTestId('recipe-form-description').fill('A test recipe');
await page.getByTestId('recipe-form-cooktime').fill('30');
// Step 3: User clicks "Save"
await page.getByTestId('recipe-form-submit').click();
// Step 4: System shows success
await expect(page.getByTestId('toast-success')).toBeVisible();
});
See references/server-lifecycle.md for scripts.
{BACKEND_START_CMD}, wait for {HEALTH_ENDPOINT} (60s timeout){FRONTEND_START_CMD}, wait for response (30s timeout)cd {FRONTEND_DIR} && npx playwright test --reporter=html,jsonFor each failing test, run the fix loop (see below). After fixes, re-run full suite.
Write to {RESULTS_DIR}/report.md using references/report-template.md.
Kill backend and frontend processes. See references/server-lifecycle.md.
digraph fix_loop {
"Test Failed" [shape=ellipse];
"attempt < 3?" [shape=diamond];
"Dispatch debug subagent" [shape=box];
"Re-run single test" [shape=box];
"Test passes?" [shape=diamond];
"Log fix, continue" [shape=box];
"Log as unresolved" [shape=box];
"Test Failed" -> "attempt < 3?";
"attempt < 3?" -> "Dispatch debug subagent" [label="yes"];
"attempt < 3?" -> "Log as unresolved" [label="no"];
"Dispatch debug subagent" -> "Re-run single test";
"Re-run single test" -> "Test passes?";
"Test passes?" -> "Log fix, continue" [label="yes"];
"Test passes?" -> "attempt < 3?" [label="no, attempt++"];
}
Subagent dispatch:
Task(subagent_type="general-purpose", prompt="""
{AUTONOMOUS_PREAMBLE} // See references/autonomous-preamble.md
SKILL TO LOAD: superpowers:systematic-debugging
E2E TEST FAILURE:
- Test: {path} / {name}
- Error: {message}
- Screenshot: {path}, Trace: {path}
USER FLOW: {original steps from spec}
CODE: Frontend: {path}, Backend: {path}, Test: {path}
DIAGNOSE → FIX → VERIFY (compiles/builds)
""")
Re-run: cd {FRONTEND_DIR} && npx playwright test {file} --grep "{name}"
Log attempts to {RESULTS_DIR}/fix-attempts/{test-name}.md
See references/failure-categories.md for detailed patterns.
| Pattern | Category |
|---|---|
| Connection refused / timeout on startup | infra |
| Element not found + selector issue | test-code |
| Element not found + missing in DOM | app-code |
| Assertion failed on content | app-code |
| Timeout waiting for element (intermittent) | flaky |
{RESULTS_DIR}/
├── report.md # Main report
├── videos/
│ ├── create-recipe.webm
│ └── ...
├── failures/ # Only if unresolved
│ ├── {test}-screenshot.png
│ └── {test}-trace.zip
└── fix-attempts/
└── {test}.md # Diagnosis + fix log
See references/report-template.md for the full report template.
Write to {RESULTS_DIR}/report.md with: summary stats, video links, fix attempt logs, unresolved failures table, and category breakdown.