work-batch
The procedure an agent follows when it runs work-batch. For people, the work-batch guide explains it.
Most of the cost of a pull request (PR) is its review: the rounds of comments, the fixes, the waits for continuous integration (CI). That cost is paid per pull request, not per line, so a team that opens one pull request per small issue pays it again for each, and several single-issue pull requests over the same files turn into merge conflicts. This skill groups several small, independent issues from one area of the code into one batch: one pull request, one commit per issue, one drive through review.
It owns the proposal (which issues may join, ranked and fitted to a budget),
the claim, the batch’s commit and pull-request conventions, and the steps
after the merge for every issue the batch closes. It delegates the rest:
validation and the pre-PR review to the repository’s plan and do-item’s
gate, the review rounds to /jig:drive-pr. The human
page is README.md; the policy and its reasons are in
references/batch-policy.md.
Paths and working directory
${CLAUDE_SKILL_DIR} below stands for the absolute path of the directory
containing this SKILL.md. Claude Code fills it in. In any other harness,
replace it with that path yourself before running a command: a shell would
expand the unset variable to an empty string. Sibling skills are reached the
same way, e.g. ${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts.
Run every command from the root of the repository the issues belong to.
Never cd into the skill directory: the scripts find the repository and its
configuration from the working directory.
Configuration
The skill reads .config/jig.yaml through the plugin’s configuration reader.
Its own section is work_batch (point_budget, size_points, max_items,
solo_flags, sizes, ranking); every field, its default and the other
fields it reads (the label roles, the repository, type and context labels,
do_item.agents.codearea_areas, drive.change_areas_catalog) are in the
plugin’s configuration reference. To
read one value yourself, run
bun "${CLAUDE_SKILL_DIR}/../resolve-review-comments/scripts/jig-config.ts" <field>.
Asking the user
Where a step needs a person’s answer (a verdict in step 2, an issue left
for a person to settle), use AskUserQuestion under Claude Code where the
session can use it; in any interactive harness where it cannot (another
harness, or a permission mode that denies the tool), ask a plain-text
numbered question and end the turn (one numbered line per option, the recommended one first and marked as the default where there is one, which the reply default takes). With nobody to answer, stop and state the question. Never pick on the
user’s behalf. A member’s size in a dispatched served batch is no question:
step 1 says what happens to it.
When not to batch
Work the issue alone with /jig:do-item when:
- It carries a solo-only flag, making it a
solo-only issue:
the human-in-the-loop label and its facets, the manual-operations label,
every flag an area of the change-area catalog carries (a database-migration
flag, an interface-contract flag), and
work_batch.solo_flags. Each starts a review gate or a human step that applies to the whole pull request: in a batch that gate would run over unrelated changes, or every issue would wait for the one human.candidates.tsholds these back itself, and no setting removes one. - The anchor area carries such a flag itself. Every change there carries it, so no batch is possible; the script refuses the anchor.
- It is urgent. A batch shares its slowest issue’s fate.
candidates.tsholds it back, and refuses it as the anchor, an urgent epic included. - It is larger than the batchable sizes, or turns out to be.
Workflow
1. Propose
Dispatched served batch. A dispatcher launch may name a fixed set of
items, their served tracker identity and each inherited item’s ancestor
epic. That set is the maximum scope; do not add siblings. Use the first named key as the anchor. Run the proposal
and its revalidation with every fixed key, in the launch’s order, in
--fixed, and with the launch’s --missing-priority value (hold or start): the script
reads only those items, and their existing served assignment does not
exclude them. That value is the dispatch.missing_priority the dispatcher
read from the default branch; never read the setting from this workspace’s
configuration, which nobody reviewed. Keep only named items the other
eligibility checks permit. This flag does not claim an item: the live claim
below still checks its state, assignment, holds and assignment provenance.
Read the full issues and assess their independence as for any batch.
The dispatcher keeps the most expensive batchable size, and every item with
no priority, out of the batches it forms, but a size or a priority can change
after the tick. A member’s size or missing priority is never a question
here. The proposal lists each member of that size, each whose size no
longer fits a batch (too large, cleared, or two at once), and each whose
priority was cleared, under Left for their own pickups (leftOut in the
JSON form), and no verdict prompt appears:
- Claim no member left out, except as the third bullet says when fewer than
two members are kept. Name each one and the reason in the pull
request’s body (the
## Batchsection, for a batch) and in the closing report. When the pass ends with a claim made and no question open, its launch record holds only the members it claimed, and the dispatcher picks up the others on their own. - With two or more members kept, go on with them as the batch.
- With fewer than two kept, the pass still has to claim one, or its launch
record keeps holding every member. The proposal names it (
alone.claimin the JSON form, “workalone” in the table): the member kept, or, when none is, the first member left out whose priority is set, or, under --missing-priority start, the first member left out. Run/jig:do-itemfor it, passing that item’s--forand--ancestorto its claim. Every other member stays unclaimed for its own pickup. When the proposal names none (alone.claimisnull, “none may start” in the table) and lists the members held for their missing priority (alone.heldForPriority), claim none and start no item: end the pass with the launch’s result command asfailed, naming each member and that its priority is missing, and pass--refused <that member's updatedAt> --key <that member>once for each, with one--reason "priority is missing"(or one--reasonper member) in the same invocation, since the result is refused without it, so the dispatcher holds each only until the member changes: setting a priority moves itsupdatedAtand makes the next tick pick it up again. - The workspace opened under the first named key, on that key’s branch. When
that member is left out, work on the branch named for the member you claim
(step 4, or
/jig:do-item’s), so the member’s own pickup can use its branch.
Any other question that needs a person ends the pass with Question:. Frame
it as a decision record and record the failed result with it through the
launch’s result command (failed --decision <file>, as the prompt says).
Include the exact tracker key of each member the person is being asked to
decide about in the question itself. For a batch-wide question, leave the
member keys out so the dispatcher shows one question for the batch.
Never choose for them.
bun "${CLAUDE_SKILL_DIR}/scripts/candidates.ts" "<anchor>" [--budget N] [--limit N] [--claimed "KEY,KEY"] [--fixed "KEY,KEY" [--missing-priority POLICY]] [--format json]<anchor> is one of:
| Anchor | Pool |
|---|---|
| A change-area name | Open issues carrying a label that names the area (do_item.agents.codearea_areas) and a batchable size |
| A path in the repository | The same, for each area whose own paths match the path |
| An epic’s key | The epic’s open children |
| One issue’s key | Open issues sharing its area-naming label; the issue is kept first. An issue that may not join a batch itself ends the run with a recommendation to work it alone |
An issue key is ENG-123 on Linear and Jira and #123 on GitHub Issues, an issue of
the configured repository; this document writes it as <KEY>. Quote a key,
and an anchor, on a command line: an unquoted # starts a shell comment.
An issue’s size and type are its
facets where the
repository’s label taxonomy has a size group: the tracker reads them
wherever it keeps them (labels, or the tracker’s own fields), and each size
the settings name (issue_tracker.labels.batch_sizes, work_batch.sizes,
size_points, ranking.sizes) is read as a size, or as the label of one.
Without a size group they are read from the labels, as the settings name
them.
The batch is filled in rank order to a point budget (each size costs points)
and an item limit, whichever binds first, skipping an issue that does not fit
rather than stopping at it. --budget and --limit override
work_batch.point_budget and work_batch.max_items for one run.
Anchoring on an issue already started and assigned to you? Add
--claimed "<its key>". Without it the script reads the issue’s own state and
assignee as someone else’s work and refuses it as the anchor.
Read each list the script prints:
- Left for their own pickups: each member of the most expensive
batchable size, or whose size no longer fits, which the dispatcher picks up
on its own (
leftOutin the JSON form). - Proposed batch: each issue’s size, points and score, its revalidation
line (below) and, under each issue of the most expensive batchable size
(
mediumby default), a verdict prompt for step 2. With--fixedno such issue is proposed, so no prompt appears. - Held back: each issue that may not join, with its reason. A reason that names a label to add (no size, no type, no repository or context label, a context or area label the configuration does not know) is a labelling gap: fix the label and re-run. The solo-only rows must stay held back.
- Labelling gaps: issues matching the anchor that have no size, so the
pool read never returned them, or no priority, so they are unranked and
left out; each row says which it lacks (an epic needs no size). Set what
each lacks (
/jig:file-issueplans an existing issue) and re-run: the re-run decides whether they are batchable.[also: …]names a blocker their labels already show; a bare row means no known blocker, not batchable. An epic anchor reads no gaps with no size: a child with no size is held back instead.
A WARNING line means part of the picture is missing (a gap read that
failed, labels that came back truncated, a seed over budget); say so in your
status message.
2. Check the proposal as a batch
Read each proposed issue in full first: its description and its comments
(bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/get_issue.ts" "<KEY>" and
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/list_comments.ts" "<KEY>"). A proposal carries titles and labels only. Then
confirm what the script cannot:
- The issues are independent. Two whose fixes touch the same function are one issue: merge them in the tracker or drop one.
- None is larger than its size label says. A size label is an estimate; drop one you doubt.
- The issues share one base. With
pull_requests.base_rulesdeclared, runbun "${CLAUDE_SKILL_DIR}/../do-item/scripts/pr-plan.ts" branch --issue "<KEY>" --title "<title>" --issue-json <that issue's JSON file>for each issue, add--json, and compare only thebasevalue it prints, never the rule or label that chose it. Issues whose bases differ cannot share a pull request: keep the group with the explicit anchor issue (the highest-priority issue when the anchor is an area, path or epic) and leave the rest for their own pull requests. Repeat the comparison whenever you trim the batch or re-anchor it. - One area is preferred. An epic anchor may span two; a mixed batch takes the union of both areas’ validation and mandatory reviews. Split unless the anchor is why the areas mix.
- Each issue under a verdict prompt gets an explicit verdict from the person running the batch: re-size it (fix the label, then re-run so the budget prices it), keep it in the batch, or leave it for its own pull request.
The constraints and why: references/batch-policy.md.
3. Claim
exact — Just before claiming, re-run step 1’s command and compare each
issue’s revalidation line with the first run’s. The line prints these
fields: state, assignee, priority, size, type, repo, context,
with ids in angle brackets.
Compare the ids, not the names: a state or a person can be renamed, and two
can share a name. Drop every issue whose line changed, that left the
proposal, or that the re-run now holds back: a priority raised to urgent
holds the issue back, and a changed assignee means someone else took it.
Record, for each issue you keep, its state and assignee ids from that line: the release in step 4 restores them. Then, for each:
-
Claim it (assign it to yourself and move it to
in_progress), as/jig:do-itemStep 4a item 2 does:bash bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" claim "<KEY>" --work-batch--work-batchmarks the claim as a batch member’s: the claim does not read the member’sblocked_byrelations, and it refuses--override-blockers(exit2), so a batch never starts an item on a person’s override. Never drop it, and never pass--override-blockershere; an item a person wants started early goes through/jig:do-itemon its own. For a dispatched served batch, append--for "<identity>"and that item’s--ancestor "<epic-key>"when supplied. Keep each identity and ancestor as one quoted argument. Preserve the served assignee. Use the script transport for this claim; a native tracker update does not perform its guards. Never retry a refusal without those options.On exit
3(someone already holds it) or4(another claim landed first), stop the batch, release the issues already claimed in this loop (step 4’s release, which preserves concurrent changes) and report the refused claim. A fixed served batch cannot safely continue after one of its members changes.The exception is a refusal by the repository’s start rules, exit
3with"why": "preflight"(itsdo_item.preflight_command) or"why": "state"(a state outside itsdo_item.claim_from) in the JSON on standard output (the reason is on stderr): nothing was written for that issue, so in an ordinary batch drop it, name it and its reason in the report, and go on with the rest; when fewer than two issues remain, release the ones claimed (step 4’s release) and stop. A fixed served batch stops too, after releasing the members already claimed by the same release; for apreflightrefusal that carries an"updatedAt", it records the result command its prompt names with--refused <that updatedAt> --key <that issue>, so the dispatcher holds only that member and launches the rest again without it. A person’s word to proceed does not clear it: the item or the repository’s rules change first.Any other way the loop ends without every claim made (a nonzero exit other than
3or4, a thrown error, a transport or configuration failure) also stops the batch: release the issues already claimed in this loop (step 4’s release) and report the failure.(judgment — native, only where none of
do_item.preflight_command,do_item.claim_fromanddo_item.claim_markeris set; with one set, a native write skips the repository’s start rules, so claim through the script above. Read the issue and stop on the same refusals, save its state and assignee through the harness’s tracker tool (the mapped state name, assignee “me”), then read it again and stop the batch when it shows another assignee, or is gone or no longer in the mapped state.) -
Once every claim above is settled, choose the anchor: the original anchor, or when a start-rules refusal dropped it, the highest-ranked issue still claimed. Then comment on each issue you kept claimed, naming that anchor and every other claimed issue in the batch (never one dropped or refused), so a second agent sees it is spoken for and by which batch (
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" comment "<KEY>" --body-file body.md). Once the last issue is commented on, remove the file (bun "${CLAUDE_SKILL_DIR}/../../shared/command.ts" -- git clean -f -- body.md): a file left in the worktree keeps the drive from converging.
Then write the batch form of the
intent chain, as /jig:do-item
Step 3.5
describes, with "mode":"batch", the anchor as issue (for an area or path
anchor, the highest-ranked issue; when a start-rules refusal dropped the
anchor, the highest-ranked issue still claimed), the anchor’s parent as epic when it has
one, and every claimed issue in items. Write that JSON to batch-intent.json
with the file-writing tool:
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/intent-chain.ts" --input batch-intent.json
bun "${CLAUDE_SKILL_DIR}/../../shared/command.ts" -- git clean -f -- batch-intent.jsonRun the second command only after the first exits 0; it removes the input
file so the worktree stays clean. Keep the pickupId the first prints: the pull request is captured with it in step 5.
4. Implement, one commit per issue
Name the branch with the pull-request policy, after the highest-priority
issue in the batch. The branch operation of pr-plan.ts only prints: the
name on its first line and the base on its second (base: <base> …; with
pull_requests.base_rules declared, pass --issue-json with that issue’s
JSON so its labels choose the base). Create the
branch from that base and switch to it before the first commit
(<remote> is the repository’s git remote: repository.remote, else
origin):
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/pr-plan.ts" branch --issue "<highest-priority KEY>" --title "<that issue's title>" --issue-json <that issue's JSON file>
bun "${CLAUDE_SKILL_DIR}/../../shared/command.ts" --timeout-seconds 3600 -- git switch -c <printed-branch-name> <remote>/<base>When a branch of that name already exists for this batch, switch to it
rather than creating a second one. When the harness has already created the
working branch and its instructions forbid renaming it, keep that branch and
say so, as /jig:do-item does. Never commit the batch on the integration
branch or on another task’s branch.
For each issue, in rank order: read it in full again if step 2 was long ago;
when it is a bug that can recur elsewhere and carries no pattern evidence,
run the same sibling scout /jig:do-item Step 4a runs for a single bug
(three or fewer mechanically identical siblings go into this issue’s commit;
more become their own issues); implement it; run the repository’s validation
plan on what is staged for it; then commit it alone:
fix(<scope>): <what this issue changed> (<KEY>)
Refs: <KEY>One commit per issue is what keeps the batch reviewable and lets one issue be reverted without the others.
After implementing, check the size again. The open operation of
pr-plan.ts (step 5)
measures the diff against pull_requests.size_budget, and step 2’s reading
may have grown an issue. When the batch has grown past its budget, trim it in
this order:
-
Take out the lowest-ranked issues and their commits (revert those commits, or an interactive rebase on the unpushed branch). Unassigning an issue alone would leave its diff in the pull request.
-
Release each issue taken out. Read it again first. If its state and assignee ids are still the ones the claim set, move it back to the state recorded at the claim (
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" transition "<KEY>" <canonical-state>;bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" statesmaps a name to its canonical key) and restore the recorded assignee. If someone changed either since the claim, leave that change in place and name the issue in your report for a person to settle. Either way, comment on it that it left the batch and why. -
Stop if nothing remains. Undo everything step 3 wrote: the issues are released by substep 2; remove this session’s intent-chain copy, so Refocus stops putting released issues in front of you, and drop the
pickupId:bash bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/intent-chain.ts" --clear-sessionWrite no replacement chain (a batch chain with no issues is not valid), open no pull request, return the branch to the commit it started from, and report the released issues.
-
Re-anchor. The chain’s
issueis rendered apart fromitems: when the anchor was released, the highest-ranked remaining issue becomes the anchor. -
Rewrite the intent chain for the remaining issues, as in step 3, and keep the new
pickupId: the pull request is captured with it, so the drive is never pointed at a released issue. -
Comment on every issue still in the batch, naming the batch as it now stands, so no batch comment names an issue the pull request will not close.
5. Validate, review and open one pull request
Run the validation plan over the whole batch diff, then /jig:do-item’s
pre-PR code review gate (Step 4a) once over the union, with every mandatory
review gate any issue’s labels or paths name. Then plan the pull request:
bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/pr-plan.ts" open --issue "<highest-priority KEY>" --issue-json <that issue's JSON file> [--json]Follow the plan as /jig:do-item’s
pull-request policy says,
including its refusals (exit 3 over size_budget means trim, step 4).
The body carries the plan’s template and a table with one row per issue:
the issue-link line the plan prints, in its form, for that row’s key
(Closes <KEY> by default), the issue’s commits and what changed:
## Batch
Anchor: `billing` (change area). 4 issues, 9 of 16 points.
| Issue | Commits | What changed |
|-------|---------|--------------|
| Closes <KEY> | `a1b2c3d` | Rounded the invoice total once, at the end |
| Closes <KEY> | `d4e5f6a` | Named the missing currency in the error |
| Closes <KEY> | `b7c8d9e` | Paged the refund list |
| Closes <KEY> | `f0e1d2c` | Removed the unused export |A row per issue is what closes each issue on merge: an issue named only in
prose stays open, which is how a member left out of a dispatched batch is
named, below the table, with the reason. Add the ## Out-of-tree follow-ups
section /jig:do-item requires, for every issue.
Once the pull request is open, and before the drive arms, move each issue
to pr_open as /jig:do-item’s “Move the item to pr_open” (Step 4a)
says: where bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" states
names pr_open, post the comment linking the pull request on the issue,
then bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" transition "<KEY>" pr_open.
Where it maps pr_open to null, skip this.
6. Drive it once
Capture the intent chain with the pickupId from step 3 (or step 4’s
rewrite), then arm the drive exactly as /jig:do-item’s “Arm the drive”
(Step 4a) says: run drive-pr’s arm script, emit its command, act on its
status as do-item’s step 2 lists (a terminal tab, a background spawn
under Claude Code, or the command only), never a second driver, and post
the tracker comment with the arm outcome on every issue in the batch. One
drive covers every issue.
bun "${CLAUDE_SKILL_DIR}/../drive-pr/scripts/capture-intent-chain.ts" <PR> --pickup <pickupId>
bun "${CLAUDE_SKILL_DIR}/../drive-pr/scripts/arm-drive.ts" <PR>After the merge
When the batch pull request merges, run /jig:work-batch after-merge <PR>.
The batch’s own table is the issue inventory: every issue-link row gets the
steps a single issue gets after its pull request merges, not only the first.
-
List the rows:
bun "${CLAUDE_SKILL_DIR}/../../shared/command.ts" -- gh pr view <PR> --json "body,mergeCommit,mergedAt"and take every issue key in the table’s issue-link cells. A row closes its issue automatically only when the configured issue-link policy usesCloses; withrefs, post-merge policy transitions the issue instead. -
For each row:
- Status:
/jig:do-item’s post-merge status rule decides:done, orops_pendingwhen a manual, operational or legal step remains (always so for an issue carrying the manual-operations label), capped atdo_item.post_merge_state(bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" post-merge). Move it with--post-merge:bun "${CLAUDE_SKILL_DIR}/../do-item/scripts/tracker.ts" transition "<KEY>" <state> --post-merge; a refusal (exit 3) leaves the issue where it is, for a person. - Closing comment: the merge commit, and the pull request’s
## Out-of-tree follow-upsitems for that issue as unchecked boxes; for an issue left short ofdone, the policy’sclosingsentence on who closes it. - Labels: compare the issue’s labels with the catalog’s
tracker.labelsandtracker.flagsfor the areas the issue’s commits touch. A flag the catalog derives that the issue lacks is a gap to report (and to settle, if it obliged a step the batch did not take); add a missing area label.
- Status:
-
Each parent once: for every distinct parent of the processed rows, after its children’s statuses moved, run
/jig:do-itemStep 5a’s reconciliation (reconcile_parent_status.ts) and act on its decision. -
The deferred findings: every
deferredoutcome in the review rounds should have become a follow-up issue (the follow-up label). Re-list the review threads, resolved and unresolved, and the reviewer’s summary findings, since a deferred thread resolves the moment its reply posts and a summary finding has no thread; check the tracker item behind each deferral exists. -
Record the processed/follow-up ratio: the rows the batch processed against the new follow-up issues its review rounds filed. State separately how many processed rows reached
doneand how many remain open under the post-merge policy. Comment it on the anchor issue (an issue or epic anchor); for an area or path anchor, on the highest-priority processed row:text Batch processed/follow-up: <PR> processed <n> issues (<d> done, <o> open) and filed <m> follow-ups (<n>:<m>).That ratio is the evidence that batching completes small units faster than review creates follow-up work, not only that it feels faster.
The eligibility mode
Tools that judge many issues at once (a dashboard panel ranking possible batches, a planning view marking issues batchable) ask the script instead of keeping their own copy of the rules:
bun "${CLAUDE_SKILL_DIR}/../../shared/command.ts" --stdin-file issues.json -- bun "${CLAUDE_SKILL_DIR}/scripts/candidates.ts" --eligibility [--claimed "KEY,KEY"] [--catalog <path>]It reads no tracker. Input: a JSON array of issues in the tracker
interface’s pool form (PoolIssue in
${CLAUDE_SKILL_DIR}/../do-item/scripts/lib/tracker/port.ts), every field
required: identifier, title, url (or null), priority (0 none, 1
urgent to 4 low), createdAt, state { id, name, type }, assignee
{ id, name } or null, labels, hasOpenChildren, and truncated (the
lists the read could not take in full; [] when complete); and the facets
type and size, each a value or null. An omitted field is refused, never
defaulted: a missing truncated would read a partial label list as complete.
An omitted facet reads as none, as a reader of an earlier release wrote
none. isEpic (true or false) and nativeType (the tracker’s own issue
type, or null) are optional: with isEpic omitted, an issue is an epic
when it carries the epic label or its nativeType is one of
issue_tracker.labels.epic_types.
Output: one JSON document.
{
"version": 1,
"policy": {
"facets": true,
"batchSizes": ["xs", "small", "medium"],
"sizes": ["xs", "small", "medium", "large", "xl"],
"sizePoints": { "xs": 1, "small": 2, "medium": 6 },
"pointBudget": 16,
"maxItems": 6,
"soloFlags": ["hitl", "manual-ops", "<every catalog flag>", "<work_batch.solo_flags>"],
"soloFlagPrefixes": ["hitl:"],
"epicLabel": "epic",
"followupLabel": "pr-followup",
"repoLabel": "web",
"repoLabels": ["web", "api"],
"typeLabels": ["bug", "feature"],
"contextPrefixes": ["area:"],
"areaLabelPrefixes": ["area:"],
"areaFlags": { "billing-api": ["api-review"] },
"stateNames": { "backlog": "backlog", "in progress": "in_progress", "done": "done" },
"knownAreaLabels": ["area:billing"],
"knownContextLabels": ["area:billing", "domain:payments"],
"knownSizes": ["xs", "small", "medium", "large", "xl"],
"ranking": { "sizes": { "xs": 2, "small": 1, "medium": 0 }, "provenance": 3, "sharedAreaLabel": 1 }
},
"verdicts": [
{ "identifier": "ENG-1", "eligible": true, "size": "small", "points": 2, "reason": null, "message": null },
{ "identifier": "ENG-2", "eligible": false, "size": null, "points": null,
"reason": { "kind": "solo-flag", "flag": "hitl" }, "message": "solo-only: carries `hitl`" }
]
}verdicts is in input order, one per issue, decided by the same
excludeReason the proposal uses. reason.kind is one of truncated,
solo-flag, solo-area, urgent, conflicting-size-labels,
not-batchable-size, conflicting-repo-labels, wrong-repo, conflicting-type-labels,
no-type-label, no-context-label, unknown-context-label,
unknown-area-label,
has-open-children, unknown-state, already-closed, already-assigned,
already-started, no-priority; message is the reason as a person reads
it. no-priority is checked last, so an issue it holds back is otherwise
eligible; the proposal lists it as a labelling gap. Where policy.facets is
true (the repository’s taxonomy has a size group), size and type are
read from each issue’s size and type fields, and batchSizes, sizes,
knownSizes and typeLabels are values of those facets; otherwise they
are read from labels.
areaFlags maps each catalog area that carries a flag to its flags: an
issue whose area-naming label names one is solo-area. stateNames maps
each issue_tracker.states name, lower case, to its canonical state; it
decides a state whose type is empty or not one the tracker interface
names, and a state it does not name either is unknown-state. A null typeLabels or
contextPrefixes means the repository configures none, and that check is
off. A null repoLabel means the same, or that the label is configured
but not required: on a GitHub tracker whose review.taxonomy.repos names no
other repository, every issue belongs to the repository by being in the
tracker. knownContextLabels are the labels the configuration
already names (the area-naming labels, do_item.agents.labels, the
catalog’s labels); an issue whose every context label is outside it is held
back. knownSizes is work_batch.sizes, else the batchable sizes and
review.taxonomy.sizes: without work_batch.sizes, a size label named in
neither (a large the repository never lists) is not recognised as a size.
Version: version changes when a field is removed or changes meaning;
adding a field, or a new reason.kind, keeps it. A reader refuses a version
it does not know, and treats an unknown reason.kind as not eligible. The
proposal’s --format json output carries the same version.
Scripts reference
| Script | Purpose | Exit codes |
|---|---|---|
bun "${CLAUDE_SKILL_DIR}/scripts/candidates.ts" "<anchor>" | Resolve the anchor, read its pool through the tracker interface, print the proposal (--format table or json) | 0 printed (possibly empty); 2 usage or an anchor that cannot be batched, with the reason and what to do instead; 1 configuration, catalog or tracker error |
bun "${CLAUDE_SKILL_DIR}/scripts/candidates.ts" --eligibility | Verdicts for issues on stdin, no tracker read | 0 printed; 2 usage or unreadable input; 1 configuration or catalog error |
In the delivery loop
- Beside
/jig:do-item: the batched form of picking up work.do-item’s batch check runs this skill’s proposal for a small issue and suggests a batch when it finds coherent siblings; it never batches silently. - Downstream: opens the pull request and arms
/jig:drive-pr, as a single pickup does. /jig:resolve-review-comments: its deferred findings carry the follow-up label, which ranks up here: already-owed, already-scoped work is the densest source of batchable issues.