# Whitespace

> Fix trailing whitespace and ensure files end with newlines. Use this skill when preparing code for commit or when whitespace issues are detected. Use when this capability is needed.

- Skill: `tomevault-io/whitespace` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/whitespace`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/whitespace/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/whitespace

---


# Whitespace

Fix whitespace issues in source code: trailing whitespace and missing final newlines.

## Actions

### Check for issues (dry-run)
```bash
<skills>/whitespace/scripts/whitespace-check.sh [directory] [extensions]
```

### Fix issues
```bash
<skills>/whitespace/scripts/whitespace-fix.sh [directory] [extensions]
```

Default extensions: `jl,py,js,ts,tsx,rs,go,md,json,yaml,yml,toml,sh`

Default directory: current working directory (`.`)

## What Gets Fixed

1. **Trailing whitespace** - spaces/tabs at end of lines
2. **Final newline** - ensures files end with exactly one newline

## Notes

- Scripts require GNU sed (Linux default, install via `brew install gnu-sed` on macOS)
- Binary files and `.git` directory are excluded
- Always review changes with `git diff` after running

---
> Source: [krastanov/juliallmagentskills](https://github.com/krastanov/juliallmagentskills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-29 -->

