mlir

mlir is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 76 tokens per session (1,696 once invoked), scanned A, original, MIT.

A guide and workflow for MLIR, a compiler framework that represents programs at several levels before turning them into machine code. It covers custom dialects and operations, lowering passes, built-in representations, and tools such as mlir-opt.

In plain words
What is it for?
Use it to define compiler operations, create dialects, write lowering passes, inspect intermediate representations, and build ML compiler pipelines.
Why use it?
It provides a structured way to transform high-level machine-learning or domain-specific code into lower-level forms for execution.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define compiler operations, create dialects, write lowering passes, inspect intermediate representations, and build ML compiler pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/mlir
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill mlir
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mlir

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/mlir/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/mlir)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/mlir"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/mlir/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mlir

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/mlir"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/mlir.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.01696
Opus 5.5 $0.00030 $0.00678
Sonnet 5.5 $0.00015 $0.00339
Haiku 4.5 $0.00008 $0.00170

Measured 14d ago against content hash 75318fe16276, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mlir scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/compiler-internals/mlir/SKILL.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MLIR

Purpose

Guide agents through MLIR (Multi-Level IR): ops, regions, blocks, and values; built-in dialects (arith, func, memref, affine, linalg); writing custom dialects with ODS; lowering passes with ConversionPattern; mlir-opt CLI; and ML compiler use cases (Torch-MLIR, IREE).

Triggers

  • Building a domain-specific compiler IR (graphics, ML, hardware DSL)
  • Lowering high-level ops to LLVM or GPU dialects
  • Writing progressive lowering pipelines (linalg → loops → LLVM)
  • Integrating with IREE or Torch-MLIR for ML deployment
  • Creating reusable transformation passes across dialects
  • Prototyping compiler optimizations at the right abstraction level

Workflow

1. MLIR structure

Module
└── func.func @main()
    └── region
        └── block ^bb0:
            └── operations (ops) producing SSA values

Key concepts:

  • Operation — instruction-like node (arith.addi, memref.load)
  • Region — container of blocks (functions, control flow)
  • Block — CFG node with ordered ops
  • Value — SSA result of an op or block argument

2. Built-in dialects

Dialect Purpose
arith Integer/float arithmetic
func Function definitions and calls
memref Buffer abstraction with shapes/strides
affine Affine loop nests, map/set constraints
linalg Structured linear algebra ops
scf Structured control flow (for, if)
llvm LLVM IR dialect for final lowering
gpu GPU kernel launches
// example.mlir
func.func @add(%a: memref<4xf32>, %b: memref<4xf32>, %c: memref<4xf32>) {
  %c0 = arith.constant 0 : index
  %c4 = arith.constant 4 : index
  scf.for %i = %c0 to %c4 step %c1 {
    %av = memref.load %a[%i] : memref<4xf32>
    %bv = memref.load %b[%i] : memref<4xf32>
    %sum = arith.addf %av, %bv : f32
    memref.store %sum, %c[%i] : memref<4xf32>
  }
  return
}

3. mlir-opt CLI

# Parse and print
mlir-opt example.mlir

# Run canonicalization
mlir-opt example.mlir -canonicalize

# Lower affine to scf
mlir-opt affine.mlir -lower-affine

# Full pipeline toward LLVM
mlir-opt input.mlir \
  --linalg-bufferize \
  --convert-linalg-to-loops \
  --convert-scf-to-cf \
  --convert-arith-to-llvm \
  --convert-memref-to-llvm \
  --convert-func-to-llvm \
  -o llvm.mlir

Read the full file on GitHub · 205 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · +2 lines 75318fe16276
  2. 3mo ago First seen · 203 lines · 76 tokens per session scan A 5ef9d24b9a2f

Subscribe to this mod's changes

mlir is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 76 tokens to every session and 1,696 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

mlir compared with skills from other repositories

mlir next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mlirmohitmishra786/low-level-dev-skillsSkill31014d agoMITA76Claude Code, Codex
ecommerce-marketing-strategy-buildernexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA112Claude Code, Codex
product-description-generatornexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA126Claude Code, Codex
shopify-marketingnexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA60Claude Code, Codex
tiktok-shop-cross-bordernexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA55Claude Code, Codex
ecommerce-landing-pagenexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA45Claude Code, Codex
market-gap-analysisnexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA38Claude Code, Codex