kunolu/640-skills/gherkin-bdd
Claude Code and agent skill by kunolu/640-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when adding, changing, reviewing, testing, synchronizing, or read-only ingesting user-visible behavior with BDD, Gherkin, Given/When/Then scenarios, .feature files, acceptance criteria, knowledge catalogs, or bug-fix behavior specs.
Install
npx vskill@latest install kunolu/640-skills/gherkin-bddSKILL.md
Gherkin BDD
Use this Skill for user-visible behavior. In strict tasks, new or changed behavior that a user, administrator, API client, CLI user, integration system, exported file consumer, notification recipient, or permission/error-state observer can see must have a persistent BDD scenario before implementation is completed. In default/lite tasks, apply this Skill when user-visible behavior, project rules, risk, or explicit delivery requirements call for persistent behavior evidence.
BDD does not replace PRD, DDD, TDD, project validation, or task workflows. It turns confirmed acceptance behavior into executable examples. PRD explains intent and scope, DDD stabilizes vocabulary and boundaries, BDD specifies observable behavior, and TDD turns the scenario into red tests and green implementation.
When To Use
Use this Skill when:
- The user asks for BDD, Gherkin, Given/When/Then,
.feature, scenarios, acceptance criteria, or behavior specs. - A task adds or changes UI, API, CLI, exported files, notifications, permissions, errors, status changes, or externally observable integration behavior.
- A user-visible bug is being fixed.
- A task has acceptance criteria that describe user-visible behavior.
- Existing code needs BDD coverage backfilled for touched behavior.
- A knowledge system needs to read repository-owned
.featurefiles from configured refs without modifying them.
Skip BDD only when the change is not user-visible, such as internal refactoring, dependency or tool configuration, purely mechanical formatting, or visual/text-only polish that does not change behavior or meaning. When skipping after code changes, report the reason.
Persistent Spec Location
Project conventions win:
- If the project already has
.featurefiles, afeatures/directory, or BDD runner configuration, follow the existing path, language, and naming style. - Otherwise, single-application projects use
<project-root>/features/<capability-slug>.feature. - Larger projects may group by capability area, such as
features/authentication/login.featureorfeatures/orders/order-cancellation.feature. - Monorepos use the owning workspace root, such as
apps/web/features/checkout/cart-update.feature,services/billing/features/invoice-export.feature, orpackages/cli/features/project-init.feature. - Cross-package behavior belongs near the product entry point that owns the observable capability, not in every internal package.
Task artifacts can draft or reference scenarios, but they are not the default long-term behavior source of truth. Use another persistent BDD path only when project-level rules explicitly define it.
Language Rules
- Existing
.featurefiles define the language and keyword style for their bounded context or feature area. - If no
.featurefiles exist, write scenario titles, descriptions, and step text in Simplified Chinese by default. - Use English Gherkin structural keywords by default:
Feature,Rule,Background,Scenario,Scenario Outline,Examples,Given,When,Then,And, andBut. - Do not add
# language: zh-CNwhen using English Gherkin keywords. Add it only when the project already uses localized Chinese Gherkin keywords or the user explicitly requests them. - Avoid mixing keyword languages inside the same bounded context or feature area.
- Domain terms must follow the project glossary,
docs/CONTEXT.md, context docs,docs/spec, and existing scenario vocabulary.
Before creating or rewriting a .feature file, make an explicit language decision:
- Inspect existing
.featurefiles, BDD runner configuration, and project-level BDD rules. - If matching
.featurefiles already exist, follow the nearest bounded context or feature area language and keyword style. - If no
.featurefiles exist and the user did not request another language, set scenario text language to Simplified Chinese, Gherkin keyword language to English, and omit# language: zh-CN. - Report the chosen scenario text language and keyword language before writing or patching the file.
Do not infer English scenario text merely from English Gherkin keywords, English PRD / design documents, code identifiers, package names, or product names. Proper nouns and established domain terms may remain in their project vocabulary inside Chinese sentences.
Default first-file pattern:
Scenario Rules
Write scenarios as product behavior, not implementation:
- Name
Featureafter the user-visible capability, not the implementation component. - Use one behavior per scenario.
- Make scenarios independent and chronologically executable.
Givenstates relevant preconditions.Whenstates one user or system action.Thenstates visible, persisted, returned, emitted, or otherwise externally observable outcomes.- Prefer concrete, realistic examples over placeholders.
- Keep step text free of selectors, mocks, fixtures, database fields, internal function names, and test helper names unless the behavior is inherently at that layer.
- Use
Ruleonly for a policy or invariant shared by multiple scenarios. - Keep
Backgroundshort and only for facts true for every scenario in the file. - Use
Scenario Outlineonly when an examples table covers the same behavior with meaningful input variations.
For user-visible wording or UI changes, require scenarios when the change affects meaning, decisions, validation, status, permissions, flow, defaults, or accessibility semantics. Skip scenarios for typos, spacing, color polish, token/class rewrites, or layout cleanup that does not change behavior or meaning.
Split-Repository Gate
When the behavior crosses repositories, services, clients, or mobile app boundaries, do not let .feature become a guess. Before drafting or finalizing scenarios, classify the available evidence:
complete: product behavior, contract, environment, account, data setup, and observable outcomes are known.contract-only: a reliable API contract, schema, fixture, or real response sample exists, but the full chain cannot run locally.environment-only: a runnable environment exists, but contract details, ownership, or expected side effects are incomplete.missing: key behavior, contract, environment, account, device, selector, data, or side-effect facts are absent.
For API behavior, confirm request shape, authentication, roles, status codes, response body, error codes, persistence side effects, emitted events, and external integrations from OpenAPI / Swagger, proto, GraphQL schema, backend docs, real samples, or user confirmation.
For Web, Mobile, or Hybrid journeys, confirm page or screen flow, stable selectors or accessibility names, backend dependency, test account, data setup and cleanup, base URL or environment switching, and platform-specific prerequisites. For iOS / Android, also confirm app artifact, bundle id / app id, simulator / emulator / device, permissions, deep links, launch arguments, and system UI requirements.
If evidence is missing, ask for the smallest missing fact that blocks a truthful scenario. If a scenario must be kept as a placeholder, tag it @todo or the project's equivalent marker and add an adjacent blocker comment. Mock-backed or app-mocked scenarios are allowed only when the mock behavior comes from a contract, real sample, existing fixture, launch argument, or explicit user confirmation; mark them as contract-backed, mock-backed, or app-mocked in the related test trace, and do not present them as full-chain verification.
Workflow
- Decide whether the change is user-visible and whether BDD is the selected behavior-evidence method for the current mode, project rules, risk, or explicit delivery.
- Read existing
.featurefiles and project vocabulary before drafting. - Run the language decision gate and report the chosen scenario text language and Gherkin keyword language.
- For split-repository or incomplete-chain behavior, run the split-repository gate and record the evidence class before treating the scenario as confirmed.
- If domain terms or boundaries are unclear, use
grill-with-docsandbook-ddd-distilled-modelingbefore finalizing scenario wording. - Create or update the persistent
.featurefile before implementation. - Review scenarios for observable behavior, one-behavior focus, vocabulary consistency, realistic examples, absence of implementation details, and compliance with the language decision.
- Derive tests from scenarios. If the project has a Gherkin runner, bind scenarios to step definitions or runner tests. Otherwise use the existing test framework and make each test traceable to a scenario by name, comment, file organization, or the project's established convention.
For Mobile / Hybrid E2E scenarios, use maestro-mobile-e2e to derive repo-resident Maestro flows when device-level coverage is needed.
- For new behavior or bug fixes, run the derived test first and confirm it fails for the intended behavior before implementation when the project test setup supports red runs.
- Implement the smallest change that makes the scenario-backed tests pass.
- During validation, confirm PRD,
.feature, tests, code, and any contract / mock assumptions agree.
If a scenario cannot be automated yet, tag it @todo or the project's equivalent marker and add an adjacent comment explaining the blocker and temporary manual verification. Do not silently drop it.
Existing Code Backfill
For existing projects, use no new uncovered behavior:
- When BDD is the selected behavior-evidence method, touched existing behavior must get or update relevant scenarios.
- When BDD is selected for a user-visible bug fix, first add the correct behavior scenario, then a failing regression test, then the fix.
- Untouched legacy behavior can remain uncovered until it is changed, an explicit BDD migration is requested, or the current mode/project rules require backfill.
When backfilling from code, record what the code does today in product language. If behavior appears suspicious or contradicts docs, names, comments, tests, or obvious user expectation, ask whether it is intended. If it is a defect, write the intended behavior as the scenario and let the derived test go red.
BDD Sync Mode
When this Skill is actively used and the user's request includes either sync or 同步, enter BDD Sync Mode. This mode syncs project .feature files with current product behavior; it does not mean local Codex configuration sync and does not copy this repository's templates to any global path.
BDD Sync Mode is a full repository behavior audit, not a diff-only update:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsbtd-workflow-onboard/templates/skills/gherkin-bdd/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kunolu/640-skills/gherkin-bdd)