| name | end-ticket |
| description | Use when the user is done working on a Linear ticket and wants to wrap up - creates PR, runs code review, merges, updates the ticket status, and cleans up the worktree |
End Ticket
Overview
Wrap up work on a Linear ticket through a fixed pipeline: verify tests, commit, create PR, run code review, merge, update the ticket, and clean up the worktree. The mirror of start-ticket.
Process
Phase 1: Identify the Ticket
Accept an optional ticket reference from the user. It can be:
- A ticket identifier like
NOV-123
- A Linear URL like
https://linear.app/team/issue/NOV-123/...
- Just a number if context is clear (e.g., "end 123")
If not provided, extract the ticket ID from the current branch name. The expected pattern is {prefix}/{TICKET-ID}-{slug} (e.g., fix/NOV-123-login-crash yields NOV-123).
Before anything else, check the current branch:
- If on
main or master, stop with error: "end-ticket is for feature branches, not main/master."
- If no ticket ID can be extracted from the branch name and the user didn't provide one, ask the user for the ticket identifier.
Fetch ticket details using the Linear MCP get_issue tool. If the ticket can't be found, tell the user and stop.
Show a summary before proceeding:
Ticket: NOV-123 - Fix login crash on empty email
Status: In Progress
Branch: fix/NOV-123-login-crash-on-empty-email
Phase 2: Verify Tests
Ask the user: "Tests were run recently -- skip or re-run?"
- If re-run: execute
cd backend && uv run pytest ../tests