Skip to content
Back to skills

Step 1 Read And Validate Quota Cache

ASecurity

"Sub-skill of agent-usage-optimizer: Step 1 \u2014 Read and Validate\

  • 17 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
ai-agentsgobash

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill step-1-read-and-validate-quota-cache --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Step 1 Read And Validate Quota Cache?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Step 1 Read And Validate Quota Cache
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-step-1-read-and-validate-quota-cache/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-step-1-read-and-validate-quota-cache)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-usage-optimizer-step-1-read-and-validate-quota-cache
description: "Sub-skill of agent-usage-optimizer: Step 1 \u2014 Read and Validate\
  \ Quota Cache."
version: 1.0.0
category: ai
type: reference
scripts_exempt: true
---

# Step 1 — Read and Validate Quota Cache

## Step 1 — Read and Validate Quota Cache


```bash
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=="Codex") | .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")
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.