What problem does it solve? Python resources like database connections, file handles, and network sockets leak when cleanup is forgotten or exceptions interrupt normal flow. This Skill provides patterns for guaranteeing resource release using context managers, plus techniques for streaming responses with accumulated state. ## Core Features & Use Cases - Context Manager Patterns: Class-based __enter__/__exit__ implementations, @contextmanager decorators, and async variants with __aenter__/__aexit__ for database pools and transactions. - Unconditional Cleanup: Guaranteed resource release even on exceptions, selective exception suppression, and multi-resource management with ExitStack/AsyncExitStack. - Streaming with State: Accumulate streamed chunks efficiently with list-join instead of O(n²) string concatenation, and track metrics like time-to-first-byte. - Use Case: When building an API endpoint that streams LLM responses while holding a database connection, use these patterns to ensure the connection closes even if the client disconnects mid-stream. ## Quick Start Show me how to write an async context manager that manages a database connection pool with guaranteed cleanup on exceptions.