Skip to content

Commit 8eca4aa

Browse files
feat(issue_graph): Add focus parameter, cross-repo support, and status extraction
- Add 'focus' parameter to shift focus to parent epic/batch - Support cross-repo sub-issues and parent lookup via GraphQL - Extract status updates from issue body, comments, and milestones - Add state reason (completed, not_planned, duplicate, merged) - Fetch project info for focus node - Parse full GitHub URLs for cross-repo references - Recognize GitHub Issue Types (Epic) for node classification - Enhanced tool description to emphasize using issue_graph first - Update issue_read description to defer to issue_graph for status - Update server instructions with comprehensive issue_graph guidance
1 parent 36824fc commit 8eca4aa

File tree

8 files changed

+991
-105
lines changed

8 files changed

+991
-105
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ The following sets of tools are available:
718718
- `repo`: Repository name (string, required)
719719

720720
- **issue_graph** - Get issue relationship graph
721+
- `focus`: Which node type to focus on: 'provided' (default) uses the specified issue/PR, 'epic' shifts focus to the nearest epic in the hierarchy, 'batch' shifts focus to the nearest batch/parent issue (string, optional)
721722
- `issue_number`: Issue or pull request number to build the graph from (number, required)
722723
- `owner`: Repository owner (string, required)
723724
- `repo`: Repository name (string, required)

pkg/github/__toolsnaps__/issue_graph.snap

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33
"title": "Get issue relationship graph",
44
"readOnlyHint": true
55
},
6-
"description": "Get a graph representation of an issue or pull request and its related issues/PRs.\n\nThis tool helps understand the relationships between issues and PRs in a repository, especially useful for:\n- Understanding the scope of work for an issue or PR\n- Planning implementation for a task that's part of a larger epic\n- Identifying blockers or dependencies\n- Finding related work that might conflict or overlap\n- Understanding why a piece of work exists (tracing to parent epic)\n\nThe graph shows:\n- Node types: epic (large initiatives), batch (parent issues), task (regular issues), pr (pull requests)\n- Parent/child relationships from sub-issues and \"closes/fixes\" references\n- Related issues mentioned in bodies\n\nCall this tool early when working on an issue to gather appropriate context about the work hierarchy.",
6+
"description": "**PRIMARY TOOL FOR ISSUE/PR/PROJECT STATUS** - Returns the entire work hierarchy in ONE call. Use this FIRST before issue_read or other tools.\n\nFASTEST PATH TO PROJECT STATUS: One call returns all related issues, PRs, and their states - no need for multiple API calls.\n\nMUST USE THIS TOOL FIRST WHEN USER ASKS:\n- \"update on...\" / \"status of...\" / \"progress on...\" / \"tell me about...\"\n- \"what's happening with...\" / \"how is... going\" / \"state of...\"\n- \"project status\" / \"overall progress\" / \"how is the epic going\"\n- \"epic\" / \"parent issue\" / \"sub-issues\" / \"blocking\" / \"depends on\"\n- ANY request for status on work that might span multiple issues\n\nDO NOT use issue_read or list_issues first for status questions - issue_graph returns everything in one call.\n\nReturns a comprehensive view including:\n- Node types: epic (large initiatives), batch (parent issues), task (regular issues), pr (pull requests)\n- Full hierarchy: epic → batch → task → PR relationships across the ENTIRE project\n- Sub-issues and \"closes/fixes\" references\n- Cross-references and related work\n- Status updates extracted from issue bodies and comments\n- Open/closed/merged state of ALL related items\n\nUse focus=\"epic\" to automatically find and focus on the parent epic of any issue.",
77
"inputSchema": {
88
"properties": {
9+
"focus": {
10+
"description": "Which node type to focus on: 'provided' (default) uses the specified issue/PR, 'epic' shifts focus to the nearest epic in the hierarchy, 'batch' shifts focus to the nearest batch/parent issue",
11+
"enum": [
12+
"provided",
13+
"epic",
14+
"batch"
15+
],
16+
"type": "string"
17+
},
918
"issue_number": {
1019
"description": "Issue or pull request number to build the graph from",
1120
"type": "number"

pkg/github/__toolsnaps__/issue_read.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Get issue details",
44
"readOnlyHint": true
55
},
6-
"description": "Get information about a specific issue in a GitHub repository.",
6+
"description": "Get detailed information about a single issue: full body, comments, sub-issues, or labels.\n\n**USE issue_graph INSTEAD when user asks about:**\n- Status, updates, or progress on issues/PRs/epics\n- Project overview or how work is going\n- Parent issues, sub-issues, or work hierarchy\n- Related or blocking issues\n\nissue_read is for: reading the full issue body, fetching comments, listing sub-issues of a known parent, or getting label details - AFTER you already know which specific issue you need.",
77
"inputSchema": {
88
"properties": {
99
"issue_number": {

pkg/github/instructions.go

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,37 @@ Before creating a pull request, search for pull request templates in the reposit
6363
case "issues":
6464
return `## Issues
6565
66-
Check 'list_issue_types' first for organizations to use proper issue types. Use 'search_issues' before creating new issues to avoid duplicates. Always set 'state_reason' when closing issues.
66+
**CRITICAL: For ANY question about issue/PR/epic status, updates, or progress - ALWAYS call 'issue_graph' FIRST before any other tool.**
6767
68-
Use 'issue_graph' early when working on an issue to understand its context, hierarchy (epic → batch → task → PR), and related work. After identifying important issues in the graph, use 'issue_read' to get full details of specific issues.`
68+
'issue_graph' is the FASTEST PATH to project status - one call returns the entire work hierarchy (epic → batches → tasks → PRs) instead of multiple separate API calls.
69+
70+
Trigger phrases that REQUIRE 'issue_graph' as the FIRST tool call:
71+
- "update on..." / "status of..." / "progress on..." / "tell me about..."
72+
- "what's happening with..." / "how is... going" / "state of..."
73+
- "project status" / "how is the project going" / "overall progress"
74+
- "epic" / "parent issue" / "sub-issues" / "blocking" / "depends on"
75+
- ANY issue/PR number reference when asking for status or updates
76+
77+
Example: User asks "give me an update on issue #123" → Call issue_graph(owner, repo, 123) FIRST.
78+
Example: User asks "what's the status of the project" → Call issue_graph with the epic/tracking issue number.
79+
80+
The 'issue_graph' tool returns in ONE call:
81+
- Full hierarchy: epic → batch → task → PR relationships across the entire project
82+
- All sub-issues and "closes/fixes" references
83+
- Status updates extracted from issue bodies/comments
84+
- Cross-references and related work
85+
- Open/closed state of all related items
86+
87+
Use focus="epic" to automatically find and focus on the parent epic of any issue.
88+
89+
ONLY AFTER calling 'issue_graph', use other tools:
90+
- 'issue_read' for full details of specific issues identified in the graph
91+
- 'search_issues' to find related issues not in the graph
92+
93+
For creating/modifying issues:
94+
- Check 'list_issue_types' first for organizations to use proper issue types
95+
- Use 'search_issues' before creating new issues to avoid duplicates
96+
- Always set 'state_reason' when closing issues`
6997
case "discussions":
7098
return `## Discussions
7199

0 commit comments

Comments
 (0)