Agentic BDD Test Case Mentor
Version: 1.0.1| License: MIT
Use this skill to improve the quality, clarity, and reviewability of BDD artifacts while keeping the output business-readable and traceable to the source of truth.
1. Establish the operating mode
Classify the task as one of these modes before producing the response:
review: critique existing BDD, rank issues, assess coverage, or produce a report
rewrite: improve existing Gherkin while preserving the intended behavior
generate: create new BDD from requirements, rules, examples, or narrative source material
hybrid: combine findings with a corrected replacement
Use hybrid when the user wants both an assessment and an improved artifact.
State the selected mode at the start of the response when it would not be obvious from context.
2. Capture the source of truth before judging correctness
Use the strongest available oracle in this order:
- business rules
- acceptance criteria
- user stories
- feature text or scenario text
- stakeholder notes
Always do these steps:
- name the oracle sources that were provided
- distinguish strong, partial, and weak oracle coverage
- separate confirmed behavior from assumptions
- review wording and BDD structure even when the oracle is weak
- avoid claiming business correctness when the source of truth is incomplete or ambiguous
Never invent:
- requirement IDs
- personas
- tags
- priorities
- business rules
- policy limits
- framework semantics
Read references/intake-and-decision-flow.md when the request is ambiguous, the oracle is incomplete, or the correct mode is not obvious.
3. Load the right supporting references
Keep SKILL.md as the operating contract. Load additional references only when they materially improve the answer.
- Read references/review-workflow.md for formal, high-confidence, or findings-first reviews.
- Read references/bdd-quality-rules.md for anti-pattern detection, rewrite heuristics, and quality checks.
- Read references/feature-and-scenario-protocol.md for
Feature:, Rule:, Background:, Scenario Outline, tags, naming, and path coverage guidance.
- Read references/report-rubric.md when the user asks for a score, executive summary, or formal report.
- Read references/output-contracts.md when the response needs a more explicit structure than the default flow.
4. Apply the universal guardrails
Treat BDD as business-readable behavioral specification.
Always:
- prefer business behavior over UI choreography
- keep one behavior path per scenario
- keep one main event in
When
- make
Then externally observable
- keep
Given minimal but sufficient
- use concrete domain examples when the source supports them
- flag blocked decisions instead of smoothing them over
- keep traceability explicit when the source provides it
Do not:
- turn Gherkin into test-script narration
- mix unrelated rule branches in one scenario
- fabricate metadata to make the artifact look complete
- overstate confidence when the oracle is weak
- add implementation details unless the user explicitly needs them and the behavior cannot be understood without them
5. Run review mode
In review mode:
- assess artifact intent and scope
- assess traceability to the source of truth
- assess scenario architecture, naming, grouping, and duplication
- assess path coverage:
- main path
- alternate path
- error path
- persona, permission, boundary, or lifecycle coverage when relevant
- assess BDD quality:
- business language
- observable outcomes
- concrete examples
- absence of UI scripting
- absence of mixed branches
- rank findings as
Critical, Major, or Minor
Default to findings-first output.
If the artifact is strong, say No material defects identified instead of inventing weak findings.
6. Run rewrite mode
In rewrite mode:
- preserve business intent
- improve titles so they describe the condition and the outcome
- split overloaded scenarios into one behavior path per scenario
- replace UI steps with business behavior unless the UI interaction is itself the rule under test
- replace vague outcomes with externally visible outcomes
- replace generic placeholders with realistic examples when the source supports them
- keep unsupported metadata as an explicit gap rather than inventing it
Use assets/bdd-feature-template.feature when the user asks for a full feature file.
7. Run generate mode
In generate mode:
- start from rules, decisions, and examples rather than automation steps
- draft a feature narrative only when the source supports it
- map the rule space into main, alternate, and error behavior where supported
- generate one scenario per behavior path or rule branch
- prefer concrete roles, dates, states, amounts, and domain language
- stop and mark the gap when the source is too incomplete for reliable generation
If the source is partial but still usable, generate only the supported behaviors and list the unresolved gaps separately.
8. Run hybrid mode
In hybrid mode:
- keep the findings section short and focused on the most material issues
- provide the improved artifact immediately after the findings
- keep unresolved assumptions or blocked decisions explicit
Use hybrid instead of forcing the user to choose between critique and a useful replacement.
9. Use the correct response contract
Use the default response shape below unless the user explicitly asks for a formal report.
review: mode, oracle used, confidence, severity-ranked findings, coverage and traceability notes, top recommendations
rewrite: mode, rewrite strategy, revised artifact, open assumptions
generate: mode, source inputs, generated artifact, assumptions and gaps
hybrid: mode, oracle used, oracle sufficiency, confidence, key findings, rewritten artifact, open assumptions
Read references/output-contracts.md when a stricter structure is needed.
If the user explicitly asks for a formal review report, scorecard, or executive summary:
- use references/report-rubric.md
- use assets/review-report-template.md
10. Keep memory scoped and explicit
Use memory deliberately:
- runtime memory: working notes and judgments for the current task only
- project-local persistent memory: create only when the user explicitly asks for a saved checklist, report, or review ledger
- shared memory: treat as an external integration boundary and use only when the host workflow explicitly provides it
Do not automatically promote runtime observations into project-local or shared memory.
11. Handle failure cases cleanly
When the task is under-specified, degrade gracefully:
- weak oracle: review structure and BDD quality, but lower confidence and avoid correctness claims
- mixed behaviors in one scenario: split them and explain why
- vague outcomes: replace them with observable results or flag the missing business outcome
- excessive feature scope: recommend splitting by capability, rule set, persona, or lifecycle phase
- missing metadata: keep the gap explicit instead of fabricating tags or IDs
12. Follow the bundled examples
Use the examples under examples/ to stay consistent with the repository's intended style.
- examples/review-request.md
- examples/rewrite-request.md
- examples/formal-report-request.md
- examples/generation-source.md
- examples/quality-ladder.md
13. Gotchas
Avoid these common mistakes while using this skill:
- The "Automation Handoff" Trap: Do not suggest framework-specific code (Cucumber, Playwright, etc.) unless explicitly requested. This skill is for business-readable BDD, not test automation scripts.
- The "Hallucination" Pitfall: Do not invent requirement IDs, personas, or business rules that are not in the source material. If they are missing, call it out as a gap rather than fabricating "professional-looking" metadata.
- The "Over-Correction" Bias: If the user provides a well-structured artifact, do not invent findings just to have something to say. Say "No material defects identified" and focus on refinement instead.
- The "Missing Context" Blind Spot: Do not assume a scenario is correct just because it is well-written. Always verify it against the strongest available oracle.
- The "Scope Creep" Drift: Do not try to solve or generate an entire feature if the user only asked for a review of specific scenarios or rules. Focus on the requested scope.
14. Resource map
- Intake and mode selection: references/intake-and-decision-flow.md
- Formal review sequence: references/review-workflow.md
- Quality heuristics: references/bdd-quality-rules.md
- Structure protocol: references/feature-and-scenario-protocol.md
- Report rubric: references/report-rubric.md
- Response contracts: references/output-contracts.md
- Feature template: assets/bdd-feature-template.feature
- Formal report template: assets/review-report-template.md
1---2name: agentic-bdd-test-case-mentor3description: Review, rewrite, generate, and assess BDD or Gherkin feature files, scenarios, and outlines from user stories, acceptance criteria, business rules, or example maps. Use to identify BDD anti-patterns, traceability or coverage gaps, weak Given-When-Then structure, overloaded scenarios, missing rule branches, or coaching-oriented improvements without framework-specific automation design.4---56# Agentic BDD Test Case Mentor78> **Version:** 1.0.1| **License:** MIT 91011Use this skill to improve the quality, clarity, and reviewability of BDD artifacts while keeping the output business-readable and traceable to the source of truth.1213## 1. Establish the operating mode1415Classify the task as one of these modes before producing the response:1617- `review`: critique existing BDD, rank issues, assess coverage, or produce a report18- `rewrite`: improve existing Gherkin while preserving the intended behavior19- `generate`: create new BDD from requirements, rules, examples, or narrative source material20- `hybrid`: combine findings with a corrected replacement2122Use `hybrid` when the user wants both an assessment and an improved artifact.2324State the selected mode at the start of the response when it would not be obvious from context.2526## 2. Capture the source of truth before judging correctness2728Use the strongest available oracle in this order:29301. business rules312. acceptance criteria323. user stories334. feature text or scenario text345. stakeholder notes3536Always do these steps:3738- name the oracle sources that were provided39- distinguish strong, partial, and weak oracle coverage40- separate confirmed behavior from assumptions41- review wording and BDD structure even when the oracle is weak42- avoid claiming business correctness when the source of truth is incomplete or ambiguous4344Never invent:4546- requirement IDs47- personas48- tags49- priorities50- business rules51- policy limits52- framework semantics5354Read [references/intake-and-decision-flow.md](references/intake-and-decision-flow.md) when the request is ambiguous, the oracle is incomplete, or the correct mode is not obvious.5556## 3. Load the right supporting references5758Keep `SKILL.md` as the operating contract. Load additional references only when they materially improve the answer.5960- Read [references/review-workflow.md](references/review-workflow.md) for formal, high-confidence, or findings-first reviews.61- Read [references/bdd-quality-rules.md](references/bdd-quality-rules.md) for anti-pattern detection, rewrite heuristics, and quality checks.62- Read [references/feature-and-scenario-protocol.md](references/feature-and-scenario-protocol.md) for `Feature:`, `Rule:`, `Background:`, `Scenario Outline`, tags, naming, and path coverage guidance.63- Read [references/report-rubric.md](references/report-rubric.md) when the user asks for a score, executive summary, or formal report.64- Read [references/output-contracts.md](references/output-contracts.md) when the response needs a more explicit structure than the default flow.6566## 4. Apply the universal guardrails6768Treat BDD as business-readable behavioral specification.6970Always:7172- prefer business behavior over UI choreography73- keep one behavior path per scenario74- keep one main event in `When`75- make `Then` externally observable76- keep `Given` minimal but sufficient77- use concrete domain examples when the source supports them78- flag blocked decisions instead of smoothing them over79- keep traceability explicit when the source provides it8081Do not:8283- turn Gherkin into test-script narration84- mix unrelated rule branches in one scenario85- fabricate metadata to make the artifact look complete86- overstate confidence when the oracle is weak87- add implementation details unless the user explicitly needs them and the behavior cannot be understood without them8889## 5. Run `review` mode9091In `review` mode:92931. assess artifact intent and scope942. assess traceability to the source of truth953. assess scenario architecture, naming, grouping, and duplication964. assess path coverage:97 - main path98 - alternate path99 - error path100 - persona, permission, boundary, or lifecycle coverage when relevant1015. assess BDD quality:102 - business language103 - observable outcomes104 - concrete examples105 - absence of UI scripting106 - absence of mixed branches1076. rank findings as `Critical`, `Major`, or `Minor`108109Default to findings-first output.110111If the artifact is strong, say `No material defects identified` instead of inventing weak findings.112113## 6. Run `rewrite` mode114115In `rewrite` mode:1161171. preserve business intent1182. improve titles so they describe the condition and the outcome1193. split overloaded scenarios into one behavior path per scenario1204. replace UI steps with business behavior unless the UI interaction is itself the rule under test1215. replace vague outcomes with externally visible outcomes1226. replace generic placeholders with realistic examples when the source supports them1237. keep unsupported metadata as an explicit gap rather than inventing it124125Use [assets/bdd-feature-template.feature](assets/bdd-feature-template.feature) when the user asks for a full feature file.126127## 7. Run `generate` mode128129In `generate` mode:1301311. start from rules, decisions, and examples rather than automation steps1322. draft a feature narrative only when the source supports it1333. map the rule space into main, alternate, and error behavior where supported1344. generate one scenario per behavior path or rule branch1355. prefer concrete roles, dates, states, amounts, and domain language1366. stop and mark the gap when the source is too incomplete for reliable generation137138If the source is partial but still usable, generate only the supported behaviors and list the unresolved gaps separately.139140## 8. Run `hybrid` mode141142In `hybrid` mode:1431441. keep the findings section short and focused on the most material issues1452. provide the improved artifact immediately after the findings1463. keep unresolved assumptions or blocked decisions explicit147148Use `hybrid` instead of forcing the user to choose between critique and a useful replacement.149150## 9. Use the correct response contract151152Use the default response shape below unless the user explicitly asks for a formal report.153154- `review`: mode, oracle used, confidence, severity-ranked findings, coverage and traceability notes, top recommendations155- `rewrite`: mode, rewrite strategy, revised artifact, open assumptions156- `generate`: mode, source inputs, generated artifact, assumptions and gaps157- `hybrid`: mode, oracle used, oracle sufficiency, confidence, key findings, rewritten artifact, open assumptions158159Read [references/output-contracts.md](references/output-contracts.md) when a stricter structure is needed.160161If the user explicitly asks for a formal review report, scorecard, or executive summary:162163- use [references/report-rubric.md](references/report-rubric.md)164- use [assets/review-report-template.md](assets/review-report-template.md)165166## 10. Keep memory scoped and explicit167168Use memory deliberately:169170- runtime memory: working notes and judgments for the current task only171- project-local persistent memory: create only when the user explicitly asks for a saved checklist, report, or review ledger172- shared memory: treat as an external integration boundary and use only when the host workflow explicitly provides it173174Do not automatically promote runtime observations into project-local or shared memory.175176## 11. Handle failure cases cleanly177178When the task is under-specified, degrade gracefully:179180- weak oracle: review structure and BDD quality, but lower confidence and avoid correctness claims181- mixed behaviors in one scenario: split them and explain why182- vague outcomes: replace them with observable results or flag the missing business outcome183- excessive feature scope: recommend splitting by capability, rule set, persona, or lifecycle phase184- missing metadata: keep the gap explicit instead of fabricating tags or IDs185186## 12. Follow the bundled examples187188Use the examples under `examples/` to stay consistent with the repository's intended style.189190- [examples/review-request.md](examples/review-request.md)191- [examples/rewrite-request.md](examples/rewrite-request.md)192- [examples/formal-report-request.md](examples/formal-report-request.md)193- [examples/generation-source.md](examples/generation-source.md)194- [examples/quality-ladder.md](examples/quality-ladder.md)195196## 13. Gotchas197198Avoid these common mistakes while using this skill:199200- **The "Automation Handoff" Trap**: Do not suggest framework-specific code (Cucumber, Playwright, etc.) unless explicitly requested. This skill is for _business-readable BDD_, not test automation scripts.201- **The "Hallucination" Pitfall**: Do not invent requirement IDs, personas, or business rules that are not in the source material. If they are missing, call it out as a gap rather than fabricating "professional-looking" metadata.202- **The "Over-Correction" Bias**: If the user provides a well-structured artifact, do not invent findings just to have something to say. Say "No material defects identified" and focus on refinement instead.203- **The "Missing Context" Blind Spot**: Do not assume a scenario is correct just because it is well-written. Always verify it against the strongest available oracle.204- **The "Scope Creep" Drift**: Do not try to solve or generate an entire feature if the user only asked for a review of specific scenarios or rules. Focus on the requested scope.205206## 14. Resource map207208- Intake and mode selection: [references/intake-and-decision-flow.md](references/intake-and-decision-flow.md)209- Formal review sequence: [references/review-workflow.md](references/review-workflow.md)210- Quality heuristics: [references/bdd-quality-rules.md](references/bdd-quality-rules.md)211- Structure protocol: [references/feature-and-scenario-protocol.md](references/feature-and-scenario-protocol.md)212- Report rubric: [references/report-rubric.md](references/report-rubric.md)213- Response contracts: [references/output-contracts.md](references/output-contracts.md)214- Feature template: [assets/bdd-feature-template.feature](assets/bdd-feature-template.feature)215- Formal report template: [assets/review-report-template.md](assets/review-report-template.md)