convert-crlf

Detect and convert CRLF line endings to LF in project files.

1|1|Updated Apr 15, 2012
One-click install
npx skills add https://github.com/siukaido/dotfiles --skill convert-crlf-siukaido
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-crlf
Source: https://github.com/siukaido/dotfiles/tree/main/claude/skills/crlf-to-lf-converter
Command: npx skills add https://github.com/siukaido/dotfiles --skill convert-crlf-siukaido

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Mixed line endings (CRLF vs LF) across a project cause noisy Git diffs and inconsistent file formatting. This Skill scans a directory or file for CRLF line endings and converts them to LF, keeping the codebase uniform. ## Core Features & Use Cases - CRLF Detection: Uses find and file to locate files containing Windows-style CRLF line endings, automatically excluding binary files. - Dry-Run Reporting: Generates a detection report listing affected files without modifying anything when run with --dry-run. - Batch Conversion: Converts detected files to LF with sed, verifies each result with file, and outputs a conversion summary. - Use Case: After receiving Markdown docs edited on Windows, run the Skill on the docs folder to detect all CRLF files and normalize them to LF before committing. ## Quick Start Ask the AI to detect all CRLF files in your project docs directory and convert them to LF line endings.

Frequently Asked Questions about convert-crlf

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

FAQPage Schema
How do I convert CRLF to LF line endings in files?

Run the conversion on a target directory or file; it detects CRLF files with the file command and rewrites them using sed -i 's/\r$//'. Each converted file is verified afterward to confirm no CRLF remains.

How can I check for CRLF files without modifying them?

Use the --dry-run option to scan the target path and generate a detection report listing all CRLF files. No files are changed in this mode, and the report includes a recommended conversion command.

Does CRLF conversion affect binary files like images?

No. Detection relies on the file command's CRLF marker, which binary files such as images and PDFs do not produce, so they are automatically excluded from conversion.

Why does Git show every line changed after converting line endings?

Without a .gitattributes rule, Git treats the line-ending change as a full-file modification. Adding '* text=auto eol=lf' to .gitattributes before converting prevents noisy diffs.

Can I undo the CRLF to LF conversion?

The conversion creates no backups, so changes are only reversible through Git version control. Back up important uncommitted files before running the conversion.