skills/accelint-ac-to-playwright/SKILL.md
Convert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.
npx skillsauth add gohypergiant/agent-skills accelint-ac-to-playwrightInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
MANDATORY - READ ENTIRE FILE: Before processing ANY acceptance criteria, you MUST read references/acceptance-criteria.md (~175 lines) completely from start to finish. NEVER set any range limits when reading this file. It is the authoritative source for AC writing rules and mappings.
Note on test-hooks.md: Load references/test-hooks.md when converting AC → JSON plans or when running Assessment mode — it contains the controlled vocabulary for area/component/intent target naming patterns. Do NOT load when converting plans → tests (translation script handles this automatically).
The skill supports two modes based on user phrasing:
Assessment mode (triggers on):
Full conversion mode (triggers on):
Assessment mode analyzes AC text only (no artifact generation). Full conversion mode generates plans and tests.
references/acceptance-criteria.md and references/test-hooks.md.- markers for each ACtest-hooks.md (nav, header, footer, form, drawer, card, toast, modal, table, page, area)references/acceptance-criteria.md.references/plan-schema.ts.<plans-output-dir>/<suite-slug>.json.scripts/translate-plan-to-tests.ts.<tests-output-dir>/<suite-slug>.spec.ts.skills/accelint-ac-to-playwright/assets/fixtures/ directory to <tests-output-dir>/fixtures/. This directory contains shared test utilities (error-handling.ts and console-tracking.ts) that generated tests import from.skills/accelint-ac-to-playwright/assets/templates/playwright.config.ts into the user‑specified summaries location.Before processing AC, identify these quality signals:
Good AC (can process directly): | Check | Question | If NO → Action | |-------|----------|----------------| | Targets | Does every action specify area.component.intent? | Ask user to clarify which specific element | | Values | Are all fill/select values quoted literals? | Ask user for exact values to use | | Outcomes | Are expectations measurable (specific text/element/state)? | Ask user what exactly to verify |
Bad patterns (ask the user questions):
'[email protected]' not "a valid email"The above table directs you to ask for clarifications because guessing creates tests that fail unpredictably.
Input to output mapping: One AC file → one suite → one plan file (<plans-dir>/<suite-slug>.json) → one test file
.md bullet-style: each - bullet = one test.feature Gherkin: each Scenario = one test; each Examples row in Scenario Outline = one testOutput structure: After conversion completes, the test output directory will contain:
<suite-slug>.spec.ts files (one per AC file)fixtures/ directory with shared utilities:
fixtures/error-handling.ts - failure artifact attachment helperfixtures/console-tracking.ts - console message tracking helperImportant for users: When copying generated tests to your Playwright project, copy both the .spec.ts files AND the fixtures/ directory. Tests import from these fixtures and will fail to compile without them.
| Input | Suite Name | Test Name | Output Slug |
|-------|------------|-----------|-------------|
| .feature | Feature: text → lowercase → capitalize first | Scenario text (lowercase, ~64 char limit) + (params) for Scenario Outlines | suite name → lowercase, spaces to dashes |
| .md | filename → lowercase → dashes to spaces → capitalize first | Summarize bullet intent (present tense, lowercase, ~64 char) | suite name → lowercase, spaces to dashes |
Scenario Outline parameters: Use shortest left-to-right column combo that uniquely identifies each row, joined with /.
Example:
Examples:
| username | password | message |
| user1 | pass1 | Welcome user1 |
| user2 | pass2 | Welcome user2 |
Appends (user1/pass1) and (user2/pass2) respectively.
.git), path = repo-relative path.external, path = file basename only.references/acceptance-criteria.md.goto) and preserve the order in the bullet text or in the Gherkin steps.
keyDown with the modifier key (e.g., Shift, Control, or app-specific modifier a)press with the non-modifier key (e.g., g, Enter)keyUp with the same modifier keykeyDown/keyUp: Shift, Control, a (app-specific)press action only accepts single unmodified keys and should never receive combination syntax like Shift+gexpectUrl using the Start URL mapping.expectNotVisible immediately before the action and expectVisible immediately after (or vice versa as appropriate).expectText / expectVisible / expectNotVisible when the AC explicitly names text or visibility.scripts/plan-schema.ts — schema and validation logic to consult when generating plans.scripts/cli/validate-plan.ts — validator script for JSON plans (run via npx validate-plan after build).scripts/translate-plan-to-tests.ts — converts a validated plan to a Playwright spec.scripts/cli/generate-tests.ts — CLI wrapper for reading, validating, and writing spec files.Use npx validate-plan path/to/plan.json to validate a plan against references/plan-schema.ts (after build).
Maximum attempts: 2 total (initial + 1 correction)
NEVER:
| Error Type | Diagnostic Question | Common Causes | Fix Strategy |
|------------|---------------------|---------------|--------------|
| Schema validation fails | What field does error message name? | Wrong field order, missing required field, extra field not in schema, incorrect field type | Check schema for exact field names and order; compare your JSON structure to schema requirements |
| Target naming invalid | Does target match area.component.intent? | Wrong pattern structure, invalid keywords from controlled lists, missing dots | Review test-hooks.md for controlled vocabulary (area: nav/header/footer/etc, component: button/link/input/etc); use fallback keywords (last in each list) if AC term doesn't match |
| Tag validation fails | Does error mention "Tags must start with '@'"? | Tags missing @ prefix in generated JSON | Review AC source: Gherkin tags should include @ (e.g., @smoke not smoke). If AC has @ but JSON doesn't, check JSON generation logic |
| Translation script errors | Which action/assertion caused failure? | Unsupported action type, malformed target selector, missing required field in step | Verify action is in allowed list (click/fill/select); check target has all three parts; ensure step has target and any required fields (e.g., fill needs value) |
| Validation passes but tests fail | Do test hooks match actual page elements? | Target selectors don't match DOM, wrong start URL, timing issues | Ask user to verify page structure matches expected targets; check if startUrl needs adjustment; consider if dynamic content needs wait conditions |
| Multiple validation failures after fixes | Did first fix break something else? | Making multiple speculative changes, misunderstanding schema requirements | Stop after 2 attempts; report specific schema violations to user; ask if AC has ambiguities or if schema has changed |
selectOption() matches HTML value attributes by default, not visible text. AC writers specify visible option text (e.g., "Premium Plan"), so always use { label: "text" } syntax: .selectOption({ label: "Premium Plan" }). Using bare strings (.selectOption("Premium Plan")) causes silent mismatches where tests pass locally but fail in production because the value attribute differs from display text.test-hooks.md.goto action in steps — tests start at startUrl, navigation happens via clicks or fills that trigger page changes. Using goto mid-test breaks Playwright's navigation lifecycle and causes race conditions where assertions run before the page is ready, leading to flaky tests that pass locally but fail in CI.doubleClick for element interactions — doubleClick is only for coordinate-based double-clicks (x,y positions). For double-clicking elements, use the element-based click action twice in sequence. Only use doubleClick when AC explicitly specifies coordinates.mouseClick for element interactions — mouseClick is only for coordinate-based clicks (x,y positions). For clicking elements, always use click with test IDs. Only use mouseClick when AC explicitly specifies coordinates.mouseMove without a follow-up action — mouseMove positions the cursor but doesn't interact with anything. It should only be used before actions like mouseDown, mouseUp, mouseClick, or when AC explicitly requires moving to specific coordinates before other mouse operations.mouseDown or mouseUp without mouseMove first — these actions press/release buttons at the current cursor position. Always use mouseMove to position the cursor before mouseDown/mouseUp, otherwise the position is unpredictable.expectText, expectVisible, expectNotVisible when AC explicitly states expected outcomes (exception: expectUrl for navigation, visibility pairs for show/hide actions)button.generic bypass the controlled vocabulary system and create tests that break because they match multiple elements unpredictably.npx validate-plan before writing files to catch errors and reduce incorrect artifact cleanupWhen validation fails, report issues in this structure:
❌ AC are not conversion-ready. Issues found:
File: [filename]
1. [Line/Scenario reference]: [Specific issue]
- Problem: [What's wrong]
- Example: [Quote from AC]
- Fix: [What needs to change]
File: [filename]
2. [Next issue...]
Example output:
❌ AC are not conversion-ready. Issues found:
File: form-actions.feature
1. Scenario "User submits form": Unknown action verb
- Problem: "hovers" is not a recognized Playwright action
- Example: "the user hovers over the tooltip"
- Fix: Use a supported action (click, fill, select) or clarify the intent
File: login-flow.feature
2. Scenario "User logs in": Missing target intent
- Problem: Test hook selector incomplete (button.form instead of button.form.submit)
- Example: "clicks the button on the form"
- Fix: Specify intent: "clicks the Submit button on the form"
When assessment passes:
✓ AC are conversion-ready
Validated ([X] AC in [Y] files):
- Structure: Proper format (bullets or Gherkin) with correct step ordering
- Targets: All meet the area/component/intent pattern with controlled vocabulary
- Actions: All verbs recognized (click/fill/select) with input values where required
- Expected outcomes: All explicitly stated and measurable
- Vocabulary: All areas/components match test-hooks.md keywords
These AC can be converted without modification.
Files analyzed:
[filename 1]
[filename 2]
...
tools
Implement QRSPI-planned OpenSpec changes with intelligent parallelization. Use when the user wants to apply a QRSPI change, implement tasks with parallelization, or says "apply this QRSPI change", "implement with parallelization", "run the parallel slices". This skill is specifically designed for changes created via accelint-qrspi that include "Parallelization Strategy" sections in tasks.md. It orchestrates parallel sub-agent execution for independent task slices using OpenSpec CLI workflows. Make sure to use this skill when the user mentions applying QRSPI changes, running parallel implementation, or working on changes with vertical slices.
development
Generate or update an ARCHITECTURE.md living document for any codebase. Use this skill whenever a user mentions "architecture.md", "ARCHITECTURE.md", "document my architecture", "architecture overview", "system architecture", "generate architecture doc", "create architecture file", "update architecture", "architecture diagram", or wants a technical overview of how their project is structured. Make sure to use this skill whenever users want to document how their system works — even if they phrase it as "write up the system", "document the tech stack", "create a technical overview", or "help me describe the architecture". Always prefer this skill over ad-hoc architecture documentation.
development
Automate the QRSPI + OpenSpec planning workflow (Questions → Research → Design → Structure) for spec-driven development. Use this skill when the user wants to plan a ticket, start a QRSPI workflow, create a change with QRSPI, or says "plan this with QRSPI", "use QRSPI to plan", "start QRSPI workflow", "create spec-driven change", or asks about planning a feature/change before implementation. This skill handles ONLY the planning phase — it does NOT implement code. After completion, the user continues with /opsx:apply for implementation.
development
Comprehensive TypeScript/JavaScript coding standards focusing on type safety, defensive programming, and code correctness. Use when (1) Writing or reviewing TS/JS code, (2) Fixing type errors or avoiding any/enum/null, (3) Implementing control flow, state management, or error handling, (4) Applying zero-value pattern or immutability, (5) Code review for TypeScript anti-patterns. Covers naming conventions, function design, return values, bounded iteration, input validation. For performance optimization, use accelint-ts-performance skill. For documentation, use accelint-ts-documentation skill.