robisson/build-like-amazon-agent-skills/dependency-management
Claude Code and agent skill by robisson/build-like-amazon-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Managing external dependencies safely with circuit breakers, timeouts, retries with exponential backoff, bulkhead pattern, graceful degradation, and dependency isolation.
Install
npx vskill@latest install robisson/build-like-amazon-agent-skills/dependency-managementSKILL.md
The same SKILL.md was published earlier as robisson/build-like-amazon-agent-skills/dependency-management.
Dependency Management
Overview
Every external dependency is a liability. Every network call can fail, every downstream service can become slow, every database can become overloaded. Dependency management is the discipline of treating every external interaction as unreliable and building defenses that keep your service healthy even when dependencies are not.
At Amazon, a single service may depend on dozens of other services, databases, caches, and external APIs. Without proper dependency management, a slowdown in one dependency cascades into a full system outage—the "thundering herd" or "retry storm" that has caused some of Amazon's most significant incidents.
The core principle: your service's availability is the product of its dependencies' availabilities, unless you actively decouple from them. If you depend on 5 services each at 99.9% availability and do nothing, your service can only be 99.5% available. Proper dependency management breaks this multiplication.
When to Use
- Making any HTTP call to another service
- Querying any database or cache
- Calling any third-party API
- Publishing to or consuming from message queues
- Reading from configuration services
- Any I/O operation that crosses a network boundary
Amazon Context
Amazon's distributed architecture means most requests traverse multiple services. The call graph for a single customer request might involve 50+ services. Without dependency isolation, a single slow service can cause a cascading failure that takes down the entire customer experience.
Key lessons learned:
- The 2004 outage taught Amazon that retries without backoff amplify failures (retry storms)
- The "thundering herd" incidents taught that all callers recovering simultaneously overwhelms the recovering service
- The "gray failures" (slow but not dead services) are harder to detect and more damaging than hard failures
Amazon's architecture mandates: circuit breakers at every service boundary, timeouts on every call, retries with jitter, and bulkheads isolating failure domains. These are not optional patterns—they are architectural requirements enforced through ORR.
The Process
1. Timeouts (First Line of Defense)
Every external call has an explicit timeout. Never use defaults.
Timeout rules:
| Dependency Type | Connect Timeout | Read Timeout | Rationale | |
|---|---|---|---|---|
| Internal service (same region) | 1s | 5s | Should be fast; detect failures quickly | |
| Internal service (cross-region) | 2s | 10s | Network latency is higher | |
| Database (primary) | 1s | 3s | DB calls should be fast; slow = problem | |
| Cache (Redis/Memcached) | 500ms | 1s | Cache misses should be fast | |
| External third-party API | 2s | 15s | Less control, but still bound it | |
| Non-critical dependency | 500ms | 2s | Fail fast, degrade gracefully |
2. Retries with Exponential Backoff and Jitter
Retries are essential but dangerous. Without backoff, retries amplify load on a struggling service:
Retry rules:
- Only retry transient errors — never retry 400s, auth failures, or validation errors
- Exponential backoff — 100ms → 200ms → 400ms (not 100ms → 100ms → 100ms)
- Full jitter — randomize wait time to prevent thundering herd
- Limited attempts — 3 attempts maximum for synchronous paths
- Budget-based retries — limit total retries per time window (e.g., 10% of traffic can be retries)
3. Circuit Breakers
Circuit breakers prevent calling a known-failing dependency:
Circuit breaker states:
Circuit breaker metrics to emit:
CircuitBreaker.StateChange(with from/to dimensions)CircuitBreaker.Rejected(requests rejected while open)CircuitBreaker.HalfOpenSuccess/CircuitBreaker.HalfOpenFailure
4. Bulkhead Pattern
Bulkheads isolate dependency failures so one bad dependency doesn't consume all resources:
Bulkhead strategies:
| Strategy | Use When | Implementation | |
|---|---|---|---|
| Thread pool isolation | Blocking I/O calls | Separate ThreadPoolExecutor per dependency | |
| Semaphore isolation | Async calls | asyncio.Semaphore limiting concurrent calls | |
| Connection pool isolation | Database connections | Separate connection pools per use case | |
| Queue isolation | Message processing | Separate queues for different priority levels |
5. Graceful Degradation Strategy
Classify every dependency as critical or non-critical:
6. Dependency Isolation Architecture
7. Dependency Client Template
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dependency-management/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/robisson/build-like-amazon-agent-skills/dependency-management)