/SKILL.md
Analyze file contents in a directory tree and intelligently rename files based on what they contain, optionally reorganizing them into a logical folder structure. Use this skill whenever the user wants to clean up messy file names, organize downloaded files, sort documents by content, rename files that have meaningless names (like IMG_20240101.jpg or document(3).pdf), or tidy up any folder where file names don't reflect their actual content. Also triggers when users mention bulk renaming, file cleanup, content-based organization, folder restructuring, collecting files by topic or purpose (e.g., "gather resume-related files", "gather dataset files", "identify disposable files"), or filtering and grouping files by category.
npx skillsauth add surrealier/smartfileorganizer smart-file-organizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reads actual file contents to recover broken filenames, generate meaningful names from scratch, and optionally reorganize files into categorized folders — all with a safe rollback map.
Analyze file contents in a target directory (including all subdirectories), rename files to reflect their content, and optionally reorganize them into a logical folder structure.
Ask the user for:
rename-only, full-organize, or collect (default: rename-only).
collect: also ask for the collection query — what kind of files to gather (e.g., "resume-related files", "dataset files", "disposable files").Which languages should be used in file names?
Allowed: (e.g., Korean, English)
Others: auto-translate to an allowed language (e.g., Japanese → English)
IITP, YOLOv8, etc.).recovery).
How strictly should files be renamed?
[R] Recovery — only fix broken/meaningless names, keep already-descriptive names as-is
[U] Uniform — rename ALL files to a standardized format based on content
recovery: skip files whose current name already reasonably describes the content (even if format doesn't perfectly match the naming convention).uniform: treat every original name as unreliable and regenerate from scratch — current behavior.If the user provides a directory without specifying other options, use defaults and proceed.
List all files recursively in the target directory.
Skip hidden files/directories (starting with .) and common ignore patterns (node_modules, .git, __pycache__, etc.).
Skip source code files by default — renaming breaks import paths, include directives, and build systems. Excluded extensions: .py, .cpp, .c, .h, .hpp, .js, .ts, .jsx, .tsx, .java, .go, .rs, .rb, .cs, .swift, .kt, .scala, .sh, .bat, .ps1, and CI/CD config files (Jenkinsfile*, Makefile, Dockerfile, *.cmake). The user can override this with an explicit --include-code flag or request.
Skip executable/installer files — keep .exe, .msi, .appimage, .dmg files with their original names.
Detect suspected dataset directories — identify directories that may contain bulk datasets before processing. A directory is suspected if ANY of the following is true:
img_0001.jpg…img_9999.jpg, a3f8c2.png).train, val, valid, validation, test, dataset, datasets, images, labels, annotations, samples, corpus, raw, processed.*.json/*.csv annotation + 50+ image/text files).For each suspected directory, prompt the user before deciding:
⚠ The following directories are suspected to be datasets:
📁 train/ — 1,523 .jpg files, sequential naming pattern
📁 annotations/ — 1,523 .json files + manifest.csv
For each directory, choose:
[S] Skip — treat as dataset, do not rename
[I] Include — treat as normal folder, process files
Create an inventory with: current path, file size, extension, last modified date.
Scan directory names — identify directories with broken or meaningless names (garbled encoding, New Folder, Untitled, numeric-only names like 1, 2, 3). These are included in the rename map alongside files. Directory renames apply in all modes (including rename-only), and are executed after all file renames to avoid path invalidation.
EUC-KR, CP949, Shift_JIS, GB2312, and Latin-1 against the raw bytes. If a readable name is recovered, use it as the basis for renaming.Report the inventory summary to the user:
If there are more than 100 files, ask the user to confirm before proceeding or suggest narrowing the scope with filters.
Batch processing — to avoid context overflow and tool-call failures:
--auto-approve or equivalent flag so that tool calls within each batch proceed automatically._unknown/). If any files are missing from batch results, re-queue them in a supplementary batch. The final rename map MUST cover 100% of inventoried files.Behavior depends on the rename strictness setting from Step 1.
uniform mode:⚠ CRITICAL: ALL non-code files MUST be renamed to a normalized format based on their actual content. No exceptions.
- The original file name is unreliable — treat it as if it were random characters.
- You MUST read/analyze the file content first, then generate a name from scratch.
- Files with partially descriptive but non-standard names (e.g.,
073_disaster_safety_XR.hwpx,report_v2_final.docx) MUST still be renamed after reading their content.- The ONLY reason to keep an original name is if it already perfectly matches the naming convention format AND accurately describes the specific content.
Rename criteria (uniform) — a file MUST be renamed if ANY of the following is true:
073_, IMG_, DSC_, 001_, (3)).[YYMMDD_]<attr1>_<attr2>[_...<attrN>].<ext> format from references/naming-conventions.md.document, file, untitled, report) without specific context.recovery mode (default):Only rename files with clearly broken or meaningless names. If the current name already conveys the file's content reasonably well, keep it as-is — even if it doesn't perfectly follow the naming convention format.
Pre-filter (before content reading) — to avoid reading hundreds of files unnecessarily, apply a fast name-quality heuristic FIRST:
IMG_\d+, DSC\d+, Screen Shot, document\(\d+\), Untitled, New File.This pre-filter dramatically reduces content reading for large directories where most files already have decent names.
Rename criteria (recovery) — a file is renamed ONLY if ANY of the following is true:
IMG_20240315_142356.jpg, document(3).pdf, a3f8c2.png).untitled, file, new, temp).Files with partially descriptive names (e.g., quarterly_report.pdf, meeting_notes_march.txt) are kept as-is in recovery mode.
For each file, read its content and determine a descriptive name:
Extensions: .txt, .md, .json, .csv, .html, .xml, .log, .yaml, .yml, .ini, .cfg, .conf, .toml, etc.
If file content appears garbled or unreadable:
utf-8 → cp949 (Korean) → shift_jis (Japanese) → gb2312 (Chinese) → euc-kr → latin-1.file command or chardet-style heuristics to detect encoding if available.Extensions: .pdf, .docx, .xlsx, .pptx, .hwp, .hwpx
.hwpx files are ZIP archives containing XML — unzip and parse Contents/section*.xml to extract body text..hwp files — use hwp5txt or pyhwp if available; otherwise try strings command with Korean encoding.⚠ content unreadable — name based on metadata/original.Extensions: .jpg, .png, .gif, .webp, .svg, .jfif
_unknown/.Files that cannot be analyzed (corrupted, encrypted, unsupported format, all encoding attempts failed):
<target-dir>/_unknown/ preserving the original file name.Apply the allowed languages setting from Step 1:
Refer to references/naming-conventions.md for detailed patterns. Key rules:
_ separator between attributes, - within multi-word attributes.YYMMDD_) when the file has a clear associated date.document, file, untitled.Build a rename map as JSON. When total files exceed 30, use summary-first presentation:
📊 Rename Summary
Rename: 142 files
Keep: 358 files (name already descriptive)
Unknown: 5 files → _unknown/
By extension: .pdf (42) · .hwpx (31) · .jpg (28) · .docx (22) · .txt (19)
[Show full list] [Show by folder] [Show renames only]
When the user requests details (or total files ≤ 30), show the full rename map:
Current Name → Proposed Name
────────────────────────────────────────────────
IMG_20240315_142356.jpg → 240315_sunset_beach-photo.jpg
document(3).pdf → 240901_quarterly_sales-report_Q3.pdf
073_disaster_safety_XR.hwpx → 250530_IITP_disaster-safety_XR-augmentation_proposal.hwpx
notes.txt → meeting-notes_product-roadmap.txt
⚠ Unreadable (→ _unknown/):
corrupted-data.bin → _unknown/corrupted-data.bin (reason: binary, no metadata)
Iterative approval loop — repeat until the user explicitly approves:
Do NOT proceed to execution until the user gives explicit approval.
Pre-execution rollback map — immediately after the user approves, save the planned rollback map BEFORE any file operations:
bash <skill-path>/scripts/rename-map.sh save <target-dir>
This creates <target-dir>/.file-organizer-map.json so that even if execution is interrupted mid-way, the user can still rollback completed operations.
After the rollback map is saved:
✅ 25/142 renamed... (17%)
✅ 50/142 renamed... (35%)
report_Q3_2.pdf.bash <skill-path>/scripts/rename-map.sh reconcile <target-dir>
This ensures the rollback map only contains operations that actually happened.If the user chose full-organize, after renaming:
Analyze existing folder structure and file content categories.
Propose a new folder structure — this may include:
misc/ → reports/, New Folder/ → presentations/).Example proposal:
📁 Folder changes:
[NEW] documents/reports/
[NEW] images/screenshots/
[RENAME] misc/ → data/csv/
[RENAME] New Folder/ → presentations/
[DELETE] old-stuff/ (empty after move)
📁 Proposed structure:
<target-dir>/
├── documents/
│ ├── reports/
│ └── notes/
├── images/
│ ├── photos/
│ └── screenshots/
├── data/
│ ├── csv/
│ └── json/
└── other/
Folder naming follows the same conventions as file naming (see references/naming-conventions.md), using descriptive names.
Present the proposed folder changes AND file moves to the user for approval.
After approval, execute folder operations first (create/rename), then move files, then clean up empty directories.
All folder rename/move operations are recorded in the rollback map for undo.
If the user chose collect, skip Steps 3–6 and follow this procedure instead:
📋 Collect: "resume-related files" → _collected/resume_related/
✅ High (12 files):
documents/resume_john-doe.pdf
career/portfolio_2025.pptx
...
🔶 Medium (5 files):
misc/cover-letter_draft.docx
...
❌ Excluded (283 files): not relevant
<target-dir>/_collected/<query-slug>/..file-organizer-changelog.md.Output a summary:
bash <skill-path>/scripts/rename-map.sh rollback <target-dir>Save change log — write a Markdown file at <target-dir>/.file-organizer-changelog.md with:
# File Organizer Change Log
- **Date**: YYYY-MM-DD HH:MM
- **Mode**: rename-only | full-organize | collect
- **Target**: <target-dir>
## Changes (N files)
| # | Before | After |
|---|--------|-------|
| 1 | `old-name.pdf` | `new-name.pdf` |
| ... | ... | ... |
## Skipped (M files)
| # | File | Reason |
|---|------|--------|
| 1 | `some-file.py` | Source code (excluded) |
| 2 | `train/` (1523 files) | Dataset directory (user confirmed) |
| ... | ... | ... |
## Moved to _unknown/ (K files)
| # | File | Reason |
|---|------|--------|
| 1 | `hash-image.webp` | Unreadable content |
| ... | ... | ... |
This file is overwritten on each run (previous logs are not preserved).
The rollback map (.file-organizer-map.json) records every rename/move operation for undo purposes. The user can manage it with these commands:
# Save current rename map (done automatically before execution)
bash <skill-path>/scripts/rename-map.sh save <target-dir>
# Show the current rollback map contents
bash <skill-path>/scripts/rename-map.sh show <target-dir>
# Undo all renames/moves recorded in the map
bash <skill-path>/scripts/rename-map.sh rollback <target-dir>
# Reconcile map after execution (remove entries for operations that didn't happen)
bash <skill-path>/scripts/rename-map.sh reconcile <target-dir>
# Clear the rollback map (after confirming changes are correct)
bash <skill-path>/scripts/rename-map.sh clear <target-dir>
The user can also ask the agent directly: "rollback the last file organization", "show me what was renamed", or "clear the rollback history".
rm -rf or any recursive delete command without explicit user approval — even inside sub-agents. Deletions of empty directories (rmdir) are allowed only after confirming the directory is empty.development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.