ワンクリックで
source-integrations
Set up and maintain GitHub OAuth2 and Slack Bot Token integrations for notification-hub.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Set up and maintain GitHub OAuth2 and Slack Bot Token integrations for notification-hub.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Edit the visual grid layout of a garden bed, assigning crops to cells on a canvas editor. Use when asked to arrange crops in a bed, draw a planting layout, move crops around, visualize companion planting placement, or check for enemy crop adjacency in a specific bed. Triggers include "layout editor", "bed grid", "draw the bed", "assign crops to cells", "companion warning in layout", or similar visual planning tasks.
Plan crop rotations, planting schedules, and companion planting for garden beds and fields. Use when asked to manage a farm, garden, or plot layout; schedule what to plant and when; check companion planting relationships; track rotation history; or generate a printable planting schedule. Triggers include "crop rotation", "planting schedule", "companion planting", "garden bed", "what to plant", "frost dates", or any task involving seasonal crop planning.
Log crop harvests with yield quantity, quality grade, field, and storage destination. Use when asked to record a harvest, check total yield for a crop or field, filter harvest history by date or grade, view analytics charts, or export harvest data. Triggers include "log harvest", "record yield", "harvest entry", "crop yield", "grade breakdown", "field yield", "harvest history", or any task involving tracking what was picked and where it went.
Query and interpret yield analytics data from harvest-logger. Use when asked about yield trends over time, comparing crop performance, finding the best-performing field, analyzing grade quality rates, running season comparisons, or generating data for external reports. Triggers include "yield trend", "top crops", "grade analysis", "field performance", "season comparison", "best yield", "harvest analytics", or any task requiring aggregated harvest data rather than individual entries.
Schedule and monitor irrigation zones with weather-aware skip rules and water usage tracking. Use when asked to manage irrigation timing, set up zone schedules, configure rain-based skip rules, check water usage, trigger manual watering, or apply seasonal duration presets. Triggers include "irrigation", "sprinkler schedule", "watering zones", "skip when raining", "water usage tracking", "manual run irrigation", or any task involving automated watering management.
Configure and troubleshoot weather-based irrigation skip rules using the Open-Meteo API. Use when asked to set up rain forecast skips, configure rain threshold values, debug why zones are or are not being skipped, check weather cache status, understand skip preview results, or tune skip rule sensitivity for your local climate. Triggers include "skip when rain", "weather threshold", "Open-Meteo", "skip preview", "rain forecast rule", "freeze protection", or any task involving weather-driven irrigation decisions.
| name | source-integrations |
| version | 1.0 |
| description | Set up and maintain GitHub OAuth2 and Slack Bot Token integrations for notification-hub. |
| tools | ["Bash","Read","Write","Edit"] |
This skill covers setting up the GitHub and Slack integrations from scratch, including creating the OAuth2 app, configuring credentials, and troubleshooting common sync failures.
notification-hub (or any name)http://localhost:3000http://localhost:3000/auth/github/callbackGITHUB_CLIENT_ID=Ov23liXXXXXXXXXX
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback
For production replace localhost:3000 with your public URL.
The flow is handled by src/integrations/github/oauth.ts. The strategy is registered at startup:
GET /auth/github - redirect to GitHub
GET /auth/github/callback - exchange code for token, store encrypted, redirect to /sources
The access token is encrypted with AES-256-GCM before writing to the sources.access_token_enc column:
NOTIFICATION_HUB_ENCRYPTION_KEY must be exactly 64 hex characters (32 bytes)
Generate a key:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
After connection, the poller in src/integrations/github/sync.ts runs on the SYNC_INTERVAL_MS schedule. It calls:
GET /notifications?all=false&participating=false&since=<last_sync>
Each notification is upserted into the notifications table using the GitHub id field as the external ID to prevent duplicates. Mute rules are evaluated at ingest time.
After OAuth, the user selects repos in the UI. Only notifications from those repos are stored. Update via API:
curl -X PATCH http://localhost:3000/api/sources/:id \
-H 'Content-Type: application/json' \
-d '{"config": {"repos": ["owner/repo1","owner/repo2"]}}'
Pass an empty array to watch all repos:
curl -X PATCH http://localhost:3000/api/sources/:id \
-H 'Content-Type: application/json' \
-d '{"config": {"repos": []}}'
| GitHub reason | Displayed as |
|---|---|
review_requested | PR review |
mention | Mention |
assign | Issue assignment |
ci_activity | CI status |
subscribed | Subscribed |
team_mention | Team mention |
Token expired or revoked
The source status will show error. Disconnect and reconnect via OAuth.
Rate limit hit
GitHub REST API allows 5000 requests/hour for authenticated users. The poller backs off automatically when the X-RateLimit-Remaining header is below 100.
Callback URL mismatch
If GitHub returns redirect_uri_mismatch, the GITHUB_CALLBACK_URL env var must exactly match the callback URL registered in the OAuth App settings.
notification-hub. Pick your workspace.channels:historychannels:readgroups:historygroups:readusers:readxoxb-...).SLACK_CLIENT_ID/SLACK_CLIENT_SECRET unless you want the full OAuth flow. For a single-workspace personal setup, only the bot token is required.In the notification-hub web UI:
xoxb-... token.auth.test to validate and fetch the workspace info.conversations.list.The token is stored encrypted at rest (same AES-256-GCM scheme as GitHub).
src/integrations/slack/sync.ts polls each watched channel using conversations.history with a oldest cursor equal to the last sync timestamp. New messages are stored as notifications. Direct mentions (<@UXXXXXXXX>) are given higher priority automatically.
# Get channel IDs
curl http://localhost:3000/api/sources/:id/channels
# Update watched channels (use Slack channel IDs, not names)
curl -X PATCH http://localhost:3000/api/sources/:id \
-H 'Content-Type: application/json' \
-d '{"config": {"channels": ["C012ABCDE","C999FGHIJ"]}}'
invalid_auth error
The token has been revoked or the app was uninstalled. Generate a new bot token in the Slack app settings and update via disconnect/reconnect.
not_in_channel error
The bot must be invited to private channels. In Slack: /invite @notification-hub in the channel.
Missing messages
conversations.history only returns messages from public channels and private channels where the bot is a member. Threads are fetched separately with conversations.replies if thread_ts is present.
Rate limits
Slack Tier 3 methods (conversations.history) allow ~50 requests/minute. The poller automatically adds delays between channel polls when multiple channels are watched.
If you need to rotate the NOTIFICATION_HUB_ENCRYPTION_KEY:
NOTIFICATION_HUB_ENCRYPTION_KEY_NEW.pnpm run migrate:rotate-keys
This re-encrypts all stored tokens with the new key. After the script completes, rename ENCRYPTION_KEY_NEW to ENCRYPTION_KEY and restart the server.
Use ngrok or a similar tunnel to expose localhost:3000 for OAuth callbacks during development:
ngrok http 3000
# Copy the https URL, e.g. https://abc123.ngrok.io
Set GITHUB_CALLBACK_URL=https://abc123.ngrok.io/auth/github/callback and update the GitHub OAuth App callback URL to match.