PatchProof
FreeNo executable scriptsNot checkedFind the 9-slice (nine-patch) borders of game UI panel images and prove each detection by re-rendering. Use when asked to work out 9-slice borders for a UI…
by raktikoo145 installs in other catalogsAbout this skill
patchproof
What this tool does
patchproof finds the 9-slice borders (left, right, top, bottom) of game UI panel PNGs — a single file or a whole folder of panels in one run. Every detection is proved by resynthesis: the panel is re-rendered 9-sliced at several sizes, odd sizes included, and its corners must come out pixel-identical, with a distortion score under the threshold. A panel that cannot be proved is reported UNCERTAIN with a reason, never given made-up border numbers. For every proven panel it also writes the engine files: a Unity .meta sidecar with spriteBorder, a Godot .tres StyleBoxTexture, and an Android .9.png.
Install
pip install git+https://github.com/RakTikoo/patchproof
This provides the patchproof command.
Run
Scan a folder of panels (a single PNG file also works), writing exports and a report to the output folder:
patchproof scan examples --out out
A folder is scanned non-recursively for PNG files. --threshold 6.0 is the default strictness: how clean a slice must be to earn PROVEN. Lower it for a stricter pass on borderline kits.
Reading the results
The table lists each file with its verdict, the four borders (L, R, T, B) and its distortion score, and ends with a count line such as 6 proven, 1 uncertain -- report: out/report.json. Read verdicts per panel:
PROVEN— the borders were verified by re-rendering; the panel PNG, its.meta,.tresand.9.pngexports are in the output folder.UNCERTAIN— no borders are reported (dashes in the table,nullin the report) and no exports are written. The stated reason says why, for example a distortion score above the threshold on a photo-like centre. Treat UNCERTAIN as "a human should set this one by hand", not as a failure of the run.
report.json carries the same facts per panel: borders, padding (transparent content margins, reported separately from the borders), verdict, score, sizes_checked, corners_identical, and reason where one applies. Exit code 0 means the scan completed — it does not mean every panel was proven, so read the per-panel verdicts. Exit code 2 means the run stopped with a clean one-line error (not a PNG file, a folder with no PNGs, or a path that does not exist).
Limits
- Centres must be flat, smoothly gradient, or stationary grain (parchment-style texture can be proven under a statistical criterion; its grain rescales when stretched, as with any stretch). Repeating patterns (checker, brick, diamond fills) and directional grain such as wood still abstain as UNCERTAIN — stretching would change the pattern's period. Centres that should be tiled rather than stretched are not modelled.
- One panel per image: sprite sheets or atlases holding several panels in one PNG are not segmented.
- Detection on ornate panels is a judgement call: the score measures how clean the slice is, not taste. Borderline kits should use a stricter
--thresholdand a human look at the UNCERTAIN pile. - Exports are written from the detection and round-trip tested, but they are not validated inside Unity or Godot; the first real engine import is still worth a look.
- Panels are processed in memory as full images; a folder of 8K textures will be slow. PNG only.
Install PatchProof in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the PatchProof skill do?
Find the 9-slice (nine-patch) borders of game UI panel images and prove each detection by re-rendering. Use when asked to work out 9-slice borders for a UI kit, set Unity spriteBorder values, Godot StyleBoxTexture patch margins, or Android .9.png markers for panel PNGs — for example "find the 9-slice borders for these panels", "set up nine-patch for my UI kit", or "which of these panels can be sliced cleanly". Not for making textures tile seamlessly (that is seamproof) or recovering the grid of damaged pixel art (that is snapgrid). Scans a whole folder at once and writes Unity .meta, Godot .tres and Android .9.png files for every proven panel.
How do I install the PatchProof skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the PatchProof skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
by Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
by Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
by Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
by Anthropic