How Code Writer works in Slack
When Code Writer is available in Slack:- Teammates can ask Glean in Slack to propose code changes based on channel messages, tickets, or stack traces.
- Agents that include a Code Writer step can be triggered from Slack (for example, from an escalation channel).
- Code Writer opens draft pull requests in GitHub and posts the pull request links and summaries back to Slack.
Prerequisites
Before teammates can use Code Writer in Slack:-
Glean in Slack is installed
- Follow the setup steps in the Glean in Slack documentation so your workspace can use the Glean app.
-
GitHub is connected
- The GitHub connector is configured and indexing the repositories where Code Writer will open pull requests.
-
Code Writer action is configured
- The Code generation / Code Writer action pack is set up in the Admin console with:
- A GitHub data source instance.
- The Glean GitHub App installed.
- Authentication and (optional) GPG signing configured.
- Access granted to the groups who will use Slack.
- The Code generation / Code Writer action pack is set up in the Admin console with:
-
User GitHub auth completed
- On first use, engineers connect their GitHub account via OAuth so Code Writer can run on their behalf.
Usage examples
Handle escalations in Slack
Use Code Writer in an escalation channel to propose fixes as part of your incident workflow. Example-
An on‑call engineer posts an error and stack trace in
#prod-escalations. -
A teammate mentions Glean in Slack and asks:
“Use Code Writer to propose a fix for this error in the
payments-servicerepo.” -
Glean:
- Reads the message and any attached logs.
- Uses Code Writer to propose a fix in the configured repository and branch.
- Posts a draft pull request URL and summary back to
#prod-escalations.
Run a Code Writer agent from Slack
If you have an agent with a Code Writer step:- In Slack, start a conversation with Glean or use the Glean app in a channel.
- Trigger the agent (for example, by name or via a message shortcut, depending on your configuration).
- Provide the required inputs (such as a ticket ID or error summary).
- The agent runs, calls Code Writer as part of its steps, and returns the new pull request link in Slack.
- Jira bug‑fix agents.
- Backlog cleanup agents.
- Internal tools that should be accessible from Slack.
Admin configuration for Slack
Enable Glean in Slack
If you have not already done so:- Install the Glean Slack app for your workspace.
- Complete any workspace‑level and channel‑level permissions needed for Glean to read messages and respond in selected channels.
Confirm Code Writer is enabled
In the Admin console:- Go to Actions.
- Open the Code generation / Code Writer configuration.
-
Verify:
- A GitHub data source instance is selected.
- The Glean GitHub App is installed for the correct organization.
- Authentication is set (User OAuth or central OAuth).
- GPG signing is configured if you require verified commits.
- The Enable actions section includes the users or groups who will use Slack.
Add Glean to relevant channels
To use Code Writer in a Slack channel:- Add the Glean app to the channel (for example,
#prod-escalationsor#eng-support). - Ensure channel members who will invoke Code Writer:
- Have Glean accounts.
- Are included in the Code Writer action’s access list.
Related topics
- Code Writer (features) – overview of Code Writer capabilities and security considerations.
- Set up Code Writer actions – admin configuration for the Code Writer action pack.
- Code Writer (agents) – how to add and configure the Code Writer action in Agent Builder.
- Code generation in Assistant – end‑user guide for code generation and Code Writer in chat.
- GitHub connector – connecting and indexing GitHub as a data source.