Fully closes out a Linear ticket: merges the current PR, returns to main, and marks the ticket Done. Use when asked to "close the ticket", "mark this done", "finish this ticket", "wrap up this ticket", "I'm done with this ticket", or "ship it".
Fully close out a Linear ticket — merge the PR, return to main, and mark the ticket Done.
Run git rev-parse --abbrev-ref HEAD to get the current branch name. Parse it for a ticket
identifier using the branch naming convention {team-key}-{number}-slug
(e.g. prd-42-add-retry-logic → PRD-42): split on -, take the first two segments, uppercase.
Use Linear-get_issue with includeRelations: true to retrieve the ticket including any linked
PRs or attachments.
Inspect the ticket's links and attachments for GitHub PR URLs. For each one, run:
gh pr view <url> --json number,state,mergedAt,headRefName
Surface a summary of what is merged and what is still open. If any linked PR is open and belongs to a branch other than the current one, flag it for the user and ask how to proceed before continuing.
Run gh pr view --json number,state,mergedAt on the current branch to find its PR.
gh pr merge --squash --delete-branch and confirm successAfter the merge (or once confirmed as already merged), run:
git checkout main && git pull
Transition the ticket state to Done via Linear-save_issue and post a brief closing comment
via Linear-save_comment summarizing what was completed. Show both previews and confirm before
applying.