python-integrations-resilience
Pythonで外部API連携を構築・レビューする際に、クライアント境界の設計、信頼性ポリシーの定義、契約テストの構造化を行い、タイムアウトやリトライ処理がない場合に改善を促すSkill。
📜 元の英語説明(参考)
Use when building or reviewing external API integrations in Python — designing client boundaries, defining outbound reliability policy, or structuring contract tests. Also use when provider SDK details leak into domain logic, outbound calls lack timeout/retry policy, or failure paths are untested.
🇯🇵 日本人クリエイター向け解説
Pythonで外部API連携を構築・レビューする際に、クライアント境界の設計、信頼性ポリシーの定義、契約テストの構造化を行い、タイムアウトやリトライ処理がない場合に改善を促すSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o python-integrations-resilience.zip https://jpskill.com/download/10637.zip && unzip -o python-integrations-resilience.zip && rm python-integrations-resilience.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10637.zip -OutFile "$d\python-integrations-resilience.zip"; Expand-Archive "$d\python-integrations-resilience.zip" -DestinationPath $d -Force; ri "$d\python-integrations-resilience.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
python-integrations-resilience.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
python-integrations-resilienceフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Python の統合と耐性
概要
外部統合は、プロバイダー固有の詳細が明示的なクライアント境界の背後に隠され、すべてのアウトバウンド操作が成功と失敗の両方のパスに対してテストされる定義済みの信頼性ポリシーを持つ場合に、信頼性を維持します。
これらの推奨事項を推奨されるデフォルトとして扱ってください。 プロジェクトの制約により逸脱が必要な場合は、トレードオフと補償コントロール(テスト、可観測性、ロールバック)を明示してください。
使用する場合
- 外部 API またはプロバイダー SDK の周りのクライアント境界を設計またはレビューする場合。
- アウトバウンド呼び出しにタイムアウト、再試行、またはべき等性ポリシーを追加または監査する場合。
- プロバイダー統合の契約または耐性テストを作成する場合。
- クライアントラッパーとアップストリームプロバイダー間の契約のずれを診断する場合。
- 特定のプロバイダー SDK に結合されたドメインロジックをリファクタリングする場合。
使用しない場合
- ネットワークまたは I/O 境界のない純粋なインプロセスライブラリ呼び出し。
- 外部契約リスクのない内部モジュールインターフェース。
- 既に分離された統合のパフォーマンスチューニング(
python-concurrency-performanceを参照)。
クイックリファレンス
- プロバイダー固有の詳細を明示的なクライアント境界の背後に隠します。
- ドメインロジックをプロバイダー SDK の詳細から分離します。
- すべてのアウトバウンド操作に明示的なタイムアウト/再試行/べき等性ポリシーを要求します。
- 契約マッピングと失敗動作の両方を直接テストします。
よくある間違い
- プロバイダーの型を境界を越えて渡す — 生の SDK レスポンスオブジェクトをドメインコードに返すことは、コードベース全体を 1 つのプロバイダーに結合します。
- 暗黙的または欠落しているタイムアウト — ライブラリのデフォルト(またはタイムアウトなし)に依存すると、遅いアップストリームがカスケード障害に変わります。
- 非べき等な呼び出しを再試行する — べき等性キーなしで
POSTを再試行すると、重複した副作用が発生するリスクがあります。 - ハッピーパスのみをテストする — タイムアウト、レート制限、および不正な形式のレスポンスシナリオをスキップすると、最も可能性の高い本番環境の障害が未解決のままになります。
- 再試行ポリシーをハードコーディングする — クライアントコードの奥深くにバックオフ定数を埋め込むと、再デプロイなしにチューニングできなくなります。
スコープに関する注意
- これらの推奨事項を、普遍的なルールではなく、一般的なケースに対する推奨されるデフォルトとして扱ってください。
- デフォルトがプロジェクトの制約と矛盾する場合、または結果を悪化させる場合は、より適切な代替案を提案し、その理由を説明してください。
- 逸脱する場合は、トレードオフと補償コントロール(テスト、可観測性、移行、ロールバック)を明示してください。
呼び出しに関する注意
- このスキルが名前で呼び出されていることをユーザーに通知します:
python-design-modularity。
参考文献
references/client-patterns.mdreferences/request-reliability-policy.mdreferences/resilience-and-contract-testing.md
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Python Integrations and Resilience
Overview
External integrations stay reliable when provider-specific details hide behind explicit client boundaries, and every outbound operation carries a defined reliability policy that is tested against both success and failure paths.
Treat these recommendations as preferred defaults. When project constraints demand deviation, call out tradeoffs and compensating controls (tests, observability, rollback).
When to Use
- Designing or reviewing client boundaries around external APIs or provider SDKs.
- Adding or auditing timeout, retry, or idempotency policy on outbound calls.
- Writing contract or resilience tests for provider integrations.
- Diagnosing contract drift between a client wrapper and the upstream provider.
- Refactoring domain logic that has coupled itself to a specific provider SDK.
When NOT to Use
- Pure in-process library calls with no network or I/O boundary.
- Internal module interfaces that carry no external contract risk.
- Performance tuning of already-isolated integrations (see
python-concurrency-performance).
Quick Reference
- Hide provider-specific details behind explicit client boundaries.
- Keep domain logic isolated from provider SDK specifics.
- Require explicit timeout/retry/idempotency policy for every outbound operation.
- Test both contract mapping and failure behavior directly.
Common Mistakes
- Letting provider types cross the boundary — returning raw SDK response objects into domain code couples the entire codebase to one provider.
- Implicit or missing timeouts — relying on library defaults (or no timeout at all) turns a slow upstream into a cascading failure.
- Retrying non-idempotent calls — retrying a POST without an idempotency key risks duplicate side effects.
- Testing only the happy path — skipping timeout, rate-limit, and malformed-response scenarios leaves the most likely production failures uncovered.
- Hardcoding retry policy — embedding backoff constants deep in client code prevents tuning without a redeploy.
Scope Note
- Treat these recommendations as preferred defaults for common cases, not universal rules.
- If a default conflicts with project constraints or worsens the outcome, suggest a better-fit alternative and explain why it is better for this case.
- When deviating, call out tradeoffs and compensating controls (tests, observability, migration, rollback).
Invocation Notice
- Inform the user when this skill is being invoked by name:
python-design-modularity.
References
references/client-patterns.mdreferences/request-reliability-policy.mdreferences/resilience-and-contract-testing.md