[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DPN46G2A7HTMCBYK832T58":3,"skill-same:01M7DPN46G2A7HTMCBYK832T58":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M7DPN46G2A7HTMCBYK832T58","runaway-guard",null,"Cost-safety discipline for paid AI \u002F inference APIs: treat $-cost as a third complexity dimension alongside time and space. Forces a written per-run $-cap, per-day $-cap, max-iterations bound, concurrency limit, and a matching provider-dashboard hard cap BEFORE any call site is written.","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frunaway-guard\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: runaway-guard\ndescription: \"Cost-safety discipline for paid AI \u002F inference APIs: treat $-cost as a third complexity dimension alongside time and space. Forces a written per-run $-cap, per-day $-cap, max-iterations bound, concurrency limit, and a matching provider-dashboard hard cap BEFORE any call site is written.\"\nrisk: safe\nsource: community\nsource_repo: morsechimwai\u002Flemmaly\nsource_type: community\ndate_added: \"2026-05-28\"\nauthor: morsechimwai\ntags: [cost-safety, finops, ai-apis, agents, retries, concurrency, wallet-invariant, gateway]\ntools: [claude-code, antigravity, cursor, gemini-cli, codex-cli]\nlicense: \"Apache-2.0\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Fmorsechimwai\u002Flemmaly\u002Fblob\u002Fmain\u002FLICENSE\"\n---\n\n# runaway-guard — $-Cost is the Third Complexity Dimension\n\nEvery loop has time complexity and space complexity. A loop that calls a paid API has a third: **dollars per execution**. The model tracks the first two automatically. It does not track the third, so it ships code where a single bug — a retry without bound, a stream reconnect storm, an agent that re-queues itself, a webhook that fires the same job twice — silently spends real money.\n\nThe canonical incident: developer writes a Fal.ai image-generation loop. Loop \"obviously terminates\" because it iterates over a fixed list. The list comes from a callback that fires on every Inngest retry. Each retry doubles the list. By morning, the bill is **$200**. Tests pass. Code review passed. The bug is not in the loop body. The bug is that **no one stated the wallet invariant**.\n\nrunaway-guard fixes this. State the max calls. State the max dollars per run. State the max dollars per day. Set the same caps in the provider dashboard so a code bug cannot bypass them. Then write the code.\n\n**Violating the letter of these rules is violating the spirit of the skill.** \"I'm only testing locally\" is the exact rationalization that ships the $200 bill — local code hits the same paid API as production.\n\n## When to Use This Skill\n\nUse **runaway-guard** when:\n\n- Writing or reviewing code that calls a paid AI \u002F inference API in a loop, queue, retry path, agent step, webhook handler, or background job.\n- Importing or wrapping any paid-inference SDK: `@fal-ai\u002F*`, `fal-client`, `@anthropic-ai\u002Fsdk`, `anthropic`, `openai`, `replicate`, `elevenlabs`, `together-ai`, `groq-sdk`, `cohere-ai`, `@mistralai\u002F*`.\n- Designing an agent loop, fan-out pipeline, retry wrapper, polling job, stream reconnect, or self-rescheduling job that may call a billed endpoint.\n- Auditing a codebase \u002F PR for unbounded fan-out, unbounded retries, missing idempotency keys, or missing provider-side spend caps.\n- Diagnosing an unexpected bill, runaway loop incident, or surprise overage.\n\n## The Iron Law\n\n```text\nNO CALL TO A PAID API WITHOUT A WRITTEN $-CAP AT BOTH THE CODE AND PROVIDER LEVEL\n```\n\nA cap only in code can be bypassed by a bug in that code. A cap only at the provider can be hit during normal usage and degrade the product. You need both. If you cannot state both in one sentence each, you have not designed the call site — you have written a wish.\n\n## Non-negotiable rules\n\n1. **Every call site gets a one-line cost contract.** Before writing any paid-API call, state in one sentence:\n   - **Max calls per run:** the strict upper bound on invocations in a single execution of this code path.\n   - **Max $ per run:** `max_calls × unit_cost` — compute it, don't estimate.\n   - **Max $ per day:** the provider-side hard cap that backstops the code-side bound.\n\n   Examples:\n   - \"Fal flux-pro at $0.05\u002Fimage; max 20 images per job; max $1 per job; provider Spend Limit $50\u002Fday.\"\n   - \"Anthropic Sonnet at ~$0.015 per request (cached); max 50 requests per agent run; max $0.75 per run; Workspace Budget hard cap $30\u002Fday.\"\n\n   If you cannot fill in all three numbers, you have not designed the call site.\n\n2. **Every loop calling a paid API gets an explicit iteration bound, not just a termination argument.** `invariant-guard` requires a termination measure. runaway-guard requires the bound to be a **concrete integer in code**, not just \"eventually terminates\":\n\n   ```ts\n   \u002F\u002F ❌ Terminates in theory. Bills $200 in practice.\n   while (job.status !== 'done') {\n     await fal.run(...);\n   }\n\n   \u002F\u002F ✅ Concrete bound — wallet invariant explicit.\n   const MAX_CALLS = 20;\n   for (let i = 0; i \u003C MAX_CALLS && job.status !== 'done'; i++) {\n     await fal.run(...);\n   }\n   if (job.status !== 'done') throw new Error('exceeded MAX_CALLS budget');\n   ```\n\n3. **Every retry path is bounded by attempts AND total elapsed cost, not by time alone.** Exponential backoff with no attempt cap is a wallet attack on yourself.\n   - Max attempts: a small integer (3–5 for transient errors, 1 for 4xx).\n   - Cap counts across the whole pipeline, not just one library — Inngest retries × SDK retries × your own retry wrapper multiply.\n   - 4xx errors do not retry. Period. They will not become 2xx; they will just bill again.\n\n4. **Every fan-out path declares a concurrency limit.** Parallel calls multiply cost per wall-clock second. State the limit in code, at the queue (Inngest `concurrency`), and at the provider where supported:\n   - Inngest: `concurrency: { limit: N }` on the function.\n   - BullMQ \u002F Sidekiq \u002F Cloud Tasks: queue-level concurrency.\n   - In-process: `p-limit`, semaphore, or batched `Promise.all` chunks — never an unbounded `Promise.all(items.map(...))` on a paid API.\n\n5. **Every paid API has a matching provider-side hard cap, configured out of band.** Defense in depth: if the code is wrong, the provider stops the bleeding. Document the cap in the same file as the call site so future readers know it exists.\n\n   | Provider | Where to set the hard cap |\n   |---|---|\n   | **Fal.ai** | Dashboard → Billing → **Spend Limit** (e.g. $50\u002Fday). Hard stop on exceed. |\n   | **Anthropic** | Console → Workspaces → **Workspace Budget** with hard limit. Per-workspace, per-month. |\n   | **OpenAI** | Org → Settings → **Usage limits** (org-level hard limit blocks requests). ⚠️ Per-*project* monthly budgets are **soft thresholds only** — they alert but do not block. For a real hard cap use the org-level Usage limit, a billing gateway, or your own fail-closed budget check. |\n   | **Replicate** | Account → Billing → **Spend limit**. Per account. |\n   | **ElevenLabs** | Workspace → **Usage limits** per workspace \u002F API key. |\n   | **Together \u002F Groq \u002F Cohere \u002F Mistral** | Each has a billing dashboard with a monthly spend cap — set it before first deploy, not after. |\n\n   No hard cap, no call site. Set the cap before the first request, not after the first incident.\n\n6. **Idempotency keys on every mutating or charging call.** A webhook that fires twice should bill once. Without an idempotency key, retry policies you cannot see (load balancer, framework, gateway) silently double-charge.\n\n7. **Make the \"amplifier\" patterns explicit and forbidden by default.** These are the shapes that turn small bugs into large bills:\n   - **Self-rescheduling jobs.** A job that re-enqueues itself with no decrementing measure is an unbounded loop with extra steps.\n   - **Webhook handlers that call the API that called the webhook.** Cycle detection or it will cycle.\n   - **Recursion over LLM output.** \"Ask the model what to do next\" with no depth cap is a depth-unbounded recursion in dollars.\n   - **Polling without a deadline.** `while (!done) await poll()` with no `maxWaitMs` is a wallet leak.\n   - **Streaming reconnect storms.** A WebSocket \u002F SSE reconnect with no backoff and no attempt cap can hammer a billed endpoint thousands of times per minute.\n   - **Cache-miss stampede on a paid call.** N concurrent requests for the same uncached key → N billed calls. Use `singleflight` \u002F request coalescing.\n\n## The pre-write protocol\n\nBefore producing code that calls a paid API, your message must contain — in this order:\n\n1. **Provider + unit cost.** \"Fal flux-pro: $0.05\u002Fimage, billed per success.\"\n2. **Max calls per run.** A literal integer that will appear as a constant in the code.\n3. **Max $ per run.** `max_calls × unit_cost`. Compute it.\n4. **Max $ per day (provider hard cap).** The dashboard setting that backstops the code.\n5. **Concurrency limit.** In code, at the queue, at the provider.\n6. **Retry policy.** Max attempts, which error codes retry, idempotency key strategy.\n7. **Amplifier audit.** Walk the list in rule 7; declare \"none apply\" or address each that does.\n8. **The code** — with the cost contract in a comment above the call site.\n9. **Self-check.** One line: \"in the worst case, this code bills $X and the provider cap stops it at $Y.\"\n\nIf any of 1–7 is missing, do not emit code.\n\n## Worked trap — the Inngest + Fal $200 night\n\nThis is the canonical case. Observe how each rule would have caught it.\n\n**What shipped:**\n\n```ts\n\u002F\u002F inngest function: generate images for a campaign\nexport const generateCampaign = inngest.createFunction(\n  { id: 'gen-campaign' },                              \u002F\u002F ❌ no concurrency limit\n  { event: 'campaign\u002Fstart' },\n  async ({ event, step }) => {\n    const prompts = await step.run('fetch', () => fetchPrompts(event.data.id));\n    \u002F\u002F ❌ unbounded fan-out, no per-run cap, no idempotency\n    await Promise.all(prompts.map(p => fal.run('fal-ai\u002Fflux-pro', { input: { prompt: p } })));\n  }\n);\n```\n\n**What went wrong.** `fetchPrompts` had a bug: on a transient DB error it returned the partial list *plus the previous run's list appended*. Inngest retried the function at its default retry count (multiple attempts in addition to the initial one). Each retry re-ran `fetchPrompts`, each retry doubled the list (40 → 80 → 160 → 320 prompts). `Promise.all` fanned all 320 out concurrently. At $0.05\u002Fimage: **$16\u002Fretry × triangular growth across overnight retries on the schedule = ~$200 by morning.**\n\n**Why each rule would have caught it.**\n\n| Rule | Catch |\n|---|---|\n| 1. Cost contract | Forces writing \"max calls per run\". The number `prompts.length` is not a known integer → rule fails → write a cap. |\n| 2. Concrete iteration bound | `Promise.all(prompts.map(...))` has no integer bound → rule fails → wrap in chunks with `MAX_IMAGES_PER_RUN`. |\n| 3. Retry policy | Inngest default retries × no idempotency key = double-billed work. Rule forces an idempotency key per `(campaignId, promptHash)`. |\n| 4. Concurrency limit | `Promise.all` is unbounded concurrency. Rule forces `p-limit(3)` and Inngest `concurrency: { limit: 3 }`. |\n| 5. Provider hard cap | Fal Spend Limit $50\u002Fday would have stopped the bleeding at $50 instead of $200. |\n| 7. Amplifier audit | \"Self-rescheduling jobs\" — Inngest's retry IS self-rescheduling. The audit forces you to consider it. |\n\n**The fix that survives the protocol:**\n\n```ts\n\u002F\u002F cost contract:\n\u002F\u002F   provider: Fal flux-pro @ $0.05\u002Fimage\n\u002F\u002F   max calls per run: 50\n\u002F\u002F   max $ per run: $2.50\n\u002F\u002F   provider hard cap: $50\u002Fday (set in Fal dashboard 2026-05-22)\n\u002F\u002F   concurrency: 3 (Inngest + p-limit, matching)\n\u002F\u002F   idempotency: key = `${campaignId}:${sha1(prompt)}` — provider-side dedup window 24h\nconst MAX_IMAGES_PER_RUN = 50;\nconst limit = pLimit(3);\n\nexport const generateCampaign = inngest.createFunction(\n  {\n    id: 'gen-campaign',\n    concurrency: { limit: 3 },\n    retries: 2,                                        \u002F\u002F attempts = 1 + retries\n  },\n  { event: 'campaign\u002Fstart' },\n  async ({ event, step }) => {\n    const prompts = await step.run('fetch', () => fetchPrompts(event.data.id));\n    if (prompts.length > MAX_IMAGES_PER_RUN) {\n      throw new NonRetriableError(\n        `prompt count ${prompts.length} exceeds MAX_IMAGES_PER_RUN=${MAX_IMAGES_PER_RUN}`\n      );\n    }\n    await Promise.all(prompts.map(p => limit(() => step.run(\n      `img:${event.data.id}:${sha1(p)}`,               \u002F\u002F idempotency key\n      () => fal.run('fal-ai\u002Fflux-pro', { input: { prompt: p } })\n    ))));\n  }\n);\n```\n\nNote: the bug in `fetchPrompts` is still there. The protocol does not fix that bug — it makes the bug **cost $2.50 instead of $200** while you find it. That is the entire point of defense in depth.\n\n## Common runaway patterns and their wallet invariants\n\n| Pattern | Wallet invariant to write | Hard cap to set |\n|---|---|---|\n| Fan-out over a list of items | `total_cost ≤ list_len × unit_cost ≤ MAX_$_PER_RUN` | provider daily spend limit |\n| Retry on transient error | `total_cost ≤ attempts × unit_cost`, attempts ≤ 5 | provider daily spend limit; alert at 50% |\n| Agent loop (\"ask model what to do next\") | `total_cost ≤ MAX_STEPS × per_step_cost`, depth ≤ MAX_DEPTH | per-agent-run cost ceiling, kill-switch |\n| Polling for job completion | `total_cost ≤ ceil(MAX_WAIT_MS \u002F poll_interval) × poll_cost` | absolute deadline + alert |\n| Webhook handler → API call | idempotency key required; cycle if webhook is triggered by the same API | provider rate limit per key |\n| Stream reconnect | `attempts ≤ MAX_RECONNECTS`, exponential backoff with cap | provider connection cap |\n| Cache miss stampede | singleflight → `cost ≤ 1 × unit_cost` per key per window | n\u002Fa (deduped in code) |\n| Self-scheduling job | recursion depth bounded by ledger row, not by code | scheduler-level dedup + max runs\u002Fday |\n| Multi-provider fallback | sum across providers ≤ MAX_$_PER_RUN | hard cap on each provider separately |\n\n## Provider-specific cheat sheet\n\nSet these **before** the first deploy. None of them require code changes.\n\n### Fal.ai\n- Dashboard → **Billing → Spend Limit**. Daily and monthly hard caps. Hard stop on exceed.\n- Use **per-API-key** keys per environment (dev \u002F staging \u002F prod) and set a low limit on dev.\n- Webhooks: deliveries are paid; cap retries on your side.\n\n### Anthropic\n- Console → **Workspaces** → create a Workspace per environment.\n- Each Workspace gets a **Budget** with a **hard limit** (request blocking) and **soft limit** (email alert).\n- Use a per-Workspace API key — a leaked dev key cannot exceed the dev Workspace budget.\n- Prompt caching reduces cost ~90% for repeated context; cap is on unblended cost so caching extends the budget.\n\n### OpenAI\n- ⚠️ **Per-project monthly budgets are soft only.** OpenAI's Help Center documents project budgets as \"soft spending thresholds\" that send alerts but do **not** enforce a hard cap. A runaway can continue past the documented project budget.\n- For a real hard cap, use one of:\n  - **Org-level Usage limits** (Org → Settings → Limits) — block requests on exceed.\n  - A billing gateway \u002F proxy in front of the API that enforces fail-closed budgets.\n  - Your own fail-closed budget check in code that refuses calls past a ledgered $-cap.\n- Use separate projects per environment (dev\u002Fstaging\u002Fprod) for attribution and alerting, but do not rely on the project budget as the hard stop.\n\n### Replicate\n- Account → **Billing → Spend limit**. Account-wide hard cap.\n- Use separate tokens per environment; rotate on leak.\n\n### ElevenLabs\n- Workspace → **Usage limits**. Set per API key.\n- Voice cloning is billed per character; cap the character count in code AND per key.\n\n### Inngest (queue layer — not paid AI but the multiplier)\n- `concurrency: { limit: N }` on every function that calls a paid API.\n- `retries: 2` (Inngest default is **4 retries**, i.e. up to 5 attempts including the initial — confirm against current Inngest docs) for paid call functions; fewer attempts on idempotent failures. Worst-case wallet math: `attempts = 1 + retries`, so a default `step.run()` can bill **5×**, not 4×.\n- `NonRetriableError` for 4xx — never retry a 4xx into a paid API.\n- `idempotency: ...` on events you cannot deduplicate at the call site.\n\n## Edge cases to enumerate before shipping\n\n| Scenario | Expected behavior |\n|---|---|\n| Empty input list | 0 calls, 0 cost, return early — do not even auth |\n| Input list longer than MAX | reject with NonRetriableError, do not partial-process |\n| All calls fail with 4xx | 1 attempt each, no retry, surface error |\n| All calls fail with 5xx | bounded retries, total cost ≤ attempts × unit, alert on full exhaustion |\n| Concurrent invocation of the same job | idempotency key dedups; second invocation costs $0 |\n| Network partition mid-batch | partial cost banked; on resume, idempotency key prevents re-charge |\n| Provider rate-limit (429) | respect `Retry-After`; do not multiply retries inside SDK and outside |\n| Webhook retried by provider | idempotency at the handler boundary |\n| Local dev accidentally pointing at prod key | per-env keys + per-env caps make this cost $0.50, not $50 |\n| Cron fires while previous run still executing | concurrency limit = 1 OR explicit overlap-tolerant design |\n\n## Output discipline\n\nCode you emit must:\n\n- Have a `\u002F\u002F cost contract:` block above each call site with the four numbers (unit cost, max calls, max $\u002Frun, provider hard cap setting).\n- Use a named constant (`MAX_IMAGES_PER_RUN`, `MAX_AGENT_STEPS`) for the bound — never a magic number inline.\n- Wrap fan-out in `p-limit` or equivalent — never raw `Promise.all` over a paid API.\n- Pass an idempotency key for every mutating \u002F charging call.\n- Set queue-level concurrency and retries in the same file or document it.\n- Reject `4xx` retries via `NonRetriableError` or equivalent.\n- Reference the provider hard-cap setting by name (\"Fal Spend Limit $50\u002Fday, set 2026-05-22\") so a future reader knows it exists.\n\n## Related Skills\n\n- **invariant-guard** — when the loop or recursion calling the paid API has no written termination measure. Termination is a precondition for a wallet cap; invariant-guard establishes it, runaway-guard bounds the cost.\n- **complexity-cuts** — when the runaway has already shipped and you are diagnosing an unexpected bill. Treat the unintended fan-out as a complexity bug, write a characterization test, then transform one step at a time.\n- **lemmaly** — when designing a new agent loop or batch pipeline that fans out paid calls. Pick the algorithm and data structure first; come back here for the wallet invariant per step.\n- **mathguard** — when the cost driver is compute on a sublinear-algorithm problem (vector search, sketching, FFT) rather than per-call billing; mathguard sets the algorithmic floor that determines per-call work.\n\n## Rationalizations to watch for\n\n| Excuse | Reality |\n|---|---|\n| \"I'm only testing locally.\" | Local hits the same paid endpoint. A retry bug in test code bills the same dollars. |\n| \"The list is small, fan-out is fine.\" | The list is small *today*. Next week it is fetched from a table that grew 50×. The cap exists for next week. |\n| \"Inngest already retries, so I don't need a retry policy.\" | Inngest retries × your retry wrapper × SDK retries = 27 attempts. Each one bills. |\n| \"The API call is cheap, $0.001.\" | At 10,000 unintended invocations that is $10 — and the count is exactly what you failed to bound. |\n| \"I'll set the provider cap later.\" | The bug ships before \"later\". Set the cap in the 60 seconds it takes; the code can wait. |\n| \"Idempotency is overkill for this.\" | Webhooks retry. Load balancers retry. Browsers retry. Without an idempotency key, *something* will duplicate. |\n| \"We have monitoring, we'll catch it.\" | Monitoring catches it after $200 is spent. Caps prevent the $200 from being spent. |\n| \"It obviously terminates.\" | The $200\u002Fnight incident also \"obviously terminated\". Write the integer bound. |\n\nIf any of these sound familiar mid-thought: stop, write the cost contract, set the provider cap, then write the code.\n\n## Red flags — STOP and write the cost contract first\n\n- About to write `await Promise.all(items.map(x => paidApi(x)))` with no `p-limit`.\n- About to write `while (!done) await paidApi(...)` with no integer bound.\n- About to write an agent loop with \"the model decides when to stop\".\n- About to write a retry wrapper around a call that is already retried by Inngest \u002F SDK \u002F framework.\n- About to deploy a paid API key without first setting the provider dashboard cap.\n- About to commit a paid API key to a `.env` shared across environments.\n- About to handle a webhook that calls the API that produced the webhook.\n- \"Just for tonight\" — overnight is exactly when runaway loops bill the most.\n\nAll of these mean: stop, write the cost contract, set the provider cap, then write the code.\n\n## Verification checklist\n\nBefore shipping any code that calls a paid API:\n\n- [ ] Cost contract comment exists above each call site with unit cost, max calls\u002Frun, max $\u002Frun, provider cap.\n- [ ] The iteration \u002F fan-out bound is a named integer constant, not implicit in list length.\n- [ ] Concurrency limit is set in code (`p-limit`) AND at the queue (`Inngest concurrency`).\n- [ ] Retry policy is explicit: max attempts, 4xx → no retry, idempotency key per call.\n- [ ] Provider dashboard hard cap is set and the value is documented in the file.\n- [ ] Per-environment API keys; dev keys have lower caps than prod.\n- [ ] Amplifier audit (rule 7) has been performed and either \"none apply\" or each addressed.\n- [ ] A test exists for: empty input, oversized input rejected, 4xx not retried, idempotency key dedups duplicate invocation.\n- [ ] In the worst case the code bills ≤ MAX_$_PER_RUN, and even with a bug the provider cap stops loss at MAX_$_PER_DAY.\n\nCannot check every box? The code is example-correct, not bill-correct. Either fill the gap or do not connect a billing-enabled key.\n\n## Limitations\n\n- **Not a billing system.** runaway-guard enforces *intent* (caps, contracts, audits) at code-write time. It does not meter spend in production — pair it with the provider's hard cap and observability (LLM-cost dashboards, log alerts) for runtime enforcement.\n- **Provider-side caps may take minutes to enforce.** Anthropic Workspace Budgets, OpenAI usage limits, and Fal Spend Limits are reconciled on a delay measured in minutes, not milliseconds. A pathological burst within a single window can still exceed the cap modestly.\n- **No automated cost estimation for novel models.** The cost-contract numbers (unit cost, $\u002Frun) are inputs the author must look up; the skill does not maintain a per-model price table.\n- **Streaming and per-token pricing.** For per-token APIs (Anthropic, OpenAI), `max calls` is a proxy — the real cap is `max input tokens × max output tokens × per-token rate`. Adapt the protocol: replace `max calls per run` with `max tokens per run`.\n- **Compute-billed providers.** For long-running GPU jobs (training, video encoding) billed in seconds, replace \"calls\" with \"GPU-seconds\" in the contract; the discipline transfers but the units differ.\n- **Does not replace incident response.** When a bill has already arrived, escalate to `complexity-cuts` for the corrective rewrite — runaway-guard prevents the next one, not the current one.\n\n## The thesis, in one line\n\n> **Time bounds prevent stalls. Space bounds prevent OOMs. Dollar bounds prevent $200 mornings. AI assistants enforce the first two by default and ignore the third. runaway-guard makes them reason about the wallet first.**\n","# runaway-guard — $-Cost is the Third Complexity Dimension\n\nEvery loop has time complexity and space complexity. A loop that calls a paid API has a third: **dollars per execution**. The model tracks the first two automatically. It does not track the third, so it ships code where a single bug — a retry without bound, a stream reconnect storm, an agent that re-queues itself, a webhook that fires the same job twice — silently spends real money.\n\nThe canonical incident: developer writes a Fal.ai image-generation loop. Loop \"obviously terminates\" because it iterates over a fixed list. The list comes from a callback that fires on every Inngest retry. Each retry doubles the list. By morning, the bill is **$200**. Tests pass. Code review passed. The bug is not in the loop body. The bug is that **no one stated the wallet invariant**.\n\nrunaway-guard fixes this. State the max calls. State the max dollars per run. State the max dollars per day. Set the same caps in the provider dashboard so a code bug cannot bypass them. Then write the code.\n\n**Violating the letter of these rules is violating the spirit of the skill.** \"I'm only testing locally\" is the exact rationalization that ships the $200 bill — local code hits the same paid API as production.\n\n## When to Use This Skill\n\nUse **runaway-guard** when:\n\n- Writing or reviewing code that calls a paid AI \u002F inference API in a loop, queue, retry path, agent step, webhook handler, or background job.\n- Importing or wrapping any paid-inference SDK: `@fal-ai\u002F*`, `fal-client`, `@anthropic-ai\u002Fsdk`, `anthropic`, `openai`, `replicate`, `elevenlabs`, `together-ai`, `groq-sdk`, `cohere-ai`, `@mistralai\u002F*`.\n- Designing an agent loop, fan-out pipeline, retry wrapper, polling job, stream reconnect, or self-rescheduling job that may call a billed endpoint.\n- Auditing a codebase \u002F PR for unbounded fan-out, unbounded retries, missing idempotency keys, or missing provider-side spend caps.\n- Diagnosing an unexpected bill, runaway loop incident, or surprise overage.\n\n## The Iron Law\n\n```text\nNO CALL TO A PAID API WITHOUT A WRITTEN $-CAP AT BOTH THE CODE AND PROVIDER LEVEL\n```\n\nA cap only in code can be bypassed by a bug in that code. A cap only at the provider can be hit during normal usage and degrade the product. You need both. If you cannot state both in one sentence each, you have not designed the call site — you have written a wish.\n\n## Non-negotiable rules\n\n1. **Every call site gets a one-line cost contract.** Before writing any paid-API call, state in one sentence:\n   - **Max calls per run:** the strict upper bound on invocations in a single execution of this code path.\n   - **Max $ per run:** `max_calls × unit_cost` — compute it, don't estimate.\n   - **Max $ per day:** the provider-side hard cap that backstops the code-side bound.\n\n   Examples:\n   - \"Fal flux-pro at $0.05\u002Fimage; max 20 images per job; max $1 per job; provider Spend Limit $50\u002Fday.\"\n   - \"Anthropic Sonnet at ~$0.015 per request (cached); max 50 requests per agent run; max $0.75 per run; Workspace Budget hard cap $30\u002Fday.\"\n\n   If you cannot fill in all three numbers, you have not designed the call site.\n\n2. **Every loop calling a paid API gets an explicit iteration bound, not just a termination argument.** `invariant-guard` requires a termination measure. runaway-guard requires the bound to be a **concrete integer in code**, not just \"eventually terminates\":\n\n   ```ts\n   \u002F\u002F ❌ Terminates in theory. Bills $200 in practice.\n   while (job.status !== 'done') {\n     await fal.run(...);\n   }\n\n   \u002F\u002F ✅ Concrete bound — wallet invariant explicit.\n   const MAX_CALLS = 20;\n   for (let i = 0; i \u003C MAX_CALLS && job.status !== 'done'; i++) {\n     await fal.run(...);\n   }\n   if (job.status !== 'done') throw new Error('exceeded MAX_CALLS budget');\n   ```\n\n3. **Every retry path is bounded by attempts AND total elapsed cost, not by time alone.** Exponential backoff with no attempt cap is a wallet attack on yourself.\n   - Max attempts: a small integer (3–5 for transient errors, 1 for 4xx).\n   - Cap counts across the whole pipeline, not just one library — Inngest retries × SDK retries × your own retry wrapper multiply.\n   - 4xx errors do not retry. Period. They will not become 2xx; they will just bill again.\n\n4. **Every fan-out path declares a concurrency limit.** Parallel calls multiply cost per wall-clock second. State the limit in code, at the queue (Inngest `concurrency`), and at the provider where supported:\n   - Inngest: `concurrency: { limit: N }` on the function.\n   - BullMQ \u002F Sidekiq \u002F Cloud Tasks: queue-level concurrency.\n   - In-process: `p-limit`, semaphore, or batched `Promise.all` chunks — never an unbounded `Promise.all(items.map(...))` on a paid API.\n\n5. **Every paid API has a matching provider-side hard cap, configured out of band.** Defense in depth: if the code is wrong, the provider stops the bleeding. Document the cap in the same file as the call site so future readers know it exists.\n\n   | Provider | Where to set the hard cap |\n   |---|---|\n   | **Fal.ai** | Dashboard → Billing → **Spend Limit** (e.g. $50\u002Fday). Hard stop on exceed. |\n   | **Anthropic** | Console → Workspaces → **Workspace Budget** with hard limit. Per-workspace, per-month. |\n   | **OpenAI** | Org → Settings → **Usage limits** (org-level hard limit blocks requests). ⚠️ Per-*project* monthly budgets are **soft thresholds only** — they alert but do not block. For a real hard cap use the org-level Usage limit, a billing gateway, or your own fail-closed budget check. |\n   | **Replicate** | Account → Billing → **Spend limit**. Per account. |\n   | **ElevenLabs** | Workspace → **Usage limits** per workspace \u002F API key. |\n   | **Together \u002F Groq \u002F Cohere \u002F Mistral** | Each has a billing dashboard with a monthly spend cap — set it before first deploy, not after. |\n\n   No hard cap, no call site. Set the cap before the first request, not after the first incident.\n\n6. **Idempotency keys on every mutating or charging call.** A webhook that fires twice should bill once. Without an idempotency key, retry policies you cannot see (load balancer, framework, gateway) silently double-charge.\n\n7. **Make the \"amplifier\" patterns explicit and forbidden by default.** These are the shapes that turn small bugs into large bills:\n   - **Self-rescheduling jobs.** A job that re-enqueues itself with no decrementing measure is an unbounded loop with extra steps.\n   - **Webhook handlers that call the API that called the webhook.** Cycle detection or it will cycle.\n   - **Recursion over LLM output.** \"Ask the model what to do next\" with no depth cap is a depth-unbounded recursion in dollars.\n   - **Polling without a deadline.** `while (!done) await poll()` with no `maxWaitMs` is a wallet leak.\n   - **Streaming reconnect storms.** A WebSocket \u002F SSE reconnect with no backoff and no attempt cap can hammer a billed endpoint thousands of times per minute.\n   - **Cache-miss stampede on a paid call.** N concurrent requests for the same uncached key → N billed calls. Use `singleflight` \u002F request coalescing.\n\n## The pre-write protocol\n\nBefore producing code that calls a paid API, your message must contain — in this order:\n\n1. **Provider + unit cost.** \"Fal flux-pro: $0.05\u002Fimage, billed per success.\"\n2. **Max calls per run.** A literal integer that will appear as a constant in the code.\n3. **Max $ per run.** `max_calls × unit_cost`. Compute it.\n4. **Max $ per day (provider hard cap).** The dashboard setting that backstops the code.\n5. **Concurrency limit.** In code, at the queue, at the provider.\n6. **Retry policy.** Max attempts, which error codes retry, idempotency key strategy.\n7. **Amplifier audit.** Walk the list in rule 7; declare \"none apply\" or address each that does.\n8. **The code** — with the cost contract in a comment above the call site.\n9. **Self-check.** One line: \"in the worst case, this code bills $X and the provider cap stops it at $Y.\"\n\nIf any of 1–7 is missing, do not emit code.\n\n## Worked trap — the Inngest + Fal $200 night\n\nThis is the canonical case. Observe how each rule would have caught it.\n\n**What shipped:**\n\n```ts\n\u002F\u002F inngest function: generate images for a campaign\nexport const generateCampaign = inngest.createFunction(\n  { id: 'gen-campaign' },                              \u002F\u002F ❌ no concurrency limit\n  { event: 'campaign\u002Fstart' },\n  async ({ event, step }) => {\n    const prompts = await step.run('fetch', () => fetchPrompts(event.data.id));\n    \u002F\u002F ❌ unbounded fan-out, no per-run cap, no idempotency\n    await Promise.all(prompts.map(p => fal.run('fal-ai\u002Fflux-pro', { input: { prompt: p } })));\n  }\n);\n```\n\n**What went wrong.** `fetchPrompts` had a bug: on a transient DB error it returned the partial list *plus the previous run's list appended*. Inngest retried the function at its default retry count (multiple attempts in addition to the initial one). Each retry re-ran `fetchPrompts`, each retry doubled the list (40 → 80 → 160 → 320 prompts). `Promise.all` fanned all 320 out concurrently. At $0.05\u002Fimage: **$16\u002Fretry × triangular growth across overnight retries on the schedule = ~$200 by morning.**\n\n**Why each rule would have caught it.**\n\n| Rule | Catch |\n|---|---|\n| 1. Cost contract | Forces writing \"max calls per run\". The number `prompts.length` is not a known integer → rule fails → write a cap. |\n| 2. Concrete iteration bound | `Promise.all(prompts.map(...))` has no integer bound → rule fails → wrap in chunks with `MAX_IMAGES_PER_RUN`. |\n| 3. Retry policy | Inngest default retries × no idempotency key = double-billed work. Rule forces an idempotency key per `(campaignId, promptHash)`. |\n| 4. Concurrency limit | `Promise.all` is unbounded concurrency. Rule forces `p-limit(3)` and Inngest `concurrency: { limit: 3 }`. |\n| 5. Provider hard cap | Fal Spend Limit $50\u002Fday would have stopped the bleeding at $50 instead of $200. |\n| 7. Amplifier audit | \"Self-rescheduling jobs\" — Inngest's retry IS self-rescheduling. The audit forces you to consider it. |\n\n**The fix that survives the protocol:**\n\n```ts\n\u002F\u002F cost contract:\n\u002F\u002F   provider: Fal flux-pro @ $0.05\u002Fimage\n\u002F\u002F   max calls per run: 50\n\u002F\u002F   max $ per run: $2.50\n\u002F\u002F   provider hard cap: $50\u002Fday (set in Fal dashboard 2026-05-22)\n\u002F\u002F   concurrency: 3 (Inngest + p-limit, matching)\n\u002F\u002F   idempotency: key = `${campaignId}:${sha1(prompt)}` — provider-side dedup window 24h\nconst MAX_IMAGES_PER_RUN = 50;\nconst limit = pLimit(3);\n\nexport const generateCampaign = inngest.createFunction(\n  {\n    id: 'gen-campaign',\n    concurrency: { limit: 3 },\n    retries: 2,                                        \u002F\u002F attempts = 1 + retries\n  },\n  { event: 'campaign\u002Fstart' },\n  async ({ event, step }) => {\n    const prompts = await step.run('fetch', () => fetchPrompts(event.data.id));\n    if (prompts.length > MAX_IMAGES_PER_RUN) {\n      throw new NonRetriableError(\n        `prompt count ${prompts.length} exceeds MAX_IMAGES_PER_RUN=${MAX_IMAGES_PER_RUN}`\n      );\n    }\n    await Promise.all(prompts.map(p => limit(() => step.run(\n      `img:${event.data.id}:${sha1(p)}`,               \u002F\u002F idempotency key\n      () => fal.run('fal-ai\u002Fflux-pro', { input: { prompt: p } })\n    ))));\n  }\n);\n```\n\nNote: the bug in `fetchPrompts` is still there. The protocol does not fix that bug — it makes the bug **cost $2.50 instead of $200** while you find it. That is the entire point of defense in depth.\n\n## Common runaway patterns and their wallet invariants\n\n| Pattern | Wallet invariant to write | Hard cap to set |\n|---|---|---|\n| Fan-out over a list of items | `total_cost ≤ list_len × unit_cost ≤ MAX_$_PER_RUN` | provider daily spend limit |\n| Retry on transient error | `total_cost ≤ attempts × unit_cost`, attempts ≤ 5 | provider daily spend limit; alert at 50% |\n| Agent loop (\"ask model what to do next\") | `total_cost ≤ MAX_STEPS × per_step_cost`, depth ≤ MAX_DEPTH | per-agent-run cost ceiling, kill-switch |\n| Polling for job completion | `total_cost ≤ ceil(MAX_WAIT_MS \u002F poll_interval) × poll_cost` | absolute deadline + alert |\n| Webhook handler → API call | idempotency key required; cycle if webhook is triggered by the same API | provider rate limit per key |\n| Stream reconnect | `attempts ≤ MAX_RECONNECTS`, exponential backoff with cap | provider connection cap |\n| Cache miss stampede | singleflight → `cost ≤ 1 × unit_cost` per key per window | n\u002Fa (deduped in code) |\n| Self-scheduling job | recursion depth bounded by ledger row, not by code | scheduler-level dedup + max runs\u002Fday |\n| Multi-provider fallback | sum across providers ≤ MAX_$_PER_RUN | hard cap on each provider separately |\n\n## Provider-specific cheat sheet\n\nSet these **before** the first deploy. None of them require code changes.\n\n### Fal.ai\n- Dashboard → **Billing → Spend Limit**. Daily and monthly hard caps. Hard stop on exceed.\n- Use **per-API-key** keys per environment (dev \u002F staging \u002F prod) and set a low limit on dev.\n- Webhooks: deliveries are paid; cap retries on your side.\n\n### Anthropic\n- Console → **Workspaces** → create a Workspace per environment.\n- Each Workspace gets a **Budget** with a **hard limit** (request blocking) and **soft limit** (email alert).\n- Use a per-Workspace API key — a leaked dev key cannot exceed the dev Workspace budget.\n- Prompt caching reduces cost ~90% for repeated context; cap is on unblended cost so caching extends the budget.\n\n### OpenAI\n- ⚠️ **Per-project monthly budgets are soft only.** OpenAI's Help Center documents project budgets as \"soft spending thresholds\" that send alerts but do **not** enforce a hard cap. A runaway can continue past the documented project budget.\n- For a real hard cap, use one of:\n  - **Org-level Usage limits** (Org → Settings → Limits) — block requests on exceed.\n  - A billing gateway \u002F proxy in front of the API that enforces fail-closed budgets.\n  - Your own fail-closed budget check in code that refuses calls past a ledgered $-cap.\n- Use separate projects per environment (dev\u002Fstaging\u002Fprod) for attribution and alerting, but do not rely on the project budget as the hard stop.\n\n### Replicate\n- Account → **Billing → Spend limit**. Account-wide hard cap.\n- Use separate tokens per environment; rotate on leak.\n\n### ElevenLabs\n- Workspace → **Usage limits**. Set per API key.\n- Voice cloning is billed per character; cap the character count in code AND per key.\n\n### Inngest (queue layer — not paid AI but the multiplier)\n- `concurrency: { limit: N }` on every function that calls a paid API.\n- `retries: 2` (Inngest default is **4 retries**, i.e. up to 5 attempts including the initial — confirm against current Inngest docs) for paid call functions; fewer attempts on idempotent failures. Worst-case wallet math: `attempts = 1 + retries`, so a default `step.run()` can bill **5×**, not 4×.\n- `NonRetriableError` for 4xx — never retry a 4xx into a paid API.\n- `idempotency: ...` on events you cannot deduplicate at the call site.\n\n## Edge cases to enumerate before shipping\n\n| Scenario | Expected behavior |\n|---|---|\n| Empty input list | 0 calls, 0 cost, return early — do not even auth |\n| Input list longer than MAX | reject with NonRetriableError, do not partial-process |\n| All calls fail with 4xx | 1 attempt each, no retry, surface error |\n| All calls fail with 5xx | bounded retries, total cost ≤ attempts × unit, alert on full exhaustion |\n| Concurrent invocation of the same job | idempotency key dedups; second invocation costs $0 |\n| Network partition mid-batch | partial cost banked; on resume, idempotency key prevents re-charge |\n| Provider rate-limit (429) | respect `Retry-After`; do not multiply retries inside SDK and outside |\n| Webhook retried by provider | idempotency at the handler boundary |\n| Local dev accidentally pointing at prod key | per-env keys + per-env caps make this cost $0.50, not $50 |\n| Cron fires while previous run still executing | concurrency limit = 1 OR explicit overlap-tolerant design |\n\n## Output discipline\n\nCode you emit must:\n\n- Have a `\u002F\u002F cost contract:` block above each call site with the four numbers (unit cost, max calls, max $\u002Frun, provider hard cap setting).\n- Use a named constant (`MAX_IMAGES_PER_RUN`, `MAX_AGENT_STEPS`) for the bound — never a magic number inline.\n- Wrap fan-out in `p-limit` or equivalent — never raw `Promise.all` over a paid API.\n- Pass an idempotency key for every mutating \u002F charging call.\n- Set queue-level concurrency and retries in the same file or document it.\n- Reject `4xx` retries via `NonRetriableError` or equivalent.\n- Reference the provider hard-cap setting by name (\"Fal Spend Limit $50\u002Fday, set 2026-05-22\") so a future reader knows it exists.\n\n## Related Skills\n\n- **invariant-guard** — when the loop or recursion calling the paid API has no written termination measure. Termination is a precondition for a wallet cap; invariant-guard establishes it, runaway-guard bounds the cost.\n- **complexity-cuts** — when the runaway has already shipped and you are diagnosing an unexpected bill. Treat the unintended fan-out as a complexity bug, write a characterization test, then transform one step at a time.\n- **lemmaly** — when designing a new agent loop or batch pipeline that fans out paid calls. Pick the algorithm and data structure first; come back here for the wallet invariant per step.\n- **mathguard** — when the cost driver is compute on a sublinear-algorithm problem (vector search, sketching, FFT) rather than per-call billing; mathguard sets the algorithmic floor that determines per-call work.\n\n## Rationalizations to watch for\n\n| Excuse | Reality |\n|---|---|\n| \"I'm only testing locally.\" | Local hits the same paid endpoint. A retry bug in test code bills the same dollars. |\n| \"The list is small, fan-out is fine.\" | The list is small *today*. Next week it is fetched from a table that grew 50×. The cap exists for next week. |\n| \"Inngest already retries, so I don't need a retry policy.\" | Inngest retries × your retry wrapper × SDK retries = 27 attempts. Each one bills. |\n| \"The API call is cheap, $0.001.\" | At 10,000 unintended invocations that is $10 — and the count is exactly what you failed to bound. |\n| \"I'll set the provider cap later.\" | The bug ships before \"later\". Set the cap in the 60 seconds it takes; the code can wait. |\n| \"Idempotency is overkill for this.\" | Webhooks retry. Load balancers retry. Browsers retry. Without an idempotency key, *something* will duplicate. |\n| \"We have monitoring, we'll catch it.\" | Monitoring catches it after $200 is spent. Caps prevent the $200 from being spent. |\n| \"It obviously terminates.\" | The $200\u002Fnight incident also \"obviously terminated\". Write the integer bound. |\n\nIf any of these sound familiar mid-thought: stop, write the cost contract, set the provider cap, then write the code.\n\n## Red flags — STOP and write the cost contract first\n\n- About to write `await Promise.all(items.map(x => paidApi(x)))` with no `p-limit`.\n- About to write `while (!done) await paidApi(...)` with no integer bound.\n- About to write an agent loop with \"the model decides when to stop\".\n- About to write a retry wrapper around a call that is already retried by Inngest \u002F SDK \u002F framework.\n- About to deploy a paid API key without first setting the provider dashboard cap.\n- About to commit a paid API key to a `.env` shared across environments.\n- About to handle a webhook that calls the API that produced the webhook.\n- \"Just for tonight\" — overnight is exactly when runaway loops bill the most.\n\nAll of these mean: stop, write the cost contract, set the provider cap, then write the code.\n\n## Verification checklist\n\nBefore shipping any code that calls a paid API:\n\n- [ ] Cost contract comment exists above each call site with unit cost, max calls\u002Frun, max $\u002Frun, provider cap.\n- [ ] The iteration \u002F fan-out bound is a named integer constant, not implicit in list length.\n- [ ] Concurrency limit is set in code (`p-limit`) AND at the queue (`Inngest concurrency`).\n- [ ] Retry policy is explicit: max attempts, 4xx → no retry, idempotency key per call.\n- [ ] Provider dashboard hard cap is set and the value is documented in the file.\n- [ ] Per-environment API keys; dev keys have lower caps than prod.\n- [ ] Amplifier audit (rule 7) has been performed and either \"none apply\" or each addressed.\n- [ ] A test exists for: empty input, oversized input rejected, 4xx not retried, idempotency key dedups duplicate invocation.\n- [ ] In the worst case the code bills ≤ MAX_$_PER_RUN, and even with a bug the provider cap stops loss at MAX_$_PER_DAY.\n\nCannot check every box? The code is example-correct, not bill-correct. Either fill the gap or do not connect a billing-enabled key.\n\n## Limitations\n\n- **Not a billing system.** runaway-guard enforces *intent* (caps, contracts, audits) at code-write time. It does not meter spend in production — pair it with the provider's hard cap and observability (LLM-cost dashboards, log alerts) for runtime enforcement.\n- **Provider-side caps may take minutes to enforce.** Anthropic Workspace Budgets, OpenAI usage limits, and Fal Spend Limits are reconciled on a delay measured in minutes, not milliseconds. A pathological burst within a single window can still exceed the cap modestly.\n- **No automated cost estimation for novel models.** The cost-contract numbers (unit cost, $\u002Frun) are inputs the author must look up; the skill does not maintain a per-model price table.\n- **Streaming and per-token pricing.** For per-token APIs (Anthropic, OpenAI), `max calls` is a proxy — the real cap is `max input tokens × max output tokens × per-token rate`. Adapt the protocol: replace `max calls per run` with `max tokens per run`.\n- **Compute-billed providers.** For long-running GPU jobs (training, video encoding) billed in seconds, replace \"calls\" with \"GPU-seconds\" in the contract; the discipline transfers but the units differ.\n- **Does not replace incident response.** When a bill has already arrived, escalate to `complexity-cuts` for the corrective rewrite — runaway-guard prevents the next one, not the current one.\n\n## The thesis, in one line\n\n> **Time bounds prevent stalls. Space bounds prevent OOMs. Dollar bounds prevent $200 mornings. AI assistants enforce the first two by default and ignore the third. runaway-guard makes them reason about the wallet first.**\n",{"name":5,"risk":24,"tags":25,"tools":34,"author":40,"source":41,"license":15,"date_added":42,"description":7,"source_repo":43,"source_type":41,"license_source":44},"safe",[26,27,28,29,30,31,32,33],"cost-safety","finops","ai-apis","agents","retries","concurrency","wallet-invariant","gateway",[35,36,37,38,39],"claude-code","antigravity","cursor","gemini-cli","codex-cli","morsechimwai","community","2026-05-28","morsechimwai\u002Flemmaly","https:\u002F\u002Fgithub.com\u002Fmorsechimwai\u002Flemmaly\u002Fblob\u002Fmain\u002FLICENSE","main","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Frunaway-guard",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill runaway-guard",{"tool":58,"command":59},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill runaway-guard",{"tool":61,"command":62},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill runaway-guard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frunaway-guard\u002FSKILL.md",true,[],[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]