AGENT SKILL

define-flow

Define a test flow by doing it: an agent-led session that builds a spec step by step in a live browser — the agent proposes each step, executes it immediately, and the user asserts the real outcome before the next step is defined. Use when a user wants to create a spec for a long or complex flow without writing it blind, or wants to walk through an existing spec live to clarify ambiguous steps. Produces a normal natural-language spec file that runs unmodified via /execute-test.

License 许可
MIT
最近更新
2026-10-26
Stars
★ 21
Forks
18

01 前言 Front Matter

name
define-flow
description
Define a test flow by doing it: an agent-led session that builds a spec step by step in a live browser — the agent proposes each step, executes it immediately, and the user asserts the real outcome before the next step is defined. Use when a user wants to create a spec for a long or complex flow without writing it blind, or wants to walk through an existing spec live to clarify ambiguous steps. Produces a normal natural-language spec file that runs unmodified via /execute-test.

03 SKILL.md 正文

Define Flow — the flow is defined by doing it, not by writing it

Role

You lead a define-by-doing session. The user has a flow in their head (or an unclear spec file); you turn it into a proven, runnable spec by executing every step live as it is defined. You lead: you ask what happens next, propose steps from what you see on the page, and offer choices. The user only answers, confirms, and selects — at no point do you ask the user to write spec text.

This session is authoring, not a test run. Note the direction reversal from a test run: there the user approves your plan; here you elicit the flow from the user, one step at a time.

You, the main agent, drive the whole session yourself. Never dispatch a subagent for any part of the loop — subagents cannot interact with the user mid-run, and this session IS mid-run interaction.

Session rules (apply throughout)

  • Forward-only. The user may correct only the step just executed. There is no jumping back: once a step is confirmed, it is immutable. If the user asks to redo an earlier step, decline plainly — explain that correction is forward-only in a definition session, and that the earlier step can be changed by editing the saved spec afterwards.
  • One sitting. No pause/resume. If the user must stop mid-session, the confirmed steps already exist in the draft spec file (see STEP LOOP): offer to save them as a partial spec clearly marked incomplete — this is not pause/resume (the session is not resumable); it only prevents losing confirmed work.
  • The user is the responsible party. This session is user-directed: the user's approval of a step IS the authorization to execute it. Never warn about, question, or double-check add/edit/delete steps the user directed — responsibility for the environment's state sits with the user. Your own initiative stays inside the normal autonomy boundary: when YOU propose data, propose disposable values (like qa.tester@example.com), never real personal data; and secrets are never printed under any circumstances.
  • Evidence is transient. Per-step screenshots exist only to show the user the actual outcome; they live in the transient .playwright-cli/ scratch and are cleaned at the end. A definition session never writes executions/ — only the optional validation run at the end (a normal /execute-test run) produces normal evidence in the normal place.
  • The user's existing files are never edited. A definition session writes exactly two things: its draft in the transient scratch, and the new spec file the user confirms at ASSEMBLE. An existing spec is input — walkthrough mode reads it and produces a NEW file beside it. It is never rewritten, reformatted, re-numbered, or silently annotated. The one line that may ever be added to an original is the cross-reference offered in walkthrough mode step 3, and only after the user says yes to it.
  • Never modify application source code. Resolve config from config/project.json and environments/<env>.json only. Never read .env: the bundled scripts read the values they need from it themselves. Never print, log, or pass secret values. A { "envSecret" } field is typed only with browser-driver's fill_secret.js (its Secret fields rule), never with fill or type.

1. SETUP

  1. Resolve target & environment exactly per the "Which environment?" and "Which login mode?" rules under Decisions in ${CLAUDE_PLUGIN_ROOT}/skills/test-execution/SKILL.md — read those sections and follow them as written: explicit environment → defaultEnvironment in config/project.json → legacy, the URL the user gave. A legacy project with no URL stops before the session with "give the URL, or run /update-agentex". Never read .env to find it. Undefined environment names are an error; undefined user handles are BLOCKED. All target, users, and test data come from the consumer project's configuration; nothing is hardcoded.
  2. Read ${CLAUDE_PLUGIN_ROOT}/skills/browser-driver/references/tools/playwright-cli.md before the first browser action. A definition session is single-session (no -s= fan-out) but NEVER the default playwright-cli session: generate one unique name — define-<HHMMSS>-<4 random hex chars> — and prefix every command with -s=<that name>. Only that session may be closed at the end; close-all / kill-all are forbidden.
  3. If the flow needs authentication, apply the optimize-login skill (read its SKILL.md): pay the login once, verify by landmark, and continue the session logged in.
  4. Ask the user for the flow's goal in one sentence. It becomes the spec's title and drives your step proposals throughout the session.

2. STEP LOOP

Repeat until the user says the flow is complete:

  1. Propose / ask. Look at the live page. Either propose the next step from what you can see ("I can see a Submit order button — is submitting next?") or ask what happens next. Offer choices as selectable options wherever possible (numbered lists of the actions or values visible on the page). The user answers, picks, or supplies a value — never ask them to phrase a spec line.
  2. Execute immediately. Run the agreed step in the live browser the moment it is agreed. Present the actual outcome: a screenshot plus the observed result in words. No mutation warnings and no second-guessing — the user's approval of the step is the authorization, including for add/edit/delete steps.
  3. Assert. The user confirms the expected result or corrects the step.
    • On confirmation, record the step as a natural-language spec line with its expected result, and append it immediately to the draft spec file in the session's transient scratch (default .playwright-cli/define-flow-draft.md) — incremental assemble: a crash or disconnect at step 14 loses nothing already confirmed. Keep a visible running list — after each confirmed step, show the numbered steps so far, so a long flow (15+ steps) never loses the thread.
    • On correction, re-phrase and re-run the just-executed step until the user confirms. Correction is forward-only: earlier steps stay as confirmed.
  4. Capture values. When a step surfaces data — an identifier the app generated, an option list, a value you read off the page — offer it: "use this later?" A selected value is recorded symbolically in the spec ("the order number produced in step 3"), with the concrete session value kept only as an inline example (e.g. "the order number produced in step 3 (this session: #48291)"). Never record the literal as the step's target — a fresh run must resolve the value live, not replay a stale one.
  5. Capture user-supplied data the same way. Input data the user provides during definition (a registration email, a record name) that must be unique or fresh for the flow to succeed again is recorded symbolically as fresh disposable data ("register with a fresh disposable email"), with the session's concrete value kept only as an inline example — mirroring app-surfaced values, and surfaced under the spec's Notes as disposable-data guidance per test/README.md. This is what keeps VALIDATE (and any fresh run) viable for mutating/create flows.
  6. Integration steps. If the user wants a beyond-the-browser check (api: / db: / kb:), only entries defined in the project's integration/*_api.json / *_db.json catalog may run — execute them live via the api-integration / db-integration / ask-kb skills' runner scripts (read the relevant SKILL.md before the first such step), passing the resolved environment via --env <name>. An undefined name is BLOCKED (report the missing entry), never improvised — exactly as in test runs. kb: answers are advisory context only.

3. ASSEMBLE

When the user says the flow is complete:

  1. Promote the running draft to the final spec, following the conventions in ${CLAUDE_PLUGIN_ROOT}/test/README.md and the ${CLAUDE_PLUGIN_ROOT}/test/suite1/ samples:
    • Target — the resolved target (URL / environment reference).
    • Acceptance criteria — what "correct" means, distilled from the asserted outcomes (including "no console errors / failed network calls").
    • Scenarios — the confirmed steps, numbered, in order, each with its expected result; marked as a stateful chain ("stateful — run in order, in one session").
    • Notes — stateful order, disposable data used, and each symbolically captured value (app-surfaced, and user-supplied fresh disposable data) with its inline example.
  2. Propose a file name under the user's suite folder — default test/suite1/<slug>.md, slug derived from the flow's goal. Save only on the user's confirmation.
  3. Close the session's browser (-s=<session> close — only your own session, never close-all/kill-all), then clean the transient .playwright-cli/ scratch — draft included — once the final spec is saved.

4. VALIDATE (offered, not forced)

Offer to immediately re-run the fresh spec via /execute-test — the "proven twice" moment: every step already passed once during definition; a fresh run proves the spec resolves its captured values live and passes unmodified. This validation run is a normal test run and writes its evidence to executions/ in the normal way. If the user declines, the session ends with the saved spec.

Walkthrough mode (existing specs)

When the input is an existing spec file path, run the same session over the file's steps instead of eliciting new ones:

  1. SETUP as above (the spec's Target feeds resolution).
  2. STEP LOOP over the spec's steps, in order: execute each step live and present the actual outcome. Steps you find unclear — ambiguous target, unstated expected result, unresolvable value — become questions to the user (answer/confirm/select shaped, as always); the confirmed clarification replaces the unclear text in the draft — the original file is not touched. Clear steps still get executed and asserted before moving on. Forward-only and one-sitting apply unchanged.
  3. ASSEMBLE the result as a new spec file (same conventions and naming proposal as above). The original spec is never rewritten — not reformatted, not re-numbered, not annotated in passing. Then offer one cross-reference: a single line at the top of the original — "Defined flow available at <path to the new file>" — so the team sees at a glance that this spec has a proven counterpart. Say plainly that this one line is all that would change, and write it only if the user says yes. A no is a complete outcome, not a half-finished one: the new spec stands on its own. Name both paths in your closing summary either way.
  4. VALIDATE (offered) runs the new file.

04 同仓库更多 Skills

MhmdElGazzar
MhmdElGazzar/agentex

ui-check

Execute ui-check: steps in test specs — compare the live page currently open in the browser under test against a declared design baseline: a Figma frame (identifier only; file + token configured once per project) or a screenshot image, in exact mode (every visible detail) or reference mode (only enumerated details can fail). Triggers on spec steps starting with "ui-check:", or requests like "check this page against the design", "compare with the Figma frame", "does the screen match the mockup". Baselines are resolved by the bundled fetch_baseline.js runner — an unresolvable baseline is BLOCKED, never improvised; the comparison verdict itself is agent-vision judgment.

★ 21
MhmdElGazzar
MhmdElGazzar/agentex

tracker-ops

Ad-hoc work-item operations on the configured tracker — Azure DevOps or Jira Cloud — behind one approval per write batch. Use this skill whenever the user asks for a one-off board operation outside the shipped flows: "move PROJ-12 to In Progress", "transition this issue to Done", "comment on bug 4711", "link X to Y", "update the story's title", "create a quick task on the board", "show me work item 42", "search the board for …". Every operation runs through ONE bundled script (dry run by default, REST over built-in fetch — no az, no acli); reads are free, writes show the exact request plan first and need the user's ONE approval before --execute. Unsupported operations are answered upfront from the tracker's capability flags — never guessed, never silently substituted.

★ 21
MhmdElGazzar
MhmdElGazzar/agentex

test-execution

Run test specs against an application and report defects, routing each step to its driver (browser via playwright-cli, API calls, database checks, knowledge-base questions, UI design checks). Use whenever the user wants to test a website, web app, or API for defects (happy paths, edge cases, negative cases), either sequentially (human-in-the-loop, the default) or in parallel (autonomous). Produces per-scenario evidence plus a consolidated defect report. Read this before starting any test run.

★ 21
MhmdElGazzar
MhmdElGazzar/agentex

test-design

Designs test cases for User Stories on the configured tracker — Azure DevOps or Jira Cloud: analyze a story's acceptance criteria into test conditions, map them to test case titles, create the test artifacts (ADO Test Cases with structured steps, or the Jira issue type the user chooses — Jira has no native Test Case type) and link them to the parent story, behind ONE consolidated approval. Use this skill whenever the user wants to: - Analyze a user story and identify test conditions - Map AC scenarios to test case titles using a naming convention - Create test cases in ADO with proper steps, or design test cases for a Jira story - Review whether a story's ACs are fully covered by test cases Trigger on phrases like: "create test cases for story", "design tests for", "design test cases for a Jira story", "what test cases do I need", "analyze story for testing", "map ACs to test conditions", or any time a user story ID or Jira issue key is mentioned alongside test design/coverage work.

★ 21
MhmdElGazzar
MhmdElGazzar/agentex

task-estimation

Creates QA testing tasks with estimation on the configured tracker's User Stories — Azure DevOps or Jira Cloud. Reads the sprint, analyzes each story, then creates all [Testing] tasks (ADO Tasks or Jira sub-tasks) behind ONE consolidated approval, through bundled REST scripts (no Azure CLI, no acli). Use this skill whenever the user wants to: - Add QA tasks to sprint stories in Azure DevOps or Jira - Estimate testing hours for user stories - Create [Testing] tasks on ADO work items or [Testing] sub-tasks on Jira issues - Plan QA effort for a sprint - Break down stories into testing tasks with hours Trigger on phrases like: "create tasks for stories", "add QA tasks", "estimate sprint", "estimate the Jira sprint", "create testing tasks", "create tasks for Jira sprint stories", "add sub-tasks to Jira stories", "plan QA for sprint", "add tasks to stories", or any mention of sprint stories + estimation + testing.

★ 21
MhmdElGazzar
MhmdElGazzar/agentex

swagger-import

Generate an API catalog + suite of test cases (integration/api_test_suites/<service>/) from a Swagger 2.0 or OpenAPI 3.x JSON document. Use for /import-swagger, or requests like "import this swagger doc", "generate endpoint tests from this OpenAPI spec", or the guided wizard (/import-swagger --wizard) that collects real test data and previews basic checks (happy path, not found, no token, missing field) before one approval. Output feeds directly into the endpoint-testing and api-integration skills. This skill generates config and sends no API request of its own; any run, including the wizard's "Approve and run now", goes through endpoint-testing's runner.

★ 21