| name | anima-sdk-patterns |
| description | Apply production-ready patterns for the Anima SDK design-to-code pipeline.
Use when building reusable Anima client wrappers, implementing output caching,
or establishing team standards for design-to-code automation.
Trigger: "anima SDK patterns", "anima best practices", "anima code patterns".
|
| allowed-tools | Read, Write, Edit |
| version | 1.4.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","design","figma","anima","patterns"] |
| compatibility | Designed for Claude Code |
Anima SDK Patterns
Overview
Production patterns for @animaapp/anima-sdk: singleton client, generation caching, output normalization, and configurable settings presets.
Instructions
Step 1: Singleton Client with Configuration
import { Anima } from '@animaapp/anima-sdk';
let instance: Anima | null = null;
export function getAnimaClient(): Anima {
if (!instance) {
if (!process.env.ANIMA_TOKEN) throw new Error('ANIMA_TOKEN not set');
instance = new Anima({ auth: { token: process.env.ANIMA_TOKEN } });
}
return instance;
}
export const PRESETS = {
nextjs: { language: 'typescript' as const, framework: 'react' as const, styling: 'tailwind' as const, : },
: { : , : , : },
: { : , : , : },
: { : , : , : },
} ;