AI-powered issue enhancement from context across Slack, Google Drive, and GitHub.
Run as an API server that automatically enhances Linear issues when they're created:
uv run python -m src.main serveWhen you create an issue in Linear with just a title (or minimal description), the API:
- Researches context from Slack and Google Drive
- Analyzes relevant GitHub repositories
- Updates the issue with a comprehensive description
Create an issue manually:
uv run python -m src.main issue \
-p "Fix the authentication timeout issue" \
-r Trelent/backend| Flag | Description |
|---|---|
-p, --prompt |
Issue description (required) |
-r, --repo |
GitHub repo (owner/repo). Omit to auto-discover. |
-b, --branch |
Branch to analyze (default: repo's default) |
Pull latest Slack messages and Google Drive docs:
uv run python -m src.main syncuv sync
cp env.example .env| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic API key |
SLACK_TOKEN |
Slack user token (xoxp-...) |
LINEAR_API_KEY |
Linear API key (for API mode) |
brew install gh
gh auth login- Get a Linear API key from Settings → API → Personal API keys
- Add to
.env:LINEAR_API_KEY=lin_api_... - Start the server:
uv run python -m src.main serve - Expose via ngrok or deploy:
ngrok http 8000 - In Linear: Settings → API → Webhooks → New webhook
- URL:
https://your-domain.ngrok.io/webhook/linear - Data change:
Issue→Create
- URL:
Set GDRIVE_CREDS to a service account JSON path.
- Create app at api.slack.com/apps
- Add User Token Scopes:
channels:history,channels:read,groups:history,groups:read,users:read - Install and copy the User OAuth Token
- Context Researcher — searches synced Slack/GDrive for relevant context
- Code Researcher — discovers repos via
gh, analyzes code and PRs - Issue Writer — synthesizes into a comprehensive issue description
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/webhook/linear |
POST | Linear webhook receiver |
# Install Fly CLI
brew install flyctl
fly auth login
# Deploy
./scripts/deploy-fly.shThis sets up:
- Persistent
/datavolume for synced content - Auto-scaling with minimum 1 instance
- HTTPS endpoint for Linear webhooks
After deploying, set up a cron job for regular syncs:
fly machine run . --schedule "*/30 * * * *" \
-e DOCS_DIR=/data \
--command "uv run python -m src.main sync"Set these secrets in Fly.io:
fly secrets set ANTHROPIC_API_KEY=sk-ant-...
fly secrets set LINEAR_API_KEY=lin_api_...
fly secrets set SLACK_TOKEN=xoxp-...
fly secrets set GH_TOKEN=ghp_... # For GitHub CLI auth
# Google Drive (base64-encode the service account JSON)
fly secrets set GDRIVE_CREDS_BASE64=$(cat credentials/gdrive-service-account.json | base64)src/
├── main.py # CLI entrypoint
├── api.py # FastAPI webhook server
├── linear.py # Linear API client
├── tools.py # Agent tools
├── tracing.py # Real-time logging
├── github_cache.py # Repo caching
├── agents/ # Claude agents
└── sync/ # Slack and GDrive sync