Skill / SKILL.md

Rust Macros

rewrite-rs/skills

Write a macro only when a function, a trait, or a generic cannot do the job — then by-example before proc-macro, with hygiene, a `_private` helper module, and spanned compile errors instead of panics. Use when writing or reviewing macro_rules! or a proc macro, when a derive or attribute macro is being added, when macro hygiene or `$crate` comes up, or when the user asks whether something should be a macro.
2 views 29 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Write a macro only when a function, a trait, or a generic cannot do the job — then by-example before proc-macro, with hygiene, a `_private` helper module, and spanned compile errors instead of panics. Use when writing or reviewing macro_rules! or a proc macro, when a derive or attribute macro is being added, when macro hygiene or `$crate` comes up, or when the user asks whether something should be a macro.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/rewrite-rs/skills' skill-source

Use the complete skill-source/skills/misc/rust-macros directory with your client’s skill installer.

  • skills/misc/rust-macros

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/misc/rust-macros

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
a8611b45f61d88ab265750b0f991954c1b31a0ac6bf22d33198d5c4b38a06c2e
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills