Skip to main content
You can use Code Writer directly from Slack through Glean’s Slack integration. This lets teammates turn Slack conversations, incidents, and escalations into draft pull requests without leaving their channels. This page explains how admins enable Code Writer for Slack, and how engineers can use it in channels where Glean is installed.

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.
Code Writer uses the same GitHub connector, GitHub App, and action pack configuration as Assistant and agents.

Prerequisites

Before teammates can use Code Writer in Slack:
  1. Glean in Slack is installed
    • Follow the setup steps in the Glean in Slack documentation so your workspace can use the Glean app.
  2. GitHub is connected
    • The GitHub connector is configured and indexing the repositories where Code Writer will open pull requests.
  3. 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.
  4. 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
  1. An on‑call engineer posts an error and stack trace in #prod-escalations.
  2. A teammate mentions Glean in Slack and asks: “Use Code Writer to propose a fix for this error in the payments-service repo.”
  3. 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.
Engineers review and merge the pull request in GitHub, following existing review and CI processes.

Run a Code Writer agent from Slack

If you have an agent with a Code Writer step:
  1. In Slack, start a conversation with Glean or use the Glean app in a channel.
  2. Trigger the agent (for example, by name or via a message shortcut, depending on your configuration).
  3. Provide the required inputs (such as a ticket ID or error summary).
  4. The agent runs, calls Code Writer as part of its steps, and returns the new pull request link in Slack.
This is useful for:
  • 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:
  1. Install the Glean Slack app for your workspace.
  2. Complete any workspace‑level and channel‑level permissions needed for Glean to read messages and respond in selected channels.
See the general Glean in Slack documentation for detailed installation and permission steps.

Confirm Code Writer is enabled

In the Admin console:
  1. Go to Actions.
  2. Open the Code generation / Code Writer configuration.
  3. 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.
Changes you make here apply to Assistant, agents, and Slack.

Add Glean to relevant channels

To use Code Writer in a Slack channel:
  1. Add the Glean app to the channel (for example, #prod-escalations or #eng-support).
  2. Ensure channel members who will invoke Code Writer:
    • Have Glean accounts.
    • Are included in the Code Writer action’s access list.