behavior-driven-development

Applies BDD principles with Gherkin scenarios and Red-Green-Refactor test-driven development.

588|49|Updated Aug 4, 2025
One-click install
npx skills add https://github.com/FradSer/dotclaude --skill behavior-driven-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: behavior-driven-development
Source: https://github.com/FradSer/dotclaude/tree/main/superpowers/skills/behavior-driven-development
Command: npx skills add https://github.com/FradSer/dotclaude --skill behavior-driven-development

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Teams often write production code before agreeing on expected behavior, producing tests that merely mirror existing code and miss real requirements. This Skill enforces a behavior-first workflow so features and bug fixes are driven by concrete, executable specifications.

Core Features & Use Cases

  • Gherkin Scenario Authoring: Guides writing declarative Given/When/Then scenarios stored in .feature files as living documentation, with bdd-specs.md as the planning-stage artifact.
  • Red-Green-Refactor Enforcement: Applies the Iron Law that no production code is written without a failing test first, including rules for deleting pre-existing untested code.
  • Testing Anti-Pattern Detection: Identifies mocking pitfalls, vacuous assertions, and implementation-coupled tests that pass without verifying real behavior.
  • Use Case: When asked to implement a login feature, the Skill first formulates scenarios like "Given a registered user, When they log in with valid credentials, Then they reach the dashboard", then drives implementation through failing tests.

Quick Start

Ask the assistant to implement a new feature using behavior-driven development with Gherkin scenarios and test-first implementation.

Frequently Asked Questions about behavior-driven-development

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

FAQPage Schema
How do I write Gherkin scenarios for behavior-driven development?

Write declarative Given/When/Then scenarios that describe business behavior, not UI steps. Keep each scenario focused on one behavior, use business language instead of technical terms, and store scenarios in .feature files rather than code comments.

What is the difference between BDD and TDD?

TDD is a lower-level developer practice using unit tests, while BDD is a higher-level collaboration practice using acceptance scenarios. Use BDD to define what to build through shared examples, and TDD's Red-Green-Refactor cycle to implement it correctly.

Should Gherkin scenarios be stored as code comments or feature files?

Store scenarios in dedicated .feature files, not code comments. Feature files are executable by BDD frameworks like Cucumber, readable by non-technical stakeholders, and serve as living documentation, while comments are not executable.

What should I do if production code already exists before tests?

Delete the existing code and re-derive it from a failing test rather than adapting it. Tests written against visible code pass on the first run regardless of correctness, so they cannot verify the intended behavior.

Why do my tests pass but not verify real behavior?

Common causes include mocking the unit under test instead of its collaborators, asserting on implementation details, over-mocking into tautologies, and vacuous assertions. Mock collaborators like databases or clocks, never the function being tested.

When is it acceptable to skip test-first development?

The documented exceptions are one-off prototypes, generated code, and configuration files. Even these should be raised explicitly with the user rather than silently assumed, and all other rationalizations are rejected.