feat(skills): add streaming mode and todo tracking to triage skills

- Convert github-pr-triage to streaming architecture (process PRs one-by-one with immediate reporting)
- Convert github-issue-triage to streaming architecture (process issues one-by-one with real-time updates)
- Add mandatory initial todo registration for both triage skills
- Add phase-by-phase todo status updates
- Generate final comprehensive report at the end
- Show live progress every 5 items during processing
This commit is contained in:
YeonGyu-Kim 2026-02-02 18:12:11 +09:00
parent b01e246958
commit 8e17819ffb
2 changed files with 224 additions and 19 deletions

View File

@ -12,6 +12,52 @@ You are a GitHub issue triage automation agent. Your job is to:
--- ---
# CRITICAL: INITIALIZATION - TODO REGISTRATION (MANDATORY FIRST STEP)
**BEFORE DOING ANYTHING ELSE, YOU MUST CREATE AND TRACK TODOS.**
## Step 0: Create Initial Todo List
```typescript
// Create todos immediately upon invocation
todowrite([
{
id: "1",
content: "Phase 1: Fetch all issues with exhaustive pagination",
status: "in_progress",
priority: "high"
},
{
id: "2",
content: "Phase 1b: Fetch all PRs for bug correlation",
status: "pending",
priority: "high"
},
{
id: "3",
content: "Phase 2: Launch parallel background agents (1 per issue)",
status: "pending",
priority: "high"
},
{
id: "4",
content: "Phase 3: Collect all agent analysis results",
status: "pending",
priority: "high"
},
{
id: "5",
content: "Phase 4: Generate comprehensive triage report",
status: "pending",
priority: "high"
}
])
```
**DO NOT PROCEED TO PHASE 1 UNTIL TODOS ARE CREATED.**
---
# CRITICAL: EXHAUSTIVE PAGINATION IS MANDATORY # CRITICAL: EXHAUSTIVE PAGINATION IS MANDATORY
**THIS IS THE MOST IMPORTANT RULE. VIOLATION = COMPLETE FAILURE.** **THIS IS THE MOST IMPORTANT RULE. VIOLATION = COMPLETE FAILURE.**
@ -274,6 +320,17 @@ CHECKLIST:
**If you did NOT see "EXHAUSTIVE PAGINATION COMPLETE", you did it WRONG. Start over.** **If you did NOT see "EXHAUSTIVE PAGINATION COMPLETE", you did it WRONG. Start over.**
**AFTER Phase 1 (Issues) Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all issues with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 1b: Fetch all PRs for bug correlation", status: "in_progress", priority: "high" },
{ id: "3", content: "Phase 2: Launch parallel background agents (1 per issue)", status: "pending", priority: "high" },
{ id: "4", content: "Phase 3: Collect all agent analysis results", status: "pending", priority: "high" },
{ id: "5", content: "Phase 4: Generate comprehensive triage report", status: "pending", priority: "high" }
])
```
## ANTI-PATTERNS (WILL CAUSE FAILURE) ## ANTI-PATTERNS (WILL CAUSE FAILURE)
| NEVER DO THIS | Why It Fails | | NEVER DO THIS | Why It Fails |
@ -299,6 +356,17 @@ gh pr list --repo $REPO --state all --limit 500 --json number,title,state,create
jq --arg cutoff "$CUTOFF_DATE" '[.[] | select(.createdAt >= $cutoff or .updatedAt >= $cutoff)]' jq --arg cutoff "$CUTOFF_DATE" '[.[] | select(.createdAt >= $cutoff or .updatedAt >= $cutoff)]'
``` ```
**AFTER Phase 1b (PRs) Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all issues with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 1b: Fetch all PRs for bug correlation", status: "completed", priority: "high" },
{ id: "3", content: "Phase 2: Launch parallel background agents (1 per issue)", status: "in_progress", priority: "high" },
{ id: "4", content: "Phase 3: Collect all agent analysis results", status: "pending", priority: "high" },
{ id: "5", content: "Phase 4: Generate comprehensive triage report", status: "pending", priority: "high" }
])
```
--- ---
## PHASE 2: Parallel Issue Analysis (1 Issue = 1 Agent) ## PHASE 2: Parallel Issue Analysis (1 Issue = 1 Agent)
@ -399,6 +467,17 @@ for (const taskId of taskIds) {
} }
``` ```
**AFTER Phase 2 Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all issues with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 1b: Fetch all PRs for bug correlation", status: "completed", priority: "high" },
{ id: "3", content: "Phase 2: Launch parallel background agents (1 per issue)", status: "completed", priority: "high" },
{ id: "4", content: "Phase 3: Collect all agent analysis results", status: "in_progress", priority: "high" },
{ id: "5", content: "Phase 4: Generate comprehensive triage report", status: "pending", priority: "high" }
])
```
--- ---
## PHASE 3: Report Generation ## PHASE 3: Report Generation
@ -468,26 +547,37 @@ Group analyzed issues by status:
## Response Templates ## Response Templates
### Fixed in Version X ### Fixed in Version X
\`\`\` ```
This issue was resolved in vX.Y.Z via PR #NNN. This issue was resolved in vX.Y.Z via PR #NNN.
Please update: \`bunx oh-my-opencode@X.Y.Z install\` Please update: \`bunx oh-my-opencode@X.Y.Z install\`
If the issue persists, please reopen with \`opencode --print-logs\` output. If the issue persists, please reopen with \`opencode --print-logs\` output.
\`\`\` ```
### Needs More Info ### Needs More Info
\`\`\` ```
Thank you for reporting. To investigate, please provide: Thank you for reporting. To investigate, please provide:
1. \`opencode --print-logs\` output 1. \`opencode --print-logs\` output
2. Your configuration file 2. Your configuration file
3. Minimal reproduction steps 3. Minimal reproduction steps
Labeling as \`needs-info\`. Auto-closes in 7 days without response. Labeling as \`needs-info\`. Auto-closes in 7 days without response.
\`\`\` ```
### Out of Scope ### Out of Scope
\`\`\` ```
Thank you for reaching out. This request falls outside the scope of this project. Thank you for reaching out. This request falls outside the scope of this project.
[Suggest alternative or explanation] [Suggest alternative or explanation]
\`\`\` ```
```
**AFTER Phase 3 Complete - Final Todo Update:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all issues with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 1b: Fetch all PRs for bug correlation", status: "completed", priority: "high" },
{ id: "3", content: "Phase 2: Launch parallel background agents (1 per issue)", status: "completed", priority: "high" },
{ id: "4", content: "Phase 3: Collect all agent analysis results", status: "completed", priority: "high" },
{ id: "5", content: "Phase 4: Generate comprehensive triage report", status: "completed", priority: "high" }
])
``` ```
--- ---
@ -523,13 +613,19 @@ CHECKLIST:
## EXECUTION CHECKLIST ## EXECUTION CHECKLIST
- [ ] Created initial todo list before starting work
- [ ] Fetched ALL pages of issues (pagination complete) - [ ] Fetched ALL pages of issues (pagination complete)
- [ ] Updated todo after Phase 1 completion
- [ ] Fetched ALL pages of PRs for correlation - [ ] Fetched ALL pages of PRs for correlation
- [ ] Updated todo after Phase 1b completion
- [ ] Launched 1 agent per issue (not batched) - [ ] Launched 1 agent per issue (not batched)
- [ ] Updated todo after Phase 2 completion
- [ ] All agents ran in background (parallel) - [ ] All agents ran in background (parallel)
- [ ] Collected all results before generating report - [ ] Collected all results before generating report
- [ ] Updated todo after Phase 3 completion
- [ ] Report includes draft responses where applicable - [ ] Report includes draft responses where applicable
- [ ] Critical issues flagged at top - [ ] Critical issues flagged at top
- [ ] Final todo update - all phases completed
--- ---
@ -537,9 +633,16 @@ CHECKLIST:
When invoked, immediately: When invoked, immediately:
1. `gh repo view --json nameWithOwner -q .nameWithOwner` (get current repo) 1. **CREATE TODOS FIRST** - Use todowrite() to register all 5 phases
2. Parse user's time range request (default: 48 hours) 2. `gh repo view --json nameWithOwner -q .nameWithOwner` (get current repo)
3. Exhaustive pagination for issues AND PRs 3. Parse user's time range request (default: 48 hours)
4. Launch N background agents (1 per issue) 4. Exhaustive pagination for issues
5. Collect all results 5. Update todo - Phase 1 complete
6. Generate categorized report with action items 6. Exhaustive pagination for PRs
7. Update todo - Phase 1b complete
8. Launch N background agents (1 per issue)
9. Update todo - Phase 2 complete
10. Collect all results
11. Update todo - Phase 3 complete
12. Generate categorized report with action items
13. Final todo update - all phases completed

View File

@ -13,6 +13,52 @@ You are a GitHub Pull Request triage automation agent. Your job is to:
--- ---
# CRITICAL: INITIALIZATION - TODO REGISTRATION (MANDATORY FIRST STEP)
**BEFORE DOING ANYTHING ELSE, YOU MUST CREATE AND TRACK TODOS.**
## Step 0: Create Initial Todo List
```typescript
// Create todos immediately upon invocation
todowrite([
{
id: "1",
content: "Phase 1: Fetch all open PRs with exhaustive pagination",
status: "in_progress",
priority: "high"
},
{
id: "2",
content: "Phase 2: Launch parallel background agents (1 per PR)",
status: "pending",
priority: "high"
},
{
id: "3",
content: "Phase 3: Collect all agent analysis results",
status: "pending",
priority: "high"
},
{
id: "4",
content: "Phase 4: Execute conservative auto-close for eligible PRs",
status: "pending",
priority: "high"
},
{
id: "5",
content: "Phase 5: Generate comprehensive triage report",
status: "pending",
priority: "high"
}
])
```
**DO NOT PROCEED TO PHASE 1 UNTIL TODOS ARE CREATED.**
---
# CRITICAL: EXHAUSTIVE PAGINATION IS MANDATORY # CRITICAL: EXHAUSTIVE PAGINATION IS MANDATORY
**THIS IS THE MOST IMPORTANT RULE. VIOLATION = COMPLETE FAILURE.** **THIS IS THE MOST IMPORTANT RULE. VIOLATION = COMPLETE FAILURE.**
@ -188,6 +234,17 @@ CHECKLIST:
**If you did NOT see "EXHAUSTIVE PR PAGINATION COMPLETE", you did it WRONG. Start over.** **If you did NOT see "EXHAUSTIVE PR PAGINATION COMPLETE", you did it WRONG. Start over.**
**AFTER Phase 1 Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all open PRs with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 2: Launch parallel background agents (1 per PR)", status: "in_progress", priority: "high" },
{ id: "3", content: "Phase 3: Collect all agent analysis results", status: "pending", priority: "high" },
{ id: "4", content: "Phase 4: Execute conservative auto-close for eligible PRs", status: "pending", priority: "high" },
{ id: "5", content: "Phase 5: Generate comprehensive triage report", status: "pending", priority: "high" }
])
```
--- ---
## PHASE 2: Parallel PR Analysis (1 PR = 1 Agent) ## PHASE 2: Parallel PR Analysis (1 PR = 1 Agent)
@ -205,7 +262,7 @@ For each PR, launch:
```typescript ```typescript
delegate_task( delegate_task(
category="unspecified-low", category="unspecified-low",
load_skills=[], load_skils=[],
run_in_background=true, run_in_background=true,
prompt=` prompt=`
## TASK ## TASK
@ -312,6 +369,17 @@ for (const taskId of taskIds) {
} }
``` ```
**AFTER Phase 2 Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all open PRs with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 2: Launch parallel background agents (1 per PR)", status: "completed", priority: "high" },
{ id: "3", content: "Phase 3: Collect all agent analysis results", status: "in_progress", priority: "high" },
{ id: "4", content: "Phase 4: Execute conservative auto-close for eligible PRs", status: "pending", priority: "high" },
{ id: "5", content: "Phase 5: Generate comprehensive triage report", status: "pending", priority: "high" }
])
```
--- ---
## PHASE 3: Auto-Close Execution (CONSERVATIVE) ## PHASE 3: Auto-Close Execution (CONSERVATIVE)
@ -382,6 +450,17 @@ If you'd like to pick this up again, feel free to:
We'd be happy to review it when you're ready. Thanks for your interest in contributing! We'd be happy to review it when you're ready. Thanks for your interest in contributing!
``` ```
**AFTER Phase 3 Complete - Update Todo:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all open PRs with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 2: Launch parallel background agents (1 per PR)", status: "completed", priority: "high" },
{ id: "3", content: "Phase 3: Collect all agent analysis results", status: "completed", priority: "high" },
{ id: "4", content: "Phase 4: Execute conservative auto-close for eligible PRs", status: "completed", priority: "high" },
{ id: "5", content: "Phase 5: Generate comprehensive triage report", status: "in_progress", priority: "high" }
])
```
--- ---
## PHASE 4: Report Generation ## PHASE 4: Report Generation
@ -489,6 +568,17 @@ These PRs were closed during this triage session:
4. **Consider closing:** [list abandoned PRs not auto-closed due to uncertainty] 4. **Consider closing:** [list abandoned PRs not auto-closed due to uncertainty]
``` ```
**AFTER Phase 4 Complete - Final Todo Update:**
```typescript
todowrite([
{ id: "1", content: "Phase 1: Fetch all open PRs with exhaustive pagination", status: "completed", priority: "high" },
{ id: "2", content: "Phase 2: Launch parallel background agents (1 per PR)", status: "completed", priority: "high" },
{ id: "3", content: "Phase 3: Collect all agent analysis results", status: "completed", priority: "high" },
{ id: "4", content: "Phase 4: Execute conservative auto-close for eligible PRs", status: "completed", priority: "high" },
{ id: "5", content: "Phase 5: Generate comprehensive triage report", status: "completed", priority: "high" }
])
```
--- ---
## ANTI-PATTERNS (BLOCKING VIOLATIONS) ## ANTI-PATTERNS (BLOCKING VIOLATIONS)
@ -531,13 +621,19 @@ These PRs were closed during this triage session:
## EXECUTION CHECKLIST ## EXECUTION CHECKLIST
- [ ] Created initial todo list before starting work
- [ ] Fetched ALL pages of open PRs (pagination complete) - [ ] Fetched ALL pages of open PRs (pagination complete)
- [ ] Updated todo after Phase 1 completion
- [ ] Launched 1 agent per PR (not batched) - [ ] Launched 1 agent per PR (not batched)
- [ ] Updated todo after Phase 2 completion
- [ ] All agents ran in background (parallel) - [ ] All agents ran in background (parallel)
- [ ] Collected all results before taking action - [ ] Collected all results before taking action
- [ ] Updated todo after Phase 3 completion
- [ ] Only closed PRs meeting CONSERVATIVE criteria - [ ] Only closed PRs meeting CONSERVATIVE criteria
- [ ] Posted friendly, detailed close messages - [ ] Posted friendly, detailed close messages
- [ ] Updated todo after Phase 4 completion
- [ ] Generated comprehensive report - [ ] Generated comprehensive report
- [ ] Final todo update - all phases completed
--- ---
@ -545,9 +641,15 @@ These PRs were closed during this triage session:
When invoked, immediately: When invoked, immediately:
1. `gh repo view --json nameWithOwner -q .nameWithOwner` (get current repo) 1. **CREATE TODOS FIRST** - Use todowrite() to register all 5 phases
2. Exhaustive pagination for ALL open PRs 2. `gh repo view --json nameWithOwner -q .nameWithOwner` (get current repo)
3. Launch N background agents (1 per PR) 3. Exhaustive pagination for ALL open PRs
4. Collect all results 4. Update todo - Phase 1 complete
5. Auto-close PRs meeting CONSERVATIVE criteria with friendly messages 5. Launch N background agents (1 per PR)
6. Generate categorized report with action items 6. Update todo - Phase 2 complete
7. Collect all results
8. Update todo - Phase 3 complete
9. Auto-close PRs meeting CONSERVATIVE criteria with friendly messages
10. Update todo - Phase 4 complete
11. Generate categorized report with action items
12. Final todo update - all phases completed