agentleFS
jitanguptajitangupta/file-safety-guard/skills/backup-first/SKILL.md

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.

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
  1. Distinctive:

    No file should ever be changed without a backup existing first.

    line 12
  2. Very specific:

    Before editing any file, create a backup copy in a _backups/ subfolder inside the current working folder.

    line 18
  3. Very specific:

    Use this exact format: originalname_backup_YYYYMMDD_HHMM.ext

    line 23
  4. Distinctive:

    Keep a maximum of 3 backups per original file.

    line 32
  5. Distinctive:

    When creating a 4th backup, delete only the oldest backup for that specific file.

    line 33
  6. Distinctive:

    Do not delete backups belonging to other files.

    line 34
  7. Distinctive:

    If it does not exist, create it immediately.

    line 39
  8. Distinctive:

    After completing any task that involved file modifications, show the user a summary:

    line 44

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.html
  • styles.css → _backups/styles_backup_20260209_1430.css
  • report.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)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.