Agent skill
time-tracking-1-handle-rate-limits
Sub-skill of time-tracking: 1. Handle Rate Limits (+2).
Install this agent skill to your Project
npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/business/productivity/time-tracking/1-handle-rate-limits
SKILL.md
1. Handle Rate Limits (+2)
1. Handle Rate Limits
import time
from functools import wraps
def rate_limited(max_per_second=1):
"""Rate limiting decorator."""
min_interval = 1.0 / max_per_second
last_call = [0.0]
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
elapsed = time.time() - last_call[0]
if elapsed < min_interval:
time.sleep(min_interval - elapsed)
result = func(*args, **kwargs)
last_call[0] = time.time()
return result
return wrapper
return decorator
2. Cache API Responses
from functools import lru_cache
from datetime import datetime
@lru_cache(maxsize=100)
def get_projects_cached(workspace_id, cache_key=None):
"""Get projects with caching."""
return toggl.get_projects(workspace_id)
# Invalidate cache daily
cache_key = datetime.now().strftime("%Y-%m-%d")
projects = get_projects_cached(workspace_id, cache_key)
3. Validate Time Entries
def validate_time_entry(entry):
"""Validate time entry before creating."""
if not entry.get("description"):
raise ValueError("Description is required")
duration = entry.get("duration", 0)
if duration > 12 * 3600: # More than 12 hours
raise ValueError("Duration exceeds 12 hours")
if duration < 60: # Less than 1 minute
raise ValueError("Duration too short")
return True
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-complete-milestone
Archive completed milestone and prepare for next version
gsd-reapply-patches
Reapply local modifications after a GSD update
gsd-verify-work
Validate built features through conversational UAT
gsd-thread
Manage persistent context threads for cross-session work
clinical-trial-protocol
Generate clinical trial protocols for medical devices or drugs through a modular, waypoint-based architecture with research-only and full protocol modes.
single-cell-rna-qc
Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations.
Didn't find tool you were looking for?