Quota management
Skill athola/claude-night-market/plugins/leyline/skills/quota-management
Tracks quotas, monitors thresholds, and degrades gracefully for rate-limited APIs. Use when integrating external services that impose rate or cost limits.From its SKILL.md
npx -y skills add athola/claude-night-market --skill quota-managementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
3.5 KB, 661 tokens by cl100k_base, as published. Nobody here has run it
Table of Contents
- Overview
- When to Use
- Core Concepts
- Quota Thresholds
- Quota Types
- Quick Start
- Check Quota Status
- Record Usage
- Estimate Before Execution
- Integration Pattern
- Detailed Resources
- Exit Criteria
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: int = 1000000
Quick Start
Check Quota Status
from leyline.quota_tracker import QuotaTracker
tracker = QuotaTracker(service="my-service")
status, warnings = tracker.get_quota_status()
if status == "CRITICAL":
# Defer or use secondary service
pass
Record Usage
tracker.record_request(
tokens=estimated_tokens,
success=True,
duration=elapsed_seconds
)
Estimate Before Execution
can_proceed, issues = tracker.can_handle_task(estimated_tokens)
if not can_proceed:
print(f"Quota issues: {issues}")
Integration Pattern
Other plugins reference this skill:
# In your skill's frontmatter
dependencies: [leyline:quota-management]
Then use the shared patterns:
- Initialize tracker for your service
- Check quota before operations
- Record usage after operations
- Handle threshold warnings gracefully
Detailed Resources
- Threshold Strategies: See
modules/threshold-strategies.mdfor degradation patterns - Estimation Patterns: See
modules/estimation-patterns.mdfor token/cost estimation
Exit Criteria
- Quota status checked before operation
- Usage recorded after operation
- Threshold warnings handled appropriately
What ships with it: 2 files
4.4 KB alongside SKILL.md
modules/
- estimation-patterns.md2.5 KB
- threshold-strategies.md1.8 KB
Gives 0 of the 12 instructions most sales audience skills give in 661 tokens
Counted across 401 of the 401 authors here whose files we hold, read 2026-08-07
- Read product marketing context before asking questionsin 21 of 401, across 11 files
- Acknowledge competitor strengths honestlyin 18 of 401, across 7 files
- Start every page with a summaryin 15 of 401, across 4 files
- Use a single, low-friction call to actionin 15 of 401, across 7 files
- Create a single source of truth for each competitorin 14 of 401, across 3 files
- Make each follow-up email add new valuein 11 of 401, across 5 files
- Cut any sentence that does not drive a replyin 10 of 401, across 4 files
- Tie personalization directly to the problemin 10 of 401, across 4 files
- Write paragraph comparisons for each dimensionin 9 of 401, across 3 files
- Link between related competitor pagesin 9 of 401, across 3 files
- Keep subject lines short and lowercasein 9 of 401, across 3 files
- Define ideal customer profile from top customersin 9 of 401, across 3 files
Said here and by no other author read
- check quota status before operations
- record usage after operations
- handle threshold warnings gracefully
- defer non-urgent operations when critical
- use secondary services when quota is critical
- consider batching at warning level
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.