agentsclimarketplace

Specifying by example

Skill msewell/agent-stuff/skills/specifying-by-example

Writes, reviews, and refines Specification by Example (SBE) artifacts — Gherkin scenarios, example mappings, rule-example tables, and scenario outlines. Produces declarative, single-behavior specifications using ubiquitous language. Use when writing acceptance criteria, Given-When-Then scenarios, feature files, BDD specifications, or executable specifications, when reviewing Gherkin for anti-patterns, when running Example Mapping or Three Amigos sessions, or when the user mentions SBE, BDD, specification by example, or spec-driven development.From its SKILL.md

Install
npx -y skills add msewell/agent-stuff --skill specifying-by-example

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.1 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

Specifying by Example

Workflow: Writing SBE specifications

  1. Clarify the business goal. Ask what problem the feature solves and for whom. If the user provides a user story, extract the goal. If they provide raw requirements, ask "why are we building this?"

  2. Identify rules. Extract the distinct business rules from the requirements. Each rule is a constraint or behavior the system must enforce. Name each rule explicitly.

  3. Generate examples for each rule. For every rule, produce:

    • The happy path (main success scenario).
    • Key boundary conditions (edges where behavior changes).
    • Important negative cases (what the system should refuse). Use realistic data (real names, plausible amounts), not "foo"/"bar."
  4. Write Gherkin scenarios. Convert each example into a Given-When-Then scenario following these rules:

    • Declarative, not imperative. Describe what happens, not UI steps. No CSS selectors, button names, or page navigation.
    • One behavior per scenario. Each scenario has exactly one When-Then pair.
    • Essential data only. Include only data that illustrates the rule. Omit incidental details (user IDs, timestamps, irrelevant fields).
    • Ubiquitous language. Use the same terms the business uses. No user_id, POST /api/orders, or status = 2.
    • Name the rule. Group scenarios under a Rule: keyword in Gherkin.
  5. Use Scenario Outlines for boundary tables. When a rule has many input-output combinations, use a parameterized Scenario Outline with an Examples table instead of repeating similar scenarios.

  6. Check for specification gaps. Are there rules with no examples? Examples with no clear rule? Unanswered questions? Surface these explicitly.

  7. Organize by domain concept. Group feature files by business capability (e.g., specs/pricing/, specs/accounts/), not by sprint or ticket number.

Workflow: Reviewing SBE specifications

  1. Read all scenarios in the feature file or specification document.
  2. Check each scenario against these anti-patterns:
Anti-patternSymptomFix
Imperative scriptsSteps say "click," "type," "navigate"Rewrite in declarative style
Multi-behavior scenariosMultiple When-Then pairsSplit into one scenario per behavior
Incidental detail overloadIrrelevant data (user IDs, timestamps)Strip to essential data only
Technical leakageSteps reference APIs, HTTP codes, DB tablesReplace with business-language equivalents
Inconsistent vocabularySame concept called different namesPick one term and use it everywhere
Scenario proliferationHundreds of trivially different scenariosUse Scenario Outlines; push combinatorics to unit tests
Too abstract"Given sufficient funds / When they withdraw / Then it succeeds"Add concrete amounts and expected outcomes
UI-coupled specsScenarios break when the UI is redesignedAutomate against the API/service layer; use declarative language
  1. Verify the specification covers happy path, boundaries, and negative cases for each rule.
  2. Propose specific fixes with before/after Gherkin.

Quick example

Input: "Users get free shipping on orders over $75, otherwise $5.95 flat rate."

Output:

Feature: Shipping cost calculation

  Rule: Shipping is free for orders over $75; otherwise $5.95 flat rate

    Scenario Outline: Shipping cost based on order total
      Given an order with a subtotal of <subtotal>
      When the shopper proceeds to checkout
      Then the shipping charge is <shipping>

      Examples:
        | subtotal | shipping |
        | $50.00   | $5.95    |
        | $74.99   | $5.95    |
        | $75.00   | $0.00    |
        | $75.01   | $0.00    |
        | $150.00  | $0.00    |

The boundary ($75.00) is tested from both sides. The rule is stated in prose above the scenarios.

When NOT to apply SBE

Ask two questions before reaching for SBE:

  1. Will a non-developer ever need to read or validate this specification? If only developers will care, use standard test frameworks.
  2. Is there genuine ambiguity about what the system should do? If everyone already agrees, write a test and move on.

Skip SBE for: trivial CRUD, pure infrastructure/DevOps, throwaway prototypes, unit-level logic, algorithmically complex internals, and highly exploratory work.

A healthy ratio: SBE scenarios cover 10–20% of the test suite (high-value acceptance layer); unit and integration tests cover the remaining 80–90%.

Reference material

What ships with it: 5 files

34.4 KB alongside SKILL.md

Gives 0 of the 12 instructions most plan spec skills give in ~1.3k tokens

Counted across 1,099 of the 1,860 authors here whose files we hold, read 2026-08-07

  • Ask one question at a timein 51 of 1099
  • Break plans into vertical slicesin 29 of 1099, across 11 files
  • Publish issues in dependency orderin 27 of 1099, across 9 files
  • Iterate until user approves the breakdownin 25 of 1099, across 7 files
  • Explore the repository to understand the codebase statein 24 of 1099, across 7 files
  • Use domain glossary vocabularyin 23 of 1099, across 5 files
  • Apply correct triage labels to published issuesin 23 of 1099, across 5 files
  • Prefer AFK slices over HITLin 22 of 1099, across 7 files
  • Write a specification before writing any codein 22 of 1099, across 14 files
  • Write failing tests before implementation codein 22 of 1099, across 20 files
  • Ask clarifying questions until requirements are concretein 21 of 1099, across 13 files
  • Respect existing architecture decision recordsin 20 of 1099, across 5 files

Said here and by no other author read

  • ask what problem the feature solves
  • extract and name distinct business rules
  • produce happy paths boundary conditions and negative cases
  • use realistic data in examples
  • limit each scenario to one When-Then pair
  • include only data that illustrates the rule

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,764. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.