mcpField
A
agile-story-generation

agile-story-generation

github.com/happy-technologies-llcDevelopment4141 installsUpdated 2d ago
Repository

About agile-story-generation

agile-story-generation is a ServiceNow skill for product owners, scrum masters, and business analysts. It turns requirements into backlog-ready user stories, with acceptance criteria, estimates, and links to epics and sprints.

Key features

  1. 01Break requirements into user stories
  2. 02Write stories in a standard format
  3. 03Generate acceptance criteria
  4. 04Estimate relative story points
  5. 05Link epics and assign sprints
  6. 06Set priority and classification

Use cases

  1. 01Convert feature requirements into backlog stories
  2. 02Add testable acceptance criteria to stories
  3. 03Plan sprints against team capacity
  4. 04Associate stories with product epics

MCP support

The skill uses SN-Query-Table to find epics, sprints, and existing stories, and SN-Create-Record and SN-Update-Record to create or update story records.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/happy-technologies-llc/happy-platform-skills --skill agile-story-generation

After installing, type/agile-story-generationin Claude Code to confirm it loaded.

Details

From the project README

Agile Story Generation

Overview

This skill enables you to generate well-structured user stories from high-level requirements, feature descriptions, or stakeholder requests within ServiceNow's Agile Development 2.0 module. It covers:

  • Decomposing features into appropriately sized user stories
  • Writing stories in standard "As a / I want / So that" format
  • Estimating story points using relative sizing
  • Linking stories to epics and assigning to sprints
  • Generating acceptance criteria for each story
  • Setting priority and classification fields

When to use: When product owners, scrum masters, or business analysts need to convert requirements into backlog-ready user stories in ServiceNow SPM.

Prerequisites

  • Plugins: com.snc.sdlc.agile.2.0 (Agile Development 2.0)
  • Roles: scrum_user, scrum_master, or scrum_admin
  • Access: Read/write access to rm_story, rm_epic, rm_sprint tables
  • Knowledge: Understanding of the project's epics, sprint cadence, and team velocity

Procedure

Step 1: Identify the Target Epic and Sprint

Query existing epics in the project to determine where the new stories belong.

Using MCP (Claude Code/Desktop):

Tool: SN-Query-Table
Parameters:
  table_name: rm_epic
  query: product.sys_id=[product_sys_id]^state!=3
  fields: sys_id,number,short_description,state,priority,story_points_total
  limit: 20

Using REST API:

GET /api/now/table/rm_epic?sysparm_query=product.sys_id=[product_sys_id]^state!=3&sysparm_fields=sys_id,number,short_description,state,priority,story_points_total&sysparm_limit=20

Query active sprints to find the target sprint for assignment:

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: rm_sprint
  query: release.product.sys_id=[product_sys_id]^state=2
  fields: sys_id,number,short_description,start_date,end_date,story_points,capacity
  limit: 5

Using REST API:

GET /api/now/table/rm_sprint?sysparm_query=release.product.sys_id=[product_sys_id]^state=2&sysparm_fields=sys_id,number,short_description,start_date,end_date,story_points,capacity&sysparm_limit=5
Step 2: Analyze the Requirement

Break down the feature description into discrete, independently deliverable user stories. Apply the INVEST criteria:

CriterionDescriptionValidation
IndependentNo dependencies on other storiesCan be developed in isolation
NegotiableDetails can be discussedNot over-specified
ValuableDelivers user/business valueClear "so that" clause
EstimableTeam can size itWell-understood scope
SmallFits in a single sprintTypically 1-8 story points
TestableClear pass/fail criteriaHas acceptance criteria
Step 3: Generate User Stories

For each identified story, create a record in the rm_story table.

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: rm_story
  fields:
    short_description: "As a [persona], I want to [action] so that [benefit]"
    description: |
      ## User Story
      **As a** customer service representative
      **I want to** search for customers by phone number
      **So that** I can quickly locate their account during inbound calls

      ## Details
      - Search should support partial phone number matching
      - Results should display customer name, account number, and status
      - Search should return results within 2 seconds

      ## Technical Notes
      - Leverage existing customer API endpoint
      - Index phone_number field for performance
    story_points: 5
    epic: [epic_sys_id]
    sprint: [sprint_sys_id]
    state: -6
    priority: 2
    acceptance_criteria: |
      Given I am logged in as a service representative
      When I enter a phone number (full or partial) in the search field
      Then matching customer records are displayed within 2 seconds

      Given no matching records exist
      When I search for a phone number
      Then a "No results found" message is displayed

      Given multiple matches are found
      When results are displayed
      Then they are sorted by relevance with exact matches first
    product: [product_sys_id]
    assigned_to: [user_sys_id]
    classification: Enhancement

Using REST API:

POST /api/now/table/rm_story
Content-Type: application/json

{
  "short_description": "As a customer service rep, I want to search customers by phone number so I can locate accounts quickly",
  "description": "## User Story\n**As a** customer service representative\n**I want to** search for customers by phone number\n**So that** I can quickly locate their account during inbound calls",
  "story_points": 5,
  "epic": "[epic_sys_id]",
  "sprint": "[sprint_sys_id]",
  "state": "-6",
  "priority": 2,
  "acceptance_criteria": "Given I am logged in as a service representative\nWhen I enter a phone number in the search field\nThen matching customer records are displayed within 2 seconds",
  "product": "[product_sys_id]",
  "classification": "Enhancement"
}
Step 4: Estimate Story Points

Use relative sizing based on team velocity and complexity. Apply the modified Fibonacci scale:

PointsEffort LevelExample
1TrivialText change, config update
2SimpleSingle field addition with validation
3SmallNew UI component with basic logic
5MediumFeature with multiple integration points
8LargeComplex feature spanning multiple modules
13Very LargeConsider splitting into smaller stories

Update story points after estimation:

Using MCP:

Tool: SN-Update-Record
Parameters:
  table_name: rm_story
  sys_id: [story_sys_id]
  fields:
    story_points: 5
    blocked: false

Using REST API:

PATCH /api/now/table/rm_story/[story_sys_id]
Content-Type: application/json

{
  "story_points": 5,
  "blocked": false
}
Step 5: Validate Sprint Capacity

Before assigning stories, verify the sprint has remaining capacity.

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: rm_sprint
  query: sys_id=[sprint_sys_id]
  fields: sys_id,short_description,capacity,story_points,start_date,end_date
  limit: 1

Calculate remaining capacity: remaining = capacity - story_points. Only assign stories if the total story points of new stories fit within the remaining capacity.

Step 6: Link Stories to Epic and Verify

Query the epic to confirm all stories are linked correctly:

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: rm_story
  query: epic=[epic_sys_id]^ORDERBYpriority
  fields: number,short_description,story_points,state,sprint,assigned_to,priority
  limit: 50

Using REST API:

GET /api/now/table/rm_story?sysparm_query=epic=[epic_sys_id]^ORDERBYpriority&sysparm_fields=number,short_description,story_points,state,sprint,assigned_to,priority&sysparm_limit=50

Tool Usage

MCP Tools Reference
ToolWhen to Use
SN-Query-TableQuery epics, sprints, existing stories, and products
SN-Create-RecordCreate new user stories in rm_story
SN-Update-RecordUpdate story points, assignments, state
SN-Natural-Language-SearchNatural language search for related stories or requirements
REST API Reference
EndpointMethodPurpose
/api/now/table/rm_storyGETQuery existing stories
/api/now/table/rm_storyPOSTCreate new story
/api/now/table/rm_story/{sys_id}PATCHUpdate story fields
/api/now/table/rm_epicGETQuery epics for linking
/api/now/table/rm_sprintGETQuery sprints for assignment

Best Practices

  • One Action Per Story: Each story should describe a single user action or capability
  • Include Acceptance Criteria: Every story must have testable acceptance criteria before sprint planning
  • Right-Size Stories: Aim for 1-8 story points; split anything estimated at 13+
  • Use Personas: Write stories from the perspective of actual user personas, not generic "user"
  • Avoid Technical Language: Stories describe what, not how; keep implementation details in tasks
  • Link to Epics: Always associate stories with their parent epic for traceability
  • Verify Capacity: Check sprint capacity before assigning stories to avoid overcommitment
  • Set Classification: Use Enhancement, Defect, or Spike to categorize the story type

Troubleshooting

"Epic not found" when linking story

Cause: Epic sys_id is incorrect or epic belongs to a different product Solution: Query rm_epic with the product filter to find valid epics: product=[product_sys_id]^state!=3

"Sprint capacity exceeded" warning

Cause: Adding stories beyond the sprint's configured capacity Solution: Check capacity vs story_points on the sprint record; consider moving stories to the next sprint

"Story not appearing on sprint board"

Cause: Story is missing the sprint assignment or is in Draft state Solution: Verify the sprint field is set and state is at least "Ready" (state=-5)

"Cannot assign story to closed sprint"

Cause: Sprint state is Complete (3) or Closed Solution: Query for active sprints with state=2 and assign to a current or future sprint

Examples

Example 1: E-Commerce Feature Decomposition

Input Requirement: "Users should be able to manage their shopping cart"

Generated Stories:

  1. STY0010001 - "As a shopper, I want to add items to my cart so that I can purchase them later" (3 pts)
  2. STY0010002 - "As a shopper, I want to remove items from my cart so that I can change my mind" (2 pts)
  3. STY0010003 - "As a shopper, I want to update item quantities in my cart so that I can buy multiples" (3 pts)
  4. STY0010004 - "As a shopper, I want to see a cart summary with subtotal so that I know what I'm spending" (5 pts)
  5. STY0010005 - "As a shopper, I want my cart to persist across sessions so that I don't lose my selections" (5 pts)

Total: 18 story points across 5 stories

Example 2: Single Story with Full Detail

Input: "Need password reset functionality for mobile app"

Tool: SN-Create-Record
Parameters:
  table_name: rm_story
  fields:
    short_description: "As a mobile app user, I want to reset my password from the login screen so that I can regain access to my account"
    story_points: 5
    epic: [auth_epic_sys_id]
    sprint: [current_sprint_sys_id]
    priority: 2
    state: -6
    classification: Enhancement
    acceptance_criteria: |
      Given I am on the mobile login screen
      When I tap "Forgot Password"
      Then I am prompted to enter my registered email address

      Given I enter a valid registered email
      When I submit the reset request
      Then I receive a password reset link via email within 60 seconds

      Given I click the reset link from the email
      When I enter a new password meeting complexity requirements
      Then my password is updated and I can log in with the new credentials

      Given I enter an unregistered email
      When I submit the reset request
      Then I see a generic message (no indication whether email exists)

Related Skills

  • spm/acceptance-criteria - Detailed acceptance criteria generation
  • spm/project-insights - Track project health and velocity
  • spm/planning-summarization - Summarize sprint and release planning
  • spm/feedback-summarization - Retrospective feedback analysis
  • development/automated-testing - Generate test cases from stories

Comments

Markdown supported