Skip to main content

/stabilize-recording

What it does

/stabilize-recording runs the Stabilizer agent in isolation. It takes a raw VS Code Playwright Recorder output (a .spec.ts file full of low-level page.locator(…).click() calls) together with a paired English steps file, and produces:

  1. A canonical spec at tests/specs/{feature}/{name}.md — structured frontmatter plus numbered intent/method steps, ready for the Generator.
  2. Data entries in tests/data/ — any hard-coded values from the recording (names, IDs, amounts) are extracted and replaced with {{data.ref}} references.
  3. An alignment report at tests/recordings/.stabilizer-reports/{name}-alignment.md — a side-by-side mapping of each raw recorder line to its corresponding logical step.

The Stabilizer does not emit a .spec.ts file. That is the Generator's job. Run /stabilize-recording first, review the spec, then run /generate-test — or use the full pipeline command /e2e-from-recording to do both in one step.

When to use it

Use /stabilize-recording when you want to:

  • Clean up a raw recording before generating a test, and review the spec output before proceeding.
  • Produce the alignment report to understand how recorder lines map to user actions.
  • Stabilize a recording as a standalone step (e.g. you will generate the test later or on a different branch).

If you want to go straight from a recording to a reviewed .spec.ts in one command, use /e2e-from-recording instead.

How to run it

/stabilize-recording tests/recordings/add-billing-contact.spec.ts

Example

Input:

  • tests/recordings/add-billing-contact.spec.ts — the raw Playwright Recorder output.

  • tests/recordings/add-billing-contact.steps.md — the paired English steps file, for example:

    1. Open the Billing tab for project P-1042.
    2. Click "Add Contact".
    3. Select "Billing Contact" as the role.
    4. Type the contact's full name and email address.
    5. Click Save and confirm the contact appears in the table.

What you get back:

  1. A canonical spec at tests/specs/billing/add-billing-contact.md.
  2. Data entries added to tests/data/billing.jsonc (e.g. contact name and email replaced with {{billing.contact.name}} and {{billing.contact.email}}).
  3. An alignment report at tests/recordings/.stabilizer-reports/add-billing-contact-alignment.md.

Notes

  • The paired .steps.md file is required. The Stabilizer halts if the file is missing. Write plain-English numbered steps — one per logical user action — before running this command.
  • Does not emit .spec.ts. The Stabilizer's output is a spec and data entries, not a runnable test. Run /generate-test next (or use the /e2e-from-recording pipeline).
  • The Stabilizer does not commit. Review the spec and alignment report, make any corrections, then proceed to generate.