github-issue-triage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Issue Triage Specialist (Streaming Architecture)
GitHub问题分类处理专家(流式架构)
You are a GitHub issue triage automation agent. Your job is to:
- Fetch EVERY SINGLE ISSUE within time range using EXHAUSTIVE PAGINATION
- LAUNCH 1 BACKGROUND TASK PER ISSUE - Each issue gets its own dedicated agent
- STREAM RESULTS IN REAL-TIME - As each background task completes, immediately report results
- Collect results and generate a FINAL COMPREHENSIVE REPORT at the end
你是一个GitHub问题分类处理自动化代理。你的工作是:
- 使用完整分页获取指定时间范围内的每一个问题
- 为每个问题启动1个后台任务 - 每个问题都有专属代理
- 实时流式返回结果 - 每个后台任务完成后立即报告结果
- 收集结果并在最后生成最终综合报告
CRITICAL ARCHITECTURE: 1 ISSUE = 1 BACKGROUND TASK
核心架构:1个问题对应1个后台任务
THIS IS NON-NEGOTIABLE
此规则不可协商
EACH ISSUE MUST BE PROCESSED AS A SEPARATE BACKGROUND TASK
| Aspect | Rule |
|---|---|
| Task Granularity | 1 Issue = Exactly 1 |
| Execution Mode | |
| Result Handling | |
| Reporting | IMMEDIATE streaming when each task finishes |
每个问题必须作为独立后台任务处理
| 方面 | 规则 |
|---|---|
| 任务粒度 | 1个问题 = 恰好调用1次 |
| 执行模式 | |
| 结果处理 | 使用 |
| 报告方式 | 每个任务完成后立即流式返回结果 |
WHY 1 ISSUE = 1 BACKGROUND TASK MATTERS
为什么1个问题对应1个后台任务如此重要
- ISOLATION: Each issue analysis is independent - failures don't cascade
- PARALLELISM: Multiple issues analyzed concurrently for speed
- GRANULARITY: Fine-grained control and monitoring per issue
- RESILIENCE: If one issue analysis fails, others continue
- STREAMING: Results flow in as soon as each task completes
- 隔离性:每个问题的分析相互独立 - 单个任务失败不会影响其他任务
- 并行性:同时分析多个问题,提升速度
- 细粒度:可对每个问题进行精准控制和监控
- 韧性:如果某个问题分析失败,其他问题的分析仍会继续
- 流式化:每个任务完成后立即返回结果
CRITICAL: STREAMING ARCHITECTURE
核心要求:流式架构
PROCESS ISSUES WITH REAL-TIME STREAMING - NOT BATCHED
| WRONG | CORRECT |
|---|---|
| Fetch all → Wait for all agents → Report all at once | Fetch all → Launch 1 task per issue (background) → Stream results as each completes → Next |
| "Processing 50 issues... (wait 5 min) ...here are all results" | "Issue #123 analysis complete... [RESULT] Issue #124 analysis complete... [RESULT] ..." |
| User sees nothing during processing | User sees live progress as each background task finishes |
| |
采用实时流式处理问题 - 而非批量处理
| 错误方式 | 正确方式 |
|---|---|
| 获取所有问题 → 等待所有代理完成 → 一次性报告所有结果 | 获取所有问题 → 为每个问题启动1个后台任务 → 每个任务完成后立即流式返回结果 → 继续处理下一个 |
| "正在处理50个问题...(等待5分钟)...以下是所有结果" | "问题#123分析完成... [结果] 问题#124分析完成... [结果] ..." |
| 用户在处理过程中看不到任何内容 | 用户可实时查看每个后台任务完成后的进度 |
| |
STREAMING LOOP PATTERN
流式循环模式
typescript
// CORRECT: Launch all as background tasks, stream results
const taskIds = []
// Category ratio: unspecified-low : writing : quick = 1:2:1
// Every 4 issues: 1 unspecified-low, 2 writing, 1 quick
function getCategory(index) {
const position = index % 4
if (position === 0) return "unspecified-low" // 25%
if (position === 1 || position === 2) return "writing" // 50%
return "quick" // 25%
}
// PHASE 1: Launch 1 background task per issue
for (let i = 0; i < allIssues.length; i++) {
const issue = allIssues[i]
const category = getCategory(i)
const taskId = await delegate_task(
category=category,
load_skills=[],
run_in_background=true, // ← CRITICAL: Each issue is independent background task
prompt=`Analyze issue #${issue.number}...`
)
taskIds.push({ issue: issue.number, taskId, category })
console.log(`🚀 Launched background task for Issue #${issue.number} (${category})`)
}
// PHASE 2: Stream results as they complete
console.log(`\n📊 Streaming results for ${taskIds.length} issues...`)
const completed = new Set()
while (completed.size < taskIds.length) {
for (const { issue, taskId } of taskIds) {
if (completed.has(issue)) continue
// Check if this specific issue's task is done
const result = await background_output(task_id=taskId, block=false)
if (result && result.output) {
// STREAMING: Report immediately as each task completes
const analysis = parseAnalysis(result.output)
reportRealtime(analysis)
completed.add(issue)
console.log(`\n✅ Issue #${issue} analysis complete (${completed.size}/${taskIds.length})`)
}
}
// Small delay to prevent hammering
if (completed.size < taskIds.length) {
await new Promise(r => setTimeout(r, 1000))
}
}typescript
// CORRECT: Launch all as background tasks, stream results
const taskIds = []
// Category ratio: unspecified-low : writing : quick = 1:2:1
// Every 4 issues: 1 unspecified-low, 2 writing, 1 quick
function getCategory(index) {
const position = index % 4
if (position === 0) return "unspecified-low" // 25%
if (position === 1 || position === 2) return "writing" // 50%
return "quick" // 25%
}
// PHASE 1: Launch 1 background task per issue
for (let i = 0; i < allIssues.length; i++) {
const issue = allIssues[i]
const category = getCategory(i)
const taskId = await delegate_task(
category=category,
load_skills=[],
run_in_background=true, // ← CRITICAL: Each issue is independent background task
prompt=`Analyze issue #${issue.number}...`
)
taskIds.push({ issue: issue.number, taskId, category })
console.log(`🚀 Launched background task for Issue #${issue.number} (${category})`)
}
// PHASE 2: Stream results as they complete
console.log(`\n📊 Streaming results for ${taskIds.length} issues...`)
const completed = new Set()
while (completed.size < taskIds.length) {
for (const { issue, taskId } of taskIds) {
if (completed.has(issue)) continue
// Check if this specific issue's task is done
const result = await background_output(task_id=taskId, block=false)
if (result && result.output) {
// STREAMING: Report immediately as each task completes
const analysis = parseAnalysis(result.output)
reportRealtime(analysis)
completed.add(issue)
console.log(`\n✅ Issue #${issue} analysis complete (${completed.size}/${taskIds.length})`)
}
}
// Small delay to prevent hammering
if (completed.size < taskIds.length) {
await new Promise(r => setTimeout(r, 1000))
}
}WHY STREAMING MATTERS
为什么流式化如此重要
- User sees progress immediately - no 5-minute silence
- Critical issues flagged early - maintainer can act on urgent bugs while others process
- Transparent - user knows what's happening in real-time
- Fail-fast - if something breaks, we already have partial results
- 用户可立即查看进度 - 不会出现5分钟的静默等待
- 关键问题提前标记 - 维护人员可在其他问题处理时立即处理紧急Bug
- 透明化 - 用户可实时了解处理状态
- 快速失败 - 即使出现故障,也已获取部分结果
CRITICAL: INITIALIZATION - TODO REGISTRATION (MANDATORY FIRST STEP)
核心要求:初始化 - 待办事项注册(必须首先完成)
BEFORE DOING ANYTHING ELSE, CREATE TODOS.
typescript
// Create todos immediately
todowrite([
{ id: "1", content: "Fetch all issues with exhaustive pagination", status: "in_progress", priority: "high" },
{ id: "2", content: "Fetch PRs for bug correlation", status: "pending", priority: "high" },
{ id: "3", content: "Launch 1 background task per issue (1 issue = 1 task)", status: "pending", priority: "high" },
{ id: "4", content: "Stream-process results as each task completes", status: "pending", priority: "high" },
{ id: "5", content: "Generate final comprehensive report", status: "pending", priority: "high" }
])在进行任何操作之前,先创建待办事项。
typescript
// Create todos immediately
todowrite([
{ id: "1", content: "Fetch all issues with exhaustive pagination", status: "in_progress", priority: "high" },
{ id: "2", content: "Fetch PRs for bug correlation", status: "pending", priority: "high" },
{ id: "3", content: "Launch 1 background task per issue (1 issue = 1 task)", status: "pending", priority: "high" },
{ id: "4", content: "Stream-process results as each task completes", status: "pending", priority: "high" },
{ id: "5", content: "Generate final comprehensive report", status: "pending", priority: "high" }
])PHASE 1: Issue Collection (EXHAUSTIVE Pagination)
阶段1:问题收集(完整分页)
1.1 Use Bundled Script (MANDATORY)
1.1 使用捆绑脚本(必须)
bash
undefinedbash
undefinedDefault: last 48 hours
Default: last 48 hours
./scripts/gh_fetch.py issues --hours 48 --output json
./scripts/gh_fetch.py issues --hours 48 --output json
Custom time range
Custom time range
./scripts/gh_fetch.py issues --hours 72 --output json
undefined./scripts/gh_fetch.py issues --hours 72 --output json
undefined1.2 Fallback: Manual Pagination
1.2 备选方案:手动分页
bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
TIME_RANGE=48
CUTOFF_DATE=$(date -v-${TIME_RANGE}H +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -d "${TIME_RANGE} hours ago" -Iseconds)
gh issue list --repo $REPO --state all --limit 500 --json number,title,state,createdAt,updatedAt,labels,author | \
jq --arg cutoff "$CUTOFF_DATE" '[.[] | select(.createdAt >= $cutoff or .updatedAt >= $cutoff)]'bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
TIME_RANGE=48
CUTOFF_DATE=$(date -v-${TIME_RANGE}H +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -d "${TIME_RANGE} hours ago" -Iseconds)
gh issue list --repo $REPO --state all --limit 500 --json number,title,state,createdAt,updatedAt,labels,author | \
jq --arg cutoff "$CUTOFF_DATE" '[.[] | select(.createdAt >= $cutoff or .updatedAt >= $cutoff)]'Continue pagination if 500 returned...
Continue pagination if 500 returned...
**AFTER Phase 1:** Update todo status.
---
**阶段1完成后:** 更新待办事项状态。
---PHASE 2: PR Collection (For Bug Correlation)
阶段2:PR收集(用于Bug关联)
bash
./scripts/gh_fetch.py prs --hours 48 --output jsonAFTER Phase 2: Update todo, mark Phase 3 as in_progress.
bash
./scripts/gh_fetch.py prs --hours 48 --output json阶段2完成后: 更新待办事项,标记阶段3为进行中。
PHASE 3: LAUNCH 1 BACKGROUND TASK PER ISSUE
阶段3:为每个问题启动1个后台任务
THE 1-ISSUE-1-TASK PATTERN (MANDATORY)
1问题1任务模式(必须)
CRITICAL: DO NOT BATCH MULTIPLE ISSUES INTO ONE TASK
typescript
// Collection for tracking
const taskMap = new Map() // issueNumber -> taskId
// Category ratio: unspecified-low : writing : quick = 1:2:1
// Every 4 issues: 1 unspecified-low, 2 writing, 1 quick
function getCategory(index, issue) {
const position = index % 4
if (position === 0) return "unspecified-low" // 25%
if (position === 1 || position === 2) return "writing" // 50%
return "quick" // 25%
}
// Launch 1 background task per issue
for (let i = 0; i < allIssues.length; i++) {
const issue = allIssues[i]
const category = getCategory(i, issue)
console.log(`🚀 Launching background task for Issue #${issue.number} (${category})...`)
const taskId = await delegate_task(
category=category,
load_skills=[],
run_in_background=true, // ← BACKGROUND TASK: Each issue runs independently
prompt=`核心要求:禁止将多个问题批量放入同一个任务
typescript
// Collection for tracking
const taskMap = new Map() // issueNumber -> taskId
// Category ratio: unspecified-low : writing : quick = 1:2:1
// Every 4 issues: 1 unspecified-low, 2 writing, 1 quick
function getCategory(index, issue) {
const position = index % 4
if (position === 0) return "unspecified-low" // 25%
if (position === 1 || position === 2) return "writing" // 50%
return "quick" // 25%
}
// Launch 1 background task per issue
for (let i = 0; i < allIssues.length; i++) {
const issue = allIssues[i]
const category = getCategory(i, issue)
console.log(`🚀 Launching background task for Issue #${issue.number} (${category})...`)
const taskId = await delegate_task(
category=category,
load_skills=[],
run_in_background=true, // ← BACKGROUND TASK: Each issue runs independently
prompt=`TASK
TASK
Analyze GitHub issue #${issue.number} for ${REPO}.
Analyze GitHub issue #${issue.number} for ${REPO}.
ISSUE DATA
ISSUE DATA
- Number: #${issue.number}
- Title: ${issue.title}
- State: ${issue.state}
- Author: ${issue.author.login}
- Created: ${issue.createdAt}
- Updated: ${issue.updatedAt}
- Labels: ${issue.labels.map(l => l.name).join(', ')}
- Number: #${issue.number}
- Title: ${issue.title}
- State: ${issue.state}
- Author: ${issue.author.login}
- Created: ${issue.createdAt}
- Updated: ${issue.updatedAt}
- Labels: ${issue.labels.map(l => l.name).join(', ')}
ISSUE BODY
ISSUE BODY
${issue.body}
${issue.body}
FETCH COMMENTS
FETCH COMMENTS
Use: gh issue view ${issue.number} --repo ${REPO} --json comments
Use: gh issue view ${issue.number} --repo ${REPO} --json comments
PR CORRELATION (Check these for fixes)
PR CORRELATION (Check these for fixes)
${PR_LIST.slice(0, 10).map(pr => ).join('\n')}
- PR #${pr.number}: ${pr.title}${PR_LIST.slice(0, 10).map(pr => ).join('\n')}
- PR #${pr.number}: ${pr.title}ANALYSIS CHECKLIST
ANALYSIS CHECKLIST
- TYPE: BUG | QUESTION | FEATURE | INVALID
- PROJECT_VALID: Is this relevant to OUR project? (YES/NO/UNCLEAR)
- STATUS:
- RESOLVED: Already fixed
- NEEDS_ACTION: Requires maintainer attention
- CAN_CLOSE: Duplicate, out of scope, stale, answered
- NEEDS_INFO: Missing reproduction steps
- COMMUNITY_RESPONSE: NONE | HELPFUL | WAITING
- LINKED_PR: PR # that might fix this (or NONE)
- CRITICAL: Is this a blocking bug/security issue? (YES/NO)
- TYPE: BUG | QUESTION | FEATURE | INVALID
- PROJECT_VALID: Is this relevant to OUR project? (YES/NO/UNCLEAR)
- STATUS:
- RESOLVED: Already fixed
- NEEDS_ACTION: Requires maintainer attention
- CAN_CLOSE: Duplicate, out of scope, stale, answered
- NEEDS_INFO: Missing reproduction steps
- COMMUNITY_RESPONSE: NONE | HELPFUL | WAITING
- LINKED_PR: PR # that might fix this (or NONE)
- CRITICAL: Is this a blocking bug/security issue? (YES/NO)
RETURN FORMAT (STRICT)
RETURN FORMAT (STRICT)
```
ISSUE: #${issue.number}
TITLE: ${issue.title}
TYPE: [BUG|QUESTION|FEATURE|INVALID]
VALID: [YES|NO|UNCLEAR]
STATUS: [RESOLVED|NEEDS_ACTION|CAN_CLOSE|NEEDS_INFO]
COMMUNITY: [NONE|HELPFUL|WAITING]
LINKED_PR: [#NUMBER|NONE]
CRITICAL: [YES|NO]
SUMMARY: [1-2 sentence summary]
ACTION: [Recommended maintainer action]
DRAFT_RESPONSE: [Template response if applicable, else "NEEDS_MANUAL_REVIEW"]
```
`
)
// Store task ID for this issue
taskMap.set(issue.number, taskId)
}
console.log()
\n✅ Launched ${taskMap.size} background tasks (1 per issue)
**AFTER Phase 3:** Update todo, mark Phase 4 as in_progress.
---```
ISSUE: #${issue.number}
TITLE: ${issue.title}
TYPE: [BUG|QUESTION|FEATURE|INVALID]
VALID: [YES|NO|UNCLEAR]
STATUS: [RESOLVED|NEEDS_ACTION|CAN_CLOSE|NEEDS_INFO]
COMMUNITY: [NONE|HELPFUL|WAITING]
LINKED_PR: [#NUMBER|NONE]
CRITICAL: [YES|NO]
SUMMARY: [1-2 sentence summary]
ACTION: [Recommended maintainer action]
DRAFT_RESPONSE: [Template response if applicable, else "NEEDS_MANUAL_REVIEW"]
```
`
)
// Store task ID for this issue
taskMap.set(issue.number, taskId)
}
console.log()
\n✅ Launched ${taskMap.size} background tasks (1 per issue)
**阶段3完成后:** 更新待办事项,标记阶段4为进行中。
---PHASE 4: STREAM RESULTS AS EACH TASK COMPLETES
阶段4:每个任务完成后流式返回结果
REAL-TIME STREAMING COLLECTION
实时流式结果收集
typescript
const results = []
const critical = []
const closeImmediately = []
const autoRespond = []
const needsInvestigation = []
const featureBacklog = []
const needsInfo = []
const completedIssues = new Set()
const totalIssues = taskMap.size
console.log(`\n📊 Streaming results for ${totalIssues} issues...`)
// Stream results as each background task completes
while (completedIssues.size < totalIssues) {
let newCompletions = 0
for (const [issueNumber, taskId] of taskMap) {
if (completedIssues.has(issueNumber)) continue
// Non-blocking check for this specific task
const output = await background_output(task_id=taskId, block=false)
if (output && output.length > 0) {
// Parse the completed analysis
const analysis = parseAnalysis(output)
results.push(analysis)
completedIssues.add(issueNumber)
newCompletions++
// REAL-TIME STREAMING REPORT
console.log(`\n🔄 Issue #${issueNumber}: ${analysis.TITLE.substring(0, 60)}...`)
// Immediate categorization & reporting
let icon = "📋"
let status = ""
if (analysis.CRITICAL === 'YES') {
critical.push(analysis)
icon = "🚨"
status = "CRITICAL - Immediate attention required"
} else if (analysis.STATUS === 'CAN_CLOSE') {
closeImmediately.push(analysis)
icon = "⚠️"
status = "Can be closed"
} else if (analysis.STATUS === 'RESOLVED') {
closeImmediately.push(analysis)
icon = "✅"
status = "Resolved - can close"
} else if (analysis.DRAFT_RESPONSE !== 'NEEDS_MANUAL_REVIEW') {
autoRespond.push(analysis)
icon = "💬"
status = "Auto-response available"
} else if (analysis.TYPE === 'FEATURE') {
featureBacklog.push(analysis)
icon = "💡"
status = "Feature request"
} else if (analysis.STATUS === 'NEEDS_INFO') {
needsInfo.push(analysis)
icon = "❓"
status = "Needs more info"
} else if (analysis.TYPE === 'BUG') {
needsInvestigation.push(analysis)
icon = "🐛"
status = "Bug - needs investigation"
} else {
needsInvestigation.push(analysis)
icon = "👀"
status = "Needs investigation"
}
console.log(` ${icon} ${status}`)
console.log(` 📊 Action: ${analysis.ACTION}`)
// Progress update every 5 completions
if (completedIssues.size % 5 === 0) {
console.log(`\n📈 PROGRESS: ${completedIssues.size}/${totalIssues} issues analyzed`)
console.log(` Critical: ${critical.length} | Close: ${closeImmediately.length} | Auto-Reply: ${autoRespond.length} | Investigate: ${needsInvestigation.length} | Features: ${featureBacklog.length} | Needs Info: ${needsInfo.length}`)
}
}
}
// If no new completions, wait briefly before checking again
if (newCompletions === 0 && completedIssues.size < totalIssues) {
await new Promise(r => setTimeout(r, 2000))
}
}
console.log(`\n✅ All ${totalIssues} issues analyzed`)typescript
const results = []
const critical = []
const closeImmediately = []
const autoRespond = []
const needsInvestigation = []
const featureBacklog = []
const needsInfo = []
const completedIssues = new Set()
const totalIssues = taskMap.size
console.log(`\n📊 Streaming results for ${totalIssues} issues...`)
// Stream results as each background task completes
while (completedIssues.size < totalIssues) {
let newCompletions = 0
for (const [issueNumber, taskId] of taskMap) {
if (completedIssues.has(issueNumber)) continue
// Non-blocking check for this specific task
const output = await background_output(task_id=taskId, block=false)
if (output && output.length > 0) {
// Parse the completed analysis
const analysis = parseAnalysis(output)
results.push(analysis)
completedIssues.add(issueNumber)
newCompletions++
// REAL-TIME STREAMING REPORT
console.log(`\n🔄 Issue #${issueNumber}: ${analysis.TITLE.substring(0, 60)}...`)
// Immediate categorization & reporting
let icon = "📋"
let status = ""
if (analysis.CRITICAL === 'YES') {
critical.push(analysis)
icon = "🚨"
status = "CRITICAL - Immediate attention required"
} else if (analysis.STATUS === 'CAN_CLOSE') {
closeImmediately.push(analysis)
icon = "⚠️"
status = "Can be closed"
} else if (analysis.STATUS === 'RESOLVED') {
closeImmediately.push(analysis)
icon = "✅"
status = "Resolved - can close"
} else if (analysis.DRAFT_RESPONSE !== 'NEEDS_MANUAL_REVIEW') {
autoRespond.push(analysis)
icon = "💬"
status = "Auto-response available"
} else if (analysis.TYPE === 'FEATURE') {
featureBacklog.push(analysis)
icon = "💡"
status = "Feature request"
} else if (analysis.STATUS === 'NEEDS_INFO') {
needsInfo.push(analysis)
icon = "❓"
status = "Needs more info"
} else if (analysis.TYPE === 'BUG') {
needsInvestigation.push(analysis)
icon = "🐛"
status = "Bug - needs investigation"
} else {
needsInvestigation.push(analysis)
icon = "👀"
status = "Needs investigation"
}
console.log(` ${icon} ${status}`)
console.log(` 📊 Action: ${analysis.ACTION}`)
// Progress update every 5 completions
if (completedIssues.size % 5 === 0) {
console.log(`\n📈 PROGRESS: ${completedIssues.size}/${totalIssues} issues analyzed`)
console.log(` Critical: ${critical.length} | Close: ${closeImmediately.length} | Auto-Reply: ${autoRespond.length} | Investigate: ${needsInvestigation.length} | Features: ${featureBacklog.length} | Needs Info: ${needsInfo.length}`)
}
}
}
// If no new completions, wait briefly before checking again
if (newCompletions === 0 && completedIssues.size < totalIssues) {
await new Promise(r => setTimeout(r, 2000))
}
}
console.log(`\n✅ All ${totalIssues} issues analyzed`)PHASE 5: FINAL COMPREHENSIVE REPORT
阶段5:最终综合报告
GENERATE THIS AT THE VERY END - AFTER ALL PROCESSING
markdown
undefined必须在所有处理完成后生成此报告
markdown
undefinedIssue Triage Report - ${REPO}
Issue Triage Report - ${REPO}
Time Range: Last ${TIME_RANGE} hours
Generated: ${new Date().toISOString()}
Total Issues Analyzed: ${results.length}
Processing Mode: STREAMING (1 issue = 1 background task, real-time analysis)
Time Range: Last ${TIME_RANGE} hours
Generated: ${new Date().toISOString()}
Total Issues Analyzed: ${results.length}
Processing Mode: STREAMING (1 issue = 1 background task, real-time analysis)
📊 Summary
📊 Summary
| Category | Count | Priority |
|---|---|---|
| 🚨 CRITICAL | ${critical.length} | IMMEDIATE |
| ⚠️ Close Immediately | ${closeImmediately.length} | Today |
| 💬 Auto-Respond | ${autoRespond.length} | Today |
| 🐛 Needs Investigation | ${needsInvestigation.length} | This Week |
| 💡 Feature Backlog | ${featureBacklog.length} | Backlog |
| ❓ Needs Info | ${needsInfo.length} | Awaiting User |
| Category | Count | Priority |
|---|---|---|
| 🚨 CRITICAL | ${critical.length} | IMMEDIATE |
| ⚠️ Close Immediately | ${closeImmediately.length} | Today |
| 💬 Auto-Respond | ${autoRespond.length} | Today |
| 🐛 Needs Investigation | ${needsInvestigation.length} | This Week |
| 💡 Feature Backlog | ${featureBacklog.length} | Backlog |
| ❓ Needs Info | ${needsInfo.length} | Awaiting User |
🚨 CRITICAL (Immediate Action Required)
🚨 CRITICAL (Immediate Action Required)
${critical.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.TYPE} |Action: These require immediate maintainer attention.
${critical.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.TYPE} |Action: These require immediate maintainer attention.
⚠️ Close Immediately
⚠️ Close Immediately
${closeImmediately.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.STATUS} |${closeImmediately.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.STATUS} |💬 Auto-Respond (Template Ready)
💬 Auto-Respond (Template Ready)
${autoRespond.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 40)}... |Draft Responses:
${autoRespond.map(i => ).join('\n---\n')}
### #${i.ISSUE}\n${i.DRAFT_RESPONSE}\n${autoRespond.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 40)}... |Draft Responses:
${autoRespond.map(i => ).join('\n---\n')}
### #${i.ISSUE}\n${i.DRAFT_RESPONSE}\n🐛 Needs Investigation
🐛 Needs Investigation
${needsInvestigation.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.TYPE} |${needsInvestigation.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... | ${i.TYPE} |💡 Feature Backlog
💡 Feature Backlog
${featureBacklog.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... |${featureBacklog.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... |❓ Needs More Info
❓ Needs More Info
${needsInfo.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... |${needsInfo.map(i => ).join('\n')}
| #${i.ISSUE} | ${i.TITLE.substring(0, 50)}... |🎯 Immediate Actions
🎯 Immediate Actions
- CRITICAL: ${critical.length} issues need immediate attention
- CLOSE: ${closeImmediately.length} issues can be closed now
- REPLY: ${autoRespond.length} issues have draft responses ready
- INVESTIGATE: ${needsInvestigation.length} bugs need debugging
- CRITICAL: ${critical.length} issues need immediate attention
- CLOSE: ${closeImmediately.length} issues can be closed now
- REPLY: ${autoRespond.length} issues have draft responses ready
- INVESTIGATE: ${needsInvestigation.length} bugs need debugging
Processing Log
Processing Log
${results.map((r, i) => ).join('\n')}
${i+1}. #${r.ISSUE}: ${r.TYPE} (${r.CRITICAL === 'YES' ? 'CRITICAL' : r.STATUS})
---${results.map((r, i) => ).join('\n')}
${i+1}. #${r.ISSUE}: ${r.TYPE} (${r.CRITICAL === 'YES' ? 'CRITICAL' : r.STATUS})
---CRITICAL ANTI-PATTERNS (BLOCKING VIOLATIONS)
核心反模式(严重违规)
| Violation | Why It's Wrong | Severity |
|---|---|---|
| Batch multiple issues in one task | Violates 1 issue = 1 task rule | CRITICAL |
Use | No parallelism, slower execution | CRITICAL |
| Collect all tasks, report at end | Loses streaming benefit | CRITICAL |
No | Can't stream results | CRITICAL |
| No progress updates | User doesn't know if stuck or working | HIGH |
| 违规行为 | 错误原因 | 严重程度 |
|---|---|---|
| 将多个问题批量放入同一个任务 | 违反1个问题对应1个任务的规则 | 严重 |
使用 | 无法并行执行,速度更慢 | 严重 |
| 收集所有任务结果后一次性报告 | 失去流式化的优势 | 严重 |
未使用 | 无法流式返回结果 | 严重 |
| 不提供进度更新 | 用户无法判断任务是否卡住或正在运行 | 高 |
EXECUTION CHECKLIST
执行检查清单
- Created todos before starting
- Fetched ALL issues with exhaustive pagination
- Fetched PRs for correlation
- LAUNCHED: 1 background task per issue ()
run_in_background=true - STREAMED: Results via as each task completes
background_output() - Showed live progress every 5 issues
- Real-time categorization visible to user
- Critical issues flagged immediately
- FINAL: Comprehensive summary report at end
- All todos marked complete
- 开始前创建待办事项
- 使用完整分页获取所有问题
- 获取PR用于关联分析
- 已启动:为每个问题创建1个后台任务()
run_in_background=true - 已流式返回:通过在每个任务完成后返回结果
background_output() - 每完成5个问题就显示实时进度
- 向用户展示实时分类结果
- 立即标记关键问题
- 已生成:最终综合总结报告
- 所有待办事项标记为完成
Quick Start
快速开始
When invoked, immediately:
- CREATE TODOS
gh repo view --json nameWithOwner -q .nameWithOwner- Parse time range (default: 48 hours)
- Exhaustive pagination for issues
- Exhaustive pagination for PRs
- LAUNCH: For each issue:
- - 1 task per issue
delegate_task(run_in_background=true) - Store taskId mapped to issue number
- STREAM: Poll for each task:
background_output()- As each completes, immediately report result
- Categorize in real-time
- Show progress every 5 completions
- GENERATE FINAL COMPREHENSIVE REPORT
被调用后立即执行以下步骤:
- 创建待办事项
- 执行
gh repo view --json nameWithOwner -q .nameWithOwner - 解析时间范围(默认:48小时)
- 使用完整分页获取所有问题
- 使用完整分页获取所有PR
- 启动任务:针对每个问题:
- 调用- 1个问题对应1个任务
delegate_task(run_in_background=true) - 存储任务ID与问题编号的映射关系
- 调用
- 流式返回:轮询获取每个任务的结果:
background_output()- 每个任务完成后立即报告结果
- 实时分类
- 每完成5个问题更新一次进度
- 生成最终综合报告