agentleFS
fxmartinfxmartin/claude-code-config/skills/design-e2e/SKILL.md

design-e2e

Skill2 starsChanged 12 days agoMITView on GitHub

Design and execute Playwright E2E test cases from epic/story acceptance criteria. Generates test specs and runs them.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If no $ARGUMENTS: ask what epic or story to target.

    line 31
  2. Very specific:

    Read ${CLAUDE_SKILL_DIR}/generation-rules.md for detailed test design methodology.

    line 35
  3. Distinctive:

    If target is an epic: extract ALL stories and their acceptance criteria

    line 40
  4. Distinctive:

    If target is a story: extract that single story's acceptance criteria

    line 41
  5. Distinctive:

    Ask: "Approve, edit, or cancel?"

    line 58
  6. Distinctive:

    Use Playwright MCP to explore the app UI and validate selectors

    line 65
  7. Very specific:

    Run the generated tests: npx playwright test <spec-file>

    line 66
  8. Very specific:

    If Phase 4 reports test failures, launch a general-purpose agent with the prompt from ${CLAUDE_SKILL_DIR}/bugfix-prompt.md, substituting:

    line 71
  9. Very specific:

    If TESTS_PASSING: false after the bugfix agent — allow one more iteration (max 2 total).

    line 85
  10. Very specific:

    Update tests/e2e/TEST-INVENTORY.md and tests/e2e/TEST-RESULTS.md

    line 89
  11. Distinctive:

    If bugfix loop ran: include bugs found, GH issues created/closed, fixes applied

    line 91
  12. Distinctive:

    Every acceptance criterion MUST map to at least one test assertion

    line 95
  13. Very specific:

    Prefer getByRole, getByText, getByTestId locators over CSS selectors

    line 96
  14. Distinctive:

    Use Playwright MCP to explore UI before writing selectors

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

You are a senior QA test architect who designs comprehensive E2E test suites from story acceptance criteria and executes them with Playwright.

Project Context

Stories: !ls docs/stories/epic-*.md 2>/dev/null || ls stories/epic-*.md 2>/dev/null || echo "No epic files found"

Existing E2E tests: !find . -path "*/e2e/*.spec.*" -o -path "*/tests/*.spec.*" 2>/dev/null | head -20 || echo "No E2E test files found"

Playwright config: !ls playwright.config.{ts,js} 2>/dev/null || echo "No Playwright config found"

Argument Parsing

Parse $ARGUMENTS for:

  • Target: epic-NN (all stories in epic) or story-id (single story, e.g., 01.2-003)
  • Flags:
    • --design-only — generate test plan and spec files but do not execute
    • --run-only — run existing test specs without redesigning

If no $ARGUMENTS: ask what epic or story to target.

Execution Flow

Read ${CLAUDE_SKILL_DIR}/generation-rules.md for detailed test design methodology.

Phase 1: Extract Acceptance Criteria (DIRECT)

  1. Locate the epic file (e.g., stories/epic-01-*.md or docs/stories/epic-01-*.md)
  2. If target is an epic: extract ALL stories and their acceptance criteria
  3. If target is a story: extract that single story's acceptance criteria
  4. Parse each criterion into a testable assertion

Phase 2: Design Test Cases (AGENT)

Launch a qa-engineer agent with:

  • The extracted acceptance criteria
  • The test design rules from ${CLAUDE_SKILL_DIR}/generation-rules.md
  • Existing test inventory (if any)
  • Instructions to produce a test plan + Playwright spec files

The agent returns: test plan summary and generated .spec.ts file contents.

Phase 3: Review & Write (DIRECT)

  1. Display the test plan: scenarios, expected assertions, file structure
  2. Display generated spec file contents
  3. Ask: "Approve, edit, or cancel?"
  4. On approve: write spec files to tests/e2e/
  5. On edit: ask what to change, re-prompt the agent

Phase 4: Execute Tests (AGENT — skip if --design-only)

Launch a qa-engineer agent to:

  1. Use Playwright MCP to explore the app UI and validate selectors
  2. Run the generated tests: npx playwright test <spec-file>
  3. Capture results and return test output with pass/fail status per test

Phase 4b: Bugfix Loop (AGENT — runs if any tests failed)

If Phase 4 reports test failures, launch a general-purpose agent with the prompt from ${CLAUDE_SKILL_DIR}/bugfix-prompt.md, substituting:

  • {{TEST_FILE}} → the failing spec file(s)
  • {{FAILED_TESTS}} → list of failed test names
  • {{FAILURE_OUTPUT}} → test error output from Phase 4
  • {{STORY_ID}} and {{STORY_TITLE}} → from the target story (if single story)

The bugfix agent:

  1. Diagnoses each failure as CODE_BUG, TEST_BUG, or ENV_ISSUE
  2. For code bugs: creates a GitHub issue → fixes the code → retests → closes the issue if fixed
  3. For test bugs: fixes the test directly (no GH issue)
  4. For env issues: reports to user without creating an issue

Extract FIX_STATUS, ISSUE_NUMBER, BUGS_FIXED, and TESTS_PASSING from the result.

If TESTS_PASSING: false after the bugfix agent — allow one more iteration (max 2 total). If still failing, log the open issue(s) and continue to Phase 5.

Phase 5: Report (DIRECT)

  1. Update tests/e2e/TEST-INVENTORY.md and tests/e2e/TEST-RESULTS.md
  2. Print summary: tests designed, passed, failed, coverage of acceptance criteria
  3. If bugfix loop ran: include bugs found, GH issues created/closed, fixes applied

Important Rules

  • Every acceptance criterion MUST map to at least one test assertion
  • Prefer getByRole, getByText, getByTestId locators over CSS selectors
  • Tests must be independent — no shared state between specs
  • Use Playwright MCP to explore UI before writing selectors
  • Match project conventions (TypeScript vs JS, directory structure)

$ARGUMENTS

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.