line-ending-normalizer

Normalize line endings for cross-platform file handling with CRLF/LF conversion and git configuration.

509 stars

Best use case

line-ending-normalizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Normalize line endings for cross-platform file handling with CRLF/LF conversion and git configuration.

Teams using line-ending-normalizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/line-ending-normalizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/cli-mcp-development/skills/line-ending-normalizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/line-ending-normalizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How line-ending-normalizer Compares

Feature / Agentline-ending-normalizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Normalize line endings for cross-platform file handling with CRLF/LF conversion and git configuration.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Line Ending Normalizer

Normalize line endings for cross-platform compatibility.

## Capabilities

- Detect line ending style
- Convert between CRLF and LF
- Configure git line ending settings
- Handle mixed line endings
- Set up .gitattributes

## Generated Patterns

```typescript
export type LineEnding = 'lf' | 'crlf' | 'mixed';

export function detectLineEnding(content: string): LineEnding {
  const crlf = (content.match(/\r\n/g) || []).length;
  const lf = (content.match(/(?<!\r)\n/g) || []).length;
  if (crlf > 0 && lf > 0) return 'mixed';
  if (crlf > 0) return 'crlf';
  return 'lf';
}

export function normalizeLineEndings(content: string, target: 'lf' | 'crlf' = 'lf'): string {
  const normalized = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
  return target === 'crlf' ? normalized.replace(/\n/g, '\r\n') : normalized;
}

// .gitattributes content
export const gitattributes = `
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
`;
```

## Target Processes

- cross-platform-cli-compatibility
- configuration-management-system
- shell-script-development