v2: add Chat SDK channel adapters and skills for 11 platforms

Thin wrapper adapters + SKILL.md for Slack, Telegram, GitHub, Linear,
Google Chat, Teams, WhatsApp Cloud API, Resend, Matrix, Webex, iMessage.
All follow the same pattern as discord-v2.ts: readEnvFile → create*Adapter
→ createChatSdkBridge → registerChannelAdapter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-04-09 11:26:33 +03:00
parent 8a06b01646
commit 12af451069
24 changed files with 1338 additions and 4 deletions

View File

@@ -0,0 +1,78 @@
---
name: add-gchat-v2
description: Add Google Chat channel integration to NanoClaw v2 via Chat SDK.
---
# Add Google Chat Channel (v2)
This skill adds Google Chat support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/gchat-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/gchat
```
### Enable the channel
Uncomment the Google Chat import in `src/channels/index.ts`:
```typescript
import './gchat-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Google Chat App
> 1. Go to [Google Cloud Console](https://console.cloud.google.com)
> 2. Create or select a project
> 3. Enable the **Google Chat API**
> 4. Go to **Google Chat API** > **Configuration**:
> - App name and description
> - Connection settings: select **HTTP endpoint URL** and set to `https://your-domain/webhook/gchat`
> 5. Create a **Service Account**:
> - Go to **IAM & Admin** > **Service Accounts** > **Create Service Account**
> - Grant the Chat Bot role
> - Create a JSON key and download it
### Configure environment
Add the service account JSON as a single-line string to `.env`:
```bash
GCHAT_CREDENTIALS={"type":"service_account","project_id":"...","private_key":"...","client_email":"..."}
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Add the bot to a Google Chat space, then send a message or @mention the bot.
## Removal
1. Comment out `import './gchat-v2.js'` in `src/channels/index.ts`
2. Remove `GCHAT_CREDENTIALS` from `.env`
3. `npm uninstall @chat-adapter/gchat`
4. Rebuild and restart

View File

@@ -0,0 +1,80 @@
---
name: add-github-v2
description: Add GitHub channel integration to NanoClaw v2 via Chat SDK. PR comment threads as conversations.
---
# Add GitHub Channel (v2)
This skill adds GitHub support to NanoClaw v2 using the Chat SDK bridge. The agent can participate in PR comment threads.
## Phase 1: Pre-flight
Check if `src/channels/github-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/github
```
### Enable the channel
Uncomment the GitHub import in `src/channels/index.ts`:
```typescript
import './github-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create GitHub credentials
> 1. Go to [GitHub Settings > Developer Settings > Personal Access Tokens](https://github.com/settings/tokens)
> 2. Create a **Fine-grained token** with:
> - Repository access: select the repos you want the bot to monitor
> - Permissions: **Pull requests** (Read & Write), **Issues** (Read & Write)
> 3. Copy the token
> 4. Set up a webhook on your repo(s):
> - Go to **Settings** > **Webhooks** > **Add webhook**
> - Payload URL: `https://your-domain/webhook/github`
> - Content type: `application/json`
> - Secret: generate a random string
> - Events: select **Issue comments**, **Pull request review comments**
### Configure environment
Add to `.env`:
```bash
GITHUB_TOKEN=github_pat_...
GITHUB_WEBHOOK_SECRET=your-webhook-secret
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> @mention the bot in a PR comment or issue comment. The bot should respond within a few seconds.
## Removal
1. Comment out `import './github-v2.js'` in `src/channels/index.ts`
2. Remove `GITHUB_TOKEN` and `GITHUB_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @chat-adapter/github`
4. Rebuild and restart

View File

@@ -0,0 +1,86 @@
---
name: add-imessage-v2
description: Add iMessage channel integration to NanoClaw v2 via Chat SDK. Local (macOS) or remote (Photon API) mode.
---
# Add iMessage Channel (v2)
This skill adds iMessage support to NanoClaw v2 using the Chat SDK bridge. Supports local mode (macOS with Full Disk Access) and remote mode (via Photon API).
## Phase 1: Pre-flight
Check if `src/channels/imessage-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install chat-adapter-imessage
```
### Enable the channel
Uncomment the iMessage import in `src/channels/index.ts`:
```typescript
import './imessage-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Local Mode (macOS)
> **Requirements**: macOS with Full Disk Access granted to your terminal/Node.js process.
>
> 1. Go to **System Settings** > **Privacy & Security** > **Full Disk Access**
> 2. Add your terminal app (Terminal, iTerm2, etc.) or the Node.js binary
> 3. The adapter reads directly from the iMessage database on disk
### Remote Mode (Photon API)
> 1. Set up a [Photon](https://photon.im) account
> 2. Get your server URL and API key
### Configure environment
**Local mode** — add to `.env`:
```bash
IMESSAGE_ENABLED=true
IMESSAGE_LOCAL=true
```
**Remote mode** — add to `.env`:
```bash
IMESSAGE_LOCAL=false
IMESSAGE_SERVER_URL=https://your-photon-server.com
IMESSAGE_API_KEY=your-api-key
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
```
## Phase 4: Verify
> Send an iMessage to the account running NanoClaw. The bot should respond within a few seconds.
## Removal
1. Comment out `import './imessage-v2.js'` in `src/channels/index.ts`
2. Remove iMessage env vars from `.env`
3. `npm uninstall chat-adapter-imessage`
4. Rebuild and restart

View File

@@ -0,0 +1,77 @@
---
name: add-linear-v2
description: Add Linear channel integration to NanoClaw v2 via Chat SDK. Issue comment threads as conversations.
---
# Add Linear Channel (v2)
This skill adds Linear support to NanoClaw v2 using the Chat SDK bridge. The agent can participate in issue comment threads.
## Phase 1: Pre-flight
Check if `src/channels/linear-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/linear
```
### Enable the channel
Uncomment the Linear import in `src/channels/index.ts`:
```typescript
import './linear-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Linear credentials
> 1. Go to [Linear Settings > API](https://linear.app/settings/api)
> 2. Create a **Personal API Key** (or use an OAuth application for team-wide access)
> 3. Copy the API key
> 4. Set up a webhook:
> - Go to **Settings** > **API** > **Webhooks** > **New webhook**
> - URL: `https://your-domain/webhook/linear`
> - Select events: **Comment** (created, updated)
> - Copy the signing secret
### Configure environment
Add to `.env`:
```bash
LINEAR_API_KEY=lin_api_...
LINEAR_WEBHOOK_SECRET=your-webhook-secret
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> @mention the bot in a Linear issue comment. The bot should respond within a few seconds.
## Removal
1. Comment out `import './linear-v2.js'` in `src/channels/index.ts`
2. Remove `LINEAR_API_KEY` and `LINEAR_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @chat-adapter/linear`
4. Rebuild and restart

View File

@@ -0,0 +1,77 @@
---
name: add-matrix-v2
description: Add Matrix channel integration to NanoClaw v2 via Chat SDK. Works with any Matrix homeserver (Element, Beeper, etc.).
---
# Add Matrix Channel (v2)
This skill adds Matrix support to NanoClaw v2 using the Chat SDK bridge. Works with any Matrix homeserver.
## Phase 1: Pre-flight
Check if `src/channels/matrix-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @beeper/chat-adapter-matrix
```
### Enable the channel
Uncomment the Matrix import in `src/channels/index.ts`:
```typescript
import './matrix-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Matrix bot account
> 1. Register a bot account on your Matrix homeserver (e.g., via Element)
> 2. Get the homeserver URL (e.g., `https://matrix.org` or your self-hosted URL)
> 3. Get an access token:
> - In Element: **Settings** > **Help & About** > **Access Token** (advanced)
> - Or via API: `curl -XPOST 'https://matrix.org/_matrix/client/r0/login' -d '{"type":"m.login.password","user":"botuser","password":"..."}'`
> 4. Note the bot's user ID (e.g., `@botuser:matrix.org`)
### Configure environment
Add to `.env`:
```bash
MATRIX_BASE_URL=https://matrix.org
MATRIX_ACCESS_TOKEN=your-access-token
MATRIX_USER_ID=@botuser:matrix.org
MATRIX_BOT_USERNAME=botuser
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Invite the bot to a Matrix room and send a message. The bot should respond within a few seconds.
## Removal
1. Comment out `import './matrix-v2.js'` in `src/channels/index.ts`
2. Remove `MATRIX_BASE_URL`, `MATRIX_ACCESS_TOKEN`, `MATRIX_USER_ID`, `MATRIX_BOT_USERNAME` from `.env`
3. `npm uninstall @beeper/chat-adapter-matrix`
4. Rebuild and restart

View File

@@ -0,0 +1,79 @@
---
name: add-resend-v2
description: Add Resend (email) channel integration to NanoClaw v2 via Chat SDK.
---
# Add Resend Email Channel (v2)
This skill adds email support via Resend to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/resend-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @resend/chat-sdk-adapter
```
### Enable the channel
Uncomment the Resend import in `src/channels/index.ts`:
```typescript
import './resend-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Resend credentials
> 1. Go to [resend.com](https://resend.com) and create an account
> 2. Add and verify your sending domain
> 3. Go to **API Keys** and create a new key
> 4. Set up a webhook:
> - Go to **Webhooks** > **Add webhook**
> - URL: `https://your-domain/webhook/resend`
> - Events: select **email.received** (for inbound email)
> - Copy the signing secret
### Configure environment
Add to `.env`:
```bash
RESEND_API_KEY=re_...
RESEND_FROM_ADDRESS=bot@yourdomain.com
RESEND_FROM_NAME=NanoClaw
RESEND_WEBHOOK_SECRET=your-webhook-secret
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Send an email to the configured from address. The bot should respond via email within a few seconds.
## Removal
1. Comment out `import './resend-v2.js'` in `src/channels/index.ts`
2. Remove `RESEND_API_KEY`, `RESEND_FROM_ADDRESS`, `RESEND_FROM_NAME`, `RESEND_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @resend/chat-sdk-adapter`
4. Rebuild and restart

View File

@@ -0,0 +1,81 @@
---
name: add-slack-v2
description: Add Slack channel integration to NanoClaw v2 via Chat SDK.
---
# Add Slack Channel (v2)
This skill adds Slack support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/slack-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/slack
```
### Enable the channel
Uncomment the Slack import in `src/channels/index.ts`:
```typescript
import './slack-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Slack App (if needed)
If the user doesn't have a Slack app:
> 1. Go to [api.slack.com/apps](https://api.slack.com/apps) and click **Create New App** > **From scratch**
> 2. Name it (e.g., "NanoClaw") and select your workspace
> 3. Go to **OAuth & Permissions** and add Bot Token Scopes:
> - `chat:write`, `channels:history`, `groups:history`, `im:history`, `channels:read`, `groups:read`, `users:read`, `reactions:write`
> 4. Click **Install to Workspace** and copy the **Bot User OAuth Token** (`xoxb-...`)
> 5. Go to **Basic Information** and copy the **Signing Secret**
> 6. Go to **Event Subscriptions**, enable events, and subscribe to:
> - `message.channels`, `message.groups`, `message.im`, `app_mention`
> 7. Set the Request URL to your webhook endpoint (e.g., `https://your-domain/webhook/slack`)
### Configure environment
Add to `.env`:
```bash
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Add the bot to a Slack channel, then send a message or @mention the bot.
> The bot should respond within a few seconds.
## Removal
1. Comment out `import './slack-v2.js'` in `src/channels/index.ts`
2. Remove `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET` from `.env`
3. `npm uninstall @chat-adapter/slack`
4. Rebuild and restart

View File

@@ -0,0 +1,75 @@
---
name: add-teams-v2
description: Add Microsoft Teams channel integration to NanoClaw v2 via Chat SDK.
---
# Add Microsoft Teams Channel (v2)
This skill adds Microsoft Teams support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/teams-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/teams
```
### Enable the channel
Uncomment the Teams import in `src/channels/index.ts`:
```typescript
import './teams-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Teams Bot
> 1. Go to [Azure Portal](https://portal.azure.com) > **Azure Bot** > **Create**
> 2. Fill in the bot details and create
> 3. Go to **Configuration**:
> - Messaging endpoint: `https://your-domain/webhook/teams`
> 4. Go to **Channels** > add **Microsoft Teams**
> 5. Note the **Microsoft App ID** and **Password** (from the bot's Azure AD app registration)
### Configure environment
Add to `.env`:
```bash
TEAMS_APP_ID=your-app-id
TEAMS_APP_PASSWORD=your-app-password
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Add the bot to a Teams channel or send it a direct message. The bot should respond within a few seconds.
## Removal
1. Comment out `import './teams-v2.js'` in `src/channels/index.ts`
2. Remove `TEAMS_APP_ID` and `TEAMS_APP_PASSWORD` from `.env`
3. `npm uninstall @chat-adapter/teams`
4. Rebuild and restart

View File

@@ -0,0 +1,82 @@
---
name: add-telegram-v2
description: Add Telegram channel integration to NanoClaw v2 via Chat SDK.
---
# Add Telegram Channel (v2)
This skill adds Telegram support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/telegram-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/telegram
```
### Enable the channel
Uncomment the Telegram import in `src/channels/index.ts`:
```typescript
import './telegram-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Telegram Bot (if needed)
> 1. Open Telegram and search for `@BotFather`
> 2. Send `/newbot` and follow the prompts:
> - Bot name: Something friendly (e.g., "NanoClaw Assistant")
> - Bot username: Must end with "bot" (e.g., "nanoclaw_bot")
> 3. Copy the bot token (looks like `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11`)
### Disable Group Privacy (for group chats)
> **Important for group chats**: By default, Telegram bots only see @mentions and commands in groups. To let the bot see all messages:
>
> 1. Open `@BotFather` > `/mybots` > select your bot
> 2. **Bot Settings** > **Group Privacy** > **Turn off**
### Configure environment
Add to `.env`:
```bash
TELEGRAM_BOT_TOKEN=your-bot-token
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Send a message to your bot in Telegram (search for its username).
> For groups: add the bot to a group and send a message.
> The bot should respond within a few seconds.
## Removal
1. Comment out `import './telegram-v2.js'` in `src/channels/index.ts`
2. Remove `TELEGRAM_BOT_TOKEN` from `.env`
3. `npm uninstall @chat-adapter/telegram`
4. Rebuild and restart

View File

@@ -0,0 +1,75 @@
---
name: add-webex-v2
description: Add Webex channel integration to NanoClaw v2 via Chat SDK.
---
# Add Webex Channel (v2)
This skill adds Cisco Webex support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/webex-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @bitbasti/chat-adapter-webex
```
### Enable the channel
Uncomment the Webex import in `src/channels/index.ts`:
```typescript
import './webex-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create Webex Bot
> 1. Go to [developer.webex.com](https://developer.webex.com/my-apps/new/bot)
> 2. Create a new bot and copy the **Bot Access Token**
> 3. Set up a webhook:
> - Use the Webex API to create a webhook pointing to `https://your-domain/webhook/webex`
> - Or use the Webex Developer Portal
> - Set a webhook secret for signature verification
### Configure environment
Add to `.env`:
```bash
WEBEX_BOT_TOKEN=your-bot-token
WEBEX_WEBHOOK_SECRET=your-webhook-secret
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Add the bot to a Webex space or send it a direct message. The bot should respond within a few seconds.
## Removal
1. Comment out `import './webex-v2.js'` in `src/channels/index.ts`
2. Remove `WEBEX_BOT_TOKEN` and `WEBEX_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @bitbasti/chat-adapter-webex`
4. Rebuild and restart

View File

@@ -0,0 +1,82 @@
---
name: add-whatsapp-cloud-v2
description: Add WhatsApp Business Cloud API channel to NanoClaw v2 via Chat SDK. Official Meta API (not Baileys).
---
# Add WhatsApp Cloud API Channel (v2)
This skill adds WhatsApp support via the official Meta WhatsApp Business Cloud API. This is different from the Baileys-based WhatsApp adapter (which uses WhatsApp Web protocol).
## Phase 1: Pre-flight
Check if `src/channels/whatsapp-cloud-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
### Install the adapter package
```bash
npm install @chat-adapter/whatsapp
```
### Enable the channel
Uncomment the WhatsApp Cloud API import in `src/channels/index.ts`:
```typescript
import './whatsapp-cloud-v2.js';
```
### Build
```bash
npm run build
```
## Phase 3: Setup
### Create WhatsApp Business App
> 1. Go to [Meta for Developers](https://developers.facebook.com/apps/) and create an app (type: Business)
> 2. Add the **WhatsApp** product
> 3. Go to **WhatsApp** > **API Setup**:
> - Note the **Phone Number ID** (not the phone number itself)
> - Generate a **permanent System User access token** with `whatsapp_business_messaging` permission
> 4. Go to **WhatsApp** > **Configuration**:
> - Set webhook URL: `https://your-domain/webhook/whatsapp`
> - Set a **Verify Token** (any random string you choose)
> - Subscribe to webhook fields: `messages`
> 5. Copy the **App Secret** from **Settings** > **Basic**
### Configure environment
Add to `.env`:
```bash
WHATSAPP_ACCESS_TOKEN=your-system-user-access-token
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id
WHATSAPP_APP_SECRET=your-app-secret
WHATSAPP_VERIFY_TOKEN=your-verify-token
```
Sync to container: `mkdir -p data/env && cp .env data/env/env`
### Build and restart
```bash
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# systemctl --user restart nanoclaw # Linux
```
## Phase 4: Verify
> Send a message to your WhatsApp Business number. The bot should respond within a few seconds.
> Note: WhatsApp Cloud API only supports 1:1 DMs, not group chats.
## Removal
1. Comment out `import './whatsapp-cloud-v2.js'` in `src/channels/index.ts`
2. Remove `WHATSAPP_ACCESS_TOKEN`, `WHATSAPP_PHONE_NUMBER_ID`, `WHATSAPP_APP_SECRET`, `WHATSAPP_VERIFY_TOKEN` from `.env`
3. `npm uninstall @chat-adapter/whatsapp`
4. Rebuild and restart