Skip to content
Back to skills

Resource Compiler

ASecurity

Compile Source 2 addon resources with the game's Resource Compiler on Windows — resolve the game installation from the Steam registry, pick the right inputs, run the compiler, locate the compiled outputs and diagnose build failures. Covers Panorama XML/CSS and SVG, textures, materials, models, particles, sounds and sound events, the raw images, meshes and audio they are built from, the order to compile them in, and Hammer map build workflows. Does not package a VPK or publish Workshop items.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 30, 2026
ai-agentsshell

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 30, 2026

npx -y skills add Wend4r/s2r-skills --skill resource-compiler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Resource Compiler?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Resource Compiler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wend4r-resource-compiler/badge)](https://www.skillsdirectory.com/skills/wend4r-resource-compiler)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: resource-compiler
description: Compile Source 2 addon resources with the game's Resource Compiler on Windows — resolve the game installation from the Steam registry, pick the right inputs, run the compiler, locate the compiled outputs and diagnose build failures. Covers Panorama XML/CSS and SVG, textures, materials, models, particles, sounds and sound events, the raw images, meshes and audio they are built from, the order to compile them in, and Hammer map build workflows. Does not package a VPK or publish Workshop items.
license: MIT
---

# Source 2 Resource Compiler

Compile the user's existing source assets with the Resource Compiler shipped in the target game's
Workshop Tools. Do not limit discovery to XML and CSS — the installed game and compiler determine
which resource types and build options exist.

## The pipeline

```
Steam registry  →  libraryfolders.vdf  →  appmanifest_<appId>.acf
                                                   │
                                                   ▼
                                          installation root
                                        ┌──────────┴──────────┐
                        content\<game>_addons\ADDON     game\bin\win64\resourcecompiler.exe
                                   main.css  ──────── -i ────────▶  game\<game>_addons\ADDON
                                   main.xml                              main.vcss_c
                                                                         main.vxml_c
```

Four phases, each with a way to be wrong:

| Phase | Reference | The mistake it prevents |
|---|---|---|
| Find the game | [installation.md](references/installation.md) | Hardcoding a drive letter, or writing into the wrong installation |
| Pick the inputs | [resources.md](references/resources.md) | Handing the compiler a `.png` that belongs to a material |
| Compile | [compile.md](references/compile.md) | Compiling `_c` outputs, skipping dependencies, losing the working directory |
| Verify | [compile.md](references/compile.md) | Calling a zero exit code proof that the resource was built |

## The short version

```powershell
& $compiler -i $sourcePath
```

Absolute input path, PowerShell's call operator, run from the compiler's own directory, exit code
checked after every file. The full loop with its guards is in
[compile.md](references/compile.md).

## Rules that hold everywhere

- **Resolve the installation, do not assume it.** A Steam library sits on any drive under any
  folder name; only the `steamapps\...` tail is fixed. See
  [installation.md](references/installation.md).
- **`content/` is sources, `game/` is output.** A `content/` path in the request names the source
  tree — it is not an instruction to put compiled files there.
- **Inputs are definitions, not raw assets.** Pass `.css`, `.xml`, `.vmat`, `.vmdl`, `.vtex`,
  `.vsnd` and friends. A `.png`, `.dmx`, `.wav` or `.mp3` is an ingredient named inside one of
  those, an existing `_c` file is a product and never an input, and renaming a raw file to a
  compiled extension produces nothing usable. See [resources.md](references/resources.md).
- **Respect the requested scope.** Compile the resources asked for. No recursive addon sweeps,
  forced rebuilds, lighting bakes or packaging flags unless the task calls for them.
- **Inspect before writing.** Read existing files, and applicable repository instructions, before
  creating or replacing anything.
- **A bare `-i` is not a map build.** A full Hammer `.vmap` build spans geometry, visibility,
  physics, lighting, navigation and packaging.
- **Report honestly.** Compilation succeeding is not runtime validation, not a complete map build,
  not VPK packaging, and not Workshop publication.

## When a run fails

Read the compiler's own diagnostic and change something — the input, the arguments, or your
understanding of the resource type — before running again. Retrying an unchanged command is never
the fix. The symptom-to-cause table is in
[compile.md](references/compile.md), *Diagnose failures*.

Two failures that look worse than they are: a `skipped` result can mean the output was already
up to date, and a trailing `Leaked KeyValues blocks: <n>` accompanies successful runs too.

## Files

| File | Contents |
|---|---|
| [installation.md](references/installation.md) | Steam registry lookup, library roots, app IDs, `content/` vs `game/`, per-game addon directories, the compiler binary |
| [resources.md](references/resources.md) | Definitions vs raw assets, a worked addon tree, the per-type table, what a definition file looks like, compile order, Panorama naming |
| [compile.md](references/compile.md) | The compile loop, choosing inputs, Hammer builds, verification, source-to-output names, failure diagnosis |

Files in this skill

  • SKILL.md4.8 KB
  • references/compile.md8.5 KB
  • references/installation.md7.6 KB
  • references/resources.md10.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…