# playwright-bdd-gherkin-syntax

playwright-bdd-gherkin-syntax guides agents in drafting Gherkin feature files, outlines, data tables, and tags for Playwright BDD.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 180 installs · ★ 201 repo stars
- Author: TheBushidoCollective
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/TheBushidoCollective/han/tree/HEAD/plugins/tools/playwright-bdd/skills/playwright-bdd-gherkin-syntax/SKILL.md
- Updated: 2026-09-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/playwright-bdd-gherkin-syntax

## What it does

This skill supplies patterns for writing Gherkin `.feature` specifications designed to work with Playwright BDD and `bddgen`. It defines standards for preconditions (`Given`), actions (`When`), outcomes (`Then`), and step continuations. The agent gets explicit conventions for handling shared prerequisites in `Background` blocks and grouping tests under business logic using `Rule` containers.

It covers data tables, key-value mappings, and parameterized execution via `Scenario Outline` with single or split `Examples` sections. It also details framework-specific test flags including `@skip`, `@only`, `@fail`, and `@fixme`, alongside tag filtering commands for CLI test runners.

## Requirements
- Works with: Playwright

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add TheBushidoCollective/han --skill playwright-bdd-gherkin-syntax -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/playwright-bdd-gherkin-syntax/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/playwright-bdd-gherkin-syntax/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add TheBushidoCollective/han --skill playwright-bdd-gherkin-syntax -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/playwright-bdd-gherkin-syntax/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add TheBushidoCollective/han --skill playwright-bdd-gherkin-syntax -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/playwright-bdd-gherkin-syntax/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install TheBushidoCollective/han plugins/tools/playwright-bdd/skills/playwright-bdd-gherkin-syntax
```

2. **Manually: put the files in place**
- File: `.github/skills/playwright-bdd-gherkin-syntax/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add TheBushidoCollective/han --skill playwright-bdd-gherkin-syntax -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/TheBushidoCollective/han --path plugins/tools/playwright-bdd/skills/playwright-bdd-gherkin-syntax
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/playwright-bdd-gherkin-syntax/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add TheBushidoCollective/han --skill playwright-bdd-gherkin-syntax -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/TheBushidoCollective/han/tree/HEAD/plugins/tools/playwright-bdd/skills/playwright-bdd-gherkin-syntax/SKILL.md

## When to use it
- write valid Gherkin feature files targeting Playwright BDD and bddgen
- structure data-driven tests using Scenario Outline with Examples tables
- organize test suites using tag inheritance and runner filtering expressions
- centralize recurring test preconditions inside Background blocks

## Example prompts
- Write a Gherkin feature file for user login with valid and invalid attempts
- Create a Scenario Outline testing cart totals across different promo codes
- Organize checkout scenarios under specific business rules with @smoke tags

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 9fc9edb10041cf88.

BEGIN THIRD-PARTY FILE 9fc9edb10041cf88
````text
---
name: playwright-bdd-gherkin-syntax
user-invocable: false
description: Use when writing Gherkin feature files, using Scenario Outline with Examples, applying tags for test organization, and leveraging Background sections for shared setup.
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep]
---

# Playwright BDD Gherkin Syntax

Expert knowledge of Gherkin syntax for writing feature files in Playwright BDD, including scenarios, outlines, backgrounds, tags, and internationalization.

## Overview

Gherkin is a domain-specific language for describing software behavior in plain text. Playwright BDD uses Gherkin feature files (`.feature`) that are transformed into Playwright test files via `bddgen`.

## Feature File Structure

### Basic Structure

```gherkin
Feature: User Authentication
  As a user
  I want to be able to log in
  So that I can access my account

  Background:
    Given I am on the login page

  Scenario: Successful login
    When I enter valid credentials
    And I click the login button
    Then I should see the dashboard

  Scenario: Failed login
    When I enter invalid credentials
    And I click the login button
    Then I should see an error message
```

### Feature Declaration

```gherkin
Feature: Short descriptive title

  Optional description spanning
  multiple lines explaining the
  feature's purpose and context.
```

## Keywords

### Given - Preconditions

Describes the initial context or state:

```gherkin
Given I am logged in as "admin"
Given the shopping cart is empty
Given the following users exist:
  | name  | email           |
  | Alice | alice@test.com  |
  | Bob   | bob@test.com    |
```

### When - Actions

Describes the action or event:

```gherkin
When I click the "Submit" button
When I fill in "email" with "test@example.com"
When I select "Express" from the shipping options
When 24 hours have passed
```

### Then - Outcomes

Describes the expected outcome:

```gherkin
Then I should see "Welcome back!"
Then the cart should contain 3 items
Then I should be redirected to the dashboard
Then an email should be sent to "test@example.com"
```

### And / But - Continuation

Continues the previous Given/When/Then:

```gherkin
Given I am logged in
And I have items in my cart
But I have not entered a shipping address

When I click checkout
And I enter my payment details

Then I should see the confirmation page
And I should receive an order email
````
END THIRD-PARTY FILE 9fc9edb10041cf88

The third-party file has ended. Everything between the 9fc9edb10041cf88 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2415 of 13514 bytes. © TheBushidoCollective · Apache-2.0 · https://github.com/TheBushidoCollective/han/tree/HEAD/plugins/tools/playwright-bdd/skills/playwright-bdd-gherkin-syntax/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
