pr-link-issue

por sentry

Anexar um link de issue do GitHub e seu ticket Linear à descrição do PR atual. Use quando solicitado a "vincular issue ao pr", "preencher issue e linear no pr", "adicionar…

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.

Mais skills de sentry

generate-frontend-forms
sentry
Guia para criar formulários usando o novo sistema de formulários do Sentry. Use ao implementar formulários, campos de formulário, validação ou funcionalidade de salvamento automático.
official
sentry-snapshots-cocoa
sentry
Configuração completa de Snapshots do Sentry para projetos Apple/Cocoa. Use quando for solicitado a "configurar SnapshotPreviews", "configurar testes de snapshot Apple", "enviar snapshots Apple para…
official
architecture-review
sentry
Revisão de saúde do código em nível de equipe. Encontra módulos monolíticos, falhas silenciosas, lacunas de segurança de tipo, buracos na cobertura de testes e problemas de compatibilidade com LLM.
official
linear-type-labeler
sentry
Classifica issues do Linear e aplica um rótulo de Tipo da taxonomia de rótulos do workspace do Sentry com base no conteúdo do título e da descrição de cada issue.
official
sentry-flutter-sdk
sentry
Configuração completa do SDK Sentry para Flutter e Dart. Use quando for solicitado "adicionar Sentry ao Flutter", "instalar sentry_flutter", "configurar Sentry no Dart" ou configurar erro…
official
sentry-svelte-sdk
sentry
Configuração completa do SDK do Sentry para Svelte e SvelteKit. Use quando for solicitado a "adicionar Sentry ao Svelte", "adicionar Sentry ao SvelteKit", "instalar @sentry/sveltekit" ou configurar…
official
vercel-react-best-practices
sentry
Diretrizes de otimização de desempenho para React e Next.js da Vercel Engineering. Esta habilidade deve ser usada ao escrever, revisar ou refatorar React/Next.js…
official
sentry-tanstack-start-sdk
sentry
Configuração completa do SDK Sentry para TanStack Start React. Use quando for solicitado "adicionar Sentry ao TanStack Start", "instalar @sentry/tanstackstart-react" ou configurar erro…
official