name: lidr-user-stories
id: user-stories
version: "2.5.0"
last_updated: "2026-06-11"
updated_by: "TL: BMad-seam visibility"
status: active
phase: 3
stage: sprint-planning
owner_role: "PO"
automation: true
domain_agnostic: true
language_default: en
integrations: [tracking]
description: >
π€ AUTOMATED User Story generation with intelligent RF slicing using 8 proven slicing patterns and INVEST validation.
Domain-agnostic β works for any software system, platform, or project methodology.
Use for transforming RFs into sprint-ready backlog with capacity management and dependency detection.
Essential after Gate 2: converts validated requirements into implementable user stories for Sprint Planning.
Always use when RFs are approved and Sprint Planning begins, always use when transforming requirements into actionable development tasks.
Do NOT use for requirements generation (use lidr-requirements per-rf mode), for epic decomposition (use bmad-create-epics-and-stories), or for test case creation (use create-test-cases).
Triggers on "automated user stories", "RF slicing", "sprint backlog generation", "INVEST validation", "story capacity planning", "requirements to stories".
Content authored in English; artifact language follows the client language setting (see _shared/lidr/integrations/). BDD scenarios (Given/When/Then) stay in English; exported for the bound {{TRACKING_TOOL}}.
Audience: PO (validates stories), SM (plans capacity), Dev (implements stories).
User Story Generator
Phase: 3 β Solutioning Β· sprint-planning (ex-Fase 4) (feeds G3 evidence) | Content authored in English; artifact language follows the client language setting (see _shared/lidr/integrations/). BDD scenarios stay in English.
Tools resolve via the central registry _shared/lidr/integrations/tool-registry.yaml; the active client binds concrete tools in clients/<CODE>.yaml.
Relationship to BMad
LIDR-unique PO artifact. BMad's bmad-create-epics-and-stories decomposes the validated requirements into the epic structure, and bmad-create-story / bmad-dev-story then turn a backlog item into a dev-agent story file (implementation-context fodder). This skill fills the gap between them: it slices the BDD-bearing RFs authored by lidr-requirements (per-rf mode) (within that epic structure) into INVEST, story-pointed, tracking-tool-ready user stories for the PO backlog (CSV export to {{TRACKING_TOOL}}) β the artifact BMad's dev-facing stories deliberately are not (per _shared/lidr/MIGRATION.md: "BMad stories are dev-agent fodder, not Jira-ready PO artifacts"). Consumes the RFs from lidr-requirements (per-rf mode) within the epics from bmad-create-epics-and-stories; feeds bmad-create-story (which re-contextualizes each US for the dev agent) and the Gate 3 DoR grooming step (lidr-refinement-notes).
Automated Workflow (NEW)
Phase 1: RF Analysis and Intelligent Slicing (Automated)
- Execute RF Slicer:
scripts/rf-slicer.pyauto-loads approved RFs from lidr-requirements outputs - Complexity Analysis: Auto-estimates RF hours based on BDD scenarios, acceptance criteria, and domain factors
- Slicing Strategy Selection: Applies 8 proven slicing patterns (Vertical Path, Workflow Steps, CRUD, User Roles, etc.)
- INVEST Validation: Automated validation against Independent, Negotiable, Valuable, Estimable, Small, Testable criteria
- Capacity Management: Auto-allocates within sprint capacity (minus tech debt allocation)
Phase 2: User Story Generation (Automated)
- BDD Scenario Adaptation: Inherits and refines BDD scenarios from RFs for each story slice
- Dependency Detection: Auto-maps RF dependencies to User Story dependencies
- Story Point Estimation: Converts hour estimates to Fibonacci story points automatically
- DoD Integration: Auto-applies standard DoD plus RF-specific criteria
- {{TRACKING_TOOL}} Export: Generates CSV format for seamless {{TRACKING_TOOL}} import
Phase 3: Sprint Planning (Human Review)
- Review Generated Backlog: Validate automated story slicing and prioritization
- Capacity Validation: Confirm stories fit within sprint capacity
- Assignment Planning: Assign stories to developers based on skills and availability
- Sprint Goal Alignment: Ensure stories support sprint goal
Legacy Manual Workflow (Fallback)
If automation fails, use original manual process:
- Manual RF reading and complexity assessment (1-2 hours)
- Manual sizing and slicing decisions (1-2 hours)
- Manual User Story writing with BDD (2-4 hours)
- Manual INVEST validation (30 minutes)
- Manual capacity planning and backlog preparation (30 minutes)
Input
| Input | Required | Source | Automated Processing |
|---|---|---|---|
| Approved RFs with BDD | β | skill lidr-requirements/ + Gate 2 |
β
rf-slicer.py auto-loads from outputs/ |
| Sprint Capacity (hours) | β | SM (ceremonies, vacations, buffer deducted) | β Auto-allocates feature vs debt capacity |
| Tech Debt Percentage | β | Standard 15-20% or custom | β Auto-calculates remaining feature capacity |
| Sprint Goal | Desirable | PO + team | β οΈ Manual validation against generated stories |
| DoR checklist | β | @../refinement-notes/checklists/dor.md | β Automated INVEST + DoR validation |
| Project Configuration | Desirable | Repository | β Auto-discovery of project patterns |
Output Location
Generated documents should be saved to: docs/projects/{projectName}/user-stories.md
Contains sprint-ready user stories with BDD scenarios and {{TRACKING_TOOL}}-ready format.
Example: docs/projects/identity-sdk-v3/user-stories.md
Automation Scripts
scripts/rf-slicer.py β Intelligent RF Slicing and User Story Generation
Purpose: Automatically analyzes approved RFs and generates INVEST-compliant User Stories with optimal slicing.
Key Features:
- 8 Proven Slicing Patterns: Vertical Path, Workflow Steps, CRUD Operations, User Roles, Business Rules, Data Variations, Interface Complexity, Acceptance Criteria
- Domain-Specific Intelligence: Configurable domain knowledge (workflows, personas, compliance factors)
- Smart Complexity Analysis: Auto-estimates hours based on BDD scenarios, acceptance criteria, security/compliance factors
- INVEST Validation: Automated validation against all 6 INVEST criteria
- Capacity Management: Auto-fits stories within sprint capacity (excluding tech debt allocation)
- BDD Scenario Adaptation: Inherits RF scenarios and adapts for story slices
- Dependency Mapping: Analyzes RF dependencies and creates story dependency chains
Slicing Decision Matrix:
RF Hours | Size | Slicing Strategy | Typical Result
2-8h | S | No slicing | 1 User Story
8-24h | M | Vertical Path | 2 User Stories
24-40h | L | Smart Pattern | 3 User Stories
40+h | XL | Multi-Pattern | 4+ User Stories
Usage:
# Standard sprint planning mode
python scripts/rf-slicer.py \
--rf-dir .claude/skills/lidr-requirements/outputs \
--sprint-capacity 400 \
--debt-percentage 0.20 \
--verbose
# Custom project configuration
python scripts/rf-slicer.py \
--rf-dir path/to/approved/rfs \
--project-code "PROJ" \
--sprint-capacity 480 \
--debt-percentage 0.15 \
--output-dir sprint-backlog
Outputs:
user-stories-generated.md: Complete User Story backlog with BDD scenariosuser-stories-jira.csv: {{TRACKING_TOOL}}-ready import file with story points and labels (filename emitted by the script; Example tool: Jira)- Automatic INVEST compliance validation and slicing pattern reporting
Practical Implementation Instructions
Step 1: Verify Prerequisites
# Ensure approved RFs exist from Gate 2
ls .claude/skills/lidr-requirements/outputs/ # Should show RF-*.md files
# Verify RFs have BDD scenarios and are Gate 2 approved
grep -l "Scenario:" .claude/skills/lidr-requirements/outputs/*.md
Step 2: Execute Automated User Story Generation
# Navigate to user-stories skill directory
cd .claude/skills/user-stories
# Run automated RF slicing and story generation
python scripts/rf-slicer.py \
--rf-dir ../lidr-requirements/outputs \
--sprint-capacity 400 \
--debt-percentage 0.20 \
--project-code "PROJ" \
--output-dir sprint-backlog \
--verbose
# Expected output:
# π Sprint Planning:
# Total capacity: 400h
# Tech debt allocation: 80h (20%)
# Feature capacity: 320h
# Processing 12 RFs...
# π Slicing RF-PROJ-001: 28h β L using Vertical Path
# π Slicing RF-PROJ-002: 45h β XL using CRUD Operations
# β
Generated 23 User Stories:
# Must: 8 stories
# Should: 12 stories
# Could: 3 stories
# Total estimated: 315h / 320h capacity
Step 3: Review Generated User Stories
# Review generated backlog
open sprint-backlog/user-stories-generated.md
# Check the {{TRACKING_TOOL}} import file (filename emitted by the script)
head -5 sprint-backlog/user-stories-jira.csv
Step 4: Import to {{TRACKING_TOOL}} and Sprint Planning
# Import to the tracking tool (Example: Jira):
# 1. Tracking tool β Projects β Your Project β Issues
# 2. More β Import Issues from CSV
# 3. Select the generated CSV
# 4. Map fields: Summary, Story Points, Priority, Epic
# Review in Sprint Planning meeting
# - Validate story slicing makes sense
# - Confirm estimates with development team
# - Assign stories to developers
# - Verify dependencies are correct
Step 5: INVEST Validation (Automated + Human Review)
The automation performs INVEST validation automatically, but review these key points:
| INVEST Criterion | Automated Check | Human Review |
|---|---|---|
| Independent | β Dependency analysis | Verify business independence |
| Negotiable | β Story format validation | Confirm scope flexibility |
| Valuable | β Business value extraction | Validate real user value |
| Estimable | β Hour-to-story-point conversion | Team consensus on estimates |
| Small | β Auto-slicing for >40h RFs | Stories fit in sprint |
| Testable | β BDD scenario validation | Confirm testability with QA |
Automated Slicing Rules and Patterns
Intelligent Slicing Strategy Selection
| RF Content Analysis | Selected Pattern | Example Slicing |
|---|---|---|
| CRUD keywords detected | CRUD Operations | Create User β Read Profile β Update Data β Delete Account |
| Workflow/steps mentioned | Workflow Steps | Registration β Verification β Activation β Onboarding |
| Multiple personas identified | User Roles | Admin Stories β End User Stories β Auditor Stories |
| Complex business rules | Business Rules | Core Logic β Validation Rules β Edge Cases |
| Multiple acceptance criteria | Acceptance Criteria | Group 1-3 β Group 4-6 β Group 7-9 |
| Default (no patterns) | Vertical Path | Happy Path β Validations β Edge Cases |
Domain Complexity Intelligence
Domain Complexity Factors (auto-detected):
- automated recognition/matching: +4h base complexity
- audio/media processing: +4h base complexity
- Document/data extraction: +3h base complexity
- Security/Compliance: +3h base complexity
- Real-time Processing: +2h base complexity
- Integration APIs: +2h base complexity
Automatic Persona Detection:
end userβ End user storiesadministratorβ Admin configuration storiesoperatorβ Operator workflow storiesauditorβ Compliance and monitoring stories
Capacity Management Rules
Sprint Capacity: 400h (example)
βββ Tech Debt (20%): 80h β Reserved for tech-debt skill
βββ Ceremonies (5%): 20h β Stand-ups, retro, planning
βββ Buffer (10%): 40h β Unplanned work, support
βββ Feature Development: 260h β Available for User Stories
User Story Selection:
1. Must stories first (until capacity allows)
2. Should stories second (remaining capacity)
3. Could stories only if extra capacity
4. Auto-defer if stories exceed capacity
Automated Output Format
Generated User Story Structure
Auto-generated from RF-PROJ-001 (example):
### US-PROJ-003: Identity verification - Happy Path (Slice 1/3 - Vertical Path)
## Story
**As a** end user
**I want** to verify my identity (happy path)
**So that** I get secure access to the system
## Card
| Field | Value |
| ------------- | -------------- |
| **ID** | US-PROJ-003 |
| **Sprint** | Current Sprint |
| **RF Origin** | RF-PROJ-001 |
| **Priority** | Must |
| **Estimate** | 6-10h |
| **Status** | To Do |
## Acceptance Criteria (BDD)
### Scenario: Successful main flow
**Given** the user is authenticated
**And** the system is available
**When** they execute the main functionality
**Then** the system processes it correctly
**And** the expected result is shown
### Scenario: Successful verification
**Given** the user starts the verification process
**When** the system processes the request
**Then** the verification is completed correctly
**And** the identity is validated
**And** access to the system is granted
## Technical Notes
Integration with the system verification SDK. Consider environmental conditions and input quality.
## Definition of Done
- [ ] Code review approved (at least 1 peer + Tech Lead)
- [ ] Unit tests pass (coverage β₯ 80% in business logic)
- [ ] SAST/SCA clean (0 Critical/High vulnerabilities)
- [ ] PR description complete
- [ ] DevβQA handoff generated and attached to the ticket
- [ ] Documentation updated if applicable
- [ ] Security review approved by CISO
## Dependencies
RF-PROJ-002, RF-PROJ-005
## Subtasks
Not required
{{TRACKING_TOOL}} CSV Export Format
Auto-generated for import β Example (Jira):
Summary,Issue Type,Description,Acceptance Criteria,Story Points,Priority,Epic Link,Labels,Component/s,Custom Field (RF Origin),Reporter
"Identity verification - Happy Path",Story,"As a end user, I want to verify my identity (happy path) so that I get secure access to the system.
Estimate: 6-10 hours","Scenario: Successful main flow
Given the user is authenticated
When they execute the main functionality
Then the system processes it correctly
Scenario: Successful verification
Given the user starts the verification process
When the system processes the request
Then the verification is completed correctly",3,Must,"Feature Development","user-story,must,slice-1-of-3,vertical-path","User Stories","RF-PROJ-001","RF Slicer System"
Sprint Backlog Summary Report
Auto-generated planning overview:
# User Stories Sprint Backlog
**Generated**: 2026-03-09 16:15:30
**RFs Processed**: 12
**Stories Generated**: 23
## Summary by Priority
| Priority | Count | Total Hours | Avg Hours |
| ---------- | ----- | ----------- | --------- |
| **Must** | 8 | 156h | 19.5h |
| **Should** | 12 | 134h | 11.2h |
| **Could** | 3 | 25h | 8.3h |
## Slicing Analysis
| RF ID | Original Hours | Slicing Pattern | Stories Generated | Efficiency Gain |
| ----------- | -------------- | --------------- | ----------------- | ----------------------- |
| RF-PROJ-001 | 28h | Vertical Path | 3 stories | Deliverable in Sprint 1 |
| RF-PROJ-002 | 45h | CRUD Operations | 4 stories | Incremental value |
| RF-PROJ-003 | 12h | No slicing | 1 story | Sprint-ready |
## Capacity Validation β
- **Available Feature Capacity**: 320h
- **Generated Stories Total**: 315h
- **Utilization**: 98.4% (optimal)
- **Buffer Remaining**: 5h for scope adjustments
Enhanced Key Rules (Updated for Automation)
Automation-First Principles
- Automated slicing is authoritative β human override only for business context or team preferences
- INVEST validation is systematic β all 6 criteria checked automatically with human review for edge cases
- Capacity management is data-driven β stories automatically fit within sprint capacity minus debt allocation
- BDD scenarios are inherited intelligently β RF scenarios adapted automatically for story slice context
Quality Enforcement (Automated Validation)
- Story value must be real β automation detects and flags generic "so that I can do it" phrases
- BDD inherited and enhanced β RF Gherkin is refined per slice (happy path vs validations vs edge cases)
- Estimates as ranges β automation provides min-max ranges based on complexity analysis
- INVEST compliance mandatory β automated validation against all criteria with detailed reporting
- Slice coherence enforced β vertical slicing preferred, horizontal patterns only when justified
Business Rules (Automated Enforcement)
- No story >40h post-slicing β large RFs automatically sliced into <40h stories
- Dependency chain integrity β RF dependencies automatically mapped to story dependencies
- Sprint capacity respected β stories that exceed capacity are automatically deferred
- Tech debt integration β 15-20% capacity automatically reserved, remaining capacity for features
Process Integration
- {{TRACKING_TOOL}} readiness guaranteed β all generated stories include complete CSV import format
- DoD completeness β standard DoD automatically applied plus RF-specific criteria
- Story point calculation β hour estimates converted to Fibonacci scale automatically
- Priority assignment β Must/Should/Could assigned based on RF content analysis
ROI and Efficiency Gains
Time Savings Achieved
- Manual RF Slicing: 2-4 hours per large RF Γ complexity assessment + story writing
- Automated RF Slicing: < 5 minutes computer time + 30 minutes validation per sprint
- Manual INVEST Validation: 30-60 minutes per story Γ validation checks
- Automated INVEST Validation: Instant validation with detailed compliance reporting
- Net Savings Per Sprint: 6-12 hours depending on RF complexity
- Annual Impact: 80+ hours saved (assuming bi-weekly sprints)
Quality Improvements
- Consistency: 100% systematic application of slicing patterns and INVEST criteria
- Completeness: No missed acceptance criteria or BDD scenarios due to automation
- Traceability: Perfect RF β User Story mapping with dependency preservation
- Sprint Planning: Ready-to-import {{TRACKING_TOOL}} format eliminates manual story creation
- Capacity Accuracy: Data-driven capacity management prevents overcommitment
Team Productivity
- PO Focus: More time on backlog prioritization, less on story mechanics
- SM Focus: More time on team facilitation, less on capacity calculation
- Dev Team: Clear, well-formed stories with proper estimates and dependencies
- Sprint Success: Better sprint predictability with capacity-aware story generation
Quality Assurance
Validation Script
This skill includes automated validation via scripts/validate-examples.ts:
# Validate skill examples and structure
npx tsx scripts/validate-examples.ts
Validation includes:
- Example completeness and correctness
- User story format and INVEST compliance patterns
- Progressive disclosure adherence
- Resource organization standards
When to use:
- Before skill release/packaging
- In CI/CD pipeline (quality gates)
- After major example updates
- During skill maintenance cycles
Integration with ecosystem:
- Used by
bmad-eval-runnerfor ecosystem validation - Supports quality gates in SDLC workflow
- Provides consistent validation across all skills
Automated Validation Checklist
β
Automated Validation (Performed by rf-slicer.py)
- Story follows "As a / I want / So that" format with real business value
- Meets all 6 INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable)
- BDD scenarios inherited from RF and adapted for slice context
- Perfect traceability to RF origin maintained
- Estimate provided as range (min-max hours) + story points
- DoR compliance validated against standard checklist
- Stories >16h automatically get subtasks
- Capacity constraints respected (stories fit in sprint)
- Dependencies mapped from RF dependencies
- Slicing pattern selection justified and documented
β οΈ Human Review Required (Sprint Planning Validation)
- Business value makes sense in current market context
- Story slicing aligns with team capabilities and preferences
- Estimates are realistic based on team velocity
- Dependencies are correct and don't create blockers
- Sprint goal alignment validated
- Developer assignment considerations (skills, availability)
- QA testability confirmed with testing team
π Automated Reports (Generated for Sprint Planning)
- Sprint capacity utilization report
- INVEST compliance summary
- Slicing pattern analysis and efficiency gains
- Priority distribution (Must/Should/Could)
- Dependency chain visualization
- Story point distribution analysis
Enhanced Resources and Integration
Automation Scripts and Configuration
- RF Slicer:
scripts/rf-slicer.pyβ Core automation engine - Slicing Patterns: 8 intelligent patterns with configurable domain knowledge
- INVEST Validator: Automated compliance checking
- Capacity Calculator: Sprint capacity management with debt allocation
Legacy References (Manual Fallback)
- INVEST checklist:
references/invest-checklist.mdβ Manual validation guidance - Slicing patterns guide:
references/story-slicing-patterns.mdβ Manual slicing strategies - Estimation guide:
references/estimation-guide.mdβ Manual estimation techniques - Sprint capacity template:
references/sprint-capacity-template.mdβ Manual capacity calculation
Integration Points
- lidr-requirements Skill (per-rf mode): Auto-loads approved RFs from skill outputs
- Tech-Debt Skill: Integrates debt allocation for capacity planning
- {{TRACKING_TOOL}} Integration: CSV export format for seamless import
- Sprint Planning: Generated backlog ready for team review and assignment
Success Metrics
- Story Quality: 100% INVEST compliance vs ~70% manual
- Sprint Predictability: Capacity-aware generation improves sprint success rate
- Team Velocity: Consistent story sizing improves velocity tracking
- Time to Sprint: Reduced from 4-6 hours to 30 minutes for backlog preparation
Changelog
| Version | Date | Author | Changes |
|---|---|---|---|
| 2.5.0 | 2026-06-11 | TL: BMad-seam visibility | Added "## Relationship to BMad": positions the skill as the PO-backlog wrapper that slices lidr-requirements RFs within bmad-create-epics-and-stories epics and feeds bmad-create-story + Gate 3 DoR (lidr-refinement-notes) β closes the MIGRATION.md Β§115 follow-up for this skill; normalized body Phase: prose to unified numbering |
| 2.4.0 | 2026-06-09 | TL: lang+tool agnostic | Language to English-default-configurable; abstracted tracking tool (Jira) via tool-registry. Translated remaining Spanish example user story, BDD scenarios, CSV export, template, and examples to English |
| 2.3.1 | 2026-06-09 | TL: BMad-coherence batch-fix | Language to English-default-configurable (BDD stays English); abstracted tracking tool via {{TRACKING_TOOL}} in generic prose; added language_default + integrations frontmatter |
| 2.3.0 | 2026-04-06 | System: Phase 4 Python Script Remediation | Complete domain-agnostic remediation: replaced examples/user-stories-selphi-document-capture.md with user-stories-document-capture-feature.md using comprehensive template variables ({{PRIMARY_WORKFLOW}}, {{DOCUMENT_TYPE}}, {{VERIFICATION_DEVICE}}, etc.). Removed all banking/biometric-specific content. Achieving 75β92/100 target score. |
| 2.2.0 | 2026-03-16 | System: QA Enhancement | Previous QA improvements |
Enhanced User Story generation with automation-first approach for any software development project.