bdd-practices

Guides Cucumber/Gherkin BDD best practices for writing declarative scenarios.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/yaochangyu/ai-dev-toolkit --skill bdd-practices-yaochangyu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bdd-practices
Source: https://github.com/yaochangyu/ai-dev-toolkit/tree/main/.github/skills/bdd-practices
Command: npx skills add https://github.com/yaochangyu/ai-dev-toolkit --skill bdd-practices-yaochangyu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cucumber/Gherkin BDD 最佳實踐指導技能,協助團隊建立共識、撰寫易讀易維護的 Gherkin 情境,並提供 Discovery Workshop、Formulation 與 Automation 三階段的實作原則。

Core Features & Use Cases

  • Discovery Workshop 指導:透過結構化對話快速界定使用者與需求
  • Gherkin 撰寫審查:檢視情境品質、主詞述詞與時態的一致性
  • BDD 反模式識別與修正:識別常見錯誤並提供改進建議
  • 測試策略諮詢:提出宣告式 vs 命令式的測試建議與風險評估

Quick Start

Read a sample Gherkin scenario, then apply the guidance to rewrite it in declarative, present-tense form with a clear scenario title.

Frequently Asked Questions about bdd-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are common Gherkin BDD anti-patterns and how do I fix them?

Common Gherkin BDD anti-patterns include imperative workflows and vague scenario titles. Fix them by applying declarative language, present tense, and one-behavior-per-scenario rules to ensure clean, maintainable specs.

How do I write declarative Cucumber scenarios for better maintainability?

Write declarative Cucumber scenarios by focusing on behavior rather than UI steps. Use present tense, ensure one-behavior-per-scenario, and craft clear scenario titles to guide teams toward high-quality, readable Gherkin specs.

What is the best way to structure a BDD discovery workshop?

Structure a BDD discovery workshop using guided conversations to quickly define users and requirements. This formulation phase establishes shared understanding before writing Gherkin scenarios and automating tests.

Should Gherkin scenarios use present tense and focus on a single behavior?

Yes, Gherkin scenarios should use present tense and focus on one behavior per scenario. Enforcing these BDD best practices improves collaboration, readability, and long-term maintainability of your test suite.

Can I use this BDD guidance for test automation strategy and risk assessment?

Yes, this BDD guidance provides test strategy consultation across discovery, formulation, and automation phases. It evaluates declarative versus imperative testing approaches and offers risk assessments for real-world projects.

Why does my Cucumber test suite become hard to maintain over time?

Your Cucumber suite becomes hard to maintain due to anti-patterns like imperative steps and multiple behaviors per scenario. Apply behavior-focused language, present tense, and clear titles to improve maintainability.