agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when organizing, deduplicating, or cleaning up files. Covers safe classification and renaming, finding true duplicates, reclaiming space, and never destroying data during a cleanup.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill file-organization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/file-organizationContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when organizing, deduplicating, or cleaning up files. Covers safe classification and renaming, finding true duplicates, reclaiming space, and never destroying data during a cleanup.
name: file-organization description: Use when organizing, deduplicating, or cleaning up files. Covers safe classification and renaming, finding true duplicates, reclaiming space, and never destroying data during a cleanup. metadata: category: productivity version: 1.0.0 tags: [files, organization, deduplication, cleanup, automation]
Bring order to a directory without losing anything. Every file-organization task has one hard requirement that overrides all others: nothing is destroyed, and every action is reversible.
1. **Survey first** — Count, size, types, and the largest items. Never act on a directory you have not looked at. 2. **Propose a plan and show it** — What will move where, what will be renamed, what will be deleted. This is shown, and confirmed, before anything happens. 3. **Detect duplicates by content, not by name** — Hash the files. Two files with the same name are frequently different; two files with different names are frequently identical. 4. **Move, do not delete** — Duplicates and junk go to a quarantine directory, not to oblivion. Delete only after the user has confirmed, and preferably never. 5. **Preserve the metadata** — Modification times carry information. Do not destroy them by copying carelessly. 6. **Report what happened** — With a way to undo it.
**Duplicate detection that is correct and fast:**
import hashlib
from collections import defaultdict
from pathlib import Path
def find_duplicates(root: Path) -> dict[str, list[Path]]:
"""Two passes. Size first — cheap. Hash only the size collisions."""
by_size: dict[int, list[Path]] = defaultdict(list)
for path in root.rglob("*"):
if path.is_file() and not path.is_symlink():
by_size[path.stat().st_size].append(path)
# Only files with an identical size can be identical. Everything else is
# excluded without reading a byte.
candidates = [paths for paths in by_size.values() if len(paths) > 1]
by_hash: dict[str, list[Path]] = defaultdict(list)
for group in candidates:
for path in group:
by_hash[_hash(path)].append(path)
return {h: paths for h, paths in by_hash.items() if len(paths) > 1}
def _hash(path: Path, chunk: int = 1 << 20) -> str:
h = hashlib.blake2b(digest_size=16)
with path.open("rb") as f:
while data := f.read(chunk):
h.update(data)
return h.hexdigest()**A plan shown before anything is done:**
Survey of ~/Downloads:
2,847 files, 41.2 GB
Duplicates (identical content) : 312 files, 8.4 GB reclaimable
Installers (.dmg, .pkg, .exe) : 89 files, 14.1 GB — all older than 6 months
Screenshots : 1,204 files, 2.1 GB
Documents (pdf, docx) : 418 files
Archives (.zip, .tar.gz) : 203 files, 9.8 GB
PLAN — nothing is deleted. Everything is moved, and a manifest records the
original location of every file.
1. Duplicates -> ~/Downloads/_quarantine/duplicates/
The most recently modified copy of each set stays where it is.
312 files, 8.4 GB.
2. Installers older than 6 months -> ~/Downloads/_quarantine/installers/
89 files, 14.1 GB.
3. Screenshots -> ~/Downloads/Screenshots/YYYY-MM/
Organized by capture date (from EXIF where available, mtime otherwise).
4. Documents -> ~/Downloads/Documents/
5. Archives -> left in place (they may be needed; too risky to move blind).
Manifest written to ~/Downloads/_quarantine/manifest.json.
To undo everything: python restore.py manifest.json
Proceed? [y/N]A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…