task icon Task

Send Slack Message

Compose and send a message to a Slack channel or DM

Requirements

Destination (channel name like #general, or person name for DM), message content or intent, optional format preference (plain or formatted)

1
instruction icon Check uiConnection Profiles Quick Access table for channel/DM IDs. Resolve the destination. If not found or ambiguous, ask the user.
3
instruction icon If no style sections exist, offer to run taskSetup Slack Connection. If Slack section missing but others exist, use those as reference.
5
instruction icon Draft the message in the user's voice. For simple messages, use plain text. For announcements or structured content, compose Block Kit JSON. Show the user a preview and get approval.
6
instruction icon If using Block Kit, write the blocks JSON to session/slack-blocks.json FIRST. Then run the send script.
8
instruction icon Confirm the message was sent. After success, delete session/slack-blocks.json if it exists.
                  To run this task you must have the following required information:


Destination (channel name like #general, or person name for DM), message content or intent, optional format preference (plain or formatted)


If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).

Add all steps to your todo list now and begin executing.

## Steps

1. Check `./documents/connections/[service-name].md` Quick Access table for channel/DM IDs. Resolve the destination. If not found or ambiguous, ask the user.

2. [Read Writing Style]: Read the file at `./documents/user/writing_style.md` and analyze its contents (User's writing style - prefer Slack section, fall back to any available)

3. If no style sections exist, offer to run `./skills/sauna//resources/recipes/slack.workspace.setup.md`. If Slack section missing but others exist, use those as reference.

4. [Read Slack Message Formatting]: Read the documentation in: `./skills/sauna//resources/context/compose.format.slack.md` (Block Kit formatting reference from artifact-composer dependency)

5. Draft the message in the user's voice. For simple messages, use plain text. For announcements or structured content, compose Block Kit JSON. Show the user a preview and get approval.

6. If using Block Kit, write the blocks JSON to session/slack-blocks.json FIRST. Then run the send script.

7. [Gather Arguments: Send Slack Message] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `channelId`: Channel or DM ID from Quick Access table
- `message`: Plain text message (always required as fallback)
- `blocksPath`: session/slack-blocks.json if using blocks, otherwise omit

8. [Run Code: Send Slack Message]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/slack.workspace.send/preview,
    "args": [
      "channelId",
      "message",
      "blocksPath"
    ]
  },
  "packages": null
}
```

9. Confirm the message was sent. After success, delete session/slack-blocks.json if it exists.