Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize 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".
.claude/skills/jeremylongshore-anima-cost-tuning/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -49% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -49% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -51% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -22% | 0% |
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.
infer consumption limits from the illustrative optimization table.
version, cache state, and duration without exposing design tokens or content.
owners so cached output cannot silently lag an approved design change.
| 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.
typescript// 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, }; } }
typescript// 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. |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→fail | 17,823 | 16,385 | -8% | 1 | 1 | 0% | 3,765 | 4,213 | +12% | 0 | 0 | — |
case-01 | fail→fail | 13,287 | 8,927 | -33% | 1 | 1 | 0% | 3,413 | 2,836 | -17% | 0 | 0 | — |
case-02 | fail→pass | 14,178 | 10,778 | -24% | 1 | 1 | 0% | 3,002 | 3,144 | +5% | 0 | 0 | — |
case-04 | pass→pass | 12,926 | 2,820 | -78% | 1 | 1 | 0% | 2,110 | 1,066 | -49% | 0 | 0 | — |
case-05 | fail→pass | 11,295 | 2,628 | -77% | 1 | 1 | 0% | 2,010 | 1,024 | -49% | 0 | 0 | — |
case-06 | fail→pass | 10,896 | 2,160 | -80% | 1 | 1 | 0% | 2,003 | 1,030 | -49% | 0 | 0 | — |
case-07 | fail→pass | 10,728 | 1,745 | -84% | 1 | 1 | 0% | 1,826 | 895 | -51% | 0 | 0 | — |
case-08 | fail→pass | 9,918 | 4,175 | -58% | 1 | 1 | 0% | 1,683 | 1,319 | -22% | 0 | 0 | — |
case-09 | pass→pass | 11,065 | 2,237 | -80% | 1 | 1 | 0% | 1,852 | 1,066 | -42% | 0 | 0 | — |
case-10 | fail→pass | 5,702 | 2,481 | -56% | 1 | 1 | 0% | 1,113 | 1,112 | -0% | 0 | 0 | — |
case-11 | fail→pass | 11,828 | 12,010 | +2% | 1 | 1 | 0% | 2,020 | 2,700 | +34% | 0 | 0 | — |
case-12 | fail→pass | 7,543 | 3,427 | -55% | 1 | 1 | 0% | 1,350 | 1,275 | -6% | 0 | 0 | — |
case-13 | fail→pass | 10,825 | 3,488 | -68% | 1 | 1 | 0% | 2,020 | 1,303 | -35% | 0 | 0 | — |
case-14 | fail→pass | 5,620 | 2,873 | -49% | 1 | 1 | 0% | 1,031 | 1,222 | +19% | 0 | 0 | — |
case-15 | fail→pass | 16,518 | 12,789 | -23% | 1 | 1 | 0% | 2,661 | 3,026 | +14% | 0 | 0 | — |
case-16 | fail→pass | 7,198 | 1,965 | -73% | 1 | 1 | 0% | 1,195 | 1,012 | -15% | 0 | 0 | — |
case-17 | fail→fail | 7,950 | 1,637 | -79% | 1 | 1 | 0% | 1,211 | 876 | -28% | 0 | 0 | — |
case-18 | fail→pass | 12,694 | 3,278 | -74% | 1 | 1 | 0% | 2,206 | 1,107 | -50% | 0 | 0 | — |
case-19 | fail→pass | 12,609 | 1,838 | -85% | 1 | 1 | 0% | 2,202 | 951 | -57% | 0 | 0 | — |
case-20 | pass→pass | 14,599 | 12,095 | -17% | 1 | 1 | 0% | 3,053 | 3,344 | +10% | 0 | 0 | — |
case-21 | pass→pass | 11,835 | 7,868 | -34% | 1 | 1 | 0% | 2,316 | 2,444 | +6% | 0 | 0 | — |
case-22 | pass→pass | 17,474 | 15,332 | -12% | 1 | 1 | 0% | 3,722 | 4,373 | +17% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +64 percentage points is the difference between those two pass rates over the 22 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v1, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.