本文へ移動
cccskills
無料GitHub で公開

anima-cost-tuning

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 with: "anima cost", "anima pricing", "anima budget", "anima API usage".

インストール方法を見る

含まれるファイル(2)

  • SKILL.md5.6 KB
  • references/official-docs.md763 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Anima Cost Tuning

Overview

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.

Pricing Context

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.

Prerequisites

  • A current agreement or account report from the authorized Anima owner; do not infer consumption limits from the illustrative optimization table.
  • Aggregate generation telemetry that records file/node identifiers, generation version, cache state, and duration without exposing design tokens or content.
  • An explicit cache freshness and invalidation policy agreed by design and code owners so cached output cannot silently lag an approved design change.

Cost Optimization Strategies

StrategyMeasureGuardrail
Content-addressed reuseAvoided duplicate generationsBind source revision, node, SDK version, and settings
Incremental generationChanged versus unchanged nodesRegenerate when change state is unknown
Asset policyHosted versus external transferFollow security, retention, and licensing policy
Output reuseAccepted reusable componentsRevalidate after source or dependency changes

Authentication

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.

Instructions

Step 1: Usage Tracker

// 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,
    };
  }
}

Step 2: Smart Generation Policy

// 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;
}

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

  • Usage tracking with cache hit rate reporting
  • Smart generation policy reducing unnecessary API calls
  • A measured avoided-work report; monetary impact remains unclaimed without account data

Examples

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.

Error Handling

FailureResponse
Account limits or pricing data are unavailableMark projections as incomplete and obtain current data from the account owner.
Cache source version is unknownRefuse reuse and regenerate the approved affected component.
Generation rate spikes unexpectedlyPause noncritical jobs, inspect aggregate telemetry, and enforce the scheduling policy.
Output is stale after an approved design changeInvalidate the affected cache key and record the corrected generation receipt.

Resources

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Build a synthetic-data CI gate for customer-controlled Abridge integration code without calling undocumented vendor interfaces. Use when adding regression checks to an Abridge deployment repository. Trigger with "test the Abridge integration".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Triage Abridge recording, note-review, Epic handoff, and access failures from observed evidence without inventing vendor error codes. Use when an Abridge clinical workflow is degraded. Trigger with "diagnose this Abridge issue".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Design and verify the clinician workflow from consent through recording, draft review, Linked Evidence, and final note disposition. Use when implementing or auditing an Abridge clinical documentation pathway. Trigger with "map the Abridge note workflow".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Verify the approved handoff of clinician-reviewed Abridge note sections into Epic templates and downstream workflows. Use when configuring or auditing Abridge-to-Epic documentation flow. Trigger with "verify the Abridge Epic handoff".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Evaluate Abridge adoption, workflow value, and avoidable operational friction without inventing prices or vendor billing meters. Use when reviewing an Abridge rollout or renewal. Trigger with "analyze Abridge value".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Produce a PHI-minimized Abridge support bundle with provenance, redaction, and protected escalation boundaries. Use when support needs reproducible evidence for an Abridge issue. Trigger with "build an Abridge debug bundle".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

jeremylongshore のスキルをすべて見る

このスキルの問題を報告する