feat(issue_graph): Add focus parameter, cross-repo support, and status extraction
Closes: #1510
Enhances the issue_graph tool to be the primary tool for project status queries. This PR adds intelligent focus shifting, cross-repo relationship discovery, and status extraction to provide comprehensive project overviews in a single API call.
Changes
New Features
-
focusparameter - Automatically shifts focus to parent epic or batchfocus="epic"- Finds and focuses on the nearest epic in the hierarchyfocus="batch"- Finds and focuses on the nearest batch/parent issue- Falls back gracefully with helpful suggestions if no match found
-
Cross-repo support - Uses GraphQL to discover relationships across repositories
- Parent issues can be in different repos than their sub-issues
- Sub-issues are fetched with their actual owner/repo (not assumed same-repo)
- Full GitHub URL parsing (
https://github.com/owner/repo/issues/123)
-
Status extraction - Lightweight "if lucky" status detection
- Parses milestone due dates (overdue/due in X days)
- Scans issue body for status keywords (on-track, delayed, blocked, ETA, etc.)
- Checks 3 most recent comments for status updates (epics/batches only)
-
State reason - Shows why issues/PRs are in their current state
- Issues: completed, not_planned, duplicate, reopened
- PRs: merged state detection
-
Project info - Fetches project name and status for the focus node
-
Issue Types recognition - Detects GitHub's native "Epic" issue type for classification
Tool Description Updates
- Enhanced
issue_graphdescription to emphasize it as the primary tool for status queries - Updated
issue_readdescription to defer toissue_graphfor status/progress questions - Updated server instructions with comprehensive guidance on when to use
issue_graph
Example Output
GRAPH SUMMARY
=============
Focus: github/copilot-agent-services#871 (batch) "[Batch] Support scope challenge"
State: open
Focus shifted: from github/github-mcp-server-remote#461 via cross-reference
Hierarchy: #201 (epic) → #871 (batch)
Direct children: 6
Projects: Agent Services Team Dashboard [In Progress]
NODES (5 total)
===============
github/github-mcp-server-remote#461|pr|merged|Implement initial scope challenge
Preview: Only do a scope challenge for org list tool...
#871|batch|open|[Batch] Support scope challenge in remote MCP [FOCUS]
Preview: Build out scope challenge...
Status: Target: 2:00pm PT today (Thursday)
What an LLM Gets From This Data
From a single tool call, an LLM can understand:
- Work Context: The focus item and its position in the work hierarchy
- Hierarchy: Full epic → batch → task → PR chain across repositories
- Node Classification: Epics, batches, tasks, PRs with GitHub Issue Types support
- Status Updates: Milestone due dates, status keywords, recent updates
- State Details: Open/closed with reason (completed, not_planned, duplicate, merged)
- Project Info: Which projects the issue is in and its status
- Cross-repo Relationships: Parent/child links that span different repositories
Testing
- Added tests for cross-repo ancestor traversal via cross-references
- Added tests for
findBestFocuswith cross-repo relationships - Added test cases for GitHub URL parsing
- Added test case for Issue Types (Epic) classification
- All existing tests pass
Checklist
- [x]
script/lintpasses - [x]
script/testpasses - [x] Toolsnaps updated
- [x] README.md updated via
script/generate-docs