End-to-end scenario testing without mocks, using real dependencies. Test scripts go in .scratch/ (gitignored), patterns documented in scenarios.jsonl (committed). Truth hierarchy - scenarios > unit tests > mocks. Use when validating features end-to-end, testing integrations, writing proof programs, or when scenario-test, e2e-test, integration-test, no-mocks, or --scenario are mentioned.
/plugin marketplace add outfitter-dev/agents/plugin install baselayer@outfitterThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/patterns.mdEnd-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:
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>
<phases> ## 1. Setup → Setting up scenario environmentPrepare real dependencies:
Create .scratch/ test script:
Run proof program:
If scenario validates behavior:
Delete .scratch/ script or promote to permanent test suite. </phases>
<rules> ALWAYS: - Verify .scratch/ in .gitignore before first use - Test against real dependencies (actual DB, live APIs) - Use self-contained scripts (runnable with single command) - Document successful scenarios in scenarios.jsonl - Cleanup test data after execution - Tag scenarios for easy filtering - Include cleanup phase in all scripts - Use test credentials (never production)NEVER:
ESCALATE when:
Related skills:
External resources:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.