Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计异常

gherkin-authoring小黄瓜创作

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

315

周安装

13

GitHub Stars

61

下载量

103
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gherkin-authoring(小黄瓜创作)
来源仓库:https://github.com/melodic-software/claude-code-plugins
仓库路径:skills/gherkin-authoring
安装命令:
npx skills add https://github.com/melodic-software/claude-code-plugins --skill gherkin-authoring
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/melodic-software/claude-code-plugins --skill gherkin-authoring

简介

用于辅助安全审计、权限检查和常见漏洞排查。

  • 适合梳理敏感配置、分析鉴权逻辑或生成安全复核清单。
  • 使用时不能将工具输出直接当作最终结论,涉及密钥或生产系统时应确认最小权限。
  • 安装命令:npx skills add https://github.com/melodic-software/claude-code-plugins --skill gherkin-authoring
  • 建议核对来源仓库 README 并确认操作边界。

SKILL.md

Gherkin Authoring

Gherkin/BDD acceptance criteria authoring for executable specifications.

When to Use This Skill

Keywords: Gherkin, Given/When/Then, BDD, behavior-driven development, feature files, scenarios, acceptance criteria, Reqnroll, Cucumber, SpecFlow, executable specifications

Use this skill when:

  • Writing acceptance criteria in Given/When/Then format
  • Creating.feature files for BDD testing
  • Converting requirements to executable specifications
  • Setting up Reqnroll tests in.NET projects
  • Understanding Gherkin syntax and best practices

Quick Syntax Reference

Feature File Structure

Feature: <Feature Name>
  <Feature description>

  Background:
    Given <common precondition>

  Scenario: <Scenario Name>
    Given <precondition>
    When <action>
    Then <expected outcome>

  Scenario Outline: <Parameterized Scenario>
    Given <precondition with <parameter>>
    When <action with <parameter>>
    Then <expected outcome with <parameter>>

    Examples:
      | parameter |
      | value1    |
      | value2    |

Step Keywords

KeywordPurposeExample
GivenSetup preconditionsGiven a user is logged in
WhenDescribe actionWhen the user clicks submit
ThenAssert outcomeThen the form is saved
AndAdditional step (same type)And an email is sent
ButNegative conditionBut no error is shown

Writing Effective Scenarios

The Three A's Pattern

Gherkin maps to the Arrange-Act-Assert pattern:

GherkinAAAPurpose
GivenArrangeSet up the test context
WhenActPerform the action under test
ThenAssertVerify the expected outcome

Single Behavior Per Scenario

Good - One behavior:

Scenario: User login with valid credentials
  Given a registered user exists
  When the user enters valid credentials
  Then the user is logged in

Bad - Multiple behaviors:

Scenario: User login and profile update
  Given a registered user exists
  When the user enters valid credentials
  Then the user is logged in
  When the user updates their profile
  Then the profile is saved

Declarative vs Imperative Style

Declarative (Preferred) - What, not how:

Scenario: Successful checkout
  Given a customer with items in cart
  When the customer completes checkout
  Then the order is confirmed

Imperative (Avoid) - Too detailed:

Scenario: Successful checkout
  Given a customer is on the home page
  And the customer clicks "Products"
  And the customer clicks "Add to Cart" on item 1
  And the customer clicks "Cart" icon
  And the customer clicks "Checkout" button
  ...

Background Section

Use Background for common setup shared across all scenarios in a feature:

Feature: Shopping Cart

  Background:
    Given a customer is logged in
    And the product catalog is available

  Scenario: Add item to cart
    When the customer adds a product to cart
    Then the cart contains 1 item

  Scenario: Remove item from cart
    Given the cart contains a product
    When the customer removes the product
    Then the cart is empty

Background Guidelines

  • Keep Background short (1-3 steps)
  • Only include truly common setup
  • Don't include anything not needed by ALL scenarios
  • Consider splitting features if Background grows large

Scenario Outline

Use Scenario Outline for parameterized tests:

Scenario Outline: Validate email format
  Given a user registration form
  When the user enters email "<email>"
  Then the validation result is "<result>"

  Examples:
    | email              | result  |
    | user@example.com   | valid   |
    | invalid-email      | invalid |
    | @missing-local.com | invalid |
    | user@             | invalid |

When to Use Scenario Outline

Use for:

  • Testing same logic with different data
  • Boundary testing
  • Error message variations
  • Multiple valid/invalid inputs

Avoid when:

  • Scenarios have fundamentally different flows
  • Setup differs significantly between examples
  • Only 1-2 examples (use separate scenarios)

Tags

Organize and filter scenarios with tags:

@smoke @authentication
Feature: User Login

  @happy-path
  Scenario: Successful login
    ...

  @security @negative
  Scenario: Account lockout after failed attempts
    ...

Common Tag Categories

CategoryExamples
Priority@critical, @high, @medium, @low
Type@smoke, @regression, @e2e
Feature@authentication, @checkout, @search
State@wip, @pending, @manual
Non-functional@security, @performance, @accessibility

Integration with Canonical Spec

Gherkin acceptance criteria map to canonical specification:

requirements:
  - id: "REQ-001"
    text: "WHEN a user submits valid credentials, the system SHALL authenticate the user"
    priority: must
    ears_type: event-driven
    acceptance_criteria:
      - id: "AC-001"
        given: "a registered user with valid credentials"
        when: "the user submits the login form"
        then: "the user is authenticated"
        and:
          - "a session is created"
          - "the user is redirected to dashboard"

Mapping Rules

Canonical FieldGherkin Element
acceptance_criteria.givenGiven step(s)
acceptance_criteria.whenWhen step(s)
acceptance_criteria.thenThen step(s)
acceptance_criteria.andAdditional And/But steps

Best Practices

Scenario Naming

Good:

  • Describes the behavior being tested
  • Uses domain language
  • Specifies the outcome
Scenario: User receives confirmation email after registration
Scenario: Cart total updates when quantity changes
Scenario: Search returns relevant results sorted by relevance

Bad:

  • Generic or vague
  • Implementation-focused
  • Missing outcome
Scenario: Test registration
Scenario: Click add button
Scenario: Verify database

Step Reusability

Write steps that can be reused:

Reusable:

Given a user with role "<role>"
Given the user has "<count>" items in cart
When the user performs "<action>"

Not Reusable:

Given John Smith is logged in as admin
Given the user has 3 items in cart for checkout test
When the user clicks the blue submit button

Avoid Coupling to UI

Good - Behavior-focused:

When the user submits the form with invalid data
Then an error message is displayed

Bad - UI-coupled:

When the user clicks the red Submit button at the bottom
Then a red error div appears below the form

Reqnroll Integration (.NET)

Step Definition Example

[Binding]
public class LoginSteps
{
    private readonly ScenarioContext _context;

    public LoginSteps(ScenarioContext context)
    {
        _context = context;
    }

    [Given(@"a registered user exists")]
    public void GivenARegisteredUserExists()
    {
        var user = new User("test@example.com", "password123");
        _context["user"] = user;
    }

    [When(@"the user enters valid credentials")]
    public void WhenTheUserEntersValidCredentials()
    {
        var user = _context.Get<User>("user");
        var result = _authService.Login(user.Email, user.Password);
        _context["loginResult"] = result;
    }

    [Then(@"the user is logged in")]
    public void ThenTheUserIsLoggedIn()
    {
        var result = _context.Get<LoginResult>("loginResult");
        result.Success.Should().BeTrue();
    }
}

Project Setup

<PackageReference Include="Reqnroll" Version="2.*" />
<PackageReference Include="Reqnroll.NUnit" Version="2.*" />

Anti-Patterns to Avoid

Anti-PatternProblemFix
Feature-length scenariosHard to maintainSplit into focused scenarios
Imperative stepsBrittle, verboseUse declarative style
Technical jargonNot business-readableUse domain language
Coupled to UIBreaks on UI changesFocus on behavior
No BackgroundDuplicated Given stepsExtract common setup
Too many ExamplesSlow, redundantTest boundary cases only

Validation Checklist

Before finalizing a Gherkin scenario:

  • Single behavior per scenario
  • Declarative, not imperative
  • Uses domain language
  • Given establishes context only
  • When contains single action
  • Then asserts observable outcomes
  • No implementation details
  • Scenario name describes behavior

References

Detailed Documentation:

Related Skills:

  • canonical-spec-format - Canonical specification structure
  • spec-management - Specification workflow navigation
  • ears-authoring - EARS requirement patterns

Last Updated: 2025-12-24

Version History

  • v1.0.0 (2025-12-26): Initial release

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

39.54%
按下载量换算41

Claude

28.34%
按下载量换算29

Cursor

19.8%
按下载量换算20

Gemini CLI

9.83%
按下载量换算10

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills