You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit acd8d22
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+31-12Lines changed: 31 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,40 @@ A sample Slack agent that showcases [Slack Code](https://docs.slack.dev/ai/slack
5
5
> [!WARNING]
6
6
> **This agent runs commands generated by a language model on the machine running the app.** Only run it against trusted, throwaway repositories, on a machine you're comfortable letting it operate. Refer to the framework README for how command approvals work.
All implementations share the same Slack listener layer and the same user experience. The only difference is how the agent is defined and executed under the hood.
19
+
20
+
## What It Can Do
21
+
22
+
The coding agent interacts with users through four entry points:
17
23
18
-
-**Channel @mentions and direct messages** — Mention the agent with a task, or message it directly. Quick questions get an answer in place; work that takes more than one message gets a code channel linked back to your message, along with the conversation it came from.
19
-
-**Code channels** — Keep chatting in the channel without an @mention. The agent writes its plan to a Plan tab you can comment on, publishes its changes to the code tab, and pins the repo, branch, and CI status to the context bar.
20
-
-**Command approvals** — File edits, read-only commands, and local git changes run right away. Anything else, like running tests, posts Approve and Deny buttons and waits for your decision.
21
-
-**Slash commands** — The agent registers commands like `/run-tests` for each channel and decides what each one does.
22
-
-**Wrap up** — When you say the work is done, the agent posts a summary back to your original message and archives the channel.
23
24
-**App Home** — The Home tab explains how to start a task.
25
+
-**Direct Messages** — Message the agent directly. Quick questions get an answer in place; work that takes more than one message gets a code channel linked back to your message.
26
+
-**Channel @mentions** — Mention the agent in any channel with a task and a repo. It answers in place, or creates a code channel for the work along with the conversation it came from.
27
+
-**Code Channels** — Keep chatting in the channel without an @mention. The agent writes its plan to a Plan tab you can comment on, publishes its changes to the code tab, and pins the repo, branch, and CI status to the context bar.
28
+
29
+
In a code channel, file edits, read-only commands, and local git changes run right away. Anything else, like running tests, posts Approve and Deny buttons and waits for your decision. The agent also registers slash commands like `/run-tests` for each channel and decides what each one does. When you say the work is done, it posts a summary back to your original message and archives the channel.
30
+
31
+
## Using the App
32
+
33
+
Once the agent is running, there are several ways to interact:
34
+
35
+
-**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
36
+
-**Direct Messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
37
+
-**Channel @mentions** — Invite the agent to a channel by typing `/invite @agent-name`, then @mention it with a task and a repo. It answers in the thread, or replies with a link to a new code channel for the work.
38
+
-**Code Channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
24
39
25
40
For full setup instructions, pick a framework above and follow the README in that directory.
41
+
42
+
## Local Development
43
+
44
+
This repo uses [`slack-bolt`](https://pypi.org/project/slack-bolt/) from PyPI.
Copy file name to clipboardExpand all lines: claude-agent-sdk/README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -262,15 +262,15 @@ python3 app_oauth.py
262
262
263
263
### Using the App
264
264
265
-
Once the agent is running, invite it to a channel by typing `/invite @agent-name` in the message box.
265
+
Once the agent is running, there are several ways to interact:
266
266
267
-
**Channel @mentions** — @mention the agent in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
267
+
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
268
268
269
-
**Direct messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
269
+
**Direct Messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
270
270
271
-
**Code channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
271
+
**Channel @mentions** — Invite the agent to a channel by typing `/invite @agent-name` in the message box, then @mention it in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
272
272
273
-
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
273
+
**Code Channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
274
274
275
275
### Linting
276
276
@@ -285,7 +285,8 @@ ruff format
285
285
### Testing
286
286
287
287
```sh
288
-
pytest
288
+
# Run pytest from root directory for unit testing
289
+
pytest .
289
290
```
290
291
291
292
## Project Structure
@@ -336,7 +337,7 @@ The `outcome.py` file defines the `RunOutcome` that `agent.py` returns and `turn
336
337
337
338
The `context.py` file reads the thread or direct message a request came from, so the agent can follow the conversation.
338
339
339
-
The `guardrails.py` file holds the SDK hooks that gate tool calls: the approval check for `run_command`, which defers a command that needs approval, and the check that skips every tool call once the session is stopped.
340
+
The `guardrails.py` file holds the SDK hooks around tool calls: the approval check for `run_command`, which defers a command that needs approval, and the check that skips every tool call once the session is stopped.
340
341
341
342
The `sessions.py` file keeps each code channel's session in memory: its working directory, plan canvas, conversation history, and messages waiting for the next turn. It also defines the `AgentDeps` and `RequestDeps` dataclasses passed to the agents at runtime, providing access to the Slack client and the session or request.
Copy file name to clipboardExpand all lines: openai-agents-sdk/README.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,15 +260,15 @@ python3 app_oauth.py
260
260
261
261
### Using the App
262
262
263
-
Once the agent is running, invite it to a channel by typing `/invite @agent-name` in the message box.
263
+
Once the agent is running, there are several ways to interact:
264
264
265
-
**Channel @mentions** — @mention the agent in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
265
+
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
266
266
267
-
**Direct messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
267
+
**Direct Messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
268
268
269
-
**Code channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
269
+
**Channel @mentions** — Invite the agent to a channel by typing `/invite @agent-name` in the message box, then @mention it in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
270
270
271
-
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
271
+
**Code Channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
272
272
273
273
### Linting
274
274
@@ -283,7 +283,8 @@ ruff format
283
283
### Testing
284
284
285
285
```sh
286
-
pytest
286
+
# Run pytest from root directory for unit testing
287
+
pytest .
287
288
```
288
289
289
290
## Project Structure
@@ -324,7 +325,7 @@ Every incoming request is routed to a "listener". This directory groups each lis
324
325
325
326
### `/agent`
326
327
327
-
The `agent.py` file defines the routing agent and the coding agent with their tools, and starts and resumes their runs. It's the only file outside `tools` that uses the OpenAI Agents SDK.
328
+
The `agent.py` file defines the routing agent and the coding agent with their tools, and starts and resumes their runs. Along with `guardrails.py` and `tools`, it's the only code that uses the OpenAI Agents SDK.
328
329
329
330
The `prompts.py` file holds both agents' prompts.
330
331
@@ -334,7 +335,7 @@ The `outcome.py` file defines the `RunOutcome` that `agent.py` returns and `turn
334
335
335
336
The `context.py` file reads the thread or direct message a request came from, so the agent can follow the conversation.
336
337
337
-
The `guardrails.py` file holds the SDK hooks that gate tool calls: the approval check for `run_command`, and the guardrail that skips every tool call once the session is stopped.
338
+
The `guardrails.py` file holds the SDK hooks around tool calls: the approval check for `run_command`, and the guardrail that skips every tool call once the session is stopped.
338
339
339
340
The `sessions.py` file keeps each code channel's session in memory: its working directory, plan canvas, conversation history, and messages waiting for the next turn. It also defines the `AgentDeps` and `RequestDeps` dataclasses passed to the agents at runtime, providing access to the Slack client and the session or request.
Copy file name to clipboardExpand all lines: pydantic-ai/README.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ pip install -e ".[dev]"
143
143
144
144
## Providers
145
145
146
-
This app supports both Anthropic and OpenAI as AI providers. Set at least one API key. If both are set, Anthropic is used by default.
146
+
This app supports both Anthropic and OpenAI as AI providers. Set at least one API key — if both are set, Anthropic is used by default.
147
147
148
148
### Anthropic Setup
149
149
@@ -272,15 +272,15 @@ python3 app_oauth.py
272
272
273
273
### Using the App
274
274
275
-
Once the agent is running, invite it to a channel by typing `/invite @agent-name` in the message box.
275
+
Once the agent is running, there are several ways to interact:
276
276
277
-
**Channel @mentions** — @mention the agent in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
277
+
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
278
278
279
-
**Direct messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
279
+
**Direct Messages** — Open the agent's _Messages_ tab and ask a question or describe a task, or pick a suggested prompt. It answers there, or links a code channel for bigger work.
280
280
281
-
**Code channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
281
+
**Channel @mentions** — Invite the agent to a channel by typing `/invite @agent-name` in the message box, then @mention it in a thread with a question about the conversation, like _what did we decide here?_, and it answers in the thread. @mention it with a task and a repo, like _add a "hello world" to the README of `<repo>`_, and it replies with a link to a new code channel for the work.
282
282
283
-
**App Home** — Open the agent in Slack and click the _Home_ tab to see how to start a task.
283
+
**Code Channels** — Follow the work in the new channel. Approve or deny commands as they come up, comment on the Plan tab, review the diff in the code tab, and send follow-ups without an @mention. Say you're done to wrap up and archive the channel.
284
284
285
285
### Linting
286
286
@@ -295,7 +295,8 @@ ruff format
295
295
### Testing
296
296
297
297
```sh
298
-
pytest
298
+
# Run pytest from root directory for unit testing
299
+
pytest .
299
300
```
300
301
301
302
## Project Structure
@@ -336,7 +337,7 @@ Every incoming request is routed to a "listener". This directory groups each lis
336
337
337
338
### `/agent`
338
339
339
-
The `agent.py` file defines the routing agent and the coding agent with their tools, picks their models, and starts and resumes their runs. It and`guardrails.py`are the only files outside `tools`that use Pydantic AI.
340
+
The `agent.py` file defines the routing agent and the coding agent with their tools, picks their models, and starts and resumes their runs. Along with`guardrails.py`and `tools`, it's the only code that uses Pydantic AI.
0 commit comments