Agent Skill
Python Resource Management skill
python-resource-managementwshobson/agentsplugins/python-development/skills/python-resource-management/SKILL.md
Python resource management with context managers, cleanup patterns, and streaming. Use when managing connections, file handles, implementing cleanup logic, or building streaming responses with accumulated state.
always on
37 tokname + description
once used
1,507 tokSKILL.md body
bundled files
15 KB
repo stars
42kGitHub
Install the Python Resource Management skill
Skills CLI (Claude Code, Codex, Cursor and others)
npx skills add https://github.com/wshobson/agents --skill python-resource-management
Claude Code, by hand (all projects)
git clone --depth 1 https://github.com/wshobson/agents.git /tmp/agents mkdir -p ~/.claude/skills cp -R /tmp/agents/plugins/python-development/skills/python-resource-management ~/.claude/skills/python-resource-management
For one project only, copy the folder into .claude/skills/ in that project instead. The agent picks it up when a task matches its description.
What it costs your context
Agent Skills load in three steps. Tokens counted with the o200k tokenizer; your model's count will differ a little.
| When | What loads | Cost |
|---|---|---|
| Every session | Name and description | 37 tok |
| When the agent uses it | The SKILL.md instructions | 1,507 tok |
| Only if opened | 1 bundled files (5 KB) | varies |
Until it is used, python-resource-management costs about 37× less than the median MCP server we measured (1,362 tokens on every turn). Installing all 150 skills from wshobson/agents would load 7,688 tokens of descriptions. Skills vs MCP study
Checks
Our checks found nothing to flag: it follows the Agent Skills specification's naming and size guidelines and doesn't pipe downloads into a shell.
Checked 2026-10-22 · method
What's inside
The headings of its SKILL.md. Read the full file on GitHub.
- Python Resource Management
- When to Use This Skill
- Core Concepts
- 1. Context Managers
- 2. Protocol Methods
- 3. Unconditional Cleanup
- 4. Exception Handling
- Quick Start
- Fundamental Patterns
- Pattern 1: Class-Based Context Manager
- Pattern 2: Async Context Manager
- Pattern 3: Using @contextmanager Decorator
- Pattern 4: Unconditional Resource Release
- Detailed worked examples and patterns
- Best Practices Summary
More skills from wshobson/agents
- typescript-advanced-typeswshobson/agents
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
91k57 tok idle · 1,998 in use - tailwind-design-systemwshobson/agents
Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.
70k42 tok idle · 1,508 in use - airflow-dag-patternswshobson/agents
Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.
42k42 tok idle · 713 in use - angular-migrationwshobson/agents
Migrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.
42k42 tok idle · 1,622 in use - anti-reversing-techniqueswshobson/agents
Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.
42k66 tok idle · 753 in use - api-design-principleswshobson/agents
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
42k144 tok idle · 762 in use - architecture-decision-recordswshobson/agents
Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.
42k41 tok idle · 1,101 in use - architecture-patternswshobson/agents
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.
42k65 tok idle · 1,558 in use