BDD from API Spec

Generate Gherkin BDD feature files from API handler definitions — map endpoints to executable business scenarios

16 stars

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

$curl -o ~/.claude/skills/bdd-from-api-spec/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/bdd-from-api-spec/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bdd-from-api-spec/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How BDD from API Spec Compares

Feature / AgentBDD from API SpecStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/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

16
from diegosouzapw/awesome-omni-skill

一次归档多个已完成的变更。用于归档多个并行变更。

moai-foundation-specs

16
from diegosouzapw/awesome-omni-skill

SPEC document management - lifecycle, versioning, approval workflows, 50+ references, SPEC-first TDD integration

eng-spec

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

Generate PRODUCT_SPEC.md through guided Q&A. Use as the first step when starting a new greenfield project.

gspec-epic

16
from diegosouzapw/awesome-omni-skill

Break down a large epic into multiple focused feature PRDs with dependency mapping

ask-questions-if-underspecified

16
from diegosouzapw/awesome-omni-skill

Clarify requirements before implementing. Use when serious doubts arise.

html-specific-rules

16
from diegosouzapw/awesome-omni-skill

Rules specific to HTML files, focusing on accessibility and Tailwind styling.

factory-spec

16
from diegosouzapw/awesome-omni-skill

Phase MODEL - Génère specs + ADR + rules

ai-ad-spec-kit

16
from diegosouzapw/awesome-omni-skill

No description provided.

speckit-documentation-engineer.agent

16
from diegosouzapw/awesome-omni-skill

Expert documentation engineer specializing in technical documentation, API docs, developer guides, and documentation-as-code. Creates maintainable, searchable documentation that developers actually use.