AgentSkillsCN

cairo-modules-scope

当请求涉及在 Cairo 中将模块拆分至多个文件与文件夹,并将 `mod` 声明与文件一一对应时,讲解如何合理组织模块,将其划分为多个文件。

SKILL.md
--- frontmatter
name: cairo-modules-scope
description: Explain Cairo modules, `mod` declarations, privacy, and scope control; use when a request involves organizing code into modules or resolving visibility errors in Cairo.

Cairo Modules and Scope

Overview

Guide module declarations, nesting, and visibility rules in Cairo.

Quick Use

  • Read references/modules-scope.md before answering.
  • Show where mod must appear and what file it refers to.
  • Emphasize that items are private by default and require pub to expose.

Response Checklist

  • Declare modules with mod name; or inline mod name { ... }.
  • Use pub to make modules or items public.
  • Use super or crate to refer to parent or crate root.

Example Requests

  • "Why can't another module access my function?"
  • "Where should I put mod hosting;?"
  • "How do I make a module public?"

Cairo by Example