Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

unity-build-pipeline — Claude Code skill: what it does, how to install

Configures and scripts Unity 6.3 LTS builds via BuildPipeline, build profiles, and CI headless runs. Helps tune stripping and pick Mono or IL2CPP.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-build-pipeline -a claude-code
Open on GitHub

What unity-build-pipeline does

This skill guides the setup and automation of Unity 6.3 LTS (6000.3) player builds. It focuses on scene lists in EditorBuildSettings or BuildProfile assets, platform switching, Managed Stripping Levels, and executing BuildPipeline.BuildPlayer with checks on BuildReport.summary.result.

It provides C# build script templates, link.xml definitions to protect reflection-dependent code during bytecode stripping, and CLI execution patterns using -batchmode, -quit, -nographics, and -executeMethod. It also addresses content build steps required for the Addressables package.

Compiling with IL2CPP fails instantly on bare machines without the required platform C++ toolchain, unlike Mono. Because SwitchActiveBuildTarget cannot run in batch mode, passing -buildTarget in CLI arguments is mandatory.

What it helps with

  • script a custom player build using BuildPipeline.BuildPlayer in C#
  • configure headless batchmode execution for Unity builds on CI runners
  • write a link.xml file to preserve types during managed code stripping
  • automate player generation using BuildProfile assets and custom scene lists

Example prompts for the agent

  • Write a C# script using BuildPipeline.BuildPlayer for Windows Standalone with BuildReport verification
  • Show the Unity CLI command line for headless CI builds with batchmode and nographics
  • Create a link.xml file to keep reflection types in the MyGameRuntime assembly

How to install unity-build-pipeline

1Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-build-pipeline -a claude-code

2Manually: put the files in place

~/.claude/skills/unity-build-pipeline/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/unity-build-pipeline/

From the same set40

The whole set →
game-feel gamedev-skills Teaches the agent to add feedback to game actions: camera shake, hit-stop, eased tweens, squash and stretch, knockback. For mechanics that work but feel weightless. Claude Code CX Codex Cursor +1 9,400installs game-ui-ux gamedev-skills Engine-neutral game UI architecture skill for responsive layouts, screen stacks, gamepad focus, and event-driven HUD updates. Claude Code CX Codex Cursor +1 9,200installs level-design gamedev-skills Plans playable game levels from blockout through playtesting, covering routes, pacing, gates and encounters. Use it when working on whiteboxes, critical paths or room flow. Claude Code CX Codex Cursor +1 7,500installs camera-systems gamedev-skills Engine-neutral patterns for 2D and 3D game cameras: smooth follow, deadzones, look-ahead, bounds clamping, and third-person collision. Claude Code CX Codex Cursor +1 7,100installs audio-design gamedev-skills A skill that treats game audio as a mixer graph: buses, gain in decibels, sidechain ducking, adaptive music and beat-synced events. Samples use Godot 4.7, Unity gets notes. Claude Code CX Codex Cursor +1 7,100installs performance-optimization gamedev-skills A skill that turns “the game runs slow” into a measured bottleneck and a specific fix: profile first, then pool objects, batch draw calls, cut allocations. Claude Code CX Codex Cursor +1 7,100installs game-ai gamedev-skills Designs NPC decision-making, behavior trees, steering forces, and A* pathfinding. Useful when building game enemy logic across engines. Claude Code CX Codex Cursor +1 7,100installs input-systems gamedev-skills Engine-neutral input system: map keys to named actions, rebinding with conflict detection, keyboard, gamepad and touch support, analog deadzones, input buffering and coyote time. Claude Code CX Codex Cursor +1 6,800installs

Similar

Questions about unity-build-pipeline

How to install unity-build-pipeline in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-build-pipeline -a claude-code.

What does unity-build-pipeline do?

It guides build configuration for Unity 6.3 LTS, covering Mono versus IL2CPP backends, code stripping rules, Addressables, and scripted CI execution.

Why does an IL2CPP build fail on a fresh machine?

IL2CPP requires the native C++ toolchain for your target platform, such as Windows build tools or Android NDK, which must be present on the host system.

Source text

SKILL.md · Apache-2.0
---
name: unity-build-pipeline
description: >
  Build and ship Unity 6.3 LTS players: build settings and scenes, player/quality settings, the
  IL2CPP vs Mono scripting backend, managed code stripping, scripted BuildPipeline.BuildPlayer,
  and CI/headless builds. Use when configuring or automating a build, choosing a scripting
  backend, shrinking build size, or when the user mentions Unity build, player settings,
  IL2CPP, code stripping, or Addressables.
---

# Unity Build Pipeline

Configure, script, and automate Unity 6.3 LTS player builds: scenes, platform target, scripting
backend, stripping, and headless/CI builds. Targets **Unity 6.3 LTS (6000.3)**.

## When to use

- Use when setting up Build Settings/Profiles, choosing a platform and scripting backend
  (Mono vs IL2CPP), reducing build size with managed stripping, scripting a repeatable build
  with `BuildPipeline.BuildPlayer`, or wiring a CI/headless build.
- Use when the project has `ProjectSettings/EditorBuildSettings.asset` or a CI build script.

**When *not* to use:** authoring a CI service config end-to-end is DevOps; this skill covers
the Unity-side build API and settings. Console/platform certification specifics are
platform-NDA territory. Storefront submission → `steam-publish` / `itch-publish`.

## Core workflow

1. **List the scenes to build** (File → Build Profiles → Scene List, or
   `EditorBuildSettings.scenes`). Only listed, enabled scenes ship; scene 0 is the start scene.
   A Build Profile asset can carry its own Scene List (Add Settings → Scene List); when it
   does, that profile builds its list, not the global one.
2. **Pick the platform target** and switch the active build target if needed
   (`BuildTarget` / `EditorUserBuildSettings`). In batch mode, pass `-buildTarget <name>` on
   the command line instead: `SwitchActiveBuildTarget` is not available there.
3. **Choose the scripting backend** (Player Settings): **Mono** (fast iteration, desktop) vs
   **IL2CPP** (AOT C++; required for many platforms, better perf, harder to reverse). IL2CPP
   needs the platform's C++ toolchain installed. (Forward note: Unity is developing a
   **CoreCLR** backend as a modern .NET runtime successor to Mono, but in the Unity 6.7 beta
   it is still *experimental*, desktop-only, and documented as not suitable for production —
   so for 6.3 LTS the choice stays Mono vs IL2CPP.)
4. **Tune size/perf:** set Managed Stripping Level (Disabled → Minimal → Low → Medium → High)
   and protect reflection-only code with a `link.xml`. Set Quality Settings per platform.
5. **Script the build** with `BuildPipeline.BuildPlayer(BuildPlayerOptions)` and **inspect the
   returned `BuildReport`** — a non-`Succeeded` result must fail your pipeline.
6. **Run headless** for CI with `-batchmode -quit -executeMethod`, and check the exit code.
7. **Verify** the actual output runs (launch the player), not just that the build returned
   without throwing.

## Patterns

### 1. Scripted build with a result check

```csharp
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;

public static class BuildScript
{
    [MenuItem("Build/Windows x64")]
    public static void BuildWindows()
    {
        var options = new BuildPlayerOptions
        {
            scenes = new[] { "Assets/Scenes/Main.unity", "Assets/Scenes/Level1.unity" },
            locationPathName = "Builds/Windows/Game.exe",
            target = BuildTarget.StandaloneWindows64,
            options = BuildOptions.None,            // add BuildOptions.Development for a dev build
        };

        BuildReport report = BuildPipeline.BuildPlayer(options);
        BuildSummary summary = report.summary;

        if (summary.result != BuildResult.Succeeded)
            throw new System.Exception($"Build failed: {summary.totalErrors} errors");
        Debug.Log($"Build OK: {summary.totalSize} bytes in {summary.totalTime}");
    }
}
```

### 2. Headless / CI invocation

```bash
# Exit code is 0 on success; -quit ensures the editor closes; -nographics for build servers.
# -buildTarget makes the Editor start on that platform, so scripts compile with its defines.
Unity -batchmode -quit -nographics \
  -projectPath "/path/to/Project" \
  -buildTarget win64 \
  -executeMethod BuildScript.BuildWindows \
  -logFile -
```

### 3. Build a saved Build Profile

```csharp
using UnityEditor;
using UnityEditor.Build.Profile;
using UnityEditor.Build.Reporting;

public static class ProfileBuild
{
    [MenuItem("Build/Windows Release Profile")]
    public static void Build()
    {
        var profile = AssetDatabase.LoadAssetAtPath<BuildProfile>(
            "Assets/Settings/Build Profiles/WindowsRelease.asset");
        var options = new BuildPlayerWithProfileOptions
        {
            buildProfile = profile,                 // platform, scene list, defines from the asset
            locationPathName = "Builds/Windows/Game.exe",
            options = BuildOptions.None,
        };
        BuildReport report = BuildPipeline.BuildPlayer(options);
        if (report.summary.result != BuildResult.Succeeded)
            throw new System.Exception($"Build failed: {report.summary.totalErrors} errors");
    }
}
```

### 4. Protect stripped code with `link.xml`

```xml
<!-- Assets/link.xml — keep types the linker can't see are used (reflection, JSON, plugins). -->
<linker>
  <assembly fullname="MyGameRuntime" preserve="all"/>
</linker>
```

## Pitfalls

- **A scene loads in the Editor but is missing in the build** — it isn't in the scene list
  (File → Build Profiles → Scene List, or the built profile's own list) or is disabled.
  `SceneManager.LoadScene` only sees listed scenes.
- **IL2CPP build fails on a fresh machine** — the platform C++ toolchain (e.g. Windows build
  tools, Android NDK) isn't installed. Mono has no such requirement.
- **`MissingMethodException`/`TypeLoadException` only in the build** — managed stripping removed
  reflection-only code. Lower the stripping level or add a `link.xml` preserve entry.
- **Treating "BuildPlayer returned" as success** — always check `BuildReport.summary.result`;
  it can return with errors.
- **Addressables content is stale/missing** — Addressables (`com.unity.addressables`) content
  is built by Build → Addressables or by `AddressableAssetSettings.BuildPlayerContent`. The
  **Build Addressables on Player Build** setting can do it during a player build, but when it
  is left at "Use global Settings" the result depends on each machine's Preferences — call the
  content build explicitly in CI, and check the profile's load path.
- **The build platform's code didn't compile in** — a scripted `BuildPlayer` for a target
  other than the active one keeps the active platform's `UNITY_*` defines, and define changes
  only apply after a domain reload. Switch platform first (in the Editor) or launch with
  `-buildTarget` (batch mode).
- **Build ignores scenes you added to the global list** — the Build Profile you build has its
  own Scene List. Edit that list; a profile without a Scene List uses the global one.
- **Shipping a Development build** — `BuildOptions.Development` enables the profiler/debugging
  and is slower; use `BuildOptions.None` for release.

## References

- For a complete **multi-platform CI build script** (`-buildTarget` per platform, version
  stamping, argument parsing, exit codes), building a Build Profile from the command line, and
  an Addressables content-build call, read `references/ci-build-script.md`.
- Primary docs: `ScriptReference/BuildPipeline.BuildPlayer`, `ScriptReference/BuildPlayerWithProfileOptions`,
  the Manual pages "Editor command line arguments" and "Manage scenes in a build", and Unity
  Manual build sections (player settings, managed code stripping). For the forward-looking
  CoreCLR backend, see the experimental note at
  `https://docs.unity3d.com/6000.7/Documentation/Manual/scripting-backends-coreclr.html`.

## Related skills

- `steam-publish` / `itch-publish` — distributing the player you just built.
- `unity-csharp-scripting` — editor scripting conventions used by build scripts.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor