sync-pr-to-task — команда для Claude Code: связь PR и задач Linear
Связывает GitHub pull request с задачей Linear: ищет номера задач и синхронизирует статусы. Пригодится для ведения PR вместе с задачами.
npx claude-code-templates@latest --command sync/sync-pr-to-taskЧто делает sync-pr-to-task
Команда анализирует pull request: ищет ссылки на задачи Linear в заголовке, описании, имени ветки и сообщениях коммитов. Она также учитывает состояние PR и ревью, затем может обновить статус задачи, добавить ссылку или комментарий и внести сведения о задаче в PR.
Для выбора действия передайте номер PR или один из аргументов --task, --auto-detect, --enable-auto, --update-state. Команда использует gh repo view для получения контекста репозитория; без доступного контекста репозитория автоматическое определение PR может не сработать.
Какие задачи решает
- найти задачу Linear по данным pull request
- сопоставить состояние PR со статусом задачи
- добавить ссылку на PR и комментарий к задаче
- включить синхронизацию изменений между GitHub и Linear
Примеры запросов агенту
- Свяжи pull request
42с соответствующей задачей Linear:/sync-pr-to-task 42. - Найди задачу Linear для текущего pull request:
/sync-pr-to-task --auto-detect. - Обнови статус задачи по состоянию pull request:
/sync-pr-to-task --update-state.
Как установить sync-pr-to-task
1Через claude-code-templates
npx claude-code-templates@latest --command sync/sync-pr-to-task2Вручную: положить файлы
.claude/commands/sync-pr-to-task.mdВызов — /sync-pr-to-task. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/sync-pr-to-task.mdВызов — /prompts:sync-pr-to-task. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/sync-pr-to-task.prompt.mdВручную: положить файлы
.gemini/commands/sync-pr-to-task.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о sync-pr-to-task
Как установить sync-pr-to-task в Claude Code?
Запустите npx claude-code-templates@latest --command sync/sync-pr-to-task.
Что делает sync-pr-to-task?
Команда связывает GitHub pull request с задачей Linear, находит идентификаторы задач и синхронизирует сведения о состоянии и ревью.
Как команда находит связанную задачу Linear?
Она проверяет заголовок и описание PR, имя ветки и сообщения коммитов.
Исходный текст
sync-pr-to-task.md · MIT
--- allowed-tools: Read, Write, Edit, Bash argument-hint: "[pr-number] | --task | --auto-detect | --enable-auto | --update-state" description: Link GitHub pull requests to Linear tasks with automated state synchronization and workflow integration --- # Sync PR to Task Link GitHub pull requests to Linear tasks with comprehensive workflow integration: **$ARGUMENTS** ## Current PR Context - Repository: !`gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "No repo context"` - PR details: Based on $ARGUMENTS PR number or auto-detection criteria - Linear references: Detection of task IDs in PR content and branch names - Webhook status: Current automation configuration for PR-task synchronization ## Task Implement comprehensive pull request to Linear task linking with automated workflow integration: **PR Target**: Use $ARGUMENTS to specify PR number, task assignment, auto-detection mode, or automation configuration **Integration Framework**: 1. **Reference Detection** - Extract Linear task IDs from PR title, body, branch names, commit messages 2. **PR Analysis** - Fetch complete PR data, analyze state, review status, change metrics, timeline 3. **State Synchronization** - Map PR states to Linear equivalents, handle review cycles, merge events 4. **Task Updates** - Update Linear task status, add PR references, create comments, sync metadata 5. **GitHub Enhancement** - Add Linear context to PR, create labels, post task summaries, maintain links 6. **Workflow Automation** - Configure webhooks, enable real-time sync, implement event handlers, maintain consistency **Advanced Features**: Smart branch detection, automated state mapping, review integration, commit analysis, comprehensive validation. **Workflow Integration**: Real-time updates, bidirectional sync, event-driven automation, comprehensive monitoring. **Output**: Complete PR-task integration with automated synchronization, workflow enhancement, state management, and comprehensive relationship tracking.
© davila7 · MIT · davila7/claude-code-templates