AgentSkillsCN

cairo-comments

当请求涉及在 Cairo 中使用匿名函数,或将行为作为参数传递时,讲解 Cairo 的闭包、语法、捕获规则、类型推断以及 Fn 特性等知识。

SKILL.md
--- frontmatter
name: cairo-comments
description: Explain Cairo comment styles and documentation comments (`//`, `///`, `//!`); use when a request involves commenting code, documenting functions/modules, or generating Cairo API docs.

Cairo Comments

Overview

Provide correct Cairo comment syntax, including documentation comments for APIs and modules.

Quick Use

  • Read references/comments.md before answering.
  • Show small examples for line comments and doc comments.
  • If the user wants documentation, include # Panics or # Examples sections where appropriate.

Response Checklist

  • Choose // for regular comments.
  • Choose /// for item-level docs (functions, structs, traits, impls).
  • Choose //! for module-level docs placed at the top of the file.

Example Requests

  • "How do I add documentation comments to a Cairo function?"
  • "Is there a module-level doc comment in Cairo?"

Cairo by Example