crontap-retries-and-idempotency — скилл для Claude Code
Настраивает политику повторов в Crontap и помогает сделать эндпоинт идемпотентным, чтобы повторный запуск не создавал дублей.
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-codeЧто делает crontap-retries-and-idempotency
Скилл ведёт агента по шагам: сначала посмотреть историю запусков и разнести сбои по классам, потом добавить идемпотентность на стороне эндпоинта, и только после этого менять политику повторов через MCP. Для правки используется update_schedule, для разбора сбоев — get_schedule_history.
Базовые задержки ограничены значениями 30000, 60000, 300000 и 900000 миллисекунд, максимум повторов — 5. Классы 5xx, 429, network и timeout считаются временными, а 4xx добавляют только тогда, когда конкретный эндпоинт отвечает так из-за перегрузки. Повторять ошибки авторизации и валидации смысла нет: нагрузка растёт, а успешных доставок не прибавляется.
Настройка своей политики доступна на Pro, Ultra и legacy Pro, на Starter остаётся стандартное поведение. Для работы нужен либо MCP-сервер Crontap по адресу https://mcp.crontap.com/mcp, либо переменные $CRONTAP_CLIENT_ID и $CRONTAP_API_KEY — второй путь только для Ultra. Если пойти через REST, PUT заменяет расписание целиком: без повторного GET легко стереть заголовки, тело запроса и интеграции. Ключ дедупликации нельзя хранить в памяти процесса — при рестарте или нескольких инстансах защита пропадёт.
Какие задачи решает
- разнести сбои расписания по временным и постоянным
- сделать эндпоинт устойчивым к повторной доставке одной задачи
- выбрать задержку и число повторов под конкретный эндпоинт
- найти источник дублей: логика приложения или ретрай Crontap
- проверить, что алерт приходит после окончательного провала, а не после успешного восстановления
Примеры запросов агенту
- Посмотри историю расписания
<schedule-id>и скажи, какие сбои тут временные - Добавь идемпотентность в обработчик и проверь его двумя одинаковыми запросами
- Включи повторы для
<schedule-id>с задержкой 60000 мс на5xxиtimeout
Как установить crontap-retries-and-idempotency
1Через Skills CLI (Vercel)
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-code2Вручную: положить файлы
~/.claude/skills/crontap-retries-and-idempotency/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/crontap-retries-and-idempotency/
1Через Skills CLI (Vercel)
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a codex2Вручную: положить файлы
.agents/skills/crontap-retries-and-idempotency/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a cursor2Вручную: положить файлы
.cursor/skills/crontap-retries-and-idempotency/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Crontap/skills crontap-retries-and-idempotency2Вручную: положить файлы
.github/skills/crontap-retries-and-idempotency/SKILL.md1Через Skills CLI (Vercel)
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a gemini-cli2Командой платформы
gemini skills install https://github.com/Crontap/skills --path skills/crontap-retries-and-idempotencyВручную: положить файлы
.devin/skills/crontap-retries-and-idempotency/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о crontap-retries-and-idempotency
Как установить crontap-retries-and-idempotency в Claude Code?
Выполните npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-code. Файл скилла появится по пути ~/.claude/skills/crontap-retries-and-idempotency/SKILL.md.
Что делает crontap-retries-and-idempotency?
Помогает настроить политику повторов расписания Crontap и подготовить эндпоинт к повторной доставке одной и той же задачи. Отдельно разбирает случаи, когда дубли появляются не из-за ретраев.
Что нужно, чтобы скилл заработал?
Либо подключённый MCP-сервер Crontap на https://mcp.crontap.com/mcp, либо переменные $CRONTAP_CLIENT_ID и $CRONTAP_API_KEY для прямого API. Своя политика повторов доступна на Pro, Ultra и legacy Pro.
Исходный текст
SKILL.md · MIT
---
name: crontap-retries-and-idempotency
description: >
Configure Crontap retry policy safely and design scheduled endpoints so
repeated requests do not duplicate side effects. Use when a user needs
reliable delivery, exponential backoff, or help diagnosing duplicate work.
license: MIT
metadata:
version: "1.0.1"
group: patterns-migrations
order: 7
title: Make retries safe
summary: Keep retries bounded and side effects idempotent, with the final delivery outcome visible in schedule history.
bestFor: Backoff policies, duplicate prevention, and recovery
guide: https://crontap.com/blog/introducing-automatic-retries-with-exponential-backoff
guideTitle: Automatic retries
tools: update_schedule,get_schedule_history
---
# Retries and idempotency
Retries improve delivery only when the endpoint can safely receive the same
logical job more than once. Make the receiver idempotent before broadening a
retry policy.
## Prerequisites
Before using the required tools, check whether they are available. If any are
missing, stop and offer the user exactly two choices:
1. Connect Crontap MCP at `https://mcp.crontap.com/mcp`. MCP access works on
every Crontap tier.
2. Configure `$CRONTAP_CLIENT_ID` and `$CRONTAP_API_KEY` for the raw API. Raw
API access requires Ultra.
Do not silently choose a path or continue until the user selects one.
- Identify the schedule and each side effect it can create.
- Decide which failures are transient for this endpoint.
- Choose a stable deduplication key and retention window.
## Workflow
1. Inspect recent history to classify failures.
2. Add endpoint idempotency and test duplicate requests.
3. Use MCP to update only the schedule's retry policy.
4. Verify a controlled transient failure and its eventual success.
5. Recheck history for attempt count, delay, and final outcome.
## MCP examples
Inspect failures before changing policy:
```json
{
"tool": "get_schedule_history",
"arguments": {
"scheduleId": "<schedule-id>",
"limit": 50
}
}
```
Retry common transient classes:
```json
{
"tool": "update_schedule",
"arguments": {
"scheduleId": "<schedule-id>",
"retryPolicy": {
"enabled": true,
"maxRetries": 3,
"baseDelayMs": 60000,
"retryOn": ["5xx", "429", "network", "timeout"]
}
}
}
```
Allowed base delays are 30000, 60000, 300000, and 900000 milliseconds. The
maximum retry count is 5. Include `4xx` only when this specific endpoint uses a
known transient 4xx response.
## Endpoint idempotency pattern
Use a unique database constraint or atomic insert keyed by a logical job
identity:
```text
key = job-name + ":" + scheduled-period
insert key before side effects
if key already exists, return the recorded result
perform side effects once
store completion outcome
```
For money movement, email, provisioning, or external writes, pass the same key
to downstream systems that support idempotency. Do not rely on an in-memory
set, because restarts and multiple instances lose that protection.
## REST fallback
MCP partial update remains the preferred path and is not Ultra-only. A public
REST PUT is a full replacement, so never send only `retryPolicy`.
With Ultra credentials, GET the current full schedule first. Build a complete
replacement containing at least `url`, `verb`, `interval`, and `timezone`.
Preserve all other configuration fields, including headers, body, integrations,
and schedule options. Preserve credentials and secrets without logging them.
Change only `retryPolicy`, then PUT the complete replacement body to
`https://api.crontap.com/v1/schedule/<schedule-id>`.
## Verification
- Send the same logical request twice and verify one durable side effect.
- Induce a safe transient failure in a non-production target.
- Confirm history records the retries and final result expected by the policy.
- Confirm alerting occurs after the final failed outcome, not on a successful
recovery.
## Safety and plan limits
- Custom retry policy settings require Pro, Ultra, or legacy Pro. Standard
automatic retry behavior remains available on Starter.
- Retrying authentication and validation failures usually adds load without
improving success.
- Never reduce idempotency retention below the maximum retry window.
- If configuration returns `RETRY_POLICY_NOT_CONFIGURABLE`, present the
structured four-option ladder and smallest viable option.
## Troubleshooting
- Duplicate work with one history entry usually comes from application logic
or another caller, not a Crontap retry.
- Duplicate work across attempts means the receiver's dedupe transaction is
incomplete or scoped too narrowly.
- Repeated 429 responses require rate-limit coordination, not more attempts.
- A partial REST replacement can erase schedule settings. Re-fetch before
retrying after a concurrent change.
## References
- [Crontap Agent Skills catalogue](https://crontap.com/skills)
- [Automatic retries with exponential backoff](https://crontap.com/blog/introducing-automatic-retries-with-exponential-backoff)
- [Cron troubleshooting](https://crontap.com/guides/cron-troubleshooting)
- [Cron job monitoring](https://crontap.com/cron-job-monitoring)
- [Live REST API reference](https://api.crontap.com/docs/)
- [Machine-readable product reference](https://crontap.com/llms.txt)
© Crontap · MIT · Crontap/skills