qclaw-text-file for Openclaw

A high-priority text-writing skill that replaces standard write tools to ensure perfect cross-platform encoding and newline compatibility.

sky-lv
v1.0.0
May 10, 2026
0
920
31

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install qclaw-text-file

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install qclaw-text-file using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is qclaw-text-file?

qclaw-text-file is a specialized technical skill designed for Openclaw Skills to handle the complexities of cross-platform text writing. It serves as a mandatory interceptor for all text file creation tasks, solving the common issues of garbled characters (mojibake) and incompatible line endings between Windows, macOS, and Linux.

By automating the detection of proper encodings like UTF-8 with or without BOM, GBK, and UTF-16, this skill ensures that generated files—such as CSVs, batch scripts, and configuration files—open correctly in their target environment. It is the definitive solution for developers needing reliable file exports and automated system configuration across different operating systems.

qclaw-text-file Use Cases

  • Creating CSV or TSV files that must open correctly in Windows Excel without character corruption.
  • Generating Windows batch (.bat) or PowerShell (.ps1) scripts from a macOS/Linux environment.
  • Managing configuration files (JSON, YAML, TOML) that require strict UTF-8 formatting without BOM.
  • Appending log data to existing files while preserving the original encoding and newline styles.
  • Automating the creation of specialized system files like Windows Registry (.reg) or driver information (.inf) files.

How qclaw-text-file Works

  1. Platform Detection: The agent first executes a detection script to identify the current operating system and determine default encoding behaviors.
  2. Temporary Staging: The agent writes the raw content to a temporary file using standard tools to avoid shell escape character issues.
  3. Skill Interception: The write_file.py script is called, using the detected platform or user-specified target platform to apply encoding and newline rules.
  4. Encoding Application: The script automatically applies the correct logic (e.g., adding BOM for Windows CSVs or converting to GBK for Chinese-character batch files).
  5. Final Writing & Cleanup: The processed content is written to the final destination path, and the temporary staging file is securely deleted.

qclaw-text-file Setup

This skill requires Python 3.6+ and has no external dependencies beyond the Python standard library. To begin using it within the Openclaw Skills framework, ensure the script is accessible in your environment:

# Check platform defaults before first use
python3 "{SKILL_DIR}/scripts/write_file.py" --detect

qclaw-text-file Data Schema & Taxonomy

The skill manages file generation based on a strict taxonomy of file extensions and target platforms. Below is the encoding logic applied for Openclaw Skills:

File Type macOS / Linux Encoding Windows Target Encoding
.csv / .tsv utf-8 (No BOM) utf-8-sig (With BOM)
.bat / .cmd utf-8 gbk (if Chinese present)
.reg utf-16 (With BOM) utf-16 (With BOM)
.json / .yaml utf-8 (No BOM) utf-8 (No BOM)
.sh / .bash utf-8 (LF) utf-8 (LF)

It supports outputting status updates in a standard JSON format, providing details on bytes_written, encoding, and newline style used.

qclaw-text-file Advanced Features

  • Platform Target Overriding: Use the --platform flag to generate Windows-compatible files even while running on macOS.
  • Style Preservation: The --preserve flag allows the skill to match the existing BOM and newline style of a file being updated.
  • Atomic Append Mode: Safely append new content to the end of existing text files without overwriting data.
  • Automatic Directory Creation: Automatically creates parent directories for the target path unless explicitly disabled with --no-mkdir.
  • Binary Safety Guard: Built-in logic prevents the skill from accidentally processing binary files like images or zips.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*