Resource lifecycle design helps you manage things like memory, files, and network connections. You decide when to create them, when to use them, and when to clean them up. This skill shows safe patterns like RAII, lazy initialization, connection pools, and guards. These patterns prevent leaks and errors. They make your code more reliable.
Think about the cost of a resource. Cheap resources can be created each time. Expensive ones should be pooled or cached. Global resources use lazy singletons. Also consider the scope. A function‑local resource can live on the stack. A request‑scoped resource is passed around. An application‑wide resource is shared across threads.
Errors matter too. If cleanup must always happen, use the Drop trait. If cleanup is optional, use an explicit close method. If cleanup can fail, return a Result from close. These choices keep your program safe and efficient.
Global
mkdir -p ~/.claude/skills/m12-lifecycleProject
mkdir -p .claude/skills/m12-lifecycleSource Repository
Typescript Advanced Typeswshobson/agents
Master advanced TypeScript types for safer and more flexible code
Python Executorqu-skills/skills
Execute Python code safely with 100+ libraries for data, scraping, and media
Golang Error Handlingsamber/cc-skills-golang
Learn to create, wrap, inspect, and log Go errors like a professional engineer
Golang Performancesamber/cc-skills-golang
Speed up your Go code using proven patterns for allocation reduction and CPU efficiency
Golang Design Patternssamber/cc-skills-golang
Idiomatic Go patterns for clean constructors error handling and graceful shutdown
Golang Concurrencysamber/cc-skills-golang
Write safe Go concurrency with goroutines, channels, and sync primitives
Golang Data Structuressamber/cc-skills-golang
Optimize Go data structures for speed and memory efficiency with internals knowledge
Golang Contextsamber/cc-skills-golang
Master Go context for cancellations, timeouts, and request values