Skip to content

Slack Bot

Scaffolds a TypeScript Slack bot using @slack/bolt with Socket Mode for local development and HTTP for production. Includes AI-powered message and app-mention handlers, an optional /ask slash command, a pluggable LLM provider registry that defaults to the Platform's ModelGateway and holds no model credential (a direct Bedrock Converse provider with prompt caching, under the AWS credential chain, for use off the substrate; no provider holds a provider key), and thread-aware conversation context for multi-turn AI responses.

Nameslack-bot
Version0.1.0
Categoryapplications
LicenseApache-2.0
Personaengineering
Tagstypescript, slack, bot, ai, chatbot, model-gateway, bedrock
Sourcetemplates/slack-bot

Render it

Three front doors, one catalog. Pick whichever suits the caller.

# CLI
npx @nanohype/sdk render slack-bot --out ./my-app

# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "slack-bot", variables);

# MCP — from an agent
get_template({ name: "slack-bot" })

Prerequisites

ToolVersionWhy
node>=26Node.js runtime for the Slack bot

Variables

Required

ProjectName string
Kebab-case project name, used as package name and directory Must be lowercase kebab-case starting with a letter.

Optional

Description string — defaults to A Slack bot with AI
Short project description for package.json and README
LlmProvider string — defaults to gateway
Default LLM provider: gateway (the Platform ModelGateway, which holds the Bedrock role on the nanohype substrate), bedrock (Bedrock called directly under the AWS credential chain, off the substrate), mock, or a custom name
PlatformName string — defaults to ${ProjectName}
Name of the Platform CR this project deploys under. The gateway provider defaults MODEL_GATEWAY_ENDPOINT to the Service the eks-agent-platform operator creates for it, <PlatformName>-gateway in namespace tenants-<PlatformName>
IncludeSlashCommands bool — defaults to true
Include the /ask slash command
IncludeTests bool — defaults to true
Include test files with vitest

What it produces

30 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.

.dockerignore
.env.example
.github/workflows/ci.yml
.gitignore
biome.json
Dockerfile
package.json
README.md
src/__tests__/config.test.ts
src/__tests__/message.test.ts
src/bootstrap.ts
src/commands/ask.ts
src/config.ts
src/events/app-mention.ts
src/events/message.ts
src/index.ts
src/logger.ts
src/metrics.ts
src/providers/__tests__/bedrock.test.ts
src/providers/__tests__/gateway.test.ts
src/providers/bedrock.ts
src/providers/gateway.ts
src/providers/index.ts
src/providers/mock.ts
src/providers/registry.ts
src/providers/types.ts
src/resilience/__tests__/circuit-breaker.test.ts
src/resilience/circuit-breaker.ts
tsconfig.json
vitest.config.ts

Composes with