Skip to content

feat: add Linear integration with polling, output handlers, and settings UI#27

Draft
dawilco wants to merge 2 commits into
Charlie85270:mainfrom
dawilco:feat/linear-integration
Draft

feat: add Linear integration with polling, output handlers, and settings UI#27
dawilco wants to merge 2 commits into
Charlie85270:mainfrom
dawilco:feat/linear-integration

Conversation

@dawilco

@dawilco dawilco commented Mar 9, 2026

Copy link
Copy Markdown

Closes #26

Summary

Full Linear integration with autonomous backlog processing capabilities:

  • Baseline Integration: Linear as automation source (polls issues via GraphQL API), output handlers (comment, transition, create issue), Settings UI with API key config
  • MCP Tools: update_linear_issue, create_linear_issue, get_linear_issue registered as agent-callable tools
  • Kanban Bridge: Linear issues auto-create kanban tasks with deduplication, priority mapping, and full context
  • Queue System: Sequential, concurrent, or parallel processing modes with auto-advance from done to next backlog item
  • Bidirectional Sync: Kanban column transitions sync to Linear status (ongoing→In Progress, done→Done with completion comment)
  • Git Workflow: Auto-generated branch names per ticket, PR creation instructions in agent prompts
  • Progress UI: BacklogProgress component with real-time polling, progress bar, queue stats, retry controls

Commits

1. Baseline Linear Integration

  • Linear polling via GraphQL API with team/project/custom filters
  • Output handlers: comment, transition, create issue
  • Settings > Linear page with API key, toggle, test connection
  • Linear source option in automation creation UI
  • 87 tests (74 orchestrator + 13 handler)
  • Official Linear SVG logo icon

2. Autonomous Backlog Processing (Phases 1-6)

Phase 1 - Linear MCP Tools:

  • update_linear_issue — comment + transition by identifier or UUID
  • create_linear_issue — with team, priority, labels support, uses GraphQL variables
  • get_linear_issue — full details with comments, sub-issues, cycle, estimates

Phase 2 - Linear-to-Kanban Bridge:

  • createKanbanTaskFromLinearItem() mirrors JIRA bridge pattern
  • Auto-creates kanban backlog tasks from Linear polls
  • Linear-aware agent prompts with tool instructions
  • Git workflow instructions (branch naming, PR creation)

Phase 3 - Queue Auto-Advance:

  • QueueConfig type: sequential/concurrent/parallel modes
  • Queue state in ~/.dorothy/automation-queue.json
  • Kanban-driven advancement: done → next backlog item auto-planned
  • automation:startBacklog, getBacklogStatus, retryFailed IPC handlers
  • Queue config UI in automation creation form

Phase 4 - Git Workflow:

  • Branch naming: dorothy/ENG-123-sanitized-title
  • Agent prompts include PR creation and Linear status transition instructions

Phase 5 - Bidirectional Sync:

  • Kanban ongoing → Linear "In Progress"
  • Kanban done → Linear "Done" + completion comment
  • 30-minute timeout for queue mode agents (vs 5min default)

Phase 6 - Progress UI:

  • BacklogProgress component with 10s polling
  • Progress bar, column counts, queue stats
  • Start Backlog and Retry Failed buttons

Files Changed

File Changes
mcp-orchestrator/src/tools/automations.ts +540 — MCP tools, kanban bridge, queue processing
mcp-orchestrator/src/utils/automations.ts +95 — QueueConfig, QueueItem types, queue CRUD
electron/handlers/kanban-handlers.ts +164 — Linear sync, auto-advance, agent prompts
electron/handlers/automation-handlers.ts +140 — Backlog IPC handlers, queue config
src/app/automations/page.tsx +191 — BacklogProgress component, queue config UI
electron/preload.ts +6 — startBacklog, getBacklogStatus, retryFailed
src/types/electron.d.ts +8 — Backlog IPC type definitions

Test plan

  • npx vitest run — all 875 tests pass (31 files)
  • npx tsc --noEmit — no new TypeScript errors in modified files
  • Verify Settings > Linear page renders with API key input and test button
  • Verify automation creation shows Linear as source with queue config options
  • Test Linear polling with valid API key → kanban tasks created
  • Test queue auto-advance: complete one task → next auto-moves to planned
  • Test bidirectional sync: kanban done → Linear issue transitioned to Done
  • Test BacklogProgress component shows real-time stats

🤖 Generated with Claude Code

…ngs UI

- Add Linear as an automation source (polls issues via GraphQL API)
- Add Linear output handlers: comment, transition, create issue
- Add Settings > Linear page with API key config and test connection
- Add Linear as source option in automation creation UI
- Include 87 tests (74 orchestrator + 13 handler)
- Use official Linear SVG logo icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

@dawilco is attempting to deploy a commit to the Charlie Rabiller's projects Team on Vercel.

A member of the Team first needs to authorize it.

@dawilco

dawilco commented Mar 9, 2026

Copy link
Copy Markdown
Author

resolves #26

…dge, and bidirectional sync

Phase 1 - Linear MCP Tools:
- Register update_linear_issue tool (comment + transition by identifier or UUID)
- Register create_linear_issue tool (with team, priority, labels support)
- Register get_linear_issue tool (full details with comments, sub-issues, metadata)

Phase 2 - Linear-to-Kanban Bridge:
- Add createKanbanTaskFromLinearItem() mirroring JIRA bridge
- Wire into runAutomation to auto-create kanban tasks from Linear polls
- Add Linear-aware agent prompts with get/update_linear_issue instructions
- Add git workflow instructions (branch naming, PR creation, status transitions)

Phase 3 - Queue Auto-Advance:
- Add QueueConfig and QueueItem types to automation utils
- Add queue state file (~/.dorothy/automation-queue.json) with CRUD operations
- Add queue-aware processing (sequential/concurrent/parallel modes)
- Add kanban-driven queue advancement (done -> next backlog item auto-planned)
- Add automation:startBacklog, automation:getBacklogStatus, automation:retryFailed IPC handlers
- Add queue config UI (mode selector, max concurrent agents)
- Increase agent timeout to 30min for queue mode

Phase 4 - Git Workflow per Ticket:
- Auto-generate branch names from Linear identifiers (dorothy/ENG-123-title)
- Add git/PR instructions to Linear task agent prompts

Phase 5 - Bidirectional Status Sync:
- Add syncKanbanToLinear() for ongoing/done transitions
- Kanban ongoing -> Linear "In Progress", done -> Linear "Done" + completion comment

Phase 6 - Backlog Progress UI:
- Add BacklogProgress component with real-time status polling
- Show progress bar, kanban column counts, queue stats
- Start Backlog and Retry Failed action buttons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dawilco dawilco mentioned this pull request Mar 9, 2026
@dawilco dawilco marked this pull request as draft March 9, 2026 03:22
@dawilco

dawilco commented Mar 9, 2026

Copy link
Copy Markdown
Author

Its late here EST, testing it out but at the minimum Linear should be useful for this project!

@Charlie85270

Copy link
Copy Markdown
Owner

Hey @dawilco , thanks a lot for the contribution. Agree linear is a good fit, I'll take a look to your PR soon. BTW your PR is still in Draft, it's wanted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for Linear

2 participants