Skip to content
Back to skills

Cairo Method Syntax

ASecurity

Explain Cairo method syntax, traits/impl blocks, `self` parameter forms, and associated functions; use when a request involves defining or calling methods on structs 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-method-syntax --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo Method Syntax?

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

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

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-method-syntax
description: Explain Cairo method syntax, traits/impl blocks, `self` parameter forms, and associated functions; use when a request involves defining or calling methods on structs in Cairo.
---

# Cairo Method Syntax

## Overview
Guide method definitions using traits and impl blocks, with correct `self` forms.

## Quick Use
- Read `references/method-syntax.md` before answering.
- Show a small struct with an impl block and a method taking `self` or `@self`.
- Mention associated functions for constructors like `new` or `square`.

## Response Checklist
- Use `self` by value for ownership-taking methods.
- Use `@self` for read-only methods and `ref self` for mutation.
- Note that methods are defined in traits and implemented in `impl` blocks.

## Example Requests
- "How do I define a method on a Cairo struct?"
- "What's the difference between `self`, `@self`, and `ref self`?"
- "How do I write a constructor-like associated function?"

## Cairo by Example
- [Methods](https://cairo-by-example.xyz/fn/methods)

Files in this skill

  • SKILL.md1 KB
  • references/method-syntax.md983 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…