Agent skill

Ref Lifecycle

by PlamenTSV in PlamenTSV/plamen

Type Thought-template (instantiate before use) - Trigger Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle

MITAuto-check passed

Install Ref Lifecycle

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

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

GitHub CLI
$ gh skill install PlamenTSV/plamen ref-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/aptos/ref-lifecycle .claude/skills/ref-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
ref-lifecycle
GitHub stars
303
Token cost
~3.4k tokens
SKILL.md length
1,494 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Type Thought-template (instantiate before use) - Trigger Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle

  • Works in 8 steps: Reference Inventory → ConstructorRef Analysis → MintRef / BurnRef Analysis → …
  • Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle
  • SKILL.md covers Background, Trigger Patterns, Reasoning Template and Finding Template, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ref Lifecycle is an agent skill from PlamenTSV/plamen. Type Thought-template (instantiate before use) - Trigger Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle

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

The repository describes itself as: Autonomous Web3 security audit agent for Claude Code. The licence is MIT.

When your agent uses it

  • Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle

Example prompts

  • “/ref-lifecycle”

Workflow steps

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

  1. Reference Inventory
  2. ConstructorRef Analysis
  3. MintRef / BurnRef Analysis
  4. TransferRef Analysis
  5. DeleteRef Analysis
  6. Ref Leakage Path Analysis
  7. Ref Revocation Assessment
  8. Cross-Ref Interaction

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

Ref Lifecycle loads about 3.4k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 1,494 words of instructions outside code blocks.

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

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,494 words, ~3,414 tokens.

Download SKILL.mdSave it as .claude/skills/ref-lifecycle/SKILL.md (or your agent's skills folder).
name
ref-lifecycle
description
Type Thought-template (instantiate before use) - Trigger Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle

Skill: Reference Lifecycle Analysis

Type: Thought-template (instantiate before use) Trigger Pattern: Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle Inject Into: Breadth agents, depth-state-trace, depth-token-flow Research basis: Aptos Object model capability-based access control, permanent reference semantics

Background

In Aptos Move, object capabilities (Refs) are unforgeable tokens that grant specific permissions over objects. Unlike role-based access control in EVM, Refs are permanent once created -- they CANNOT be revoked. A leaked or improperly stored Ref grants permanent capability to its holder.

Key Ref types:

  • ConstructorRef: Created once during object::create_*. Parent of all other Refs. Grants ability to generate TransferRef, MintRef, BurnRef, DeleteRef, and ExtendRef.
  • TransferRef: Grants ability to transfer an object even when its TransferRef is frozen. Bypasses ungated_transfer restrictions.
  • MintRef: Grants ability to mint FungibleAsset. Unlimited minting if held.
  • BurnRef: Grants ability to burn FungibleAsset from any FungibleStore.
  • DeleteRef: Grants ability to delete an object.
  • ExtendRef: Grants ability to generate a signer for the object, enabling further resource manipulation.

Trigger Patterns

ConstructorRef|TransferRef|MintRef|BurnRef|DeleteRef|ExtendRef|
object::create_named_object|object::create_sticky_object|object::create_object|
fungible_asset::generate_mint_ref|fungible_asset::generate_burn_ref|
fungible_asset::generate_transfer_ref|object::generate_delete_ref|
object::generate_extend_ref|object::generate_transfer_ref

Reasoning Template

Step 1: Reference Inventory

Enumerate ALL Ref types found in the codebase. For each:

Ref TypeCreated In (module::function)Stored LocationAccess ControlCapability Granted
ConstructorRef{module}::{init_fn}{consumed / stored in resource}{who can access}Generate all other Refs
MintRef{module}::{init_fn}{global resource at @addr}{who can access}Unlimited minting of {asset}
BurnRef{module}::{init_fn}{global resource at @addr}{who can access}Burn {asset} from any store
TransferRef{module}::{init_fn}{global resource at @addr}{who can access}Transfer {asset} bypassing freeze
DeleteRef{module}::{init_fn}{global resource at @addr}{who can access}Delete {object}
ExtendRef{module}::{init_fn}{global resource at @addr}{who can access}Generate signer for {object}

Completeness check: Search for ALL generate_*_ref calls and object::create_* calls. Every Ref created MUST appear in the table.

Step 2: ConstructorRef Analysis

The ConstructorRef is the root capability. It exists only during the init_module or object creation call.

Check 2a: Is ConstructorRef stored?

  • Search for any struct field of type ConstructorRef -- this type has drop but NOT store, so it CANNOT be stored in global storage directly.
  • If code attempts to extract a signer from ConstructorRef via object::generate_signer(&constructor_ref) and stores the signer reference indirectly, trace what that signer can do.
  • Expected pattern: ConstructorRef is consumed during init to generate other Refs, then dropped. It should NOT persist beyond the creation transaction.

Check 2b: What Refs are generated from it?

  • List every generate_*_ref call that uses this ConstructorRef
  • For each generated Ref: is it stored with appropriate access control?
  • FINDING trigger: If ConstructorRef generates MintRef AND that MintRef is stored with public visibility or weak access control -> unlimited minting capability leak.

Check 2c: ExtendRef derived signer

  • If object::generate_extend_ref is called, the resulting ExtendRef can later produce a signer via object::generate_signer_for_extending
  • Trace ALL uses of this derived signer -- it can move resources, modify object state, and call move_to/move_from
  • FINDING trigger: If ExtendRef is stored with weaker access control than the operations its signer can perform.
Step 3: MintRef / BurnRef Analysis

Check 3a: Storage access control

  • Where is MintRef stored? (must be in a resource at a controlled address)
  • Who can call functions that borrow the MintRef? (check acquires and signer requirements)
  • Is there any public fun that exposes MintRef via return value or mutable reference?
  • FINDING trigger: public fun returning &MintRef or &mut MintRef = capability leak to any module.

Check 3b: Mint amount validation

  • Does the minting function validate the amount? (cap, rate limit, per-epoch limit)
  • Is there a supply cap enforced? (fungible_asset::supply check before mint)
  • FINDING trigger: Unlimited minting with no cap = inflation vulnerability.

Check 3c: BurnRef scope

  • fungible_asset::burn_from with a BurnRef can burn tokens from ANY FungibleStore
  • Check: does the burn function require the store owner's authorization, or only the BurnRef?
  • FINDING trigger: If BurnRef holder can burn from arbitrary user stores without authorization.

Check 3d: Mint/Burn symmetry

  • If protocol has both MintRef and BurnRef: are they held by the same entity?
  • Can one be used without the other? (mint without ability to burn = permanent inflation; burn without mint = permanent deflation)
  • Are there economic invariants that depend on mint/burn balance?
Step 4: TransferRef Analysis

Check 4a: Freeze bypass

  • fungible_asset::transfer_with_ref bypasses frozen store checks
  • If the protocol uses fungible_asset::set_frozen_flag for compliance/security: does a stored TransferRef undermine the freeze?
  • FINDING trigger: TransferRef stored alongside freeze functionality = freeze can always be bypassed by TransferRef holder.

Check 4b: Transfer direction

  • Can TransferRef be used to transfer FROM any store (withdrawal) or only TO (deposit)?
  • fungible_asset::transfer_with_ref takes from: Object<FungibleStore> and to: Object<FungibleStore> -- the holder controls BOTH ends
  • FINDING trigger: TransferRef holder can drain any FungibleStore of the associated asset.

Check 4c: Who holds TransferRef?

  • If protocol stores TransferRef: who can invoke the transfer function?
  • Is there a path where an external caller (not admin) can trigger a TransferRef-backed transfer?
  • Trace all call paths from public entry fun to the transfer_with_ref invocation.
Step 5: DeleteRef Analysis

Check 5a: Resource cleanup before deletion

  • If object::delete(delete_ref) is called, what happens to resources stored at the object address?
  • Move does NOT automatically clean up resources when an object is deleted -- resources become orphaned
  • FINDING trigger: Object deletion without prior move_from of all resources = stranded assets (Rule 9: minimum MEDIUM).

Check 5b: Deletion authorization

  • Who holds the DeleteRef? Can they delete an object that other users depend on?
  • Is there a dependency check before deletion? (e.g., are there outstanding balances, active positions?)
  • FINDING trigger: DeleteRef holder can delete a shared object (LP pool, vault) = griefing or fund loss.
Show full SKILL.md (605 more words)Show less
Step 6: Ref Leakage Path Analysis

Check 6a: Public function returns

  • Search for ANY public fun or public(friend) fun that returns a Ref type
  • Even &MintRef (immutable reference) leak is dangerous because it can be passed to fungible_asset::mint within the same transaction
  • Leakage severity: public fun returning Ref = Critical leak (any module can use). public(friend) fun returning Ref = Medium leak (friend modules can use -- check friend list).

Check 6b: Friend module exposure

  • List all friend declarations in modules that store Refs
  • For each friend module: does it re-export the Ref or expose a public fun that uses the Ref without additional access control?
  • Transitive leak: Module A stores MintRef, Module B is friend of A and gets MintRef access, Module B has public fun that calls Module A's mint function = any module can mint via Module B.

Check 6c: Store ability check

  • Refs with store ability can be placed in arbitrary global storage locations
  • Check: do any Ref types in the protocol have store? (standard Aptos Refs: ConstructorRef has drop only; MintRef/BurnRef/TransferRef/DeleteRef/ExtendRef have drop and store)
  • FINDING trigger: Ref with store ability placed in a resource with weak access control = Ref can migrate to uncontrolled storage.
Step 7: Ref Revocation Assessment

Critical fact: Aptos Refs CANNOT be revoked once created. There is no revoke_mint_ref function in the framework.

Check 7a: Maximum blast radius

  • For each stored Ref: what is the maximum damage if the Ref holder is compromised?
  • Document: if MintRef is compromised -> unlimited inflation. If TransferRef is compromised -> drain all stores. If ExtendRef is compromised -> arbitrary object state modification.

Check 7b: Compensating controls

  • Since Refs cannot be revoked, does the protocol have compensating controls?
    • Pause mechanism that blocks functions using the Ref?
    • Multi-signer requirement before Ref-backed operations?
    • Rate limiting on Ref-backed operations?
  • FINDING trigger: No compensating controls on a stored Ref with high blast radius = single point of failure.

Check 7c: Module upgrade path

  • If the module is upgradeable (compatible or immutable policy?): can an upgrade change who accesses the Ref?
  • If the module is immutable: the Ref access pattern is permanent -- any vulnerability is permanent.
Step 8: Cross-Ref Interaction

Check 8a: Ref combination attacks

  • Can MintRef + TransferRef be combined? (Mint tokens, then force-transfer them to a target store)
  • Can BurnRef + TransferRef be combined? (Transfer tokens from victim store, then burn the evidence)
  • Can ExtendRef + any other Ref be combined? (Generate signer to bypass access control, then use Ref)

Check 8b: Ref holder alignment

  • Are all Refs held by the same entity? If different entities hold different Refs, model adversarial interaction.
  • Example: Admin holds MintRef, Operator holds TransferRef. If Operator is compromised, they can drain stores. Admin cannot revoke TransferRef.

Finding Template

markdown
## Finding [{PREFIX}-N]: {Title}

**Verdict**: CONFIRMED / PARTIAL / REFUTED / CONTESTED
**Step Execution**: {see checklist below}
**Ref Type**: {ConstructorRef / MintRef / BurnRef / TransferRef / DeleteRef / ExtendRef}
**Severity**: {Critical/High/Medium/Low/Info}
**Location**: {SourceFile:LineN}
**Description**: {What capability is exposed and how}
**Impact**: {What an attacker/compromised entity can do with the Ref}
**Evidence**: {Code showing Ref creation, storage, and access path}

### Blast Radius
- **If compromised**: {Maximum damage description}
- **Revocable**: NO (Aptos Refs are permanent)
- **Compensating controls**: {pause/multisig/rate-limit or NONE}

Step Execution Checklist (MANDATORY)

StepRequiredCompleted?Notes
1. Reference InventoryYESY/N/?Must enumerate ALL Refs
2. ConstructorRef AnalysisYESY/N/?
3. MintRef/BurnRef AnalysisIF presentY/N(none)/?
4. TransferRef AnalysisIF presentY/N(none)/?
5. DeleteRef AnalysisIF presentY/N(none)/?
6. Ref Leakage Path AnalysisYESY/N/?Check public returns + friends
7. Ref Revocation AssessmentYESY/N/?Always: Refs are permanent
8. Cross-Ref InteractionIF 2+ Ref typesY/N(single)/?
Output Format for Step Execution
markdown
**Step Execution**: check1,2,3,4,6,7,8 | x5(no DeleteRef)

OR if incomplete:

markdown
**Step Execution**: check1,2,3 | ?4,6,7(TransferRef not fully traced)
**FLAG**: Incomplete analysis -- requires depth review (leakage paths not exhausted)

Instantiation Parameters

{CONTRACTS}           -- Move modules to analyze
{ASSET_NAME}          -- Primary fungible asset name
{REF_STORAGE}         -- Where Refs are stored (resource name and address)
{ACCESS_CONTROL}      -- Who can access stored Refs (signer requirements)
{FRIEND_MODULES}      -- Modules declared as friends
{FREEZE_USED}         -- Whether protocol uses freeze functionality (YES/NO)
{UPGRADE_POLICY}      -- Module upgrade policy (compatible/immutable)

Output Schema

FieldRequiredDescription
ref_inventoryyesComplete table of all Refs in codebase
constructor_ref_analysisyesConstructorRef lifecycle and consumption
mint_burn_analysisif presentMintRef/BurnRef storage and access control
transfer_ref_analysisif presentTransferRef and freeze bypass potential
delete_ref_analysisif presentDeleteRef and resource cleanup
leakage_pathsyesPublic/friend exposure of Refs
revocation_assessmentyesBlast radius and compensating controls
cross_ref_interactionsif 2+ typesCombined Ref attack scenarios
findingyesCONFIRMED / REFUTED / CONTESTED / NEEDS_DEPTH
evidenceyesCode locations with line numbers
step_executionyesStatus for each step

© 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/aptos/ref-lifecycle of PlamenTSV/plamen.

Open the folder on GitHubat commit 795962b

Compare with similar skills

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

Ref Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ref Lifecycle this skillPlamenTSV/plamen303—~3.4kAutomated safety check: PassMIT
Golang Patternsaffaan-m/ECC274k—~1.1kAutomated safety check: PassMIT
Kotlin Exposed Patternsaffaan-m/ECC274k4 repos~5.5kAutomated safety check: PassMIT
Dotnet Patternsaffaan-m/ECC274k1 repos~2.3kAutomated safety check: PassMIT
Fastapi Patternsaffaan-m/ECC274k—~2.3kAutomated safety check: PassMIT
Python Patternsaffaan-m/ECC274k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Golang Patterns

    affaan-m/ECC

    Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization.

    274k GitHub stars~1.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

    274k GitHub starsUsed in 4 repos~5.5k tokens
    DatabasesAuto-check passed
  • Dotnet Patterns

    affaan-m/ECC

    Idiomatic C and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications.

    274k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Fastapi Patterns

    affaan-m/ECC

    FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.

    274k GitHub stars~2.3k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Python Patterns

    affaan-m/ECC

    Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization.

    274k GitHub stars~2.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Patterns

    sickn33/agentic-awesome-skills

    Reference document for monopoly patterns. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 1 repo~2.6k tokens
    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

Questions about Ref Lifecycle

What does Ref Lifecycle do?

Type Thought-template (instantiate before use) - Trigger Pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle. Ref Lifecycle is an agent skill from PlamenTSV/plamen.

When should I use Ref Lifecycle?

Ref Lifecycle fits situations like: pattern Always (Aptos Move) -- ConstructorRef/TransferRef/MintRef/BurnRef lifecycle.

How do I install Ref Lifecycle in Claude Code?

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

How do I install Ref Lifecycle in Codex?

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

Can I use Ref 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 ref-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/ref-lifecycle, .gemini/skills/ref-lifecycle, .github/skills/ref-lifecycle and .opencode/skills/ref-lifecycle in your project.

What does Ref Lifecycle need to run?

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

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

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

About 3.4k tokens (SKILL.md is roughly 14k 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 Ref Lifecycle?

Skills that share tags, products or a category with Ref Lifecycle: Golang Patterns (affaan-m/ECC, 274k stars), Kotlin Exposed Patterns (affaan-m/ECC, 274k stars), Dotnet Patterns (affaan-m/ECC, 274k stars) and Fastapi Patterns (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ref 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.