From flyio-pack
Manages Fly.io Machines API rate limits with exponential backoff retries, PQueue concurrency control, and batching for create/update/delete/start/stop operations. Useful for high-volume machine management.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flyio-pack:flyio-rate-limitsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Fly.io Machines API has rate limits per organization. Machine create/update/delete operations are more tightly limited than read operations. The API returns 429 with `Retry-After` header when limits are exceeded.
The Fly.io Machines API has rate limits per organization. Machine create/update/delete operations are more tightly limited than read operations. The API returns 429 with Retry-After header when limits are exceeded.
| Operation | Approximate Limit | Scope |
|---|---|---|
| Machine create/delete | ~10/minute | Per org |
| Machine start/stop | ~30/minute | Per org |
| List/get machines | ~60/minute | Per org |
| App operations | ~20/minute | Per org |
async function flyApiWithRetry<T>(
fn: () => Promise<Response>,
maxRetries = 4
): Promise<T> {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const res = await fn();
if (res.ok) return res.json();
if (res.status === 429) {
const retryAfter = parseInt(res.headers.get('Retry-After') || '10');
const delay = retryAfter * 1000 + Math.random() * 2000;
console.log(`Rate limited. Retry in ${(delay / 1000).toFixed(0)}s`);
await new Promise(r => setTimeout(r, delay));
continue;
}
if (res.status >= 500 && attempt < maxRetries) {
await new Promise(r => setTimeout(r, Math.pow(2, attempt) * 1000));
continue;
}
throw new Error(`Fly API ${res.status}: ${await res.text()}`);
}
throw new Error('Max retries exceeded');
}
import PQueue from 'p-queue';
// Limit concurrent machine operations
const flyQueue = new PQueue({ concurrency: 3, interval: 10000, intervalCap: 10 });
async function batchCreateMachines(configs: Array<{ region: string; config: any }>) {
return Promise.all(
configs.map(c => flyQueue.add(() =>
flyApiWithRetry(() => fetch(`${FLY_API}/v1/apps/${app}/machines`, {
method: 'POST', headers,
body: JSON.stringify(c),
}))
))
);
}
For security, see flyio-security-basics.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin flyio-packImplements TypeScript clients and patterns for Fly.io Machines API: typed REST calls, lifecycle management, state waiting, multi-region deployments with Docker images.
Deploy, configure, and manage applications on the Fly.io platform using flyctl CLI, fly.toml configuration, Fly Machines, Fly Volumes, private networking, secrets, health checks, autoscaling, and GitHub Actions CI/CD. Use when deploying any application to Fly.io, writing or modifying fly.toml configuration, managing Fly Machines or Volumes, configuring networking (public services, private 6PN, Flycast, custom domains, TLS), setting secrets, configuring health checks, setting up autostop/autostart or metrics-based autoscaling, deploying with GitHub Actions, managing Fly Postgres databases, or preparing an app for production on Fly.io.
Provides quick reference for Fly.io PaaS deployments including fly.toml config, global distribution, scaling patterns, secrets management, health checks, and troubleshooting. Auto-loads on fly.toml detection.