Conventions and rules for BDD scenario generation. Use this skill when creating Gherkin feature files, step definitions, or managing the bdd/ scaffold. It defines language/format detection, domain detection, file naming, tagging, step writing rules, and index maintenance.
From mnpx claudepluginhub molcajeteai/plugin --plugin mThis skill uses the workspace's default tool permissions.
references/exploration.mdreferences/generation.mdreferences/scaffold.mdreferences/splitting.mdtemplates/feature-gherkin.mdtemplates/feature-mdg.mdtemplates/index-features.mdtemplates/index-steps.mdtemplates/steps-go.mdtemplates/steps-python.mdtemplates/steps-typescript.mdtemplates/world-go.mdtemplates/world-python.mdtemplates/world-typescript.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Standards for generating BDD scenarios, step definitions, and maintaining the bdd/ scaffold.
The canonical bdd/ directory tree:
bdd/
├── features/
│ ├── INDEX.md
│ ├── cross-domain/
│ └── {domain}/
│ └── {feature-name}.feature
├── steps/
│ ├── INDEX.md
│ ├── world.[ext]
│ ├── common_steps.[ext]
│ ├── api_steps.[ext]
│ ├── db_steps.[ext]
│ └── {domain}_steps.[ext]
Note: bdd/.claude/rules/ is user-created when needed for custom domain mappings — it is not part of the auto-generated scaffold.
Scan existing step files to determine the language:
bdd/steps/*.* and count file extensions: .py, .go, .ts.bdd/steps/: {list}. Using majority language: {language}."| Extension | Language | Framework | Step syntax |
|---|---|---|---|
.py | Python | behave | @given, @when, @then decorators |
.go | Go | godog | ctx.Step registration in InitializeScenario |
.ts | TypeScript | cucumber-js | Given, When, Then from @cucumber/cucumber |
bdd/features/**/*.feature.md.bdd/features/**/*.feature (excluding .feature.md matches)..feature.md files exist → use MDG format (Markdown-Gherkin)..feature files exist → use standard Gherkin..feature).bdd/features/.Determine domain subdirectories under bdd/features/ using this priority — stop at the first source that yields names:
bdd/.claude/rules/*.md for explicit domain mappings.bdd/CLAUDE.md for domain conventions.bdd/features/*/ — preserve existing domains.prd/changelog.md for domain-organized sections.prd/specs/*/ and group slugs into logical domains.server//src/ subdirectories.If no sources yield domains, create a single general/ domain folder. Always ensure cross-domain/ exists. Use kebab-case naming.
user-registration.feature, not userRegistration.feature or user_registration.featurepassword-reset.feature, not forgot-password-click.featureEvery scenario must have at least one tag. Choose from:
| Tag | When to use |
|---|---|
@smoke | Core happy-path scenarios that must always pass |
@regression | Standard coverage scenarios |
@critical | Scenarios testing security, data integrity, or financial correctness |
@backend | Scenarios that test server-side behavior only |
@fullstack | Scenarios requiring UI + backend interaction |
@{domain} | Domain-specific tag matching the folder name (e.g., @auth, @billing) |
Scenarios may have multiple tags. Feature-level tags: @{domain} and one priority tag (@smoke, @regression, or @critical).
| Rule | Requirement | Good example | Bad example |
|---|---|---|---|
| Declarative Given (FR-0KTg-018) | Given steps describe state, not procedures | Given user alice is logged in | Given I open the login page and type alice into the username field |
| Exact Then (FR-0KTg-019) | Then steps make exact assertions | Then the balance is exactly $94.00 | Then the balance is around $94 |
| Reusable patterns | Use parameterized patterns for similar steps | Given user {name} is logged in | Given user alice is logged in + Given user bob is logged in as separate steps |
| Situation | Construct | Example |
|---|---|---|
| Unique flow with specific setup and assertion | Scenario | Login with valid credentials |
| Same flow tested with different inputs/outputs | Scenario Outline + Examples | Login with various invalid credentials |
| Multiple scenarios sharing the same preconditions | Background | All scenarios need a logged-in user |
| Structured input data in a step | Data table | Creating a user with multiple fields |
Prefer Scenario Outline over multiple near-identical Scenario blocks. Use Background sparingly — only for truly shared preconditions, not convenience.
Before creating any step definitions, read bdd/steps/INDEX.md to identify existing reusable patterns. For each step in the generated feature file:
| Category | File | When to use |
|---|---|---|
| Common | common_steps.[ext] | Generic steps reusable across domains: login, navigation, time manipulation, basic CRUD |
| API | api_steps.[ext] | HTTP request/response steps: sending requests, checking status codes, validating response bodies |
| Database | db_steps.[ext] | Database assertion steps: checking row counts, verifying column values, seeding test data |
| Domain-specific | {domain}_steps.[ext] | Steps unique to a business domain: billing calculations, notification rules, auth policies |
If the target step file exists, append new definitions. If not, create it using the matching template from templates/.
Every new step definition must include:
TODO: implement step placeholder body (not an empty body)Both bdd/features/INDEX.md and bdd/steps/INDEX.md must be updated together after any generation. Never leave partial index state — updating one without the other could introduce drift.
| File | Description |
|---|---|
| references/scaffold.md | Scaffold creation and index validation procedure (Steps 2a-2h) |
| references/exploration.md | Codebase exploration for generic feature names (Steps 2-exp-a to 2-exp-e) |
| references/generation.md | Feature file and step definition generation (Steps 3-pre to 3d) |
| templates/ | Individual file templates (INDEX.md, world modules, features, steps) |
| references/splitting.md | Feature file splitting when scenario count exceeds 15 (Step 3e) |