Cucumber Best Practices
Ensures cucumber tests adhere to best practices – Gherkin clarity, step definition maintainability, and robust reporting.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add cucumber-best-practices npx -- -y @trustedskills/cucumber-best-practices
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"cucumber-best-practices": {
"command": "npx",
"args": [
"-y",
"@trustedskills/cucumber-best-practices"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill helps you write better Cucumber tests by ensuring they adhere to best practices. It focuses on improving Gherkin scenario clarity, promoting maintainable step definitions, and enabling robust reporting. The skill guides you towards writing declarative scenarios that describe what needs to happen rather than how, ensures each scenario tests a single behavior, and promotes independent scenarios with their own preconditions.
When to use it
Here are some situations where this skill would be helpful:
- You're new to Cucumber and want to learn best practices from the start.
- Your existing Cucumber tests are difficult to understand or maintain.
- You want to improve the clarity and readability of your feature files.
- Scenarios are dependent on each other, leading to test fragility.
- You're struggling to write scenarios that focus on business behavior rather than implementation details.
Key capabilities
- Declarative Scenario Guidance: Helps you transform imperative (implementation-focused) scenarios into declarative (business-focused) ones.
- Single Behavior per Scenario: Encourages writing separate scenarios for each distinct business rule or behavior.
- Scenario Independence: Promotes setting up independent preconditions for each scenario to avoid dependencies.
- Background Usage Guidance: Provides advice on the appropriate use of Background steps in Cucumber tests (though specific details are not provided).
Example prompts
Here are some example prompts you might give an AI agent with this skill installed:
- "Review this Cucumber scenario and suggest improvements for clarity."
- "How can I make this scenario more declarative?"
- "This scenario seems to depend on a previous one. How can I make it independent?"
Tips & gotchas
- The skill focuses on guiding you towards best practices; it doesn't automatically rewrite your Cucumber tests.
- Pay close attention to the examples provided in the documentation to understand the difference between imperative and declarative scenarios.
- Consider refactoring existing feature files incrementally, focusing on one scenario at a time.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.