Skip to main content
command

task-from-pr — Claude Code command: Linear tasks from pull requests

Turns a GitHub pull request into a Linear task, with a size estimate, team assignment and links running both ways.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command sync/task-from-pr
Open on GitHub

What task-from-pr does

The command pulls PR data through gh, picks apart the description for sections and checklists, and builds a Linear task out of what it finds. Size comes from how much code changed, how many files were touched, review comments and testing needs.

It then files the task under the right Linear team, reads priority off the PR labels, and links task and pull request to each other. A duplicate check runs before anything is created.

Batch mode handles several pull requests at once. You need gh with repository access, plus a mapping between GitHub usernames and Linear users — without that mapping there is no one to assign the task to.

What it helps with

  • file a Linear task from a pull request description
  • estimate effort from the size of a PR diff
  • turn a batch of open pull requests into tasks
  • carry PR label priority over to the task
  • link a task and its pull request both ways

Example prompts for the agent

  • Create a Linear task from pull request 142
  • Analyze PR 142 and assign the task to the backend team with a size estimate
  • Batch process all open pull requests and create tasks for them

How to install task-from-pr

1claude-code-templates

npx claude-code-templates@latest --command sync/task-from-pr

2Manually: put the files in place

.claude/commands/task-from-pr.md

Call it with /task-from-pr. For all projects use ~/.claude/commands/

Questions about task-from-pr

How do I install task-from-pr in Claude Code?

Run npx claude-code-templates@latest --command sync/task-from-pr; the file lands at .claude/commands/task-from-pr.md.

What does task-from-pr do?

It creates Linear tasks from GitHub pull requests: parses the description, estimates size, picks a team and links the task to the PR.

What does the command need to work?

Repository access through gh and a mapping of GitHub usernames to Linear users, otherwise there is no assignee for the task.

Source text

task-from-pr.md · MIT
---
allowed-tools: Read, Write, Edit, Bash
argument-hint: "[pr-number] | --team | --estimate | --batch-process | --auto-create"
description: Create Linear tasks from GitHub pull requests with intelligent content extraction and task sizing
---

# Task from PR

Create Linear tasks from GitHub pull requests with intelligent analysis: **$ARGUMENTS**

## Current PR Environment

- Repository: !`gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "No repo context"`
- PR status: Based on $ARGUMENTS PR number or batch processing criteria
- Linear teams: Available teams for task assignment
- User mappings: GitHub username to Linear user correspondence

## Task

Generate Linear tasks from GitHub pull requests with comprehensive content analysis:

**PR Source**: Use $ARGUMENTS to specify PR number, team assignment, size estimation, or batch processing mode

**Task Generation Framework**:
1. **PR Analysis** - Extract comprehensive PR data, parse description structure, identify key components, analyze changes
2. **Content Extraction** - Parse structured sections, extract checklists, identify technical details, capture requirements
3. **Intelligent Sizing** - Estimate task complexity from code changes, file count, review comments, testing requirements
4. **Task Construction** - Build Linear task with proper formatting, preserve PR context, maintain references, structure content
5. **Team Assignment** - Map to appropriate Linear team, assign based on code areas, set priorities from labels
6. **Validation & Creation** - Check for duplicates, validate task structure, create in Linear, establish bidirectional links

**Advanced Features**: Smart content parsing, automated size estimation, intelligent team mapping, comprehensive validation, batch processing.

**Quality Assurance**: Duplicate detection, content validation, proper formatting, relationship maintenance, comprehensive error handling.

**Output**: Successfully created Linear tasks with comprehensive PR context, accurate sizing estimates, proper team assignments, and complete bidirectional linking.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Git and GitHub →

From the same set361

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor