agentleFS
agentsdanceagentsdance/agentskills/skills/slack-bot-builder/SKILL.md

slack-bot-builder

Skill3 starsChanged 11 months agoApache-2.0View on GitHub

Build Slack bots and integrations. Use when the user needs to create Slack apps, slash commands, or automated Slack workflows.

  • Reads credentials

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create Slack bots and integrations.

    line 8

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Slack Bot Builder

Create Slack bots and integrations.

Bolt.js Setup

import { App } from '@slack/bolt';

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  socketMode: true,
  appToken: process.env.SLACK_APP_TOKEN,
});

// Start the app
(async () => {
  await app.start(3000);
  console.log('⚡️ Slack bot is running!');
})();

Slash Commands

// Handle /hello command
app.command('/hello', async ({ command, ack, respond }) => {
  await ack();

  await respond({
    text: `Hello, <@${command.user_id}>! 👋`,
    response_type: 'in_channel', // or 'ephemeral'
  });
});

// Interactive command with blocks
app.command('/poll', async ({ command, ack, respond }) => {
  await ack();

  await respond({
    blocks: [
      {
        type: 'section',
        text: { type: 'mrkdwn', text: `*Poll:* ${command.text}` },
      },
      {
        type: 'actions',
        elements: [
          {
            type: 'button',
            text: { type: 'plain_text', text: '👍 Yes' },
            action_id: 'poll_yes',
          },
          {
            type: 'button',
            text: { type: 'plain_text', text: '👎 No' },
            action_id: 'poll_no',
          },
        ],
      },
    ],
  });
});

Message Events

// Listen for messages containing "hello"
app.message('hello', async ({ message, say }) => {
  await say(`Hey there <@${message.user}>!`);
});

// Regex matching
app.message(/^(hi|hello|hey)$/i, async ({ message, say }) => {
  await say(`Hello! How can I help you?`);
});

// All messages in a channel
app.event('message', async ({ event, client }) => {
  console.log(`Message: ${event.text}`);
});

Interactive Components

// Button click handler
app.action('poll_yes', async ({ body, ack, client }) => {
  await ack();

  await client.chat.postMessage({
    channel: body.channel.id,
    text: `<@${body.user.id}> voted Yes!`,
  });
});

// Modal submission
app.view('feedback_modal', async ({ ack, body, view }) => {
  await ack();

  const feedback = view.state.values.feedback_block.feedback_input.value;
  console.log(`Feedback from ${body.user.id}: ${feedback}`);
});

Opening Modals

app.command('/feedback', async ({ command, ack, client }) => {
  await ack();

  await client.views.open({
    trigger_id: command.trigger_id,
    view: {
      type: 'modal',
      callback_id: 'feedback_modal',
      title: { type: 'plain_text', text: 'Feedback' },
      submit: { type: 'plain_text', text: 'Submit' },
      blocks: [
        {
          type: 'input',
          block_id: 'feedback_block',
          element: {
            type: 'plain_text_input',
            action_id: 'feedback_input',
            multiline: true,
          },
          label: { type: 'plain_text', text: 'Your feedback' },
        },
      ],
    },
  });
});

Scheduled Messages

// Schedule a message
await client.chat.scheduleMessage({
  channel: 'C1234567890',
  post_at: Math.floor(Date.now() / 1000) + 3600, // 1 hour from now
  text: 'Reminder: Team meeting in 10 minutes!',
});

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.