A Slack bot that integrates with Groq AI and Jira to create tasks from Slack threads. The bot uses Groq's deepseek-r1-distill-llama-70b model for intelligent task title and description generation with AI-powered categorization and repository context integration.
- AI Categorization System: Automatically categorizes requests into frontend, docs, agents, contracts, or indexer
- GitHub Repository Integration: Fetches repository context using UitHub API for enhanced issue generation
- Enhanced LLM Context: Uses repository structure and category-specific guidance for better task descriptions
- AI-powered task title and description generation using Groq's deepseek-r1-distill-llama-70b model
- Automatic sprint assignment for non-backlog tasks
- Beautiful unicode-styled confirmation messages with category and repository information
- Git command suggestions for new task branches
- Thread-based context gathering for better task descriptions
- User mapping between Slack and Jira for automatic assignee handling
- Support for both socket mode and HTTP server mode
- Automatic priority assignment (default: Medium)
- Comprehensive error handling and logging
- Bun installed on your system
- Slack workspace with:
- Bot Token (
xoxb-*) - App-Level Token (
xapp-*) for Socket Mode - Signing Secret
- Bot Token (
- Groq API Key
- GitHub Personal Access Token (for private repositories)
- Jira Cloud instance with:
- API Token
- Project configured with sprints
- Custom field for sprint assignment
-
Install dependencies:
bun install
-
Copy the example environment file and configure your variables:
cp .env.example .env
-
Configure environment variables in
.envfile:# Slack Configuration SLACK_BOT_TOKEN=xoxb-your-slack-bot-token SLACK_SIGNING_SECRET=your-slack-signing-secret SLACK_APP_TOKEN=xapp-your-slack-app-level-token-for-socket-mode # Groq API Configuration GROQ_API_KEY=your-groq-api-key # GitHub Configuration GITHUB_PAT=your-github-personal-access-token # Allowed User IDs (comma-separated Slack User IDs) ALLOWED_USER_IDS=U1234,U5678 # Jira Configuration JIRA_BASE=https://your-org.atlassian.net JIRA_EMAIL=your-email@org.com JIRA_API_TOKEN=your-jira-api-token CUSTOM_SPRINT_FIELD=customfield_10007 # Slack User ID to Jira Account ID Mapping (JSON string) SLACK_TO_JIRA_MAP={"U1234":"712020:user1","U5678":"712020:user2"} # Application Port (for HTTP mode) PORT=4207
-
Build the TypeScript code:
bun run build
-
Start the development server:
bun run dev
Or for production:
bun run start
The project uses Bun for fast TypeScript execution and package management. Available commands:
bun run dev- Start development server with hot reloadbun run build- Build production bundlebun run start- Start production serverbun run lint- Run ESLint checksbun run lint:fix- Fix ESLint issuesbun run format- Format code with Prettierbun run format:check- Check code formattingbun run types- Check TypeScript typesbun run types:watch- Watch and check TypeScript types
Mention the bot in a Slack thread with the following options:
@username- Assign the task to a specific userbacklogorback log- Skip sprint assignment and place in backlog
Examples:
@dst-bot @valentin backlog Update documentation
@dst-bot @charles Implement new feature
@dst-bot Fix critical bug
The bot will:
- Analyze and categorize the thread context using AI
- Fetch repository context based on the determined category
- Generate enhanced task title and description using repository-aware prompts
- Create a Jira ticket with appropriate assignments
- Return a formatted message with:
- Issue key and title
- Category and confidence level
- Target repository
- Assignee
- Jira URL
- Git branch creation command
- Git commit message format
For systemd-based deployments, use the provided dst-bot.service file:
-
Copy the service file:
sudo cp dst-bot.service /etc/systemd/system/
-
Enable and start the service:
sudo systemctl enable dst-bot sudo systemctl start dst-bot
The service will:
- Run in the
/root/ds-slackdirectory - Use Bun to execute the server
- Auto-restart on failures
- Load environment variables from
.env - Log to systemd journal
The bot is built with:
- TypeScript for type safety
- @slack/bolt for Slack integration
- @ai-sdk/groq for AI processing
- axios for HTTP requests
- marklassian for Markdown to Atlassian Document Format conversion
- dotenv for environment management
Key components:
src/server.ts- Main application entry pointsrc/worker.ts- Core task processing logic with enhanced categorizationsrc/genai.ts- Groq AI integration with categorization and enhanced contextsrc/repository.ts- UitHub API integration for repository contextsrc/config.ts- Configuration management with repository mappingssrc/types.ts- TypeScript type definitions for new features
Internal use only - DefiSpace