backup-first
Skill3 starsChanged 9 months agoMITView on GitHub
Automatic file backup before any modification. Use when a file is about to be edited, modified, or transformed. Creates timestamped backup copies in a _backups/ folder, manages backup rotation (max 3 per file), and provides post-task summaries of all modifications and backups created.
In this repository2 other files it gives its agents.
- dry-runSkill
- file-safetySkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
No file should ever be changed without a backup existing first.
- Very specific: line 18
Before editing any file, create a backup copy in a _backups/ subfolder inside the current working folder.
- Very specific: line 23
Use this exact format: originalname_backup_YYYYMMDD_HHMM.ext
- Distinctive: line 32
Keep a maximum of 3 backups per original file.
- Distinctive: line 33
When creating a 4th backup, delete only the oldest backup for that specific file.
- Distinctive: line 34
Do not delete backups belonging to other files.
- Distinctive: line 39
If it does not exist, create it immediately.
- Distinctive: line 44
After completing any task that involved file modifications, show the user a summary:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backup First
No file should ever be changed without a backup existing first.
Rules
1. Create Backup Before Every Edit
- Before editing any file, create a backup copy in a
_backups/subfolder inside the current working folder. - The backup must be created and confirmed before any modifications begin on the original file.
2. Backup Naming Format
Use this exact format: originalname_backup_YYYYMMDD_HHMM.ext
Examples:
index.html→_backups/index_backup_20260209_1430.htmlstyles.css→_backups/styles_backup_20260209_1430.cssreport.docx→_backups/report_backup_20260209_1430.docx
3. Maximum 3 Backups Per File
- Keep a maximum of 3 backups per original file.
- When creating a 4th backup, delete only the oldest backup for that specific file.
- Do not delete backups belonging to other files.
4. Session Startup Check
- At the start of every session, check if the
_backups/folder exists in the working directory. - If it does not exist, create it immediately.
- This check should happen before any file work begins.
5. Post-Task Summary
After completing any task that involved file modifications, show the user a summary:
✅ Task complete
─────────────────────────────
Files modified: X
Backups created: X
Backup location: _backups/
─────────────────────────────Activation
This skill activates when:
- A file is about to be edited or modified
- A new session begins (for the startup check)
- A task involving file changes is completed (for the summary)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

