Back/Engineering/Goose
AdvancedEngineeringGoose

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

Tools Used

Goose

Open-source AI agent by Block for automating tasks

02Step-by-Step Guide
1

Post an Idea in Slack

Start by describing a task or an idea for a code change as a regular message in a Slack channel. This message will serve as the initial prompt for the AI agent.

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.
2

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:.

3

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.

4

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.

Pro Tip: This step relies heavily on robust internal tooling and documentation. An environment that is easy for a human developer to navigate is also easy for an AI agent to navigate.
5

Review the Pull Request

After completing its task, the agent creates a pull request for human review. Engineers can then review the AI-generated code, approve it, and merge it, shifting their focus from writing boilerplate code to high-level review.

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