一键导入
write-user-story
Create a well-structured user story with acceptance criteria, following project conventions and issue templates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a well-structured user story with acceptance criteria, following project conventions and issue templates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create a user journey map documenting the end-to-end experience of a user accomplishing a goal
Create a service blueprint documenting frontstage and backstage processes that deliver a service experience
Introspect on a completed work session to propose and apply improvements to documentation, agent guidance, and repo quality
基于 SOC 职业分类
| name | write-user-story |
| description | Create a well-structured user story with acceptance criteria, following project conventions and issue templates |
| inputs | [{"name":"feature_description","description":"Brief description of what the user wants to accomplish","required":true},{"name":"user_role","description":"The type of user (e.g., \"admin\", \"developer\", \"end user\")","required":false}] |
| outputs | [{"name":"user_story","description":"Complete user story with title, description, and acceptance criteria"}] |
Guide the creation of consistent, actionable user stories that follow project conventions and leverage existing issue templates when available.
Search the repository for issue templates in common locations:
Primary locations to check:
.github/ISSUE_TEMPLATE/ directory (YAML or Markdown templates).github/ISSUE_TEMPLATE.md (single template file)docs/ISSUE_TEMPLATE.md (alternative location)What to look for:
| File Pattern | Purpose |
|---|---|
feature_request.yml or feature_request.md | Use as primary structure basis |
bug_report.yml or bug_report.md | Note fields for cross-referencing |
config.yml | Check for blank issue restrictions or external links |
Custom templates (e.g., user_story.yml) | Follow established team conventions |
If templates exist:
If no templates exist:
Collect the essential elements:
| Component | Question to Answer |
|---|---|
| User Role | Who is the user? Be specific (not just "user") |
| Goal | What does the user want to do? |
| Benefit | Why does the user want this? What value does it provide? |
| Context | What triggers this need? When would this be used? |
Write using the standard format:
## User Story
**As a** [specific user role],
**I want** [goal/desire],
**So that** [benefit/value].
Write testable, specific acceptance criteria using Given/When/Then:
## Acceptance Criteria
### Scenario: [descriptive name]
- **Given** [precondition/context]
- **When** [action taken]
- **Then** [expected outcome]
Include criteria for:
Include additional sections as needed:
## Technical Notes
- Dependencies: [related systems, APIs, services]
- Constraints: [technical limitations, regulatory requirements]
## Out of Scope
- [Explicitly list what this story does NOT include]
## Related
- Relates to #[issue number]
- Blocked by #[issue number]
- Part of Epic: [epic name/link]
Before finalizing, verify the story meets INVEST criteria:
| Criterion | Check |
|---|---|
| Independent | Can be developed without depending on other stories |
| Negotiable | Details can be discussed and refined |
| Valuable | Delivers value to the user or business |
| Estimable | Team can estimate the effort required |
| Small | Can be completed in one sprint/iteration |
| Testable | Acceptance criteria are verifiable |
If an issue template was found in step 1:
If no template exists:
## User Story
**As a** system administrator,
**I want** to receive email notifications when user accounts are locked,
**So that** I can proactively assist users and identify potential security issues.
## Acceptance Criteria
### Scenario: Account locked due to failed login attempts
- **Given** a user account exists in the system
- **When** the account is locked after 5 failed login attempts
- **Then** an email is sent to all system administrators within 1 minute
### Scenario: Email contains relevant details
- **Given** an account lock notification is triggered
- **When** the email is sent
- **Then** it includes: username, timestamp, IP address of attempts, and unlock link
### Scenario: Administrator is unavailable
- **Given** no administrator acknowledges the notification within 1 hour
- **When** the escalation timer expires
- **Then** the notification is escalated to the security team
## Technical Notes
- Integrates with existing email service (SendGrid)
- Must respect user notification preferences
- Audit log entry required for compliance
## Out of Scope
- Self-service account unlock (separate story)
- SMS notifications (future enhancement)
## Related
- Part of Epic: Account Security Improvements
- Relates to #142 (Audit logging)
## User Story
As a user, I want better notifications so that I know what's happening.
## Acceptance Criteria
- Notifications work
- Users are happy
Why this is poor: Vague user role, unclear goal, unmeasurable criteria.