pr-link-issue

oleh sentry

Tambahkan tautan isu GitHub dan tiket Linear-nya ke deskripsi PR saat ini. Gunakan saat diminta untuk "menautkan isu ke PR", "mengisi isu dan Linear di PR", "menambahkan…

npx skills add https://github.com/getsentry/skills --skill pr-link-issue

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:

    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:

    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:

    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:

    #### Issues
    
    * Resolves: #<n>
    * Resolves: <linear-key>
    
  6. Update the PR with a heredoc to preserve newlines:

    gh pr edit <pr-number> --body "$(cat <<'EOF'
    <new body>
    EOF
    )"
    
  7. 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.

Lebih banyak skill dari sentry

add-ai-integration
sentry
Tambahkan integrasi penyedia AI baru ke Sentry JavaScript SDK. Gunakan saat berkontribusi pada instrumentasi AI baru (OpenAI, Anthropic, Vercel AI, LangChain, dll.)…
add-cdn-bundle
sentry
Buat bundel CDN baru untuk paket peramban dengan fitur yang ditentukan
agent-prompt
sentry
Panduan referensi untuk menulis prompt dan skill agen yang efektif. Gunakan saat membuat skill baru, meninjau kualitas prompt, atau memahami prompt Warden…
agents-md
sentry
Keterampilan ini harus digunakan ketika pengguna meminta untuk "membuat AGENTS.md", "memperbarui AGENTS.md", "memelihara dokumentasi agen", "menyiapkan CLAUDE.md", atau perlu menjaga agen…
agents-md
sentry
Buat dan pelihara dokumentasi agen minimal dengan sinyal tinggi di bawah 60 baris. Menerapkan praktik terbaik berbasis riset untuk dokumentasi yang ditujukan bagi agen; kualitas instruksi menurun seiring panjangnya dokumen. Membutuhkan tiga bagian inti: Pengelola Paket, Perintah dalam Lingkup Berkas (test/lint/typecheck per berkas), dan Atribusi Komit dengan identitas agen. Menganalisis struktur proyek (file kunci, konfigurasi linter, perintah CI, indikator monorepo) untuk menentukan apa yang termasuk dalam berkas. Hanya menggunakan header dan poin; referensi...
agents-md
sentry
Keterampilan ini harus digunakan ketika pengguna meminta untuk "membuat AGENTS.md", "memperbarui AGENTS.md", "memelihara dokumentasi agen", "menyiapkan CLAUDE.md", atau perlu menjaga agen…
ai-sdk
sentry
ai-sdk — keterampilan yang dapat diinstal untuk agen AI, diterbitkan oleh getsentry/webvitals.com.
analytics
sentry
Instrument dan temukan event analytics di UI frontend Sentry. Gunakan saat menambahkan pelacakan ke tombol, halaman, modal, atau interaksi kustom, saat mendefinisikan…