An intelligent issue analysis system that automatically processes Linear issues using specialized AI agents. Built with Upstash Workflow and Cloudflare Workers, it provides deep insights, technical analysis, and smart prioritization for your Linear issues.
Caution
This project is currently in beta and under active development - while functional, it may contain bugs or exhibit unexpected behavior, so consider starting with a test workspace before using in important projects.
- β¨ Features
- π Getting Started
- π§ Architecture
- π Usage
- π Security
- π¨ Error Handling
- π€ Contributing
- π License
- π Acknowledgments
- π« Support
-
π€ Multi-Agent System - Specialized agents for different types of analysis:
- Manager Agent - Orchestrates task distribution and workflow coordination
- Bug Agent - Deep analysis of bug reports with automatic research
- Feature Agent - Market research and technical feasibility analysis
- Improvement Agent - Technical debt and performance optimization analysis
-
π Intelligent Analysis Tools
- Code Quality Analysis - Evaluates code patterns and suggests improvements
- Performance Analysis - Analyzes metrics and provides optimization recommendations
- Dependency Analysis - Checks for updates, security issues, and breaking changes
- Security Analysis - Identifies potential vulnerabilities and security implications
- Market Research - Evaluates similar products and features (via ProductHunt)
- Technical Feasibility - Assesses implementation approaches and challenges
-
π― Smart Prioritization
- Context-aware priority assessment
- Impact and effort-based scoring
- Automatic priority updates with detailed explanations
-
π Integrated Research
- Stack Overflow integration for technical solutions
- GitHub Issues search for similar problems
- DuckDuckGo search for broad context gathering
- Competitor analysis for feature research
- Node.js (v18 or higher)
- Wrangler (Cloudflare Workers CLI)
- Linear account with API access
- Upstash account with Workflow access
-
Clone the repository:
git clone https://github.com/yourusername/linear-copilot.git cd linear-copilot
-
Install dependencies:
npm install
-
Create a development environment file:
cp wrangler.example.toml wrangler.toml
-
Configure your development environment in
.dev.vars
:# Linear API Keys MANAGER_API_KEY=your_manager_api_key BUG_API_KEY=your_bug_api_key FEATURE_API_KEY=your_feature_api_key IMPROVEMENT_API_KEY=your_improvement_api_key # Linear Webhook Configuration LINEAR_WEBHOOK_SECRET=your_webhook_secret # Upstash Configuration UPSTASH_REDIS_URL=your_redis_url UPSTASH_REDIS_TOKEN=your_redis_token # Agent Configuration QSTASH_TOKEN=your_qstash_token OPENAI_API_KEY=your_openai_api_key
-
Start the development server:
npm run dev
-
For local webhook testing, use a tool like ngrok:
ngrok http 8787
-
Login to Cloudflare:
npx wrangler login
-
Configure your production secrets:
npx wrangler secret put MANAGER_API_KEY npx wrangler secret put BUG_API_KEY npx wrangler secret put FEATURE_API_KEY npx wrangler secret put IMPROVEMENT_API_KEY npx wrangler secret put LINEAR_WEBHOOK_SECRET npx wrangler secret put UPSTASH_REDIS_URL npx wrangler secret put UPSTASH_REDIS_TOKEN
-
Deploy to Cloudflare Workers:
npm run deploy
-
Your webhook endpoint will be available at:
https://<your-worker>.<your-subdomain>.workers.dev/
- Go to your Linear workspace settings
- Navigate to "Webhooks" and click "New Webhook"
- Enter your Cloudflare Worker URL
- Select the following events:
- Issue: Created
- Issue: Updated (for label changes)
- Save the webhook and copy the secret
- Update your
LINEAR_WEBHOOK_SECRET
environment variable
The system uses a multi-agent architecture where each agent is specialized in analyzing different aspects of issues:
- Manager Agent: Routes issues to appropriate specialized agents and coordinates workflow
- Bug Agent: Analyzes bug reports, searches for similar issues, and provides solution recommendations
- Feature Agent: Evaluates feature requests, performs market research, and assesses technical feasibility
- Improvement Agent: Analyzes technical improvements, performance metrics, and provides optimization recommendations
Each agent has access to specialized tools based on their focus:
- Error Analysis - Searches for similar issues and solutions
- Stack Overflow Integration - Finds technical solutions and workarounds
- GitHub Issues Search - Identifies similar bug reports and fixes
- Code Quality Analysis - Examines potential code-related causes
- Market Research - Evaluates similar products via ProductHunt
- Competitor Analysis - Researches competitor implementations
- Technical Feasibility - Assesses implementation approaches
- Requirements Analysis - Evaluates feature scope and impact
- Performance Analysis - Evaluates metrics and suggests optimizations
- Code Quality Assessment - Analyzes maintainability and patterns
- Dependency Analysis - Checks for updates and security issues
- Technical Debt Evaluation - Assesses improvement impact
- Upstash Workflow - Serverless task orchestration
- Cloudflare Workers - Edge computing platform
- Linear SDK - Issue tracking integration
- TypeScript - Type-safe development
The system automatically processes issues when:
- A new issue is created in Linear
- An issue's labels are updated
The appropriate agent will:
- Analyze the issue based on its type (bug, feature, improvement)
- Perform relevant analysis using specialized tools
- Add detailed comments with findings and recommendations
- Update issue priority based on comprehensive analysis
- Suggest next steps or additional requirements
-
Bug Report Analysis:
- Bug Agent searches for similar issues on Stack Overflow and GitHub
- Analyzes error patterns and potential solutions
- Provides code quality recommendations if applicable
- Sets priority based on impact and urgency
- Adds detailed comments with findings and next steps
-
Feature Request Analysis:
- Feature Agent researches similar products on ProductHunt
- Analyzes competitor implementations
- Assesses technical feasibility and challenges
- Sets priority based on business value and implementation effort
- Provides detailed market and technical recommendations
-
Improvement Analysis:
- Improvement Agent analyzes performance metrics and thresholds
- Evaluates code quality patterns and technical debt
- Checks dependencies for updates and security issues
- Sets priority based on technical impact and implementation risk
- Provides optimization recommendations with context-aware priorities
Each analysis includes:
- Detailed findings from specialized tools
- Context-aware recommendations
- Automatic priority updates with explanations
- Integration with external knowledge bases
- Clear next steps and requirements
- Secure storage of API keys using Cloudflare Workers' environment variables
- Linear webhook signature validation
- IP allowlist validation
- Rate limiting implementation
- Sanitized error outputs
The system implements robust error handling:
- Webhook request validation
- Tool execution error handling
- Detailed error reporting
- Graceful failure recovery
We welcome contributions! Please read our Contributing Guide for details on:
- Code of Conduct
- Development process
- Pull request guidelines
- Testing requirements
- Style guide
This project is licensed under the MIT License - see the LICENSE file for details.
- Linear for their excellent issue tracking system and API
- Upstash for their serverless workflow engine
- Cloudflare for their edge computing platform
- OpenAI for their language models
- Open an issue for bug reports or feature requests
- Follow me on X for updates
- Star the repo if you find it useful!