What's Next Workflow
When activated, execute this workflow to recommend the next issue to work on:
Steps
- •
Check current branch: Determine if we're on a feature branch and extract the issue number if present.
- •
Check for active cycles: Query Linear for the team's active cycle:
json{"action": "graphql", "graphql": "query { teams { nodes { key activeCycle { id name issues { nodes { id identifier title state { name } priority } } } } } }"}If an active cycle exists, prioritize issues from that cycle.
- •
Get recent completed work: Query Linear for recently completed issues to understand work patterns:
json{"action": "graphql", "graphql": "query { issues(filter: {team: {key: {eq: \"BT\"}}, state: {name: {in: [\"Done\", \"In Review\"]}}}, orderBy: updatedAt, first: 10) { nodes { id identifier title labels { nodes { name } } parent { identifier title } } } }"} - •
Check git history: Review recent commits to understand what areas were recently worked on:
bashgit log --oneline -20 --format="%s" | grep -oE "BT-[0-9]+" | sort -u | head -5
- •
Find candidate issues: Query Linear for backlog issues that are ready to work on:
json{"action": "graphql", "graphql": "query { issues(filter: {team: {key: {eq: \"BT\"}}, state: {name: {in: [\"Backlog\", \"Ready\"]}}}, orderBy: priority, first: 20) { nodes { id identifier title description priority state { name } labels { nodes { name } } parent { identifier title } children { nodes { identifier state { name } } } relations { nodes { type relatedIssue { identifier state { name } } } } } } }"} - •
Prioritize issues: Score and rank issues based on:
- •Active cycle membership (highest priority if cycle is active)
- •
agent-readylabel (fully specified, can start immediately) - •Priority level (1=Urgent, 2=High, 3=Medium, 4=Low)
- •Blocking relationships (issues that unblock others get priority)
- •Relatedness to recent work (same parent issue, similar area)
- •Dependencies satisfied (all blocking issues are Done)
- •
Present recommendations: Display the top 3-5 recommended issues with:
- •Issue identifier and title
- •Priority and state
- •Why it's recommended (cycle, related to recent work, unblocks others, etc.)
- •Any blockers that need resolution first
- •
Optional: Start work: Ask the user if they want to start on the top recommended issue (which would run the
/next-issueworkflow for that specific issue).
Scoring Logic
| Condition | Points |
|---|---|
| In active cycle | +50 |
Has agent-ready label | +30 |
| Related to recently completed work (same parent or area) | +20 |
| Unblocks other issues | +15 |
| Priority 1 (Urgent) | +10 |
| Priority 2 (High) | +5 |
| Has unresolved blocking dependencies | -100 |
Has needs-spec label (requires human input first) | -50 |
Has blocked label | -20 |