mcpbeat

Quota Management

athola/quota-management

Tracks quotas, monitors thresholds, and degrades gracefully for rate-limited APIs. Use when integrating external services that impose rate or cost limits.

2k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
324
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/athola/claude-night-market --skill quota-management

The instruction itself

15 sections, as written by the author

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.md for degradation patterns
  • Estimation Patterns: See modules/estimation-patterns.md for token/cost estimation

Exit Criteria

  • Quota status checked before operation
  • Usage recorded after operation
  • Threshold warnings handled appropriately

How to use it

Copy the folder

Take athola/quota-management from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.