smithery.ai

cairo-custom-data-structures

Explain how to build custom data structures in Cairo using structs, traits, and dictionaries; use when a request involves implementing mutable collections (like a vector) or handling Destruct/Drop with Felt252Dict.

First seen Apr 4, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,334 B
  • docs SUMMARY.md 250 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Cairo Custom Data Structures

Overview

Guide users through building mutable data structures on top of dictionaries and traits, including proper destruction.

Quick Use

  • Read references/custom-data-structures.md before answering.
  • Emphasize that arrays are immutable; use Felt252Dict for mutable storage.
  • Call out Destruct implementations for structs containing dictionaries.

Response Checklist

  • Define a trait interface for the structure's operations.
  • Store values in a Felt252Dict and track len separately when emulating vectors.
  • Use Nullable when storing generic T in a dict.
  • Implement Destruct to squash() dictionaries.

Example Requests

  • "How do I build a mutable vector in Cairo?"
  • "Why does my struct with a dictionary need Destruct?"
  • "How can I update a value by index?"

Cairo by Example