🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub✦ BytesAgain

Slack Automator

by @xueyetianya

Automate Slack messaging, channels, and search with Block Kit. Use when sending scheduled messages, syncing channels, monitoring chats, notifying teams.

Versionv4.0.0
Installs1
TERMINAL
clawhub install slack-automator

πŸ“– About This Skill


version: "4.0.0" name: slack-automator description: "Automate Slack messaging, channels, and search with Block Kit. Use when sending scheduled messages, syncing channels, monitoring chats, notifying teams." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills

slack-automator

Send messages to Slack channels via Incoming Webhooks. Supports direct messaging, channel notifications, message templates with variable substitution, scheduled messages, formatting helpers, and full send history with export.

Requirements

  • bash 4.0+
  • curl (for HTTP requests to Slack)
  • python3 (for JSON handling β€” typically pre-installed)
  • Slack Incoming Webhook URL β€” see setup below
  • How to Get a Slack Webhook URL

    1. Go to https://api.slack.com/apps 2. Click Create New App β†’ From scratch 3. Name it (e.g., "Automator") and select your workspace 4. In the left sidebar, click Incoming Webhooks 5. Toggle Activate Incoming Webhooks to On 6. Click Add New Webhook to Workspace 7. Select the channel to post to and click Allow 8. Copy the webhook URL (starts with https://hooks.slack.com/services/...)

    Setup

    Configure the webhook URL before sending messages:

    scripts/script.sh connect https://hooks.slack.com/services/T00000/B00000/xxxxxxxx
    

    Verify connectivity:

    scripts/script.sh webhook test
    

    Commands

    connect

    Save a Slack Incoming Webhook URL to local configuration. The URL is stored in ~/.slack-automator/config.json.

    # Save your webhook URL
    scripts/script.sh connect https://hooks.slack.com/services/T00000/B00000/xxxxxxxx
    

    βœ… Webhook URL saved.

    send

    Send a plain text message to Slack via the configured webhook.

    # Send a simple message
    scripts/script.sh send "Hello from Slack Automator!"

    Send a message with emoji

    scripts/script.sh send "πŸš€ Deployment complete β€” v2.1.0 is live!"

    Send multi-word messages

    scripts/script.sh send Build succeeded, all 142 tests passing.

    notify

    Send a message to a specific Slack channel. The channel name will be prefixed with # if not already present.

    # Notify the alerts channel
    scripts/script.sh notify alerts "⚠️ Server CPU at 95%!"

    Notify with # prefix (also works)

    scripts/script.sh notify "#deployments" "v3.0.2 deployed to production"

    Notify the team channel

    scripts/script.sh notify general "Standup in 5 minutes!"

    schedule add

    Add a scheduled message. Time can be in HH:MM format (converted to daily cron) or a full cron expression. Schedules are saved to ~/.slack-automator/schedule.json.

    # Schedule a daily message at 9:00 AM
    scripts/script.sh schedule add 09:00 "Good morning, team! β˜€οΈ"

    Schedule with cron expression (every Friday at 6 PM)

    scripts/script.sh schedule add "0 18 * * 5" "Happy Friday! πŸŽ‰"

    Schedule hourly reminder

    scripts/script.sh schedule add "0 * * * *" "Hourly status check"

    > Note: Schedules are saved locally. To actually trigger them, set up a cron job that runs slack-automator send with the scheduled messages.

    schedule list

    Display all scheduled messages with their IDs, cron expressions, and status.

    scripts/script.sh schedule list
    

    === Scheduled Messages ===

    βœ… [1710820800] 0 9 * * * β€” Good morning, team! β˜€οΈ

    βœ… [1710820900] 0 18 * * 5 β€” Happy Friday! πŸŽ‰

    schedule remove

    Remove a scheduled message by its ID.

    scripts/script.sh schedule remove 1710820900
    

    βœ… Removed schedule 1710820900.

    template list

    List all saved message templates.

    scripts/script.sh template list
    

    === Message Templates ===

    πŸ“ deploy β€” πŸš€ Deployed *{{service}}* to production.

    πŸ“ alert β€” ⚠️ Alert: {{message}} (severity: {{level}})

    template save

    Save a reusable message template. Use {{variable}} placeholders for dynamic values.

    # Save a deploy notification template
    scripts/script.sh template save deploy "πŸš€ Deployed *{{service}}* to production ({{version}})."

    Save an alert template

    scripts/script.sh template save alert "⚠️ {{level}}: {{message}}"

    Save a welcome template

    scripts/script.sh template save welcome "πŸ‘‹ Welcome to the team, {{name}}!"

    template use [var=value ...]

    Send a message using a saved template. Variables in {{var}} are replaced with provided var=value pairs.

    # Use deploy template with variables
    scripts/script.sh template use deploy service=api-server version=v2.1.0
    

    Sends: πŸš€ Deployed *api-server* to production (v2.1.0).

    Use alert template

    scripts/script.sh template use alert level=HIGH message="Database connection timeout"

    Use welcome template

    scripts/script.sh template use welcome name=Alice

    webhook test

    Send a test message to verify webhook connectivity. The test message includes a timestamp.

    scripts/script.sh webhook test
    

    Testing webhook connectivity...

    βœ… Webhook is working! Test message sent.

    webhook info

    Show the current webhook configuration. The URL is partially masked for security.

    scripts/script.sh webhook info
    

    === Webhook Configuration ===

    URL: https://hooks.slack.com/services/T0...xxxxxxxx

    Full URL stored in: ~/.slack-automator/config.json

    format