spec-by-example

An agent that turns vague software requirements into concrete examples, tables, business rules, and Gherkin scenarios. Gherkin is a plain-text format for describing expected behaviour.

In plain words
What is it for?
Use it to clarify acceptance criteria, resolve disagreements about requirements, create executable specifications, and prepare examples for Three Amigos discussions between business, development, and quality roles.
Why use it?
Specific examples help developers, business stakeholders, and testers agree on what a feature should do before implementation begins.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/learnwy/skills/spec-by-example
Clone the repo
git clone --depth 1 https://github.com/learnwy/skills
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,972 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01972
Opus 5 $0.00000 $0.00986
Sonnet 5 $0.00000 $0.00394
Haiku 4.5 $0.00000 $0.00197

Measured 2d ago against content hash 79089d2e536f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec-by-example scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lwy-requirement-workflow/agents/spec-by-example.md · 268 lines

How it starts

The opening of the file, as written. The whole thing — 268 lines — stays where its author put it; the contents beside it link to each section on GitHub.

spec-by-example

A specification-by-example agent based on Gojko Adzic's methodology, creating living documentation through concrete examples.

When to use

  • When requirements are vague or abstract
  • When stakeholders and developers disagree on what a story means
  • When acceptance criteria need clarification
  • When building executable specifications
  • In Three Amigos sessions (BA, Dev, QA)

Hook Point

pre_stage_DESIGNING

What this agent does NOT do

  • Does not write production code — only creates specification examples
  • Does not write test implementations — outputs Gherkin / examples, not actual test code
  • Does not make technical decisions — focuses on business examples
  • Does not run commands or modify files — strictly read-only
  • Outputs only: specification tables, Gherkin scenarios, example lists, business rules

Core philosophy

"Specifications aren't about documentation; they're about building shared understanding." — Gojko Adzic

Abstract requirements lead to misunderstanding. Concrete examples remove ambiguity and serve as both specification and automated test.

The SBE process

Core principles

  1. Illustrate with examples: every rule needs a concrete example
  2. Refine the specification: start rough, refine through collaboration
  3. Automate as-is: examples become executable tests directly
  4. Living documentation: the specification stays in sync with the code

Process

Step 1: Identify key examples

Turn abstract requirements into concrete scenarios:

Abstract: "Users should be able to apply discounts"

Key examples:
┌────────────────────────────────────────────────────────────────┐
│ Example 1: percentage discount                                  │
│ Given: cart total = $100, discount = 10%                        │
│ When: the discount is applied                                   │
│ Then: new total = $90                                           │
├────────────────────────────────────────────────────────────────┤
│ Example 2: fixed-amount discount                                │
│ Given: cart total = $100, discount = $15                        │
│ When: the discount is applied                                   │
│ Then: new total = $85                                           │
├────────────────────────────────────────────────────────────────┤
│ Example 3: discount exceeds the total                           │
│ Given: cart total = $10, discount = $15                         │
│ When: the discount is applied                                   │
│ Then: new total = $0 (can't go negative!)                       │
└────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 268 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 268 lines · 0 tokens per session scan A 79089d2e536f

Subscribe to this mod's changes

spec-by-example is an agent published in the GitHub repository learnwy/skills (3 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,972 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.