SU

superpowers-python-automation

Provides robust patterns for building reliable Python-based REST API integrations.

Install

mkdir -p .claude/skills/superpowers-python-automation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6109" && unzip -o skill.zip -d .claude/skills/superpowers-python-automation && rm skill.zip

Installs to .claude/skills/superpowers-python-automation

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
214 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Implement retry logic for network errors and 429/5xx status codes
  • Configure explicit connect and read timeouts
  • Support pagination via next URL, cursor, or page parameters
  • Enforce idempotency using headers or state stores
  • Generate structured logs for request metrics

How it works

The skill provides a reference architecture for API clients that centralizes request logic, enforces mandatory timeouts, and applies consistent retry policies. It uses helper functions to manage pagination and idempotency to ensure reliable data synchronization.

Inputs & outputs

You give it
API endpoint configuration and request parameters
You get back
Validated response data or processed records

When to use superpowers-python-automation

  • Building a robust API client
  • Implementing retry logic for API calls
  • Writing an ETL sync script

About this skill

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)

When not to use it

  • Simple scripts not requiring error handling or scalability
  • Environments where standard library requests are strictly prohibited

Prerequisites

Python environment with httpx or requests installed

Limitations

  • Requires manual implementation of idempotency logic
  • Retry policies must be explicitly configured for specific status codes

How it compares

It enforces a standardized, testable architecture for API interactions rather than using ad-hoc request calls without error handling.

Compared to similar skills

superpowers-python-automation side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
superpowers-python-automation (this skill)36moReviewIntermediate
telegram-bot-builder1066moReviewIntermediate
signalwire-agents-sdk05moReviewIntermediate
component-search17moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

signalwire-agents-sdk

diegosouzapw

Expert assistance for building SignalWire AI Agents in Python. Automatically activates when working with AgentBase, SWAIG functions, skills, SWML, voice configuration, DataMap, or any signalwire_agents code. Provides patterns, best practices, and complete working examples.

00

component-search

redpanda-data

This skill should be used when users need to discover Redpanda Connect components for their streaming pipelines. Trigger when users ask about finding inputs, outputs, processors, or other components, or when they mention specific technologies like "kafka consumer", "postgres output", "http server", or ask "which component should I use for X".

12

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

5201,086

fastapi-pro

sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

79181

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

Search skills

Search the agent skills registry