|
| 1 | +--- |
| 2 | +name: process-issues |
| 3 | +description: > |
| 4 | + Process a batch of GitHub issues end-to-end: fetch unlabeled issues, triage |
| 5 | + them, apply labels, fix the actionable ones, and babysit the resulting PRs. |
| 6 | + Use this skill when the user wants to work through the issue backlog |
| 7 | + autonomously — e.g. "process issues", "work through the backlog", "run the |
| 8 | + issue pipeline". Accepts an optional batch size: "process issues 5". |
| 9 | + Pairs well with /loop for continuous background processing. |
| 10 | +--- |
| 11 | + |
| 12 | +# Process Issues |
| 13 | + |
| 14 | +Fetches a batch of unprocessed GitHub issues, triages each one, labels it, |
| 15 | +fixes the actionable ones, and babysits the resulting PRs. |
| 16 | + |
| 17 | +## Arguments |
| 18 | + |
| 19 | +- Batch size (optional, default 10): number of issues to process per run. |
| 20 | + E.g. "process issues 5" or "process issues --batch 5". |
| 21 | + |
| 22 | +## Labels |
| 23 | + |
| 24 | +These labels track agent processing state. Create any that don't exist yet |
| 25 | +with `gh label create --repo docker/docs <name> --color <hex>`. |
| 26 | + |
| 27 | +| Label | Meaning | |
| 28 | +|-------|---------| |
| 29 | +| `agent/triaged` | Agent has analyzed this issue; verdict in a comment | |
| 30 | +| `agent/fix` | Agent has opened a PR for this issue | |
| 31 | +| `agent/skip` | Triaged; not actionable (STALE, UPSTREAM, INDETERMINATE, CLOSEABLE_FIXED) | |
| 32 | + |
| 33 | +## Workflow |
| 34 | + |
| 35 | +### 1. Resolve fork username and fetch a batch |
| 36 | + |
| 37 | +Get the authenticated user's GitHub login — don't hardcode it: |
| 38 | + |
| 39 | +```bash |
| 40 | +FORK_USER=$(gh api user --jq '.login') |
| 41 | +``` |
| 42 | + |
| 43 | +Fetch up to N open issues that have none of the `agent/*` labels: |
| 44 | + |
| 45 | +```bash |
| 46 | +gh issue list --repo docker/docs \ |
| 47 | + --state open \ |
| 48 | + --limit <N> \ |
| 49 | + --json number,title,labels \ |
| 50 | + --jq '[.[] | select( |
| 51 | + ([.labels[].name] | map(startswith("agent/")) | any) | not |
| 52 | + )]' |
| 53 | +``` |
| 54 | + |
| 55 | +If there are no unprocessed issues, report that the backlog is clear and stop. |
| 56 | + |
| 57 | +### 2. Triage each issue |
| 58 | + |
| 59 | +Follow the full **triage-issues** skill workflow for all fetched issues, |
| 60 | +running fetches in parallel. Produce a verdict for each: |
| 61 | +OPEN, CLOSEABLE_FIXED, UPSTREAM, INDETERMINATE, or STALE. |
| 62 | + |
| 63 | +### 3. Label each issue immediately after verdict |
| 64 | + |
| 65 | +Apply `agent/triaged` to every issue regardless of verdict — it means "we |
| 66 | +looked at it." Then apply a second label based on the outcome: |
| 67 | + |
| 68 | +```bash |
| 69 | +# All issues — mark as triaged |
| 70 | +gh issue edit <number> --repo docker/docs --add-label "agent/triaged" |
| 71 | + |
| 72 | +# Non-actionable (STALE, UPSTREAM, INDETERMINATE) |
| 73 | +gh issue edit <number> --repo docker/docs --add-label "agent/skip" |
| 74 | + |
| 75 | +# Already resolved (CLOSEABLE_FIXED) — close with explanation |
| 76 | +gh issue close <number> --repo docker/docs \ |
| 77 | + --comment "Closing — <one sentence explaining what resolved it>." |
| 78 | + |
| 79 | +# Actionable (OPEN, no existing PR) — no extra label yet; agent/fix applied after PR is created |
| 80 | +``` |
| 81 | + |
| 82 | +Leave a comment on every issue summarising the verdict and reasoning in one |
| 83 | +sentence. Do this immediately — don't batch it for the end. |
| 84 | + |
| 85 | +### 4. Fix actionable issues |
| 86 | + |
| 87 | +For each issue with verdict OPEN and no existing open PR, follow the |
| 88 | +**fix-issues** skill workflow. |
| 89 | + |
| 90 | +Skip issues where: |
| 91 | +- An open PR already exists |
| 92 | +- Verdict is anything other than OPEN |
| 93 | +- The fix requires changes to `_vendor/` or `data/cli/` (upstream owned) |
| 94 | + |
| 95 | +After the PR is created, apply `agent/fix` to the issue: |
| 96 | + |
| 97 | +```bash |
| 98 | +gh issue edit <number> --repo docker/docs --add-label "agent/fix" |
| 99 | +``` |
| 100 | + |
| 101 | +### 5. Babysit PRs |
| 102 | + |
| 103 | +After opening PRs, schedule a recurring check with `/loop` so babysitting |
| 104 | +continues asynchronously after the batch summary is reported: |
| 105 | + |
| 106 | +``` |
| 107 | +/loop 5m babysit PRs <#N, #M, …> in docker/docs — check for failing checks, |
| 108 | +new review comments, and requested changes; investigate and fix anything that |
| 109 | +needs attention; stop looping once all PRs are merged or closed |
| 110 | +``` |
| 111 | + |
| 112 | +At each check, for every open PR: |
| 113 | + |
| 114 | +- **Failing checks**: investigate the failure, fix the cause, force-push an |
| 115 | + updated commit to the branch via the GitHub API |
| 116 | +- **Review comments**: read them, address the feedback, push an update, reply |
| 117 | + to the comment |
| 118 | +- **All clear**: note it and move on |
| 119 | + |
| 120 | +Don't just report status — act on anything that needs attention. |
| 121 | + |
| 122 | +### 6. Report results |
| 123 | + |
| 124 | +``` |
| 125 | +## Batch summary |
| 126 | +
|
| 127 | +Processed: <N> issues |
| 128 | +PRs opened: <n> |
| 129 | +Skipped: <n> (STALE: n, UPSTREAM: n, INDETERMINATE: n) |
| 130 | +Closed: <n> (already resolved) |
| 131 | +
|
| 132 | +### PRs opened |
| 133 | +| Issue | PR | Checks | Review | |
| 134 | +|-------|-----|--------|--------| |
| 135 | +| #N | #M | ✅ | pending | |
| 136 | +
|
| 137 | +### Skipped |
| 138 | +| Issue | Verdict | Reason | |
| 139 | +|-------|---------|--------| |
| 140 | +| #N | STALE | ... | |
| 141 | +``` |
| 142 | + |
| 143 | +## Notes |
| 144 | + |
| 145 | +- **Fork username**: always resolve dynamically with `gh api user --jq '.login'` |
| 146 | +- **One issue, one PR**: never combine multiple issues in a single branch |
| 147 | +- **Validation**: skip `docker buildx bake lint vale` unless the change is |
| 148 | + complex — it's slow and the basic checks run automatically on the PR |
| 149 | +- **Resumability**: labels are applied immediately at triage time, so if the |
| 150 | + session ends mid-run the next run skips already-processed issues automatically |
0 commit comments