# Windows-Safe Source Edits

> Prevent and repair silent file corruption, encoding errors, and broken regex escapes in Windows dev environments.

Windows-Safe Source Edits is a free AI agent skill on Agensi by synergieloc, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [synergieloc](https://www.agensi.io/creators/synergieloc)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-20
- Security: scan passed (2026-10-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/windows-safe-source-edits
- Tags: llm-ops, powershell, git-bash, encoding, regex

## About this skill

A regex that stops matching because \b became a backspace byte. Accents turned into Ã©. A script that runs on the server but finds nothing because of an invisible BOM. These bugs compile, pass type-checks, and look fine on screen.

This skill teaches your agent the five rules that prevent them on Windows (PowerShell, Git Bash, SSH to Linux).

It also ships check_text_files.py, which detects control characters, BOMs, mixed line endings, mojibake and invalid UTF-8, and can repair mojibake after taking a backup.

Includes an EXPERT.md reference (exact parameters, thresholds, failure diagnosis). Tested script: scripts/check_text_files.py.

Note: the skill's own docs and its checker contain mojibake examples on purpose, so the checker flags them.

## Requires

- Python 3
- Git

Standard library only; no third-party packages.

## Known limitations

Does not review code logic. Skips binary files like images or PDFs. Focuses on encoding and escaping integrity rather than functional debugging.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Windows-Safe Source Edits skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent errors that standard type-checks might miss?

This skill addresses 'silent corruption' where shell redirects or encoding mismatches (like PowerShell's default ANSI) alter your code's byte-structure, leading to broken regex escapes or hidden characters that cause production failures despite the code looking visually correct.

### Which development environments and AI agents are supported?

The skill is optimized for AI agents with file-editing capabilities operating within Windows environments, including PowerShell 5.1+, Git Bash, WSL, and remote SSH connections to Linux servers.

### What assets are included with my purchase?

You will receive the core logic for the 'Windows Safe Source Edits' skill, including the specialized editing rules and the byte-level validation scripts used to verify file integrity.

### Can this skill fix existing encoding issues, or does it only prevent new ones?

It detects all of them, and repairs one of them automatically. The checker flags BOMs, mixed CRLF/LF line endings, control characters, mojibake and invalid UTF-8, with the file and line. Only mojibake has an automated repair (--fix-mojibake, which writes a .bak copy first); BOMs and line endings are reported for you to fix with the documented procedure, deliberately, so nothing rewrites your files behind your back.

### Does this tool work on all file types, including images or PDFs?

The skill focuses exclusively on text-based source files and configuration scripts; it is programmed to automatically skip binary files such as images, PDFs, or compiled executables to prevent accidental corruption.

### Are there any complex dependencies required to get this running?

Setup is straightforward: once integrated into your agent's toolset, it simply requires access to the Python environment on your host to run the included validation and repair scripts.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
