Skip to content
Back to skills

Cairo Operator Overloading

ASecurity

Explain Cairo operator overloading using core::ops traits like Add; use when a request involves redefining operators for custom types 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-operator-overloading --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo Operator Overloading?

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

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

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-operator-overloading
description: Explain Cairo operator overloading using core::ops traits like Add; use when a request involves redefining operators for custom types in Cairo.
---

# Cairo Operator Overloading

## Overview
Show how to overload operators by implementing the corresponding trait.

## Quick Use
- Read `references/operator-overloading.md` before answering.
- Use a concise example like `impl TypeAdd of Add<Type>`.
- Emphasize that operator meaning should remain intuitive.

## Response Checklist
- Choose the correct trait (e.g., `Add`, `Sub`, `Mul`, `Div`, `Rem`, `Neg`).
- Implement the trait for the concrete RHS type (`Add<Other>` or `Add<Self>`).
- Return a new value with the expected semantics.

## Example Requests
- "How do I implement `+` for a custom struct?"
- "Can I overload operators in Cairo?"

## Cairo by Example
- [Operator Overloading](https://cairo-by-example.xyz/trait/ops)

Files in this skill

  • SKILL.md929 B
  • references/operator-overloading.md397 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…