Skip to content
bdd-assistant logo

BDD Assistant

bdd-assistant

Guide developers through Behavior-Driven Development workflow. Use when: writing BDD scenarios, using Gherkin syntax, Given-When-Then format, feature files, Three Amigos collaboration. Keywords: BDD, behavior-driven, Given When Then, Gherkin, Cucumber, scenario, feature file, step definition, 行為驅...

SKILL.md

Full skill instructions

BDD Assistant

Language: English | 繁體中文

Version: 1.0.0 Last Updated: 2026-01-19 Applicability: Claude Code Skills


Purpose

This skill guides developers through the Behavior-Driven Development workflow, helping them:

  • Conduct Discovery sessions to explore requirements
  • Write effective Gherkin scenarios in Given-When-Then format
  • Create reusable step definitions
  • Integrate BDD with TDD for implementation
  • Maintain living documentation

Quick Reference

BDD Workflow Checklist

┌─────────────────────────────────────────────────────────────────┐
│  🔍 DISCOVERY Phase                                              │
│  □ Stakeholders identified (Business, Dev, QA)                  │
│  □ User story discussed and understood                          │
│  □ Concrete examples collected (Example Mapping)                │
│  □ Edge cases identified                                        │
│  □ Questions answered or noted for follow-up                    │
├─────────────────────────────────────────────────────────────────┤
│  📝 FORMULATION Phase                                            │
│  □ Scenarios use correct Gherkin syntax                         │
│  □ Scenarios are declarative (WHAT, not HOW)                    │
│  □ Business language used (no technical jargon)                 │
│  □ Each scenario is independent and self-contained              │
│  □ Scenarios have 5-10 steps maximum                            │
│  □ Scenarios reviewed by stakeholders                           │
├─────────────────────────────────────────────────────────────────┤
│  ⚙️ AUTOMATION Phase                                             │
│  □ Step definitions created for all steps                       │
│  □ Step definitions are reusable                                │
│  □ Scenarios fail initially (RED)                               │
│  □ TDD used for unit-level implementations                      │
│  □ All scenarios pass (GREEN)                                   │
│  □ Code refactored and clean                                    │
└─────────────────────────────────────────────────────────────────┘

Gherkin Quick Reference

KeywordPurposeExample
FeatureContainer for scenariosFeature: User Login
ScenarioSingle test caseScenario: Successful login
GivenSet up initial contextGiven I am on the login page
WhenTrigger actionWhen I enter valid credentials
ThenAssert outcomeThen I should see my dashboard
And/ButContinue previousAnd I should see a welcome message
BackgroundCommon setupRuns before each scenario
Scenario OutlineData-drivenTemplate with Examples table

Declarative vs Imperative

# ❌ BAD - Imperative (too detailed, UI-focused)
Scenario: Login
  Given I navigate to "http://example.com/​login"
  And I click on the username field
  And I type "[email protected]"
  And I click on the password field
  And I type "secret123"
  And I click the submit button
  Then I should see "Dashboard" in the page title

# ✅ GOOD - Declarative (behavior-focused)
Scenario: Successful login with valid credentials
  Given I am a registered user
  When I login with valid credentials
  Then I should see my dashboard

Three Amigos Quick Reference

RoleFocusQuestions to Ask
Business (PO/​BA)What & Why"What's the value?", "Who are the users?"
DevelopmentHow"What's the technical impact?", "Dependencies?"
Testing (QA)What if"What could go wrong?", "Edge cases?"

Workflow Assistance

Discovery Phase Guidance

When exploring requirements:

  1. Example Mapping

    🟡 User Story: "User can login"
         │
         ├─ 🔵 Rule: "Users must be authenticated"
         │      ├─ 🟢 Example: Valid credentials → login success
         │      └─ 🟢 Example: Invalid credentials → error message
         │
         ├─ 🔵 Rule: "Account lockout after failures"
         │      ├─ 🟢 Example: 3 failures → account locked
         │      └─ 🟢 Example: Locked account → cannot login
         │
         └─ 🔴 Question: Password expiration policy?
    
  2. Questions to Ask

    • What's the happy path?
    • What could go wrong?
    • What are the boundary conditions?
    • What's explicitly out of scope?

Formulation Phase Guidance

When writing scenarios:

  1. Feature File Structure

    Feature: Feature name
      As a [role]
      I want [feature]
      So that [benefit]
    
      Background:
        Given common preconditions
    
      Scenario: Descriptive scenario name
        Given [initial context]
        When [action]
        Then [expected outcome]
    
  2. Scenario Style Guidelines

    • One behavior per scenario
    • Use business language
    • Keep steps declarative
    • Aim for 5-10 steps maximum
    • Make scenarios independent

Automation Phase Guidance

When implementing:

  1. Step Definition Best Practices

    // ✅ Good: Reusable, parameterized
    Given('I have {int} items in my cart', (count) => { ... });
    
    // ❌ Bad: Specific to one scenario
    Given('I have 3 widgets in my cart', () => { ... });
    
  2. BDD + TDD Integration

    BDD Scenario (feature level)
         │
         └──▶ Step Definitions
                 │
                 └──▶ TDD Cycle (unit level)
                       🔴 Write failing unit test
                       🟢 Implement minimal code
                       🔵 Refactor
    

Integration with Other Workflows

BDD + SDD

When working with Spec-Driven Development:

# Reference spec in feature file
# @spec SPEC-001
@SPEC-001
Feature: User Authentication
  Implements SPEC-001 user authentication requirements.

  @AC-1
  Scenario: Successful login
    # Acceptance Criterion 1 from SPEC-001
    ...

BDD + TDD

Scenario Level (BDD)           Unit Level (TDD)
─────────────────────          ─────────────────
Scenario: Checkout    ──────▶  test_calculate_total()
  Given cart items             test_apply_discount()
  When checkout                test_create_order()
  Then order created           test_send_email()

BDD + ATDD

ATDD: Acceptance Criteria (business sign-off)
  │
  └──▶ BDD: Feature Files (Gherkin scenarios)
         │
         └──▶ TDD: Unit Tests (implementation)

Configuration Detection

This skill supports project-specific configuration.

Detection Order

  1. Check CONTRIBUTING.md for "Disabled Skills" section
    • If this skill is listed, it is disabled for this project
  2. Check CONTRIBUTING.md for "BDD Standards" section
  3. Check for existing .feature files in the codebase
  4. If not found, default to standard BDD practices

First-Time Setup

If no configuration found and context is unclear:

  1. Ask: "This project hasn't configured BDD preferences. Which BDD tool do you use?"

    • Cucumber (JavaScript/​TypeScript)
    • Behave (Python)
    • SpecFlow (C#)
    • Other
  2. After selection, suggest documenting in CONTRIBUTING.md:

## BDD Standards

### BDD Tool
- Cucumber.js

### Feature File Location
- `features/` directory

### Scenario Style
- Declarative (behavior-focused)
- Business language required
- Max 10 steps per scenario

Detailed Guidelines

For complete standards, see:

For related standards:


Anti-Patterns Quick Detection

SymptomLikely ProblemQuick Fix
Scenarios break on UI changesImperative styleUse declarative language
Business can't read scenariosTechnical jargonUse business language
Scenarios pass but features don't workMissing scenariosBetter Discovery sessions
Too many scenariosScenario explosionUse Scenario Outlines
Step definitions duplicatedNot reusableExtract to helpers

Related Standards


Version History

VersionDateChanges
1.0.02026-01-19Initial release

License

This skill is released under CC BY 4.0.

Source: universal-dev-standards

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View