Agent skill
behavior-driven-development
Applies behavior-driven development principles including Gherkin scenarios and test-driven development. This skill should be used when the user asks to implement features, fix bugs, or when writing executable specifications and tests before writing production code.
Install this agent skill to your Project
npx add-skill https://github.com/FradSer/dotclaude/tree/main/superpowers/skills/behavior-driven-development
SKILL.md
Behavior-Driven Development (BDD) Skill
This skill provides a comprehensive guide to applying Behavior-Driven Development principles to your coding tasks. BDD is not just about tools; it's a methodology for shared understanding and high-quality implementation.
How to Use This Skill
When the user asks for a feature, bug fix, or refactor, apply the following mindset:
- Understand Behavior First: Do not start coding until you know what the system should do.
- Define Scenarios: Create or ask for concrete examples (Gherkin) of the expected behavior.
- Drive Implementation with Tests: Use the Red-Green-Refactor cycle.
Core Concepts
1. The BDD Cycle
The process flows from requirements to code:
- Discovery: Clarify requirements through examples (The "Three Amigos").
- Formulation: Write these examples as specific scenarios (Given/When/Then).
- Automation: Implement using TDD.
See BDD Best Practices for a detailed guide.
2. Writing Scenarios (Gherkin)
Scenarios are your "Executable Specifications".
- Keep them declarative (business focus).
- Avoid technical jargon and UI details.
- One behavior per scenario.
- Store in .feature files, NOT as code comments - this makes them executable and accessible to non-technical stakeholders.
See Cucumber Gherkin Guide for syntax and storage structure.
3. Red-Green-Refactor (TDD)
The engine of implementation:
- RED: Write a failing test for the scenario (or a unit thereof).
- GREEN: Write the minimal code to pass the test.
- REFACTOR: Clean up the code while keeping tests passing.
Quick Reference: The Iron Law
"No production code is written without a failing test first."
If you write code before the test:
- You don't know if the test is capable of failing (false positives).
- You are biased by your implementation.
- You are writing legacy code from day one.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
optimize-plugin
This skill should be used when the user asks to "validate a plugin", "optimize plugin", "check plugin quality", "review plugin structure", or "run plugin optimizer".
plugin-best-practices
This skill should be used when the user asks to "validate plugin structure", "review manifest files", "check frontmatter compliance", "verify tool invocation patterns", "explain plugin component types", or needs Claude Code plugin architectural guidance.
init-config
Generates a CLAUDE.md file with AI-driven environment detection and advanced configuration options. This skill should be used when the user asks to "initialize config", "setup claude config", "create CLAUDE.md", or needs help configuring project instructions.
start-feature
Starts working on a new feature branch using git-flow. This skill should be used when the user asks to "start a feature", "create feature branch", "begin new feature", "git flow feature start", or wants to start a new feature.
finish-feature
Finalizes and merges a feature branch into develop using git-flow. This skill should be used when the user asks to "finish a feature", "merge feature branch", "complete feature", "git flow feature finish", or wants to finalize a feature branch.
finish-hotfix
Finalizes a hotfix and merges it into main and develop using git-flow. This skill should be used when the user asks to "finish a hotfix", "merge hotfix branch", "complete hotfix", "git flow hotfix finish", or wants to finalize a hotfix.
Didn't find tool you were looking for?