Skip to content
Back to skills

Cs2 Modding Ui

ASecurity

The Cities: Skylines II mod UI discipline: the C#-to-JavaScript binding layer and the game''s React frontend. Use when a mod needs a panel, button or overlay in the game''s UI, when exposing C# state to the frontend or invoking C# from it, when injecting into the game''s own component tree, when a UI mod''s bundle does not load or its styles do not apply, or when checking what the game''s frontend already provides.

  • 10 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added August 31, 2026
ai-agentsjavascripttypescriptgojavac#reactdebuggingfrontend

Security analysis

A100/100

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

Scanned November 14, 2026

npx -y skills add CitiesSkylinesModding/agents-plugins --skill cs2-modding-ui --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cs2 Modding Ui?

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

Security grade badge for Cs2 Modding Ui
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/citiesskylinesmodding-cs2-modding-ui/badge)](https://www.skillsdirectory.com/skills/citiesskylinesmodding-cs2-modding-ui)

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: cs2-modding-ui
description: 'The Cities: Skylines II mod UI discipline: the C#-to-JavaScript binding layer and the game''s React frontend. Use when a mod needs a panel, button or overlay in the game''s UI, when exposing C# state to the frontend or invoking C# from it, when injecting into the game''s own component tree, when a UI mod''s bundle does not load or its styles do not apply, or when checking what the game''s frontend already provides.'
---

# Modding the Cities: Skylines II UI

The game's interface is a web page: React components rendered by Coherent Gameface, shipped on disk as one JavaScript bundle beside one stylesheet.
A UI mod is a second ES module the page loads and hands the module registry, through which it overrides, extends or appends to the game's own components.
Its C# half publishes state and receives calls over the binding layer, where every binding is a `group.name` path.

Work by the `cs2-modding` skill's working loop: find how the game's own UI does the thing, in the bundle, before writing.
A trap you meet here that this skill misses goes through that skill's trap reports.

## Which source answers what

- The installed bundle, `Cities2_Data/Content/Game/UI/index.js` with `index.css` beside it, answers for the whole frontend: the module registry and its paths, the component tree, the formatters, the wire format a binding arrives in.
  It ships minified to one line, so read the reformatted copy the setup record names; where `UI bundle copy` is absent or `(none)`, route the user to `cs2-modding-setup`.
- The decompile answers only for the C# half: the binding types in `Colossal.UI.Binding`, and the `Game.UI.*` systems that register the game's own bindings.
  A C# grep that finds nothing about a module, an export or a class name settles nothing.
- The official UI scaffold under the install's `.ModdingToolchain` answers for the modules a UI mod may import and for the game's TypeScript declarations.

The sibling `coherent-gameface` plugin tells whether a CSS or JS feature exists in the game's Cohtml version, and drives the live UI over the debugging port `cs2-modding-setup`'s launch options open.
It is optional; everything here works without it.

## Traps

- A throw in a mod's registrar skips every registrar after it, other mods' included, and after a UI reload leaves the whole UI unrendered: wrap the registrar's body in `try`/`catch`. [symbol: none]
- `getModule` throws on an export it cannot resolve, and a throw at a module's top level drops that mod's whole UI with nothing logged: call it inside a `try`. [symbol: none]
- A value the scaffold's `cs2/*` typings declare with a single `export` compiles and is `undefined` at runtime: import only the values they declare `export export` or name in an `export { … }` list, by its alias there and through the namespace wrapping the list. [symbol: none]
- A C# answer to a frontend request comes back on the promise of `call`, from a `CallBinding` with a result type, rather than through a trigger and a separate value binding. [symbol: Colossal.UI.Binding.CallBinding]
- A `CallBinding` result skips the binding writers, so an `Entity` arrives as `{Index, Version}`: return a primitive, or a type whose public members are named as the frontend reads them. [symbol: Colossal.UI.Binding.RawCallBindingBase]
- A `GetterValueBinding` added with `AddBinding` keeps its first value until you call its `Update()`: add it with `AddUpdateBinding`, and call `base.OnUpdate()` in any `UISystemBase.OnUpdate` override. [symbol: Game.UI.UISystemBase]
- Every UI mod's images share the one `coui://ui-mods/` host, so another mod's image at the same path can show in place of yours: give image files names unique to the mod. [symbol: Colossal.UI.DefaultResourceHandler] [symbol: Game.Modding.ModManager]
- A literal `font-size` ignores the player's text-scale setting: use the game's `--fontSize*` tokens, or `calc(<n>rem * var(--fontScale))`. [symbol: none]

## Building and iterating

[The UI build and the dev loop](references/ui-build-and-devloop.md) covers what the build produces and where it lands, the externals that keep the game's modules out of the bundle, refreshing type declarations after a game update, and iterating against a running game.
Creating the UI project and hooking its build into the mod's `dotnet build` is `cs2-mod-project`'s.

Files in this skill

  • SKILL.md5.1 KB
  • references/binding-layer/binding-layer.md42.3 KB
  • references/frontend-and-injection/frontend-and-injection.md45.8 KB
  • references/frontend-and-injection/promised-registry-paths.md5.1 KB
  • references/ui-build-and-devloop/ui-build-and-devloop.md26.4 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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.