agentleFS
chalk-labchalk-lab/Mooncake.jl/.claude/skills/inspect/SKILL.md

inspect

Skill413 starsChanged 5 months agoMITView on GitHub

Inspect the AD pipeline IR for a Julia function at each Mooncake compilation stage.

15 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not assume — ask the user to pick.

    line 24
  2. Distinctive:

    Run commands via Bash and present IR in fenced code blocks.

    line 84
  3. Distinctive:

    When showing diffs, explain what changed and why the transformation matters.

    line 85
  4. Distinctive:

    If errors occur, check that Mooncake is loaded and the function signature is valid.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Inspect

Inspect IR transformations in Mooncake's AD pipeline for a given function.

Setup

using Mooncake, Mooncake.SkillUtils

Gathering user intent

Ask the user:

  1. Function and arguments — e.g. sin, 1.0 or a custom function
  2. Mode — reverse (default) or forward
  3. What to view — all stages, a specific stage, a diff between two stages, or world age info

Do not assume — ask the user to pick.

Pipeline stages

Reverse mode (default)

StageSymbolDescription
Raw IR:rawoptimised, type-inferred SSAIR from Julia's compiler
Normalised:normalizedafter Mooncake's normalisation passes
CFG blocks:cfg_blocksVector{CFGBlock} representation with stable IDs
Forward IR:fwd_irgenerated forward-pass IR
Reverse IR:rvs_irgenerated pullback IR
Optimised Forward:optimized_fwdforward pass after optimisation
Optimised Reverse:optimized_rvspullback after optimisation

Forward mode

StageSymbolDescription
Raw IR:rawoptimised, type-inferred SSAIR from Julia's compiler
Normalised:normalizedafter Mooncake's normalisation passes
CFG blocks:cfg_blocksinspection-only — forward mode does not use the CFGBlock representation internally
Dual IR:dual_irgenerated dual-number IR
Optimised:optimizedafter optimisation passes

Commands

# Full inspection
ins = inspect_ir(f, args...; mode=:reverse)  # or mode=:forward

# View stages
show_ir(ins)                          # all stages
show_stage(ins, :raw)                 # one stage

# Diffs between stages
show_diff(ins; from=:raw, to=:normalized)
show_all_diffs(ins)

# World age debugging
show_world_info(ins)

# Write everything to files
write_ir(ins, "/tmp/ir_output")

# Shorthand helpers
ins = inspect_fwd(f, args...)         # forward mode
ins = inspect_rvs(f, args...)         # reverse mode
ins = quick_inspect(f, args...)       # inspect + display immediately

# Options
inspect_ir(f, args...;
    mode       = :reverse,
    optimize   = true,
    do_inline  = true,
    debug_mode = false,
)

Presenting results

  • Run commands via Bash and present IR in fenced code blocks.
  • When showing diffs, explain what changed and why the transformation matters.
  • If errors occur, check that Mooncake is loaded and the function signature is valid.

Limitations

Inspects Mooncake's internal AD pipeline only. For allocation, world-age, or compiler-boundary debugging, see docs/src/developer_documentation/advanced_debugging.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.