# Docs Agent Slack bot

import { Aside, Steps } from '@astrojs/starlight/components';

Create documentation without leaving Slack. @mention EkLine in a channel the EkLine app is in, or in a thread there, and the bot generates a draft you can review and edit in EkLine. The bot acts only on @mentions. It ignores thread replies that do not mention it, does not answer direct messages, and has no per-channel settings in EkLine.

## Prerequisites

Before you begin, you need:

- An EkLine organization account.
- Slack workspace administrator access to install the app.

## Connect your Slack workspace

<Steps>
1. Go to **Settings > Integrations** in your EkLine dashboard.

2. Find **Slack** in the integrations list.

3. Click **Connect**.

4. On the Slack page that opens, allow EkLine to access your Slack workspace.

5. Complete the Slack authorization flow. Slack returns you to EkLine.

6. Verify the integration shows as **Connected**.
</Steps>

Once connected, anyone in the Slack workspace can mention `@EkLine` to create documentation drafts.

## Create documentation from Slack

<Steps>
1. In a Slack channel the EkLine app is in, or a thread there, type `@EkLine` followed by your request.
   ```text
   @EkLine create a troubleshooting guide based on this discussion
   ```

2. Look for the :eyes: reaction on your message. If your request is unclear, the bot asks a question in the thread. Answer it with a new @mention.

3. Follow the reply in the thread. Docs Agent replies in one of two ways:

   - **Draft link:** "Got it! I'm looking into this now.", then "📝 Draft ready! Review in EkLine" with a link to the session.
   - **Threaded replies:** a message with a **View EkLine chat** button that opens the session. A typing status shows while Docs Agent works. When it finishes, the agent posts its reply in the thread, with a collapsed **Proposed changes** diff of up to five changed files. Expand it to read the diff in Slack. Every reply ends with a **See the full chat** link to the whole session. To stop a running request, mention `@EkLine stop` in the thread.

   If you get draft links and want threaded replies, contact support@ekline.io.

4. Open the session in EkLine to review and edit the draft.

5. Look for the pull request. With automatic pull requests on, Docs Agent opens one when it changes documentation files. See [Automatic pull requests](#automatic-pull-requests).
</Steps>

## Automatic pull requests

When Docs Agent changes documentation files for a Slack request, it opens a pull request with the drafted changes. This is **on by default**.

With threaded replies, Docs Agent includes the PR link in its Slack reply. The pull request also appears in the editor session for that draft. If no pull request appears, open the session and click **Raise PR**.

### Disable automatic PRs

If you prefer to review drafts in the editor before creating a PR manually:

1. Go to **Settings** > **Docs Agent** > **Slack triggers** in your EkLine dashboard.
2. Turn off the **Automatically raise PRs from Slack requests** toggle.

The setting applies from the next Slack request, including a new @mention in a thread whose session already exists. Turn the toggle back on to resume automatic pull requests.

## Context the bot captures

| Context type | What the bot captures |
|--------------|-----------------------|
| Thread messages | All messages in the current thread |
| Channel messages | Up to 10 messages before your @mention. In a thread, up to 10 before and 10 after the message that started it |
| File attachments | Images (JPEG, PNG, GIF, WebP), PDFs, and videos attached to the message |
| Reactions | Emoji reactions on messages |

<Aside type="tip" title="Get better results">
@mention the bot in threads with relevant discussion. The more context in the thread, the more accurate the generated documentation.
</Aside>

## Write effective prompts

The quality of your prompt determines the quality of the output.

| Instead of... | Try... |
|---------------|--------|
| "help with docs" | "Create a troubleshooting guide for the API timeout issue discussed here" |
| "document this" | "Write a how-to guide for the workaround Sarah described" |
| "make docs" | "Update the authentication docs based on the new flow we agreed on" |

**Include specific details:**

- Reference the type of documentation you need: tutorial, how-to guide, reference, troubleshooting.
- Name specific topics or features from the conversation.
- Mention existing documentation to update if applicable.
- Point to URLs or ticket IDs for more context.

## Check it worked

- A :eyes: reaction appears on your @mention, followed by a reply in the thread that links to EkLine.
- The session appears under **Sessions** in the EkLine app. Filter by **Source** > **Slack** to find it. See [Find a past session](/agent/find-sessions/).

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Bot does not respond | Verify the workspace connection in **Settings > Integrations**. Check that the bot has access to the channel. |
| "This workspace isn't connected to EkLine. Ask an admin to reconnect." | Ask a workspace administrator to reconnect the integration in EkLine settings. |
| Draft does not match expectations | Give more specific instructions in your mention. Include the documentation type and key topics to cover. |
| Bot takes longer than expected | Complex requests may take longer. The bot notifies you if a request times out. |
| Bot responds but link is broken | Refresh the page and try the link again. If the issue persists, contact **support@ekline.io**. |

## Next steps

- [Turn a Slack support thread into a troubleshooting doc](/agent/slack-thread-to-troubleshooting-doc/): Convert a resolved support conversation into a published guide.
- [GitHub PR bot](/agent/github-integration/): Trigger Docs Agent from pull request comments and code reviews.
- [Create documentation](/agent/create/): Generate READMEs, API references, and guides from your codebase.
- [Update and review](/agent/update-review/): Keep documentation in sync with code changes.
- [Integrations](/agent/integrations/): Connect Notion, Linear, Jira, and other tools.