agentleFS
EnigmaWUEnigmaWU/MyCodeAgentSkills/write-user-story/SKILL.md

write-user-story

Skill4 starsChanged 3 months agoMITView on GitHub

WHEN/WHERE/WHO: [Scheduling: Developers, product owners, or agents formalizing requirements into backlog items.] HOW: [Structural: Use this SKILL to write User Stories backed strictly by BDD "Given/When/Then" executable specifications.] WHY: [Scheduling: Vague stories lead to misunderstandings. BDD-style criteria make expected behavior explicit and testable.]

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 13 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When this skill is activated, first load skill-common and apply the shared conventions it defines: canonical section order, frontmatter …

    line 13
  2. Distinctive:

    Transfer Check: Verify the workflow still works for greenfield feature stories and refinements of partially defined backlog items.

    line 49
  3. Distinctive:

    Stop Rule: If the request has no observable business behavior, stop and tell the user it is not a valid user-story candidate.

    line 50
  4. Very specific:

    Primary Story Format: Use the traditional As a <role>, I want <capability>, So that <value> format by default.

    line 55
  5. Distinctive:

    Keep scenarios atomic: one behavior per scenario.

    line 57
  6. Distinctive:

    Keep examples concrete, realistic, and domain-readable.

    line 58
  7. Very specific:

    Do not couple Then clauses to implementation details, APIs, or database internals.

    line 59
  8. Distinctive:

    If the input is purely a technical chore (e.g., "Update dependency X to version Y") with no observable business behavior, stop and inform …

    line 62
  9. Distinctive:

    If any of these are missing or vague, ask the user before continuing.

    line 67
  10. Distinctive:

    Ensure scenarios are declarative (focusing on business intent) rather than imperative (focusing on UI clicks and keystrokes).

    line 80
  11. Very specific:

    Use realistic example values and explicit expected outcomes in Then.

    line 81
  12. Very specific:

    Remove ambiguous words from Then clauses (for example: fast, robust, seamless) unless quantified.

    line 84
  13. Distinctive:

    Verify each scenario tests one behavior and has clear pass/fail observables.

    line 85
  14. Distinctive:

    Add a brief ambiguity/risk note for unresolved business decisions.

    line 86
  15. Distinctive:

    Verify that every scenario has at least one Given, one When, and one Then.

    line 102
  16. Distinctive:

    Verify that the story includes a clear business value statement.

    line 103
  17. Distinctive:

    Verify at least one error/edge path exists and is behavior-focused.

    line 104
  18. Very specific:

    Verify all Then clauses are concrete and testable without implementation coupling.

    line 105

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Write User Story in BDD Style

Common Contract (Load First)

When this skill is activated, first load skill-common and apply the shared conventions it defines: canonical section order, frontmatter rules, anti-pattern guidance, and the Review In Mind loop in review-in-mind. This skill adds only domain-specific rules below.

Who

Developers, product owners, business analysts, or AI Agents. The agent uses this skill to produce well-structured user stories with BDD-style acceptance criteria.

What

Generate a user story that focuses on business value and testability. The output is a self-contained story package: story statement, executable BDD criteria, concrete business examples, and ambiguity/risk notes ready for backlog refinement.

When

Invoke this skill when asked to write, create, or draft a user story, or when asked for BDD-style acceptance criteria based on a feature description.

Where

Applies to product requirements, feature descriptions, and backlog items (e.g., JIRA, markdown files).

Why

BDD-style acceptance criteria make expected behavior explicit, testable, and unambiguous. Consistent story format reduces back-and-forth between product and engineering, and Given/When/Then maps directly to automated acceptance tests.

Inputs

  • Feature description (required): What the user wants to build.
  • Business goal / expected outcome (required): Why this feature should exist and what measurable behavior change is expected.
  • Role/persona (optional): Who the end-user is.
  • Business value (optional): Why this feature matters.
  • Edge cases (optional): Known constraints or error paths.

Output (Logical Evidence)

  • A User Story formatted using the standard templates.
  • Executable BDD criteria with at least one happy path and one error/edge path.
  • A compact example set with realistic domain data.
  • A short ambiguity/risk list for unresolved decisions.

Optimization Readiness

  • Failure Signals: The story collapses into a technical task, scenarios focus on UI clicks instead of business behavior, acceptance criteria are not executable, or realistic examples are replaced with vague placeholders.
  • Evidence To Collect: Story drafts, BDD scenarios, example sets, ambiguity lists, and reviewer feedback on whether the story drives implementation and testing cleanly.
  • Safe Mutation Boundaries: Refine story phrasing, scenario-shaping prompts, example guidance, and ambiguity-reporting rules without changing the core business-goal-first and BDD-first structure.
  • Acceptance Criteria: Accept revisions only if the story ties capability to business value, includes executable Given/When/Then criteria, covers both success and edge behavior, and avoids implementation-coupled Then clauses.
  • Rejected Revision Handling: Record technical-chore stories, UI-script scenarios, and placeholder-heavy example patterns so they are not reused blindly.
  • Transfer Check: Verify the workflow still works for greenfield feature stories and refinements of partially defined backlog items.
  • Stop Rule: If the request has no observable business behavior, stop and tell the user it is not a valid user-story candidate.

Constraints (Logical Boundaries)

  • RULE 1: BDD Executable Specifications First. The absolute most important part of the story is the Acceptance Criteria. They MUST be written as strict BDD Given/When/Then scenarios that can be directly translated into automated tests (e.g., Cucumber).
  • RULE 2: Goal Before Detail. Derive scenario scope from business outcome first. Do not start from UI click paths.
  • Primary Story Format: Use the traditional As a <role>, I want <capability>, So that <value> format by default.
  • Advisory Story Format: You may optionally suggest the In order to <value>, As a <role>, I want <capability> format if the business goal seems to be getting lost in the technical details.
  • Keep scenarios atomic: one behavior per scenario. Do not write "end-to-end test scripts" disguised as scenarios.
  • Keep examples concrete, realistic, and domain-readable; avoid placeholders that hide rules.
  • Do not couple Then clauses to implementation details, APIs, or database internals.

One More Thing

If the input is purely a technical chore (e.g., "Update dependency X to version Y") with no observable business behavior, stop and inform the user that BDD User Stories are for functional requirements, not technical debt.

How (Structural Workflow)

Phase 1: Gather Context

  1. Identify the role (who), the capability (what), and the business value (why).
  2. If any of these are missing or vague, ask the user before continuing.
  3. Confirm the expected business outcome and scope boundary before drafting scenarios.

Phase 2: Write the Story Statement

  1. Compose the Primary Story statement (As a... I want... So that...).

Phase 3: Identify Scenarios

  1. Extract the happy path first — the main success flow.
  2. Identify alternate paths — valid variations of the input or context.
  3. Identify error or edge-case paths — invalid input, missing data, permission failures, timeouts, etc.

Phase 4: Write BDD Acceptance Criteria

  1. For each scenario, write the executable specifications using Given / When / Then.
  2. Ensure scenarios are declarative (focusing on business intent) rather than imperative (focusing on UI clicks and keystrokes).
  3. Use realistic example values and explicit expected outcomes in Then.

Phase 5: Refine for Specification Quality

  1. Remove ambiguous words from Then clauses (for example: fast, robust, seamless) unless quantified.
  2. Verify each scenario tests one behavior and has clear pass/fail observables.
  3. Add a brief ambiguity/risk note for unresolved business decisions.

Resources

  • BDD Story Format
  • Specification by Example Enhancements

Review In Mind (ReviewInMindGenie)

Execute the common review loop in review-in-mind before delivering.

Review lens for this skill:

  • Does the story state role, capability, and business value with executable Given/When/Then scenarios?
  • Is there at least one error/edge path with concrete examples and no implementation-coupled Then clauses?
  • Would a skeptical PO/QA accept it as testable without further clarification?

Validation

  1. Verify that every scenario has at least one Given, one When, and one Then.
  2. Verify that the story includes a clear business value statement.
  3. Verify at least one error/edge path exists and is behavior-focused.
  4. Verify all Then clauses are concrete and testable without implementation coupling.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.