How I Turned Slack Into an AI Teammate That Opens Pull Requests
DEV Community

How I Turned Slack Into an AI Teammate That Opens Pull Requests

This is a submission for Weekend Challenge: Passion Edition.

While talking about AI workflow automation, someone asked me a simple question: β€œAre you using it yourself?” That question stayed with me. My passion is software engineering, so for the DEV Weekend Challenge, I decided to automate a small part of the work I do every day: turning an idea or bug report into a pull request.

What I Built

I built Slack2PR, an AI coding teammate accessible directly from Slack. You mention the bot, describe what you need, and it can:

  • Ask follow-up questions about the requirements
  • Inspect the target GitHub repository
  • Create an implementation plan
  • Build the feature component by component
  • Write and run unit tests
  • Create a branch and open a pull request
  • Return the PR link inside the original Slack thread

Slack2PR also distinguishes between three types of requests:

  • Feature: clarify, plan, implement, test, and open a PR
  • Bug: investigate first, then wait for approval before applying a fix
  • Question: inspect the code in read-only mode and explain it

It was to explore what happens when an AI agent becomes part of the development workflow instead of being limited to a separate chat window.

Demo Code

marrouchi / Slack2PR

An AI coding workflow that turns Slack requests into GitHub pull requests using OpenCode and isolated sandboxes.

Slack2PR - Your AI Code Companion on Slack

Mention it in Slack like a teammate, describe a feature or a bug, and it plans, codes, tests, and opens a pull request on GitHub.

Slack2PR is a Hexabot app that automates the software development lifecycle end to end: a Slack message triggers an agentic workflow that interviews you about requirements, breaks the work into components, implements them one by one inside a sandboxed clone of your repository, writes unit tests, and replies in the thread with a PR link. It exists to answer the question every Hexabot engineer eventually gets asked: "Are you using it yourself?" - yes, even to build Hexabot.

How It Works

Slack message
β”‚
β–Ό
Slack channel (hexabot-channel-slack)
β”‚
β–Ό
Slack2PR workflow ── classify intent
β”‚
β”œβ”€ develop β†’ requirements interview β†’ plan components β†’ implement each
β”‚   in a loop β†’ write unit tests β†’ open PR

How I Built It

The project combines several tools, each responsible for a different part of the workflow.

  • Hexabot handles the conversational workflow and connects the agent to Slack. The workflow is defined in YAML and manages intent classification, requirements interviews, loops, memory, approval steps, and status updates.
  • Google Gemini is used for intent classification, summarizing requirements, and powering the coding tasks in the demo.
  • OpenCode acts as the coding harness. The implementation is also compatible with Claude Code, Codex, and Grok Build through interchangeable TanStack AI adapters.
  • TanStack AI Sandboxes provide an isolated Docker workspace. Each Slack thread receives a cloned copy of the target repository, and the same sandbox is reused throughout planning, implementation, testing, and delivery.
  • Git and the GitHub CLI are configured inside the sandbox so the agent can create a branch, commit its work, push it, and open a pull request without exposing credentials in its prompts.

One important design decision was to keep the workflow in control. The agent does not receive one giant prompt asking it to do everything. Instead, the workflow divides the job into explicit stages:

Slack request
β”‚
β–Ό
Classify intent
β”‚
β–Ό
Gather requirements
β”‚
β–Ό
Plan components
β”‚
β–Ό
Implement each component
β”‚
β–Ό
Write and run tests
β”‚
β–Ό
Open a GitHub pull request

This makes the process easier to observe, constrain, and improve.

Prize Categories

Best Use of Google AI

Comments

No comments yet. Start the discussion.