/anima-pack:anima-cost-tuning [usage-report-or-policy]from anima-pack
Optimize Anima API costs through caching, incremental generation, and tier selection. Helps reduce unnecessary code generations and right-size Anima plans.
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.
Read when SKILL.md points to them.
Optimize design-to-code generation by measuring approved usage, avoiding duplicate work, and retaining only reusable outputs. Treat cost projections as planning inputs until the account owner confirms current contractual terms.
Do not infer price units from the SDK or marketing site. Obtain the current account agreement or usage report from the authorized owner and label every projection with its source date, currency, unit, and included allowance.
| Strategy | Measure | Guardrail |
|---|---|---|
| Content-addressed reuse | Avoided duplicate generations | Bind source revision, node, SDK version, and settings |
| Incremental generation | Changed versus unchanged nodes | Regenerate when change state is unknown |
| Asset policy | Hosted versus external transfer | Follow security, retention, and licensing policy |
| Output reuse | Accepted reusable components | Revalidate after source or dependency changes |
Read usage only through the account owner's authorized report or integration. Keep Anima and Figma credentials in the backend secret manager and aggregate telemetry before analysis so this workflow never receives token or design data.
// src/cost/usage-tracker.ts
interface GenerationRecord {
timestamp: string;
fileKey: string;
nodeId: string;
cached: boolean;
durationMs: number;
}
class AnimaUsageTracker {
private records: GenerationRecord[] = [];
record(entry: GenerationRecord): void { this.records.push(entry); }
getReport(): { total: number; cached: number; cacheHitRate: number | null } {
const total = this.records.length;
const cached = this.records.filter(r => r.cached).length;
return {
total,
cached,
cacheHitRate: total > 0 ? cached / total : null,
};
}
}
// Only generate when:
// 1. Figma file version changed (check via Figma API)
// 2. The repository's reviewed cache-retention policy requires refresh
// 3. Settings changed (new framework/styling)
// 4. Force flag passed (manual override)
async function shouldGenerate(
fileKey: string,
nodeId: string,
cache: any,
): Promise<boolean> {
// Check cache first
const cached = cache.get(fileKey, nodeId);
if (cached && cached.sourceRevision === cache.currentSourceRevision(fileKey)) {
console.log('Using source- and settings-bound cached generation');
return false;
}
return true;
}
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.
For a weekly design-system sync, record aggregate generation counts for the approved component registry, then compare an uncached baseline with the smart generation policy. Regenerate only components whose Figma version or generation settings changed, and attach the source-version and cache decision to the PR. If the current usage report is incomplete, a cache cannot identify its source version, or a design owner requests an immediate change, bypass the cache only with an explicit force record and regenerate the affected component—not the entire design file by default.
| Failure | Response |
|---|---|
| Account limits or pricing data are unavailable | Mark projections as incomplete and obtain current data from the account owner. |
| Cache source version is unknown | Refuse reuse and regenerate the approved affected component. |
| Generation rate spikes unexpectedly | Pause noncritical jobs, inspect aggregate telemetry, and enforce the scheduling policy. |
| Output is stale after an approved design change | Invalidate the affected cache key and record the corrected generation receipt. |
What SKILL.md sets; muted values are Claude Code's defaults
inherithighThree short reads, in order
anima, cost-optimization, api-costs, caching, design-to-code
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 with: "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 with: "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 with: "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 with: "anima website to code", "anima URL clone", "anima AI customization",
"website to react", "clone website to code".
/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 with: "anima debug bundle", "anima support ticket", "anima diagnostics".
/anima-deploy-integrationDeploy Anima design-to-code service as a backend API endpoint.
Use when building a design-to-code microservice, deploying Anima SDK
as a serverless function, or creating an internal design tool API.
Trigger with: "deploy anima", "anima service deploy", "anima serverless".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin anima-packOther plugins' skills for the same job