Token导航 LogoToken导航TokenDH.com
AI 工具只读github未标认证来源可访问clear审计通过

aeo-cost-governorAEO 成本调节器

Agent Skill

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

总安装

326

周安装

14

GitHub Stars

公开资料未说明

下载量

114
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ivzc07/aeo-skills --skill aeo-cost-governor

简介

AEO 成本调节器用于跟踪 token 使用并执行预算限制,适合对成本控制有要求的项目。

  • 适用于需要监控 AI 任务成本、设置预算阈值和防止超额支出的场景。
  • 通过配置文件设定每日和单任务预算,自动追踪输入输出 token 消耗。
  • 安装前需确认配置权限和维护状态,注意可能触发联网和文件读写操作。
  • aeo-cost-governor 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

AEO Cost Governor

Purpose: Track token usage and enforce budget limits. Optional skill for cost-conscious projects.

Configuration

Create budget config at $PAI_DIR/USER/aeo-budget.json:

{
  "daily_budget_usd": 10.00,
  "per_task_budget_usd": 2.00,
  "alert_threshold_percent": 80,
  "hard_limit_percent": 100,
  "enable_tracking": true
}

Defaults (if no config):

  • Daily budget: $10.00
  • Per-task budget: $2.00
  • Alert at: 80%
  • Hard limit: 100%

Model Pricing (per 1M tokens)

Claude Models (Jan 2025):

  • Claude Opus 4: Input $15.00, Output $75.00
  • Claude Sonnet 4.5: Input $3.00, Output $15.00
  • Claude Haiku 4: Input $0.80, Output $4.00

Cost Calculation Formula:

cost_usd = (input_tokens / 1_000_000 * input_price) + (output_tokens / 1_000_000 * output_price)

When to Track

Track costs during:

  • Tool execution (PreToolUse hook)
  • Task completion
  • Session end

Cost Tracking

Per-Task Tracking

When a task starts:

# Initialize task cost tracking
echo '{
  "task_id": "unique-id",
  "task_description": "Add user authentication",
  "start_time": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
  "model": "claude-sonnet-4.5",
  "budget_usd": 2.00,
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "cost_usd": 0.00
  }
}' > ~/.claude/MEMORY/aeo-task-cost.json

After each tool use:

# Update task cost
# (Read existing, add new usage, write back)
jq '.usage.cost_usd += 0.15' ~/.claude/MEMORY/aeo-task-cost.json > /tmp/cost.json
mv /tmp/cost.json ~/.claude/MEMORY/aeo-task-cost.json

Daily Tracking

Append to daily log:

echo '{
  "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
  "date": "$(date -u +%Y-%m-%d)",
  "task_id": "unique-id",
  "model": "claude-sonnet-4.5",
  "input_tokens": 1250,
  "output_tokens": 850,
  "cost_usd": 0.15
}' >> ~/.claude/MEMORY/aeo-costs.jsonl

Budget Checks

Check Before Task

# Get today's total cost
today_total=$(jq -s "map(select(.date == \"$(date -u +%Y-%m-%d)\")) | map(.cost_usd) | add" \
  ~/.claude/MEMORY/aeo-costs.jsonl)

# Get budget
budget=$(jq '.daily_budget_usd' ~/.claude/USER/aeo-budget.json)

# Calculate percentage
percent=$(echo "$today_total / $budget * 100" | bc)

# Check if over limit
if (( $(echo "$percent >= 100" | bc -l) )); then
  echo "❌ BUDGET EXCEEDED - $today_total spent of $budget"
  exit 1
fi

Check During Task

After each operation:

# Read task cost
task_cost=$(jq '.usage.cost_usd' ~/.claude/MEMORY/aeo-task-cost.json)
task_budget=$(jq '.per_task_budget_usd' ~/.claude/USER/aeo-budget.json)

# Check if over task budget
if (( $(echo "$task_cost > $task_budget" | bc -l) )); then
  echo "⚠️ TASK BUDGET EXCEEDED - $task_cost spent of $task_budget"
  # Invoke aeo-escalation
fi

Alerts

Warning Alert (80%)

⚠️ COST ALERT - 80% BUDGET CONSUMED

Daily Budget: $10.00
Used: $8.47 (84.7%)
Remaining: $1.53

Tasks completed today: 7
Average cost per task: $1.21

Options:
1. Continue anyway - Proceed with current task
2. Pause and review - Assess completed work
3. Switch to cheaper model - Use Haiku instead of Sonnet

Recommended: Option 3 - Switch to Haiku for routine tasks

Your choice (1-3):

Hard Limit (100%)

❌ BUDGET EXCEEDED - HARD LIMIT REACHED

Daily Budget: $10.00
Used: $10.23 (102.3%)
Overage: $0.23

Action Required:
• All tasks blocked until budget resets
• Budget resets at midnight UTC
• Consider increasing daily_budget_usd in config

Current time: $(date -u +%H:%M UTC)
Time until reset: [hours remaining]

Options:
1. Wait for reset - Resume at midnight UTC
2. Increase budget - Modify aeo-budget.json
3. Override limit - Not recommended

Contact: [Admin email if configured]

Model Selection Guidelines

Use Opus for:

  • Complex architectural decisions
  • Multi-file refactoring with deep implications
  • Critical security analysis
  • Performance optimization requiring deep reasoning

Use Sonnet for:

  • Feature implementation
  • Bug fixing
  • Code review
  • Most development tasks

Use Haiku for:

  • Documentation generation
  • Simple code modifications
  • Test writing
  • Routine refactoring

Cost Optimization Tips

  1. Use Haiku for documentation - Saves ~85% on docs
  2. Provide clear specs - Reduces back-and-forth
  3. Batch similar tasks - Amortize context loading
  4. Use targeted file reads - Instead of reading entire codebase
  5. Enable caching - Reuse previous responses when possible

Reporting

Daily Summary

Generate at end of day:

# Get today's costs
jq -s "
  select(.date == \"$(date -u +%Y-%m-%d)\")
  | {
      total_cost: map(.cost_usd) | add,
      task_count: length,
      avg_cost: (map(.cost_usd) | add / length),
      by_model: group_by(.model) | map({
          model: .[0].model,
          cost: map(.cost_usd) | add,
          tasks: length
      })
    }
" ~/.claude/MEMORY/aeo-costs.jsonl

Output:

{
  "total_cost": 8.47,
  "task_count": 7,
  "avg_cost": 1.21,
  "by_model": [
    {"model": "claude-sonnet-4.5", "cost": 6.32, "tasks": 5},
    {"model": "claude-haiku-4", "cost": 2.15, "tasks": 2}
  ]
}

Weekly Analysis

# Last 7 days
jq -s "
  group_by(.date)
  | map({
      date: .[0].date,
      total_cost: map(.cost_usd) | add,
      task_count: length
    })
  | .[-7:]
" ~/.claude/MEMORY/aeo-costs.jsonl

Integration

Hooks Integration:

// In PreToolUse hook
if (cost_governor_enabled) {
  const cost = estimate_tool_cost(tool_name, tool_input);
  const daily_total = get_daily_total();
  const remaining = budget - daily_total;

  if (cost > remaining) {
    invoke_skill('aeo-escalation', {
      type: 'cost_limit',
      cost: cost,
      remaining: remaining
    });
  }
}

Best Practices

DO:

  • Set realistic budgets based on usage patterns
  • Use alerts to stay informed before hitting limits
  • Track costs per task to identify expensive operations
  • Use cheaper models when appropriate
  • Review cost reports weekly to optimize spending

DON'T:

  • Set budgets too low and constantly hit limits
  • Ignore alerts until hard limit is reached
  • Use Opus for routine tasks
  • Forget to account for input tokens (not just output)
  • Track only at session end - track during tasks too

Example Session

User: /aeo
User: Refactor the authentication system

AEO-Core: [Calculating confidence...]
          [Invokes aeo-cost-governor]

Cost Governor: Checking budget...

              Daily Budget: $10.00
              Used: $8.47 (84.7%)
              Remaining: $1.53
              Task Estimate: ~$2.50

              ⚠️ ALERT: Task may exceed daily budget

Options:
1. Continue anyway - May exceed budget
2. Use Haiku instead - Estimated cost ~$0.50
3. Break into smaller tasks - Spread across multiple days

Recommended: Option 3 - Break into smaller tasks

User: 3

Cost Governor: [Recording decision]
              Suggesting subtasks:
              1. Extract auth logic to service (Day 1)
              2. Implement JWT tokens (Day 2)
              3. Migrate existing sessions (Day 3)

AEO-Core: Proceeding with subtask 1: Extract auth logic

Cleanup

Archive old cost logs:

# Keep last 90 days, archive older
cat ~/.claude/MEMORY/aeo-costs.jsonl | \
  jq -r 'select(.date >= "$(date -u -d '90 days ago' +%Y-%m-%d)")' \
  > /tmp/costs-recent.jsonl

cat ~/.claude/MEMORY/aeo-costs.jsonl | \
  jq -r 'select(.date < "$(date -u -d '90 days ago' +%Y-%m-%d)")' \
  > ~/.claude/MEMORY/aeo-costs.archive.jsonl

mv /tmp/costs-recent.jsonl ~/.claude/MEMORY/aeo-costs.jsonl

Disable Cost Tracking

To disable cost tracking for a project:

{
  "enable_tracking": false
}

Or delete the config file entirely - AEO will use defaults but won't enforce limits.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

27.2%
按下载量换算31

OpenCode

22.82%
按下载量换算26

Codex

17.55%
按下载量换算20

windsurf

13.74%
按下载量换算16

trae

8.69%
按下载量换算10

Cursor

3.64%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills