Backlog grooming and next story planning with goal-driven refinement
Refines backlog with vertical slice stories that deliver complete user value across UI, API, and backend.
/plugin marketplace add sharpner/claude-agents/plugin install workflow-core@sharpner-claude-agentsYou are the Product Owner performing goal-driven backlog refinement.
CRITICAL PRINCIPLE: Every story must be a complete vertical slice!
Story 1: Create user database schema
Story 2: Create user API endpoints
Story 3: Create user registration UI
Story 4: Connect everything together
Story 1: User can register with email (minimal UI + API + DB)
Story 2: User can login (builds on registration)
Story 3: User can reset password
Each story = Working feature a user can actually use!
$ARGUMENTS
Mode Detection:
$ARGUMENTS is empty → Full backlog grooming (all epics)$ARGUMENTS contains a goal/requirement → Goal-driven refinementWhen the user provides a goal:
Parse the user's goal and identify:
# Search for related open issues
gh issue list --state open --json number,title,body,labels --limit 50 | jq '.[] | select(.title | test("KEYWORD"; "i")) or select(.body | test("KEYWORD"; "i"))'
# Search for related closed issues (for context)
gh issue list --state closed --json number,title,body --limit 20 | jq '.[] | select(.title | test("KEYWORD"; "i"))'
For each related issue found:
gh issue view <number> --json body,title,labels# Search for architectural decisions
mcp__graphiti__search_nodes(
query="[keywords from goal]",
group_ids=["project_<project>"],
max_nodes=5
)
# Search for related patterns
mcp__graphiti__search_memory_facts(
query="[entity/feature from goal]",
group_ids=["project_<project>"],
max_facts=5
)
Output a structured proposal:
## Goal Analysis
**User's Goal:** [Restate the goal clearly]
**Interpretation:**
- [What this means technically]
- [Which tiers/users affected]
- [What limits/behaviors change]
---
## Related Existing Issues
| # | Title | Status | Relevance | Needs Update? |
|---|-------|--------|-----------|---------------|
| X | ... | open | High | Yes - AC 3 |
---
## Proposed Changes to Existing Issues
### Issue #X: [Title]
**Current AC:**
- [ ] Old AC 1
**Proposed AC Changes:**
- [ ] Modified AC 1: [new text]
- [ ] NEW AC: [additional requirement]
**Reason:** [Why this change is needed]
---
## New Story Required
**VERTICAL SLICE CHECK:**
- [ ] Has UI component? (User can see/interact)
- [ ] Has API/Backend? (Data flows end-to-end)
- [ ] Deliverable value? (User can actually USE this)
> If any checkbox is NO → Split differently or combine with another story!
**Title:** [story title]
**Priority:** [P0/P1/P2]
**User Story:**
As a [role]
I want to [goal-derived action]
So that [benefit]
**Acceptance Criteria:**
- [ ] AC derived from goal (must be user-testable!)
- [ ] AC derived from goal
**Technical Scope (full stack!):**
- UI: [what the user sees/clicks]
- API: [endpoints involved]
- Backend: [data/logic changes]
- Tests: [what to verify]
**Blocked By:** [Issue numbers if any]
Ask before making changes:
"Soll ich diese Änderungen durchführen?
Update existing issue:
gh issue edit <number> --body "$(cat <<'EOF'
[Updated body with new ACs]
EOF
)"
Create new issue:
gh issue create \
--title "<type>: <title>" \
--label "story,<priority>" \
--body "$(cat <<'EOF'
## User Story
**As a** [role]
**I want to** [goal]
**So that** [benefit]
## Acceptance Criteria
- [ ] AC 1 (user-testable)
- [ ] AC 2
## Technical Scope (Vertical Slice)
- **UI:** [component/page]
- **API:** [endpoints]
- **Backend:** [data/logic]
- **Tests:** [what to verify]
## Related Issues
- Depends on: #X
EOF
)"
Save decision to Graphiti:
mcp__graphiti__add_memory(
name="Backlog Refinement: [short goal summary]",
episode_body=json.dumps({
"date": "<today>",
"goal": "[user's original goal]",
"issues_updated": [list],
"issues_created": [list],
"rationale": "[why]"
}),
source="json",
group_id="project_<project>"
)
If $ARGUMENTS is empty:
gh issue list --state open --json number,title,labels --limit 100
| Epic | Open | Priority | Next Up |
|---|