Linear Pipeline
Autonomous ticket-to-PR workflow that takes Linear issues and delivers reviewed GitHub pull requests with Slack notifications.
The Linear Pipeline is an autonomous workflow that takes a Linear ticket and delivers a reviewed GitHub pull request -- with minimal human intervention. It handles everything from ticket classification to code generation, verification, PR creation, and review iteration.
How It Works
The pipeline runs a 10-step orchestration:
Step 1: Triage
The system receives a Linear ticket and classifies it:
- Bug -- Includes error reproduction context
- Feature -- Includes acceptance criteria
- Chore -- Includes scope boundaries
- Refactor -- Includes before/after expectations
A type-specific prompt is built for the agent.
Step 2: Preflight Check
Before starting work, the system verifies:
- The workspace directory is clean (no uncommitted changes)
- The target branch doesn't already exist
- Required tools (git, GitHub CLI) are available
Step 3: Create Branch
A branch is automatically created from the issue slug (e.g., fix/login-timeout-error).
Step 4: Agent Execution
The AI agent runs in two phases:
- Planning phase (10-minute timeout) -- Agent analyzes the ticket and creates an execution plan
- Execution phase (10-minute timeout) -- Agent implements the solution with file changes and tool use
Step 5: Verification
The code is verified with automated checks:
- Lint -- Code style validation
- Type-check -- TypeScript compilation
- Retry loop -- Up to 3 automatic fix attempts if checks fail
Step 6: Self-Review
The agent performs a diff analysis of its own changes before creating a PR, checking for:
- Completeness against the original ticket
- Code quality issues
- Unintended changes
Step 7: Create PR
A GitHub pull request is created with:
- Descriptive title and body linking to the Linear ticket
- Targeted git staging (filters out sensitive files like
.env,.key,.pem) - Self-review findings included in the PR description
Step 8: PR Review Loop
The pipeline monitors for review feedback:
- Polls every 5 minutes for new review comments
- 24-hour window for the review cycle
- Up to 10 fix iterations responding to reviewer feedback
- Automatically pushes fixes and requests re-review
Step 9: Slack Notification
A Slack message is sent to your configured channel:
- Links to the PR for human review
- Summary of what was done
- Request for final approval
Step 10: Update Linear
The Linear ticket is updated:
- Status changed to "In Review"
- PR link posted as a comment
- Metadata updated
Webhook Processing
The pipeline can receive Linear tickets via webhooks with defense-in-depth security:
| Layer | Protection |
|---|---|
| IP Allowlisting | Only accepts requests from Linear's published source IPs |
| HMAC Verification | SHA-256 signature validation with timing-safe comparison |
| Replay Protection | Deduplication via Linear-Delivery header |
| Raw Body Preservation | Accurate signature verification |
| Async Processing | Returns 200 immediately, processes in background |
Trigger Modes
| Mode | Description |
|---|---|
| Webhook | Linear sends events to your app automatically |
| Polling | The app periodically checks Linear for new tickets |
| Both | Webhook as primary, polling as fallback |
Configuration
Configure the pipeline in Settings > Connectors:
Linear Settings
- API Key -- For reading tickets and updating status
- Webhook Secret -- For verifying incoming webhooks
- Team ID -- Which Linear team to monitor
- Assignee Filter -- Only process tickets assigned to specific users
- Poll Interval -- How often to check for new tickets (polling mode)
GitHub Settings
- Personal Access Token -- For creating branches and PRs
Slack Settings
- Webhook URL -- For sending notifications
- Channel -- Where to post updates
Pipeline Settings
- Workspace Directory -- Where code changes happen
- Default Branch -- Base branch for new branches (e.g.,
main) - Auto-Process -- Whether to start automatically on new tickets
All credentials are stored encrypted using AES-256-GCM with per-field unique IVs and PBKDF2-SHA512 key derivation.
Timeouts and Limits
| Parameter | Value |
|---|---|
| Planning phase timeout | 10 minutes |
| Execution phase timeout | 10 minutes |
| Total pipeline timeout | 60 minutes |
| Max verification retries | 3 |
| Max PR review iterations | 10 |
| Review poll interval | 5 minutes |
| Review window | 24 hours |
Error Handling
The pipeline handles errors at each phase:
- Phase-level retries -- Each step can retry on transient failures
- State persistence -- Pipeline state saved to disk for recovery
- Graceful degradation -- If Slack fails, the PR is still created
- Logging -- Comprehensive logging for debugging
Learn More
- Agent System -- How the agent executes tasks
- Workspace Security -- How the workspace is protected
- Desktop Application -- Overview and setup