Before you start
- The Guild CLI, logged in.
- Slack connected in your workspace. See Slack setup.
- The Slack agent invited to the channels where it should reply. It posts with the
chat:writescope, which only reaches channels it belongs to.
1. Create the agent
PROMPT.md:
guild.yaml:
2. Give it something to answer from
Add your team’s facts to the workspace context: on-call rotation, where runbooks live, how to request access, release days. Open the workspace, click Context, write in Markdown, and publish. See Workspace context.3. Save it and install it in your workspace
4. Create the trigger
channel_ids limits the trigger to the channels you list. Find a channel’s ID at the bottom of its details in Slack. Omit --service-config to answer in every channel.
Slack events have no actions, so there’s no --action. The agent receives a prompt that names the event, followed by the Slack payload as JSON, trimmed to the fields an agent needs.
5. Try it
In the channel, mention the Slack agent with a question the context answers. The reply appears in the thread, with a link to the Guild session underneath. To ask a follow-up, mention it again in the same thread. Each mention is a new run in the thread’s session; the agent reads the thread withslack_conversations_replies to see the earlier exchange. A reply in the thread that doesn’t mention the agent doesn’t trigger it.
How the run is attributed
If the person who mentioned the agent has an identity mapping, the run acts as their Guild user. Otherwise it acts as the trigger’s creator. Messages always post as the Slack agent.Variations
- Answer direct messages too. Create a second trigger on
messagewith nochannel_ids. It also fires on every message in channels the agent belongs to, so tell the agent to reply only whenevent.channel_typeisim. See Direct messages. - Look things up before answering. Add another integration’s read tools to
guild.yaml, such asjira_get_issue, so the agent can answer “what’s the status of ENG-123?”.
Related
- Slack integration: events, scopes, and how sessions work
- Event triggers: agent input and
service_config - Native agents: what a prompt-only agent can and can’t do