/intercom-pack:intercom-local-dev-loopfrom intercom-pack
Configures Intercom local development with testing, mocking, and hot reload for fast iteration against a dev workspace.
Ships in intercom-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Set up a fast local development workflow for Intercom integrations with proper test isolation, mocking strategies, and webhook tunneling. The loop has two lanes: a mocked unit lane that runs offline with no token, and an integration lane that talks to a real dev workspace and is skipped automatically when no token is present.
intercom-install-auth setupThe client authenticates with a single Intercom bearer access token, issued per
workspace by the intercom-install-auth step. Read it from
process.env.INTERCOM_ACCESS_TOKEN (loaded from git-ignored .env.development);
never hardcode it. The mocked unit lane needs no token at all — pointing the loop
at a different dev workspace is only a matter of swapping the .env.development
value.
Work through these steps to stand up the loop. The full, copy-paste-ready code for every step lives in the implementation walkthrough.
Scaffold the project structure — an src/intercom/ module (singleton
client.ts, plus contacts.ts / conversations.ts / types.ts), a tests/
tree with a mocks/ factory, and three env files (.env.example committed,
.env.development and .env.test git-ignored). Use Write to create each
file. See implementation.md.
Configure environments — commit .env.example as the template and keep
real tokens in the git-ignored .env.development. See
implementation.md.
Write an environment-aware client singleton that reads the token, throws a
clear error when it is missing, and exposes a resetClient() for tests. The
skeleton:
// src/intercom/client.ts
import { IntercomClient } from "intercom-client";
let instance: IntercomClient | null = null;
export function getClient(): IntercomClient {
if (!instance) {
const token = process.env.INTERCOM_ACCESS_TOKEN;
if (!token) {
throw new Error(
"INTERCOM_ACCESS_TOKEN not set. Copy .env.example to .env.development"
);
}
instance = new IntercomClient({ token });
}
return instance;
}
export function resetClient(): void {
instance = null;
}
Build a mock client factory (tests/mocks/intercom.ts) covering contacts,
conversations, messages, admins, and tags with vi.fn() resolved values, so
the unit lane never touches the network. Full factory in
implementation.md.
Write mocked unit tests against the factory, asserting call arguments and returned shapes. See implementation.md.
Tunnel webhooks with ngrok — run the local server, ngrok http 3000, and
register the HTTPS URL in Intercom Developer Hub. Use Bash(npx:*) for
ngrok. See implementation.md.
Wire package scripts (dev, test, test:watch, test:integration,
typecheck) — use Edit to add them to package.json, then drive the loop
with Bash(npm:*). See implementation.md.
Following this skill produces a working local Intercom development loop:
src/intercom/ client module and tests/ tree with a reusable
mock factory..env.example template plus git-ignored
.env.development / .env.test.npm run test / test:watch) that runs with
no token and no network.npm run test:integration) that is skipped
automatically when INTERCOM_ACCESS_TOKEN is absent.| Error | Cause | Solution |
|---|---|---|
INTERCOM_ACCESS_TOKEN not set | Missing .env file | Copy .env.example to .env.development |
| Port 3000 in use | Another process | lsof -i :3000 and kill, or change port |
| ngrok tunnel expired | Free tier 2h limit | Restart ngrok or use paid plan |
| Mock type mismatch | SDK updated | Regenerate mocks from SDK types |
rate_limit_exceeded in dev | Dev workspace limits | Add delays between integration tests |
A minimal mocked unit test (from implementation.md):
it("should create a user contact", async () => {
const contact = await mockClient.contacts.create({
role: "user",
externalId: "user-123",
email: "[email protected]",
});
expect(contact.id).toBe("mock-contact-id");
expect(mockClient.contacts.create).toHaveBeenCalledOnce();
});
For the token-gated integration test pattern (describe.skipIf, live create +
cleanup) and the commands that drive each lane, see
the examples reference.
intercom-sdk-patterns for production-ready code patterns.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin intercom-pack24 skills in this plugin
/intercom-ci-integrationConfigure CI/CD pipelines for Intercom integrations with GitHub Actions.
Use when setting up automated testing, configuring CI with Intercom secrets,
or integrating Intercom API tests into your build process.
Trigger with phrases like "intercom CI", "intercom GitHub Actions",
"intercom automated tests", "CI intercom", "intercom pipeline".
/intercom-common-errorsDiagnose and fix Intercom API errors by HTTP status code and error type.
Use when encountering Intercom errors, debugging failed API requests,
or troubleshooting integration issues.
Trigger with phrases like "intercom error", "fix intercom",
"intercom not working", "debug intercom", "intercom 401", "intercom 429".
/intercom-core-workflow-aManage Intercom contacts: create, search, update, merge leads into users.
Use when building contact management features, syncing user data, or implementing contact search and segmentation against the Intercom REST API.
Trigger with phrases like "intercom contacts", "intercom users", "intercom leads", "create intercom contact", "search intercom contacts", "merge intercom lead".
/intercom-core-workflow-bManage Intercom conversations: create, reply, close, snooze, assign, and tag.
Use when building conversation management features, automating replies,
or implementing support workflow automation.
Trigger with phrases like "intercom conversations", "intercom reply",
"intercom assign conversation", "intercom close conversation",
"intercom snooze", "manage intercom conversations".
/intercom-cost-tuningOptimize Intercom API costs through caching, request reduction, and usage monitoring.
Use when analyzing Intercom API usage, reducing unnecessary requests,
or implementing usage tracking and budget awareness.
Trigger with phrases like "intercom cost", "intercom billing",
"reduce intercom requests", "intercom pricing", "intercom usage", "intercom budget".
/intercom-data-handlingImplement Intercom data handling for GDPR, contact export, data retention, and PII.
Use when handling sensitive Intercom contact data, fulfilling a data subject access or deletion request, redacting PII in logs, or setting retention policy for cached Intercom records.
Trigger with phrases like "intercom data", "intercom PII",
"intercom GDPR", "intercom data retention", "intercom privacy", "intercom CCPA",
"intercom data export", "intercom delete contact".
Other plugins' skills for the same job