agentleFS
UwayxtUwayxt/agent-skills/.agents/skills/flow-based-functional-testing/SKILL.md

flow-based-functional-testing

Skill4 starsChanged 2 months agoMITView on GitHub

Execute user flows as functional test cases and verify outcomes match the design. Use when functional testing, user flow testing, end-to-end test, verify the flow works, or test this feature.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Every user flow defined in user-flow-mapping becomes a test scenario.

    line 9
  2. Distinctive:

    Not all flows are equal. Order execution by business impact:

    line 17
  3. Distinctive:

    Use Given-When-Then format for absolute clarity.

    line 25
  4. Distinctive:

    Run the test suite. Record states: pass / fail / blocked (environment issue, not a product bug).

    line 48
  5. Very specific:

    Every user flow from user-flow-mapping has at least one test scenario

    line 57
  6. Distinctive:

    All failures are documented with PRD requirement reference

    line 59
  7. Distinctive:

    Test results are recorded in an output report

    line 61
  8. Distinctive:

    Test case document (Given-When-Then format for each scenario)

    line 64
  9. Distinctive:

    Test results report (scenario × pass/fail × failure details × PRD requirement ID)

    line 66
  10. Distinctive:

    Not recording results — "it passed on my machine" is not a result

    line 72

≈ “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

A feature is not done when it is built — it is done when a user can complete the flow you designed for them. Testing the flow is the only way to know.

1. Extract test scenarios from user-flow-mapping

Every user flow defined in user-flow-mapping becomes a test scenario. Define the scenario attributes:

  • Entry point (URL or starting state)
  • Actor (user role/permission level)
  • Steps (sequence of actions)
  • Expected outcome (what MUST be true at the end)
  • Error paths (what happens if a step fails)

2. Prioritize scenarios

Not all flows are equal. Order execution by business impact:

  • Critical path (the flow that delivers the product's core value)
  • Authentication and permission flows (most security-critical)
  • Data mutation flows (create, update, delete — irreversible actions)
  • Error and recovery flows (what happens when things go wrong)
  • Edge cases (empty state, max length inputs, concurrent operations)

3. Write test cases

Use Given-When-Then format for absolute clarity. For each scenario:

  • Given: initial state and preconditions
  • When: sequence of user actions
  • Then: expected outcomes (UI changes, data changes, navigation, notifications)

4. Generate Playwright test scaffolds

Produce an executable Playwright test for every scenario. Ensure assertions test outcomes, not implementation details.

// Run: npx playwright test flow-tests/
test('Critical path: User completes [flow name]', async ({ page }) => {
  // Given
  await page.goto('/start-url');
  // When
  await page.click('[data-testid="action-button"]');
  // Then
  await expect(page.locator('[data-testid="success-state"]')).toBeVisible();
});

Note: Use data-testid attributes for selectors — never CSS classes or text content.

5. Execute tests and record results

Run the test suite. Record states: pass / fail / blocked (environment issue, not a product bug). For failures, capture:

  • Step that failed
  • Expected vs actual outcome
  • Screenshot or DOM snapshot at point of failure

6. Map failures to PRD requirements

For every failed test, resolve the corresponding PRD requirement ID from the prd-traceability-matrix. The failure report must include the requirement ID. This feeds the qa-feedback-loop-orchestrator.

Completion Criteria

  • Every user flow from user-flow-mapping has at least one test scenario
  • Critical path tests pass 100%
  • All failures are documented with PRD requirement reference
  • Playwright scaffolds are in version control and runnable
  • Test results are recorded in an output report

Output

  • Test case document (Given-When-Then format for each scenario)
  • Playwright test files (flow-tests/*.spec.js)
  • Test results report (scenario × pass/fail × failure details × PRD requirement ID)

Anti-patterns

  • Writing tests only for the happy path and ignoring error flows
  • Using CSS classes or display text as selectors
  • Running tests only locally — they should be reproducible in any environment
  • Not recording results — "it passed on my machine" is not a result
  • Testing implementation details instead of user outcomes

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.