slackhive 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +582 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="apps/web/public/logo.svg" alt="SlackHive" width="80" />
|
|
4
|
+
|
|
5
|
+
# SlackHive
|
|
6
|
+
|
|
7
|
+
### Build, deploy, and orchestrate teams of Claude Code AI agents on Slack
|
|
8
|
+
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://www.npmjs.com/package/slackhive)
|
|
11
|
+
[](https://www.npmjs.com/package/slackhive)
|
|
12
|
+
[](https://nodejs.org)
|
|
13
|
+
[](https://www.typescriptlang.org)
|
|
14
|
+
[](https://docs.docker.com/compose)
|
|
15
|
+
[](https://docs.anthropic.com/en/agent-sdk)
|
|
16
|
+
[](https://api.slack.com/bolt)
|
|
17
|
+
|
|
18
|
+
[Quick Start](#-quick-start) · [Features](#-features) · [Architecture](#-architecture) · [Documentation](#-creating-your-first-agent) · [Contributing](#-contributing)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Why SlackHive?
|
|
25
|
+
|
|
26
|
+
Most AI agent frameworks focus on a single agent doing a single task. But real teams have **specialists** — a data analyst who speaks SQL, a writer who crafts announcements, an engineer who reviews code. What if your AI team worked the same way?
|
|
27
|
+
|
|
28
|
+
**SlackHive** was born from a simple observation: the most powerful AI setup isn't one omniscient agent — it's a **team of specialists** that learn and improve from every interaction.
|
|
29
|
+
|
|
30
|
+
Inspired by how engineering teams actually collaborate in Slack, we built a platform where:
|
|
31
|
+
|
|
32
|
+
- **Each agent is a Slack bot** with its own identity, skills, and memory
|
|
33
|
+
- **A Boss Agent** knows the entire team and delegates work by @mentioning the right specialist
|
|
34
|
+
- **Every agent learns** — memories from conversations are persisted and loaded on the next start
|
|
35
|
+
- **Everything is configurable** from a clean web UI — no code changes needed to add agents, assign tools, or edit behavior
|
|
36
|
+
|
|
37
|
+
Whether you're building an internal AI ops team, a customer support squad, or a research group — SlackHive gives you the infrastructure to make it happen.
|
|
38
|
+
|
|
39
|
+
<details>
|
|
40
|
+
<summary><b>See it in action</b></summary>
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
User: @boss can you analyze last week's conversion funnel?
|
|
44
|
+
Boss: That's right up @data-analyst's alley. Let me loop them in 👇
|
|
45
|
+
@data-analyst — user wants conversion funnel analysis for last week.
|
|
46
|
+
DataBot: [reads full thread context, runs Redshift query via MCP]
|
|
47
|
+
Here are the results: conversions were up 12% week-over-week...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The Boss reads the message, checks its team registry, and delegates to the right specialist. The specialist picks up the **full Slack thread** as context — nothing is lost in the handoff.
|
|
51
|
+
|
|
52
|
+
</details>
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## ✨ Features
|
|
57
|
+
|
|
58
|
+
### Core Platform
|
|
59
|
+
|
|
60
|
+
| Feature | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| 👑 **Boss Agent** | Orchestrator bot that knows every specialist and delegates by @mention in threads |
|
|
63
|
+
| 🧠 **Agent Memory** | Agents learn from every conversation — memories auto-synced to Postgres |
|
|
64
|
+
| 🔌 **MCP Server Catalog** | Add tool servers once, assign to any agent — Redshift, GitHub, custom APIs |
|
|
65
|
+
| 🧵 **Thread Context** | Tagged agents fetch full thread history — zero context loss in handoffs |
|
|
66
|
+
| 💾 **Session Persistence** | Slack thread ↔ Claude session mapping survives restarts |
|
|
67
|
+
| 🔁 **Hot Reload** | Edit anything in the UI → agent picks up changes in seconds via Redis pub/sub |
|
|
68
|
+
|
|
69
|
+
### Web UI
|
|
70
|
+
|
|
71
|
+
| Feature | Description |
|
|
72
|
+
|---------|-------------|
|
|
73
|
+
| 🧙 **Onboarding Wizard** | Guided flow: identity → Slack app → tokens → MCPs & skills (skipped for boss) → review |
|
|
74
|
+
| 📝 **Skill Editor** | In-browser editor for agent markdown skills with file tree and categories |
|
|
75
|
+
| 🔐 **Tool Permissions** | Per-agent allowlist/denylist for Claude Code SDK tools |
|
|
76
|
+
| 📊 **Live Logs** | SSE-streamed Docker log output per agent with level filters and search |
|
|
77
|
+
| ⚙️ **Settings** | Configurable branding (app name, logo, tagline), dashboard title, user management |
|
|
78
|
+
| 🧠 **Memory Viewer** | Browse, inspect, and delete agent memories grouped by type |
|
|
79
|
+
| 📄 **CLAUDE.md Viewer** | Read and edit the compiled system prompt sent to each agent |
|
|
80
|
+
| 📐 **Collapsible Sidebar** | Clean sidebar with live agent roster, status dots, and collapse toggle |
|
|
81
|
+
| 📱 **Responsive Design** | Mobile-friendly layout with hamburger menu, overlay sidebar, fluid grids |
|
|
82
|
+
| 🔒 **Auth & RBAC** | Login page, superadmin via env vars, 4 roles (superadmin/admin/editor/viewer) |
|
|
83
|
+
| 👥 **User Management** | Create users with admin, editor, or viewer roles from Settings |
|
|
84
|
+
| 🏢 **Agent Hierarchy** | Multi-boss support — agents can report to multiple bosses, each boss manages its own team |
|
|
85
|
+
| ⏰ **Scheduled Jobs** | Cron-based recurring tasks executed by the boss agent, with run history |
|
|
86
|
+
|
|
87
|
+
### Agent Capabilities
|
|
88
|
+
|
|
89
|
+
- **Slack Block Kit formatting** — markdown tables rendered as native Slack table blocks, headings, code blocks
|
|
90
|
+
- **Streaming responses** — tool use labels, progress indicators, and rich formatted output
|
|
91
|
+
- **MCP tool integration** — stdio, SSE, and HTTP transports supported
|
|
92
|
+
- **Customizable personas** — each agent has its own personality and behavior
|
|
93
|
+
- **Skill system** — modular markdown files organized by category with sort ordering
|
|
94
|
+
- **Auto-generated boss registry** — each boss gets a team roster compiled from agents that report to it
|
|
95
|
+
- **Memory system injected into CLAUDE.md** — agents know how to write and organize memories
|
|
96
|
+
- **Multi-boss hierarchy** — `reports_to` is a UUID array; an agent can report to multiple bosses
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 🏗 Architecture
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
104
|
+
│ Slack Workspace │
|
|
105
|
+
│ @boss @data-bot @writer @engineer ... │
|
|
106
|
+
└────────────────────────────┬────────────────────────────────┘
|
|
107
|
+
│ Socket Mode (Bolt)
|
|
108
|
+
┌────────────────────────────▼────────────────────────────────┐
|
|
109
|
+
│ Docker Compose │
|
|
110
|
+
│ │
|
|
111
|
+
│ ┌─────────────────┐ publish events ┌─────────────────┐ │
|
|
112
|
+
│ │ Web UI │ ──────────────► │ Redis 7 │ │
|
|
113
|
+
│ │ Next.js 15 │ │ pub/sub │ │
|
|
114
|
+
│ │ :3000 │ └────────┬────────┘ │
|
|
115
|
+
│ │ │ │ subscribe │
|
|
116
|
+
│ │ • Dashboard │ read/write ┌───────▼────────┐ │
|
|
117
|
+
│ │ • Agent config │ ◄───────────────► │ Runner │ │
|
|
118
|
+
│ │ • Skill editor │ │ │ │
|
|
119
|
+
│ │ • MCP catalog │ │ AgentRunner │ │
|
|
120
|
+
│ │ • Memory viewer│ │ ├─ Boss │ │
|
|
121
|
+
│ │ • Live logs │ │ ├─ DataBot │ │
|
|
122
|
+
│ │ • Settings │ │ ├─ Writer │ │
|
|
123
|
+
│ └─────────────────┘ │ └─ ... │ │
|
|
124
|
+
│ │ └───────┬────────┘ │
|
|
125
|
+
│ │ read/write │ │
|
|
126
|
+
│ ▼ ▼ │
|
|
127
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
128
|
+
│ │ PostgreSQL 16 │ │
|
|
129
|
+
│ │ │ │
|
|
130
|
+
│ │ agents · skills · memories · permissions │ │
|
|
131
|
+
│ │ mcp_servers · agent_mcps · sessions │ │
|
|
132
|
+
│ │ settings · users · scheduled_jobs · job_runs │ │
|
|
133
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
134
|
+
└─────────────────────────────────────────────────────────────┘
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**How it flows:**
|
|
138
|
+
|
|
139
|
+
1. **User** messages an agent (or `@boss`) in Slack
|
|
140
|
+
2. **Runner** receives the event via Bolt Socket Mode
|
|
141
|
+
3. **Claude Code SDK** processes the message with the agent's compiled `CLAUDE.md`
|
|
142
|
+
4. Agent may use **MCP tools** (Redshift queries, GitHub API, etc.) during processing
|
|
143
|
+
5. **Response** is formatted as Slack Block Kit and posted to the thread
|
|
144
|
+
6. **Memory files** written during the session are detected by `MemoryWatcher` and synced to Postgres
|
|
145
|
+
7. On next conversation, the agent starts with all accumulated **learned knowledge**
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🚀 Quick Start
|
|
150
|
+
|
|
151
|
+
### Option A: One-command install (recommended)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm install -g slackhive
|
|
155
|
+
slackhive init
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The CLI will:
|
|
159
|
+
1. Check prerequisites (Docker, Docker Compose, Git)
|
|
160
|
+
2. Clone the repository
|
|
161
|
+
3. Walk you through configuration (API key, admin credentials)
|
|
162
|
+
4. Start all services automatically
|
|
163
|
+
|
|
164
|
+
### Option B: Manual setup
|
|
165
|
+
|
|
166
|
+
#### Prerequisites
|
|
167
|
+
|
|
168
|
+
- [Docker](https://docs.docker.com/get-docker/) + [Docker Compose](https://docs.docker.com/compose/)
|
|
169
|
+
- An [Anthropic API key](https://console.anthropic.com/) (`ANTHROPIC_API_KEY`)
|
|
170
|
+
|
|
171
|
+
#### 1. Clone & configure
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
git clone https://github.com/amansrivastava17/slackhive.git
|
|
175
|
+
cd slackhive
|
|
176
|
+
cp .env.example .env
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Edit `.env` with your Anthropic API key and credentials:
|
|
180
|
+
|
|
181
|
+
```env
|
|
182
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
183
|
+
ADMIN_USERNAME=admin
|
|
184
|
+
ADMIN_PASSWORD=changeme
|
|
185
|
+
POSTGRES_PASSWORD=slackhive
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### 2. Start everything
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
docker compose up -d --build
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
This launches all four services:
|
|
195
|
+
|
|
196
|
+
| Service | Port | Description |
|
|
197
|
+
|---------|------|-------------|
|
|
198
|
+
| **Web UI** | `localhost:3001` | Dashboard and agent management |
|
|
199
|
+
| **Runner** | — | Manages all Slack bot connections |
|
|
200
|
+
| **PostgreSQL** | `localhost:5432` | Persistent storage |
|
|
201
|
+
| **Redis** | `localhost:6379` | Event pub/sub for hot reload |
|
|
202
|
+
|
|
203
|
+
#### 3. Open the dashboard
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
http://localhost:3001
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Login with your admin credentials and create your first agent.
|
|
210
|
+
|
|
211
|
+
### CLI Commands
|
|
212
|
+
|
|
213
|
+
After installing with `npm install -g slackhive`:
|
|
214
|
+
|
|
215
|
+
| Command | Description |
|
|
216
|
+
|---------|-------------|
|
|
217
|
+
| `slackhive init` | Clone, configure, and start SlackHive |
|
|
218
|
+
| `slackhive start` | Start all services |
|
|
219
|
+
| `slackhive stop` | Stop all services |
|
|
220
|
+
| `slackhive status` | Show running containers |
|
|
221
|
+
| `slackhive logs` | Tail runner logs |
|
|
222
|
+
| `slackhive update` | Pull latest changes and rebuild |
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 🔑 Claude Code Authentication
|
|
227
|
+
|
|
228
|
+
SlackHive supports two authentication modes for the Claude Code SDK. Choose the one that fits your setup.
|
|
229
|
+
|
|
230
|
+
### Option 1: API Key (pay-per-use)
|
|
231
|
+
|
|
232
|
+
Best for: teams, production, predictable billing.
|
|
233
|
+
|
|
234
|
+
Set your Anthropic API key in `.env`:
|
|
235
|
+
|
|
236
|
+
```env
|
|
237
|
+
ANTHROPIC_API_KEY=sk-ant-api03-...
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
That's it. Every agent will use this key. You're billed per token via the [Anthropic API](https://console.anthropic.com/).
|
|
241
|
+
|
|
242
|
+
### Option 2: Claude Code Subscription (Max plan)
|
|
243
|
+
|
|
244
|
+
Best for: individual developers, Claude Pro/Max subscribers ($100–$200/month unlimited).
|
|
245
|
+
|
|
246
|
+
If you have a Claude Max subscription with Claude Code access:
|
|
247
|
+
|
|
248
|
+
**Step 1 — Login on the host machine:**
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
claude login
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
This opens a browser for OAuth and saves credentials to `~/.claude/`.
|
|
255
|
+
|
|
256
|
+
**Step 2 — Mount credentials into the runner container:**
|
|
257
|
+
|
|
258
|
+
The `docker-compose.yml` runner service needs access to your host's Claude credentials. Add these volume mounts if not already present:
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
runner:
|
|
262
|
+
volumes:
|
|
263
|
+
- ~/.claude:/root/.claude # Auth credentials
|
|
264
|
+
- /tmp/agents:/tmp/agents # Agent working dirs
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Step 3 — Remove the API key (important):**
|
|
268
|
+
|
|
269
|
+
Make sure `ANTHROPIC_API_KEY` is **not** set in `.env`. When no API key is present, the SDK falls back to the subscription credentials from `~/.claude/`.
|
|
270
|
+
|
|
271
|
+
```env
|
|
272
|
+
# ANTHROPIC_API_KEY= ← comment out or remove
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Step 4 — Restart:**
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
slackhive update
|
|
279
|
+
# or: docker compose up -d --build runner
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Which should I use?
|
|
283
|
+
|
|
284
|
+
| | API Key | Subscription |
|
|
285
|
+
|---|---------|-------------|
|
|
286
|
+
| **Billing** | Per-token (pay what you use) | Flat monthly ($100/$200) |
|
|
287
|
+
| **Setup** | Just paste the key | Run `claude login` on host |
|
|
288
|
+
| **Best for** | Teams, CI/CD, production | Solo devs, prototyping |
|
|
289
|
+
| **Rate limits** | API tier limits | Subscription fair-use limits |
|
|
290
|
+
| **Multiple agents** | All share one key | All share one subscription |
|
|
291
|
+
|
|
292
|
+
> **Note:** If both `ANTHROPIC_API_KEY` and `~/.claude` credentials are present, the API key takes precedence.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## 🤖 Creating Your First Agent
|
|
297
|
+
|
|
298
|
+
Click **New Agent** from the dashboard and follow the wizard:
|
|
299
|
+
|
|
300
|
+
### Step 1 — Identity
|
|
301
|
+
Set the agent's name, slug (e.g., `data-bot`), persona, and description. Toggle **Boss** if this agent should orchestrate others — boss agents skip the MCPs & Skills step since their `CLAUDE.md` is auto-generated. For specialist agents, select which boss(es) they report to.
|
|
302
|
+
|
|
303
|
+
### Step 2 — Slack App Setup
|
|
304
|
+
The platform generates a `slack-app-manifest.json`. Create a Slack app from this manifest:
|
|
305
|
+
|
|
306
|
+
1. Go to [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → **From a manifest**
|
|
307
|
+
2. Paste the generated JSON
|
|
308
|
+
3. **Install to Workspace** → copy the **Bot Token** (`xoxb-...`)
|
|
309
|
+
4. **Socket Mode** → Enable → generate the **App-Level Token** (`xapp-...`)
|
|
310
|
+
5. **Basic Information** → copy the **Signing Secret**
|
|
311
|
+
6. Paste all three back in the wizard
|
|
312
|
+
|
|
313
|
+
### Step 3 — Permissions
|
|
314
|
+
Configure which Claude Code SDK tools the agent can use. Quick-add buttons for common tools like `Read`, `Write`, `Bash`, `WebFetch`.
|
|
315
|
+
|
|
316
|
+
### Step 4 — MCPs
|
|
317
|
+
Select MCP servers from the platform catalog to give your agent access to external tools (databases, APIs, etc.).
|
|
318
|
+
|
|
319
|
+
### Step 5 — Skills
|
|
320
|
+
Choose a starter template or start blank. Skills are modular markdown files that compose the agent's `CLAUDE.md` system prompt.
|
|
321
|
+
|
|
322
|
+
The agent starts automatically and connects to Slack.
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## 👑 Boss Agents
|
|
327
|
+
|
|
328
|
+
Create one or more agents with the **Boss** toggle enabled. Each boss gets its own `CLAUDE.md` team registry listing the agents that report to it:
|
|
329
|
+
|
|
330
|
+
```markdown
|
|
331
|
+
## Your Team
|
|
332
|
+
|
|
333
|
+
- **DataBot** (<@U12345678>) — Data warehouse NLQ, Redshift queries, business metrics
|
|
334
|
+
- **Writer** (<@U87654321>) — Content generation, Slack summaries, announcements
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
The registry **auto-regenerates** for every boss whenever you add, update, or delete an agent — no manual maintenance needed.
|
|
338
|
+
|
|
339
|
+
You can have **multiple boss agents** for different domains or teams. When creating a specialist agent, check the bosses it should report to — it will appear in each selected boss's registry. A specialist can report to more than one boss.
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
User: @boss help me analyze last week's bookings
|
|
343
|
+
Boss: I'll get @data-bot on this 👇
|
|
344
|
+
@data-bot — user wants booking analysis for last week
|
|
345
|
+
DataBot: [reads full thread, runs Redshift query via MCP]
|
|
346
|
+
Bookings were up 12% to 4,320...
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## 🧠 How Agents Learn
|
|
352
|
+
|
|
353
|
+
Every conversation is an opportunity for the agent to learn. This is the **primary design goal** of the platform.
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
Conversation
|
|
357
|
+
└─► Claude writes .claude/memory/feedback_xyz.md
|
|
358
|
+
└─► MemoryWatcher detects change (fs.watch)
|
|
359
|
+
└─► Parses YAML frontmatter (name, type, description)
|
|
360
|
+
└─► Upserts into memories table (Postgres)
|
|
361
|
+
└─► Included in CLAUDE.md on next start
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Memory types follow [Claude Code memory conventions](https://docs.anthropic.com/en/claude-code/memory):
|
|
365
|
+
|
|
366
|
+
| Type | Purpose | Example |
|
|
367
|
+
|------|---------|---------|
|
|
368
|
+
| `feedback` | Behavioral corrections and validated approaches | "Don't mock the database in integration tests" |
|
|
369
|
+
| `user` | Information about people the agent works with | "Kai is the data team lead, prefers concise answers" |
|
|
370
|
+
| `project` | Ongoing work context, goals, deadlines | "Merge freeze starts March 5 for mobile release" |
|
|
371
|
+
| `reference` | Pointers to external systems and resources | "Pipeline bugs tracked in Linear project INGEST" |
|
|
372
|
+
|
|
373
|
+
View and manage all memories from **Agents → [name] → Memory**.
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## ⏰ Scheduled Jobs
|
|
378
|
+
|
|
379
|
+
Scheduled jobs let the boss agent run recurring tasks on a cron schedule and post results to Slack.
|
|
380
|
+
|
|
381
|
+
### How it works
|
|
382
|
+
|
|
383
|
+
1. Create a job from the **Jobs** page in the web UI
|
|
384
|
+
2. Set a **prompt** (what to tell the boss), **schedule** (cron expression), and **target** (channel or DM)
|
|
385
|
+
3. The runner's `JobScheduler` fires on schedule and sends the prompt to the boss agent
|
|
386
|
+
4. Boss processes it like any normal message — may delegate to specialists, run MCP tools, etc.
|
|
387
|
+
5. Result is posted to the target Slack channel or DM
|
|
388
|
+
6. Run history (status, output, duration) is tracked and visible in the UI
|
|
389
|
+
|
|
390
|
+
### Example
|
|
391
|
+
|
|
392
|
+
| Field | Value |
|
|
393
|
+
|-------|-------|
|
|
394
|
+
| **Name** | Daily Booking Report |
|
|
395
|
+
| **Prompt** | Generate a summary of yesterday's bookings with key metrics |
|
|
396
|
+
| **Schedule** | `0 8 * * *` (daily at 8:00 AM) |
|
|
397
|
+
| **Target** | `#analytics` channel |
|
|
398
|
+
|
|
399
|
+
The UI includes schedule presets (hourly, daily, weekdays, weekly) and shows cron expressions in human-readable form.
|
|
400
|
+
|
|
401
|
+
### Job run states
|
|
402
|
+
|
|
403
|
+
| Status | Meaning |
|
|
404
|
+
|--------|---------|
|
|
405
|
+
| **Running** | Job is currently executing |
|
|
406
|
+
| **Success** | Completed and result posted to Slack |
|
|
407
|
+
| **Error** | Failed — boss not running, Claude error, or Slack API failure |
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## 🔒 Authentication & Roles
|
|
412
|
+
|
|
413
|
+
SlackHive ships with a simple but effective auth system — no external auth provider needed.
|
|
414
|
+
|
|
415
|
+
### How it works
|
|
416
|
+
|
|
417
|
+
- **Superadmin** is configured via environment variables (`ADMIN_USERNAME` / `ADMIN_PASSWORD`) — never stored in the database
|
|
418
|
+
- **Sessions** use HMAC-signed cookies (no JWTs, no session table)
|
|
419
|
+
- **Middleware** protects all routes — unauthenticated requests redirect to `/login`
|
|
420
|
+
|
|
421
|
+
### Roles
|
|
422
|
+
|
|
423
|
+
| Role | View | Create/edit agents | Manage jobs | Settings | Manage users |
|
|
424
|
+
|------|------|-------------------|-------------|----------|-------------|
|
|
425
|
+
| **Superadmin** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
426
|
+
| **Admin** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
427
|
+
| **Editor** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
428
|
+
| **Viewer** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
429
|
+
|
|
430
|
+
- **Superadmin**: configured via env vars, never stored in DB
|
|
431
|
+
- **Admin**: full access — can create users with any role
|
|
432
|
+
- **Editor**: can create/edit agents, jobs, MCPs, skills, settings — but cannot manage users
|
|
433
|
+
- **Viewer**: read-only access to everything
|
|
434
|
+
|
|
435
|
+
All permissions are enforced server-side via API route guards, not just hidden in the UI.
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## 🔌 MCP Server Catalog
|
|
440
|
+
|
|
441
|
+
MCP servers are managed at the platform level. Add a server once, assign it to any agent.
|
|
442
|
+
|
|
443
|
+
| Transport | Use Case | Config |
|
|
444
|
+
|-----------|----------|--------|
|
|
445
|
+
| `stdio` | Local subprocess | `command`, `args`, `env` |
|
|
446
|
+
| `sse` | Remote SSE endpoint | `url`, `headers` |
|
|
447
|
+
| `http` | Remote HTTP endpoint | `url`, `headers` |
|
|
448
|
+
|
|
449
|
+
**Example — Redshift MCP:**
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"name": "redshift-mcp",
|
|
454
|
+
"type": "stdio",
|
|
455
|
+
"description": "Read-only Redshift query access",
|
|
456
|
+
"config": {
|
|
457
|
+
"command": "node",
|
|
458
|
+
"args": ["/path/to/redshift-mcp-server/dist/index.js"],
|
|
459
|
+
"env": { "DATABASE_URL": "redshift://user:pass@host:5439/db" }
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Tool names follow the pattern `mcp__{serverName}__{toolName}`.
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## 📁 Project Structure
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
slackhive/
|
|
472
|
+
├── apps/
|
|
473
|
+
│ ├── web/ # Next.js 15 — Web UI + API
|
|
474
|
+
│ │ └── src/
|
|
475
|
+
│ │ ├── app/ # Pages, API routes, settings
|
|
476
|
+
│ │ └── lib/
|
|
477
|
+
│ │ ├── db.ts # Postgres + Redis client
|
|
478
|
+
│ │ ├── auth.ts # HMAC cookie sessions, bcrypt
|
|
479
|
+
│ │ ├── auth-context.tsx # Client-side auth React context
|
|
480
|
+
│ │ ├── api-guard.ts # Role guard for API routes
|
|
481
|
+
│ │ ├── boss-registry.ts # Auto-generated boss team registry
|
|
482
|
+
│ │ ├── slack-manifest.ts
|
|
483
|
+
│ │ └── skill-templates.ts
|
|
484
|
+
│ │
|
|
485
|
+
│ └── runner/ # Agent runner service
|
|
486
|
+
│ └── src/
|
|
487
|
+
│ ├── agent-runner.ts # Lifecycle manager
|
|
488
|
+
│ ├── claude-handler.ts # Claude Code SDK integration
|
|
489
|
+
│ ├── slack-handler.ts # Slack Bolt + Block Kit formatting
|
|
490
|
+
│ ├── compile-claude-md.ts # Skills + memories → CLAUDE.md
|
|
491
|
+
│ ├── memory-watcher.ts # fs.watch → DB sync (learning)
|
|
492
|
+
│ ├── job-scheduler.ts # Cron-based scheduled job executor
|
|
493
|
+
│ └── logger.ts # Structured logging
|
|
494
|
+
│
|
|
495
|
+
├── packages/
|
|
496
|
+
│ └── shared/ # Shared TypeScript types + DB schema
|
|
497
|
+
│
|
|
498
|
+
├── docker-compose.yml
|
|
499
|
+
├── scripts/dev.sh
|
|
500
|
+
└── .env.example
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## 🛠 Tech Stack
|
|
506
|
+
|
|
507
|
+
| Layer | Technology |
|
|
508
|
+
|-------|-----------|
|
|
509
|
+
| **Language** | TypeScript 5.x throughout |
|
|
510
|
+
| **Web UI** | Next.js 15 (App Router), React 19 |
|
|
511
|
+
| **AI Runtime** | Claude Code SDK (`@anthropic-ai/claude-agent-sdk`) |
|
|
512
|
+
| **Slack** | Bolt SDK (Socket Mode) |
|
|
513
|
+
| **Database** | PostgreSQL 16 |
|
|
514
|
+
| **Pub/Sub** | Redis 7 |
|
|
515
|
+
| **Infrastructure** | Docker Compose |
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## 🔮 Roadmap
|
|
520
|
+
|
|
521
|
+
We're actively building and these are on the horizon:
|
|
522
|
+
|
|
523
|
+
- [ ] **Local model support** — plug in local LLMs via Claude Code's model routing when available
|
|
524
|
+
- [ ] **Agent-to-agent conversations** — agents can directly message each other, not just through Boss
|
|
525
|
+
- [x] **Scheduled tasks** — cron-based agent actions (daily reports, weekly summaries)
|
|
526
|
+
- [ ] **Multi-workspace support** — one platform instance serving multiple Slack workspaces
|
|
527
|
+
- [ ] **Analytics dashboard** — message volume, response times, memory growth per agent
|
|
528
|
+
- [ ] **Webhook triggers** — trigger agent actions from external events (GitHub, Jira, PagerDuty)
|
|
529
|
+
- [ ] **Custom tool builder** — define simple tools in the UI without writing an MCP server
|
|
530
|
+
- [ ] **Agent templates marketplace** — share and import pre-configured agent setups
|
|
531
|
+
- [ ] **Conversation history UI** — browse past conversations and their outcomes in the web UI
|
|
532
|
+
- [ ] **RAG integration** — connect agents to document stores for knowledge retrieval
|
|
533
|
+
|
|
534
|
+
Have an idea? [Open an issue](https://github.com/amansrivastava17/slackhive/issues) — we'd love to hear it.
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## 🤝 Contributing
|
|
539
|
+
|
|
540
|
+
Contributions are very welcome! This project is in active development.
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
# Clone and install
|
|
544
|
+
git clone https://github.com/amansrivastava17/slackhive.git
|
|
545
|
+
cd slackhive
|
|
546
|
+
npm install
|
|
547
|
+
|
|
548
|
+
# Start infra
|
|
549
|
+
docker compose up postgres redis -d
|
|
550
|
+
|
|
551
|
+
# Run services locally
|
|
552
|
+
cd apps/web && npm run dev # http://localhost:3000
|
|
553
|
+
cd apps/runner && npm run dev # Connects to Slack
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Please open an issue before submitting large PRs so we can discuss the approach.
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
## ⭐ Star History
|
|
561
|
+
|
|
562
|
+
If you find this project useful, please consider giving it a star — it helps others discover it!
|
|
563
|
+
|
|
564
|
+
<a href="https://star-history.com/#amansrivastava17/slackhive&Date">
|
|
565
|
+
<picture>
|
|
566
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=amansrivastava17/slackhive&type=Date&theme=dark" />
|
|
567
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=amansrivastava17/slackhive&type=Date" />
|
|
568
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=amansrivastava17/slackhive&type=Date" width="600" />
|
|
569
|
+
</picture>
|
|
570
|
+
</a>
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## 📄 License
|
|
575
|
+
|
|
576
|
+
MIT © 2026 [Aman Srivastava](https://github.com/amansrivastava17)
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
<div align="center">
|
|
581
|
+
<sub>Built with Claude Code SDK, Slack Bolt, and a lot of ☕</sub>
|
|
582
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slackhive",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "CLI to install and manage SlackHive — AI agent teams on Slack",
|
|
5
5
|
"bin": {
|
|
6
6
|
"slackhive": "./dist/index.js"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"node": ">=18.0.0"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
|
-
"dist"
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
42
43
|
]
|
|
43
44
|
}
|