Logo di Flow Test

Flow Test

CommunityPopolare
Trystan-SA
flow-test

Turn a user flow into an end-to-end test with a UX budget — the test fails when the happy path needs more clicks, fields or page loads than allowed, so UX regressions break CI the way performance regressions do. Playwright by default, adapted to Cypress or the project's existing E2E setup. Use when asked to test a flow, add a click budget, keep onboarding, signup or checkout from getting longer, or after a happy-path audit sets a budget.

Panoramica

Pubblicato daTrystan-SA
Repositoryproduct-engineer-skills
Nome della skillflow-test
Stelle
2.1K
Fork
247
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da Trystan-SA su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Flow Test in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/Trystan-SA/product-engineer-skills/tree/main/skills/flow-test
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Trystan-SA/product-engineer-skills.git /tmp/product-engineer-skills
mkdir -p .claude/skills
cp -r /tmp/product-engineer-skills/skills/flow-test .claude/skills/flow-test
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Flow Test in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Flow Test non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Flow Test non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Flow Test

A flow that took 6 clicks at launch takes 11 a year later, one reasonable PR at a time, and nothing fails along the way. This skill makes the flow's cost an assertion: an end-to-end test walks the happy path the way a user would, counts the interactions, and fails when the count exceeds the budget.

Phase 1: Find the E2E setup

Look for an existing end-to-end stack: playwright.config.*, cypress.config.*, wdio.conf.*, Maestro or Detox for mobile. Reuse its config, fixtures, authentication helpers, test-data seeding and CI job.

If there's none, propose Playwright and ask before adding it: a new tool in the project's toolchain is the team's decision.

Phase 2: Get the flow and the budget

Read flow-audit.md in the feature folder (docs/product/<feature-slug>/) for the steps and the budget. Without one, trace the happy path quickly (entry point → steps → goal state) and set the budget to today's count: the test's first job is to stop the flow from getting worse.

What to assert, depending on the flow:

  • clicks — activations of controls: buttons, links, options, checkboxes, tabs, including opening dropdowns and closing modals.
  • fields — distinct inputs the user fills.
  • navigations — page loads and client-side route changes after the start state.
  • time (optional) — only with a generous margin, because CI machines are noisy.

These match the definitions in happy-path-audit, so the audit's budget can be asserted as is.

Phase 3: Add the UX meter

Count interactions in the page, not in the test code. A listener on real DOM events counts every click, whichever helper or page object produced it. Add this once next to the project's other fixtures, adapted to its language and conventions (Playwright with TypeScript shown):

ts
// e2e/fixtures/ux-meter.ts
import { test as base, expect, type Page } from '@playwright/test';

export type UxBudget = { clicks?: number; fields?: number; navigations?: number };

export class UxMeter {
  clicks = 0;
  fields = 0;
  navigations = 0;

  constructor(private readonly page: Page) {}

  async install() {
    await this.page.exposeBinding('__uxMeter', (_source, kind: 'click' | 'field') => {
      if (kind === 'click') this.clicks++;
      else this.fields++;
    });
    await this.page.addInitScript(() => {
      const report = (kind: string) => (window as any).__uxMeter?.(kind);
      const touched = new WeakSet<EventTarget>();
      const onField = (event: Event) => {
        if (event.target && !touched.has(event.target)) {
          touched.add(event.target);
          report('field');
        }
      };
      addEventListener('click', (event) => { if (event.isTrusted) report('click'); }, true);
      addEventListener('input', onField, true);
      addEventListener('change', onField, true);
    });
    this.page.on('framenavigated', (frame) => {
      if (frame === this.page.mainFrame()) this.navigations++;
    });
  }

  /** Call once the start state is visible (after login, seeding and the first goto). */
  start() {
    this.clicks = 0;
    this.fields = 0;
    this.navigations = 0;
  }

  expectWithin(budget: UxBudget) {
    const actual = { clicks: this.clicks, fields: this.fields, navigations: this.navigations };
    base.info().annotations.push({ type: 'ux-budget', description: JSON.stringify({ actual, budget }) });
    for (const key of Object.keys(budget) as (keyof UxBudget)[]) {
      expect(actual[key], `UX budget exceeded for ${key}: ${JSON.stringify(actual)}`)
        .toBeLessThanOrEqual(budget[key]!);
    }
  }
}

export const test = base.extend<{ ux: UxMeter }>({
  ux: async ({ page }, use) => {
    const meter = new UxMeter(page);
    await meter.install();
    await use(meter);
  },
});
export { expect };

What it counts:

  • Playwright's click, check and tap produce trusted events and are counted. Clicks dispatched by the app's own JavaScript are not.
  • fill and selectOption count one field per input, however many times it's edited. They don't count a click: focusing a text field is part of filling it. A native <select> costs a real user two clicks — add them to the budget by hand if the flow has one.
  • A checkbox or radio counts as one click and one field. Set budgets from a measured run, not only from the audit's arithmetic.
  • framenavigated fires for full page loads and for client-side route changes. If the app rewrites the URL several times per screen (query parameters, redirects), assert clicks and fields and leave navigations out.
  • For Cypress or another runner, keep the same design: a page-side listener on click, input and change in the capture phase, reset at the start state, asserted at the goal state.

Phase 4: Write the tests

Happy path first. Walk it like a user: role- and label-based locators (getByRole, getByLabel), which survive refactors and double as an accessibility check. Seed the start state through the API if that's faster, but never take API shortcuts for the steps being measured.

ts
import { test, expect } from './fixtures/ux-meter';

test('first invoice is sent within budget', async ({ page, ux }) => {
  await page.goto('/dashboard'); // signed in through storageState
  await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
  ux.start();

  await page.getByRole('button', { name: 'New invoice' }).click();
  await page.getByLabel('Client').fill('Acme');
  await page.getByRole('option', { name: 'Acme Corp' }).click();
  await page.getByLabel('Amount').fill('1200');
  await page.getByRole('button', { name: 'Send invoice' }).click();

  await expect(page.getByText('Invoice sent')).toBeVisible(); // goal state
  ux.expectWithin({ clicks: 3, fields: 2 });                  // budget from flow-audit.md
});

Then the critical unhappy paths listed in unhappy-paths.md. Simulate failures with network interception (page.route returning a 500 or a validation error) and assert the recovery: the error is visible, the input is kept, and the user gets back on the path within a small budget.

Phase 5: Make the budget a team rule

  • Keep budgets next to the test, or in one ux-budgets.json when there are several flows, so any budget change shows up in the diff.
  • The failure message must say what to do: if the extra step is intentional, raise the budget in the same PR and justify it in the description; otherwise remove the step.
  • Ratchet: when a PR makes the flow shorter, lower the budget in that PR.
  • Run the tests in the existing CI job. The ux-budget annotation records the measured counts, so ux-review can show before and after on a PR.

Output

The fixture, the flow tests and the budgets committed to the repo, with a run that passes — or that fails on an existing regression, which you report. Summarize: flows covered, budgets set (current and target), and any flow already over its target.

Domande frequenti

Cosa fa la skill IA Flow Test?

Turn a user flow into an end-to-end test with a UX budget — the test fails when the happy path needs more clicks, fields or page loads than allowed, so UX regressions break CI the way performance regressions do. Playwright by default, adapted to Cypress or the project's existing E2E setup. Use when asked to test a flow, add a click budget, keep onboarding, signup or checkout from getting longer, or after a happy-path audit sets a budget.

Perché usare Flow Test su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Flow Test è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Flow Test in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/Trystan-SA/product-engineer-skills/tree/main/skills/flow-test. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Flow Test?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Flow Test?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Flow Test: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Flow Test è gratuita?

Sì. È pubblicata su GitHub da Trystan-SA con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇