/flyio-pack:flyio-webhooks-eventsfrom flyio-pack
Monitors Fly.io machine state changes, health checks, and structured logs for deployment automation and alerting.
Ships in flyio-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fly.io does not have traditional webhooks. Instead, monitor machine state changes via the Machines API, process structured logs via fly logs, and use health check endpoints for automated responses.
// Monitor machine state transitions via Machines API
async function watchMachines(appName: string, callback: (event: MachineEvent) => void) {
const client = new FlyClient(appName, process.env.FLY_API_TOKEN!);
const stateCache = new Map<string, string>();
setInterval(async () => {
const machines = await client.listMachines();
for (const m of machines) {
const prev = stateCache.get(m.id);
if (prev && prev !== m.state) {
callback({
machineId: m.id,
region: m.region,
previousState: prev,
currentState: m.state,
timestamp: new Date(),
});
}
stateCache.set(m.id, m.state);
}
}, 10_000); // Check every 10 seconds
}
interface MachineEvent {
machineId: string;
region: string;
previousState: string;
currentState: string;
timestamp: Date;
}
// Implement health check that reports machine health
// Fly.io uses this to auto-restart unhealthy machines
import express from 'express';
const app = express();
app.get('/health', async (req, res) => {
const checks = {
database: await checkPostgres(),
redis: await checkRedis(),
memory: process.memoryUsage().heapUsed < 500 * 1024 * 1024, // < 500MB
};
const healthy = Object.values(checks).every(Boolean);
res.status(healthy ? 200 : 503).json({
status: healthy ? 'healthy' : 'unhealthy',
region: process.env.FLY_REGION,
machine: process.env.FLY_MACHINE_ID,
checks,
});
});
# Stream logs and process with jq
fly logs -a my-app --json | jq -c 'select(.level == "error")' | while read -r line; do
echo "$line" >> errors.jsonl
# Send to Slack, PagerDuty, etc.
done
# Search recent logs for specific patterns
fly logs -a my-app --no-tail | grep -i "error\|crash\|oom"
# Post-deploy notification in CI
fly deploy -a my-app && \
curl -X POST "$SLACK_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "{\"text\": \"Deployed my-app to Fly.io. Status: $(fly status -a my-app --json | jq -r '.Status')\"}"
For performance optimization, see flyio-performance-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
18 skills in this plugin
/flyio-ci-integrationConfigure CI/CD pipelines for Fly.io with GitHub Actions, Docker builds,
deploy tokens, and automated deployment workflows.
Trigger: "fly.io CI", "fly.io GitHub Actions", "fly deploy CI/CD".
/flyio-common-errorsDiagnose and fix common Fly.io errors including deployment failures, health check
failures, machine issues, and networking problems.
Trigger: "fly.io error", "fly deploy failed", "fly.io not working", "fly health check".
/flyio-core-workflow-aExecute Fly.io primary workflow: deploy, scale, and manage apps with flyctl and fly.toml.
Use when deploying applications, configuring regions, setting secrets,
or managing the app lifecycle on Fly.io.
Trigger: "fly deploy", "fly.io app management", "fly scale", "fly.io regions".
npx claudepluginhub flight505/skill-forge --plugin flyio-packOther plugins' skills for the same job