skills/setting-up-support-slack-locally/SKILL.md
Connect a real Slack workspace to local PostHog Conversations (the SupportHog Slack app) so Slack messages become support tickets and replies post back. Use when the user wants to test the conversations Slack integration locally, hits "Support Slack OAuth client ID is not configured", gets a white screen or "Network error" on the OAuth callback, or asks how to set SUPPORT_SLACK_APP_CLIENT_ID / a tunnel for supporthog Slack events. Covers the Slack app + scopes, the SUPPORT_SLACK_* dynamic settings, and the key split: localhost for OAuth and the UI, a public tunnel only for inbound events.
npx skillsauth add posthog/ai-plugin setting-up-support-slack-locallyInstall 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.
Slack is SaaS-only, so "local" means a throwaway Slack workspace + app whose OAuth and events reach your laptop. The job has one non-obvious idea that avoids almost every wall: the OAuth connect and the event webhook have opposite reachability needs, so you point them at different places.
localhost is reachable.
No tunnel needed.localhost, so this one needs a public tunnel.Keep the whole app and the OAuth flow on localhost, and point only Event Subscriptions (and Interactivity)
at the tunnel. This also sidesteps free-tier tunnel rate limits, since the tunnel then carries only Slack's
low-volume event POSTs rather than the entire SPA.
This is the conversations/SupportHog variant of the general
Slack local setup guide; that guide covers the
PostHog Desktop / notifications Slack app (SLACK_APP_*, /integrations/slack/callback). Conversations uses
its own SUPPORT_SLACK_* credentials and /api/conversations/v1/slack/* routes, but the tunnel and
SITE_URL mechanics are identical.
All under products/conversations/backend/api/urls.py, prefixed /api/conversations/:
| Route | Purpose | Reachability |
| ------------------------ | ------------------------------------------------------------- | ------------------------ |
| v1/slack/authorize | returns the Slack OAuth URL (auth-gated) | browser (localhost) |
| v1/slack/callback | OAuth redirect target; built from SITE_URL, no forced https | browser (localhost) |
| v1/slack/events | inbound event webhook | Slack's servers (tunnel) |
| v1/slack/interactivity | interactive component callbacks | Slack's servers (tunnel) |
The callback requires an authenticated session on whatever origin SITE_URL resolves to, because the
session cookie is per-origin. Keep SITE_URL on localhost and log in there, and the callback keeps your
session.
SUPPORT_SLACK_APP_CLIENT_ID, SUPPORT_SLACK_APP_CLIENT_SECRET, and SUPPORT_SLACK_SIGNING_SECRET are
django-constance dynamic settings (posthog/settings/dynamic_settings.py) that default to the matching env
var. Empty client id is what produces "Support Slack OAuth client ID is not configured". Put your Slack
app's values in .env.local (gitignored) and restart the backend:
SUPPORT_SLACK_APP_CLIENT_ID=<client id>
SUPPORT_SLACK_APP_CLIENT_SECRET=<client secret>
SUPPORT_SLACK_SIGNING_SECRET=<signing secret>
Constance stores values in the DB, and a stored value overrides the env default. If it still reads as
unconfigured after a restart, check /admin/constance/config/ for a blank stored value and set it there
instead.
At api.slack.com/apps, create an app in a throwaway workspace, then:
SUPPORTHOG_SLACK_SCOPE in
products/conversations/backend/api/slack_oauth.py): channels:history, channels:read, chat:write,
chat:write.customize, groups:history, groups:read, reactions:read, users:read,
users:read.email.http://localhost:8010/api/conversations/v1/slack/callback
and Save. If Slack refuses a plain-http localhost URL, use the tunnel URL for the callback too and log in
once on the tunnel origin (see references/troubleshooting.md)..env.local (Step 1).Run any HTTPS tunnel pointed at Caddy on 8010, rewriting the upstream Host header to localhost (the
dev Caddy only answers for the localhost host; without the rewrite you get an empty 200 and a white page):
ngrok http --host-header=localhost 8010
# or, free with no rate limit:
cloudflared tunnel --url http://localhost:8010 --http-host-header localhost
Verify it reaches Django, not just Caddy:
curl -sS https://<tunnel-host>/_preflight | head -c 120 # want JSON, server: granian
Then in the Slack app set Event Subscriptions → Request URL (and Interactivity → Request URL if
testing buttons) to https://<tunnel-host>/api/conversations/v1/slack/events (and .../interactivity).
Slack sends a synchronous url_verification challenge on save, so the backend must be up; the handler
echoes it back automatically.
The Request URL alone only passes verification; it delivers nothing until you subscribe to events. Under
Event Subscriptions → Subscribe to bot events, add the events the backend handles (SUPPORT_EVENT_TYPES
in products/conversations/backend/api/slack_events.py):
app_mentionmessage.channels (and message.groups for private channels), both arriving as the inner message eventreaction_addedmember_joined_channel, member_left_channelReinstall the app after changing scopes/events so the new grants take effect.
Browse the app at http://localhost:8010, log in, go to Support settings, and connect Slack. The OAuth
round-trip completes on localhost. Then invite the bot to a channel in your dev workspace and post a
message; it should arrive as a ticket, and a reply from the ticket should post back to the thread.
For the failure modes worth recognizing (white screen, "Network error", redirect mismatch, region routing), see references/troubleshooting.md.
data-ai
Signals scout for PostHog Tasks, the agent work items a project runs. Two lenses: delivery health (runs failing, clustered by repository and error class, and retry storms) every run, and on a slower rotation demand (recurring asks across human-authored tasks that point at a product gap). Skips the scout fleet's own run rows.
devops
Signals scout for the PostHog Conversations (support inbox) product. Watches the `$conversation_*` ticket-lifecycle events for support-delivery regressions — SLA breach-rate steps, first-response latency blowouts, backlog inflow-vs-resolution imbalance, and channel / assignment concentration — and files each dated regression as a report. Complements the per-ticket product-feedback signals the emission pipeline already fires; does not re-surface individual ticket content.
development
Populates and maintains a project's data catalog (semantic layer): canonical metrics, trust marks (certifications) on warehouse tables/views, and reviewed table relationships. Use when asked to set up / seed / bootstrap the data catalog or semantic layer, to catalog a project's metrics, to certify or deprecate data sources, to propose or review table joins, or to work through the proposal review queue. To *use* an existing catalog to answer a business-number question, see querying-posthog-data instead. Trigger terms: data catalog, semantic layer, canonical metric, certify table, deprecate source, relationship proposal, metric drift, review queue.
tools
Investigate logs in a PostHog project: verify a service or deployment is healthy, explain an error spike, triage an incident, or understand what a log stream is saying. Use when the user asks to "check the logs", asks whether a service, deploy, release, or change is working or broke anything, asks why errors are up or what changed, or wants the root cause of failures visible in logs. Routes the logs MCP tools (services overview, pattern mining, before/after pattern diffing, bucketed counts, facets, raw rows) so investigations start from summaries instead of raw rows or hand-written SQL over the logs table.