Agent skill · software engineering · jeremylongshore

oraclecloud-sdk-patterns

Production-grade OCI SDK patterns for client lifecycle, retry logic,

Why this skill is useful

Adds production-grade patterns for OCI SDK that prevent memory leaks and implement retry logic, which are not commonly known.

What it needs

Requires pip, python installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Oracle Cloud SDK Patterns Overview Production patterns for the OCI Python SDK that avoid the most common pitfalls: memory leaks from Instance Principal authentication (~10 MiB/hour if clients are recreated per request), missing retry logic for 429/500 errors, and timeout misconfiguration across different service clients. The OCI SDK has different timeout defaults depending on the service (Compute: 60s, Object Storage: 300s for uploads), and none of them set connection timeouts by default. Purpose: Provide correct client lifecycle (create once, reuse, close), exponential backoff retry, singleton patterns that prevent the Instance Principal memory leak, and per-service timeout configuration. Prerequisites Completed oraclecloud-install-auth — valid ~/.oci/config Python 3.8+ with pip install oci Familiarity with OCI service clients (ComputeClient, ObjectStorageClient, etc.) Instructions Step 1: Singleton Client Pattern (Avoids Memory Leak) Instance Principal authentication allocates new security tokens on each client instantiation. Creating clients per-request leaks ~10 MiB/hour. Use a singleton: Step 2: Timeout Configuration OCI SDK has no connection timeout by default. Set both connection and read timeouts explicitly: Step 3: Exponential Backoff Retry Strategy The built-in DEFAULTRETRYSTRATEGY retries on 429, 500, 502, 503, 504. For custom control: Step 4: Manual Retry with Error Classification For fine-grained control over which errors to retry: Step 5: Pagination Helper OCI API responses are paginated. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/oraclecloud-sdk-patterns--ef7db4

View the source on GitHub

Browse the @skills marketplace