Scenario testing

From aiskillstore/marketplace · View interactive version

Scenario testing is an AI agent skill from the GitHub repository aiskillstore/marketplace. 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 .scrat

How to use this skill

Skill file

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

Required Practices

1. Write Scenarios in `.scratch/`

2. Promote Patterns to `scenarios.jsonl`

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:

What Makes a Scenario Invalid

A scenario is invalid if it:

Common Violations to Avoid

Reject these rationalizations:

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

Only scenario tests prove your feature delivers value to users.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.