Skip to content

PranavNagrecha/AwesomeSalesforceSkills / skills/admin/acceptance-criteria-given-when-then

acceptance-criteria-given-when-then

Verified

Use this skill when writing test-first, behavior-driven acceptance criteria in Given/When/Then format for a Salesforce user story. Covers happy path, edge cases, negative paths, permission boundaries, and data-state preconditions so the AC block can drive UAT scripts and Apex test design downstream. Trigger keywords: given when then, gherkin, behavior driven AC, test first acceptance criteria, scenario outline, BDD acceptance criteria. NOT for the user-story format itself (use admin/user-story-writing-for-salesforce). NOT for UAT script writing (use admin/uat-test-case-design). NOT for Apex test method generation (use agents/test-class-generator). NOT for high-level UAT planning (use admin/uat-and-acceptance-criteria). More triggers: acceptance criteria record, ac_id, req_id on a criterion, artefact under test, negative case for a rule-type requirement, no-match fall-through criterion, oracle for a Then clause, test type apex flow manual, criteria linter, check_ac_format.py, --manifest-dir.

templates/acceptance-criteria-given-when-then-template.md

View on GitHub
# Acceptance Criteria — Given/When/Then Work Template

Use this template when activating the `acceptance-criteria-given-when-then`
skill on a new or existing user story.

## Scope

**Skill:** `acceptance-criteria-given-when-then`

**Request summary:** (fill in what the user asked for — typically "write
behavior-driven AC for story X")

**Story under work:** (paste the As a / I want / So that wrapper)

## Context Gathered

Record answers to the Before Starting questions from `SKILL.md`:

- **Persona / profile / PSG:**
- **Target object(s):**
- **Sharing-relevant? OWD?** (Private / Public RO / Public RW / Controlled by Parent)
- **Single-record or bulk path expected?**
- **Async / callout / integration boundary?**
- **Known constraints (governor limits, integration peer system, license tier):**

## Approach

Which patterns from `SKILL.md` apply?

- [ ] Background block with named users + PSGs (always when sharing-relevant)
- [ ] Happy-path Scenario(s)
- [ ] Paired negative-path Scenario(s)
- [ ] Scenario Outline with Examples (when 3+ parameterized cases)
- [ ] Bulk Scenario (when trigger / flow / validation)
- [ ] `Then eventually` async Scenario (when callout / Queueable / PE / batch)

## Output

Use `templates/ac-template.md` (sibling file) as the canonical skeleton.
Paste the filled-in AC block into the user story body, then run:

```bash
python3 scripts/check_ac_format.py --file <story.md>
```

## Checklist

Copy the Review Checklist from `SKILL.md` and tick items as you complete
them. Do not hand off to `agents/test-class-generator` until all items are
ticked.

- [ ] Every Scenario has exactly one Given, one When, one Then
- [ ] Every happy-path has a paired negative-path
- [ ] Every Scenario names the running user by PSG / profile
- [ ] Record ownership / lifecycle precondition is explicit
- [ ] No UI-chrome language
- [ ] Bulk Scenario present (when applicable)
- [ ] Async outcomes use "eventually within N seconds"
- [ ] Validation-error messages are exact strings (or marked `# TBD`)
- [ ] Integration expectations name the named credential
- [ ] Every criterion has a `req_id`, persona, sandbox, artefact and `proof`
- [ ] Every rule-type requirement has a `negative: true` no-match criterion
- [ ] `check_ac_format.py --file <record>` reports 0 errors

## Notes

Record any deviations from the standard pattern and why.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 323kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 323kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 323kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall