Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Pr Link Issue

ASecurity

Append 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.

1,037 stars
0 votes
0 copies
0 views
Added 9/29/2026
developmentjavascriptpythonjavabashgit

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add getsentry/skills --skill pr-link-issue --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr Link Issue?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pr Link Issue
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/getsentry-pr-link-issue/badge)](https://www.skillsdirectory.com/skills/getsentry-pr-link-issue)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: pr-link-issue
description: Append 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.
---

# Link a GitHub Issue + Linear Ticket on a PR

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 like `https://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

1. **Resolve the PR number** — skip if user supplied one:

   ```bash
   gh pr view --json number,body -q '.number'
   ```

   If no PR exists on the branch, stop and tell the user.

2. Extract issue number + repo from the input URL, or accept a bare `#1234` for current repo.

3. Fetch the Linear ticket from the issue's linear-linkback comment:

   ```bash
   gh issue view <n> --repo <owner>/<repo> --json comments \
     -q '.comments[] | select(.author.login=="linear-code") | .body' \
     | grep -Eioe '[a-z]+-[0-9]+' | head -1
   ```

   If no match, fall back to asking the user for the Linear key, or omit it.

4. Read the existing PR body so you can append rather than overwrite:

   ```bash
   gh pr view <pr-number> --json body -q '.body'
   ```

5. Construct the new body. If the body is empty, use just the `#### Issues` block. Otherwise, append it after a blank line. Don't duplicate — if `#### Issues` is already present, replace that section instead of adding a second one.

   Format:

   ```markdown
   #### Issues

   * Resolves: #<n>
   * Resolves: <linear-key>
   ```

6. Update the PR with a heredoc to preserve newlines:

   ```bash
   gh pr edit <pr-number> --body "$(cat <<'EOF'
   <new body>
   EOF
   )"
   ```

7. Confirm by echoing the resulting PR URL:

   ```bash
   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.

Attribution

getsentrygetsentry
View sourceSee grades on GitHubMore from getsentry →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →