scenario-testing
This skill should be used when writing tests, validating features, or needing to verify code works. Triggers on "write tests", "add test coverage", "validate feature", "integration test", "end-to-end", "e2e test", "mock", "unit test". Enforces scenario-driven testing with real dependencies in .scratch/ directory.
Best use case
scenario-testing is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. This skill should be used when writing tests, validating features, or needing to verify code works. Triggers on "write tests", "add test coverage", "validate feature", "integration test", "end-to-end", "e2e test", "mock", "unit test". Enforces scenario-driven testing with real dependencies in .scratch/ directory.
This skill should be used when writing tests, validating features, or needing to verify code works. Triggers on "write tests", "add test coverage", "validate feature", "integration test", "end-to-end", "e2e test", "mock", "unit test". Enforces scenario-driven testing with real dependencies in .scratch/ directory.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "scenario-testing" skill to help with this workflow task. Context: This skill should be used when writing tests, validating features, or needing to verify code works. Triggers on "write tests", "add test coverage", "validate feature", "integration test", "end-to-end", "e2e test", "mock", "unit test". Enforces scenario-driven testing with real dependencies in .scratch/ directory.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/scenario-testing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How scenario-testing Compares
| Feature / Agent | scenario-testing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This skill should be used when writing tests, validating features, or needing to verify code works. Triggers on "write tests", "add test coverage", "validate feature", "integration test", "end-to-end", "e2e test", "mock", "unit test". Enforces scenario-driven testing with real dependencies in .scratch/ directory.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Scenario-Driven Testing for AI Code Generation ## Core Principle **The Iron Law**: "NO FEATURE IS VALIDATED UNTIL A SCENARIO PASSES WITH REAL DEPENDENCIES" Mocks create false confidence. Only scenarios exercising real systems validate that code works. ## The Truth Hierarchy 1. **Scenario tests** (real system, real data) = **truth** 2. **Unit tests** (isolated) = human comfort only 3. **Mocks** = lies hiding bugs As stated in the principle: "A test that uses mocks is not testing your system. It's testing your assumptions about how dependencies behave." ## When to Use This Skill - Validating new functionality - Before declaring work complete - When tempted to use mocks - After fixing bugs requiring verification - Any time you need to prove code works ## Required Practices ### 1. Write Scenarios in `.scratch/` - Use any language appropriate to the task - Exercise the real system end-to-end - Zero mocks allowed - Must be in `.gitignore` (never commit) ### 2. Promote Patterns to `scenarios.jsonl` - Extract recurring scenarios as documented specifications - One JSON line per scenario - Include: name, description, given/when/then, validates - This file IS committed ### 3. Use Real Dependencies External APIs must hit actual services (sandbox/test mode acceptable). Mocking any dependency invalidates the scenario. ### 4. Independence Requirement Each scenario must run standalone without depending on prior executions. This enables: - Parallel execution - Prevents hidden ordering dependencies - Reliable CI/CD integration ## What Makes a Scenario Invalid A scenario is invalid if it: - Contains any mocks whatsoever - Uses fake data instead of real storage - Depends on another scenario running first - Never actually executed to verify it passes ## Common Violations to Avoid Reject these rationalizations: - **"Just a quick unit test..."** - Unit tests don't validate features - **"Too simple for end-to-end..."** - Integration breaks simple things - **"I'll mock for speed..."** - Speed doesn't matter if tests lie - **"I don't have API credentials..."** - Ask your human partner for real ones ## Definition of Done A feature is complete only when: 1. ✅ A scenario in `.scratch/` passes with zero mocks 2. ✅ Real dependencies are exercised 3. ✅ `.scratch/` remains in `.gitignore` 4. ✅ Robust patterns extracted to `scenarios.jsonl` ## Example Workflow 1. **Write scenario** - Create `.scratch/test-user-registration.py` 2. **Use real dependencies** - Hit real database, real auth service (test mode) 3. **Run and verify** - Execute scenario, confirm it passes 4. **Extract pattern** - Document in `scenarios.jsonl` 5. **Keep .scratch ignored** - Never commit scratch scenarios ## Why This Matters - **Unit tests** verify isolated logic - **Integration tests** verify components work together - **Scenario tests** verify the system actually works Only scenario tests prove your feature delivers value to users.
Related Skills
testing-strategies
Design comprehensive testing strategies for software quality assurance. Use when planning test coverage, implementing test pyramids, or setting up testing infrastructure. Handles unit testing, integration testing, E2E testing, TDD, and testing best practices.
backend-testing
Write comprehensive backend tests including unit tests, integration tests, and API tests. Use when testing REST APIs, database operations, authentication flows, or business logic. Handles Jest, Pytest, Mocha, testing strategies, mocking, and test coverage.
wordpress-penetration-testing
This skill should be used when the user asks to "pentest WordPress sites", "scan WordPress for vulnerabilities", "enumerate WordPress users, themes, or plugins", "exploit WordPress vulnerabilities", or "use WPScan". It provides comprehensive WordPress security assessment methodologies.
web3-testing
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.
web-security-testing
Web application security testing workflow for OWASP Top 10 vulnerabilities including injection, XSS, authentication flaws, and access control issues.
unit-testing-test-generate
Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.
testing-qa
Comprehensive testing and QA workflow covering unit testing, integration testing, E2E testing, browser automation, and quality assurance.
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
ssh-penetration-testing
This skill should be used when the user asks to "pentest SSH services", "enumerate SSH configurations", "brute force SSH credentials", "exploit SSH vulnerabilities", "perform SSH tunneling", or "audit SSH security". It provides comprehensive SSH penetration testing methodologies and techniques.
sqlmap-database-pentesting
This skill should be used when the user asks to "automate SQL injection testing," "enumerate database structure," "extract database credentials using sqlmap," "dump tables and columns...
sqlmap-database-penetration-testing
This skill should be used when the user asks to "automate SQL injection testing," "enumerate database structure," "extract database credentials using sqlmap," "dump tables and columns from a vulnerable database," or "perform automated database penetration testing." It provides comprehensive guidance for using SQLMap to detect and exploit SQL injection vulnerabilities.
sql-injection-testing
This skill should be used when the user asks to "test for SQL injection vulnerabilities", "perform SQLi attacks", "bypass authentication using SQL injection", "extract database information through injection", "detect SQL injection flaws", or "exploit database query vulnerabilities". It provides comprehensive techniques for identifying, exploiting, and understanding SQL injection attack vectors across different database systems.