superpowers-python-automation — скилл для Claude Code
Скилл superpowers-python-automation настраивает правила создания надёжных Python-скриптов для работы с REST API: повторы запросов, таймауты, пагинацию и тесты. Пригодится при написании интеграций и синхронизаций данных.
MIT 1 установок ★ 852 обновлён 2026-01-18
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a claude-codeЧто делает superpowers-python-automation
Скилл задаёт архитектуру и правила для скриптов на Python, работающих с внешними REST API. Базовый стек опирается на библиотеку httpx для сетевых запросов и pytest с пакетом respx для тестов. Конфигурация выносится в переменные окружения через pydantic-settings. Проект делится на отдельные файлы: клиент в client.py, структуры данных в models.py, логика передачи в sync.py и запуск через main.py.
Запросы без явных таймаутов на соединение и чтение запрещены, иначе скрипт рискует зависнуть. Повторные попытки разрешаются для сетевых сбоев, ошибок сервера и превышения лимитов с учётом заголовка Retry-After. Ошибки клиента повторно не отправляются, чтобы не тратить запросы впустую. Для надёжности скилл требует сохранять состояние через заголовок Idempotency-Key или локальную базу SQLite.
Токены авторизации и конфиденциальные заголовки исключены из логов. Для проверки работы перед записью скилл обязывает агента добавить флаг --dry-run.
Какие задачи решает
- Настроить HTTP-клиент с обработкой повторов и таймаутов
- Реализовать постраничную загрузку данных с лимитом шагов
- Предотвратить дублирование записей через заголовок идемпотентности или
SQLite - Подготовить тесты для логики трансформации данных с моками на
respx
Примеры запросов агенту
- Напиши скрипт синхронизации данных из REST API в
sync.pyс обработкой пагинации через курсор - Создай клиент на
httpxс повторами сетевых ошибок и тестами наpytest - Собери CLI-утилиту в
main.pyс поддержкой флага dry-run для проверки выгрузки
Как установить superpowers-python-automation
1Через Skills CLI (Vercel)
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a claude-code2Вручную: положить файлы
~/.claude/skills/superpowers-python-automation/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/superpowers-python-automation/
1Через Skills CLI (Vercel)
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a codex2Вручную: положить файлы
.agents/skills/superpowers-python-automation/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a cursor2Вручную: положить файлы
.cursor/skills/superpowers-python-automation/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install anthonylee991/gemini-superpowers-antigravity .agent/skills/superpowers-python-automation2Вручную: положить файлы
.github/skills/superpowers-python-automation/SKILL.md1Через Skills CLI (Vercel)
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a gemini-cli2Командой платформы
gemini skills install https://github.com/anthonylee991/gemini-superpowers-antigravity --path .agent/skills/superpowers-python-automationВручную: положить файлы
.devin/skills/superpowers-python-automation/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о superpowers-python-automation
Как установить superpowers-python-automation в Claude Code?
Выполните команду npx skills add anthonylee991/gemini-superpowers-antigravity --skill superpowers-python-automation -a claude-code. Файл сохранится по пути ~/.claude/skills/superpowers-python-automation/SKILL.md.
Зачем нужен скилл superpowers-python-automation?
Он задаёт стандарты автоматизации: обязательные таймауты, правила повтора сетевых сбоев, защиту от дублей и изоляцию токенов от логов.
Какой HTTP-клиент скилл использует по умолчанию?
Основным клиентом выбран httpx, но скилл разрешает использовать requests, если это принято в текущем проекте.
Исходный текст
SKILL.md · MIT
--- name: superpowers-python-automation description: Implements reliable automations in Python for REST APIs: httpx/requests patterns, retries, timeouts, pagination, typing, config, logging, and tests. Use when writing Python scripts/services that call external APIs. --- # Python Automation Skill This skill provides concrete Python patterns to implement robust REST API automations. ## When to use this skill - Python scripts that call one or more REST APIs - ETL jobs, sync tools, webhook handlers - CLI tools or small services that integrate external systems ## Preferred stack (defaults) - HTTP client: **httpx** (preferred) or requests - Config: env vars + `.env` (optional) with pydantic-settings if appropriate - Logging: stdlib `logging` with structured-ish fields - Testing: pytest (+ respx for httpx mocking when useful) If the project already uses different tools, follow project conventions. --- ## Reference architecture (small but scalable) - `client.py`: API client wrapper (auth headers, retries, pagination helpers) - `models.py`: typed payload models (dataclasses or pydantic) - `sync.py`: orchestration logic (fetch -> transform -> upsert) - `main.py`: CLI entrypoint - `tests/`: unit tests for transform + client behavior ## HTTP rules (mandatory) - Always set timeouts (connect + read) - Centralize request sending in one function so retries/logging are consistent - Never log secrets (Authorization headers, tokens) ### Retry policy guidance Retry on: - network errors/timeouts - 429 (respect Retry-After when present) - 500–599 Optional: 408, and 409 only if operation is safe and semantics known Do NOT retry on: - most 400–499 (unless explicitly safe) ### Timeouts - Set explicit timeouts; do not rely on defaults. - Use smaller connect timeout; moderate read timeout. --- ## Pagination patterns Support at least one helper that can handle: - `next` URL in response - cursor token in response - page/limit parameters Add a hard stop: - max pages OR max items OR max elapsed time --- ## Idempotency patterns (Python) Choose and document: - Use an `Idempotency-Key` header when supported - Upsert using a stable `external_id` - Persist a lightweight state store: - simplest: SQLite file (recommended for OSS) - alternative: JSONL log + compaction Minimum: ensure repeated runs don’t create duplicates. --- ## Observability (Python) Minimum logs should include: - `run_id` - request: method, url/path, status_code, elapsed_ms, attempt - record counts: processed/created/updated/skipped/failed Also include a final summary log line. --- ## Verification requirements For non-trivial work, add: - unit tests for mapping/transform logic - at least one test for pagination or retry behavior (mocked) - a “dry-run” CLI flag (prints intended writes) --- ## Output format when writing code - Provide a small directory layout - Explain how to configure env vars - Include exact commands to run (and test)
© anthonylee991 · MIT · anthonylee991/gemini-superpowers-antigravity