llm-safe-writelisted
Install: claude install-skill ThinkDonk/llm-safe-write
## When to use me
Use this skill when:
- You need to write a file that is **longer than 50 lines**
- The file contains **CJK characters** (Chinese, Japanese, Korean) or special escape sequences
- A previous **Write tool call failed** with `Unterminated string` or JSON truncation errors
- You are about to write a Python/JS/TS file with more than a few functions
- You need to embed **CJK strings** in source code
Do NOT use this skill when:
- The file is short (< 50 lines) and ASCII-only — just use Write directly
- You are making small edits to an existing file — just use Edit directly
## Prerequisites: Understanding Write Tool JSON Truncation
The Write tool serializes file content as a JSON string for transport. CJK characters occupy 3-4 bytes each in UTF-8. When a multi-byte character happens to cross an internal buffer boundary, the JSON string gets truncated, causing `Unterminated string` errors. ASCII-only content avoids this because each character is exactly 1 byte.
**Key facts**:
- Truncation is **probabilistic** — short files and pure ASCII rarely trigger it, but long files or CJK content trigger it frequently
- Bash tool also fails when passing multi-line Python code via PowerShell — PowerShell interprets quotes, backticks, curly braces, silently corrupting code
- You may try Write for files under 50 lines, but expect frequent failures above this threshold. For files > 50 lines or containing CJK, go directly to skeleton + Edit. The 50-line threshold is conservative