Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Quota Management

  • 98 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Estimate tokens and API cost from files and task types before kicking off large agent runs so you stay inside quota and budget.

About

Quota Management (packaged in Prism under athola/claude-night-market as estimation-patterns content) gives solo builders procedural patterns to forecast LLM consumption before work starts instead of discovering overages after a long agent session. It documents TOKEN_RATIOS by file type so you can approximate input size from repository paths, and a task matrix that brackets typical input and output tokens for analyses, summarization, pattern extraction, and template generation. A small cost estimator multiplies token counts by published per-million-dollar rates for common models. The skill is methodology-first: you invoke it whenever an agent is about to read many files, regenerate boilerplate, or chain multi-step tasks. It pairs naturally with night-market style agent marketplaces where quota guardrails matter. Because estimation applies before validation spikes, heavy builds, ship-time reviews, and operate iteration, treat it as journey-wide guardrails rather than a single-phase integration.

  • File-based token estimation with suffix-specific character-to-token ratios (code, JSON, text)
  • Task-based ranges for analysis, summarization, pattern extraction, and boilerplate generation
  • USD cost helper using per-model input and output rates (e.g. gemini-pro, gemini-flash, qwen-max)
  • estimate_file_tokens(Path) pattern sized for pre-flight checks in scripts
  • Documented estimated_tokens: 450 in skill metadata for lightweight invocation

Quota Management by the numbers

  • 98 all-time installs (skills.sh)
  • Ranked #4,469 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill quota-management

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs98
repo stars325
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Estimate tokens and API cost from files and task types before kicking off large agent runs so you stay inside quota and budget.

Files

SKILL.mdMarkdownGitHub ↗

Table of Contents

Quota Management

Overview

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:

LevelUsageAction
Healthy<80%Proceed normally
Warning80-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: 1. Initialize tracker for your service 2. Check quota before operations 3. Record usage after operations 4. 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

Related skills

FAQ

Is Quota Management safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingautomationllm

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.