Skip to content
xiv

linear-to-pr

Issue in, settled PR out. linear-to-pr is a pure composition: it runs linear-implement as a subflow, then hands that result to pr-review-loop as a second subflow. It owns no agent tasks of its own — all behavior lives in the two children.

  • Triggered by: xiv ship <issueId> (alias l2pr) — see /commands/ship
  • Source: pack/workflows/linear-to-pr.tsx

Shape

Loading diagram...

Two SubflowLoose steps in a <Sequence>:

  1. impl runs linear-implement with the forwarded input (issueId, tdd, skipAcceptanceReview, maxIterations). It plans, iterates implement → validate → review, and commits the work locally on feat/<issue-key>.
  2. pr runs pr-review-loop against the branch the implement run produced. It writes a PR description from the diff, opens the PR, then settles it against CI and human comments in bounded rounds. It is skipped entirely (skipIf) when the implement subflow produced no result — no half-implemented PR ever opens.

What crosses the seam

The composition is more than sequencing — specific facts are carried from the implement result into the PR step rather than re-derived:

  • branch — the PR is opened from the exact branch finalize committed to.
  • issueContext — key, title, and acceptance criteria, used for the PR title and as context for the describing agent.
  • knownGaps — the findings the local review raised that the implement loop shipped without fixing. Forwarding them means the PR's "Known gaps" section reflects what the review actually raised, not what a describing agent can infer from the diff.

This hand-off works because linear-implement names its primary result table output — the one table the engine exposes as a subflow's result (see /workflows).

Inputs and outputs

Input:

FieldDefaultMeaning
issueId""Linear issue to ship.
base"main"Base branch for the PR.
tddfalseForwarded to linear-implement.
skipAcceptanceReviewfalseForwarded: skip the local review step (validation still gates).
maxIterations3Forwarded: implement-loop cap.

Output (prResult, a loose object from the pr-review-loop subflow):

FieldMeaning
prUrlThe opened PR.
resolvedTrue when checks are green (or absent) and no human comment is outstanding.
pending[]What still needs a human.
summaryFinal state in prose.

Behavior notes

  • Never merges. The tail loop reports "ready for a human to review and merge" at best.
  • Caps and exit conditions are the children's: the implement loop's maxIterations (default 3, clamped 1–10) and the review loop's maxRounds (default 2).
  • Model assignment is entirely per-child-task — see the child pages and /concepts/model-tiers.