work-batch
/jig:work-batchTyped in Claude Code. In Codex, ask for the jig:work-batch skill by name.
Groups several small, independent issues from one area of the code into one pull request, one commit each: proposes a ranked batch within a point budget, holds back every issue a sensitivity flag makes solo-only, claims the batch, opens the pull request and drives it once; after the merge, closes out every issue in it
Works with · Deliver a change The batched form of do-item, whose batch check suggests it; opens the pull request under do-item’s pull-request policy and starts drive-pr on it
Run these commands in Bash or PowerShell with Bun, Git and GitHub CLI available to the command tool. Write tracker bodies and intent input with the file-writing tool, then pass file paths; branch names are read from the policy command output.
What problem this solves. Most of the cost of a pull request is its review: the rounds of reviewer comments, the fixes, the waits for continuous integration (CI). That cost is paid per pull request, not per line. A team that opens one pull request for each small issue pays it again for each one, and small issues often arrive faster than that pace can close them. Running several of those pull requests at once over the same files does not help: they conflict with each other. Without batching, the backlog of small issues grows, or it turns into merge conflicts. With it, an agent groups several small, independent issues from one area of the code into one pull request, with one commit for each issue. The batch then goes through review once, and five closures cost about what one costs.
/jig:work-batch is that practice as a skill. The agent’s procedure is
SKILL.md; the constraints and their reasons are in
references/batch-policy.md.
A dispatcher can launch a batch from a served person’s queue. Its named items are the maximum scope, and each claim preserves that person as assignee. The claim checks inherited assignment and writer provenance live; a refused item stops the batch. A question needing a person stops the headless pass and is recorded with the launch result. When it concerns particular members, include their exact tracker keys in the question, so the dispatcher places it on those members. Members the question does not name, and that the pass never claimed, are picked up again by the usual rules; a claimed member is not restarted automatically. Leave keys out for a batch-wide question, which is shown once on the batch anchor; the siblings wait on it with no need of their own, and answering it releases those the pass never claimed.
Contents: the procedure · anchors · solo-only issues · batch size · ranking · tracker reads · configuration · after the merge · evidence · the eligibility mode · left out
The procedure
- Propose. A script takes a batch anchor (an area of the code, a path, an epic or one issue; see anchors), reads the open issues that match it, holds back every issue that may not join a batch, ranks the rest and fills a batch up to a size budget. It prints the proposed batch, the issues it held back with the reason for each, and the matching issues that have no size or no priority (a labelling gap, which would otherwise make an area look empty, or leave an unranked issue to be batched as the least urgent).
- Check. The agent reads each proposed issue in full (description and
comments) and confirms what the script cannot: the issues are
independent of each other, none is larger than its size label says, and
each
mediumissue gets an explicit decision: re-size it, keep it, or leave it for its own pull request. A batch the dispatcher forms has nobody to decide, so an issue of the most expensive batchable size (mediumby default) stays out of it and is picked up on its own; when every batchable size costs the same, none is kept out. - Claim. Just before claiming, the agent runs the proposal again and
drops any issue whose state, assignee, priority, size, type, context or
flags changed since the first run: a new flag or an urgent priority holds
the issue back on the re-run, and the rest are on its revalidation line.
It compares ids, not names: a state or a person can be renamed, and two
can share a name. It then moves each issue to
in_progress, assigns itself and comments on each one, naming the other issues in the batch. It records each issue’s state and assignee as they were before the claim, for a release in step 4, and writes the batch form of the intent chain. - Implement. One commit for each issue, each one validated before it is
committed. A bug gets the same sibling scout
do-itemruns for a single bug. When the batch has grown past its budget after implementing, it is trimmed: the lowest-ranked issues and their commits come out; each is released (back to the state and assignee recorded at the claim, unless someone else changed them since, which the agent reports instead) with a comment saying why; when nothing remains, the session’s intent-chain copy is removed, no pull request opens and the released issues are reported; otherwise the highest-ranked remaining issue becomes the anchor when the anchor left, the intent chain is rewritten for what remains, and every remaining issue gets a comment naming the batch as it now stands. - Open one pull request through
do-item’s pull-request policy. Its body carries a table with one row for each issue:Closes <key>, the issue’s commits, and what changed. The per-issueClosesline is what closes each issue on merge. - Drive it once with
/jig:drive-pr: one drive covers every issue.
Anchors
| Anchor | Pool |
|---|---|
| Change-area name | Open issues carrying a label that names the area, and a batchable size |
| Path in the repository | The same, for each area the path belongs to |
| Epic | The epic’s open children |
| One issue | Open issues sharing its area-naming label; the issue itself is kept first when it is eligible, and an ineligible one ends the proposal with a recommendation to work it alone |
The area and path anchors read the change-area catalog
(drive.change_areas_catalog): the same tracker.labels that label an issue
for an area define which issues belong to it, so there is one answer, not a
second hand-kept list. A path belongs to the areas whose own paths match it
directly, not the areas they imply. An area whose own tracker.flags include
a solo-only flag cannot be an anchor: every change there carries the flag, so
no batch is possible.
An area’s labels can include shared ones, such as a broad domain label that
several areas carry. Only a label that names the area itself narrows the
pool; the others add to an issue’s rank. Which labels name an area is
already configured: do_item.agents.codearea_areas maps a label to the area
it routes to. When an area has no such label, its shared labels would select
issues from unrelated areas, and the script refuses the anchor instead of
proposing a batch of unrelated issues.
Solo-only issues
A solo-only issue never joins a batch. Its sensitivity flag starts a review gate or a human step that applies to the whole pull request: a database migration review, an interface-contract review, a privacy review, a manual operation after merge, or a decision that is a human’s to make (HITL). In a batch, that gate would run over five unrelated changes, or all six issues would wait for the one human.
The label names are each repository’s values, so the list is derived, and configuration can only add to it:
- the labels
issue_tracker.labels.hitl(and its facets) andissue_tracker.labels.manual_opsname; - every label any area’s
tracker.flagsnames in the change-area catalog, since a catalog flag exists to start a gate; work_batch.solo_flags, for flags the catalog does not project (a privacy label applied by hand, for example).
No setting removes a label the first two sources supply. An issue carrying any of them, in any case, is held out of a batch: the flags are one rule over the issue’s labels, matched as the rule matchers’ chapter says.
Every other read that cannot be completed holds the issue back rather than admitting it. An issue whose label list came back truncated is held back, because a solo-only flag could be on the part that was not read. An issue with no size, no type, or only context or area labels the configuration does not know is held back too, with a reason that says what to set. An issue with no priority is held back last and listed as a labelling gap: it is unranked, not the least urgent. The issue is not dropped without a word.
Where the repository’s label taxonomy has a size group, size and type are issue facets: the tracker reads them wherever it keeps them, labels or its own fields, and each size a setting names is read as a size or as the label of one. Without a size group they are read from labels, as before.
Provenance labels are not sensitivity flags. An issue filed from a review
finding (issue_tracker.labels.followup) is already-owed work, already
scoped, and it ranks higher.
Batch size
A batch has two limits, applied in one pass down the ranked list: take each issue that still fits both, skip (do not stop at) one that does not.
- Points (the main limit). Each size costs points:
xs1,small2,medium6, against a budget of 16. At those numbers at most twomediumissues fit, and a batch of onlyxsandsmallissues reaches the item limit first. - Items (the second limit), 6 by default. Points do not limit how many separate concerns one review round must hold; this does.
- Changed lines, checked after implementing, since the diff does not
exist when the batch is proposed. It reads
pull_requests.size_budgetwhen the repository sets one.
Ranking
The proposal fills the batch in rank order. An issue’s score is the sum of:
- the weight of its size label, so that cheaper issues come first;
- the weight of the follow-up label, when it carries it;
- the weight of each shared area label it carries, so an issue that touches the anchor’s wider domain ranks above one that only names the area.
Higher scores come first. Ties go to the tracker’s priority (urgent first,
no priority last), then to the older issue, then to the issue key in text
order, so the input order never decides which issue fits the budget. The
defaults are size {xs: 2, small: 1, medium: 0}, 3 for the follow-up label
and 1 for a shared area label; work_batch.ranking replaces any of them.
The skill’s tests pin these defaults, so a repository that sets nothing gets
the same order on every machine.
Tracker reads
The proposal reads the tracker only through the
tracker interface: open issues filtered by several
label conditions, the open children of an issue, and one issue in the same
form. Each result carries what eligibility and ranking read: priority,
creation time, the state and the assignee with their ids, every label,
whether the issue has open children, and which nested lists were truncated.
A pool is read to the end or the read fails, and it is scoped to the
configured team on Linear (issue_tracker.team) or the configured repository
on GitHub Issues; an empty label condition is refused, since it would widen
the pool to every open issue.
Configuration
The work_batch section, in CONFIGURATION.md:
| Field | Default | What it does |
|---|---|---|
work_batch.point_budget | 16 | The main limit |
work_batch.size_points | {xs: 1, small: 2, medium: 6} | Points each batchable size costs; its keys must be exactly issue_tracker.labels.batch_sizes |
work_batch.max_items | 6 | The item limit |
work_batch.solo_flags | [] | Labels added to the derived solo-only list |
work_batch.sizes | none | Every size label, batchable or not, so the gap report can tell “no size” from “too large” |
work_batch.ranking | the weights in ranking | Score for each size, for the follow-up label and for each shared area label |
The rest comes from fields other skills read too: the batchable sizes
(issue_tracker.labels.batch_sizes), the repository label a batch item must
carry (review.repo_label, one of review.taxonomy.repos; not required on a
GitHub tracker whose taxonomy names no other repository), the type labels
and context-label prefixes (review.taxonomy), the follow-up label, the
line budget, and the catalog path. The audit skill’s configuration check
refuses size_points that do not price exactly the batchable sizes.
After the merge
Every issue the batch closes needs the steps a single issue gets after its
pull request merges: the closing comment, label reconciliation, and moving
its epic forward (do-item’s reconcile_parent_status.ts). The batch’s own
Closes table is the list: the skill runs the post-merge steps for each row,
not once for the pull request. Each issue stops where do-item’s
post-merge rule says, do_item.post_merge_state included, and where the
repository names a pr_open state each issue moves there when the batch’s
pull request opens.
Evidence
The skill ends each batch by recording its processed/follow-up ratio: issues
it processed, against new follow-up issues its review rounds filed, with how
many processed issues reached done and how many stay open under the
post-merge policy reported separately. That ratio is the only evidence that
batching completes small issues faster than review creates follow-up work,
rather than just feeling faster.
The eligibility mode
A tool that judges many issues at once, such as a dashboard panel ranking possible batches across the whole backlog, runs the proposal script’s eligibility mode instead of keeping a copy of the rules: it hands over issues in the tracker interface’s form and gets back, for each, the verdict and reason the proposal would give, with the effective policy (the solo-only flags, the batchable sizes, the points). The plugin is installed per machine, not as a package a repository can import, so this versioned JSON document is the contract; its format is in SKILL.md.
Left out
- Ranking batches across the whole backlog (a dashboard panel). It needs a dashboard and a backlog snapshot that Jig does not have; a repository that has both builds the panel on the eligibility mode.
- Batches across repositories. A pull request lands in one repository, so a batch does too.
- Changing the review-finding scope rule for batches. A batch with a
mediumissue usually passes the line count at which a review finding that widens scope is deferred rather than fixed in place. Whether that rule should change for batches is a separate decision, made from the processed/follow-up ratios.
Source: plugin/skills/work-batch/README.mdThe agent's contract (SKILL.md)