From rara-skills
Use when designing BDD features, writing Gherkin acceptance criteria, decomposing requirements into testable scenarios, creating GitHub issues with .feature specs, or specifying acceptance criteria for the implementation agent. Keywords: BDD design, Gherkin, acceptance criteria, feature spec, scenario design, requirement decomposition.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rara-skills:bdd-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**IRON LAW: Every step must be specific enough that an agent can derive test assertions from the step text alone.** If a step says "it works" or "the result is correct", it is too vague — rewrite it with concrete, verifiable expectations.
IRON LAW: Every step must be specific enough that an agent can derive test assertions from the step text alone. If a step says "it works" or "the result is correct", it is too vague — rewrite it with concrete, verifiable expectations.
You are Agent 1 (the design agent). Produce a GitHub issue containing Gherkin acceptance criteria and a design spec that Agent 2 (the implementation agent) will use to deliver working code with passing BDD tests.
Copy and track progress:
- [ ] ⚠️ 1. Understand the codebase (read AGENT.md, CLAUDE.md, src/, features/)
- [ ] ⚠️ 2. Check existing step definitions (rara-bdd list)
- [ ] ⚠️ 3. Write plan spec (context, deliverables, constraints, out of scope)
- [ ] ⚠️ 4. Write Gherkin .feature content (≥3 scenarios per deliverable)
- [ ] 5. Write design spec (files, signatures, constraints)
- [ ] ⚠️ 6. Self-check (all checklist items pass)
- [ ] ⚠️ 7. Submit for bdd-review (GO / NO_GO gate)
- [ ] 8. Fix based on review feedback (max 2 rounds)
- [ ] ⛔ 9. Confirm with user before creating issue
- [ ] 10. Create the GitHub issue(s)
Read the project context before writing anything:
AGENT.md — project conventions and architectureCLAUDE.md — dev workflow and commandssrc/ — source structurefeatures/ — existing .feature files (if any)Reuse existing steps — do NOT create duplicates.
rara-bdd list
If an existing step matches your intent (even partially), reuse its exact wording.
Before writing any Gherkin, produce a plan spec that frames the work:
## Plan Spec
**Product context:** Why this feature exists, what user problem it solves.
**Deliverables:**
- [ ] Deliverable 1 — brief description
- [ ] Deliverable 2 — brief description
**Constraints:**
- Constraint 1 (e.g., must not break existing API)
- Constraint 2 (e.g., max response time < 200ms)
**Out of scope:**
- Thing explicitly excluded from this work
The plan spec serves as the contract between design and review. The bdd-review agent will check that every deliverable has corresponding scenarios.
When the task is too large for a single issue:
.feature file with at least 3 scenariosfeat(scope): description (1/N), feat(scope): description (2/N).feature files to bdd-review together for cross-feature consistencyCreate complete Gherkin content with at least 3 scenarios per deliverable: one happy path, one error case, and one edge case.
@module-name (e.g., @auth, @billing)@AC-XX (e.g., @AC-01, @AC-02)"quoted strings" for string parameters, bare integers for number parametersrara-bdd listGiven for preconditions, When for actions, Then for assertionsAnd / But for continuation within the same keyword group# BAD — too vague, agent cannot derive assertions
@AC-01
Scenario: User logs in
Given a user exists
When they log in
Then it works
# BAD — implementation detail in steps (leaks internal API)
@AC-01
Scenario: User logs in
Given a row in the users table with id 1
When POST /api/v1/sessions with JSON body {"user_id": 1}
Then the sessions table has a new row
# GOOD — specific, testable, no implementation leak
@AC-01
Scenario: Valid credentials return a session token
Given a registered user with email "[email protected]"
When the user logs in with correct credentials
Then the response status is 200
And the response body contains a non-empty "token" field
# GOOD — error case with clear expected behavior
@AC-02
Scenario: Invalid password returns 401
Given a registered user with email "[email protected]"
When the user logs in with password "wrong-password"
Then the response status is 401
And the response body contains error "invalid credentials"
# GOOD — edge case
@AC-03
Scenario: Login with non-existent email returns 404
Given no user is registered with email "[email protected]"
When the user logs in with email "[email protected]"
Then the response status is 404
Provide a concise design spec that tells the implementation agent exactly what to build:
Before submitting for review, verify:
rara-bdd list)"quoted strings" for string params, bare integers for numbers@AC-XX@module-nameSubmit the following to the bdd-review skill for quality review:
rara-bdd list)Wait for the review verdict:
When bdd-review returns NO_GO:
Max 2 review rounds. If Round 2 still returns NO_GO, escalate to the user with both review reports and ask for guidance. Do NOT loop further.
Present the complete plan spec, Gherkin content, and design spec to the user. Include the bdd-review verdict (should be GO at this point). Wait for explicit approval before creating the GitHub issue. Do NOT create the issue without confirmation.
Use the bdd_task.yml issue template:
gh issue create --template bdd_task.yml \
--title "feat(scope): short description" \
--body "$(cat <<'EOF'
### Description
What should be implemented and why.
### Plan Spec
**Product context:** ...
**Deliverables:**
- [ ] ...
**Constraints:**
- ...
**Out of scope:**
- ...
### .feature (Acceptance Criteria)
```gherkin
@module-name
Feature: Feature title
@AC-01
Scenario: Happy path description
Given ...
When ...
Then ...
@AC-02
Scenario: Error case description
Given ...
When ...
Then ...
@AC-03
Scenario: Edge case description
Given ...
When ...
Then ...
src/module.rs — create: new module with XxxTraitsrc/lib.rs — modify: add pub mod module;features/module.feature — create: copy from aboveDesign constraints, dependencies, notes. EOF )" --label "agent:claude" --label "enhancement" --label "core"
**Required labels:**
- Agent label: `agent:claude` (or whichever agent is performing this)
- Type label: auto-applied by template (`enhancement`)
- Component label: one of `core`, `backend`, `frontend`, `cli`, `ci`, `docs`
For **Large / Epic tasks** (N issues), create each issue in sequence with the `(X/N)` suffix in the title and cross-reference the other issues in the Additional Context section.
## Anti-Patterns
- Writing vague steps like "it works", "result is correct", "operation succeeds"
- Leaking implementation details into steps (SQL, HTTP methods, table names)
- Ignoring existing step definitions and creating duplicates
- Writing only the happy path — always include error + edge cases
- Creating the issue without user confirmation
- Skipping the plan spec and jumping straight to Gherkin
- Skipping bdd-review and going directly to user confirmation
- Looping more than 2 review rounds without escalating to the user
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub rararulab/rara-skills --plugin rara