packages/cli/skills/pikku-gateway-slack/SKILL.md
Use when integrating Slack with a Pikku app. Covers SlackGatewayAdapter, slash commands, OAuth flow, message handling, and signature verification. TRIGGER when: code uses SlackGatewayAdapter, parseSlashCommand, buildSlackInstallUrl, or user asks about Slack integration, Slack bots, or @pikku/gateway-slack. DO NOT TRIGGER when: user asks about general gateway/webhook patterns (use pikku-trigger).
npx skillsauth add pikkujs/pikku pikku-gateway-slackInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill as an execution checklist, not reference material.
pikku-meta when available; otherwise run the relevant pikku meta ... --json command and inspect only the focused output you need..pikku, node_modules, vendored packages, or broad build artifacts.pikku-verify or pikku all when functions, wirings, schemas, or generated clients may have changed.@pikku/gateway-slack provides a Slack Events API gateway adapter, slash command handling, OAuth installation flow, and message utilities.
yarn add @pikku/gateway-slack @slack/web-api
SlackGatewayAdapterimport { SlackGatewayAdapter } from '@pikku/gateway-slack'
const adapter = new SlackGatewayAdapter(options: SlackGatewayAdapterOptions)
Bridges Slack Events API webhooks with Pikku's gateway system for processing Slack events as Pikku functions.
SlackGatewayHelperHelper for handling Slack messages and metadata within gateway functions.
import { parseSlashCommand, respondToSlashCommand } from '@pikku/gateway-slack'
const command = parseSlashCommand(request)
await respondToSlashCommand(responseUrl, { text: 'Done!' })
import {
buildSlackInstallUrl,
exchangeSlackOAuthCode,
RECOMMENDED_BOT_SCOPES,
} from '@pikku/gateway-slack'
const installUrl = buildSlackInstallUrl({
clientId: config.slackClientId,
scopes: RECOMMENDED_BOT_SCOPES,
redirectUri: config.slackRedirectUri,
})
const tokens = await exchangeSlackOAuthCode({
clientId: config.slackClientId,
clientSecret: config.slackClientSecret,
code: oauthCode,
redirectUri: config.slackRedirectUri,
})
import { verifySlackSignature } from '@pikku/gateway-slack'
verifySlackSignature(signingSecret, timestamp, body, signature)
import { SlackGatewayAdapter } from '@pikku/gateway-slack'
const slackGateway = new SlackGatewayAdapter({
signingSecret: config.slackSigningSecret,
botToken: config.slackBotToken,
})
// Register with your HTTP runner to handle /slack/events endpoint
const handleSlashCommand = pikkuSessionlessFunc({
title: 'Handle Slack Command',
func: async ({ db }, data) => {
const command = parseSlashCommand(data)
// Process command...
await respondToSlashCommand(command.response_url, {
text: `Processed: ${command.text}`,
})
},
})
documentation
Deprecated — use pikku-middleware instead. Tag middleware (addTagMiddleware) is now documented as a section within the pikku-middleware skill, alongside global HTTP middleware, execution order, and the service-to-service bearer auth pattern.
testing
Use when adding authorization checks to Pikku functions or routes — pikkuPermission, pikkuAuth, per-function permissions, pattern-based permissions, or understanding OR/AND permission logic. TRIGGER when: user wants to restrict who can call a function, check resource ownership, add role-based access, or understand where permission checks belong. DO NOT TRIGGER when: user asks about middleware or request interception (use pikku-middleware), authentication strategies (use pikku-security), or session management.
testing
Use when adding any middleware to a Pikku app — global HTTP middleware, tag-scoped middleware (including service-to-service bearer auth), per-route middleware, session-setting middleware, or understanding middleware execution order and priority. TRIGGER when: user wants middleware on some or all routes, machine-to-machine auth, tag-scoped cross-cutting concerns, global interceptors, or middleware priority/order questions. DO NOT TRIGGER when: user asks about permissions/authorization checks (use pikku-permissions), auth strategies like authBearer/authCookie (use pikku-security), or deployment.
documentation
Standard cleanup to run right after a Pikku template is cloned or scaffolded into a new project. TRIGGER when: a Pikku template was just cloned/scaffolded (via `pikku create`, `git clone <template>`, or the user says "I cloned the kanban template / starter / template"), or the working tree still looks like an untouched template (template README, placeholder `@project/*` name in package.json). DO NOT TRIGGER when: working in an established project mid-feature, or editing the template repo itself.