# Ship a GitHub PR From a Slack Message with Managed Deep Agents

## Executive summary

This walkthrough introduces Patch, an agent built using LangChain's Managed Deep Agents (MDAs). Patch automates the process of converting natural language feature requests from a Slack message into a fully drafted GitHub Pull Request (PR), complete with descriptions and code changes. The agent successfully demonstrated implementing features (e.g., adding a share button, changing the background color) for a Tetris side project, proving that complex integrations—including Slack communication, GitHub interaction, and code sandboxing—can be achieved with minimal code.

## Key takeaways

- Slack-to-GitHub PR Automation: Patch allows development discussions held in Slack to immediately trigger the creation of a GitHub PR, eliminating the need for manual PR drafting and code sharing via screenshots.
- Multi-System Integration Simplicity: Managed Deep Agents simplify connecting disparate systems (Slack, GitHub, Sandbox) into a single agent workflow using only a few lines of code.
- Agent Configuration Components: The agent's functionality is defined by modular files: `agent.py` (defines the agent name and model, e.g., Claude Sonnet 5), `instructions.md` (specifies goals and procedures), and dedicated connectors for Slack, GitHub, and the sandbox.

## Technical details

- Agent Definition (agent.py): The agent is defined in `agent.py`, specifying its name (Patch) and the underlying model (Claude Sonnet 5).
- Agent Instructions (instructions.md): The `instructions.md` file guides the agent, pointing it to the target GitHub repository and instructing it to solve bugs and implement features, while also detailing the required behavior and procedure.
- GitHub Integration: GitHub access is managed using the GitHub MCP (Managed Connector Platform) and requires an access token, which is stored as a secret environment variable (e.g., `Patch GitHub`).
- Sandbox Implementation: The agent's ability to write and test code is enabled by importing and invoking the `define_sandbox` function, providing a secure environment for code execution.

## Practical implications

- Automates the initial stages of the development lifecycle (idea -> PR draft), significantly reducing friction between discussion (Slack) and implementation (GitHub).
- Demonstrates a highly modular and low-code approach to building complex, multi-system agents, which is valuable for CI/CD pipeline enhancement.
- The use of Managed Deep Agents simplifies the orchestration of tools (GitHub, Slack, Sandbox) that traditionally require extensive boilerplate code.

## Topics

Agentic Workflow, LLM Orchestration, GitHub API Integration, Slack API, Code Sandboxing, LangChain, Managed Deep Agents docs, Managed Deep Agents: the fastest way to ship a production deep agent, Connect a Managed Deep Agent to Slack, LangSmith

Source: https://www.youtube.com/watch?v=4-oA1BJeyr4
