retry
Skill2 starsChanged 4 months agoMITView on GitHub
Add retry-with-backoff to a flaky external call — a network request, database query, or third-party API — so transient failures recover instead of surfacing as errors, using the project's existing HTTP/client stack. Use when the user says "add a retry", "retry on failure", "add exponential backoff", "make this resilient to flaky network", "handle transient errors", or "this call fails intermittently".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- SonyHarv/claude-polyroutertheir own version, first seen Apr 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- SonyHarv/claude-polyrouter★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- audit-logSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- pre-commitSkill
- profileSkill
- prune-branchesSkill
- rate-limitSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- security-headersSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- squashSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Make it observable and reuse infra: Prefer the project's existing retry helper (p-retry, axios-retry, tenacity, resilience4j, Polly) over a …
- Distinctive: line 29
Always use bounded attempts plus exponential backoff with jitter and a total deadline — no unbounded or fixed-interval retry loops.
- Distinctive: line 31
After wiring, summarize what's retried, the retryable conditions, the backoff/jitter and attempt cap, and the idempotency assumption you …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Client & retry-library signals
!grep -rilE "axios|got|node-fetch|undici|ky|retry|p-retry|tenacity|backoff|resilience4j|polly|retryablehttp|httpx|requests" --include='*.*' package.json pyproject.toml go.mod Gemfile pom.xml 2>/dev/null | grep -vE 'node_modules|\.git|dist|build' | head -8
Instructions
Make the call in $ARGUMENTS resilient to transient failures. If it's unclear which call is flaky or what its idempotency guarantees are, ask before wrapping it — retrying the wrong operation can double-charge or double-write. Reuse the project's existing client and any retry helper already present.
Method
- Confirm the operation is safe to retry. Only retry idempotent operations (GETs, reads, PUT/DELETE by id, or writes protected by an idempotency key). Retrying a non-idempotent POST (charge, send, create-without-key) can duplicate the effect — flag that and either skip retry or add an idempotency key first.
- Retry only transient, retryable failures. Network timeouts, connection resets,
429, and5xxare retryable.4xx(bad request, auth, not found) are not — retrying them just wastes time and hammers the dependency. Match on those specifically rather than retrying every exception. - Use exponential backoff with jitter. Space attempts out (e.g. 100ms, 200ms, 400ms…) with random jitter so concurrent clients don't retry in lockstep and create a thundering herd. Honor a
Retry-Afterheader when the response provides one. - Bound the retries. Cap attempts (typically 3–5) and the total elapsed time so a failing dependency surfaces an error promptly instead of hanging the request. Pair with a sensible per-attempt timeout. Mention a circuit breaker if the project already has one or the call is hot.
- Make it observable and reuse infra. Prefer the project's existing retry helper (
p-retry, axios-retry,tenacity, resilience4j, Polly) over a hand-rolled loop. Log/trace retry attempts so flakiness is visible, and let the final failure propagate cleanly after retries are exhausted.
Rules
- Retry only idempotent operations; for non-idempotent writes, add an idempotency key first or don't retry — never risk a duplicate side effect silently.
- Retry only transient/retryable errors (timeouts,
429,5xx); never retry4xxor programming errors. - Always use bounded attempts plus exponential backoff with jitter and a total deadline — no unbounded or fixed-interval retry loops.
- Honor
Retry-After, reuse the project's retry library and client, and make attempts observable rather than silent. - After wiring, summarize what's retried, the retryable conditions, the backoff/jitter and attempt cap, and the idempotency assumption you relied on.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

