Night Market Skill — ported from claude-night-market/leyline. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Patterns for tracking and enforcing resource quotas across rate-limited services. This skill provides the infrastructure that other plugins use for consistent quota handling.
Three-tier threshold system for proactive management:
LevelUsageActionHealthy<80%Proceed normallyWarning80-95%Alert, consider batchingCritical>95%Defer non-urgent, use secondary services
python
@dataclass
class QuotaConfig:
requests_per_minute: int = 60
requests_per_day: int = 1000
tokens_per_minute: int = 100000
tokens_per_day: int = 1000000
python
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
python
tracker.record_request(
tokens=estimated_tokens,
success=True,
duration=elapsed_seconds
)
python
can_proceed, issues = tracker.can_handle_task(estimated_tokens)
if not can_proceed:
print(f"Quota issues: {issues}")
Other plugins reference this skill:
yaml
# In your skill's frontmatter
dependencies: [leyline:quota-management]
Then use the shared patterns:
modules/threshold-strategies.md for degradation patternsmodules/estimation-patterns.md for token/cost estimation