跳到技能内容
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
词映 AI导航
工具库Skills 技能
我的收藏
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
Skills directory/0xMiden/protocol/masm-named-literals

Claude Code skill for replacing Rust magic numbers with associated constants

Give repeated domain values a name on the Rust type that owns their meaning, then use that constant consistently.

中文

Install in Claude Code

Use a Miden Rust checkout and pick a helper type whose capacity is duplicated. Work within local Rust files for this exercise.

  1. Review `.claude/skills/masm-named-literals/SKILL.md` and its requirements at the pinned GitHub commit.
  2. Create `.claude/skills/masm-named-literals/` in your project and save the reviewed file as `.claude/skills/masm-named-literals/SKILL.md`.
  3. Start Claude Code from that project's root, then select `/masm-named-literals` in the slash menu.

Example task

Use a trail-record queue. Replace 24 in the capacity allocation and boundary check with one associated constant. Keep unrelated values with the same number separate.
`TrailQueue` · `TrailQueue::CAPACITY` · `24` rows · `25` rows

What to check

One definition gives `TrailQueue::CAPACITY` the value `24`. The queue admits `24` rows and rejects row `25` through the existing limit.

Original SKILL.md on GitHub · Updated 2026-11-14

Frequently asked question

Why keep two constants that have the same number?

A constant name represents a domain meaning. Reuse a number when its meaning is shared and let separate limits evolve independently.

Related skills from this repository

  • Claude Code assert-specific-error-in-tests skill for exact Rust error assertions
  • Claude Code skill for checking integer addition overflow in Rust
  • Claude Code conversion-method-naming skill for Rust ownership signals
Browse Claude Code skills in the Chinese directory
词映 AI 导航Skills 技能
工具分类全部工具已本地化技能选型指南AI 快讯