# Issue Tracker reference: Workflow
Part of the `issue-tracker` skill. Read this only when the task reaches these sections.
## Workflow
### Step 1: Identify User & Context
1. Call #tool:mcp_github_github_get_me to get the authenticated username.
2. Detect the workspace repo from the current directory (check for `.git` remote or `package.json` repository field).
3. **Load preferences** from `.github/accessibility-agents/preferences.md` (the user creates it from `docs/reference/preferences.example.md`):
- If that file does not exist, read `.github/agents/preferences.md` (the older location) and suggest moving it: VS Code loads every `.md` file in `.github/agents/` as a custom agent.
- Read `repos.discovery` for the search scope (default: `all` -- search every repo the user can access).
- Read `repos.include` for pinned repos, `repos.exclude` for muted repos.
- Read `repos.overrides` for per-repo settings: check each repo's `track.issues` flag -- only search issues for repos where this is `true` (or not configured, which defaults to `true`).
- Read per-repo `labels.include`, `labels.exclude`, and `assignees` filters.
- Read `search.default_window` for the default time range (default: 30 days).
4. Use the workspace repo as the smart default when the user doesn't specify a repo, but when listing "my issues" or running triage, search across the full configured scope.
### Step 2: Understand Intent
Parse the user's request into one of these modes:
| Request Pattern | Mode | Action |
|---|---|---|
| "my issues", "what's open" | **List** | Search & display |
| "triage", "what needs attention" | **Triage** | Prioritized dashboard + document |
| "show me #42", "details on issue X" | **Deep Dive** | Full thread + document |
| "reply to #42", "comment on issue" | **Reply** | Draft, preview, post new comment |
| "reply to @alice's comment on #42" | **Reply to Comment** | Reply to a specific existing comment |
| "create issue", "file a bug", "new issue" | **Create** | Create a new issue |
| "react to #42", "thumbs up #42", "like issue" | **React** | Add reaction to issue or comment |
| "edit #42", "update issue title/body" | **Edit** | Modify issue title, body, or metadata |
| "add label", "remove label", "label #42" | **Labels** | Manage issue labels |
| "assign @user to #42", "unassign" | **Assign** | Manage issue assignees |
| "close #42", "reopen #42" | **Close/Reopen** | Change issue state |
| "lock #42", "unlock #42" | **Lock** | Lock/unlock issue conversation |
| "set milestone on #42" | **Milestone** | Set or remove milestone |
| "transfer #42 to owner/repo" | **Transfer** | Transfer issue to another repo |
| "report", "summary", "save for later" | **Document** | Generate workspace file |
| "search critical-bugs", "show me my-stale-prs" | **Saved Search** | Expand named filter from preferences |
| "reply with template needs-info" | **Template Reply** | Load template and draft reply |
| "project status of #42" | **Project Board** | Show project board column and status |
| "scanner issues", "CI a11y issues" | **Scanner Triage** | List and triage issues from CI accessibility scanners |
If ambiguous, infer the most useful mode and proceed -- mention your assumption. Only use #tool:ask_questions if genuinely stumped (e.g., 3+ repos match).
### Step 3: Search Issues
The issue tracker searches across **all repos the user has access to** by default. The GitHub Search API with the authenticated user's token automatically covers every repo they can read.
Choose the right approach based on mode:
- **Author:** #tool:mcp_github_github_search_issues with `author:USERNAME` (spans all repos)
- **Assigned:** #tool:mcp_github_github_search_issues with `assignee:USERNAME` (spans all repos)
- **Mentioned:** #tool:mcp_github_github_search_issues with `mentions:USERNAME` (spans all repos)
- **Specific repo:** #tool:mcp_github_github_list_issues with owner/repo
- **Keywords:** #tool:mcp_github_github_search_issues with search terms (spans all repos)
- **Organization-wide:** #tool:mcp_github_github_search_issues with `org:ORGNAME` to search within an org
**Scope narrowing** -- if the user specifies a scope, add repo qualifiers:
- `repo:owner/name` for a single repo
- `org:orgname` for all repos in an org
- `user:username` for all repos owned by a user
- No qualifier for searching across everything (default)
**Per-repo filters** -- after collecting results, filter based on preferences:
- Skip repos in `repos.exclude`.
- For repos with `overrides`, check `track.issues` is `true`.
- Apply `labels.include` and `labels.exclude` filters.
- Apply `assignees` filter if configured.
**Cross-repo intelligence:**
- When an issue references another repo (e.g., `See also owner/other#42`), surface the referenced item.
- When issues in different repos share the same label pattern (e.g., both tagged `P0`), group them together in triage.
- Flag issues that cross repo boundaries -- _"This issue in repo-A references an open PR in repo-B."_
**Date range handling** -- convert natural language to GitHub qualifiers:
- "last week" --> `created:>YYYY-MM-DD` (7 days ago)
- "this month" --> `created:>YYYY-MM-01`
- "between X and Y" --> `created:X..Y`
- No date specified --> use `search.default_window` from preferences (default: `updated:>YYYY-MM-DD` 30 days) and say so
**Auto-recovery:** If 0 results, automatically broaden (remove date filter, expand scope to `all` repos, or remove label filters) and explain what changed.
### Step 4: Gather Enhanced Data
For each issue found:
1. **Reactions** -- Collect reaction data. Note total positive reactions, any negative sentiment, and flag as Popular (5+), Controversial (mixed), or Quiet.
2. **Release context** -- Check if the issue is in a milestone. If so, check #tool:mcp_github_github_list_releases to see if that milestone maps to an upcoming release.
3. **Discussions** -- Search for GitHub Discussions that reference this issue.
4. **Team activity** -- Note who else is active on the issue (helps identify who to coordinate with).
### Step 5: Display Results in Chat
Lead with a summary line, then a table:
```markdown
**Found 12 open issues across 3 repos** (last 30 days, 3 popular, 2 release-bound)
| Priority | Issue | Repo | Labels | Comments | Reactions | Updated | Signal |
|----------|-------|------|--------|----------|-----------|---------|--------|
| 1 | [Issue #N: Title](url) | owner/repo | `bug` `P1` | 5 | +1: 3, Popular | 2 days ago | Action needed -- @mentioned |
```
**Signal column** (text labels only, no emoji):
- **Action needed** -- You were @mentioned and haven't responded
- **New activity** -- New comments since your last activity
- **Stale** -- No activity for 14+ days
- **High priority** -- Priority label detected
- **Linked PR** -- Has a linked pull request
- **Popular** -- 5+ positive reactions from community
- **Controversial** -- Mixed positive and negative reactions
- **Release-bound** -- In a milestone for an upcoming release
- **Discussion** -- Has a related GitHub Discussion thread
- **In Progress** -- Tracked on project board, currently in progress
- **Blocked** -- Marked as blocked on project board
### Step 6: Deep Dive into an Issue
When the user focuses on a specific issue:
1. Use #tool:mcp_github_github_issue_read to get full metadata.
2. Fetch ALL comments -- present each with author, timestamp, and content.
3. **Fetch reactions** on the issue body and on individual comments.
4. Look for linked PRs by scanning comment/body text for `#N`, `fixes`, `closes` patterns, and cross-reference with #tool:mcp_github_github_search_pull_requests.
5. **Check release context** -- is this issue in a milestone? Has the linked PR been released?
6. **Check for discussions** -- search for GitHub Discussions referencing this issue.
7. Present the full thread in chat.
### Step 7: Generate Workspace Documents
**This is a core feature.** When the user asks for a report, deep dive, triage, or "save for later," generate BOTH a markdown and HTML file in the workspace.
Create files in a `.github/reviews/issues/` directory in the workspace.
**File naming:**
- Markdown: `{repo}-{issue-number}-{slugified-title}.md`
- HTML: `{repo}-{issue-number}-{slugified-title}.html`
#### Single Issue Document -- Markdown Template
```markdown
# Issue Review: {repo}#{number} -- {title}
> Generated on {date} by Issue Tracker Agent
> [View on GitHub]({url})
## Status
| Field | Value |
|-------|-------|
| State | {open/closed} |
| Author | @{author} |
| Assignees | @{assignees} |
| Labels | {labels} |
| Milestone | {milestone} |
| Release | {release version if applicable, or "None"} |
| Created | {date} |
| Updated | {date} |
| Comments | {count} |
| Reactions | {summary: +1: N, heart: N, etc.} |
| Sentiment | {Popular / Controversial / Quiet} |
| Linked PRs | {PR links or "None"} |
| Discussions | {discussion links or "None"} |
## Description
{issue body}
## Community Reactions
{Reaction summary with counts. Note any particularly reacted comments.}
## Discussion Thread ({count} comments)
### Comment 1: @{commenter} -- {date}
{comment body}
**Reactions:** {reactions on this comment}
---
### Comment 2: @{commenter} -- {date}
{comment body}
---
## Cross-References
- **Related PRs:** {list with status: open/merged/closed, or "None found"}
- **Referenced issues:** {list or "None found"}
- **Mentioned in:** {list or "None found"}
- **GitHub Discussions:** {list or "None found"}
- **Release context:** {e.g., "In milestone v2.0 -- release date TBD" or "Fixed in v1.2.3"}
## Action Items
- [ ] {Inferred action from the latest discussion state}
- [ ] {Respond to @{user}'s question from {date}}
- [ ] {Other inferred todos}
## My Notes
```
#### Single Issue Document -- HTML Template
Generate using the shared HTML standards from shared-instructions.md. Key requirements:
```html