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>(aliasl2pr) — see /commands/ship - Source:
pack/workflows/linear-to-pr.tsx
Shape
Loading diagram...
Two SubflowLoose steps in a <Sequence>:
implrunslinear-implementwith the forwarded input (issueId,tdd,skipAcceptanceReview,maxIterations). It plans, iterates implement → validate → review, and commits the work locally onfeat/<issue-key>.prrunspr-review-loopagainst 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:
| Field | Default | Meaning |
|---|---|---|
issueId | "" | Linear issue to ship. |
base | "main" | Base branch for the PR. |
tdd | false | Forwarded to linear-implement. |
skipAcceptanceReview | false | Forwarded: skip the local review step (validation still gates). |
maxIterations | 3 | Forwarded: implement-loop cap. |
Output (prResult, a loose object from the pr-review-loop subflow):
| Field | Meaning |
|---|---|
prUrl | The opened PR. |
resolved | True when checks are green (or absent) and no human comment is outstanding. |
pending[] | What still needs a human. |
summary | Final 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'smaxRounds(default 2). - Model assignment is entirely per-child-task — see the child pages and /concepts/model-tiers.