Linear Backlog
Run a frozen Linear queue as serial batches with parallel execution inside each
batch. Keep the parent as controller; send every implementation issue through
orchestrator, autogoal, and the repo's task skill.
Required Capabilities
Require all of these before mutation:
- Linear issue read and write tools.
$orchestrator with durable Codex child-thread tools.
$autogoal and its goal tools.
- The destination repo's
$task skill and AGENTS instructions.
- Git and the repo's normal PR and merge tooling.
If a capability is missing, report the exact dependency. Never replace durable
child threads with hidden sub-agents or fake Linear state transitions with
comments.
Commands
$linear-backlog run <scope>: execute the queue in maximal safe parallel
batches.
$linear-backlog status: report counts, active batch and lanes, conflict
groups, blocked issues, and the next candidate batch.
$linear-backlog stop: stop after parking every active lane safely and
recording resumable state.
Scope may be a Linear project, cycle, label, saved view, or explicit issue list.
If the prompt and current context do not identify exactly one scope, ask one
short question before mutation.
Non-Negotiable Contract
- Keep exactly one batch active at a time.
- Run every safe lane in that batch concurrently.
- Do not start the next batch until every lane in the current batch is
queue-terminal and the batch join is recorded.
- Make each batch inclusion-maximal: no remaining dependency-ready issue may be
added without a hard conflict or exceeding proven safe capacity.
- Never impose an arbitrary lane cap.
- Treat minor file overlap or an expected small merge conflict as a conflict
group, not an automatic reason to serialize.
- Do not implement product code in the parent.
- Do not ask the user to say
continue between batches.
- Do not widen an issue beyond its Linear description, acceptance criteria,
linked source, and repo policy.
- Freeze queue membership at startup unless the user explicitly asks for
continuous intake. State, dependencies, and ordering may still change.
- Re-read Linear after every issue transition and before planning each batch.
- Never invent missing issues, acceptance criteria, or product decisions.
Queue-terminal means one of:
- merged, verified, and moved to the team's completed state;
- canceled by an authorized source;
- blocked with evidence, an owner or missing decision, and a concrete next
action.
Opening a PR, passing tests, or finishing a plan is not queue-terminal by
itself.
Start The Parent Run
- Turn
$orchestrator on and record the mode in parent status.
- Use
$autogoal to create one parent goal for the frozen queue.
- Define the parent completion threshold as:
- every frozen issue id is queue-terminal;
- every batch has joined;
- no child is still mutating code;
- every completed issue has verified merge and Linear state evidence;
- blocked count is zero.
If blocked items remain after all eligible work is exhausted, close the loop
as blocked under
$autogoal; do not call the queue complete.
- Create a queue ledger:
| Batch | Order | Issue | State | Dependencies | Conflict group | Child | Branch / PR | Proof | Blocker / owner | Next |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
- Record total, completed, blocked, active, and remaining counts after every
transition.
The parent goal owns queue and batch completion. Each child owns a separate
issue-scoped autogoal.
Build The Queue
- Resolve the Linear team and its real workflow states.
- Query the requested scope and read every candidate issue in full, including
description, priority, project or cycle, state, labels, links, parent-child
relationships, and blocking dependencies.
- Exclude completed and canceled issues from runnable work, but keep them in
the frozen ledger as already terminal.
- Preserve explicit Linear ordering when exposed.
- If no explicit order is available, sort dependency-ready issues by priority,
then oldest creation time. Record this fallback once.
- Keep dependency chains visible. A dependency and its dependent issue can
never share a batch.
- Never treat a broad project description as issue acceptance criteria unless
the issue explicitly adopts it.
Plan A Maximal Safe Batch
Build a fresh conflict graph from every dependency-ready, non-terminal issue.
Use issue source, likely owners, repo structure, current branches, runtime and
data requirements, and prior batch evidence. Lexical file guesses alone are
not proof.
Create a hard-conflict edge only when concurrent execution would be unsafe or
would invalidate proof, such as:
- a dependency relation;
- the same migration, schema contract, generated artifact, or exclusive config
owner;
- overlapping destructive or proof-breaking writes to the same data;
- the same exclusive runtime, port, environment, credential, or deployment
surface when it cannot be isolated;
- the same security or authorization policy mutation;
- source-backed evidence that both tickets must change the same unmergeable
lines or API contract in incompatible ways.
Do not create a hard-conflict edge merely because tickets:
- belong to the same product area or package;
- touch adjacent components;
- may both update a barrel, lockfile, docs index, or generated summary;
- may produce a small normal merge conflict;
- use the same read-only service or test suite;
- have vague keyword overlap without source-backed ownership evidence.
Select the batch:
- Start with candidates in recorded backlog order.
- Add every candidate that has no hard-conflict edge with a selected issue and
has a safe worktree, child thread, runtime, data strategy, and proof path.
- Record soft overlaps in conflict groups for merge arbitration.
- Revisit every excluded candidate. If the exclusion is only caution, minor
overlap, or expected merge work, include it.
- Stop only when no excluded dependency-ready candidate can be added safely.
A one-ticket batch is valid only when hard conflicts, dependencies, or real
capacity constraints force it. Record the reason.
Batched Execution Loop
Repeat until no eligible frozen issue remains:
- Refresh every non-terminal issue from Linear.
- Recover and finish or park any already-active batch before planning another.
- Plan the next maximal safe batch and record its lanes and conflict groups.
- Read current AGENTS instructions and every selected issue's full source.
- Remove and block only issues lacking an implementable outcome or auditable
proof surface, then refill the batch from remaining safe candidates.
- Through
$orchestrator, create or reuse one durable child per issue and
assign separate disposable worktrees, short-lived branches from main, PR
target main, runtime owners, ports, data strategies, and cleanup rules.
- Move every selected Linear issue to the team's active state with issue-update
tools. Never represent state by posting comments.
- Dispatch all batch children without waiting for one lane to finish before
starting the next. Send each child:
Run `$task` for <ISSUE-ID> as lane <LANE> of batch <BATCH>.
Use `$autogoal` in one-shot execution mode before implementation. The child goal
ends only when acceptance criteria, repo-required checks, relevant runtime
proof, PR body, push state, and task closeout are complete.
Stay inside the assigned worktree and issue scope. Follow AGENTS. Target `main`.
Respect the assigned runtime, data strategy, and conflict group. Report goal
state, changed files, checks, proof, PR URL/state, merge blocker, Linear
handoff, conflict risk, and exact next owner.
- Supervise all lanes concurrently. Route new evidence to the owning child and
let independent lanes continue when another lane blocks.
- Do not plan the next batch while any current lane is implementing, testing,
reviewing, repairing, merging, or still lacks a queue-terminal blocker
packet.
- When PRs are ready, choose a merge order from dependencies and actual
conflicts. Serialize merges, not implementation.
- Before each merge, integrate current
origin/main into that lane using repo
policy, rerun affected checks and proof, and never force push.
- After each merge, tell unmerged sibling lanes to integrate the new
main
when relevant and rerun affected proof. Resolve only real conflicts.
- Move each issue through the team's real review and completed states using
Linear mutations. Verify merge, completed state, and child-goal closure from
fresh reads.
- Copy each closeout into the parent ledger, remove disposable worktrees, and
archive finished children when their lane is terminal.
- Mark the batch joined only when every lane is queue-terminal and all merge
arbitration is resolved.
- Refresh Linear, recompute the conflict graph, and start the next maximal
safe batch automatically.
Blocker Policy
Classify blockers instead of turning every snag into a user interruption:
dependency-local: schedule the blocking issue in the earliest safe batch
when it is in scope.
lane-local: record evidence and next action, update the issue to a real
blocked state when one exists, and let sibling lanes finish.
external-owner: record the person, system, approval, or unavailable tool
owning the next action; park the lane and continue the batch.
scope-authority: stop the run only when the missing decision changes the
meaning or safety of the whole queue. Ask one precise question.
repo-wide: stop when checks, credentials, branch policy, infrastructure, or
missing durable tools make every remaining issue unsafe or impossible.
Never silently skip a blocked issue. Never mark blocked work completed.
Linear Discipline
- Resolve state ids or names from each issue's team before updating.
- Preserve team, project, cycle, labels, and parent relationships.
- Use issue mutations for state, assignment, and project changes.
- Use comments only for evidence, blockers, and handoff context.
- Re-read an issue after every mutation controlling routing or completion.
- Do not move an issue to completed merely because a branch exists or CI is
green.
- Do not start an issue already owned by another active agent or human unless
the user explicitly authorizes takeover.
Resume Safely
On restart or compaction:
- Read the parent goal and ledger.
- Re-read the frozen Linear issue ids.
- Inspect durable children, worktrees, branches, and PRs.
- Reconstruct the active batch and its conflict groups.
- Finish or park every active lane and record the batch join before selecting
another batch.
- Reconcile conflicting local and Linear state using fresh verifiable evidence,
then continue the batch loop.
Never duplicate a child, worktree, branch, PR, or goal because context was lost.
Stop And Complete
Finish the batch loop when every frozen issue is queue-terminal and every batch
has joined.
Complete the parent autogoal only when:
- every frozen issue is completed or canceled;
- every completed issue has verified merge and completed-state evidence;
- blocked count is zero;
- no code-mutating child remains active;
- every batch join is recorded;
- final counts reconcile with the frozen issue list.
If blocked issues remain, preserve evidence, owner or missing decision, and next
action, then keep or mark the goal blocked according to $autogoal's tool
contract. Never convert a partial queue into a completed goal.
Final handoff must report:
- scope and frozen issue count;
- batch count and peak parallel lanes;
- completed, canceled, blocked, and remaining counts;
- merged PRs and merge order;
- blocked issues with owner and next action;
- whether the queue goal completed or remains blocked.
Do not stop after one successful batch while another eligible frozen issue
remains. That defeats the entire point of the skill.
1---2name: linear-backlog-33description: Run a scoped Linear backlog autonomously as a sequence of maximal safe parallel batches by composing orchestrator, autogoal, and task. Use when the user wants Codex to execute ordered Linear issues without prompting for each next batch while parallelizing every dependency-ready ticket that lacks a hard conflict.4---56# Linear Backlog78Run a frozen Linear queue as serial batches with parallel execution inside each9batch. Keep the parent as controller; send every implementation issue through10`orchestrator`, `autogoal`, and the repo's `task` skill.1112## Required Capabilities1314Require all of these before mutation:1516- Linear issue read and write tools.17- `$orchestrator` with durable Codex child-thread tools.18- `$autogoal` and its goal tools.19- The destination repo's `$task` skill and AGENTS instructions.20- Git and the repo's normal PR and merge tooling.2122If a capability is missing, report the exact dependency. Never replace durable23child threads with hidden sub-agents or fake Linear state transitions with24comments.2526## Commands2728- `$linear-backlog run <scope>`: execute the queue in maximal safe parallel29 batches.30- `$linear-backlog status`: report counts, active batch and lanes, conflict31 groups, blocked issues, and the next candidate batch.32- `$linear-backlog stop`: stop after parking every active lane safely and33 recording resumable state.3435Scope may be a Linear project, cycle, label, saved view, or explicit issue list.36If the prompt and current context do not identify exactly one scope, ask one37short question before mutation.3839## Non-Negotiable Contract4041- Keep exactly one batch active at a time.42- Run every safe lane in that batch concurrently.43- Do not start the next batch until every lane in the current batch is44 queue-terminal and the batch join is recorded.45- Make each batch inclusion-maximal: no remaining dependency-ready issue may be46 added without a hard conflict or exceeding proven safe capacity.47- Never impose an arbitrary lane cap.48- Treat minor file overlap or an expected small merge conflict as a conflict49 group, not an automatic reason to serialize.50- Do not implement product code in the parent.51- Do not ask the user to say `continue` between batches.52- Do not widen an issue beyond its Linear description, acceptance criteria,53 linked source, and repo policy.54- Freeze queue membership at startup unless the user explicitly asks for55 continuous intake. State, dependencies, and ordering may still change.56- Re-read Linear after every issue transition and before planning each batch.57- Never invent missing issues, acceptance criteria, or product decisions.5859Queue-terminal means one of:6061- merged, verified, and moved to the team's completed state;62- canceled by an authorized source;63- blocked with evidence, an owner or missing decision, and a concrete next64 action.6566Opening a PR, passing tests, or finishing a plan is not queue-terminal by67itself.6869## Start The Parent Run70711. Turn `$orchestrator on` and record the mode in parent status.722. Use `$autogoal` to create one parent goal for the frozen queue.733. Define the parent completion threshold as:74 - every frozen issue id is queue-terminal;75 - every batch has joined;76 - no child is still mutating code;77 - every completed issue has verified merge and Linear state evidence;78 - blocked count is zero.79 If blocked items remain after all eligible work is exhausted, close the loop80 as blocked under `$autogoal`; do not call the queue complete.814. Create a queue ledger:8283```md84| Batch | Order | Issue | State | Dependencies | Conflict group | Child | Branch / PR | Proof | Blocker / owner | Next |85| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |86```87885. Record total, completed, blocked, active, and remaining counts after every89 transition.9091The parent goal owns queue and batch completion. Each child owns a separate92issue-scoped autogoal.9394## Build The Queue95961. Resolve the Linear team and its real workflow states.972. Query the requested scope and read every candidate issue in full, including98 description, priority, project or cycle, state, labels, links, parent-child99 relationships, and blocking dependencies.1003. Exclude completed and canceled issues from runnable work, but keep them in101 the frozen ledger as already terminal.1024. Preserve explicit Linear ordering when exposed.1035. If no explicit order is available, sort dependency-ready issues by priority,104 then oldest creation time. Record this fallback once.1056. Keep dependency chains visible. A dependency and its dependent issue can106 never share a batch.1077. Never treat a broad project description as issue acceptance criteria unless108 the issue explicitly adopts it.109110## Plan A Maximal Safe Batch111112Build a fresh conflict graph from every dependency-ready, non-terminal issue.113Use issue source, likely owners, repo structure, current branches, runtime and114data requirements, and prior batch evidence. Lexical file guesses alone are115not proof.116117Create a hard-conflict edge only when concurrent execution would be unsafe or118would invalidate proof, such as:119120- a dependency relation;121- the same migration, schema contract, generated artifact, or exclusive config122 owner;123- overlapping destructive or proof-breaking writes to the same data;124- the same exclusive runtime, port, environment, credential, or deployment125 surface when it cannot be isolated;126- the same security or authorization policy mutation;127- source-backed evidence that both tickets must change the same unmergeable128 lines or API contract in incompatible ways.129130Do not create a hard-conflict edge merely because tickets:131132- belong to the same product area or package;133- touch adjacent components;134- may both update a barrel, lockfile, docs index, or generated summary;135- may produce a small normal merge conflict;136- use the same read-only service or test suite;137- have vague keyword overlap without source-backed ownership evidence.138139Select the batch:1401411. Start with candidates in recorded backlog order.1422. Add every candidate that has no hard-conflict edge with a selected issue and143 has a safe worktree, child thread, runtime, data strategy, and proof path.1443. Record soft overlaps in conflict groups for merge arbitration.1454. Revisit every excluded candidate. If the exclusion is only caution, minor146 overlap, or expected merge work, include it.1475. Stop only when no excluded dependency-ready candidate can be added safely.148149A one-ticket batch is valid only when hard conflicts, dependencies, or real150capacity constraints force it. Record the reason.151152## Batched Execution Loop153154Repeat until no eligible frozen issue remains:1551561. Refresh every non-terminal issue from Linear.1572. Recover and finish or park any already-active batch before planning another.1583. Plan the next maximal safe batch and record its lanes and conflict groups.1594. Read current AGENTS instructions and every selected issue's full source.1605. Remove and block only issues lacking an implementable outcome or auditable161 proof surface, then refill the batch from remaining safe candidates.1626. Through `$orchestrator`, create or reuse one durable child per issue and163 assign separate disposable worktrees, short-lived branches from `main`, PR164 target `main`, runtime owners, ports, data strategies, and cleanup rules.1657. Move every selected Linear issue to the team's active state with issue-update166 tools. Never represent state by posting comments.1678. Dispatch all batch children without waiting for one lane to finish before168 starting the next. Send each child:169170```md171Run `$task` for <ISSUE-ID> as lane <LANE> of batch <BATCH>.172173Use `$autogoal` in one-shot execution mode before implementation. The child goal174ends only when acceptance criteria, repo-required checks, relevant runtime175proof, PR body, push state, and task closeout are complete.176177Stay inside the assigned worktree and issue scope. Follow AGENTS. Target `main`.178Respect the assigned runtime, data strategy, and conflict group. Report goal179state, changed files, checks, proof, PR URL/state, merge blocker, Linear180handoff, conflict risk, and exact next owner.181```1821839. Supervise all lanes concurrently. Route new evidence to the owning child and184 let independent lanes continue when another lane blocks.18510. Do not plan the next batch while any current lane is implementing, testing,186 reviewing, repairing, merging, or still lacks a queue-terminal blocker187 packet.18811. When PRs are ready, choose a merge order from dependencies and actual189 conflicts. Serialize merges, not implementation.19012. Before each merge, integrate current `origin/main` into that lane using repo191 policy, rerun affected checks and proof, and never force push.19213. After each merge, tell unmerged sibling lanes to integrate the new `main`193 when relevant and rerun affected proof. Resolve only real conflicts.19414. Move each issue through the team's real review and completed states using195 Linear mutations. Verify merge, completed state, and child-goal closure from196 fresh reads.19715. Copy each closeout into the parent ledger, remove disposable worktrees, and198 archive finished children when their lane is terminal.19916. Mark the batch joined only when every lane is queue-terminal and all merge200 arbitration is resolved.20117. Refresh Linear, recompute the conflict graph, and start the next maximal202 safe batch automatically.203204## Blocker Policy205206Classify blockers instead of turning every snag into a user interruption:207208- `dependency-local`: schedule the blocking issue in the earliest safe batch209 when it is in scope.210- `lane-local`: record evidence and next action, update the issue to a real211 blocked state when one exists, and let sibling lanes finish.212- `external-owner`: record the person, system, approval, or unavailable tool213 owning the next action; park the lane and continue the batch.214- `scope-authority`: stop the run only when the missing decision changes the215 meaning or safety of the whole queue. Ask one precise question.216- `repo-wide`: stop when checks, credentials, branch policy, infrastructure, or217 missing durable tools make every remaining issue unsafe or impossible.218219Never silently skip a blocked issue. Never mark blocked work completed.220221## Linear Discipline222223- Resolve state ids or names from each issue's team before updating.224- Preserve team, project, cycle, labels, and parent relationships.225- Use issue mutations for state, assignment, and project changes.226- Use comments only for evidence, blockers, and handoff context.227- Re-read an issue after every mutation controlling routing or completion.228- Do not move an issue to completed merely because a branch exists or CI is229 green.230- Do not start an issue already owned by another active agent or human unless231 the user explicitly authorizes takeover.232233## Resume Safely234235On restart or compaction:2362371. Read the parent goal and ledger.2382. Re-read the frozen Linear issue ids.2393. Inspect durable children, worktrees, branches, and PRs.2404. Reconstruct the active batch and its conflict groups.2415. Finish or park every active lane and record the batch join before selecting242 another batch.2436. Reconcile conflicting local and Linear state using fresh verifiable evidence,244 then continue the batch loop.245246Never duplicate a child, worktree, branch, PR, or goal because context was lost.247248## Stop And Complete249250Finish the batch loop when every frozen issue is queue-terminal and every batch251has joined.252253Complete the parent autogoal only when:254255- every frozen issue is completed or canceled;256- every completed issue has verified merge and completed-state evidence;257- blocked count is zero;258- no code-mutating child remains active;259- every batch join is recorded;260- final counts reconcile with the frozen issue list.261262If blocked issues remain, preserve evidence, owner or missing decision, and next263action, then keep or mark the goal blocked according to `$autogoal`'s tool264contract. Never convert a partial queue into a completed goal.265266Final handoff must report:267268- scope and frozen issue count;269- batch count and peak parallel lanes;270- completed, canceled, blocked, and remaining counts;271- merged PRs and merge order;272- blocked issues with owner and next action;273- whether the queue goal completed or remains blocked.274275Do not stop after one successful batch while another eligible frozen issue276remains. That defeats the entire point of the skill.