/salesloft-pack:salesloft-reference-architecturefrom salesloft-pack
Production architecture for SalesLoft API integrations with typed client, service layer, webhook processing, and CRM sync patterns. Use when designing new SalesLoft integrations or reviewing project structure.
Ships in salesloft-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.
None: SKILL.md is the whole skill.
Production architecture for SalesLoft API integrations: typed API client, service layer with caching, webhook processor, and background sync. Designed around SalesLoft's REST API v2 with cost-based rate limiting.
salesloft-integration/
├── src/
│ ├── salesloft/
│ │ ├── client.ts # Axios wrapper with rate-limit handling
│ │ ├── types.ts # Person, Cadence, Activity types
│ │ ├── paginator.ts # AsyncGenerator pagination
│ │ └── errors.ts # SalesloftApiError class
│ ├── services/
│ │ ├── people-sync.ts # Bidirectional people sync
│ │ ├── cadence-manager.ts # Cadence CRUD + enrollment
│ │ └── activity-tracker.ts # Email/call activity aggregation
│ ├── webhooks/
│ │ ├── handler.ts # Signature verification + routing
│ │ └── processors/ # Per-event-type processors
│ ├── jobs/
│ │ ├── incremental-sync.ts # Cron: sync changed records
│ │ └── engagement-report.ts# Cron: aggregate daily metrics
│ └── api/
│ ├── health.ts # /health endpoint
│ └── webhooks.ts # /webhooks/salesloft endpoint
├── config/
│ ├── default.json
│ ├── production.json
│ └── test.json
└── tests/
├── unit/
└── integration/
┌─────────────────────────────────┐
│ API Layer │
│ /health /webhooks/salesloft │
├─────────────────────────────────┤
│ Service Layer │
│ PeopleSync CadenceManager │
│ ActivityTracker │
├─────────────────────────────────┤
│ SalesLoft Client │
│ Typed API Pagination Retry │
├─────────────────────────────────┤
│ Infrastructure │
│ Redis Cache BullMQ Jobs │
│ PostgreSQL Prometheus │
└─────────────────────────────────┘
│ ▲
▼ │
┌─────────────────────────────────┐
│ SalesLoft REST API v2 │
│ /people /cadences /webhooks │
│ Rate: 600 cost/min │
└─────────────────────────────────┘
// src/salesloft/types.ts
export interface SalesloftPerson {
id: number;
display_name: string;
email_address: string;
first_name: string;
last_name: string;
title: string | null;
company_name: string | null;
phone: string | null;
city: string | null;
state: string | null;
tags: string[];
created_at: string;
updated_at: string;
}
export interface SalesloftCadence {
id: number;
name: string;
current_state: 'draft' | 'active' | 'paused' | 'archived';
team_cadence: boolean;
counts: { people_count: number };
}
export interface SalesloftActivity {
id: number;
action_type: 'email' | 'phone' | 'other' | 'integration';
person_id: number;
cadence_id: number | null;
created_at: string;
}
// src/services/people-sync.ts
export class PeopleSyncService {
constructor(
private salesloft: SalesloftClient,
private db: Database,
private cache: LRUCache<string, any>,
) {}
async syncIncremental(): Promise<{ created: number; updated: number }> {
const lastSync = await this.db.getLastSyncTime('people');
const stats = { created: 0, updated: 0 };
for await (const person of this.salesloft.paginate<SalesloftPerson>(
'/people.json', { updated_at: { gt: lastSync } }
)) {
const existing = await this.db.findPersonBySlId(person.id);
if (existing) {
await this.db.updatePerson(person);
stats.updated++;
} else {
await this.db.createPerson(person);
stats.created++;
}
this.cache.delete(`person:${person.email_address}`);
}
await this.db.setLastSyncTime('people', new Date().toISOString());
return stats;
}
}
// src/jobs/incremental-sync.ts
import { CronJob } from 'cron';
new CronJob('*/5 * * * *', async () => { // Every 5 minutes
const service = new PeopleSyncService(salesloft, db, cache);
const stats = await service.syncIncremental();
console.log(`Sync: +${stats.created} created, ~${stats.updated} updated`);
}).start();
| Component | Failure Mode | Recovery |
|---|---|---|
| API Client | 429 rate limit | Automatic retry with Retry-After |
| Webhook Handler | Invalid signature | Reject 401, log for investigation |
| Sync Job | Partial failure | Resume from last successful updated_at |
| Cache | Redis unavailable | Fall through to API (graceful degradation) |
See individual skill docs for deep-dives on each component.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/salesloft-ci-integrationSet up CI/CD pipelines for SalesLoft integrations with GitHub Actions.
Use when automating SalesLoft integration tests, validating OAuth tokens,
or running cadence sync validation in CI.
Trigger: "salesloft CI", "salesloft GitHub Actions", "salesloft automated tests".
/salesloft-common-errorsDiagnose and fix SalesLoft API errors: 401, 403, 422, 429, and 5xx.
Use when encountering SalesLoft errors, debugging failed requests,
or troubleshooting OAuth token issues.
Trigger: "salesloft error", "fix salesloft", "salesloft not working", "salesloft 429".
/salesloft-npx claudepluginhub flight505/skill-forge --plugin salesloft-packOther plugins' skills for the same job