| name | yux-linear-pr |
| description | Create pull request with Linear issue linking and status sync. Triggers on "create PR", "linear PR", "submit for review", "开PR". |
| allowed-tools | Read, Write, Bash(git:*), Bash(gh:*), Glob, Grep, mcp__linear__*, AskUserQuestion |
Linear PR - Create Pull Request
Create a pull request with Linear issue integration and optional draft mode.
Usage: /yux-linear-pr [--draft] [additional description]
Input
--draft: Create as draft PR (early feedback before full review)
- Additional text: Extra context for PR description
Prerequisites
- Not on main/master branch
- Has commits ahead of main:
git log origin/main..HEAD --oneline
gh auth status passes
Workflow
Step 1: Extract Issue Info
- Parse
LIN-xxx from branch name
- Fetch details:
mcp__linear__get_issue(id: "LIN-xxx")
Step 2: Gather Commits
git log origin/main..HEAD --pretty=format:"%s" --reverse
Group by type for changelog.
Step 3: Generate PR Content
- Title:
[LIN-456] <Issue Title>
- Body: Summary + Linear issue link (
Closes LIN-456) + changes + test plan
- Language: detect from user input, default to English
Step 4: Create PR
First check if a PR already exists for this branch:
gh pr view --json number,url 2>/dev/null
If a PR exists, inform the user and offer to view/update it instead of creating a duplicate.
Otherwise create:
git push origin HEAD
gh pr create --title "<title>" --body "<body>" --base main [--draft]
Step 5: Update Task State
If .claude/linear-tasks.json exists:
- Set
pr_number, status to pr_created, update last_active_at
Step 6: Update Linear
mcp__linear__update_issue(id: "<uuid>", state: "In Review")
mcp__linear__create_comment(issueId: "<uuid>", body: "PR created: <url>")
Step 7: Check Initial CI
gh pr checks <number> --json name,state,conclusion 2>/dev/null
Display one-time status snapshot.
Step 8: Summary
=== PR Created ===
PR: #82 - [LIN-456] Add user authentication
URL: https://github.com/org/repo/pull/82
Branch: feat/LIN-456-user-auth → main
Linear: LIN-456 → In Review
CI: pending (3 checks)
Next: /yux-linear-merge when approved