Link a GitHub Issue + Linear Ticket on a PR
SkillMonitoring & opsAppend a GitHub issue link and its Linear ticket to the current PR's description. Use when asked to "link issue to pr", "fill in issue and linear in pr", "add issue refs to pr", or when given a GitHub issue URL and asked to attach it to the current PR. Resolves the Linear ticket automatically from the issue's linear-linkback comment.
Use Link a GitHub Issue + Linear Ticket on a PR in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Link a GitHub Issue + Linear Ticket on a PR and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Link a GitHub Issue + Linear Ticket on a PR skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
What this skill tells your AI
The instructions your AI receives, as published by getsentry/skills in skills/pr-link-issue/SKILL.md and read by ahel’s review.
Appends a Sentry-style #### Issues block to a PR description, referencing both the GitHub issue and the Linear ticket pulled from the issue's linear-linkback comment.
Inputs
<issue-url>— GitHub issue URL likehttps://github.com/<owner>/<repo>/issues/<n>. Issue number alone is fine if the PR is in the same repo.- (optional)
<pr-number>— defaults to the open PR for the current branch.
Steps
-
Resolve the PR number — skip if user supplied one:
gh pr view --json number,body -q '.number'If no PR exists on the branch, stop and tell the user.
-
Extract issue number + repo from the input URL, or accept a bare
#1234for current repo. -
Fetch the Linear ticket from the issue's linear-linkback comment:
gh issue view <n> --repo <owner>/<repo> --json comments \ -q '.comments[] | select(.author.login=="linear-code") | .body' \ | grep -Eioe '[a-z]+-[0-9]+' | head -1If no match, fall back to asking the user for the Linear key, or omit it.
-
Read the existing PR body so you can append rather than overwrite:
gh pr view <pr-number> --json body -q '.body' -
Construct the new body. If the body is empty, use just the
#### Issuesblock. Otherwise, append it after a blank line. Don't duplicate — if#### Issuesis already present, replace that section instead of adding a second one.Format:
#### Issues * Resolves: #<n> * Resolves: <linear-key> -
Update the PR with a heredoc to preserve newlines:
gh pr edit <pr-number> --body "$(cat <<'EOF' <new body> EOF )" -
Confirm by echoing the resulting PR URL:
gh pr view <pr-number> --json url -q '.url'
Notes
- Linear linkback comments are posted by the GitHub user
linear-code. The body contains a markdown link whose text is the Linear key, e.g.PY-2357. - Project keys vary per repo (
PY-…for sentry-python,JS-…for sentry-javascript, etc.) — the regex[a-z]+-[0-9]+covers them. - Don't strip existing PR content. Always read first, append/replace second.
- If the issue doesn't have a Linear linkback yet (newly filed), proceed with just the GitHub issue reference and tell the user the Linear key is missing.
Signals
- GitHub stars
- 1k
- Forks
- 53
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
pr-link-issue- Source
- github.com/getsentry/skills
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · wshobson
The pick for JavaScriptpython-performance-optimization
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythonlark-markdown
Skill · larksuite
The pick for Markdownmarkdown-formatter
Skill · nvidia
The pick for Markdown