Skip to content
cccskills
FreePublished on GitHub

anima-rate-limits

Manage rate limits when generating code from Figma designs with Anima. Set bounded waits and retries, track successful and failed nodes, and resume only the failed work, using the account’s documented quota instead of assumed limits.

OriginalShow the original description

Implement rate limiting for Anima API code generation requests. Use when batching component generation, handling rate limit errors, or optimizing API throughput for large design systems. Trigger with: "anima rate limit", "anima throttling", "anima batch generation".

Works withFigma

Run score Not tested

See how to install

Good for

  • Batch code generation for design components
  • Handle Figma rate limit responses
  • Resume only failed generation items

Files included (2)

  • SKILL.md6.2 KB
  • references/official-docs.md793 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Anima Rate Limits

Overview

Handle Figma rate limits from the current SDK's structured callback and treat any Anima generation quota as account-specific until the provider or agreement says otherwise. Never encode an invented requests-per-minute or concurrency allowance.

Documented Signals

SurfaceSignalRequired action
FigmaRestApi.onRateLimitedretryAfter, figmaPlanTier, figmaRateLimitTypeRetry only inside a bounded elapsed-time budget
figmaRateLimitMaxWait1–180 seconds; default 60Set explicitly for the request's latency budget
Anima generationReturned error/progress state and account contractStop or queue; do not infer a numeric quota

Prerequisites

  • Confirm the account's current generation and concurrency contract before choosing worker concurrency; absence of a published number means fail closed, not guess.
  • Store ANIMA_TOKEN, FIGMA_TOKEN, and FIGMA_FILE_KEY in the runtime secret manager or injected environment, and verify that the token has only the scopes required for the selected file. Never put tokens in source, fixtures, logs, generated receipts, or retry payloads.
  • Define an explicit allowlist of Figma files and node IDs, a bounded batch size, a maximum retry budget, and an approved output directory. Use synthetic or sandbox designs for load tests and confirm that generated output contains no customer data before persisting it.
  • Install the pinned SDK and decide whether a generation is safe to repeat. Persist a redacted request fingerprint and resume only failed node IDs.

Instructions

Step 1: Configure Structured Figma Rate Handling

// src/anima/client.ts
import { Anima, FigmaRestApi } from '@animaapp/anima-sdk';

const figmaRestApi = new FigmaRestApi({
  defaultOptions: {
    token: process.env.FIGMA_TOKEN!,
    onRateLimited: async ({ retryAfter, figmaPlanTier, figmaRateLimitType }) => {
      console.warn({ retryAfter, figmaPlanTier, figmaRateLimitType });
      return retryAfter > 0 && retryAfter <= 5; // Repository latency budget.
    },
  },
});

export const anima = new Anima({
  auth: { token: process.env.ANIMA_TOKEN! },
  figmaRestApi,
});

Step 2: Bind Each Generation to a Maximum Wait

const result = await anima.generateCode({
  fileKey: process.env.FIGMA_FILE_KEY!,
  nodesId: ['1:2'],
  figmaRateLimitMaxWait: 5,
  settings: { framework: 'react', language: 'typescript', styling: 'tailwind' },
});
console.log({ fileCount: Object.keys(result.files).length, sessionId: result.sessionId });

Error Handling

  • Let FigmaRestApi own Figma retry decisions. Do not add a second uncoordinated retry loop around the same request.
  • Do not retry 401/403 authentication or permission failures, invalid node/file parameters, or policy rejections. Stop the batch, report the node ID and redacted status, and repair credentials or scope before resuming.
  • Retry only bounded transient 5xx and network failures. Cap attempts and total elapsed time, cancel queued work after the budget is exhausted, and preserve the successful results separately from failed node IDs so a resume cannot regenerate the whole batch accidentally.
  • Treat timeout, process restart, and partial writes as ambiguous outcomes: check the request fingerprint or cache before resubmitting, write output atomically, and quarantine incomplete files. Logs and receipts may contain counts, status classes, and hashes, but not tokens, design contents, user identifiers, or generated source.
  • Alert when the observed rate, queue depth, quota remaining, or failure ratio crosses the configured threshold. A human must approve any change to concurrency or quota settings; rollback means restoring the last known-good limiter configuration and draining queued work.

Examples

For a sandbox batch, keep the work bounded and make the outcome auditable without exposing design data:

const nodeIds = ['synthetic-card', 'synthetic-button'];
const receipt = {
  batchId: 'sandbox-2026-01-15-a',
  requested: nodeIds.length,
  succeeded: 0,
  failed: 0,
  contactsExported: 0,
};

for (const nodeId of nodeIds) {
  try {
    await anima.generateCode({ fileKey: process.env.FIGMA_FILE_KEY!, nodesId: [nodeId], figmaRateLimitMaxWait: 5, settings });
    receipt.succeeded++;
  } catch (error) {
    receipt.failed++;
    // Store only a redacted status and node fingerprint; never serialize `error` or source.
  }
}
console.log(JSON.stringify({ ...receipt, tokenPresent: Boolean(process.env.ANIMA_TOKEN) }));

An acceptable completion receipt is requested=2; succeeded=2; failed=0; contacts_exported=0 with the sandbox ID and limiter settings recorded separately. A production batch should use the same controls, a reviewed allowlist, and an owner-approved change record before increasing concurrency.

Tool Discipline

Use Read and Grep to inspect the existing integration and generated diff before changing anything. Use Write or Edit only inside the approved generated-code, test, or configuration paths. Use the declared Bash commands only for the explicit install, validation, or diagnostic steps in this workflow; never print tokens, source designs, generated source, or private website captures.

Output

  • Bottleneck-throttled code generation matching API limits
  • Batch generator for design system-scale operations
  • 429 retry handler with progressive backoff

Resources

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Add a synthetic-data CI gate for customer-owned Abridge integration code. Test consent handling, note-review handoffs, redaction, and rollback behavior with mocked vendor boundaries, without connecting CI to a live Abridge or EHR tenant.

  • Adding regression checks to an Abridge integration repository
  • Testing consent and note-release handling
  • Checking logs for sensitive data exposure
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

Triage Abridge recording, note review, Epic handoff, and access problems using observed symptoms and approved guidance. Identify the affected workflow stage, organize a minimal timeline, and prepare a redacted escalation record for the responsible team.

  • Separate recording problems from upload failures
  • Investigate note creation delays and editor issues
  • Identify the responsible team for Epic handoff failures
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

Map and review an Abridge clinical documentation workflow from consent and recording through draft review, evidence checks, edits, and final disposition. Keep clinician approval explicit, identify failure exits, and separate verified facts from tenant-specific details and pending approvals.

  • Map a clinical note workflow for a care setting
  • Check where consent and patient identity are verified
  • Review draft notes against linked evidence before sign-off
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

Audit how clinician-reviewed Abridge note sections map into Epic templates and downstream workflows. Use approved test records to document destinations, exceptions, evidence, rollback steps, and a go or no-go decision for a specific environment.

  • Checking Abridge note section mappings to Epic templates
  • Auditing a department’s approved documentation handoff
  • Preparing test evidence and a go or no-go decision
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

Review Abridge adoption and workflow value using local usage records, clinician feedback, and verified contract costs. Build an evidence based decision table covering adoption, quality, support burden, and options to expand, hold, or improve the rollout.

  • Reviewing adoption after an Abridge rollout
  • Preparing evidence for a renewal decision
  • Comparing workflow outcomes across care settings
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

Prepare a bounded support bundle for an Abridge issue using allowlisted operational details such as versions, coarse timestamps, and correlation references. Exclude recordings, transcripts, patient identifiers, credentials, and unrestricted logs, then document redactions and review details.

  • Preparing reviewed evidence for an Abridge support case
  • Documenting redactions and excluded data
  • Collecting approved operational details for an incident
jeremylongshore/tons-of-skills-marketplace2.9KUpdated Oct 23, 2026

See all skills by jeremylongshore

Report a problem with this skill