Agent skill

Masm File Structure

by 0xMiden in 0xMiden/protocol

Enforce file structure and section ordering for Miden Assembly (.masm) files.

MITAuto-check passedDevelopment

Install Masm File Structure

skills CLI
$ npx skills add 0xMiden/protocol --skill masm-file-structure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 0xMiden/protocol masm-file-structure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/0xMiden/protocol.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/masm-file-structure .claude/skills/masm-file-structure && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
masm-file-structure
GitHub stars
133
Token cost
~885 tokens
SKILL.md length
204 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Enforce file structure and section ordering for Miden Assembly (.masm) files.

  • Works in 5 steps: Imports – use statements only; no… → Type aliases – type definitions → Constants – see the masm-constants skill… → …
  • Creating .masm files
  • SKILL.md covers Section Order, Example Structure, Guidelines and When Sections Are Omitted, plus 1 more section
  • Needs LEAF_DATA_KEY and PROOF_DATA_KEY

What it does

Masm File Structure is an agent skill from 0xMiden/protocol. Enforce file structure and section ordering for Miden Assembly (.masm) files. Use when editing, reviewing, or creating .masm files.

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: Core components of the Miden protocol. The licence is MIT.

When your agent uses it

  • Creating .masm files

Example prompts

  • “/masm-file-structure”

Requirements

  • A credential in LEAF_DATA_KEY
  • A credential in PROOF_DATA_KEY

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Imports – use statements only; no section header
  2. Type aliases – type definitions
  3. Constants – see the masm-constants skill for organization (non-error constants first, then errors)
  4. Public interface – pub proc procedures that form the module API
  5. Helper procedures – proc (non-pub) procedures used internally

What it can do on your machine

Read from SKILL.md and the folder at commit 5f6a246. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are masm).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LEAF_DATA_KEY
    • PROOF_DATA_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Masm File Structure loads about 885 tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 204 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~885

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 0xMiden/protocol at commit 5f6a246, republished under its MIT licence (© 0xMiden). 204 words, ~885 tokens.

Download SKILL.mdSave it as .claude/skills/masm-file-structure/SKILL.md (or your agent's skills folder).
name
masm-file-structure
description
Enforce file structure and section ordering for Miden Assembly (.masm) files. Use when editing, reviewing, or creating .masm files.

MASM File Structure

MASM files must follow a fixed section order. Use section headers with the long separator line:

masm
# SECTION NAME
# =================================================================================================

Section Order

  1. Imports – use statements only; no section header
  2. Type aliases – type definitions
  3. Constants – see the masm-constants skill for organization (non-error constants first, then errors)
  4. Public interface – pub proc procedures that form the module API
  5. Helper procedures – proc (non-pub) procedures used internally

Example Structure

masm
use miden::agglayer::bridge::bridge_config
use miden::agglayer::bridge::leaf_utils
use miden::core::mem
use miden::core::word

# TYPE ALIASES
# =================================================================================================

type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
type DoubleWord = struct { word_lo: BeWord, word_hi: BeWord }
type MemoryAddress = u32

# CONSTANTS
# =================================================================================================

const PROOF_DATA_PTR = 0
const PROOF_DATA_WORD_LEN = 134

# ERRORS
# =================================================================================================

const ERR_BRIDGE_NOT_MAINNET = "bridge not mainnet"
const ERR_LEADING_BITS_NON_ZERO = "leading bits of global index must be zero"

# PUBLIC INTERFACE
# =================================================================================================

#! Main entry point. Computes the leaf value and verifies it.
#!
#! Inputs:  [LEAF_DATA_KEY, PROOF_DATA_KEY, pad(8)]
#! Outputs: [pad(16)]
#!
#! Invocation: call
pub proc verify_leaf_bridge
    exec.get_leaf_value
    exec.verify_leaf
end

# HELPER PROCEDURES
# =================================================================================================

#! Loads leaf data and computes the leaf value.
#!
#! Inputs:  [LEAF_DATA_KEY]
#! Outputs: [LEAF_VALUE[8]]
#!
#! Invocation: exec
proc get_leaf_value(leaf_data_key: BeWord) -> DoubleWord
    ...
end

#! Verifies leaf against Merkle proof.
#!
#! Inputs:  [LEAF_VALUE[8], PROOF_DATA_KEY]
#! Outputs: []
#!
#! Invocation: exec
proc verify_leaf
    ...
end

Guidelines

  • Imports: One use per line; group by module. No blank lines between imports.
  • Type aliases: Define shared types (e.g. DoubleWord, MemoryAddress) before constants or procedures.
  • Constants: Follow the masm-constants skill.
  • Public interface: Only pub proc; these are the module’s API. Order by importance or call flow.
  • Helper procedures: Non-pub procedures that support the public interface. May include pub proc helpers (e.g. get_leaf_value) if they are used internally or re-exported, or used for unit tests.

When Sections Are Omitted

  • No imports → start with type aliases or constants
  • No type aliases → constants follow imports
  • No helpers → public interface is the last section

Validation Checklist

  • Imports at top (if any)
  • Type aliases before constants and procedures
  • Constants before procedures; errors subsection after non-error constants
  • Public interface (pub proc) before helper procedures
  • Section headers use # SECTION NAME and # ===... separator

© 0xMiden, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/masm-file-structure of 0xMiden/protocol.

Open the folder on GitHubat commit 5f6a246

Compare with similar skills

Masm File Structure next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Masm File Structure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Masm File Structure this skill0xMiden/protocol133—~885Automated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from 0xMiden/protocol

All 35 skills in this repo
  • Advice Provider Hygiene

    0xMiden/protocol

    A skill your agent uses when writing kernel, account, or note MASM code that reads from or writes to the advice provider (advice stack / advice map) — validate advice data.

    133 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Cheap Masm Equivalents

    0xMiden/protocol

    A skill your agent uses when writing or reviewing MASM hot paths or loops — prefer the cheaper equivalent: loop counters and pointers on the operand stack instead of procedure locals, neq.0 over…

    133 GitHub stars~804 tokensUpdated yesterday
    Auto-check passed
  • Keep CHANGELOG.md entries to a single concise sentence. An agent skill from 0xMiden/protocol.

    133 GitHub stars~805 tokensUpdated yesterday
    Auto-check passed
  • Keep PR and issue descriptions short and decision-focused. An agent skill from 0xMiden/protocol.

    133 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Conversion Method Naming

    0xMiden/protocol

    A skill your agent uses when naming a conversion or accessor method in Rust — follow the Rust API naming conventions for the method's cost and ownership.

    133 GitHub stars~450 tokensUpdated yesterday
    Auto-check passed
  • A skill your agent uses when writing a generic MASM utility that accesses a caller-selected account storage slot — receive the slot as a parameter so the utility is portable across storage layouts.

    133 GitHub stars~529 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Masm File Structure

What does Masm File Structure do?

Enforce file structure and section ordering for Miden Assembly (.masm) files. Masm File Structure is an agent skill from 0xMiden/protocol.masm) files.

When should I use Masm File Structure?

Masm File Structure fits situations like: creating .masm files.

How do I install Masm File Structure in Claude Code?

Run `npx skills add 0xMiden/protocol --skill masm-file-structure -a claude-code`. Or copy the skill folder (.claude/skills/masm-file-structure in 0xMiden/protocol) into .claude/skills/masm-file-structure in your project. Claude Code loads it when a task matches its description.

How do I install Masm File Structure in Codex?

Run `npx skills add 0xMiden/protocol --skill masm-file-structure -a codex`. Or copy the skill folder (.claude/skills/masm-file-structure in 0xMiden/protocol) into .agents/skills/masm-file-structure in your project. Codex loads it when a task matches its description.

Can I use Masm File Structure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 0xMiden/protocol --skill masm-file-structure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/masm-file-structure, .gemini/skills/masm-file-structure, .github/skills/masm-file-structure and .opencode/skills/masm-file-structure in your project.

What does Masm File Structure need to run?

Going by SKILL.md and its folder, Masm File Structure needs credentials named LEAF_DATA_KEY and PROOF_DATA_KEY. Our summary lists: A credential in LEAF_DATA_KEY; A credential in PROOF_DATA_KEY.

Does Masm File Structure access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Masm File Structure safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Masm File Structure use?

Masm File Structure is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Masm File Structure use?

About 885 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Masm File Structure?

Skills that share tags, products or a category with Masm File Structure: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Masm File Structure?

0xMiden (a GitHub organization) maintains it in 0xMiden/protocol, which has 133 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 8, 2026.

Source: 0xMiden/protocol on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.