| name | quota-management |
| description | Tracks quotas, monitors thresholds, and degrades gracefully for rate-limited APIs. Use when integrating external services that impose rate or cost limits. |
| alwaysApply | false |
| category | infrastructure |
| tags | ["quota","rate-limiting","resource-management","cost-tracking","thresholds"] |
| dependencies | [] |
| tools | [] |
| provides | {"infrastructure":["quota-tracking","threshold-monitoring","usage-estimation"],"patterns":["graceful-degradation","quota-enforcement","cost-optimization"]} |
| usage_patterns | ["service-integration","rate-limit-management","cost-tracking","resource-monitoring"] |
| complexity | intermediate |
| model_hint | standard |
| estimated_tokens | 500 |
| progressive_loading | true |
| modules | ["modules/threshold-strategies.md","modules/estimation-patterns.md"] |
Table of Contents
Quota Management
Overview
Tracks cumulative token budgets and enforces limits. For per-call logging,
use usage-logging.
Patterns for tracking and enforcing resource quotas across rate-limited
services. This skill provides the infrastructure that other plugins use for
consistent quota handling.
When To Use
- Building integrations with rate-limited APIs
- Need to track usage across sessions
- Want graceful degradation when limits approached
- Require cost estimation before operations
When NOT To Use
- Project doesn't use the leyline infrastructure patterns
- Simple scripts without service architecture needs
Core Concepts
Quota Thresholds
Three-tier threshold system for proactive management:
| Level | Usage | Action |
|---|
| Healthy | <80% | Proceed normally |
| Warning | 80-95% | Alert, consider batching |
| Critical | >95% | Defer non-urgent, use secondary services |
Quota Types
@dataclass
class QuotaConfig:
requests_per_minute: int = 60
requests_per_day: int = 1000
tokens_per_minute: int = 100000
tokens_per_day: =