BDD from API Spec
Generate Gherkin BDD feature files from API handler definitions — map endpoints to executable business scenarios
Best use case
BDD from API Spec is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate Gherkin BDD feature files from API handler definitions — map endpoints to executable business scenarios
Teams using BDD from API Spec should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bdd-from-api-spec/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How BDD from API Spec Compares
| Feature / Agent | BDD from API Spec | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate Gherkin BDD feature files from API handler definitions — map endpoints to executable business scenarios
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# BDD from API Spec Skill Automatically generate Gherkin feature files from API handler definitions, producing executable business specifications for each endpoint. ## Trigger Conditions - New handler file is created - Existing handler endpoint is modified - BDD scenarios are requested - User invokes with "write BDD" or "bdd-from-api-spec" ## Input Contract - **Required:** Path to handler files - **Optional:** OpenAPI spec for additional context ## Output Contract - Gherkin `.feature` files per handler/resource - Scenario coverage: happy path, error cases, edge cases, auth checks - Step definition stubs (Go/Godog format) ## Tool Permissions - **Read:** Handler files, DTO files, service interfaces, OpenAPI spec - **Write:** Feature files in `features/` directory, step definition stubs - **Search:** Grep for handler methods, route registrations ## Execution Steps 1. **Extract endpoints**: Parse handler files for all endpoint methods with HTTP method and path 2. **Identify scenarios**: For each endpoint, generate scenarios: - Happy path (valid request, successful response) - Authentication failure (missing/invalid token) - Authorization failure (wrong user/scope) - Validation failure (invalid input) - Business rule failure (e.g., insufficient funds, account frozen) - Idempotency (duplicate request returns same result) 3. **Generate Gherkin**: Write `.feature` files with Given/When/Then format 4. **Generate step stubs**: Create step definition file stubs for Godog
Related Skills
openspec-bulk-archive-change
一次归档多个已完成的变更。用于归档多个并行变更。
moai-foundation-specs
SPEC document management - lifecycle, versioning, approval workflows, 50+ references, SPEC-first TDD integration
eng-spec
Generate an Engineering Specification. Use when the user says /eng-spec, asks to create a technical spec, engineering spec, system design document, or translate a PRD into a technical plan. Triggers: eng-spec, engineering spec, technical spec, system design, technical design, architecture spec.
a11y-specialist
Expert in web accessibility (WCAG 2.1/2.2 AA/AAA compliance), ARIA patterns, keyboard navigation, screen reader testing, color contrast, focus management, and automated accessibility testing
spec-prd-creator
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
product-spec
Generate PRODUCT_SPEC.md through guided Q&A. Use as the first step when starting a new greenfield project.
gspec-epic
Break down a large epic into multiple focused feature PRDs with dependency mapping
ask-questions-if-underspecified
Clarify requirements before implementing. Use when serious doubts arise.
html-specific-rules
Rules specific to HTML files, focusing on accessibility and Tailwind styling.
factory-spec
Phase MODEL - Génère specs + ADR + rules
ai-ad-spec-kit
No description provided.
speckit-documentation-engineer.agent
Expert documentation engineer specializing in technical documentation, API docs, developer guides, and documentation-as-code. Creates maintainable, searchable documentation that developers actually use.