qclaw-text-file

Generate plain text files with platform-specific encoding, BOM, and newline rules.

Updated May 4, 2026
One-click install
npx skills add https://github.com/234194027-cpu/xianclaw --skill qclaw-text-file-234194027-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: qclaw-text-file
Source: https://github.com/234194027-cpu/xianclaw/tree/main/resources/openclaw/config/skills/qclaw-text-file
Command: npx skills add https://github.com/234194027-cpu/xianclaw --skill qclaw-text-file-234194027-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It prevents cross-platform text file corruption by routing all text-file writes through a controlled writer that automatically selects the correct encoding, BOM, and newline style for the target platform.

Core Features & Use Cases

  • Forced safe path for all text writes: blocks using the built-in write tool for final text targets and requires using scripts/write_file.py for compliance and consistency.
  • Automatic encoding + BOM handling: chooses utf-8 vs utf-8-sig for CSV/TSV, uses utf-16 with BOM for .reg, and uses gbk for Windows .inf and for Windows .bat/.cmd when non-ASCII is present.
  • Automatic newline adaptation: generates Windows CRLF for Windows targets (Excel-friendly) and LF for macOS/Linux targets, with options to preserve existing newline/BOM when updating files.
  • Use Case: When you export data as CSV for Excel in another OS, it writes the file with the correct BOM and CRLF so Chinese characters do not appear as garbled text.

Quick Start

Tell the agent to use the qclaw-text-file skill to generate a CSV at export.csv from your provided rows, targeting Windows Excel formatting.

Frequently Asked Questions about qclaw-text-file

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a CSV file for Excel so Chinese characters don't show up as garbled text?▼

Writing CSV files for Excel requires utf-8-sig encoding with BOM and CRLF newlines on Windows to prevent garbled text. The text-file-writing script enforces these deterministic encoding and newline rules automatically.

Why does my text file have wrong line endings when created on different operating systems?▼

Wrong line endings occur when text file creation doesn't adapt to the target OS. Automatic newline normalization applies CRLF for Windows and LF for macOS/Linux, preventing cross-platform line ending corruption.

What encoding should I use to write a .reg file on Windows?▼

Writing a Windows .reg file requires utf-16 encoding with BOM. The text-file-writing script automatically selects this specific encoding to ensure the Windows registry correctly parses the file contents.

How do I safely update an existing text file without changing its original encoding and newlines?▼

To safely update an existing text file without changing its original encoding and newlines, use a text-file-writing script with options to preserve existing newline and BOM settings during the write operation.

Can I write a Windows .bat file with non-ASCII characters?▼

Yes, writing Windows .bat files with non-ASCII characters requires gbk encoding. The text-file-writing script automatically detects non-ASCII content and applies gbk encoding for Windows .bat and .cmd files.

What is the best way to automate cross-platform text file generation?▼

Automating cross-platform text file generation is best done by routing all writes through a controlled script that infers and applies deterministic encoding, BOM, and newline rules based on the detected target platform.