bdd-patterns
Use when applying Behavior-Driven Development patterns including Given-When-Then structure, feature files, and acceptance criteria. Use when writing BDD-style tests and specifications.
What this skill does
# BDD Patterns
Master Behavior-Driven Development patterns to write clear, business-readable specifications that drive implementation.
## Given-When-Then Structure
The fundamental BDD pattern uses three parts:
- **Given**: The initial context or preconditions
- **When**: The action or event being tested
- **Then**: The expected outcome or result
```gherkin
Feature: User Authentication
Scenario: Successful login with valid credentials
Given a registered user with email "[email protected]"
And the user has password "secure123"
When the user submits the login form with correct credentials
Then the user should be redirected to the dashboard
And a session should be created
```
## Feature File Organization
```gherkin
Feature: Shopping Cart
As a customer
I want to manage items in my cart
So that I can purchase products I'm interested in
Background:
Given I am logged in as a customer
And the product catalog is available
Scenario: Add item to empty cart
Given my cart is empty
When I add "Blue T-Shirt" to my cart
Then my cart should contain 1 item
And the cart total should be $29.99
Scenario: Remove item from cart
Given my cart contains "Blue T-Shirt"
When I remove "Blue T-Shirt" from my cart
Then my cart should be empty
```
## Scenario Outlines for Data-Driven Tests
```gherkin
Scenario Outline: Password validation
Given I am on the registration page
When I enter password "<password>"
Then I should see "<message>"
Examples:
| password | message |
| abc | Password too short |
| abcdefgh | Password needs a number |
| abcdefgh1 | Password accepted |
| abcdefgh1! | Password accepted |
```
## Step Definition Patterns
```ruby
# Ruby/Cucumber example
Given('a registered user with email {string}') do |email|
@user = User.create!(email: email, password: 'password123')
end
When('the user submits the login form with correct credentials') do
visit login_path
fill_in 'Email', with: @user.email
fill_in 'Password', with: 'password123'
click_button 'Log In'
end
Then('the user should be redirected to the dashboard') do
expect(page).to have_current_path(dashboard_path)
end
```
## When to Use This Skill
Use bdd-patterns when you need to:
- Write acceptance tests that stakeholders can understand
- Define behavior before implementation
- Create living documentation from tests
- Bridge communication between developers and business
- Ensure features meet business requirements
## Best Practices
- Write scenarios from the user's perspective
- Keep scenarios focused on single behaviors
- Use declarative language, not implementation details
- Reuse step definitions across scenarios
- Use Background for common setup steps
- Keep feature files organized by domain area
## Common Pitfalls
- Writing scenarios that are too technical
- Coupling steps to specific UI implementations
- Creating overly complex scenario outlines
- Not maintaining feature files as code changes
- Mixing multiple behaviors in one scenario
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert 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.