unbanished: Skill for Claude Code

.agents/skills/banished-shader/SKILL.md

banished-shader is a skill for Claude Code, Codex from tanepiper/unbanished. It costs 74 tokens per session (730 once invoked), scanned A, original, Apache-2.0.

A guide for translating Banished's compiled Direct3D 9 graphics programs into WGSL, the shader language used by the wgpu renderer. It covers the small programs that calculate how materials such as water, terrain, and particles are drawn.

In plain words
What is it for?
Use it when adding or fixing a Banished material, such as terrain, sky, foliage, snow, rain, models, or user-interface graphics.
Why use it?
It removes the guesswork from matching the original game's graphics while supporting WebGL2, a browser graphics standard. It also explains how to identify the correct original program and preserve its calculations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is tanepiper/unbanished's own configuration. It tells Claude Code and Codex how to work on unbanished itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unbanished configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 tools/shader/d3d9_disasm.py game-data/extracted/<path>/X_vs.crs # list variants.

Reuse

Borrowing it

Nothing to install: this file belongs to tanepiper/unbanished. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tanepiper/unbanished/main/.agents/skills/banished-shader/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/tanepiper/unbanished

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for banished-shader

README.md
[![agentmods](https://agentmods.dev/badge/skills/tanepiper/unbanished/banished-shader/github.svg)](https://agentmods.dev/skills/tanepiper/unbanished/banished-shader)
Your own site
<a href="https://agentmods.dev/skills/tanepiper/unbanished/banished-shader"><img src="https://agentmods.dev/badge/skills/tanepiper/unbanished/banished-shader/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for banished-shader

Your own site · 80×15
<a href="https://agentmods.dev/skills/tanepiper/unbanished/banished-shader"><img src="https://agentmods.dev/badge/skills/tanepiper/unbanished/banished-shader.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 730 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.00730
Opus 5.5 $0.00030 $0.00292
Sonnet 5.5 $0.00015 $0.00146
Haiku 4.5 $0.00007 $0.00073

Measured 3d ago against content hash ed860dc4cb90, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

banished-shader scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/banished-shader/SKILL.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Port a shader to WGSL

1. Find and disassemble

Materials reference programs by resource path (decode the MaterialInstance/material with banished-format tools to find them). Disassemble the shipped D3D9 bytecode:

python3 tools/shader/d3d9_disasm.py game-data/extracted/<path>/X_vs.crs        # list variants
python3 tools/shader/d3d9_disasm.py game-data/extracted/<path>/X_ps.crs 0 > analysis/X_ps0.txt

Each resource holds several D3D9 variants then DXBC blobs; the CTAB lists constant names and registers — that tells you what each c# is (view_proj, light_dir, fog…). Pick the variant the game uses (usually 0; confirm via the material's program index). Keep dumps in analysis/.

2. Translate

  • Translate instruction by instruction first, then simplify only where provably identical. Keep the original constants verbatim (e.g. 0.00390625, -0.666666687).
  • D3D9 → wgpu differences:
    • clip-space depth is 0..1 in both; but matrices are row-vector in D3D9 (m4x4 = dot rows) — check transpose against the CPU side;
    • texkill → discard;
    • sincos, lrp(a,b,c) = mix(c, b, a); sge/slt → select/step;
    • saturate modifiers _sat → clamp(x, 0.0, 1.0).
  • World space is the terrain's: x/y in cells (map-centred), z up = saved height / 256.
  • Prepend the shared GLOBALS_WGSL (scene_gfx.rs) instead of redeclaring Globals; call reflect_clip(world_z) for the planar reflection pass.

3. WGSL / WebGL2 rules (learned the hard way)

  • textureSample needs uniform control flow: do every sample before any discard (put reflect_clip() / alpha-test discards at the end).
  • WebGL2 has no base-vertex draws, limited storage buffers in vertex stages, and needs downlevel_webgl2_defaults limits — use vertex/index buffers and uniforms.
  • Render targets use SCENE_FORMAT (Rgba8Unorm) and DEPTH_FORMAT from scene_gfx.rs.
  • To preserve destination alpha (e.g. decals over terrain) use an alpha blend of Zero/One.

Read the full file on GitHub · 49 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 49 lines · 74 tokens per session scan A ed860dc4cb90

Subscribe to this mod's changes

banished-shader is a skill published in the GitHub repository tanepiper/unbanished (23 stars, last pushed 22d ago), licensed Apache-2.0. It adds 74 tokens to every session and 730 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-15.

Related

banished-shader compared with skills from other repositories

banished-shader next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
banished-shadertanepiper/unbanishedSkill2322d agoApache-2.0A74Claude Code, Codex
soundclawiamlukethedev/Claw3DSkill2.5k14d agoMITA18Claude Code, Codex
task-manageriamlukethedev/Claw3DSkill2.5k14d agoMITA56Claude Code, Codex
todoiamlukethedev/Claw3DSkill2.5k14d agoMITA12Claude Code, Codex
gamedev-shippingericrisco/rsc-harnessSkill636todayMITA99Claude Code, Codex
self-evolvetettethu/VibeGameSkill38810d agoApache-2.0A50Claude Code, Codex
artist-self-evolvetettethu/VibeGameSkill38810d agoApache-2.0A62Claude Code, Codex