Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

user-story用户故事

Agent Skill

user-story 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

33,719

周安装

1,410

GitHub Stars

3,872

下载量

11,535
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:user-story(用户故事)
来源仓库:https://github.com/deanpeters/product-manager-skills
仓库路径:skills/user-story
安装命令:
npx skills add https://github.com/deanpeters/product-manager-skills --skill user-story
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/deanpeters/product-manager-skills --skill user-story

简介

使用 Mike Cohn 格式和 Gherkin 验收标准将用户需求转化为可开发的故事。

  • 将“作为/我想要/因此”用户故事结构与“给定/何时/那么”验收标准相结合,以实现可测试、以结果为中心的工作
  • 包括质量检查和反模式,以避免通用角色、模糊结果和范围蔓延
  • 专为待办事项整理、冲刺计划以及产品、工程和 QA 之间的共享理解而设计
  • 强调故事是对话的开端,而不是锁定的合同;包括有关何时拆分超大故事的指导

SKILL.md

Purpose

Create clear, concise user stories that combine Mike Cohn's user story format with Gherkin-style acceptance criteria. Use this to translate user needs into actionable development work that focuses on outcomes, ensures shared understanding between product and engineering, and provides testable success criteria.

This is not a feature spec—it's a conversation starter that captures *who* benefits, *what* they're trying to do, *why* it matters, and *how* you'll know it works.

Key Concepts

The Mike Cohn + Gherkin Format

A user story combines:

Use Case (Mike Cohn format):

  • As a [user persona/role]
  • I want to [action to achieve outcome]
  • so that [desired outcome]

Acceptance Criteria (Gherkin format):

  • Scenario: [Brief description of the scenario]
  • Given: [Initial context or preconditions]
  • and Given: [Additional preconditions]
  • When: [Event that triggers the action]
  • Then: [Expected outcome]

Why This Structure Works

  • User-centric: Forces focus on who benefits and why
  • Outcome-focused: "So that" emphasizes the value delivered, not just the action
  • Testable: Gherkin acceptance criteria are concrete and verifiable
  • Conversational: Story is the opening for discussion, not the final spec
  • Shared language: Product, engineering, and QA all understand the format

Anti-Patterns (What This Is NOT)

  • Not a task: "As a developer, I want to refactor the database" (this is a tech task, not user value)
  • Not a feature list: "I want dashboards, reports, and analytics" (this is too big—needs splitting)
  • Not vague: "I want a better experience" (unmeasurable, no clear outcome)
  • Not a contract: Stories are placeholders for conversation, not locked-in specs

When to Use This

  • Translating user needs into development work
  • Backlog grooming and sprint planning
  • Communicating value to engineering and design
  • Ensuring testable acceptance criteria exist before development

When NOT to Use This

  • For pure technical debt or refactoring (use engineering tasks instead)
  • When stories are too large (split first—see skills/user-story-splitting/SKILL.md)
  • Before understanding the user problem (write a problem statement first)

Application

Step 1: Gather Context

Before writing a story, ensure you have:

  • User persona: Who is this for? (reference skills/proto-persona/SKILL.md)
  • Problem understanding: What need does this address? (reference skills/problem-statement/SKILL.md)
  • Desired outcome: What does success look like?
  • Constraints: Technical, time, or scope limitations

If missing context: Run discovery interviews or problem validation work first.


Optional Helper Script (Template Generator)

If you want a consistent Markdown stub, you can generate one from CLI inputs. This script is deterministic and does not fetch data or write files.

python3 scripts/user-story-template.py --persona \"trial user\" --action \"log in with Google\" --outcome \"access the app without creating a new password\"

Step 2: Write the Use Case

Use template.md for the full fill-in structure.

Fill in the template:

### User Story [ID]:

- **Summary:** [Brief, memorable title focused on value to the user]

#### Use Case:
- **As a** [user name if available, otherwise persona, otherwise role]
- **I want to** [action user takes to get to outcome]
- **so that** [desired outcome]

Quality checks:

  • "As a" specificity: Is this a specific persona (e.g., "trial user") or generic ("user")?
  • "I want to" clarity: Is this an action the user takes, or a feature you're building?
  • "So that" outcome: Does this explain the user's motivation? Or is it just restating the action?

Common mistakes:

  • ❌ "As a user, I want a login button, so that I can log in" (restating the action)
  • ✅ "As a trial user, I want to log in with Google, so that I can access the app without creating a new password"

Step 3: Write the Acceptance Criteria

Fill in the template:

#### Acceptance Criteria:

- **Scenario:** [Brief, human-readable scenario describing value]
- **Given:** [Initial context or precondition]
- **and Given:** [Additional context or preconditions]
- **and Given:** [Additional context as needed]
- **and Given:** [UI-focused context ensuring 'When' can happen]
- **and Given:** [Outcomes-focused context ensuring 'Then' is delivered]
- **When:** [Event that triggers the action—aligns with 'I want to']
- **Then:** [Expected outcome—aligns with 'so that']

Quality checks:

  • Multiple Givens are okay: Preconditions stack up (e.g., "Given I'm logged in" + "Given I have items in my cart")
  • Only one When: If you need multiple "When" statements, you likely have multiple stories—split them
  • Only one Then: If you need multiple "Then" statements, you likely have multiple stories—split them
  • Alignment: Does "When" match "I want to"? Does "Then" match "so that"?

Red flags:

  • Multiple Whens/Thens: Sign of scope creep—split the story (reference skills/user-story-splitting/SKILL.md)
  • Vague Thens: "Then I see improved performance" (unmeasurable—make it specific)

Step 4: Add a Summary

Write a short, memorable summary that captures the story's value:

- **Summary:** [Brief, human-readable title]

Examples:

  • ✅ "Enable Google login for trial users to reduce signup friction"
  • ✅ "Bulk delete items to save time for power users"
  • ❌ "Add delete button" (feature-centric, not value-centric)

Step 5: Validate and Refine

  • Read aloud to the team: Does everyone understand who, what, why?
  • Test acceptance criteria: Can QA write test cases from this?
  • Check for splitting: If the story feels too big, use skills/user-story-splitting/SKILL.md
  • Ensure testability: Can you prove "Then" happened?

Examples

See examples/sample.md for full examples (good, bad, and split-needed stories).

Mini example excerpt:

### User Story 042:

- **Summary:** Enable Google login for trial users to reduce signup friction

#### Use Case:
- **As a** trial user visiting the app for the first time
- **I want to** log in using my Google account
- **so that** I can access the app without creating and remembering a new password

#### Acceptance Criteria:
- **Scenario:** First-time trial user logs in via Google OAuth
- **Given:** I am on the login page
- **and Given:** I have a login account
- **When:** I click the "Sign in with Google" button and authorize the app
- **Then:** I am logged into the app and redirected to the onboarding flow

Common Pitfalls

Pitfall 1: Technical Tasks Disguised as User Stories

Symptom: "As a developer, I want to refactor the API, so that the code is cleaner"

Consequence: This is an engineering task, not a user story. No user value is delivered.

Fix: If there's no user outcome, it's not a user story—use an engineering task or tech debt ticket instead.


Pitfall 2: "As a User" (Too Generic)

Symptom: Every story starts with "As a user"

Consequence: No persona clarity. Different users have different needs.

Fix: Use specific personas: "As a trial user," "As a paid subscriber," "As an admin," etc. (reference skills/proto-persona/SKILL.md)


Pitfall 3: "So That" Restates "I Want To"

Symptom: "I want to click the save button, so that I can save my work"

Consequence: No insight into *why* the user cares. Just restating the action.

Fix: Dig into the motivation: "so that I don't lose my progress if the page crashes" (real outcome).


Pitfall 4: Multiple When/Then Statements

Symptom: Acceptance criteria with 5 "When" statements and 5 "Then" statements

Consequence: Story is too big. Likely multiple features bundled together.

Fix: Split the story using skills/user-story-splitting/SKILL.md. Each When/Then pair should be its own story (or at least evaluated for splitting).


Pitfall 5: Untestable Acceptance Criteria

Symptom: "Then the user has a better experience" or "Then it's faster"

Consequence: QA can't verify success. Ambiguous definition of "done."

Fix: Make it measurable: "Then the page loads in under 2 seconds" or "Then the user sees a success confirmation message."


References

Related Skills

  • skills/user-story-splitting/SKILL.md — How to break large stories into smaller ones
  • skills/proto-persona/SKILL.md — Defines the "As a [persona]" section
  • skills/problem-statement/SKILL.md — Stories should address validated problems
  • skills/epic-hypothesis/SKILL.md — Epics decompose into user stories

Optional Helpers

  • skills/user-story/scripts/user-story-template.py — Deterministic Markdown stub generator (no network access)

External Frameworks

  • Mike Cohn, *User Stories Applied* (2004) — Origin of the "As a / I want / so that" format
  • Gherkin (Cucumber) — "Given/When/Then" acceptance criteria format
  • INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable)

Dean's Work

  • [Link to relevant Dean Peters' Substack articles if applicable]

Provenance

  • Adapted from prompts/user-story-prompt-template.md in the https://github.com/deanpeters/product-manager-prompts repo.

Skill type: Component Suggested filename: user-story.md Suggested placement: /skills/components/ Dependencies: References skills/proto-persona/SKILL.md, skills/problem-statement/SKILL.md Used by: skills/user-story-splitting/SKILL.md, skills/epic-hypothesis/SKILL.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.68%
按下载量换算3,885

Claude

31.17%
按下载量换算3,595

Cursor

17.16%
按下载量换算1,979

Gemini CLI

8.22%
按下载量换算948

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills