Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

ai-cost-optimizerAI 成本优化器

Agent Skill

ai-cost-optimizer 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

552

周安装

23

GitHub Stars

9

下载量

184
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ai-cost-optimizer(AI 成本优化器)
来源仓库:https://github.com/yuniorglez/gemini-elite-core
仓库路径:skills/ai-cost-optimizer
安装命令:
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill ai-cost-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill ai-cost-optimizer

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 安装命令:npx skills add https://github.com/yuniorglez/gemini-elite-core --skill ai-cost-optimizer。
  • 使用前建议确认权限范围和是否会触发文件读写或命令执行。
  • 可参考来源仓库 README 了解具体操作流程和限制。

SKILL.md

Skill: AI Cost Optimizer (Standard 2026)

Role: The AI Cost Optimizer is a specialized "Token Economist" responsible for maximizing the reasoning output of AI agents while minimizing the operational expense. In 2026, this role masters the pricing tiers of Gemini 3 Flash and Lite models, implementing "Thinking-Level" routing and multi-layered caching to achieve up to 90% cost reduction on high-volume apps.

🎯 Primary Objectives

  1. Economic Orchestration: Dynamically routing prompts between Gemini 3 Pro, Flash, and Lite based on complexity.
  2. Context Caching Mastery: Implementing implicit and explicit caching for system instructions and long documents (v1.35.0+).
  3. Token Engineering: Reducing "Noise tokens" through XML-tagging and strict response schemas.
  4. Usage Governance: Implementing granular quotas and attribution to prevent runaway API billing.

🏗️ The 2026 Economic Stack

1. Target Models

  • Gemini 3 Pro: Reserved for "Mission Critical" reasoning and deep architecture mapping.
  • Gemini 3 Flash-Preview: The "Workhorse" for most coding and extraction tasks ($0.50/1M input).
  • Gemini Flash-Lite-Latest: The "Utility" agent for real-time validation and short-burst responses.

2. Optimization Tools

  • Google GenAI Context Caching: Reducing input fees for stable context blocks.
  • Thinking Level Param: Controlling reasoning depth for cost/latency trade-offs.
  • Prompt Registry: Deduplicating and optimizing recurring system instructions.

🛠️ Implementation Patterns

1. The "Thinking Level" Router

Adjusting the model's internal reasoning effort based on the task type.

// 2026 Pattern: Cost-Aware Generation
const model = genAI.getGenerativeModel({
  model: "gemini-3-flash",
  generationConfig: {
    thinkingLevel: taskComplexity === 'high' ? 'standard' : 'low',
    responseMimeType: "application/json",
  }
});

2. Explicit Context Caching (v1.35.0+)

Crucial for large codebases or stable documentation.

// Squaads Standard: 1M+ token repository caching
const codebaseCache = await cacheManager.create({
  model: "gemini-flash-lite-latest",
  contents: [{ role: "user", parts: [{ text: fullRepoData }] }],
  ttlSeconds: 86400, // Cache for 24 hours
});

// Subsequent calls use cachedContent to avoid full re-billing
const result = await model.generateContent({
  cachedContent: codebaseCache.name,
  contents: [{ role: "user", parts: [{ text: "Explain the auth flow." }] }],
});

3. XML System Instruction Packing

Using XML tags to reduce instruction drift and token wastage in multi-turn chats.

<system_instruction>
  <role>Senior Architect</role>
  <constraints>No legacy PHP, use Property Hooks</constraints>
</system_instruction>

🚫 The "Do Not List" (Anti-Patterns)

  1. NEVER send a full codebase in every prompt. Use Repomix for pruning and Context Caching for reuse.
  2. NEVER use high-resolution video frames (280 tokens) for tasks that only need low-res (70 tokens).
  3. NEVER default to Gemini 3 Pro. Always start with Flash-Lite and escalate only if validation fails.
  4. NEVER allow agents to run in an infinite loop without a "Kill Switch" based on token accumulation.

🛠️ Troubleshooting & Usage Audit

IssueLikely Cause2026 Corrective Action
Billing SpikesUnoptimized multimodal inputDownsample images/video before sending to the model.
Low Quality (Lite)Insufficient reasoning depthSwitch thinkingLevel to standard or route to Flash-Preview.
Cache MissesContext drift in dynamic filesIsolate stable imports/types from volatile business logic.
HallucinationInstruction drift in long contextUse <system> tags and explicit "Do Not" lists.

📚 Reference Library


📊 Economic Metrics

  • Cost per Feature: < $0.05 (Target for Squaads agents).
  • Token Efficiency: > 80% (Knowledge vs Boilerplate).
  • Cache Hit Rate: > 75% for codebase queries.

🔄 Evolution of AI Pricing

  • 2023: Fixed per-token pricing (Prohibitive for large context).
  • 2024: First-gen Context Caching (Pro-only).
  • 2025-2026: Ubiquitous Caching and "Reasoning-on-Demand" (Thinking Level parameters).

End of AI Cost Optimizer Standard (v1.1.0)

*Updated: January 22, 2026 - 23:45*

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.9%
按下载量换算72

Claude

29.77%
按下载量换算55

Cursor

17.83%
按下载量换算33

Gemini CLI

9.86%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills