npx skills add ...
npx skills add giuseppe-trisciuoglio/developer-kit --skill specs-e2e-verification
Executes real end-to-end verification against a running application after specification implementation. Detects the application type, starts the local runtime (Docker, Node, Spring Boot, etc.), runs real tests (curl for REST APIs, Playwright for web SPAs, computer-use for desktop apps), verifies acceptance criteria from the functional specification, generates a markdown report, and tears down the environment. Use when: user asks to verify a completed spec with real tests, run e2e checks after implementation, validate acceptance criteria in a live environment, or test the feature for real after task completion.
npx skills add giuseppe-trisciuoglio/developer-kit --skill specs-e2e-verification
Performs real environment verification after a specification has been implemented and cleaned up. This skill bridges the gap between unit-tested code and observable runtime behavior by:
[IMP] acceptance criteria in the functional specificationcurl, Playwright, computer-use)Input: docs/specs/[id]/ (spec folder with functional specification and tasks)
Output: docs/specs/[id]/e2e-report-YYYY-MM-DD-HHMMSS.md
specs.task-implementation and specs.code-cleanup to confirm the feature works in reality.| Argument | Required | Description |
|---|---|---|
--spec | Yes | Path to the specification folder (e.g., docs/specs/001-feature/) |
--task | No | Specific task ID to limit verification scope (e.g., TASK-003) |
--keep-alive | No | If present, skip teardown and leave the environment running |
--timeout | No | Startup and test timeout in seconds (default: 120) |
--insecure | No | If present, allow curl to use -k / --insecure (TLS bypass opt-in) |
rm -rf, docker system prune, sudo).[IMP] acceptance criterion from the functional specification.--keep-alive is passed; warn about leftover processes.Parse $ARGUMENTS:
--spec (required): spec folder path. Validate that the directory exists and contains at least one functional specification file (YYYY-MM-DD--*.md). If missing or invalid, abort with an error.--task (optional): task ID filter (e.g., TASK-003). If provided, validate that tasks/<task-id>.md exists inside the spec folder.--keep-alive (optional): boolean flag. If present, skip teardown at the end.--timeout (optional): positive integer in seconds. Default is 120. Validate that the value is a positive integer; if not, abort with an error.--insecure (optional): boolean flag. If present, curl commands MAY use -k / --insecure for local development with self-signed certificates. By default, TLS bypass is forbidden (REQ-NR003).Read the functional specification and extract:
[IMP], [SEF], [EXT])[IMP] criteria will generate runtime testsIf --task is provided, read the task file and limit scope to its provides files and related AC.
Use TodoWrite to create a todo list for all 8 phases.
Before any command is executed, run the following security checks:
Command Whitelist Check:
references/test-execution-patterns.md.AskUserQuestion to request explicit user confirmation before execution.docker compose up -d --build, ./mvnw spring-boot:run, ./gradlew bootRun, npm run dev, npm run start:dev, npm start, cargo tauri build --debug, cargo tauri dev, npm run electron:dev, npx electron ., open *.app, and equivalent local process launchers.sudo, rm -rf, docker system prune, mkfs, dd, or similar destructive operations is NOT whitelisted and SHALL be rejected.Forbidden Pattern Scan (REQ-NR001):
sudo → abort with: "Forbidden: sudo is not permitted during E2E verification."rm -rf → abort with: "Forbidden: rm -rf is not permitted during E2E verification."docker system prune → abort with: "Forbidden: docker system prune is not permitted during E2E verification."rm, drop, destroy, prune targeting databases, volumes, or local data → abort with: "Forbidden: destructive data operations are not permitted."TLS Enforcement Check (REQ-NR003):
-k or --insecure AND --insecure was NOT passed → abort with: "Forbidden: curl TLS bypass (-k / --insecure) is disabled by default. Pass --insecure to opt-in."--insecure was passed → log a warning: "WARNING: TLS certificate verification is disabled. Use only for local development."Data Integrity Pre-Check (REQ-NR004):
rm, drop, prune, volume deletion flags).Set PROJECT_ROOT to the directory containing .git or the parent directory of --spec.
Inspect PROJECT_ROOT for configuration files using the following heuristics (execute in order):
Docker-managed (highest priority):
If any of these files exist, classify as Docker-managed regardless of other framework configs.
JVM / Spring Boot:
AND verify source directory exists:
If both conditions are true, classify as JVM-based service.
NestJS:
If true, classify as NestJS.
Web SPA (React / Vue / Angular):
If true, classify as Web SPA.
Desktop App:
If true, classify as Desktop App.
Python:
If true, classify as Python.
Apply priority rules:
pom.xml and package.json without Docker Compose):
If no recognizable config is found, OR if multiple non-Docker configs exist and the spec domain is ambiguous, use AskUserQuestion with exactly these options:
Port Discovery: Once the application type is known, determine the target port by inspecting framework configuration files in this order:
Vite projects (vite.config.ts or vite.config.js):
Spring Boot (application.yml):
Spring Boot (application.properties):
Node.js / package.json scripts:
Also check for PORT environment variable in scripts:
Fallback defaults (if no port is found in any config file):
| App Type | Default Port |
|---|---|
| Node.js / NestJS | 3000 |
| Spring Boot (JVM) | 8080 |
| Angular | 4200 |
| Vite (React/Vue) | 5173 |
| Python | 8000 |
Log the detected type and discovered port; both will be recorded in the report.
Read references/test-execution-patterns.md (shipped with this skill) for the command mapping. Based on detection:
Data integrity pre-flight (REQ-NR004): Before executing the startup command, verify it does not contain patterns that overwrite or delete existing databases, volumes, or local data (e.g., rm, --volumes, prune, drop). If a destructive pattern is detected, abort immediately with: "Startup aborted: command would destroy existing data."
Initialize runtime state:
STARTUP_COMMAND="" — the exact command used to start the environmentHEALTH_CHECK_METHOD="" — description of how readiness was determinedSTARTUP_LOGS_FILE="$(mktemp)" — temp file capturing stdout/stderr from startupSTARTUP_TIMEOUT="${TIMEOUT:-120}" — seconds to wait for readinessSTART_TIME="$(date +%s)"STARTUP_PID="" — background process PID (for local processes)Pre-startup port check (all types):
Docker-managed startup:
STARTUP_COMMAND="docker compose up -d --build"Spring Boot startup:
NestJS / Node.js startup:
node_modules exists to avoid cryptic errors:
package.json scripts:
$STARTUP_LOGS_FILE for common server-ready messages (e.g., Nest application successfully started, Local:, ready in, Server running) and record the first matching line in the report as evidence of successful startup.Python (FastAPI / Django / Flask) (see references/test-execution-patterns.md):
uvicorn main:app --reload, python manage.py runserver, or flask runDesktop App (Tauri / Electron / .NET MAUI) (see references/test-execution-patterns.md):
Framework detection:
Build step (triggered when no pre-built debug binary exists or when source is newer than target):
Tauri:
Electron:
Launch the built application binary:
Tauri (macOS):
Tauri (Linux):
Electron:
Health check (process appearance, timeout enforced):
Post-startup bookkeeping (all types):
STARTUP_COMMAND and HEALTH_CHECK_METHOD in report metadata (AC-010).STARTUP_LOGS_FILE contents to the report under Raw Output (REQ-020).CRITICAL: Only test [IMP] acceptance criteria. Translate each into one or more concrete runtime actions.
Prerequisite check: Before generating any tests, verify curl is installed:
1. Parse [IMP] AC for endpoint hints
For each [IMP] acceptance criterion in the specification:
GET, POST, PUT, PATCH, DELETE (case-insensitive)./ followed by alphanumeric segments, e.g., /api/users, /v1/health.2xx, 3xx, 4xx, 5xx or specific codes like 200, 201, 204, 400, 401, 403, 404, 500.Content-Type by searching for application/json, text/plain, text/html, etc.If an [IMP] AC does not contain a parseable endpoint path and method, mark it MANUAL CHECK REQUIRED and skip to the next criterion.
2. Discover authentication credentials
Before constructing curl commands, attempt to locate test credentials by scanning the following files in PROJECT_ROOT (in order):
| File | Key Patterns |
|---|---|
.env.test | E2E_AUTH_TOKEN=..., E2E_USERNAME=..., E2E_PASSWORD=... |
.env.local | E2E_AUTH_TOKEN=..., E2E_USERNAME=..., E2E_PASSWORD=... |
application-test.yml | e2e.auth-token: ..., e2e.username: ..., e2e.password: ... |
application-test.properties | e2e.auth-token=..., e2e.username=..., e2e.password=... |
e2e.credentials.json | Top-level keys E2E_AUTH_TOKEN, E2E_USERNAME, E2E_PASSWORD |
Discovery logic:
If no credentials are found after scanning all files AND the AC text implies authentication is required (mentions "auth", "login", "token", "protected", "bearer", "API key"), use AskUserQuestion to prompt the user:
Security: Redact token values in the E2E report; show only the header name (e.g., Authorization: Bearer <redacted>).
3. Generate curl commands
For each parseable [IMP] AC, construct the curl command using this exact pattern:
Rules:
-s -w "\n%{http_code}" -o /tmp/e2e_resp.json.-X <METHOD>: only add if the method is not GET. For GET, omit -X entirely.-H "Content-Type: application/json": only add for POST, PUT, PATCH.-d '<REQUEST_BODY>': only add when the AC describes a request body. If no body is described, omit -d.<AUTH_HEADER>:
E2E_AUTH_TOKEN is set: -H "Authorization: Bearer ${E2E_AUTH_TOKEN}"E2E_USERNAME and E2E_PASSWORD are set: -u "${E2E_USERNAME}:${E2E_PASSWORD}"-k or --insecure to curl commands unless the --insecure flag was explicitly passed when invoking the skill. If --insecure was passed, log a warning that TLS verification is disabled./tmp/e2e_resp.json and the status code on the last line of stdout.4. Execute curl and assert (no retry)
Execute each curl command exactly once (REQ-NR008). Do NOT retry on failure.
Assertions (all must pass for the AC to be VERIFIED):
a. HTTP status code:
b. Content-Type header (only if specified in the AC):
c. Response body structure using jq (preferred) or grep (fallback):
jq is installed and the response is JSON:
jq is NOT installed, use grep as fallback:
5. Record results
For each curl test, record:
If any assertion fails, mark the AC as FAILED immediately. Do not retry.
Prerequisite check: Before generating any SPA tests, verify Playwright is installed:
If Playwright is missing, the skill MUST report the gap with the install commands above and skip SPA tests. Do NOT attempt to auto-install.
1. Prepare artifact directory
2. Parse [IMP] AC for UI behavior hints
For each [IMP] acceptance criterion in the specification that relates to Web SPA behavior:
click, fill, type, select, submit, navigate, scroll, hover.data-testid="..." or data-testid='...' → [data-testid=...]id="..." or id='...' → #...class="..." or class='...' → .class-name (replace spaces with dots)text=.../pathIf an [IMP] AC does not contain parseable UI behavior or visible state hints, mark it MANUAL CHECK REQUIRED and skip to the next criterion.
3. Launch headless browser context
Browser MUST be headless by default. Only use headed mode if the user explicitly passes --headed.
For each SPA test, generate a temporary Playwright script and execute it with node:
4. Translate AC into Playwright actions
For each parsed UI interaction, generate the corresponding Playwright action inside the temporary script:
| AC Description Pattern | Playwright Action |
|---|---|
| "click [selector]" | await page.click('[data-testid=refresh]'); |
| "fill [selector] with [value]" | await page.fill('#username', 'testuser'); |
| "type [value] into [selector]" | await page.type('input[name=search]', 'query'); |
| "select [value] in [selector]" | await page.selectOption('select[name=country]', 'US'); |
| "submit [form]" | await page.click('button[type=submit]'); |
| "navigate to [path]" | await page.goto('http://localhost:${TARGET_PORT}/path'); |
| "hover over [selector]" | await page.hover('.tooltip-trigger'); |
| "scroll to [selector]" | await page.locator('[data-testid=footer]').scrollIntoViewIfNeeded(); |
Selector precedence (most specific to least specific):
[data-testid=...] — preferred, most stable#id — unique element ID.class-name — CSS class[name=...] — form element nametext=... — visible text content (fallback)5. Assert visible states
For each expected visible state, generate the corresponding assertion inside the temporary script:
| AC Description Pattern | Playwright Assertion |
|---|---|
| "page shows [text]" | await expect(page.locator('body')).toContainText('text'); |
| "[selector] has text [value]" | await expect(page.locator('[data-testid=title]')).toHaveText('value'); |
| "[selector] contains [text]" | await expect(page.locator('.message')).toContainText('text'); |
| "table has [N] rows" | expect(await page.locator('table tbody tr').count()).toBe(N); |
| "URL is [path]" | expect(page.url()).toBe('http://localhost:${TARGET_PORT}/path'); |
| "URL contains [fragment]" | expect(page.url()).toContain('/fragment'); |
| "[selector] is visible" | await expect(page.locator('[data-testid=modal]')).toBeVisible(); |
| "[selector] is hidden" | await expect(page.locator('[data-testid=spinner]')).toBeHidden(); |
6. Execute test with timeout enforcement
Each Playwright test MUST enforce a per-test timeout to prevent indefinite hangs (REQ-NR007). The wrapper script uses the timeout command:
If the test process hangs beyond the timeout, the timeout command sends SIGTERM, the AC is marked FAILED, and the evidence records: "Test hung and was terminated after ${TEST_TIMEOUT_SEC}s".
7. Screenshot capture on failure
When any assertion or action fails:
page.screenshot({ path: ..., fullPage: true }).${ARTIFACT_DIR}/screenshot-<timestamp>-ac-<AC_ID>.png.When a test passes, screenshots are optional and only captured if --capture-success is passed.
8. Record results
For each SPA test, record:
If any assertion fails, mark the AC as FAILED immediately. Do not retry.
Edge cases — error handling:
npm install -D @playwright/test and npx playwright install chromium suggestion. Mark all SPA ACs as MANUAL CHECK REQUIRED. Continue with other test categories.page.goto() throws net::ERR_CONNECTION_REFUSED or similar, report: "Dev server not reachable at ${DEV_SERVER_URL}. Ensure the server is running before verification." Mark affected ACs as FAILED.npx playwright install-deps chromium. Mark affected ACs as MANUAL CHECK REQUIRED.Prerequisite check: Before generating any desktop tests, verify that computer-use or MCP-based GUI automation tools are available. This skill does NOT auto-install these tools.
1. Prepare artifact directory
2. Parse [IMP] AC for desktop behavior hints
For each [IMP] acceptance criterion in the specification that relates to Desktop App behavior:
If an [IMP] AC does not contain parseable desktop behavior hints (no window, element, or workflow descriptions), mark it MANUAL CHECK REQUIRED and skip to the next criterion.
3. Verify the application is running
If the desktop app was not started in Phase 3 or its process has exited, re-launch using the commands from Phase 3:
4. Verify window/UI elements via visual or accessibility-tree inspection
For each AC describing a window or UI element (AC-022):
Visual inspection (computer-use):
Accessibility-tree inspection (MCP GUI automation):
5. Simulate user workflows through GUI automation
For each AC describing a user workflow (AC-023), translate the description into GUI automation actions:
| AC Description Pattern | GUI Automation Action |
|---|---|
| "click [button label]" | Click the UI element with the matching accessible name or label |
| "fill [field] with [value]" | Focus the input field and type the value |
| "toggle [switch/checkbox]" | Click the toggle or checkbox element |
| "select [option] from [dropdown]" | Open the dropdown and click the option element |
| "navigate to [menu item]" | Click the menu item with the matching label |
| "type [value] into [field]" | Focus the field and type the value |
6. Screenshot capture at each verification step
At EVERY step (before actions, after actions, and on assertions), capture a screenshot:
Screenshots are saved for every step regardless of pass/fail status, satisfying AC-024 (SEF).
7. Per-test timeout enforcement
Each desktop test MUST enforce a per-test timeout to prevent indefinite hangs (REQ-NR007):
If a test times out:
FAILED8. Record results
For each desktop test, record:
If any assertion or action fails, mark the AC as FAILED immediately. Do not retry.
Edge cases — error handling:
$STARTUP_LOGS_FILE and reported. Verification aborts before launch.FAILED, and attempt to restart the app for the next AC.FAILED and capture a screenshot of the current desktop state.Fallback: If a specific AC cannot be translated into an automated test (e.g., it requires human aesthetic judgment), mark it as MANUAL CHECK REQUIRED and continue.
Goal: Compare every test execution result against the [IMP] acceptance criteria from the functional specification and produce a deterministic verdict for each.
Create an associative results structure (e.g., shell associative array, JSON object, or temporary file) keyed by AC ID. For every [IMP] acceptance criterion extracted in Phase 1, pre-populate a row with:
| Field | Initial Value |
|---|---|
ac_id | The AC identifier (e.g., AC-012) |
ac_text | The full criterion text, truncated to 120 characters for display |
status | PENDING (updated in 5.2) |
evidence | Empty string (updated in 5.2) |
actual | Empty string (populated only on mismatch) |
expected | Empty string (populated only on mismatch) |
Iterate over the specification’s acceptance criteria table and include only rows whose taxonomy tag is [IMP]. [SEF] and [EXT] criteria are excluded from runtime verification; they may be listed in an appendix but do not require a status verdict.
For each AC that was targeted by a test in Phase 4, apply the following rules in order:
VERIFIED (REQ-016):
status = "VERIFIED"evidence to a concise description:
curl returned HTTP <code> in <N>msPlaywright assertion passed: <selector> <condition>GUI automation confirmed: <window/element> presentFAILED (REQ-018):
status = "FAILED"actual to the observed value (e.g., HTTP 400, element not found, timeout after 30s)expected to the value demanded by the AC (e.g., HTTP 201, element visible)evidence to a human-readable sentence combining actual vs expected, plus the path to any captured artifact (screenshot, response dump) if available.MANUAL CHECK REQUIRED (REQ-017):
status = "MANUAL CHECK REQUIRED"evidence to the reason: No automated test could be derived: <reason>IMPORTANT: Every [IMP] AC MUST have a final status of VERIFIED, FAILED, or MANUAL CHECK REQUIRED. No AC may remain in PENDING when Phase 5 ends.
After all rows are populated, compute:
Store these counts; they are required in the report Summary section (REQ-020).
Goal: Produce a deterministic, human-readable markdown report that follows the format defined in Phase 6.3 and contains no secrets.
SPEC_FOLDER is the value of the --spec argument (e.g., docs/specs/001-real-e2e-verification/).e2e-report-YYYY-MM-DD-HHMMSS.md (AC-026).Before writing any command output into the report, run the raw logs through a redaction pass (REQ-NR002):
Only the redacted version ($STARTUP_LOGS_FILE.redacted_final) is included in the report. The original temp file is discarded.
Generate the report by appending each section in the exact order below. All paths inside the report MUST be relative to the report file location.
Section 1 — Summary
Section 2 — Environment
RUNTIME_VERSION: capture the runtime version detected during startup:
docker --versionnode --versionjava -version 2>&1 | head -1python --version or python3 --versionISO8601_START_TIME: the timestamp when Phase 3 began, in ISO-8601 format.Section 3 — Test Results
... if longer.VERIFIED, FAILED, or MANUAL CHECK REQUIRED../e2e-artifacts/ac-019-screenshot.png).Section 4 — Raw Output
(no output).(truncated; full logs available in <path>).Section 5 — Artifacts
$ARTIFACT_DIR.No artifacts captured for this run.Section 6 — Teardown Status
TEARDOWN_EXECUTED: true / false / skipped (--keep-alive)PORT_RELEASED: true / false / unknownREMAINING_PROCESSES: A comma-separated list of PIDs or container names still active after teardown, or none.markdownlint rules): proper heading levels, no trailing spaces, consistent pipe table delimiters.REPORT_PATH="$REPORT_FILE" for use in Phase 8.Goal: Gracefully stop all runtime resources started in Phase 3, verify that ports and processes are fully released, and record the outcome. If --keep-alive is passed, skip teardown entirely and warn the user.
--keep-alive GuardDocker-managed (AC-029):
Local processes (JVM, Node.js/NestJS, Python, Desktop) (AC-029):
Emergency cleanup — orphan processes from a crashed test:
Update the report file in-place (append the Teardown Status section if it was not written in Phase 6, or ensure the variables are correctly set before Phase 6 finalizes). The preferred order is:
sed):If the report was already finalized before teardown (a valid alternative), append a Post-Teardown Update section at the end of the report:
IMPORTANT: Do NOT delete the report or modify any spec/task files during teardown (REQ-NR005).
--keep-alive notice)/developer-kit-specs:specs.task-implementation again for the failing taskActions:
pom.xml + docker-compose.yml → Docker-managed Spring Bootdocker compose up -dlocalhost:8080/actuator/health[IMP] AC describing login endpointcurl -s -w "\n%{http_code}" -X POST http://localhost:8080/api/login -d '{"email":"test@example.com","password":"secret"}'200 and response contains tokendocs/specs/001-user-auth/e2e-report-2026-05-31-143022.mddocker compose downActions:
package.json with react dependencynpm run dev; wait for localhost:5173/dashboardpage.click('[data-testid=refresh]'), assert table rows updateActions:
src-tauri/Cargo.toml → Tauri desktop appcargo tauri build --debug then launch the .app/.exeOnly commands documented in references/test-execution-patterns.md may be executed automatically. The whitelist covers:
| Category | Allowed Commands |
|---|---|
| Docker | docker compose up -d --build, docker compose down, docker compose ps, docker compose logs |
| JVM / Spring Boot | ./mvnw spring-boot:run, ./gradlew bootRun |
| Node.js / NestJS | npm run dev, npm run start:dev, npm start, node server.js |
| Python | uvicorn main:app --reload, python manage.py runserver, flask run |
| Desktop (Tauri) | cargo tauri build --debug, cargo tauri dev, open *.app, direct binary execution |
| Desktop (Electron) | npm run electron:dev, npx electron . |
| Testing | curl (without -k/--insecure unless --insecure passed), npx playwright, node (for inline Playwright scripts) |
| Teardown | docker compose down, kill -TERM, kill -KILL (for stuck processes only), lsof, nc |
Non-whitelisted command policy: IF a derived command is NOT in the whitelist → use AskUserQuestion to request explicit user confirmation before execution. The user MUST approve the command; otherwise, abort.
The following negative requirements (REQ-NR001 through REQ-NR008) are enforced at multiple points in the skill workflow:
The system SHALL NOT run sudo, rm -rf, docker system prune, mkfs, dd, or any other destructive system command during startup, test, or teardown.
Enforcement:
docker compose down and graceful process termination (kill -TERM / kill -KILL for stuck orphans only).The system SHALL NOT expose secrets, API keys, or passwords in the E2E report.
Enforcement:
Authorization: Bearer <token> → Authorization: Bearer ***REDACTED***E2E_AUTH_TOKEN=..., E2E_USERNAME=..., E2E_PASSWORD=... → E2E_xxx=***REDACTED***"token": "..." → "token": "***REDACTED***"curl -u user:password → curl -u user:***REDACTED***The system SHALL NOT disable TLS certificate verification (-k / --insecure) in curl by default.
Enforcement:
-k or --insecure unless the --insecure flag was explicitly passed.-k / --insecure.--insecure is passed → a warning is logged: "TLS certificate verification is disabled. Use only for local development."The system SHALL NOT overwrite or delete existing databases, volumes, or local data unless the startup command itself does so.
Enforcement:
rm, --volumes, prune, drop, or similar destructive data patterns.The system SHALL NOT modify the functional specification or task files during report generation or teardown.
Enforcement:
e2e-report-YYYY-MM-DD-HHMMSS.md) only.The system SHALL NOT leave orphan processes or containers running when startup fails.
Enforcement:
docker compose down is executed before exiting.kill -TERM $STARTUP_PID is executed before exiting.The system SHALL NOT block indefinitely on a hanging test.
Enforcement:
timeout --signal=TERM <N>; if timeout occurs, the AC is marked FAILED.TEST_TIMEOUT_SEC; if exceeded, the AC is marked FAILED.FAILED, never VERIFIED or PENDING.The system SHALL NOT retry failed curl requests.
Enforcement:
--retry flag, NO retry loops, NO fallback re-execution.FAILED.npm install -g or brew install automatically.localhost. Remote URLs, staging, or production endpoints are out of scope.references/test-execution-patterns.md. Any command outside the whitelist requires user confirmation via AskUserQuestion.E2E_* environment variables, and passwords are redacted from the report. Only header names and redacted values appear.--insecure only for local development with self-signed certificates.--keep-alive is passed, the user is responsible for manual teardown.