task icon Task

Send to Slack

Send a message or upload a file to a Slack channel or DM

Requirements
Destination (channel name like #general, or person name for DM), message content or intent. Optional: file path to upload OR Block Kit formatting (not both)
2

Check stateService Profiles Quick Access table for channel/DM IDs. Resolve the destination. If not found or ambiguous, ask the user.

5

If no style sections exist, offer to run taskBuild Slack Profile. If Slack section missing but others exist, use those as reference.

7

Draft the message in the user's voice. For simple messages, use plain text.
For announcements or structured content, compose Block Kit JSON.

Write a preview draft with _action frontmatter:


_action:
label: "Send to [channel/person]"
prompt: "Send this Slack message using the content below. Convert to Block Kit if structured."
isComplete: false

Channel: #channel-name (or @person)

[message content]

Sauna displays this as a preview card with a "Send to #channel" button.
User can edit the message, then click to send.

8

Note: If uploading a file, the message will be plain text (Block Kit not supported with file uploads). If rich formatting is needed, send the Block Kit message first, then upload the file separately.

9

If user is attaching a file, confirm the file exists at the given path. Ask for optional title if not provided.

10

If using Block Kit (text-only message), write the blocks JSON to stateSlack Block Kit JSON first.

12

Confirm success. Clean up stateSlack Block Kit JSON if it exists. If a file was uploaded, share the permalink.

                    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: file path to upload OR Block Kit formatting (not both)

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 CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.

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

## Steps

1. [Read External Actions Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/sauna.actions.external.md` (Preview UI pattern for external actions)

2. Check `documents/user/services/*.md` Quick Access table for channel/DM IDs. Resolve the destination. If not found or ambiguous, ask the user.

3. [Read User Analysis Results]: Discover relevant information in the user's filesystem at `documents/user/analysis/*.md`. (User's writing style - prefer Slack section, fall back to any available (file: writing-style.md))

4. [Read Domain Preferences]: Discover relevant information in the user's filesystem at `documents/preferences/[domain].md`. (Check for messaging preferences and past corrections (domain: messaging))

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

6. [Read Slack Message Formatting]: Read the documentation in: `skills/sauna/[skill_id]/references/compose.format.slack.md` (Block Kit formatting reference)

7. Draft the message in the user's voice. For simple messages, use plain text.
For announcements or structured content, compose Block Kit JSON.

Write a preview draft with _action frontmatter:

---
_action:
  label: "Send to [channel/person]"
  prompt: "Send this Slack message using the content below. Convert to Block Kit if structured."
  isComplete: false
---

**Channel:** #channel-name (or @person)

[message content]

Sauna displays this as a preview card with a "Send to #channel" button.
User can edit the message, then click to send.


8. Note: If uploading a file, the message will be plain text (Block Kit not supported with file uploads). If rich formatting is needed, send the Block Kit message first, then upload the file separately.

9. If user is attaching a file, confirm the file exists at the given path. Ask for optional title if not provided.

10. If using Block Kit (text-only message), write the blocks JSON to `session/slack-blocks.json` first.

11. [Gather Arguments: Send to Slack] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `channelId`: Channel or DM ID
- `message`: Message text
- `filePath`: File path to upload, OR empty string for text-only message
- `blocksPath`: Block Kit JSON path (text-only messages), OR empty string
- `title`: File title (uploads only), OR empty string

12. [Run Code: Send to Slack]: Call `run_script` with:

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

13. Confirm success. Clean up `session/slack-blocks.json` if it exists. If a file was uploaded, share the permalink.