.claude/skills/gen-gherkin-feature/SKILL.md
Use when formalizing acceptance criteria from a use case into executable Gherkin scenarios. Generates a .feature file with traceability comments, tag taxonomy, Scenario Outlines, @pending placeholders, and a coverage matrix. Pairs with gen-use-case (upstream) and gen-test-class (downstream). Also invoke when the user mentions: Gherkin feature, BDD feature file, acceptance scenarios, .feature file, Cucumber/SpecFlow feature. Domain: Testing, BDD. Level: Intermediate.
npx skillsauth add klod68/littlerae gen-gherkin-featureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a senior business analyst and BDD practitioner. Convert the use case document
below into a well-structured Gherkin .feature file that is:
Do not invent behavior not present in the use case. For any TBD section,
generate a @pending scenario with # TODO: placeholder steps.
${1:e.g. HR Portal}${2:e.g. Manage Working Hours}${3:e.g. Employee}${4|SpecFlow,Cucumber (Java),Cucumber (JS),Behave (Python)|}Feature block — one-line description + In order to / As a / I want to narrativeBackground — if preconditions are shared by all scenarios@happy-path) — Main Scenario, step by step@alternative) — one per extension row@business-rule) — one Scenario or Scenario Outline per verifiable rule@negative) — null inputs, unauthorized access, boundary conditions@pending) — one per TBD item in the Pending Issues sectionGiven → system state or precondition (already true before the actor acts)When → the actor's action (exactly one trigger per scenario)Then → the observable outcome (what changed, returned, or notified)And / But → continuation of the previous keyword onlyScenario Outline + Examples: table when the same behavior applies to multiple data setsthe ${3}, not "the user")<someValue>clicks, sees, types) — describe intent and outcome, not mechanics| Tag | When to apply |
|---|---|
| @happy-path | Main success scenario |
| @alternative | Extensions and alternate flows |
| @business-rule | Scenarios derived from business rules |
| @negative | Error, rejection, and edge case scenarios |
| @pending | Placeholder for TBD items |
Above every scenario, add a single-line comment tracing it to the use case:
# UC: Main Scenario — Step 3
# UC: Extension 2 — <condition>
# UC: Business Rule 2 — <rule-statement>
# UC: Pending Issues — Issue 1
Emit two sections:
1. The .feature file (complete, ready to save)
2. Coverage Matrix (markdown table):
| Use Case Section | Scenario(s) |
|---|---|
| Main Scenario | Happy path — ${3} completes full flow |
| Extension *a | <scenario title> |
| Business Rule N | <scenario title> |
| Pending Issues | @pending — <title> |
@pendingWhen stepScenario Outline is mandatory whenever the same rule applies to 2+ data setstools
Use when cross-cutting concerns (logging, metrics, validation, authorization) are tangled into command handlers or service methods, when building database command pipelines with reorderable concerns, or when HTTP client pipelines or message handlers need composable, independently-replaceable processing stages. Covers ICommandInterceptor interface, InterceptorPipeline with reverse-chain construction, zero-cost Empty sentinel to skip overhead when no interceptors are registered, and ConfigureAwait(false) discipline for library code. Domain: Architecture, Cross-Cutting Concerns. Level: Intermediate. Tags: interceptor, pipeline, middleware, decorator, cross-cutting-concerns.
development
Use when writing integration tests for Razor Pages, MVC, or Minimal API applications to validate routing, middleware, page rendering, and HTTP behavior without a browser or live server, or when adding fast smoke tests to a CI pipeline. Covers WebApplicationFactory<Program> setup with public partial class Program, in-memory test server, AngleSharp HTML parsing, CSS selector assertions, redirect and status code testing, and a shared static fixture pattern for minimal per-test startup overhead. Domain: Testing, ASP.NET Core. Level: Intermediate. Tags: integration-testing, webapplicationfactory, razor-pages, anglesharp, http-testing.
development
Use when designing indexes for new tables, diagnosing slow queries that are not using indexes efficiently, reviewing index fragmentation and maintenance, or when the current indexing strategy results in key lookups, table scans, or missing index warnings. Covers clustered index key selection (narrow, unique, ever-increasing), non-clustered index design for query patterns, covering indexes with INCLUDE columns, filtered indexes for subset queries, composite index column ordering, DMV-based monitoring for missing and unused indexes, and rebuild vs reorganize maintenance thresholds. Domain: Database, Performance. Level: Intermediate. Tags: index, sql-server, covering-index, filtered-index, performance, dmv, maintenance.
development
Use when building a searchable in-memory catalog or registry for documentation sites, admin panels, or type/API browsers where you need keyword matching, fuzzy search, and ranked results without an external search engine or database. Covers RegistryService with weighted scoring across name, description, keywords, and method names; Levenshtein fuzzy matching; synonym expansion; category and subcategory filtering; and singleton DI registration for datasets of hundreds to low thousands of items. Domain: Search, Data Access Patterns. Level: Intermediate. Tags: search, registry, fuzzy-matching, in-memory, catalog, filtering.