bdd

A workflow that turns written requirements into behavior-focused acceptance tests. BDD means describing what users should see the system do, without depending on how the code is built.

In plain words
What is it for?
Use it to create acceptance tests and, when a runnable end-to-end test framework exists, corresponding tests for normal work or for checking behavior before refactoring.
Why use it?
It makes expected user-visible behavior explicit before design decisions are made and helps confirm that the finished system meets the requirements.

Command

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 commands/andkirby/markdown-ticket/bdd
Clone the repo
git clone --depth 1 https://github.com/andkirby/markdown-ticket
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 3,989 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.03989
Opus 5 $0.00000 $0.01995
Sonnet 5 $0.00000 $0.00798
Haiku 4.5 $0.00000 $0.00399

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

Security

Grade A, and why

bdd 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.

prompts/mdt/commands/bdd.md · 516 lines

How it starts

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

MDT BDD Specification Workflow (v2)

Generate BDD acceptance tests from requirements. Produce user-visible behavior tests that validate the system from the outside.

Core Principle: BDD tests specify WHAT the system does from the user perspective, independent of internal architecture. They are written before architecture decisions.

Skill Discovery

Check AGENTS.md for skills matching this workflow. If found, invoke via Skill tool before proceeding.

User Input

$ARGUMENTS

Session Context

Use {TICKETS_PATH} in all file path templates below (if it is not defined, read ticketsPath from .mdt-config.toml).

Output Location

Mode Output
Normal {TICKETS_PATH}/{CR-KEY}/bdd.md + E2E test files (when executable framework exists)
Prep (--prep) {TICKETS_PATH}/{CR-KEY}/prep/bdd.md + E2E test files (when executable framework exists)

Mode Detection

Mode Flag Input Source Test State Purpose
Normal (none) requirements.md RED (when executable) Specify new behavior
Prep --prep existing system GREEN (when executable) Lock behavior before refactoring

Usage Guardrails

Use /mdt:bdd for:

  • New or changed user-visible behavior
  • Feature enhancements before architecture
  • Prep behavior locking (--prep) before major refactoring

Do not use /mdt:bdd for:

  • Pure technical refactoring with no user-visible behavior (use /mdt:tests --prep)
  • Documentation-only work
  • Internal-only changes with no user-visible impact

If this is a Feature Enhancement with user-visible behavior, BDD is required unless the user explicitly waives executable acceptance gating.

Critical Rules

  1. Write tests from user perspective only (no internal mechanics).
  2. Do not assume architecture (no components/services/file-level details in scenarios).
  3. Use Gherkin (Given/When/Then) syntax.
  4. Keep focus on end-to-end interfaces (browser/API/CLI).
  5. Enforce scenario budget:
    • normal: max 12 total, max 3 per journey
    • prep: max 8 total, max 2 per journey
  6. Deduplicate aggressively; use Scenario Outline for mirrored variants.
  7. If framework: "none", generate spec-only output (no executable placeholders).
  8. RED/GREEN execution state is required only when executable E2E framework exists.
  9. Feature acceptance gate: executable BDD scenarios must be GREEN before completion (unless user waiver for spec-only mode).
  10. Internal constraints belong in /mdt:tests, unless explicitly user-visible.
  11. Tag scenarios with sub-requirement IDs (BR-X.Y), not only parent IDs.
  12. Coverage honesty: do not claim coverage unless a scenario explicitly validates it.
  13. No invented behaviors: if needed behavior is absent from requirements, stop and route to /mdt:requirements or /mdt:clarification.
  14. Non-functional thresholds in BDD are opt-in: include only when requirements define measurable thresholds and acceptance method.

Read the full file on GitHub · 516 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 · 516 lines · 0 tokens per session scan A edb61395f49a

Subscribe to this mod's changes

bdd is a command published in the GitHub repository andkirby/markdown-ticket (5 stars, last pushed 16d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,989 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.