# Drain Tickets

> Drain ready-for-agent GitHub tickets via do-work subagents — parallel or sequential, one PR or PR-per-ticket.

- Skill: `kenlck/drain-tickets` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add kenlck/drain-tickets`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kenlck/drain-tickets/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: kenlck (https://skillmd.com/u/kenlck)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kenlck/drain-tickets

---


# Drain Tickets

Orchestrate a queue of `ready-for-agent` tickets through `do-work`. One fresh subagent per ticket. You choose the plan; workers execute.

## 1. Resolve queue

Parse the invocation:

| Input | Queue |
| --- | --- |
| Issue numbers (e.g. `#3 #4 #5`) | Those tickets, in ascending number order |
| Bare `/drain-tickets` | Every open eligible `ready-for-agent` ticket (same eligibility as `do-work`), ascending |

List each ticket: number, title, one-line complexity guess (`high` / `normal`).

If the queue is empty: say so and stop.

**Done when:** the ordered queue is fixed and shown to the user, or the run stopped on an empty queue.

## 2. Confirm plan

Stop and ask before any claim, branch, worktree, or subagent. Require an explicit choice on both axes:

| Axis | Options |
| --- | --- |
| **schedule** | `parallel` (worktrees, fan-out) · `sequential` (one ticket at a time) |
| **pr-shape** | `batch` (one shared branch → one draft PR after the queue) · `each` (draft PR per ticket as `do-work` normally does) |

If the user already stated both axes, echo the plan back and still wait for confirmation.

Show the matrix consequence in one line, e.g. `parallel + batch → worktrees, merge, deferred playwright, one PR`.

**Done when:** the user has confirmed `schedule` and `pr-shape`.

## 3. Drain

Read [worker-brief.md](worker-brief.md) once, then run the confirmed plan.

**Shared rules (every plan):**

- Fresh subagent per ticket — never reuse a worker context.
- Model: `cursor-grok-4.5-high` when complexity is `high`; `composer-2.5` when `normal`.
- Worker runs `do-work` for exactly that ticket, under the overrides in the brief for this `pr-shape`.
- On worker `HITL` / refuse: record it, continue the rest of the queue; do not silent-skip.

### `sequential` + `each`

Loop: next ticket → spawn worker → await → next. Stop when the queue is exhausted.

### `sequential` + `batch`

Create one integration branch from the default base. Loop: spawn worker on that branch with batch overrides → await → next. After the loop, go to Finalize.

### `parallel` + `each`

For every ticket, create a worktree + branch, spawn workers together, await all. Each worker opens its own draft PR.

### `parallel` + `batch`

Create one integration branch from the default base. For every ticket, create a worktree on `issue-<n>-<slug>`, spawn workers together, await all. Merge each worktree branch into the integration branch (ascending issue order). Then Finalize.

**Done when:** every queue ticket has a terminal worker outcome (implemented, `HITL`, or refused), and for `batch` the integration branch holds every successful implement.

## 4. Finalize

### `each`

Summarize: PR URLs, `HITL` / refused tickets, worktrees removed. Stop.

### `batch`

1. One deferred playwright / frontend-artifact round on the integration branch for every UI-touching ticket that succeeded (see `do-work` artifacts).
2. Open one **draft** PR: `Closes #N` for every successful ticket; attach artifact evidence.
3. Clear `WIP` on those successful tickets.
4. Remove worktrees. Summarize successes, `HITL` / refused, and the PR URL.

**Done when:** required PR(s) exist for the confirmed `pr-shape`, `WIP` is cleared on tickets the PRs close, worktrees are gone, and the summary is reported.

