$ recombobulate _
home / tips / write-bdd-feature-files-with-claude
0

Write BDD Feature Files with Claude

bagwaa @bagwaa · Mar 26, 2026 · Workflows
write-bdd-feature-files-with-claude

Gherkin feature files are living documentation that non-technical stakeholders can read and developers can run as tests. Claude can generate them from a feature description and then produce the matching step definitions.

Write Gherkin feature files for our user registration flow. Cover: successful registration,
duplicate email rejection, weak password rejection, and the email verification step.
Use Given/When/Then format compatible with Behat.

Claude produces clean, readable scenarios:

Feature: User Registration

  Scenario: Successful registration
    Given I am on the registration page
    When I fill in "email" with "user@example.com"
    And I fill in "password" with "Str0ngP@ss!"
    And I submit the form
    Then I should see "Check your email to verify your account"
    And a verification email should be queued

Once the feature files look right, ask Claude to wire them up:

Generate Behat step definitions for these scenarios using our existing PageObject
classes and the DatabaseTransactions trait.

For non-PHP projects, Claude knows Cucumber (Ruby, Java, JavaScript) and Behave (Python) just as well.

The real payoff is using Claude to generate feature files before writing any code — it forces clarity on what you're actually building before a line is written.

Feature files are the spec and the test in one — Claude writes them faster than you can argue about the wording.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago