Windows-Safe Source Edits

    1

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

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Windows-Safe Source Edits

    Example session with this skill installed

    I need to update the regex in my python scripts across the project. I'm on Windows using PowerShell. Make sure the backslashes don't break.

    • Read your context and instructions
    • Compiled the windows-safe source edits

    I will update the regex patterns in your Python files. To prevent PowerShell from corrupting the backslashes or adding a UTF-8 BOM, I will use the internal editor tool for direct string replacement rather than a shell script. I will also run the byte-level validation script to confirm no control characters were introduced.

    File Integrity Audit

    FileStatusLine EndingsBOMIssues Found
    src/parser.pyVerifiedLFNoneNone
    src/utils/regex_helper.pyFixedLFNoneFound and removed 0x08 (Backspace)
    tests/test_parser.pyVerifiedLFNoneNone
    
    # Updated regex in src/parser.py
    # The replacement was performed using direct string injection to preserve backslashes.
    import re
    
    def parse_logs(line):
        # Safe edit: ensured \b remains two characters and not a backspace byte
        pattern = re.compile(r'\b(ERROR|WARN)\b')
        return pattern.findall(line)
    

    Next steps

    1. Run python scripts/check_text_files.py src/ to perform a final byte-level sweep.
    2. Execute one unit test that specifically exercises the \b boundary logic.
    3. If deploying to Linux, use scp to move the files instead of piping via ssh stdin.

    Connects securely to your tools. The creator never sees your data.

    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.

    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

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    • Free with an Agensi account

    Requires

    Python 3
    Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    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.

    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.

    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.

    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.

    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.

    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.

    New in LLM Ops