Sync and display active GitHub issues as trackable tasks with local caching for commit integration
Synchronizes GitHub issues to local cache and displays them as trackable tasks for commit integration.
/plugin marketplace add C0ntr0lledCha0s/claude-code-plugin-automations/plugin install github-workflows@claude-code-plugin-automations[filter: assigned|labeled|milestone|project|all] [value]Synchronize GitHub issues to a local cache and display them as trackable tasks. This enables automatic issue references in commits.
/issue-track # Show cached issues (uses cache if fresh, syncs if stale/empty)
/issue-track sync # Force sync from GitHub, bypassing cache
/issue-track assigned # Sync issues assigned to you
/issue-track labeled priority:high # Sync issues with specific label
/issue-track milestone "Sprint 5" # Sync issues in milestone
/issue-track project "Agent Plugin Development" # Sync issues in project board (by title)
/issue-track project 3 # Sync issues in project board (by number)
/issue-track all # Sync all open issues
/issue-track context # Show issues filtered by context (project + scope + assignment)
/issue-track scope # Show issues matching branch scope
/issue-track branch # Show only issues selected for current branch
/issue-track select 42 43 # Select issues for current branch
/issue-track clear # Clear the local cache
First argument (optional): Filter type or action
sync: Force sync from GitHub, bypassing cacheassigned: Issues assigned to current userlabeled: Issues with specific label (requires second arg)milestone: Issues in specific milestone (requires second arg)project: Issues in specific project board (requires second arg: title or number)all: All open issues in repositorycontext: Show issues filtered by combined context (project + scope + assignment)scope: Show issues matching the branch's detected scope labelbranch: Show only issues selected for the current branchselect: Select issues for current branch (requires issue numbers as additional args)clear: Clear the local cacheSecond argument (optional): Filter value for labeled, milestone, project, or select
project: Can be project title (string) or project number (integer)select: One or more issue numbers (e.g., select 42 43 44)Input validation: Only accepts predefined filters. Invalid inputs are rejected.
Cache behavior: Cache is considered "fresh" if synced within the last 15 minutes. Fresh cache is displayed without re-fetching from GitHub. Use sync to bypass this.
.claude/github-workflows/active-issues.jsonIssues are cached in .claude/github-workflows/active-issues.json:
{
"lastSync": "2025-01-15T10:30:00Z",
"repository": "owner/repo",
"filter": "assigned",
"issues": [
{
"number": 42,
"title": "Implement user authentication",
"state": "open",
"labels": ["feature", "priority:high"],
"assignees": ["username"],
"milestone": "Sprint 5",
"created_at": "2025-01-10T08:00:00Z",
"updated_at": "2025-01-14T15:30:00Z",
"url": "https://github.com/owner/repo/issues/42",
"body_preview": "First 500 characters of issue body for context..."
}
]
}
When this command is invoked:
Validate arguments (CRITICAL - prevents command injection):
Check cache status:
sync argument: skip cache and fetch fresh datalastSync timestamp from active-issues.jsonenv.jsonjq -r '.preferences.defaultIssueFilter // "assigned"' .claude/github-workflows/env.jsonassigned if no preference is set (backward compatible)assigned, all, etc.): fetch fresh data from GitHub# Check cache freshness (15 minute threshold)
CACHE_FILE=".claude/github-workflows/active-issues.json"
if [[ -f "$CACHE_FILE" ]]; then
LAST_SYNC=$(jq -r '.lastSync' "$CACHE_FILE")
LAST_SYNC_EPOCH=$(date -d "$LAST_SYNC" +%s 2>/dev/null || date -j -f "%Y-%m-%dT%H:%M:%SZ" "$LAST_SYNC" +%s)
NOW_EPOCH=$(date +%s)
AGE_MINUTES=$(( (NOW_EPOCH - LAST_SYNC_EPOCH) / 60 ))
if [[ $AGE_MINUTES -lt 15 ]]; then
echo "Using cached issues (synced $AGE_MINUTES minutes ago)"
# Display cached issues
else
echo "Cache is stale ($AGE_MINUTES minutes old), syncing..."
# Fetch fresh data
fi
fi
Fetch from GitHub (if syncing):
# Assigned to user
gh issue list --assignee @me --state open --json number,title,state,labels,assignees,milestone,createdAt,updatedAt,url,body
# With label
gh issue list --label "priority:high" --state open --json ...
# In milestone
gh issue list --milestone "Sprint 5" --state open --json ...
# In project board (requires GraphQL)
# First get project ID, then query items
gh api graphql -f query='
query($owner: String!, $number: Int!) {
user(login: $owner) {
projectV2(number: $number) {
items(first: 100) {
nodes {
content {
... on Issue {
number
title
state
labels(first: 10) { nodes { name } }
assignees(first: 5) { nodes { login } }
milestone { title }
createdAt
updatedAt
url
body
}
}
}
}
}
}
}' -f owner="$OWNER" -F number="$PROJECT_NUMBER"
# All open
gh issue list --state open --json ...
Process and cache:
.claude/github-workflows/active-issues.jsonDisplay as task list:
📋 Active Issues (synced 5 minutes ago)
Repository: owner/repo
Filter: assigned to @me
HIGH PRIORITY:
┌─ #42 Implement user authentication
│ Labels: feature, priority:high, scope:backend
│ Milestone: Sprint 5
│ Status: In Progress (branch: feature/auth)
└─ Use: Closes #42 or Refs #42
┌─ #56 Fix login validation error
│ Labels: bug, priority:high
│ Status: Open
└─ Use: Closes #56 or Refs #56
NORMAL PRIORITY:
┌─ #78 Add password reset feature
│ Labels: feature
│ Milestone: Sprint 6
└─ Use: Closes #78 or Refs #78
💡 Tip: Use /commit-smart to auto-suggest these in commits
The cached issues enable automatic commit integration:
feature/issue-42 → suggests #42/commit-smart reads cache and suggests referencesCloses #N: Closes issue when PR mergesFixes #N: Same as Closes (for bugs)Refs #N: References without closingProgresses #N: Indicates partial progressShow cached issues:
/issue-track
Sync assigned issues:
/issue-track assigned
Sync high-priority issues:
/issue-track labeled priority:high
Sync current sprint:
/issue-track milestone "Sprint 5"
Sync issues from project board (by title):
/issue-track project "Agent Plugin Development"
Sync issues from project board (by number):
/issue-track project 3
Show context-filtered issues (project + scope + assignment):
/issue-track context
Show issues matching branch scope:
/issue-track scope
Show only branch-selected issues:
/issue-track branch
Select issues for current branch:
/issue-track select 42 43 44
Force resync:
/issue-track sync
The command also detects if current branch relates to an issue:
# On branch feature/issue-42 or feature/42-auth
Current branch appears related to issue #42
This information is used by /commit-smart to prioritize that issue.
If the filter is invalid:
If GitHub CLI fails:
gh is installed and authenticatedgh auth loginIf no issues found:
.claude/github-workflows/sync to bypass cache and fetch fresh data/commit-smart automatically reads the cache/workflow-status displays cached issues in summary.claude/ directory is already typically gitignored/github-workflows:init:
all (fetch all open issues)assigned (fetch only your issues).claude/github-workflows/env.json