cairo

Guide Cairo programming for Starknet smart contract development.

4|1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/hairyf/blockchain-skills --skill cairo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cairo
Source: https://github.com/hairyf/blockchain-skills/tree/main/skills/cairo
Command: npx skills add https://github.com/hairyf/blockchain-skills --skill cairo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write, compile, and understand Cairo programs and Starknet contracts, streamlining the development process for blockchain applications.

Core Features & Use Cases

  • Language Syntax: Understand Rust-like syntax, linear types, and Cairo's core constructs.
  • Starknet Development: Learn about contract structure, storage, entry points, and events.
  • Tooling: Utilize Cairo's compiler and related tools for development workflows.
  • Use Case: A developer needs to implement a new feature in a Starknet smart contract. They can use this Skill to quickly look up the correct syntax for defining storage variables, writing an external function, and emitting an event.

Quick Start

Explain how to define a simple storage variable in a Starknet contract using Cairo.

Frequently Asked Questions about cairo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a storage variable in a Starknet contract using Cairo?

To define storage variables in a Starknet contract using Cairo, you utilize Cairo's Starknet-specific storage constructs. This allows you to securely declare and manage on-chain state directly within your contract modules.

What is the best way to write external entry points in Starknet contracts?

The best way to write external entry points in Starknet contracts is by using Cairo's dedicated entry point constructs. This approach ensures your contract functions are correctly exposed for external blockchain interaction and state modification.

Does Cairo support object-oriented programming or does it use linear types?

Cairo uses linear types rather than traditional object-oriented programming. This system ensures resource safety and provable program execution, requiring developers to handle variables explicitly within modules and traits.

How do I emit events from a smart contract on Starknet?

To emit events from a smart contract on Starknet, you use Cairo's built-in event constructs. This functionality allows your contracts to log specific operational data and state changes for off-chain observers.

Can I use Rust syntax when developing smart contracts with Cairo?

Cairo features a Rust-like syntax, making it familiar for Rust developers. However, it is a distinct programming language specifically designed for writing provable programs and Starknet blockchain applications.