Skip to content
Back to skills

Cairo Structs

ASecurity

Explain how to define and instantiate Cairo structs, field access, mutability, field init shorthand, and update syntax; use when a request involves struct definitions or field-related compile errors 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-structs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo Structs?

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

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

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-structs
description: Explain how to define and instantiate Cairo structs, field access, mutability, field init shorthand, and update syntax; use when a request involves struct definitions or field-related compile errors in Cairo.
---

# Cairo Structs

## Overview
Guide struct definitions, instantiation patterns, and safe field updates.

## Quick Use
- Read `references/structs.md` before answering.
- Use clear examples showing `struct` definition and `Type { field: value }` initialization.
- Highlight ownership effects of struct update syntax.

## Response Checklist
- Note that the whole instance must be `mut` to change any field.
- Use field init shorthand when variable names match field names.
- If using update syntax, mention that it moves fields from the source instance.

## Example Requests
- "How do I define a struct with multiple fields in Cairo?"
- "Why can't I mutate just one struct field without `mut`?"
- "How does struct update syntax affect ownership?"

## Cairo by Example
- [Custom Types](https://cairo-by-example.xyz/custom_types)
- [Structures](https://cairo-by-example.xyz/custom_types/structs)
- [Struct visibility](https://cairo-by-example.xyz/mod/struct_visibility)

Files in this skill

  • SKILL.md1.2 KB
  • references/structs.md805 B

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…