agentleFS
youcislayoucisla/Agent-Foundry/skills/core/e2e-test-strategy/SKILL.md

e2e-test-strategy

Skill1 starsChanged 23 days agoMITView on GitHub

'Plan an end-to-end test pyramid: which flows to E2E, which to integration,

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't invert it. Lots of E2E = slow, flaky, low-signal.

    line 30
  2. Distinctive:

    Verify the world, not the self-report: re-read the file, row, or response.

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

E2E Test Strategy

A test pyramid that catches the bugs that matter, runs fast, and doesn't flake.

Procedure

The Pyramid

       ╱  E2E  ╲              few — 5-20 critical flows
      ╱─────────╲
     ╱Integration╲           some — key API + DB combinations
    ╱─────────────╲
   ╱     Unit     ╲         many — every function, every branch
  ╱─────────────────╲

Don't invert it. Lots of E2E = slow, flaky, low-signal.

Decision Tree

For any test case, ask in order:

  1. Can I test it with a pure function? → Unit
  2. Can I test it with one module + mocked deps? → Integration
  3. Does it span network / browser / external service? → E2E
BehaviorLayer
validateEmail(s) rejects bad inputUnit
UserRepo.create() inserts and returnsIntegration
POST /signup returns 201 + sends emailE2E
Drag-drop reorders listE2E
Pricing tier changes entitlementIntegration
Stripe webhook triggers subscriptionE2E

Which E2E Flows Matter

E2E is expensive. Pick the 5-20 flows where a regression would cost the most.

Always E2ENever E2E
Sign-up → first value momentInternal helpers
Core monetization (checkout, subscription)Pure UI styling
Critical auth (login, password reset)Bulk data imports
Cross-service contracts (webhooks)Background jobs
Critical admin actions

Rule: "What is the user-visible failure cost if this regresses?" Catastrophic → E2E. Cosmetic → unit or skip.

Test Data: Seeding

Bad: production DB or saved dumps.

Good: deterministic per-test seeding.

async function seedUser(opts: { plan?: 'free' | 'pro' } = {}) {
  const id = `test-${randomUUID()}`;
  await db.users.insert({ id, email: `${id}@test.com`, plan: opts.plan ?? 'free' });
  return id;
}

Rules:

  • Each test seeds only what it needs
  • Cleanup in afterEach, not afterAll
  • Unique IDs per run (parallel-safe)
  • Pin time-relative data to fixtures

Anti-patterns

  • Putting every flow in E2E because it is end-to-end.
  • Sharing one seeded user across parallel tests.
  • Relying on production data or saved dumps.
  • A test that passes only when run alone.

References

  • details

Verification Checklist

  • Each behavior sits at the cheapest layer that can catch it.
  • E2E set is limited to costly regressions.
  • Tests seed deterministic, unique data.
  • Auth state is created without manual steps.
  • The suite passes in parallel and in isolation.

Test Integrity Rules

  • Snapshot byte-exact prompt assembly for a real skill, the fallback, and a schema-augmented request. A one-space template change must fail.
  • Probe provider capability once and mark skips explicitly; a missing provider is a skip, not a silent pass.
  • Install a raising stub in mocked-provider tests so an accidental real call fails loudly.
  • Reset module caches and env overrides before each test; a spec that passes only alone is a test defect.
  • Verify the world, not the self-report: re-read the file, row, or response. Assert untouched files are byte-identical.
  • A guard only guards if the regression fails it. Introduce the regression once, watch red, revert.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.