Skip to content
Back to skills

Cairo References Snapshots

ASecurity

Explain Cairo references, snapshots (`@`), `ref` parameters, and desnap (`*`); use when a request involves borrowing, avoiding moves, or mutating data through references in Cairo.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
documentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill cairo-references-snapshots --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo References Snapshots?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cairo References Snapshots
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-cairo-references-snapshots/badge)](https://www.skillsdirectory.com/skills/david-li0406-cairo-references-snapshots)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cairo-references-snapshots
description: Explain Cairo references, snapshots (`@`), `ref` parameters, and desnap (`*`); use when a request involves borrowing, avoiding moves, or mutating data through references in Cairo.
---

# Cairo References and Snapshots

## Overview
Explain when to pass by value, snapshot, or mutable reference, and how to read or mutate safely.

## Quick Use
- Read `references/references-snapshots.md` before answering.
- Show the correct parameter form (`value`, `@value`, or `ref value`).
- Use `*snapshot` only for `Copy` types.

## Response Checklist
- Use snapshots (`@T`) to read without moving ownership.
- Use `ref` when the callee must mutate and the caller must regain ownership.
- Remind that `ref` requires a `mut` variable at the call site.
- Call out that snapshots are immutable and cannot be mutated directly.

## Example Requests
- "Why does passing this array move ownership?"
- "How do I modify a struct inside a function and keep it?"
- "What does `@` mean in a type annotation?"

## Cairo by Example
- [Retaining Ownership](https://cairo-by-example.xyz/scope/retaining_ownership)
- [Snapshots](https://cairo-by-example.xyz/scope/retaining_ownership/snapshots)
- [References](https://cairo-by-example.xyz/scope/retaining_ownership/ref)

Files in this skill

  • SKILL.md1.3 KB
  • references/references-snapshots.md1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…