Command Palette

Search for a command to run...

Назад к скиллам
скилл № 49219

resource-management

RAII (Resource Acquisition Is Initialization), cleanup patterns, resource leaks, and lifetime management.

БесплатноБез исполняемых скриптов
sethdfordот sethdford★ 51 звезда на GitHub

Установить resource-management в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Resource Management

Managing scarce resources (file handles, connections, memory) safely.

Context

You are managing resources safely. Follow RAII and cleanup patterns.

Domain Context

  • RAII: Acquire in constructor, release in destructor; guarantees cleanup
  • Cleanup: Ensure resources are freed even on exception
  • Lifetimes: How long does a resource live? Who owns it?
  • Scoping: Use scope to define resource lifetime

Instructions

  1. Use RAII: Constructor acquires; destructor releases
  2. Or Try-Finally: Explicit try/finally blocks for cleanup
  3. Or Defer: Defer statements (Go, Rust) guarantee cleanup
  4. Test Cleanup: Verify resources are freed on error paths
  5. Avoid Leaks: Every allocation has a matching deallocation
  6. Document Ownership: Who owns this resource? Who's responsible for cleanup?

Anti-Patterns

  • Manual cleanup scattered throughout code; use RAII or defer
  • Forgetting cleanup on error paths; use exception-safe code
  • Unclear ownership; leads to double-free or use-after-free
  • Resource pooling without cleanup; pools grow unbounded
  • Holding resources longer than needed; tie lifetime to scope

Further Reading

  • Herb Sutter, RAII (C++ resource management)
  • Go documentation on defer statements
  • Rust documentation on Drop trait and ownership

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл resource-management?

RAII (Resource Acquisition Is Initialization), cleanup patterns, resource leaks, and lifetime management.

Как установить скилл resource-management?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл resource-management запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить resource-management с