基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/javimosch/open-claw-skills --skill rate-limit-pro命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Connect your AI assistant to GoHighLevel CRM via the official API v2. Manage contacts, conversations, calendars, pipelines, invoices, payments, workflows, and 30+ endpoint groups through natural language. Includes interactive setup wizard and 100+ pre-built, safe API commands. Python 3.6+ stdlib only — zero external dependencies.
Manage Cloudflare DNS records, Tunnels (cloudflared), and Zero Trust policies. Use for pointing domains, exposing local services via tunnels, and updating ingress rules.
Mema's personal brain - SQLite metadata index for documents and Redis short-term context buffer. Use for organizing workspace knowledge paths and managing ephemeral session state.
| id | rate-limit-pro |
| version | 1.0.0 |
| name | Rate Limit Pro |
| description | Advanced rate limiting with tiered controls and quota management |
| author | NeoClaw Team |
| category | utility |
| tags | ["rate-limiting","quota","throttling"] |
| dependencies | [] |
Advanced rate limiting with multiple tiers and quota management.
class RateLimiter {
constructor(options = {}) {
this.tiers = options.tiers || {
free: { requests: 10, window: 60000 }, // 10 req/min
basic: { requests: 100, window: 60000 },
pro: { requests: 1000, window: 60000 }
};
this.requests = new Map();
}
checkLimit(userId, tier = 'free') {
const tierConfig = this.tiers[tier];
if (!tierConfig) {
return { allowed: false, reason: 'invalid_tier' };
}
const now = Date.now();
const userRequests = this.requests.get(userId) || [];
// Remove old requests outside window
const validRequests = userRequests.filter(
timestamp => now - timestamp < tierConfig.window
);
// Check if under limit
if (validRequests.length >= tierConfig.requests) {
const oldestRequest = validRequests[0];
const resetIn = tierConfig.window - (now - oldestRequest);
return {
allowed: false,
reason: 'rate_limit_exceeded',
limit: tierConfig.requests,
remaining: 0,
resetIn: Math.ceil(resetIn / 1000)
};
}
// Add current request
validRequests.push(now);
this.requests.set(userId, validRequests);
return {
allowed: true,
limit: tierConfig.requests,
remaining: tierConfig.requests - validRequests.length,
resetIn: Math.ceil(tierConfig.window / 1000)
};
}
resetUser(userId) {
this.requests.delete(userId);
}
getStats(userId) {
const userRequests = this.requests.get(userId) || [];
return {
totalRequests: userRequests.length,
oldestRequest: userRequests[0] || null,
newestRequest: userRequests[userRequests.length - 1] || null
};
}
}
// Export for OpenClaw
module.exports = { RateLimiter };
const limiter = new skills.rateLimitPro.RateLimiter({
tiers: {
free: { requests: 10, window: 60000 },
pro: { requests: 1000, window: 60000 }
}
});
const result = limiter.checkLimit('user123', 'free');
if (result.allowed) {
// Process request
} else {
console.log(`Rate limit exceeded. Reset in ${result.resetIn}s`);
}
{
"tiers": {
"free": { "requests": 10, "window": 60000 },
"basic": { "requests": 100, "window": 60000 },
"pro": { "requests": 1000, "window": 60000 }
}
}