UTH UTF-8 Guard
Purpose
Use this skill as a document-encoding guard for UTH governance docs. It prevents Chinese Markdown and governance text from being written back with broken encoding or obvious mojibake.
Trigger
Use before and after modifying:
AGENTS.md- root
README.md docs/**/*.md- task-package Markdown under
docs/work/ - governed templates or manuals
skills/**/*.mdonly when the user explicitly invokedskill-creatorskills/uth-sp-*/**/*.mdonly during explicit UTH-SP maintenance
Do not use for normal code files, generated files, binary files, lock files, build outputs, or unrelated text unless the user asks.
Guard Protocol
Before writing:
- If the file exists, read it as bytes and confirm it decodes as UTF-8.
- Note whether the file already has unusual encoding, replacement characters, or mojibake markers.
- Do not normalize unrelated line endings or rewrite unrelated content.
After writing:
- Read the file as UTF-8.
- Check for Unicode replacement characters.
- Check common mojibake markers using the bundled script list.
- For Markdown, check that fenced code blocks are balanced.
- If any check fails, block closeout and repair the document before continuing.
Script
Use the bundled checker when possible:
python .\skills\uth-utf8-guard\scripts\check_utf8_docs.py <path> [<path> ...]
It validates UTF-8 decoding, scans for mojibake markers, and checks Markdown fence parity.
Closeout
If .uth-governance/project.json contains document_language, render the closeout report in that language. For zh-CN, use Chinese headings and Chinese prose; preserve literal paths, commands, skill names, schema values, and code identifiers.
When this guard is used, include:
UTF-8 guard:
- files checked:
- result:
- repaired encoding issues:
If the guard was required but not run, do not claim documentation closeout is complete.
Source: undertaker33/uth-governance — distributed by TomeVault.