Agent skill · software engineering · jeremylongshore
klaviyo-reference-architecture
Implement Klaviyo reference architecture with best-practice project
Why this skill is useful
Provides a structured project layout and specific implementation patterns for Klaviyo integrations that the AI wouldn't reliably generate on its own.
What it needs
Requires redis, typescript installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Klaviyo Reference Architecture Overview Production-ready architecture for Klaviyo integrations: a layered project structure, service patterns, event-driven sync, and the klaviyo-api SDK wired into a real application. SKILL.md gives you the four-layer contract and the skeleton you scaffold from; the deep material lives in references/ so you pull code only when you reach that layer. Layout & layering (full directory tree, layer contract, data flow): architecture.md Working code for every layer (config, profile sync, event tracker): implementation.md Prerequisites TypeScript project with klaviyo-api installed Understanding of layered architecture Redis (for caching/queuing) and database (for audit/sync state) Instructions Use Write to scaffold the directory tree, then fill each layer bottom-up. The four layers and their one-way call rule: 1. Scaffold the tree. Create the src/{klaviyo,services,webhooks,jobs,middleware,config,health} layout. Full annotated tree: architecture.md. 2. Config layer first. A single loadConfig() returns environment-specific keys, rate limits, and cache TTLs — every other layer reads from it. Code: implementation.md Step 1. 3. Service layer. Build ProfileSyncService (bidirectional upsert) and EventTracker (server-side Placed Order / custom events). Both route Klaviyo calls through withRateLimitRetry. Code: implementation.md Steps 2–3. 4. Wire the data flow. Signup → syncToKlaviyo(), purchase → trackPurchase(), inbound profile.updated webhook → WebhookRouter.routeEvent() → local DB. Diagram: architecture.md. When reviewing an existing project, Read its src/ tree and Grep for cross-layer imports that break the one-way rule (SDK importing a service, a route importing the SDK directly). Output Applying this skill produces: A scaffolded src/ tree matching the four-layer contract, with SDK, service, webhook, job, middleware, config, and health directories. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/klaviyo-reference-architecture