pr-link-issue — скилл для Claude Code: связывает issue и PR
Добавляет к описанию текущего PR ссылку на GitHub issue и связанный тикет Linear. Пригодится, когда нужно связать задачу с уже открытым PR.
npx skills add getsentry/skills --skill pr-link-issue -a claude-codeЧто делает pr-link-issue
Скилл находит открытый PR для текущей ветки, если вы не передали его номер, и добавляет в описание раздел #### Issues со ссылками на GitHub issue и тикет Linear. Номер issue можно передать отдельно или указать URL; номер без URL подходит для репозитория PR.
Связанный тикет Linear скилл ищет в комментарии к issue от linear-code. Перед правкой он читает описание PR: существующий текст сохраняется, а прежний раздел #### Issues заменяется, чтобы не создавать дубликат. Если тикет не найден, скилл может запросить его ключ или продолжить только со ссылкой на issue. Без открытого PR в текущей ветке он остановится, поэтому для другой ветки укажите номер PR.
Какие задачи решает
- добавить ссылку на GitHub issue в описание PR
- найти и прикрепить связанный тикет Linear
- обновить раздел
#### Issues, не затрагивая остальное описание PR - связать issue с PR по его номеру или URL
Примеры запросов агенту
- Добавь к текущему PR issue по ссылке и найди связанный тикет Linear.
- Свяжи issue
#1234с открытым PR этой ветки. - Обнови раздел
#### Issuesв PR42по этому GitHub issue.
Как установить pr-link-issue
1Через Skills CLI (Vercel)
npx skills add getsentry/skills --skill pr-link-issue -a claude-code2Вручную: положить файлы
~/.claude/skills/pr-link-issue/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/pr-link-issue/
1Через Skills CLI (Vercel)
npx skills add getsentry/skills --skill pr-link-issue -a codex2Вручную: положить файлы
.agents/skills/pr-link-issue/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add getsentry/skills --skill pr-link-issue -a cursor2Вручную: положить файлы
.cursor/skills/pr-link-issue/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install getsentry/skills pr-link-issue2Вручную: положить файлы
.github/skills/pr-link-issue/SKILL.md1Через Skills CLI (Vercel)
npx skills add getsentry/skills --skill pr-link-issue -a gemini-cli2Командой платформы
gemini skills install https://github.com/getsentry/skills --path skills/pr-link-issueВручную: положить файлы
.devin/skills/pr-link-issue/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add getsentry/skills --skill pr-link-issue -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о pr-link-issue
Как установить pr-link-issue в Claude Code?
Выполните npx skills add getsentry/skills --skill pr-link-issue -a claude-code. Файл скилла устанавливается в ~/.claude/skills/pr-link-issue/SKILL.md.
Что делает pr-link-issue?
Скилл добавляет к описанию PR раздел со ссылкой на GitHub issue и найденным тикетом Linear. Перед обновлением он читает текущее описание и сохраняет его содержимое.
Что произойдёт, если Linear-тикет не найден?
Скилл может запросить ключ Linear или оставить в разделе только ссылку на GitHub issue.
Исходный текст
SKILL.md · Apache-2.0
---
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.
© getsentry · Apache-2.0 · getsentry/skills