Skip to main content
ClaudeWave
EN, English
Skill142 repo starsupdated 25d ago

ilspy-decompile

The ilspy-decompile skill enables reverse engineering of compiled .NET assemblies by translating binary code back into readable C# source code. Use this skill when investigating how .NET APIs work internally, examining third-party NuGet package implementations, viewing .NET framework source code, or understanding the behavior of compiled binaries without access to original source.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules /tmp/ilspy-decompile && cp -r /tmp/ilspy-decompile/plugins/handbook-dotnet/skills/ilspy-decompile ~/.claude/skills/ilspy-decompile
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# .NET Assembly Decompilation with ILSpy

Use this skill to understand how .NET code works internally by decompiling compiled assemblies.

## Prerequisites

- .NET SDK installed
- ILSpy command-line tool available via one of the following:
  - `dotnet dnx ilspycmd` (if available in your SDK or runtime)
  - `dotnet tool install --global ilspycmd`

Both forms are shown below. Use the one that works in your environment.

> Note: ILSpyCmd options may vary slightly by version.
> Always verify supported flags with `ilspycmd -h`.

## Quick start

```bash
# Decompile an assembly to stdout
ilspycmd MyLibrary.dll
# or
dotnet dnx ilspycmd MyLibrary.dll

# Decompile to an output folder
ilspycmd -o output-folder MyLibrary.dll
```

## Common .NET Assembly Locations

### NuGet packages

```bash
~/.nuget/packages/<package-name>/<version>/lib/<tfm>/
```

### .NET runtime libraries

```bash
dotnet --list-runtimes
```

### .NET SDK reference assemblies

```bash
dotnet --list-sdks
```

> Reference assemblies do not contain implementations.

### Project build output

```bash
./bin/Debug/net8.0/<AssemblyName>.dll
./bin/Release/net8.0/publish/<AssemblyName>.dll
```

## Core workflow

1. Identify what you want to understand
2. Locate the assembly
3. List types to find the target
4. Decompile the target

## Commands

### List types in an assembly

Use `-l` with an entity type to discover what's inside:

```bash
# List classes
ilspycmd -l c MyLibrary.dll

# List interfaces
ilspycmd -l i MyLibrary.dll

# List structs, delegates, enums
ilspycmd -l s MyLibrary.dll
ilspycmd -l d MyLibrary.dll
ilspycmd -l e MyLibrary.dll
```

### Basic decompilation

```bash
ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll
```

### Targeted decompilation

```bash
# Decompile specific type
ilspycmd -t Namespace.ClassName MyLibrary.dll

# Specify C# language version (default: Latest)
ilspycmd -lv CSharp12_0 MyLibrary.dll
```

### View IL code

```bash
ilspycmd -il MyLibrary.dll
```

### Clean output

```bash
# Remove dead code and dead stores for cleaner results
ilspycmd --no-dead-code --no-dead-stores MyLibrary.dll
```

### Organized project output

```bash
# Decompile with nested directories matching namespaces
ilspycmd --nested-directories -p -o ./decompiled MyLibrary.dll
```

## References

- **references/diagrammer.md** — Generate interactive HTML diagrams from assemblies. Load when the user asks to visualize or explore type relationships.

## Notes on modern .NET builds

- ReadyToRun images may reduce readability
- Trimmed or AOT builds may omit code
- Prefer non-trimmed builds

## Legal note

Decompiling assemblies may be subject to license restrictions.
adr-planSkill

Analyze a task and produce an Architecture Decision Record with implementation steps.

coverage-reportSkill

Generate a .NET code coverage report scoped to files changed in the current branch. Runs tests with coverage collection and produces filtered HTML reports.

dotnet-dependencySkill

This skill should be used when investigating .NET project dependencies, understanding why packages are included, listing references, or auditing for outdated/vulnerable packages.

dotnet-run-fileSkill

Run script-like CSharp programs using dotnet run file.cs. Use this skill when users want to execute CSharp code directly, write one-liner scripts via stdin, or learn about run file directives.

dotnet-verifySkill

This skill should be used when working with Verify snapshot tests in .NET projects. Use when updating verified snapshots after intentional code changes, accepting new snapshots, discovering verify tests, or troubleshooting snapshot mismatches. Trigger phrases include "verify tests", "update snapshots", "accept snapshots", "verified files", ".verified.txt".

elasticsearchSkill

>

git-worktreeSkill

This skill should be used when the user wants to manage Git worktrees - creating worktrees from local or remote branches, listing active worktrees with details, deleting worktrees, or switching between worktrees. Ideal for working on multiple branches simultaneously without stashing changes.

glabSkill

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.