All jobs

Prepare Each Sprint Retrospective From Linear

After each Linear cycle closes, an agent drafts the sprint retrospective: what shipped, what rolled over and why, scope added mid-sprint, and last retro's actions.

Run this on RushOpens the console with this prompt ready to send. Connect Linear there first.

What the agent does

This is for a B2B software company whose product engineering team plans in two-week Linear cycles and holds a retrospective the morning after each one closes. The facilitator spends the hour before it clicking through the cycle: which issues finished, which rolled into the next cycle, what was pulled in halfway through, and whether anyone did the three things the team agreed at the last retro. The agent does that preparation and hands the facilitator one page to put on the screen. The meeting stays with the team; the agent only brings the evidence.

It reads the team's Linear workspace through the Linear connection, which reaches the run as Linear's MCP server, signed in as the person who connected it. Linear's API reference describes the fields it works from. On a cycle, isPrevious marks the team's most recently completed cycle, startsAt, endsAt and completedAt bound it, scopeHistory and completedScopeHistory hold daily snapshots of total and completed scope in the team's estimation settings, and uncompletedIssuesUponClose is the set of issues recorded as unfinished when the cycle closed. On each issue it reads state, completedAt, canceledAt, estimate, assignee, labels, comments and addedToCycleAt, which says when the issue entered the cycle.

From those it builds four sections. What shipped: issues completed between startsAt and completedAt, grouped by project. What rolled over: the issues in uncompletedIssuesUponClose, each with the last comment that explains the delay, quoted with its issue identifier, so the reason comes from the person who wrote it and not from the agent. Scope added mid-sprint: issues whose addedToCycleAt falls after startsAt, with the day they arrived, read against the scope history so the facilitator can see whether the cycle grew or the work slipped. Last retro's actions: issues carrying the team's action label, named in the prompt, created before this cycle, each marked done, in progress or untouched.

Last, it writes three to five questions for the room, each tied to something on the page: a stretch of days where completedScopeHistory stayed flat, an issue that rolled over twice, a block of work added after the start. When Linear's MCP server does not return a field the prompt asks for, such as addedToCycleAt or the scope histories, the page says which section it could not fill rather than guessing. It writes retro.md and changes nothing in Linear: no issue, comment, label or cycle.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Prepare the sprint retrospective for Linear team PLAT. Use the Linear connection, read only. 1) Find the team's most recently completed cycle (isPrevious true): number, startsAt, endsAt, completedAt, scopeHistory, completedScopeHistory, issueCountHistory. If its completedAt is more than 7 days ago, write retro.md with one line saying no cycle closed this week and stop. 2) For every issue in the cycle read identifier, title, project, assignee, state, estimate, completedAt, canceledAt, addedToCycleAt, labels and comments. 3) Write retro.md with: What shipped (completed inside the cycle, by project); What rolled over (uncompletedIssuesUponClose, each with the latest comment that explains the delay, quoted with its identifier and author); Scope added mid-sprint (addedToCycleAt after startsAt, with the date, and start versus end scope from the histories); Last retro's actions (issues labelled retro-action created before this cycle's startsAt: done, in progress or not started); then 3 to 5 questions for the room, each citing the issue or the days it comes from. If a field is not returned, say which section is incomplete. Do not rate or rank people. Create, edit or comment on nothing in Linear.",
  "connections": [
    "linear"
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The session returns retro.md as an artifact, and the turn's result holds the same text. The facilitator opens it the morning of the retrospective: the shipped list first, then the rollover list with each delay in its owner's own words, the scope added after the start with dates, the status of last time's action items and the questions at the bottom.

What the facilitator checks before sharing it: that the rollover reasons quoted are the current ones, since a comment can be older than the decision that followed it, and that the action-item list matches what the team actually agreed, because the agent only finds items that carry the label. Nothing on the page scores or ranks a person: the prompt forbids it, and the sections are about issues, not people.

After the meeting the facilitator can send a follow-up message to the same session with the actions the team agreed, worded as they want them, and ask the agent to create them as Linear issues with the action label. That is the one write in the job, and a person decides its content.

Run it on every cycle that closes

The team saves the agent once with POST /o/{org}/agents, naming linear in connections and putting the prompt above in its instructions, then creates an automation in a Project with a schedule trigger for the morning after cycles usually end, such as {"cron": "0 7 * * 2", "timezone": "Europe/Berlin"}, with that agent as the automation's profile_id. A cron line cannot count two-week cycles, so the agent checks completedAt itself and ends with a one-line note in a week when no cycle closed.

A team with several Linear teams gives each its own automation and a prompt that names its team key, so every retro page covers one team's cycle and each run's cost is read separately on the session.

The use case this job follows, with its automation and trigger: Produce a report or file, no repo.

Why run it on Rush?

The Linear sign-in stays in Rush's connection, and the agent reads the workspace as the person who connected it, so the page sees exactly the issues and comments that person can see and no Linear API key sits in a script or a shared document. The run has its own computer, and its transcript lists every Linear read it made, which is how a facilitator answers the question of where a quoted reason came from.

A laptop script would need someone to remember to run it the night before. The schedule starts the run whether or not anyone is in, each run records its model cost on the session, and the same agent serves every team in the company through its own automation without sharing state between them.

Frequently asked questions

Does the agent run the retrospective?

No. It prepares the evidence and suggests questions; the team holds the meeting and decides what to change. The page is a starting point the facilitator edits, not minutes of a meeting that has not happened.

How is this different from a cycle report?

A cycle report is the numbers: completion rate, rollover counts, scope change. This page is built for the meeting, so it adds the reasons people gave in comments for each delay, the state of last retro's action items and questions grounded in what happened. Teams often keep both, the report for leadership and this page for the room.

What if our team does not estimate issues?

Linear documents scopeHistory as using the team's estimation settings, so without estimates the scope figures are not meaningful. The agent then uses issueCountHistory, the daily count of issues in the cycle, and says on the page that scope is measured in issues.

Can the agent see private teams or issues?

It sees what the person who connected Linear can see, and nothing more. If the team key in the prompt is a team that person cannot read, the run says so instead of writing an empty page, and the fix is to connect Linear as someone who is a member of that team.

More Linear jobs

More jobs like this: Produce a report or file, no repo

Keep reading