Agent skill

M12 Lifecycle

by fjrevoredo in fjrevoredo/mini-diarium

A skill your agent uses when designing resource lifecycles. An agent skill from fjrevoredo/mini-diarium.

MITAuto-check passedBackend & APIs

Install M12 Lifecycle

skills CLI
$ npx skills add fjrevoredo/mini-diarium --skill m12-lifecycle -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install fjrevoredo/mini-diarium m12-lifecycle --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/fjrevoredo/mini-diarium.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/m12-lifecycle .claude/skills/m12-lifecycle && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
m12-lifecycle
GitHub stars
308
Used in
1 other repo
Token cost
~1.1k tokens
SKILL.md length
310 words
Files
1
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when designing resource lifecycles. An agent skill from fjrevoredo/mini-diarium.

  • Works in 3 steps: What's the resource cost? → What's the scope? → What about errors?
  • Designing resource lifecycles
  • SKILL.md covers Core Question, Lifecycle Pattern →…, Thinking Prompt and Trace Up ↑, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

M12 Lifecycle is an agent skill from fjrevoredo/mini-diarium. Use when designing resource lifecycles. Keywords: RAII, Drop, resource lifecycle, connection pool, lazy initialization, connection pool design, resource cleanup patterns, cleanup, scope, OnceCell, Lazy, oncecell, OnceLock, transaction, session management, when is Drop called, cleanup on error, guard pattern, scope guard, 资源生命周期, 连接池, 惰性初始化, 资源清理, RAII 模式

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Authentication. The repository describes itself as: A local-only journal with serious encryption. Free, open source, and never touches the internet. The licence is MIT.

When your agent uses it

  • Designing resource lifecycles
  • Tasks that involve Authentication

Example prompts

  • “/m12-lifecycle”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. What's the resource cost?
  2. What's the scope?
  3. What about errors?

What it can do on your machine

Read from SKILL.md and the folder at commit 3ddc537. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

M12 Lifecycle loads about 1.1k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from fjrevoredo/mini-diarium at commit 3ddc537, republished under its MIT licence (© fjrevoredo). 310 words, ~1,084 tokens.

Download SKILL.mdSave it as .claude/skills/m12-lifecycle/SKILL.md (or your agent's skills folder).
name
m12-lifecycle
description
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 模式
user-invocable
false

Resource Lifecycle

Layer 2: Design Choices

Core Question

When should this resource be created, used, and cleaned up?

Before implementing lifecycle:

  • What's the resource's scope?
  • Who owns the cleanup responsibility?
  • What happens on error?

Lifecycle Pattern → Implementation

PatternWhenImplementation
RAIIAuto cleanupDrop trait
Lazy initDeferred creationOnceLock, LazyLock
PoolReuse expensive resourcesr2d2, deadpool
GuardScoped accessMutexGuard pattern
ScopeTransaction boundaryCustom struct + Drop

Thinking Prompt

Before designing lifecycle:

  1. What's the resource cost?

    • Cheap → create per use
    • Expensive → pool or cache
    • Global → lazy singleton
  2. What's the scope?

    • Function-local → stack allocation
    • Request-scoped → passed or extracted
    • Application-wide → static or Arc
  3. What about errors?

    • Cleanup must happen → Drop
    • Cleanup is optional → explicit close
    • Cleanup can fail → Result from close

Trace Up ↑

To domain constraints (Layer 3):

"How should I manage database connections?"
    ↑ Ask: What's the connection cost?
    ↑ Check: domain-* (latency requirements)
    ↑ Check: Infrastructure (connection limits)
QuestionTrace ToAsk
Connection poolingdomain-*What's acceptable latency?
Resource limitsdomain-*What are infra constraints?
Transaction scopedomain-*What must be atomic?

Trace Down ↓

To implementation (Layer 1):

"Need automatic cleanup"
    ↓ m02-resource: Implement Drop
    ↓ m01-ownership: Clear owner for cleanup

"Need lazy initialization"
    ↓ m03-mutability: OnceLock for thread-safe
    ↓ m07-concurrency: LazyLock for sync

"Need connection pool"
    ↓ m07-concurrency: Thread-safe pool
    ↓ m02-resource: Arc for sharing

Quick Reference

PatternTypeUse Case
RAIIDrop traitAuto cleanup on scope exit
Lazy InitOnceLock, LazyLockDeferred initialization
Poolr2d2, deadpoolConnection reuse
GuardMutexGuardScoped lock release
ScopeCustom structTransaction boundaries

Lifecycle Events

EventRust Mechanism
Creationnew(), Default
Lazy InitOnceLock::get_or_init
Usage&self, &mut self
CleanupDrop::drop()

Pattern Templates

RAII Guard
rust
struct FileGuard {
    path: PathBuf,
    _handle: File,
}

impl Drop for FileGuard {
    fn drop(&mut self) {
        // Cleanup: remove temp file
        let _ = std::fs::remove_file(&self.path);
    }
}
Lazy Singleton
rust
use std::sync::OnceLock;

static CONFIG: OnceLock<Config> = OnceLock::new();

fn get_config() -> &'static Config {
    CONFIG.get_or_init(|| {
        Config::load().expect("config required")
    })
}

Common Errors

ErrorCauseFix
Resource leakForgot DropImplement Drop or RAII wrapper
Double freeManual memoryLet Rust handle
Use after dropDangling referenceCheck lifetimes
E0509 move out of DropMoving owned fieldOption::take()
Pool exhaustionNot returnedEnsure Drop returns

Anti-Patterns

Anti-PatternWhy BadBetter
Manual cleanupEasy to forgetRAII/Drop
lazy_static!External depstd::sync::OnceLock
Global mutable stateThread unsafetyOnceLock or proper sync
Forget to closeResource leakDrop impl

WhenSee
Smart pointersm02-resource
Thread-safe initm07-concurrency
Domain scopesm09-domain
Error in cleanupm06-error-handling

© fjrevoredo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/m12-lifecycle of fjrevoredo/mini-diarium.

Open the folder on GitHubat commit 3ddc537

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in fjrevoredo/mini-diarium, which our catalogue first saw on October 7, 2026.

Compare with similar skills

M12 Lifecycle next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

M12 Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
M12 Lifecycle this skillfjrevoredo/mini-diarium3081 repos~1.1kAutomated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Better Auth Best Practiceslatitude-dev/latitude-llm4.7k7 repos~1.6kAutomated safety check: PassMIT
Supabasecurvenote/curvenote1695 repos~2.2kAutomated safety check: PassCustom licence
Gitnexus Exploringaws-samples/sample-kolya-br-proxy10611 repos~749Automated safety check: PassMIT-0

Similar skills

  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    169 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Gitnexus Exploring

    aws-samples/sample-kolya-br-proxy

    Official

    A skill your agent uses when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase.

    106 GitHub starsUsed in 11 repos~749 tokens
    Backend & APIsAuto-check passed
  • Agentic Wallet

    coinbase/agentic-wallet-skills

    Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API…

    127 GitHub starsUsed in 3 repos~1k tokens
    Backend & APIsAuto-check passed

More from fjrevoredo/mini-diarium

All 41 skills in this repo
  • Manual Planning

    fjrevoredo/mini-diarium

    Create, update, review, and execute manual Markdown implementation plans when harness planning mode is not being used.

    308 GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • M10 Performance

    fjrevoredo/mini-diarium

    CRITICAL: Use for performance optimization. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub starsUsed in 2 repos~1k tokens
    Auto-check passed
  • Solidjs

    fjrevoredo/mini-diarium

    SolidJS framework development skill for building reactive web applications with fine-grained reactivity.

    308 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Rust Symbol Analyzer

    fjrevoredo/mini-diarium

    Analyze Rust project structure using LSP symbols. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Tauri V2

    fjrevoredo/mini-diarium

    Tauri v2 cross-platform app development with Rust backend. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Exploration Mode

    fjrevoredo/mini-diarium

    Enter exploration mode: a thinking partner for researching and thinking through ideas and problems before implementation.

    308 GitHub stars~3.4k tokensUpdated today
    Auto-check passed

Categories

Questions about M12 Lifecycle

What does M12 Lifecycle do?

A skill your agent uses when designing resource lifecycles. An agent skill from fjrevoredo/mini-diarium. M12 Lifecycle is an agent skill from fjrevoredo/mini-diarium. Use when designing resource lifecycles.

When should I use M12 Lifecycle?

M12 Lifecycle fits situations like: designing resource lifecycles; tasks that involve Authentication.

How do I install M12 Lifecycle in Claude Code?

Run `npx skills add fjrevoredo/mini-diarium --skill m12-lifecycle -a claude-code`. Or copy the skill folder (.agents/skills/m12-lifecycle in fjrevoredo/mini-diarium) into .claude/skills/m12-lifecycle in your project. Claude Code loads it when a task matches its description.

How do I install M12 Lifecycle in Codex?

Run `npx skills add fjrevoredo/mini-diarium --skill m12-lifecycle -a codex`. Or copy the skill folder (.agents/skills/m12-lifecycle in fjrevoredo/mini-diarium) into .agents/skills/m12-lifecycle in your project. Codex loads it when a task matches its description.

Can I use M12 Lifecycle in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add fjrevoredo/mini-diarium --skill m12-lifecycle -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/m12-lifecycle, .gemini/skills/m12-lifecycle, .github/skills/m12-lifecycle and .opencode/skills/m12-lifecycle in your project.

What does M12 Lifecycle need to run?

SKILL.md names no scripts, command-line tools or credentials: M12 Lifecycle is instructions for the agent only.

Does M12 Lifecycle access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is M12 Lifecycle safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does M12 Lifecycle use?

M12 Lifecycle is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does M12 Lifecycle use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to M12 Lifecycle?

Skills that share tags, products or a category with M12 Lifecycle: Fortify Development (coollabsio/coolify, 63k stars), Supabase Development and Debugging (supabase/agent-skills, 2.7k stars), Better Auth Best Practices (latitude-dev/latitude-llm, 4.7k stars) and Supabase (curvenote/curvenote, 169 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains M12 Lifecycle?

fjrevoredo (a GitHub user) maintains it in fjrevoredo/mini-diarium, which has 308 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 7, 2026.

Source: fjrevoredo/mini-diarium on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.