Story Refiner
Purpose
Use this skill to refine raw user stories into clear, testable, sprint-ready backlog items. The agent evaluates each story against INVEST, detects common gaps, asks focused refinement questions, and produces a structured improved story with acceptance criteria and negative scenarios.
This skill is domain-generic. It must work for any product, service, workflow, or delivery team without embedding project-specific assumptions.
When to Use
Use this skill when the user asks to:
- Improve, rewrite, or refine a user story.
- Turn a rough requirement into a sprint-ready backlog item.
- Add acceptance criteria to a story.
- Check whether a story is ready for sprint planning.
- Split an oversized story into smaller stories.
- Reframe technical tasks into user-value-oriented stories.
- Identify missing edge cases, error scenarios, dependencies, or UX details.
Do not use this skill for enterprise architecture, PRD writing, full technical specifications, source code, implementation plans, or project documentation. Keep the output at backlog-item level.
Core Operating Rules
- Use INVEST as the primary evaluation framework. Every story must be checked for Independent, Negotiable, Valuable, Estimable, Small, and Testable.
- Preserve intent, improve expression. Do not change the user's intended outcome unless a gap makes the story unsafe, unclear, or untestable.
- Refocus technical wording on user value. If the input is a technical task, rewrite it as a user or business outcome while preserving necessary implementation constraints as notes.
- Make acceptance criteria observable. Replace vague phrases with measurable, testable Given/When/Then criteria.
- Include unhappy paths. Always check for error cases, alternative flows, empty states, permission failures, validation failures, unavailable dependencies, and recovery behavior.
- Split oversized work. If the story is too large, propose 2-3 smaller stories with separate value and acceptance criteria direction.
- Ask only blocking questions. If missing information prevents a correct refinement, ask specific questions. If a safe assumption exists, state it explicitly.
- Avoid implementation overreach. Do not prescribe internal design, frameworks, database tables, or APIs unless the user provides them as constraints.
- Keep the story sprint-ready. The refined output must be understandable by product, design, engineering, and QA.
INVEST Evaluation Criteria
| Criterion |
Question to Ask |
Failure Signal |
Refinement Action |
| Independent |
Can this story be delivered without strict dependency on another story in the same sprint? |
Requires multiple unfinished stories to provide value. |
Identify dependency or split by independently valuable increments. |
| Negotiable |
Does it leave room for delivery collaboration? |
Reads like a rigid technical contract. |
Reframe around outcome and constraints, not detailed design. |
| Valuable |
Is the user or business value explicit? |
Describes only a task or component. |
Add clear so that value and identify beneficiary. |
| Estimable |
Does the team have enough information to estimate effort? |
Missing scope, actors, rules, data, or interfaces. |
Add assumptions or ask targeted questions. |
| Small |
Can it fit comfortably within a sprint? |
Multiple workflows, roles, systems, or large unknowns. |
Suggest smaller stories or an epic split. |
| Testable |
Can QA objectively verify completion? |
No acceptance criteria or vague outcomes. |
Write observable Given/When/Then criteria. |
Common Gap Detection
Actively detect and correct these issues:
| Gap |
Detection Pattern |
Required Response |
| Vague acceptance criteria |
Words like fast, simple, works well, user-friendly, robust, or intuitive without measurement. |
Replace with observable behavior, thresholds, or explicit examples. |
| Happy-path only |
No mention of errors, empty states, permissions, invalid input, unavailable dependencies, or recovery. |
Add negative and alternative scenarios. |
| Purely technical task |
Story focuses on internal components rather than user or business outcome. |
Reframe using As a [profile], I want [action], so that [value]. |
| Missing UX context |
No validation messages, visible states, accessibility expectations, or interaction feedback where user interaction exists. |
Add UX notes and acceptance criteria for visible behavior. |
| Hidden dependencies |
Needs upstream data, approvals, designs, access, integrations, or decisions. |
List dependencies and ask blocking questions if needed. |
| Oversized story |
Multiple actors, workflows, outcomes, or lifecycle stages. |
Propose 2-3 smaller stories and mark original as an epic candidate. |
| Ambiguous actor |
user is too broad for permissions, goals, or workflows. |
Ask or infer a more specific role and mark assumptions. |
| Weak value statement |
so that is missing or repeats the action. |
Add a concrete user, operational, compliance, or business benefit. |
Execution Workflow
Phase 1: Ingest and Analyze
- Read the raw story, notes, constraints, and any existing acceptance criteria.
- Identify actor, action, value, scope, dependencies, risks, and unknowns.
- Score each INVEST criterion as
Pass, Partial, or Fail.
- Produce a short
Detected Gaps report.
Phase 2: Progressive Refinement
- If the story is too large, suggest 2-3 smaller stories before writing the final version.
- If critical information is missing, ask specific blocking questions.
- If missing information is non-blocking, proceed with stated assumptions.
- Convert technical wording into user-value wording.
- Add acceptance criteria, negative scenarios, dependencies, and notes.
Phase 3: Generate the Refined Story
Produce a complete refined story using the required output structure.
Required Output Structure
Use this format unless the user requests only a review or only acceptance criteria:
# <Clear Story Title>
## Readiness Summary
- Status: Ready | Needs Clarification | Split Recommended
- Reason:
## INVEST Review
| Criterion | Status | Notes | Fix Applied |
| --- | --- | --- | --- |
## Detected Gaps
- <Gap and impact>
## Refined User Story
As a <specific actor>, I want <action or capability>, so that <clear value or outcome>.
## Acceptance Criteria
### AC1: <Observable behavior>
- Given <context>
- When <action>
- Then <expected result>
### AC2: <Observable behavior>
- Given <context>
- When <action>
- Then <expected result>
## Negative and Edge Scenarios
- Given <error or edge context>
- When <action>
- Then <safe, visible, or recoverable outcome>
## Dependencies
- <Dependency, owner if known, and why it matters>
## Assumptions
- <Assumption made to keep refinement moving>
## Open Questions
- <Only questions that block correctness, estimation, or testing>
## Suggested Splits
- <Smaller story title>: <value and scope>
Splitting Rules
When a story fails Small, split by one or more of these dimensions:
- User role or permission level.
- Happy path before edge cases.
- Read-only before write/update behavior.
- One workflow step before end-to-end automation.
- One channel, platform, or interface before multiple channels.
- Core validation before advanced validation.
- Manual workflow before automated workflow.
Each split story must still provide independent value and include a testable outcome.
Acceptance Criteria Rules
- Use English Given/When/Then wording.
- Each criterion must describe one observable behavior.
- Include at least one happy-path criterion when applicable.
- Include at least one negative or edge scenario when applicable.
- Avoid implementation details unless they are externally visible constraints.
- Replace vague performance or quality words with measurable thresholds or explicit examples.
- If a threshold is unknown, write
TBD threshold and ask who can define it.
Quality Checklist
Before presenting the result, verify:
- The output is written in English.
- The actor, action, and value are explicit.
- INVEST review is complete.
- Acceptance criteria are testable and observable.
- Error, empty, invalid, permission, and dependency scenarios were considered.
- Dependencies and assumptions are visible.
- Oversized work is split or marked as split recommended.
- The story avoids unnecessary technical implementation detail.
- The final output can be used by product, engineering, design, and QA without repeated clarification.
Response Style
- Be direct, structured, and practical.
- Prefer concise tables for evaluation.
- Prefer Gherkin bullets for acceptance criteria.
- Use neutral role names such as
domain user, authorized user, operator, administrator, or system actor when the exact persona is unknown.
- Mark unknowns as
TBD instead of inventing business context.
1---2name: story-refiner3description: Refine user stories into sprint-ready backlog items using INVEST checks, gap analysis, Gherkin acceptance criteria, edge cases, dependencies, and structured refinement questions.4license: MIT5---67# Story Refiner89## Purpose1011Use this skill to refine raw user stories into clear, testable, sprint-ready backlog items. The agent evaluates each story against INVEST, detects common gaps, asks focused refinement questions, and produces a structured improved story with acceptance criteria and negative scenarios.1213This skill is domain-generic. It must work for any product, service, workflow, or delivery team without embedding project-specific assumptions.1415## When to Use1617Use this skill when the user asks to:1819- Improve, rewrite, or refine a user story.20- Turn a rough requirement into a sprint-ready backlog item.21- Add acceptance criteria to a story.22- Check whether a story is ready for sprint planning.23- Split an oversized story into smaller stories.24- Reframe technical tasks into user-value-oriented stories.25- Identify missing edge cases, error scenarios, dependencies, or UX details.2627Do not use this skill for enterprise architecture, PRD writing, full technical specifications, source code, implementation plans, or project documentation. Keep the output at backlog-item level.2829## Core Operating Rules30311. **Use INVEST as the primary evaluation framework.** Every story must be checked for Independent, Negotiable, Valuable, Estimable, Small, and Testable.322. **Preserve intent, improve expression.** Do not change the user's intended outcome unless a gap makes the story unsafe, unclear, or untestable.333. **Refocus technical wording on user value.** If the input is a technical task, rewrite it as a user or business outcome while preserving necessary implementation constraints as notes.344. **Make acceptance criteria observable.** Replace vague phrases with measurable, testable Given/When/Then criteria.355. **Include unhappy paths.** Always check for error cases, alternative flows, empty states, permission failures, validation failures, unavailable dependencies, and recovery behavior.366. **Split oversized work.** If the story is too large, propose 2-3 smaller stories with separate value and acceptance criteria direction.377. **Ask only blocking questions.** If missing information prevents a correct refinement, ask specific questions. If a safe assumption exists, state it explicitly.388. **Avoid implementation overreach.** Do not prescribe internal design, frameworks, database tables, or APIs unless the user provides them as constraints.399. **Keep the story sprint-ready.** The refined output must be understandable by product, design, engineering, and QA.4041## INVEST Evaluation Criteria4243| Criterion | Question to Ask | Failure Signal | Refinement Action |44| --- | --- | --- | --- |45| Independent | Can this story be delivered without strict dependency on another story in the same sprint? | Requires multiple unfinished stories to provide value. | Identify dependency or split by independently valuable increments. |46| Negotiable | Does it leave room for delivery collaboration? | Reads like a rigid technical contract. | Reframe around outcome and constraints, not detailed design. |47| Valuable | Is the user or business value explicit? | Describes only a task or component. | Add clear `so that` value and identify beneficiary. |48| Estimable | Does the team have enough information to estimate effort? | Missing scope, actors, rules, data, or interfaces. | Add assumptions or ask targeted questions. |49| Small | Can it fit comfortably within a sprint? | Multiple workflows, roles, systems, or large unknowns. | Suggest smaller stories or an epic split. |50| Testable | Can QA objectively verify completion? | No acceptance criteria or vague outcomes. | Write observable Given/When/Then criteria. |5152## Common Gap Detection5354Actively detect and correct these issues:5556| Gap | Detection Pattern | Required Response |57| --- | --- | --- |58| Vague acceptance criteria | Words like `fast`, `simple`, `works well`, `user-friendly`, `robust`, or `intuitive` without measurement. | Replace with observable behavior, thresholds, or explicit examples. |59| Happy-path only | No mention of errors, empty states, permissions, invalid input, unavailable dependencies, or recovery. | Add negative and alternative scenarios. |60| Purely technical task | Story focuses on internal components rather than user or business outcome. | Reframe using `As a [profile], I want [action], so that [value]`. |61| Missing UX context | No validation messages, visible states, accessibility expectations, or interaction feedback where user interaction exists. | Add UX notes and acceptance criteria for visible behavior. |62| Hidden dependencies | Needs upstream data, approvals, designs, access, integrations, or decisions. | List dependencies and ask blocking questions if needed. |63| Oversized story | Multiple actors, workflows, outcomes, or lifecycle stages. | Propose 2-3 smaller stories and mark original as an epic candidate. |64| Ambiguous actor | `user` is too broad for permissions, goals, or workflows. | Ask or infer a more specific role and mark assumptions. |65| Weak value statement | `so that` is missing or repeats the action. | Add a concrete user, operational, compliance, or business benefit. |6667## Execution Workflow6869### Phase 1: Ingest and Analyze70711. Read the raw story, notes, constraints, and any existing acceptance criteria.722. Identify actor, action, value, scope, dependencies, risks, and unknowns.733. Score each INVEST criterion as `Pass`, `Partial`, or `Fail`.744. Produce a short `Detected Gaps` report.7576### Phase 2: Progressive Refinement77781. If the story is too large, suggest 2-3 smaller stories before writing the final version.792. If critical information is missing, ask specific blocking questions.803. If missing information is non-blocking, proceed with stated assumptions.814. Convert technical wording into user-value wording.825. Add acceptance criteria, negative scenarios, dependencies, and notes.8384### Phase 3: Generate the Refined Story8586Produce a complete refined story using the required output structure.8788## Required Output Structure8990Use this format unless the user requests only a review or only acceptance criteria:9192```markdown93# <Clear Story Title>9495## Readiness Summary96- Status: Ready | Needs Clarification | Split Recommended97- Reason:9899## INVEST Review100| Criterion | Status | Notes | Fix Applied |101| --- | --- | --- | --- |102103## Detected Gaps104- <Gap and impact>105106## Refined User Story107As a <specific actor>, I want <action or capability>, so that <clear value or outcome>.108109## Acceptance Criteria110### AC1: <Observable behavior>111- Given <context>112- When <action>113- Then <expected result>114115### AC2: <Observable behavior>116- Given <context>117- When <action>118- Then <expected result>119120## Negative and Edge Scenarios121- Given <error or edge context>122- When <action>123- Then <safe, visible, or recoverable outcome>124125## Dependencies126- <Dependency, owner if known, and why it matters>127128## Assumptions129- <Assumption made to keep refinement moving>130131## Open Questions132- <Only questions that block correctness, estimation, or testing>133134## Suggested Splits135- <Smaller story title>: <value and scope>136```137138## Splitting Rules139140When a story fails `Small`, split by one or more of these dimensions:141142- User role or permission level.143- Happy path before edge cases.144- Read-only before write/update behavior.145- One workflow step before end-to-end automation.146- One channel, platform, or interface before multiple channels.147- Core validation before advanced validation.148- Manual workflow before automated workflow.149150Each split story must still provide independent value and include a testable outcome.151152## Acceptance Criteria Rules153154- Use English Given/When/Then wording.155- Each criterion must describe one observable behavior.156- Include at least one happy-path criterion when applicable.157- Include at least one negative or edge scenario when applicable.158- Avoid implementation details unless they are externally visible constraints.159- Replace vague performance or quality words with measurable thresholds or explicit examples.160- If a threshold is unknown, write `TBD threshold` and ask who can define it.161162## Quality Checklist163164Before presenting the result, verify:165166- The output is written in English.167- The actor, action, and value are explicit.168- INVEST review is complete.169- Acceptance criteria are testable and observable.170- Error, empty, invalid, permission, and dependency scenarios were considered.171- Dependencies and assumptions are visible.172- Oversized work is split or marked as split recommended.173- The story avoids unnecessary technical implementation detail.174- The final output can be used by product, engineering, design, and QA without repeated clarification.175176## Response Style177178- Be direct, structured, and practical.179- Prefer concise tables for evaluation.180- Prefer Gherkin bullets for acceptance criteria.181- Use neutral role names such as `domain user`, `authorized user`, `operator`, `administrator`, or `system actor` when the exact persona is unknown.182- Mark unknowns as `TBD` instead of inventing business context.