一键导入
masm-inline-comments
Enforce inline commenting conventions for Miden Assembly (.masm) files. Use when editing, reviewing, or creating .masm files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforce inline commenting conventions for Miden Assembly (.masm) files. Use when editing, reviewing, or creating .masm files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when writing kernel, account, or note MASM code that reads from or writes to the advice provider (advice stack / advice map) — validate advice data.
Use when writing or reviewing MASM hot paths — prefer the cheaper equivalent instruction: `neq.0` over `push.0 gt` for non-zero checks, `cdrop` over an `if/else` selecting between two values, `dup.N` over `loc_load` for a value still on the stack, `eqw` over hand-rolled element-wise word comparison, `u32gt`/`u32lt` over generic `gt`/`lt` on known-u32 operands.
Use when writing a GENERIC MASM storage utility (one that operates over a caller-chosen slot or map) inside a reusable account component — receive the slot id as a parameter so the utility works against any slot, not one hard-coded one.
Use when constructing a `Felt` from a numeric value in Rust — avoid silently producing a non-canonical Felt that no longer equals the original input.
Critical pitfalls and safety rules for Miden frontend development. Covers WASM initialization, concurrent access crashes, COOP/COEP headers, BigInt handling, Bech32 network mismatches, IndexedDB state loss, auto-sync side effects, Vite configuration, and React rendering race conditions. Use when reviewing, debugging, or writing Miden frontend code.
Guide for advanced Miden frontend development using source repo exploration. Covers AI development practices (Plan Mode, verification-driven development, context engineering, sub-agents) and maps the Miden web-sdk source repository for discovering advanced patterns. Use when building complex applications beyond basic hook usage, implementing custom signers, working with WasmWebClient directly, or troubleshooting SDK internals.
| name | masm-inline-comments |
| description | Enforce inline commenting conventions for Miden Assembly (.masm) files. Use when editing, reviewing, or creating .masm files. |
Inline comments (single #) should begin with a lowercase letter.
# good: lowercase start
# remove the asset from the account
exec.native_account::remove_asset
dropw
# => [ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]
# Bad: uppercase start (avoid)
# Remove the asset from the account
Only add comments that provide value. Skip comments for self-explanatory operations. Only apply this rule to new code you write. Do not remove comments that are present in the code.
Skip comments for:
add, sub, mul, divdrop, swap, dupif.true, while.true, endDo comment:
# => [ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]# compute the pointer at which we should stop iterating# => [...] trackersInsert a blank line after a # => [...] stack-state tracker, except when the next non-blank line is one of:
end (proc / while.true / if.true / repeat.N closing).else (note: else is always bare; a false-conditioned branch uses if.false, not an else.* suffix).# => line that continues the same multi-line stack state.# continuation comment that explains the tracker.This pairs each stack state visually with the operation that produced it and lets the eye skim from one labeled state to the next.
Good:
dupw.1 dupw.1
# => [ASSET_KEY, ASSET_VALUE, ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]
# remove the asset from the account
exec.native_account::remove_asset
dropw
# => [ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]
Also OK (no blank line before end or control flow):
# => [pad(16)]
end
Good:
dupw.1 dupw.1
# => [ASSET_KEY, ASSET_VALUE, ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]
# remove the asset from the account
exec.native_account::remove_asset
dropw
# => [ASSET_KEY, ASSET_VALUE, note_idx, pad(7)]
exec.output_note::add_asset
# => [pad(16)]
Avoid:
# Swap the top two elements
swap # swap
# Drop the word
dropw # drops 4 elements