/anima-pack:anima-rate-limitsfrom anima-pack
Implements rate limiting for Anima API code generation requests using Bottleneck, with batch generation and 429 retry handling.
Ships in anima-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.
Anima API has per-minute rate limits on code generation. Each generateCode call processes one Figma node through AI — it's compute-intensive and rate-limited accordingly.
| Tier | Generations/min | Concurrent | Notes |
|---|---|---|---|
| Partner (standard) | 10 | 2 | Most common |
| Enterprise | 30 | 5 | Custom agreement |
// src/anima/throttled-generator.ts
import Bottleneck from 'bottleneck';
import { Anima } from '@animaapp/anima-sdk';
const limiter = new Bottleneck({
maxConcurrent: 2,
minTime: 6000, // 10 per minute = 1 every 6 seconds
reservoir: 10,
reservoirRefreshInterval: 60000,
reservoirRefreshAmount: 10,
});
const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });
async function throttledGenerate(params: any) {
return limiter.schedule(() => anima.generateCode(params));
}
// Batch generate with automatic throttling
async function batchGenerate(nodeIds: string[], settings: any) {
const results = [];
for (const nodeId of nodeIds) {
const result = await throttledGenerate({
fileKey: process.env.FIGMA_FILE_KEY!,
figmaToken: process.env.FIGMA_TOKEN!,
nodesId: [nodeId],
settings,
});
results.push({ nodeId, files: result.files });
console.log(`Generated ${nodeId}: ${result.files.length} files`);
}
return results;
}
export { throttledGenerate, batchGenerate };
async function generateWithRetry(anima: Anima, params: any, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
return await anima.generateCode(params);
} catch (err: any) {
if (err.response?.status !== 429 || attempt === maxRetries) throw err;
const wait = Math.min(60000, 10000 * attempt); // Wait up to 60s
console.log(`Rate limited — waiting ${wait / 1000}s`);
await new Promise(r => setTimeout(r, wait));
}
}
}
For security practices, see anima-security-basics.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/anima-ci-integrationConfigure CI/CD pipeline for automated Figma-to-code generation with Anima.
Use when automating design-to-code in GitHub Actions, setting up PR-based
component generation, or integrating Anima into design handoff workflows.
Trigger: "anima CI", "anima GitHub Actions", "anima automated generation".
/anima-common-errorsDiagnose and fix common Anima SDK design-to-code errors.
Use when encountering Figma token errors, code generation failures,
node not found issues, or output quality problems.
Trigger: "anima error", "anima not working", "anima debug", "figma to code error".
/anima-core-workflow-aBuild automated Figma-to-React pipeline with the Anima SDK.
Use when automating design handoff, building CI/CD design-to-code workflows,
or creating a design system code generator from Figma components.
Trigger: "anima design pipeline", "figma to react pipeline",
"automated design handoff", "anima component generator".
/anima-core-workflow-bClone websites to React/HTML code and customize Anima output with AI.
Use when converting live websites to code, customizing generated components,
or building design-system-aware code from URL screenshots.
Trigger: "anima website to code", "anima URL clone", "anima AI customization",
"website to react", "clone website to code".
/anima-cost-tuningOptimize Anima API costs through caching, incremental generation, and tier selection.
Use when managing Anima API usage, reducing unnecessary code generations,
or right-sizing your Anima plan for team size.
Trigger: "anima cost", "anima pricing", "anima budget", "anima API usage".
/anima-debug-bundleCollect Anima SDK debug evidence for support tickets and troubleshooting.
Use when filing Anima support requests, debugging code generation issues,
or collecting diagnostic data for the Anima team.
Trigger: "anima debug bundle", "anima support ticket", "anima diagnostics".
npx claudepluginhub flight505/skill-forge --plugin anima-packOther plugins' skills for the same job