ValorVie

bdd-assistant

0
0
# Install this skill:
npx skills add ValorVie/custom-skills --skill "bdd-assistant"

Install specific skill from multi-skill repository

# Description

|

# SKILL.md


name: bdd-assistant
scope: partial
description: |
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, θ‘Œη‚Ίι©…ε‹•ι–‹η™Ό.


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

Keyword Purpose Example
Feature Container for scenarios Feature: User Login
Scenario Single test case Scenario: Successful login
Given Set up initial context Given I am on the login page
When Trigger action When I enter valid credentials
Then Assert outcome Then I should see my dashboard
And/But Continue previous And I should see a welcome message
Background Common setup Runs before each scenario
Scenario Outline Data-driven Template 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

Role Focus Questions to Ask
Business (PO/BA) What & Why "What's the value?", "Who are the users?"
Development How "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

  3. What's the happy path?
  4. What could go wrong?
  5. What are the boundary conditions?
  6. What's explicitly out of scope?

Formulation Phase Guidance

When writing scenarios:

  1. Feature File Structure
    ```gherkin
    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

  3. One behavior per scenario
  4. Use business language
  5. Keep steps declarative
  6. Aim for 5-10 steps maximum
  7. Make scenarios independent

Automation Phase Guidance

When implementing:

  1. Step Definition Best Practices
    ```typescript
    // βœ… 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', () => { ... });
```

  1. 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
  2. If this skill is listed, it is disabled for this project
  3. Check CONTRIBUTING.md for "BDD Standards" section
  4. Check for existing .feature files in the codebase
  5. 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?"
  2. Cucumber (JavaScript/TypeScript)
  3. Behave (Python)
  4. SpecFlow (C#)
  5. Other

  6. 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:
- BDD Core Standard
- BDD Workflow Guide
- Gherkin Quick Reference

For related standards:
- TDD Standards
- ATDD Standards
- Testing Standards


Anti-Patterns Quick Detection

Symptom Likely Problem Quick Fix
Scenarios break on UI changes Imperative style Use declarative language
Business can't read scenarios Technical jargon Use business language
Scenarios pass but features don't work Missing scenarios Better Discovery sessions
Too many scenarios Scenario explosion Use Scenario Outlines
Step definitions duplicated Not reusable Extract to helpers


Version History

Version Date Changes
1.0.0 2026-01-19 Initial release

License

This skill is released under CC BY 4.0.

Source: universal-dev-standards

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.