MCP HubMCP Hub
Вернуться к навыкам

agent-usage-optimizer-step-1-read-and-validate-quota-cache

vamseeachanta
Обновлено Today
58 просмотров
3
2
3
Посмотреть на GitHub
Другоеgeneral

О программе

Этот навык считывает и проверяет кэшированный файл квот для определения доступности использования Claude API. Он проверяет существование кэша и его актуальность (не старше одного часа), выдавая предупреждения при устаревании или отсутствии файла. Используйте этот навык в качестве первого шага при маршрутизации агентов, чтобы определить доступность моделей Claude перед продолжением работы.

Быстрая установка

Claude Code

Рекомендуется
Основной
npx skills add vamseeachanta/workspace-hub
Команда плагинаАльтернативный
/plugin add https://github.com/vamseeachanta/workspace-hub
Git клонированиеАльтернативный
git clone https://github.com/vamseeachanta/workspace-hub.git ~/.claude/skills/agent-usage-optimizer-step-1-read-and-validate-quota-cache

Скопируйте и вставьте эту команду в Claude Code для установки этого навыка

Документация

Step 1 — Read and Validate Quota Cache

Step 1 — Read and Validate Quota Cache

QUOTA_FILE="$HOME/.cache/agent-quota.json"

# Check cache exists and is fresh (< 1 hour old)
if [[ ! -f "$QUOTA_FILE" ]]; then
  echo "WARN: quota cache not found at $QUOTA_FILE"
  echo "Run: bash scripts/monitoring/query-quota.sh"
  echo "Falling back to default routing rules."
  CACHE_FRESH=false
else
  CACHE_AGE_SECS=$(( $(date +%s) - $(date -r "$QUOTA_FILE" +%s) ))
  if [[ $CACHE_AGE_SECS -gt 3600 ]]; then
    echo "WARN: quota cache is $(( CACHE_AGE_SECS / 60 ))m old — consider refreshing"
    CACHE_FRESH=false
  else
    CACHE_FRESH=true
  fi
fi

# Parse quota values (requires jq)
CLAUDE_PCT=$(jq -r '.agents[] | select(.provider=="claude") | .pct_remaining' "$QUOTA_FILE" 2>/dev/null || echo 100)
CODEX_PCT=$(jq  -r '.agents[] | select(.provider=="codex")  | .pct_remaining' "$QUOTA_FILE" 2>/dev/null || echo 100)
GEMINI_PCT=$(jq -r '.agents[] | select(.provider=="gemini") | .pct_remaining' "$QUOTA_FILE" 2>/dev/null || echo 100)
CACHE_TS=$(jq  -r '.timestamp' "$QUOTA_FILE" 2>/dev/null || echo "unknown")

GitHub репозиторий

vamseeachanta/workspace-hub
Путь: .claude/skills/ai/agent-usage-optimizer/step-1-read-and-validate-quota-cache

Похожие навыки

algorithmic-art

Мета

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

Просмотреть навык

subagent-driven-development

Разработка

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

Просмотреть навык

executing-plans

Дизайн

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

Просмотреть навык

cost-optimization

Другое

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

Просмотреть навык