# sync-pr-to-task

sync-pr-to-task connects GitHub pull requests to Linear issues, mapping review statuses and comments bidirectionally.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 1357 repo stars
- Author: qdhenry
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/sync/sync-pr-to-task.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/qdhenry-sync-pr-to-task

## What it does

The command extracts issue identifiers from branch naming conventions, PR descriptions, and commit cues such as resolves or closes. It matches ticket patterns like `ABC-123` alongside web URLs pointing to Linear workspaces.

Once linked, it maps the state of the pull request directly to the tracker. Draft items map to Backlog, merged code flips the ticket to Done, and approved reviews move issues to In Review. It adds metadata blocks, appends PR links into the task body, and assigns dedicated labels on GitHub via the `gh` utility.

Working executions rely on an authenticated `gh` installation in your environment. The routine also validates discrepancies between PR assignees and task owners, surfacing mismatches immediately.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/sync-pr-to-task.md` — Call it with /sync-pr-to-task. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/sync-pr-to-task.md` — Call it with /prompts:sync-pr-to-task. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/sync-pr-to-task.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/sync-pr-to-task.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/sync/sync-pr-to-task.md

## When to use it
- connect GitHub pull requests to Linear tickets
- transition Linear issue states from review approvals
- detect tracker references in branch names automatically
- spot metadata mismatches between PRs and tasks

## Example prompts
- Link PR 123 to Linear issue ABC-456
- Detect Linear task reference for PR 123 and update its state
- Validate existing links between pull requests and tracker tasks

## Similar
- [task-from-pr](https://affpapa.org/en/nevibecode/commands/task-from-pr.md) — command · 133 installs
- [linear-task-to-issue](https://affpapa.org/en/nevibecode/commands/linear-task-to-issue.md) — command · 129 installs
- [sync-todos-to-github](https://affpapa.org/en/nevibecode/commands/sync-todos-to-github.md) — command · ★ 907 repo stars
- [sync-automation-setup](https://affpapa.org/en/nevibecode/commands/buildwithclaude-community-sync-automation-setup.md) — command · ★ 3785 repo stars
- [project-board-sync](https://affpapa.org/en/nevibecode/commands/project-board-sync.md) — command · ★ 850 repo stars
- [openai-gh-address-comments](https://affpapa.org/en/nevibecode/skills/openai-gh-address-comments.md) — skill · ★ 540 repo stars

## Other versions with the same name
- [sync-pr-to-task · davila7](https://affpapa.org/en/nevibecode/commands/sync-pr-to-task.md) — 122 installs

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
