This skill should be used when validating features end-to-end without mocks, testing integrations, or when "scenario test", "e2e test", or "no mocks" are mentioned.
End-to-end validation using real dependencies, no mocks ever.
<when_to_use>
NOT for: unit testing, mock testing, performance benchmarking, load testing
</when_to_use>
<iron_law>
NO MOCKS EVER.
Truth hierarchy:
Mocks test your assumptions, not reality. When mocks pass but production fails, the mock lied. When scenarios fail, reality spoke.
Test against real databases, real APIs, real services. Use test credentials, staging environments, local instances — but always real implementations.
</iron_law>
<directory_structure>
Throwaway test scripts for quick validation. Self-contained, runnable, disposable.
CRITICAL: Verify .scratch/ in .gitignore before first use.
Successful scenario patterns documented as JSONL. One scenario per line, each a complete JSON object.
Purpose: capture proven patterns, regression indicators, reusable test cases.
Structure:
{"name":"auth-login-success","description":"User logs in with valid credentials","setup":"Create test user with known password","steps":["POST /auth/login with credentials","Receive JWT token","GET /auth/me with token"],"expected":"User profile returned with correct data","tags":["auth","jwt","happy-path"]}
{"name":"auth-login-invalid","description":"Login fails with wrong password","setup":"Test user exists","steps":["POST /auth/login with wrong password"],"expected":"401 Unauthorized, no token issued","tags":["auth","error-handling"]}
</directory_structure>
<scratch_directory>
Quick validation without ceremony. Write script, run against real deps, verify behavior, delete or document.
test-{feature}.ts — feature validation (test-auth-flow.ts)debug-{issue}.ts — investigate specific bug (debug-token-expiry.ts)prove-{behavior}.ts — demonstrate expected behavior (prove-rate-limiting.ts)explore-{api}.ts — learn external API behavior (explore-stripe-webhooks.ts)// .scratch/test-auth-flow.ts
import { db } from '../src/db'
import { api } from '../src/api'
async function testAuthFlow() {
// Setup: real test user in real database
const user = await db.users.create({
email: 'test@example.com',
password: 'hashed-test-password'
})
// Execute: real HTTP requests
const loginRes = await api.post('/auth/login', {
email: user.email,
password: 'test-password'
})
// Verify: actual response
console.assert(loginRes.status === 200, 'Login should succeed')
console.assert(loginRes.body.token, 'Should receive JWT token')
const meRes = await api.get('/auth/me', {
headers: { Authorization: `Bearer ${loginRes.body.token}` }
})
console.assert(meRes.status === 200, 'Auth should work')
console.assert(meRes.body.email === user.email, 'Should return correct user')
// Cleanup
await db.users.delete({ id: user.id })
console.log('✓ Auth flow validated')
}
testAuthFlow().catch(console.error)
</scratch_directory>
<scenarios_jsonl>
Each line is complete JSON object with fields:
{
name: string // unique identifier (kebab-case)
description: string // human-readable summary
setup: string // prerequisites and state preparation
steps: string[] // ordered actions to execute
expected: string // success criteria
tags: string[] // categorization (auth, api, error, etc)
env?: string // required environment (staging, local, prod-readonly)
duration_ms?: number // typical execution time
}
Document in scenarios.jsonl when:
Delete from .scratch/ when:
</scenarios_jsonl>
<workflow>Loop: Write → Execute → Document → Cleanup
Each iteration:
<gitignore_check>
MANDATORY before first .scratch/ use:
grep -q '.scratch/' .gitignore || echo '.scratch/' >> .gitignore
Verify .scratch/ directory will not be committed. All test scripts are local-only.
If .gitignore doesn't exist, create it:
[ -f .gitignore ] || touch .gitignore
grep -q '.scratch/' .gitignore || echo '.scratch/' >> .gitignore
</gitignore_check>
<stages>Prepare real dependencies:
Create .scratch/ test script:
Run proof program:
If scenario validates behavior:
Delete .scratch/ script or promote to permanent test suite.
</stages> <rules>ALWAYS:
NEVER:
ESCALATE when:
Patterns and examples:
Related skills:
External resources:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer