SingleIssue Workflow
Focused triage of a single issue or PR.
Invocation Parsing
INPUT: "#123" | "owner/repo#123" | full GitHub URL
MODE: analyze (default) | act
DEPTH: medium (default) | shallow | deep
Extract repo and issue number:
# If just #N, detect repo from current directory
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
NUMBER=123
# If owner/repo#N, parse directly
REPO="owner/repo"
NUMBER=123
# If URL, extract
# https://github.com/tektoncd/pipeline/issues/9438
REPO="tektoncd/pipeline"
NUMBER=9438
Phase 1: Fetch Full Context
# Issue details
gh issue view "$NUMBER" --repo "$REPO" \
--json number,title,state,body,author,labels,assignees,comments,createdAt,updatedAt,milestone
# Timeline (for cross-references, linked PRs)
gh api "repos/$REPO/issues/$NUMBER/timeline" \
--jq '.[] | select(.event == "cross-referenced" or .event == "referenced") | {event, source: .source.issue.html_url}' \
2>/dev/null || true
# Check for linked PRs
gh api "repos/$REPO/issues/$NUMBER/timeline" \
--jq '.[] | select(.event == "connected" or .event == "cross-referenced") | .source.issue // .url' \
2>/dev/null || true
Phase 2: Classify
Apply the same classification logic from the Triage workflow:
- Determine
kind/*from title, body, labels - Assess
priority/*from impact signals - Check if
triage/needs-informationapplies - Note existing labels and what’s missing
Phase 3: Investigate
Shallow
- Summarize the issue in 2-3 sentences
- Note key details: version info, reproduction steps, error messages
- Flag if information is missing
Medium
Clone or use existing checkout of the repo, then:
# Search for error messages mentioned in the issue
rg "error message from issue" --type go -l
# Search for function/type names mentioned
rg "FunctionName" --type go -l
# Search for file paths mentioned
# (extract from stack traces, code blocks in issue body)
# Check recent commits related to the area
git log --oneline --since="6 months ago" -- "path/to/relevant/dir/"
# Look for related tests
rg "TestRelatedFunction" --type go -l
Present findings:
- Relevant source files (with brief explanation of each)
- Whether the described behavior matches the code
- Whether tests cover the reported scenario
- Related recent commits or PRs
Deep
Everything from medium, plus:
# Read the relevant source files in detail
# Trace the code path described in the issue
# Check error handling paths
# Look for the specific condition that could cause the bug
# Check git blame for recent changes in the area
git log -p --since="6 months ago" -- "path/to/file.go" | head -200
# Check if similar bugs were fixed before
gh search issues --repo "$REPO" --state closed "similar keywords" --limit 5
Present a structured analysis:
## Root Cause Analysis
**Hypothesis:** {what's going wrong and why}
**Evidence:**
- `path/to/file.go:123` — {what this code does and why it's problematic}
- `path/to/file.go:456` — {related code that contributes to the issue}
**Fix Approach:**
- In `path/to/file.go`, function `FunctionName`:
- {what needs to change}
- {why this fixes the problem}
**Risk Assessment:** {LOW|MEDIUM|HIGH}
- {what could go wrong with this fix}
- {what tests should be added}
**Related:**
- Similar fix in #{older_issue} (if found)
- Tests to add: `path/to/file_test.go`
Phase 4: Report
Present the full analysis:
## #{number}: {title}
**Repo:** {repo}
**Author:** {author} ({created_at})
**State:** {open/closed}
**Existing labels:** {labels}
**Assignees:** {assignees or "none"}
### Classification
- **Kind:** {kind/bug|feature|question|...}
- **Priority:** {priority assessment with reasoning}
- **Suggested labels:** {labels to add}
### Summary
{2-3 sentence summary of the issue}
### Investigation Findings
{Depth-appropriate findings from Phase 3}
### Suggested Actions
1. {Action 1 — e.g., "Add label kind/bug"}
2. {Action 2 — e.g., "Comment asking for reproduction steps"}
3. {Action 3 — e.g., "Assign to @maintainer familiar with this area"}
### Draft Comment (if applicable)
> {Ready-to-post comment}
Phase 5: Act Mode
If in act mode, walk through each suggested action with approval:
1. Add labels [kind/bug, priority/important-soon]? [y/n]
2. Post this comment? [y/n/edit]
---
{draft comment}
---
3. Assign to @someone? [y/n]
Execute only approved actions.