{"id":29360083,"url":"https://github.com/quang1225/slack-cursor-ide-assistant","last_synced_at":"2026-04-10T23:32:45.747Z","repository":{"id":302605287,"uuid":"1012999803","full_name":"quang1225/slack-cursor-ide-assistant","owner":"quang1225","description":"A Slack bot that summarize requirements in a Slack thread and forwards messages to Cursor editor's chat (Agent mode) interface on macOS. This bot runs locally (for fast codebase indexing). Output is a Merge Request with analytics.","archived":false,"fork":false,"pushed_at":"2025-08-29T10:28:23.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-29T13:19:02.341Z","etag":null,"topics":["ai","cursor","cursor-ai","cursorai","llm","mcp","mcp-server","slack","slack-bot","slackbot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quang1225.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T07:55:48.000Z","updated_at":"2025-08-29T10:28:26.000Z","dependencies_parsed_at":"2025-08-29T11:27:40.211Z","dependency_job_id":null,"html_url":"https://github.com/quang1225/slack-cursor-ide-assistant","commit_stats":null,"previous_names":["quang1225/slack-cursor-ide-assistant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quang1225/slack-cursor-ide-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quang1225%2Fslack-cursor-ide-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quang1225%2Fslack-cursor-ide-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quang1225%2Fslack-cursor-ide-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quang1225%2Fslack-cursor-ide-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quang1225","download_url":"https://codeload.github.com/quang1225/slack-cursor-ide-assistant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quang1225%2Fslack-cursor-ide-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278315190,"owners_count":25966774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cursor","cursor-ai","cursorai","llm","mcp","mcp-server","slack","slack-bot","slackbot"],"created_at":"2025-07-09T07:09:50.739Z","updated_at":"2025-10-04T12:49:03.968Z","avatar_url":"https://github.com/quang1225.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-cursor-ide-assistant\n\nA sophisticated Slack bot that creates an AI-assisted development workflow by forwarding Slack messages to Cursor editor's Agent mode, enabling automatic code generation, GitLab MR creation, and preview URL generation. This bot runs locally for fast codebase indexing and seamless integration with your development workflow.\n\n## Features\n\n- 🤖 **AI-Powered Development Workflow** - Forward Slack messages to Cursor's Agent mode for automatic code generation\n- 🧵 **Smart Thread Context** - Captures complete conversation history for better AI understanding\n- 🔀 **GitLab Integration** - Automatic Merge Request creation with proper branching and commit conventions\n- 🌐 **Preview URL Generation** - Creates demo environments and preview links\n- 🎯 **Intelligent Response System** - Bot replies back to Slack threads with MR links and results\n- 📱 **Fallback Notifications** - Desktop notifications as backup when direct integration fails\n- 🔧 **Socket Mode Integration** - Real-time messaging without webhooks\n- 🍎 **Native macOS Integration** - AppleScript automation for seamless Cursor control\n- 📝 **Rich Message Formatting** - Includes sender, channel, and thread context information\n- 🔄 **Project-Specific Setup** - Opens specific project folders in Cursor automatically\n\n## Slide\n\n[https://docs.google.com/presentation/d/1mq8SpC92NjMPRGHun8lNRQPwV7wN__QdzrxndYIRAhM](https://docs.google.com/presentation/d/1mq8SpC92NjMPRGHun8lNRQPwV7wN__QdzrxndYIRAhM)\n\n## RFC\n\n[https://docs.google.com/document/d/1PqM_IaivSpb4itCDbPHWXmEBy2cmSdBJxUopteU1XSw](https://docs.google.com/document/d/1PqM_IaivSpb4itCDbPHWXmEBy2cmSdBJxUopteU1XSw)\n\n## Quick Start 🚀\n\nGet your Slack-Cursor bot running in 5 minutes!\n\n### Prerequisites for Quick Start\n\n- macOS computer\n- Cursor editor installed\n- Node.js (v18+)\n- Slack workspace admin access\n\n### 1. Create Slack App (Fastest Method)\n\n#### Option A: Use Slack App Manifest\n\n1. Go to [Slack Apps](https://api.slack.com/apps)\n2. Click \"Create New App\" → \"From an app manifest\"\n3. Select your workspace\n4. Copy and paste this manifest:\n\n```yaml\ndisplay_information:\n  name: Cursor Bot\n  description: Forwards Slack messages to Cursor AI chat\n  background_color: '#2c2d30'\nfeatures:\n  bot_user:\n    display_name: Cursor Bot\n    always_online: false\noauth_config:\n  scopes:\n    bot:\n      - app_mentions:read\n      - channels:history\n      - channels:read\n      - chat:write\n      - reactions:write\nsettings:\n  socket_mode_enabled: true\n  token_rotation_enabled: false\n```\n\n5. Create the app and note down your tokens\n\n#### Option B: Manual Setup\n\nFollow the detailed setup instructions below in the \"Setup Instructions\" section.\n\n### 2. Quick Environment Setup\n\nCreate a `.env` file with your tokens:\n\n```bash\n# Slack Configuration\nSLACK_BOT_TOKEN=xoxb-your-bot-token\nSLACK_SIGNING_SECRET=your-signing-secret\nSLACK_APP_TOKEN=xapp-your-app-token\n\n# Optional: Debug and Project Settings\nDEBUG_MODE=false\nPROJECT_LOCAL_PATH=/path/to/your/project\n\n# GitLab Integration (Optional - for MR creation)\nGITLAB_PROJECT_URL=https://gitlab.com/your-org/your-project\nGITLAB_PROJECT_ID=12345\nGITLAB_MR_TARGET_BRANCH=main\nGITLAB_MR_DEFAULT_LABEL=bot-generated\nSAMPLE_DEMO_URL=https://your-demo-site.com\n```\n\n### 3. Quick Test\n\n```bash\n# Install dependencies\nnpm install\n\n# Test Cursor integration first\nnpm run test-cursor\n\n# If that works, start the bot\nnpm start\n```\n\n### 4. Test in Slack\n\n1. Add the bot to a channel: `/invite @Cursor Bot`\n2. Send a message in the channel\n3. Check Cursor - you should see the message appear!\n\n### Quick Troubleshooting\n\n- **Bot not receiving messages?** Check if bot is in the channel and verify tokens in `.env`\n- **Cursor integration not working?** Grant accessibility permissions to Terminal and make sure Cursor is running\n- **Test manually:** `osascript -e 'tell application \"Cursor\" to activate'`\n\n---\n\n## Prerequisites\n\n- macOS (required for AppleScript integration)\n- Node.js (v18 or higher)\n- Cursor editor installed\n- Slack workspace with admin permissions\n\n## Setup Instructions\n\n### 1. Clone and Install Dependencies\n\n```bash\n# Install dependencies\nnpm install\n\n# Or use yarn\nyarn install\n```\n\n### 2. Create Slack App\n\n1. Go to [Slack API Apps](https://api.slack.com/apps)\n2. Click \"Create New App\" → \"From scratch\"\n3. Name your app (e.g., \"Cursor Bot\") and select your workspace\n4. Navigate to \"OAuth \u0026 Permissions\" in the sidebar\n\n### 3. Configure OAuth Scopes\n\nAdd these Bot Token Scopes:\n\n- `app_mentions:read` - Read mentions\n- `channels:history` - Read channel messages\n- `chat:write` - Send messages\n- `reactions:write` - Add reactions\n- `channels:read` - Read channel information\n\n### 4. Enable Socket Mode\n\n1. Go to \"Socket Mode\" in the sidebar\n2. Toggle \"Enable Socket Mode\"\n3. Create an App-Level Token with `connections:write` scope\n4. Save the App Token (starts with `xapp-`)\n\n### 5. Install App to Workspace\n\n1. Go to \"OAuth \u0026 Permissions\"\n2. Click \"Install to Workspace\"\n3. Authorize the app\n4. Copy the Bot User OAuth Token (starts with `xoxb-`)\n\n### 6. Get Signing Secret\n\n1. Go to \"Basic Information\"\n2. Copy the Signing Secret from \"App Credentials\"\n\n### 7. Configure Environment Variables\n\nCreate a `.env` file in the root directory with all required variables:\n\n### 8. Enable Accessibility Permissions\n\nFor AppleScript to control Cursor, you need to grant accessibility permissions:\n\n1. Open System Preferences → Security \u0026 Privacy → Privacy\n2. Select \"Accessibility\" from the left panel\n3. Click the lock to make changes\n4. Add Terminal (or your preferred terminal app)\n5. Add Node.js if it appears in the list\n\n## Usage\n\n### Start the Bot\n\n```bash\n# Development mode with auto-restart\nnpm run dev\n\n# Production mode\nnpm start\n```\n\n### Test the Integration\n\nBefore starting the full bot, test the Cursor integration:\n\n```bash\n# Test Cursor integration (recommended first step)\nnpm run test-cursor\n```\n\nThis will:\n\n- ✅ Verify Cursor is available and running\n- ✅ Test project folder opening (if configured)\n- ✅ Send a comprehensive test message to Agent mode\n- ✅ Test notification fallback system\n\nIf the test passes, then start the full bot:\n\n1. **Start the bot**: `npm start`\n2. **Open Cursor editor** and ensure it's running\n3. **Send a message** in a Slack channel where the bot is present\n4. **Check Cursor** - you should see a new Agent conversation with your message and thread context\n5. **Wait for AI response** - Cursor AI will process and reply back to the Slack thread\n\n### Bot Commands\n\n- **Any message in channels**: Bot captures thread context, forwards to Cursor Agent mode, and replies with MR results\n- **@mention the bot**: Bot responds immediately with status message, processes request via Cursor AI\n- **Thread conversations**: Bot maintains complete conversation history for better AI context\n- **Direct messages**: Bot forwards DMs to Cursor with full workflow automation\n\n### Expected Workflow\n\n1. **User posts request** in Slack channel or mentions the bot\n2. **Bot replies** with \"🧠 I'm creating the MR and Preview URL based on your request...\"\n3. **Cursor AI processes** the request with full thread context and workflow rules\n4. **AI creates** code, branches, and Merge Request following conventions\n5. **Bot replies** in thread with MR link, preview URL, and implementation summary\n\n## How It Works\n\n1. **Slack Integration**: Uses Slack Bolt SDK with Socket Mode for real-time messaging\n2. **Thread Context Capture**: Automatically gathers complete conversation history from Slack threads\n3. **Cursor Rules Injection**: Adds comprehensive development workflow instructions to each message\n4. **Project Opening**: Opens specific project folder in Cursor using CLI or AppleScript (if configured)\n5. **Agent Mode Activation**: Uses AppleScript to:\n   - Activate Cursor application\n   - Start new Agent session (Cmd+Shift+I)\n   - Inject formatted message with thread context via clipboard\n   - Send message to AI agent\n6. **AI Development Workflow**: Cursor AI agent processes the request and:\n   - Analyzes requirements from the Slack conversation\n   - Creates/modifies code based on the request\n   - Creates GitLab branches following naming conventions\n   - Generates Merge Requests with proper formatting\n   - Sets up preview environments\n   - Replies back to the original Slack thread with results\n7. **Fallback System**: Shows macOS notifications if direct integration fails\n\n## Cursor Keyboard Shortcuts\n\nThe bot uses these Cursor shortcuts:\n\n- `Cmd+Shift+I`: Start new Agent session (primary method)\n- `Cmd+V`: Paste formatted message via clipboard\n- `Enter`: Send message to AI agent\n\nMake sure these shortcuts are enabled in Cursor's settings. Each Slack message will start a fresh Agent conversation in Cursor with complete thread context and development workflow instructions.\n\n## Troubleshooting\n\n### Bot Not Receiving Messages\n\n- Check if bot is added to the channel\n- Verify OAuth scopes are correct\n- Ensure Socket Mode is enabled\n\n### Cursor Integration Not Working\n\n- Verify Cursor is running\n- Check accessibility permissions\n- Try running in debug mode: `DEBUG_MODE=true`\n- Test with `osascript` manually:\n  ```bash\n  osascript -e 'tell application \"Cursor\" to activate'\n  ```\n\n### Common Issues\n\n1. **\"Cursor not found\"**: Make sure Cursor is installed and in Applications\n2. **Permissions denied**: Grant accessibility permissions to Terminal/Node\n3. **Messages not formatting**: Check AppleScript escaping for special characters\n\n## Advanced Configuration\n\n### Project-Specific Setup\n\nIf you want Cursor to open a specific project folder when receiving Slack messages, set the `PROJECT_LOCAL_PATH` environment variable:\n\n```bash\n# In your .env file\nPROJECT_LOCAL_PATH=/path/to/your/project\n# Example: PROJECT_LOCAL_PATH=/Users/username/Documents/PROJECTS/my-project\n```\n\nThis will:\n\n- Open Cursor with your project folder before sending messages\n- Keep your context focused on the right codebase\n- Use either AppleScript (Cmd+O) or CLI (`cursor` command) to open the project\n\n### Custom Message Formatting\n\nEdit `src/cursor-integration.js` to customize message formatting:\n\n```javascript\nconst formattedMessage = `Custom format: ${userName} says: ${message.text}`\n```\n\n### Alternative Integration Methods\n\nThe bot includes multiple integration methods:\n\n- Direct typing with AppleScript\n- Clipboard-based message sending\n- Notification fallbacks\n- Project-specific folder opening\n\n## Development\n\n### Project Structure\n\n```\nsrc/\n├── index.js              # Main bot entry point with Slack integration\n├── cursor-integration.js # Cursor Agent mode automation logic\n├── cursor-rules.js       # AI development workflow rules and instructions\n├── test-cursor.js        # Integration testing script\n├── api/                  # Future API endpoints (empty)\n└── utils/\n    └── logger.js         # Logging utility\n```\n\n### Adding Features\n\n1. **Message Handlers**: Edit Slack event handlers in `src/index.js`\n2. **Cursor Integration**: Modify AppleScript automation in `src/cursor-integration.js`\n3. **AI Workflow Rules**: Update development workflow instructions in `src/cursor-rules.js`\n4. **Testing**: Use `npm run test-cursor` to verify Cursor integration\n5. **Development Mode**: Run with `npm start` for testing\n\n### AI Development Workflow\n\nThis bot implements a sophisticated AI-assisted development workflow:\n\n1. **Thread Context**: Captures complete Slack conversation history\n2. **Cursor Rules**: Injects comprehensive development instructions including:\n   - Git workflow with proper branching (`bot.quang.lehong/{jira-ticket-id}`)\n   - Commit message format: `[AI generated] [TICKET-ID] Description`\n   - GitLab MR creation with labels and assignees\n   - Preview URL generation and formatting\n3. **Response System**: AI agent replies back to Slack thread with:\n   - MR links and status\n   - Preview URLs for testing\n   - Implementation summary\n\n### GitLab Integration Requirements\n\nFor full workflow automation, ensure you have:\n\n- GitLab MCP tools configured in Cursor\n- Proper GitLab project access tokens\n- Branch protection rules configured\n- CI/CD pipelines for preview deployments\n\n## Security Notes\n\n- Keep your Slack tokens secure\n- Don't commit `.env` file to version control\n- The bot runs locally - no data leaves your machine\n- AppleScript has system access - review scripts before running\n\n## Version\n\n**Current Version**: 1.0.0 (Released 2024-07-04)\n\nSee [CHANGELOG.md](CHANGELOG.md) for detailed version history.\n\n## Requirements\n\n- **Node.js**: \u003e= 18.0.0\n- **macOS**: Required for AppleScript integration\n- **Cursor**: Latest version with Agent mode support\n- **Slack Workspace**: Admin permissions for app installation\n\n## License\n\nMIT License - Feel free to modify and distribute\n\n**Author**: quang1225 (quang1225@gmail.com)\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test with `npm run test-cursor` first\n5. Test the full integration with a Slack workspace\n6. Submit a pull request\n\n---\n\n**Need help?** Check the troubleshooting section or create an issue in the repository.\n\n**Pro Tip**: Start with `npm run test-cursor` to ensure your Cursor integration is working before setting up Slack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquang1225%2Fslack-cursor-ide-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquang1225%2Fslack-cursor-ide-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquang1225%2Fslack-cursor-ide-assistant/lists"}