0157-python-resource-management

Community

Reliably clean up resources with context managers

AuthorMrJmpl3
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you prevent resource leaks and unstable behavior by ensuring connections, file handles, and streams are cleaned up deterministically even when errors occur.

Core Features & Use Cases

  • Sync context managers: Use with plus __enter__/__exit__ to guarantee unconditional cleanup of acquired resources.
  • Async context managers: Use async with plus __aenter__/__aexit__ to manage pooled or transactional async resources safely.
  • Operational patterns for robustness: Choose when to suppress specific exceptions (e.g., client disconnects), accumulate streaming state efficiently, and manage a dynamic set of resources via ExitStack/AsyncExitStack.

Quick Start

Use the 0157-python-resource-management skill to wrap a database connection or file handle in a context manager so it is always released, even if your code raises an exception.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: 0157-python-resource-management
Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0157-python-resource-management

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.