bdd-patterns — скилл для Claude Code: что делает и как установить
Скилл bdd-patterns для Claude Code помогает писать BDD-спецификации, сценарии и критерии приёмки в формате Given–When–Then. Создаёт тесты, понятные разработчикам и бизнесу.
Apache-2.0 211 установок ★ 201 обновлён 2026-09-08
npx skills add TheBushidoCollective/han --skill bdd-patterns -a claude-codeЧто делает bdd-patterns
bdd-patterns задаёт структуру BDD-сценариев: контекст через Given, действие через When и ожидаемый результат через Then. Он помогает оформлять feature-файлы, Background, сценарии с таблицами Examples и определения шагов для Cucumber.
Скилл применим к приёмочным тестам, живой документации и проверке требований до реализации. Он также подсказывает держать сценарии сфокусированными, писать их от лица пользователя и не привязывать шаги к деталям интерфейса.
Какие задачи решает
- сформулировать критерии приёмки
- разбить поведение на Given–When–Then
- создать feature-файл с Background
- подготовить сценарий Outline с Examples
- описать step definitions для Cucumber
Примеры запросов агенту
- Оформи требования к входу пользователя как BDD-сценарии в формате Given–When–Then.
- Создай feature-файл для корзины с общим Background и отдельными сценариями добавления и удаления товара.
- Составь Scenario Outline для проверки паролей и добавь таблицу Examples.
Как установить bdd-patterns
1Через Skills CLI (Vercel)
npx skills add TheBushidoCollective/han --skill bdd-patterns -a claude-code2Вручную: положить файлы
~/.claude/skills/bdd-patterns/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/bdd-patterns/
1Через Skills CLI (Vercel)
npx skills add TheBushidoCollective/han --skill bdd-patterns -a codex2Вручную: положить файлы
.agents/skills/bdd-patterns/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add TheBushidoCollective/han --skill bdd-patterns -a cursor2Вручную: положить файлы
.cursor/skills/bdd-patterns/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install TheBushidoCollective/han plugins/patterns/bdd/skills/bdd-patterns2Вручную: положить файлы
.github/skills/bdd-patterns/SKILL.md1Через Skills CLI (Vercel)
npx skills add TheBushidoCollective/han --skill bdd-patterns -a gemini-cli2Командой платформы
gemini skills install https://github.com/TheBushidoCollective/han --path plugins/patterns/bdd/skills/bdd-patternsВручную: положить файлы
.devin/skills/bdd-patterns/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add TheBushidoCollective/han --skill bdd-patterns -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о bdd-patterns
Как установить bdd-patterns в Claude Code?
Выполните npx skills add TheBushidoCollective/han --skill bdd-patterns -a claude-code, затем проверьте файл ~/.claude/skills/bdd-patterns/SKILL.md.
Что делает bdd-patterns?
Скилл помогает создавать BDD-спецификации, feature-файлы, сценарии Given–When–Then и критерии приёмки. Он также описывает сценарии с данными и step definitions.
Можно ли вызвать bdd-patterns как слэш-команду?
Нет. В метаданных скилла указано user-invocable: false, поэтому он предназначен для применения агентом по контексту задачи.
Исходный текст
SKILL.md · Apache-2.0
---
name: bdd-patterns
user-invocable: false
description: Use when applying Behavior-Driven Development patterns including Given-When-Then structure, feature files, and acceptance criteria. Use when writing BDD-style tests and specifications.
allowed-tools:
- Bash
- Read
---
# BDD Patterns
Master Behavior-Driven Development patterns to write clear, business-readable specifications that drive implementation.
## Given-When-Then Structure
The fundamental BDD pattern uses three parts:
- **Given**: The initial context or preconditions
- **When**: The action or event being tested
- **Then**: The expected outcome or result
```gherkin
Feature: User Authentication
Scenario: Successful login with valid credentials
Given a registered user with email "[email protected]"
And the user has password "secure123"
When the user submits the login form with correct credentials
Then the user should be redirected to the dashboard
And a session should be created
```
## Feature File Organization
```gherkin
Feature: Shopping Cart
As a customer
I want to manage items in my cart
So that I can purchase products I'm interested in
Background:
Given I am logged in as a customer
And the product catalog is available
Scenario: Add item to empty cart
Given my cart is empty
When I add "Blue T-Shirt" to my cart
Then my cart should contain 1 item
And the cart total should be $29.99
Scenario: Remove item from cart
Given my cart contains "Blue T-Shirt"
When I remove "Blue T-Shirt" from my cart
Then my cart should be empty
```
## Scenario Outlines for Data-Driven Tests
```gherkin
Scenario Outline: Password validation
Given I am on the registration page
When I enter password "<password>"
Then I should see "<message>"
Examples:
| password | message |
| abc | Password too short |
| abcdefgh | Password needs a number |
| abcdefgh1 | Password accepted |
| abcdefgh1! | Password accepted |
```
## Step Definition Patterns
```ruby
# Ruby/Cucumber example
Given('a registered user with email {string}') do |email|
@user = User.create!(email: email, password: 'password123')
end
When('the user submits the login form with correct credentials') do
visit login_path
fill_in 'Email', with: @user.email
fill_in 'Password', with: 'password123'
click_button 'Log In'
end
Then('the user should be redirected to the dashboard') do
expect(page).to have_current_path(dashboard_path)
end
```
## When to Use This Skill
Use bdd-patterns when you need to:
- Write acceptance tests that stakeholders can understand
- Define behavior before implementation
- Create living documentation from tests
- Bridge communication between developers and business
- Ensure features meet business requirements
## Best Practices
- Write scenarios from the user's perspective
- Keep scenarios focused on single behaviors
- Use declarative language, not implementation details
- Reuse step definitions across scenarios
- Use Background for common setup steps
- Keep feature files organized by domain area
## Common Pitfalls
- Writing scenarios that are too technical
- Coupling steps to specific UI implementations
- Creating overly complex scenario outlines
- Not maintaining feature files as code changes
- Mixing multiple behaviors in one scenario
© TheBushidoCollective · Apache-2.0 · TheBushidoCollective/han