Turn failed CircleCI builds into tracked Linear issues

By General Input

When a build fails on your default branch, we open a Linear issue with the broken jobs and tests, or update the existing ticket so you never get duplicates.

Integrations

  • CircleCI
  • Linear

Type

Agentic Task

Categories

  • Engineering

Watch my CircleCI project with a poll trigger on the workflow-completed event, so this runs every time a workflow finishes. Only act when the workflow's status is failed and it ran on my default branch (for example main or master). Ignore successful and canceled workflows, and ignore any failure that happened on a non-default branch.

When a real failure comes in, use CircleCI's Get a workflow's jobs to list the jobs in the workflow and identify which ones failed. Then use Get test metrics for a workflow to pull the failing tests for that workflow, capturing their names so I can reference them later.

Before filing anything, call Get flaky tests for a project to fetch the project's known-flaky tests. Compare the failing tests against that flaky list. If every failing test is already flagged as flaky, stop and do nothing, so I do not open tickets for known-flaky noise. Only continue when at least one failing test is not flaky, or when a job failed for a reason that is not a test.

For a genuine failure, use Linear's Search Issues to look for an existing open issue about this pipeline or one of the failing tests. Match on the project or workflow name and on the failing test names, and only consider issues that are still open (not done, canceled, or archived).

If no open issue matches, use Linear's Create Issue to open a new one. Write an AI-drafted title and description that name the failed jobs and the failing tests and include a direct link to the CircleCI build. If a matching open issue already exists, do not create a duplicate; instead use Add Comment to Issue to note that the failure recurred, and include how many times it has now happened based on the issue's history.

Keep everything scoped to the default branch, and skip any failure where every failing test is already flagged flaky.

Related prompts

Explore more prompts
Catch feature flags that never got switched on in productionWeekly alert noise review board for incident.io on-callMorning triage board for your Kernel browser agent runsTrack every half finished LaunchDarkly rollout in one boardFind the customers stuck contacting support again and againTurn shipped Linear work into Intercom product announcementsVoice agent QA review board for your Hume EVI callsClose the loop between Front tickets and Linear bug fixesOpen a Heroku release war room the moment production looks wrongFind the themes Help Scout tags miss and file them in Linear