File Naming Normalization
Normalizes asset filenames by splitting on common separators, stripping asset IDs and optional user strings from each segment, then joining with underscores (snakecase). Use when normalizing asset filenames, batch-renaming SFX/UI textures, file naming normalization, asset naming convention, slug normalization, or snakecase asset names.
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use File Naming Normalization when an AI agent needs a reusable SKILL.md workflow for this job: Normalizes asset filenames by splitting on common separators, stripping asset IDs and optional user strings from each segment, then joining with underscores (snakecase). Use when normalizing asset filenames, batch-renaming SFX/UI textures, file naming normalization, asset naming convention, slug normalization, or snakecase asset names.
When not to use it
Skip File Naming Normalization when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/file-naming-normalization # Save SKILL.md to ~/.claude/skills/file-naming-normalization/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/file-naming-normalization/SKILL.md. For a shared project, commit the folder at .claude/skills/file-naming-normalization/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the File Naming Normalization skill for this task: Split the filename stem (extension is preserved) on common separators: , -, ., whitespace. Confirm any required inputs or files before making changes.
What supports this recommendation?
83/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 92/100
- Practical detail
- 92/100
- Source evidence
- 61/100
- Source signals
- 72/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# File Naming Normalization
Normalize asset filenames: split → clean each segment → join with `_` (snake_case).
## Rules
When this skill applies, read and follow [skill-dependency-manager](../skill-dependency-manager.md) — run scripts as documented, install missing tools into `.dependency/`.
## Quick Start
Default: split on `_`, `-`, `.`, and spaces; strip leading/trailing digits from each segment; join with `_`:
```bash .dependency/python/python .ai/file-naming-normalization/normalize.py path/to/file_or_folder ```
Preview without renaming:
```bash .dependency/python/python .ai/file-naming-normalization/normalize.py Audio/SFX --dry-run ```
## Workflow
1. **Split** the filename stem (extension is preserved) on common separators: `_`, `-`, `.`, whitespace. 2. **Clean** each segment: - Drop pure-digit segments with 4+ digits (asset IDs like `38126`) - Keep short pure-digit segments as variant indices (`1`, `2`, `01`) - Remove leading digits from mixed segments (`001Hero` → `Hero`) - Remove trailing digits from mixed segments (`Attack02` → `Attack`, `foisal72` → `foisal`) - Remove user-given strings (see `--strip`) 3. **Drop** empty segments after cleaning. 4. **Join** remaining segments with `_`. 5. **Rename** in place (or write to `--output-dir`).
## Examples
| Input | Output | |-------|--------| | `001_Hero_Attack_02.wav` | `001_Hero_Attack_02.wav` (already snake_case) | | `001-Hero-Attack-02.wav` | `001_Hero_Attack_02.wav` | | `sfx-button-click.mp3` | `sfx_button_click.mp3` | | `UI 12 Panel Open.png` | `UI_12_Panel_Open.png` | | `freesound_community-shoot-1-81135.wav` | `freesound_community_shoot_1.wav` | | `SFX_001_button.wav` with `--strip SFX` | `001_button.wav` |
```bash # Strip custom strings (repeatable) .dependency/python/python .ai/file-naming-normalization/normalize.py Assets --strip SFX --strip UI
# Recursive folder .dependency/python/python .ai/file-naming-normalization/normalize.py Assets -r
# Copy normalized files to another folder (originals unchanged) .dependency/python/python .ai/file-naming-normalization/normalize.py Assets -o normalized/ -r ```
## Output
`--dry-run` preview (unchanged files such as `001_Hero_Attack_02.wav` are omitted):
``` Assets/001-Hero-Attack-02.wav -> Assets/001_Hero_Attack_02.wav Assets/freesound_community-shoot-1-81135.wav -> Assets/freesound_community_shoot_1.wav Assets/sfx-button-click.mp3 -> Assets/sfx_button_click.mp3 Assets/UI 12 Panel Open.png -> Assets/UI_12_Panel_Open.png
Dry run: 4 file(s) would be renamed. ```
In-place rename:
``` Assets/001-Hero-Attack-02.wav -> Assets/001_Hero_Attack_02.wav
Renamed 1 file(s). ```
Nothing to change:
``` All filenames already normalized. ```
With `--strip SFX`:
``` Assets/SFX_001_button.wav -> Assets/001_button.wav
Renamed 1 file(s). ```
Copy to `--output-dir` (originals kept):
``` Assets/SFX_001_button.wav -> normalized/001_button.wav
Renamed 1 file(s). ```
Name collision (exit code 1):
``` Name collision: 'Assets/Hero-Attack.wav' and 'Assets/Hero.Attack.wav' both map to 'Assets/Hero_Attack.wav' ```
## Common Flags
`-r` / `--recursive` · `--strip TEXT` (repeatable) · `--strip-case-insensitive` · `-o` / `--output-dir` · `--dry-run` · `--overwrite`
## Agent Notes
1. Use the bundled script; do not hand-write rename loops unless the script cannot cover the case. 2. Always run `--dry-run` first when normalizing many files; show the user the preview. 3. `--strip` removes the given substring anywhere inside each segment (not only at edges). Pass one `--strip` per string. 4. Segments that become empty after cleaning are dropped (`81135` alone → skipped). 5. Collisions (two files mapping to the same name) abort with an error — resolve manually or normalize in smaller batches. 6. Only renames files; does not rename directories.
## CLI
Copy-paste commands: [cli/file-naming-normalization.md](../../../cli/file-naming-normalization.md)
Intended uses
- Split the filename stem (extension is preserved) on common separators: , -, ., whitespace.
- Clean each segment:
- Drop pure-digit segments with 4+ digits (asset IDs like 38126)
- Keep short pure-digit segments as variant indices (1, 2, 01)
- Remove leading digits from mixed segments (001Hero → Hero)
- Remove trailing digits from mixed segments (Attack02 → Attack, foisal72 → foisal)
- Remove user-given strings (see --strip)
- Drop empty segments after cleaning.
- Join remaining segments with .
- Rename in place (or write to --output-dir).
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.