
M12 lifecycle
Guides Rust resource lifecycle design: Drop cleanup, lazy init, pools and guards
M12 lifecycle is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 21
- Last commit
- License
- MIT
- Listing updated
Similar skills
About M12 lifecycle
This skill is a design reference for deciding when a resource should be created, used and cleaned up. It walks the agent through questions about cost, scope and error behavior, then maps the chosen pattern to Rust mechanisms such as the Drop trait, OnceLock and LazyLock, connection pools like r2d2 and deadpool, MutexGuard-style scoped access and custom transaction structs.
The skill includes templates for an RAII guard that removes a temporary file on drop and a lazily initialized global config using OnceLock. It also lists common errors such as forgotten cleanup, leaked pool connections and moving fields out of a Drop type, with fixes for each, and points to related skills for ownership, concurrency and error handling.
It is a single instruction file with no scripts. It expects a Rust codebase and a design question about resources, and it does not run any tools itself.
When your agent uses it
Use when designing resource lifecycles. Keywords: RAII, Drop, resource lifecycle, connection pool, lazy initialization, connection pool design, resource cleanup patterns, cleanup, scope, OnceCell, Lazy, once_cell, OnceLock, transaction, session management, when is Drop called, cleanup on error, guard pattern, scope guard, 资源生命周期, 连接池, 惰性初始化, 资源清理, RAII 模式
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/m12-lifecycle to use it in all your projects:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/m12-lifecycle &&
cp -R "$tmp/.claude/skills/m12-lifecycle" ~/.claude/skills/m12-lifecycle &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/m12-lifecycle inside it instead.
Copy the skill folder to ~/.agents/skills/m12-lifecycle to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/m12-lifecycle &&
cp -R "$tmp/.claude/skills/m12-lifecycle" ~/.agents/skills/m12-lifecycle &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/m12-lifecycle inside it instead.
Copy the skill folder to ~/.cursor/skills/m12-lifecycle to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/m12-lifecycle &&
cp -R "$tmp/.claude/skills/m12-lifecycle" ~/.cursor/skills/m12-lifecycle &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/m12-lifecycle inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/k1-c/linear-tui.git --path .claude/skills/m12-lifecycleOr copy the folder to ~/.gemini/skills/m12-lifecycle yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/m12-lifecycle:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/m12-lifecycle &&
cp -R "$tmp/.claude/skills/m12-lifecycle" ~/.copilot/skills/m12-lifecycle &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/m12-lifecycle inside it instead.
Get the folder:
git clone --depth 1 https://github.com/k1-c/linear-tui.gitThen copy linear-tui/.claude/skills/m12-lifecycle into your agent's skills folder as m12-lifecycle. Agents that support SKILL.md read one folder per skill.
What it does
- Lifecycle decision checklist
- Guides the agent through resource cost, scope and error-handling questions before choosing a pattern.
- RAII and Drop patterns
- Covers automatic cleanup with the Drop trait and scope guards for transactions.
- Lazy initialization options
- Explains when to use OnceLock or LazyLock for deferred or global setup.
- Connection pool guidance
- Names pooling crates such as r2d2 and deadpool and the pitfalls of unreturned connections.
- Rust code templates
- Provides example RAII guard and lazy singleton implementations.
- Common error reference
- Lists typical lifecycle bugs such as leaks, dangling references and E0509 with fixes.
Good for
- Design cleanup behavior for a temporary file handle in Rust
- Choose between a connection pool and per-use connections
- Set up a lazily loaded global configuration
- Implement a transaction guard that rolls back on early return
- Diagnose a pool exhaustion or resource leak in Rust code
M12 lifecycle FAQ
What does M12 lifecycle need to run?
It is a single SKILL.md with no scripts or extra files. It assumes a Rust project and does not declare allowed tools.
When does M12 lifecycle trigger?
It is meant for requests about designing resource lifecycles, including terms such as RAII, Drop, connection pools, lazy initialization and cleanup on error.
Does M12 lifecycle change any files?
The skill itself only provides guidance and code patterns for the agent to apply; it does not run scripts.
How do I install M12 lifecycle in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/m12-lifecycle to use it in all your projects, or to .claude/skills/m12-lifecycle in one project.
Does M12 lifecycle run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use M12 lifecycle?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to M12 lifecycle?
The closest alternatives to M12 lifecycle are M11 ecosystem, M02 resource, M01 ownership, M06 error handling and M03 mutability.
Where this comes from
- Description: from the skill's own SKILL.md.
More from k1-c/linear-tui

Gives the agent a quick reference of Rust-specific naming, error handling and async rules
- Open source
- 21 GitHub stars
- Developer tools

Guides the agent to write Conventional Commits, splitting mixed changes into several
- Open source
- 21 GitHub stars
- Developer tools

Guides an agent through building Rust command-line tools with clap, config layers
- Open source
- 21 GitHub stars
- Developer tools

Guides the agent through Rust ownership, borrow and lifetime compiler errors
- Open source
- 21 GitHub stars
- Developer tools

Guides an agent in choosing Rust smart pointers like Box, Rc, Arc, Weak and RefCell
- Open source
- 21 GitHub stars
- Developer tools

Guides a Rust agent through E0596/E0499/E0502 borrow errors and interior mutability
- Open source
- 21 GitHub stars
- Developer tools

