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.
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.