Back/Engineering/Goose
AdvancedEngineering

How to Automate Code Generation from a Slack Message into a Pull Request

Learn how Stripe's engineering team turns a simple Slack message into a complete pull request using AI agents. This workflow automates environment setup, coding, and testing, triggered by a simple emoji reaction, dramatically reducing the friction to start new development work.

How to Automate Code Generation from a Slack Message into a Pull Request

From 06:52 to 13:41, Steve Yegge demonstrates triggering a Minion from a Slack emoji, provisioning its environment, running the agent loop, and opening the resulting pull request. Clip range: 06:52 to 13:41.

Before you start

What you need

  • Slack workspace with emoji-trigger automation configured
  • Repository-specific trigger emoji
  • Cloud development environment provisioning system
  • GitHub repository access with branch and PR permissions
  • Automated test suite and CI configuration

What you’ll make

A pull request generated from a Slack task description with code changes and CI results.

Tools used

  • Goose

    Open-source AI agent by Block for automating tasks

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

5 steps

Step01

Post an Idea in Slack

Describe a task or an idea for a code change in a Slack message. This text becomes the primary instruction for the AI agent, so include specific context and the desired outcome. For example, mention the target URL and the goal, like adding a code example to a documentation page.

Example prompt
I have this cool idea for docs at stripe.com/payment/machine. This is our new machine to machine payment work, which we'll look at later in our call. Um, and I want to make sure the landing page really sticks and gives a good code. Example of how to get started quickly.
Step02

Trigger the Agent with an Emoji

Add a specific, pre-configured emoji reaction to the Slack message to activate the AI agent. The emoji name can specify which repository the agent should work in, for example,:create-minion-payserver:.

Step03

Automated Environment Provisioning

Once triggered, the system automatically spins up a fully-configured, isolated cloud development environment. This includes checking out a new git branch, setting up databases, and installing necessary tools like a VS Code server.

Step04

Execute the Agent Loop

The AI agent, using a harness like Goose, takes the original Slack message as its core prompt. It then enters a loop to solve the task: searching the codebase, identifying files, modifying the code, running tests, and committing the changes.

Example prompt
You are an expert software engineer. Your goal is to implement the following task completely and correctly. Use the available tools to search the codebase, identify files, modify code, run tests, and commit your changes.

Task:
[paste the original request from Slack]
Step05

Review the Pull Request

After completing its task, the agent creates a pull request. Review the AI-generated code as you would any other submission. Check the diff, inspect the output from CI tests, and confirm the changes meet the original request's intent before approving and merging.

What good looks like

  • Adding the configured emoji starts environment provisioning
  • Agent creates a new git branch linked to the Slack request
  • Tests run automatically before pull request creation
  • PR description reflects the original Slack task intent

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

Slack trigger emoji maps to the wrong repository
Validate emoji to repository routing rules before execution
Provisioned environment lacks required dependencies
Sync the environment image with repository setup scripts
Generated changes pass tests but do not satisfy the documented request
Require reviewer comparison against the original Slack message before merge

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready