Agent skill

Storage Lifecycle

by PlamenTSV in PlamenTSV/plamen

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth agents

MITAuto-check passedSecurity

Install Storage Lifecycle

skills CLI
$ npx skills add PlamenTSV/plamen --skill storage-lifecycle -a claude-code

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

GitHub CLI
$ gh skill install PlamenTSV/plamen storage-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/PlamenTSV/plamen.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/skills/soroban/storage-lifecycle .claude/skills/storage-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
storage-lifecycle
GitHub stars
303
Token cost
~2.5k tokens
SKILL.md length
1,107 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth agents

  • Works in 6 steps: Storage Type Audit → TTL Management → Instance Storage Bounds → …
  • Pattern Always required for Soroban audits - Inject Into Breadth agents
  • SKILL.md covers 1. Storage Type Audit, 2. TTL Management, 3. Instance Storage Bounds and 4. Archival Risk Assessment, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Storage Lifecycle is an agent skill from PlamenTSV/plamen. Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth agents

Its SKILL.md is about 2.5k 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 Security, covering Smart contract auditing. It works with Stellar. The repository describes itself as: Autonomous Web3 security audit agent for Claude Code. The licence is MIT.

When your agent uses it

  • Pattern Always required for Soroban audits - Inject Into Breadth agents
  • Tasks that involve Smart contract auditing

Example prompts

  • “/storage-lifecycle”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Storage Type Audit
  2. TTL Management
  3. Instance Storage Bounds
  4. Archival Risk Assessment
  5. Temporary Data Critical Assessment
  6. Storage Key Collision

What it can do on your machine

Read from SKILL.md and the folder at commit 795962b. 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 and markdown).

    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

Storage Lifecycle loads about 2.5k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 1,107 words of instructions outside code blocks.

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

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 PlamenTSV/plamen at commit 795962b, republished under its MIT licence (© PlamenTSV). 1,107 words, ~2,500 tokens.

Download SKILL.mdSave it as .claude/skills/storage-lifecycle/SKILL.md (or your agent's skills folder).
name
storage-lifecycle
description
Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth agents

STORAGE_LIFECYCLE Skill (Soroban)

Trigger Pattern: Always required for Soroban audits Inject Into: Breadth agents, depth agents Finding prefix: [SL-N] Rules referenced: R8, R10, R14

Soroban has three distinct storage types — Instance, Persistent, and Temporary — with fundamentally different lifetime semantics. Using the wrong storage type is a critical design flaw. Instance and Persistent entries expire if TTL is not extended; Temporary entries are permanently deleted at expiration with no recovery path.

1. Storage Type Audit

For every storage key defined (typically in a DataKey enum or equivalent), verify the correct storage type is used:

DataKey VariantStorage Type UsedCorrect Type?Justification
{key}Instance / Persistent / TemporaryYES/NO{why this type is correct or wrong}

Selection rules:

  • Instance: Contract-wide config that lives and dies with the contract itself (admin address, fee parameters, pause flag). Shared 64KB limit with all other Instance entries for this contract.
  • Persistent: User-specific state that must survive indefinitely (balances, positions, allowances that should not expire). Requires explicit TTL extension. Archived entries can be restored but require a fee.
  • Temporary: Truly ephemeral data that becomes invalid after a period (short-lived signatures, nonces with expiry, one-time-use proofs). Permanently deleted at expiry — no recovery.

Common misclassifications to flag:

  • User balances stored as Temporary (funds permanently lost at expiry)
  • Escrow or locked funds stored as Temporary
  • Allowances stored as Temporary without the protocol communicating expiry to users
  • Voting records or governance state stored as Temporary (votes silently discarded)

2. TTL Management

Soroban entries expire if their TTL is not extended. Identify all critical entries and verify TTL extension logic:

DataKeyStorage TypeTTL Extended?Extension LocationThreshold ValueExtend-To ValueReasonable?
{key}Persistent/InstanceYES/NO{fn:line or NONE}{ledgers or NONE}{ledgers or NONE}YES/NO

Check for:

  • Critical entries (admin, balances, config) never having their TTL extended → will expire after the initial minimum TTL (~17 days at default settings)
  • extend_ttl called with threshold = 0 (extends on every call, expensive) vs reasonable threshold
  • extend_ttl called only in some code paths but not others (e.g., extended on deposit but not on query)
  • Extend-to value set too low (e.g., 100 ledgers ≈ 8 minutes) causing rapid re-expiry

TTL extension pattern (correct):

rust
let max_ttl = env.ledger().max_entry_ttl();
env.storage().persistent().extend_ttl(&key, max_ttl / 2, max_ttl);

Dangerous anti-pattern:

rust
// Never extends TTL — entry will expire after initial minimum
env.storage().persistent().set(&DataKey::Balance(user), &balance);
// (no extend_ttl call anywhere for this key)

3. Instance Storage Bounds

Instance storage is shared across ALL instance entries for a contract and has a hard cap of approximately 64KB. Unbounded growth causes contract failure.

DataKeyStored in Instance?Data TypeCan Grow Unboundedly?Current BoundRisk
{key}YES/NO{type}YES/NO{N entries or unbounded}HIGH/MED/LOW

Check for:

  • Vec<T> stored in Instance storage — grows with each push
  • Map<K, V> stored in Instance storage — grows with each new key
  • Any collection type in Instance storage that users or external callers can add to

Attack: If Instance storage approaches 64KB, ALL contract operations that touch instance storage fail, effectively bricking the contract. An attacker who can add entries (e.g., via a public function that appends to an Instance-stored Vec) can DoS the entire contract.

Estimate growth: For each unbounded Instance collection, estimate: what is the maximum realistic entry size? How many entries before 64KB is reached? Is that number reachable by a malicious actor?

3b. Persistent Storage Single-Entry Growth DoS

Even though Persistent storage has no shared size limit, each individual ledger entry has a ~64KB size limit. A single Persistent key holding a growing collection hits this limit the same way Instance storage does.

Persistent KeyData TypeGrows With Users?Approx Entries Before ~64KBPermissionless Append?Risk
{key}{Vec/Map}YES/NO{estimate}YES/NOHIGH/MED/LOW

Dangerous pattern: DataKey::AllUsers → Vec<Address> stored as a single Persistent entry. At ~32 bytes per Address, this hits ~64KB at ~2,000 entries.

Correct pattern: Variable DataKeys — one Persistent entry per user/item: DataKey::User(address) → UserData. This distributes data across unlimited entries with no single-entry size constraint.

Check for: Any Persistent storage key that stores a collection type (Vec<T>, Map<K,V>) where the collection grows with protocol usage (new users, new positions, new orders). If the append operation is permissionless or low-cost, flag as DoS risk (same severity as Instance storage DoS).

Show full SKILL.md (448 more words)Show less

4. Archival Risk Assessment

Persistent entries that are not extended will eventually be archived by the network. Archived entries can be restored but this requires paying a fee and providing a Merkle proof — not a default user flow.

DataKeyPersistent?TTL Extended?Archive RiskRecovery Path Exists?User Impact if Archived
{key}YES/NOYES/NOHIGH/MED/LOWYES/NO{impact description}

High-risk patterns:

  • User positions/balances that are never TTL-extended → users who haven't interacted for ~17 days lose access until they (or someone) pays for restoration
  • Protocol-owned accounts (liquidity pools, vaults) with no TTL extension mechanism → pool becomes inaccessible
  • Admin key archived → protocol loses all admin capabilities

For each HIGH risk entry: verify whether the protocol documentation communicates archival risk to users and whether the smart contract itself provides a restore helper function.

5. Temporary Data Critical Assessment

Temporary storage is permanently deleted when it expires — there is no archival, no restoration, no recovery. Verify no critical value is stored as Temporary:

DataKeyTemporary Storage?Critical Value?Deletion ImpactFinding?
{key}YES/NOYES/NO{what is lost}[SL-N] if critical + Temporary

Critical values that MUST NOT use Temporary storage:

  • Token balances or positions
  • Locked/escrowed funds
  • Governance votes or proposals
  • Access control grants
  • Any value that represents user funds or irreversible commitments

Acceptable Temporary storage uses:

  • Price oracle observations with explicit expiry
  • Short-lived authorization proofs (e.g., CLOB order validity windows)
  • Rate-limiting counters that naturally reset
  • Replay-protection nonces where expiry is intentional

6. Storage Key Collision

Soroban storage keys are arbitrary Val types. If the same key value is written to different storage types, they are separate entries (no collision). However, within the same storage type, key values must be unique across all uses.

Storage TypeKey Values in UseAny Duplicates?Collision Impact
Instance{list DataKey variants}YES/NO{if YES: which keys collide and what is overwritten}
Persistent{list DataKey variants}YES/NO{if YES: which keys collide and what is overwritten}
Temporary{list DataKey variants}YES/NO{if YES: which keys collide and what is overwritten}

Collision patterns to check:

  • DataKey enum variants that serialize to the same byte representation (e.g., tuple variants with the same structure but different semantic meaning)
  • Dynamic keys using (symbol, address) tuples where two different contexts could produce the same tuple
  • Integer keys used across multiple logical namespaces without a discriminator prefix

Finding Template

markdown
**ID**: [SL-N]
**Severity**: [Critical if funds permanently lost, High if DoS/archival risk, Medium if config risk]
**Step Execution**: ✓1,2,3,4,5,6 | ✗(reasons) | ?(uncertain)
**Rules Applied**: [R8:✓/✗, R10:✓/✗, R14:✓/✗]
**Location**: src/{contract}.rs:LineN
**Title**: {DataKey} stored as {wrong type / missing TTL extension} — {impact}
**Description**: [Specific storage type misuse with the key, the type used, and why it is wrong]
**Impact**: [Permanent fund loss / contract DoS / config expiry / inaccessible protocol]

Step Execution Checklist (MANDATORY)

SectionRequiredCompleted?Notes
1. Storage Type AuditYES✓/✗/?Every DataKey variant
2. TTL ManagementYES✓/✗/?Every Persistent and Instance key
3. Instance Storage BoundsYES✓/✗/?All collections in Instance storage
4. Archival Risk AssessmentYES✓/✗/?All Persistent keys without TTL extension
5. Temporary Data Critical AssessmentYES✓/✗/?All Temporary keys
6. Storage Key CollisionYES✓/✗/?All DataKey variants per storage type

© PlamenTSV, 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/soroban/storage-lifecycle of PlamenTSV/plamen.

Open the folder on GitHubat commit 795962b

Compare with similar skills

Storage 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.

Storage Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Storage Lifecycle this skillPlamenTSV/plamen303—~2.5kAutomated safety check: PassMIT
Soroban Contract Auditsickn33/agentic-awesome-skills47k1 repos~1.4kAutomated safety check: PassMIT
Soroban Liquidity Poolsickn33/agentic-awesome-skills47k1 repos~1.3kAutomated safety check: PassMIT
Soroban Storage Ttl Lifecyclesickn33/agentic-awesome-skills47k1 repos~1.3kAutomated safety check: PassMIT
Soroban Token Mintersickn33/agentic-awesome-skills47k1 repos~1.3kAutomated safety check: PassMIT
Stellar DevVelaPayments/vela-payments131—~1.8kAutomated safety check: PassMIT

Similar skills

  • Soroban Contract Audit

    sickn33/agentic-awesome-skills

    Soroban smart contract security audit register: authorization checks, panic pathways, integer overflows, and storage footprint verification for Stellar.

    47k GitHub starsUsed in 1 repo~1.4k tokens
    SecurityAuto-check passed
  • Soroban Liquidity Pool

    sickn33/agentic-awesome-skills

    Automated market maker liquidity pool register: constant-product invariant curves, swap fee tiers, and LP token shares for Soroban DeFi.

    47k GitHub starsUsed in 1 repo~1.3k tokens
    SecurityAuto-check passed
  • Soroban Storage Ttl Lifecycle

    sickn33/agentic-awesome-skills

    Soroban ledger state rent and TTL extension register: live state tracking, bump thresholds, rent fee reserves, and archive boundaries.

    47k GitHub starsUsed in 1 repo~1.3k tokens
    SecurityAuto-check passed
  • Soroban Token Minter

    sickn33/agentic-awesome-skills

    Soroban SEP-41 token contract architecture register: admin control, supply caps, metadata standard, and transfer event emissions on Stellar.

    47k GitHub starsUsed in 1 repo~1.3k tokens
    SecurityAuto-check passed
  • Stellar Dev

    VelaPayments/vela-payments

    End-to-end Stellar development playbook. An agent skill from VelaPayments/vela-payments.

    131 GitHub stars~1.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Stellar iOS Mac SDK

    Soneso/stellar-ios-mac-sdk

    Guides Stellar blockchain development in Swift using stellar-ios-mac-sdk.

    132 GitHub stars~4.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from PlamenTSV/plamen

All 87 skills in this repo
  • Audit Prep

    PlamenTSV/plamen

    Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project…

    303 GitHub stars~3.7k tokensUpdated 11 days ago
    Auto-check passed
  • Verification Protocol

    PlamenTSV/plamen

    Trigger Pattern Always (used by all verifier agents) - Inject Into security-verifier agents (Phase 5)

    303 GitHub stars~3.5k tokensUpdated 11 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.3k tokensUpdated 11 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Sui Move) -- foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.2k tokensUpdated 11 days ago
    Auto-check passed
  • Account Lifecycle

    PlamenTSV/plamen

    Trigger Pattern ACCOUNTCLOSING flag detected (close/CloseAccount usage) - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.2k tokensUpdated 11 days ago
    Auto-check passed
  • Account Validation

    PlamenTSV/plamen

    Trigger Pattern Always required for Solana audits - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.7k tokensUpdated 11 days ago
    Auto-check passed

Works with

Categories

Questions about Storage Lifecycle

What does Storage Lifecycle do?

Trigger Pattern Always required for Soroban audits - Inject Into Breadth agents, depth agents. Storage Lifecycle is an agent skill from PlamenTSV/plamen.

When should I use Storage Lifecycle?

Storage Lifecycle fits situations like: pattern Always required for Soroban audits - Inject Into Breadth agents; tasks that involve Smart contract auditing.

How do I install Storage Lifecycle in Claude Code?

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

How do I install Storage Lifecycle in Codex?

Run `npx skills add PlamenTSV/plamen --skill storage-lifecycle -a codex`. Or copy the skill folder (agents/skills/soroban/storage-lifecycle in PlamenTSV/plamen) into .agents/skills/storage-lifecycle in your project. Codex loads it when a task matches its description.

Can I use Storage 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 PlamenTSV/plamen --skill storage-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/storage-lifecycle, .gemini/skills/storage-lifecycle, .github/skills/storage-lifecycle and .opencode/skills/storage-lifecycle in your project.

What does Storage Lifecycle need to run?

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

Does Storage 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 Storage 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 Storage Lifecycle use?

Storage 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 Storage Lifecycle use?

About 2.5k tokens (SKILL.md is roughly 10k 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 Storage Lifecycle?

Skills that share tags, products or a category with Storage Lifecycle: Soroban Contract Audit (sickn33/agentic-awesome-skills, 47k stars), Soroban Liquidity Pool (sickn33/agentic-awesome-skills, 47k stars), Soroban Storage Ttl Lifecycle (sickn33/agentic-awesome-skills, 47k stars) and Soroban Token Minter (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Storage Lifecycle?

PlamenTSV (a GitHub user) maintains it in PlamenTSV/plamen, which has 303 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on September 26, 2026.

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