m12-lifecycle은(는) 무엇을 하나요?
리소스 수명 주기를 설계할 때 사용합니다. 키워드: RAII, Drop, 리소스 수명 주기, 연결 풀, 지연 초기화, 연결 풀 설계, 리소스 정리 패턴, 정리, 범위, OnceCell, Lazy, once_cell, OnceLock, 트랜잭션, 세션 관리, Drop 호출 시점, 오류 시 정리, 가드 패턴, scope guard, 资源生命周期, 连接池, 惰性初始化, 资源清理, RAII 模式
리소스 수명 주기 설계에 사용됩니다. RAII, Drop, 리소스 수명 주기, 연결 풀, 지연 초기화, 리소스 정리 패턴, 범위, OnceCell, Lazy, 트랜잭션, 세션 관리 같은 키워드와 관련이 있습니다.
이 스킬은 리소스 수명 주기를 안전하고 효율적으로 설계하는 방법을 안내합니다. RAII(Resource Acquisition Is Initialization), Drop 트레잇, 연결 풀, 지연 초기화, 리소스 정리 패턴과 같은 핵심 개념을 다룹니다. 개발자는 OnceCell, Lazy, OnceLock 같은 동기화 원시 타입을 사용하여 지연 초기화를 구현하고, scope guard 패턴을 통해 오류 발생 시에도 안전하게 리소스를 정리할 수 있습니다. 이 스킬은 Rust, C++ 등 RAII를 지원하는 언어에서 특히 유용하며, 트랜잭션 관리, 세션 관리, 연결 풀 설계와 같은 실용적인 시나리오를 설명합니다. SKILL.md 문서는 리소스 수명 주기의 각 단계에서 발생할 수 있는 문제와 해결 방안을 코드 예제와 함께 제시하여, 안전하고 예측 가능한 리소스 관리를 돕습니다.
npx skills add https://github.com/actionbook/rust-skills/tree/main/skills/m12-lifecycle리소스 수명 주기를 설계할 때 사용합니다. 키워드: RAII, Drop, 리소스 수명 주기, 연결 풀, 지연 초기화, 연결 풀 설계, 리소스 정리 패턴, 정리, 범위, OnceCell, Lazy, once_cell, OnceLock, 트랜잭션, 세션 관리, Drop 호출 시점, 오류 시 정리, 가드 패턴, scope guard, 资源生命周期, 连接池, 惰性初始化, 资源清理, RAII 模式
This repo contains 13 individual skills — each has its own dedicated page.
CRITICAL: Use for ownership/borrow/lifetime issues. Triggers: E0382, E0597, E0506, E0507, E0515, E0716, E0106, value moved, borrowed value does not live long enough, cannot move out of, use of moved value, ownership, borrow, lifetime, 'a, 'static, move, clone, Copy, 所有权, 借用, 生命周期
CRITICAL: Use for smart pointers and resource management. Triggers: Box, Rc, Arc, Weak, RefCell, Cell, smart pointer, heap allocation, reference counting, RAII, Drop, should I use Box or Rc, when to use Arc vs Rc, 智能指针, 引用计数, 堆分配
CRITICAL: Use for mutability issues. Triggers: E0596, E0499, E0502, cannot borrow as mutable, already borrowed as immutable, mut, &mut, interior mutability, Cell, RefCell, Mutex, RwLock, 可变性, 内部可变性, 借用冲突
CRITICAL: Use for generics, traits, zero-cost abstraction. Triggers: E0277, E0308, E0599, generic, trait, impl, dyn, where, monomorphization, static dispatch, dynamic dispatch, impl Trait, trait bound not satisfied, 泛型, 特征, 零成本抽象, 单态化
CRITICAL: Use for type-driven design. Triggers: type state, PhantomData, newtype, marker trait, builder pattern, make invalid states unrepresentable, compile-time validation, sealed trait, ZST, 类型状态, 新类型模式, 类型驱动设计
CRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, error propagation, 错误处理, Result 用法, 什么时候用 panic
CRITICAL: Use for concurrency/async. Triggers: E0277 Send Sync, cannot be sent between threads, thread, spawn, channel, mpsc, Mutex, RwLock, Atomic, async, await, Future, tokio, deadlock, race condition, 并发, 线程, 异步, 死锁
CRITICAL: Use for domain modeling. Triggers: domain model, DDD, domain-driven design, entity, value object, aggregate, repository pattern, business rules, validation, invariant, 领域模型, 领域驱动设计, 业务规则
CRITICAL: Use for performance optimization. Triggers: performance, optimization, benchmark, profiling, flamegraph, criterion, slow, fast, allocation, cache, SIMD, make it faster, 性能优化, 基准测试
Use when integrating crates or ecosystem questions. Keywords: E0425, E0433, E0603, crate, cargo, dependency, feature flag, workspace, which crate to use, using external C libraries, creating Python extensions, PyO3, wasm, WebAssembly, bindgen, cbindgen, napi-rs, cannot find, private, crate recommendation, best crate for, Cargo.toml, features, crate 推荐, 依赖管理, 特性标志, 工作空间, Python 绑定
Use when designing domain error handling. Keywords: domain error, error categorization, recovery strategy, retry, fallback, domain error hierarchy, user-facing vs internal errors, error code design, circuit breaker, graceful degradation, resilience, error context, backoff, retry with backoff, error recovery, transient vs permanent error, 领域错误, 错误分类, 恢复策略, 重试, 熔断器, 优雅降级
Use when learning Rust concepts. Keywords: mental model, how to think about ownership, understanding borrow checker, visualizing memory layout, analogy, misconception, explaining ownership, why does Rust, help me understand, confused about, learning Rust, explain like I'm, ELI5, intuition for, coming from Java, coming from Python, 心智模型, 如何理解所有权, 学习 Rust, Rust 入门, 为什么 Rust
CRITICAL: Use for unsafe Rust code review and FFI. Triggers on: unsafe, raw pointer, FFI, extern, transmute, *mut, *const, union, #[repr(C)], libc, std::ffi, MaybeUninit, NonNull, SAFETY comment, soundness, undefined behavior, UB, safe wrapper, memory layout, bindgen, cbindgen, CString, CStr, 安全抽象, 裸指针, 外部函数接口, 内存布局, 不安全代码, FFI 绑定, 未定义行为
ElevenLabs text-to-speech with mac-style say UX.
Oracle CLI second-model review/debug/refactor/design with selected files, dry-run token checks, API or browser engine.
Capture and automate macOS UI with the Peekaboo CLI.
Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".
Build a throwaway prototype to flesh out a design — a runnable terminal app for state/business-logic questions, or several radically different UI variations toggleable from one route.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".