task icon Task

Compose Block Kit Message

Requirements
Content to format (announcement text, update details, metrics to display), destination (channel name or person), message type (announcement, status update, team update, action prompt)
6

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

7

Understand what kind of message the user wants:

  • Announcement: Header + main content + optional CTA
  • Status Update: Header + metrics fields + highlights
  • Team Update: Sprint/project summary with completed/pending items
  • Action Prompt: Request with approve/reject buttons

If unclear, ask: "What type of message is this—an announcement, status update, or something else?"

8

Compose the Block Kit JSON following the templates in the slice.

Structure guidelines:

  • Start with a header block for the title (use emoji for visual interest)
  • Use sections for main content with mrkdwn formatting
  • Use fields (2-column grid) for metrics or key-value pairs
  • Add dividers between major sections
  • End with context block for metadata (date, author, links)
9

Validate the Block Kit JSON before proceeding:

  • Confirm valid JSON array syntax
  • Verify block count is under 50
  • Check headers use plain_text (not mrkdwn)
  • Ensure any fields arrays have 10 or fewer items
  • Verify button styles are only "primary" or "danger"

If validation fails, fix the issues before continuing.

10

Write a preview draft with _action frontmatter:


_action:
label: "Send to [#channel]"
prompt: "Send this Block Kit message to the specified channel"
isComplete: false

Channel: #channel-name (or @person)
Type: [announcement / status update / team update]

Preview

[Describe how the message will appear - header, sections, fields, etc.]

Block Kit JSON

[
  { "type": "header", ... },
  { "type": "section", ... },
  ...
]

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

11

Write the Block Kit JSON to uiSlack Block Kit JSON before sending.

13

Confirm success to the user: 'Message sent to #channel!'

14

Delete the temporary file at uiSlack Block Kit JSON to clean up.

                    To run this task you must have the following required information:

> Content to format (announcement text, update details, metrics to display), destination (channel name or person), message type (announcement, status update, team update, action prompt)

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. [Read External Actions Guide]: Read the documentation in: `./skills/sauna/[skill_id]/references/sauna.actions.external.md` (Preview UI pattern for external actions)

2. [Read Slack Message Formatting]: Read the documentation in: `./skills/sauna/[skill_id]/references/compose.format.slack.md` (Block Kit structure and templates)

3. [Read Writing Style]: Read the file at `./documents/user/writing_style.md` and analyze its contents (User's writing style - prefer Slack section for emoji/formatting preferences)

4. [Read Stated Preferences]: Read the file at `./documents/preferences/stated.yaml` and analyze its contents (Check for explicit messaging preferences)

5. [Read Learned Preferences]: Read the file at `./documents/preferences/learned.yaml` and analyze its contents (Check for past corrections (e.g., formatting preferences))

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

7. Understand what kind of message the user wants:
- **Announcement**: Header + main content + optional CTA
- **Status Update**: Header + metrics fields + highlights
- **Team Update**: Sprint/project summary with completed/pending items
- **Action Prompt**: Request with approve/reject buttons

If unclear, ask: "What type of message is this—an announcement, status update, or something else?"


8. Compose the Block Kit JSON following the templates in the slice.

Structure guidelines:
- Start with a header block for the title (use emoji for visual interest)
- Use sections for main content with mrkdwn formatting
- Use fields (2-column grid) for metrics or key-value pairs
- Add dividers between major sections
- End with context block for metadata (date, author, links)


9. Validate the Block Kit JSON before proceeding:
- Confirm valid JSON array syntax
- Verify block count is under 50
- Check headers use plain_text (not mrkdwn)
- Ensure any fields arrays have 10 or fewer items
- Verify button styles are only "primary" or "danger"

If validation fails, fix the issues before continuing.


10. Write a preview draft with _action frontmatter:

---
_action:
  label: "Send to [#channel]"
  prompt: "Send this Block Kit message to the specified channel"
  isComplete: false
---

**Channel:** #channel-name (or @person)
**Type:** [announcement / status update / team update]

## Preview

[Describe how the message will appear - header, sections, fields, etc.]

## Block Kit JSON

```json
[
  { "type": "header", ... },
  { "type": "section", ... },
  ...
]
```

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


11. Write the Block Kit JSON to `./documents/tmp/slack-blocks.json` before sending.

12. [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`: Fallback text for notifications
- `filePath`: empty string (no file upload)
- `blocksPath`: ./documents/tmp/slack-blocks.json
- `title`: empty string (no file title)

13. [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
}
```

14. Confirm success to the user: 'Message sent to #channel!'

15. Delete the temporary file at `./documents/tmp/slack-blocks.json` to clean up.