agentleFS
quietdaemonquietdaemon/starter-skills/skills/agent-backup/SKILL.md

agent-backup

Skill1 starsChanged 5 months agoMITView on GitHub

Mirror your AI assistant's live config (skills, persona, settings, custom plugins) to a private git remote. Run on a schedule via cron — secrets and runtime state are excluded by an allowlist .gitignore. Use when asked for a manual backup, or when a backup cron fires.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    After installing a new skill, persona, or plugin and the change should be preserved before the next scheduled window.

    line 23
  2. Distinctive:

    Run the helper script via your shell/terminal tool (not a sandboxed code tool that lacks git/network access):

    line 62
  3. Very specific:

    Never name a file .gitignore inside a skill subfolder: if you keep a template of these rules in another repo — git will treat it as …

    line 100
  4. Very specific:

    Never --amend or force-push: Always a fresh commit, so history stays linear and auditable.

    line 104

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

Agent Config Backup

Snapshot your assistant's live config to a private git remote so a fresh box can be rebuilt in minutes if this one dies. The whole trick is an allowlist .gitignore: you commit only the things you've explicitly named, so a stray secret can never sneak into the backup.

When to use

  • A scheduled backup cron fires (e.g. nightly).
  • The user says "back up now" / "force a backup" / "push the config".
  • After installing a new skill, persona, or plugin and the change should be preserved before the next scheduled window.

What's included vs. excluded

Tune these to your setup. The pattern that matters: default-deny, then allow.

Included (committed + pushed):

  • skills/ — your custom skills (SKILL.md + helper scripts)
  • the persona/system file (e.g. <SOUL_OR_SYSTEM_PROMPT_FILE>)
  • the main config file (model, providers, toolset toggles)
  • scripts/ — helper scripts
  • any custom plugin source you maintain

Excluded (must never leave the box):

  • the secrets file (.env or equivalent) — all credentials
  • chat history / memory databases
  • re-cloneable caches and git mirrors
  • generated artifacts (images, downloads) and runtime logs

Allowlist .gitignore (the safe pattern)

# Default deny everything…
/*
# …then re-allow only what you intend to back up:
!skills/
!scripts/
!config.yaml
!<SOUL_OR_SYSTEM_PROMPT_FILE>
# Belt-and-suspenders: never commit secrets even if re-included above
**/.env
**/*secret*

How to invoke

Run the helper script via your shell/terminal tool (not a sandboxed code tool that lacks git/network access):

bash <AGENT_HOME>/scripts/backup.sh

It prints one JSON line summarizing the run:

{"ok": true, "changed": true, "commit": "a1b2c3d", "files_changed": 4, "pushed": true}

Clean run with nothing to do:

{"ok": true, "changed": false, "commit": null, "files_changed": 0, "pushed": false}

Failure:

{"ok": false, "error": "...", "stage": "commit|push"}

See backup.sh for a ready-to-adapt implementation.

Cron

Schedule it however your platform does cron (a system crontab line, or your agent's built-in scheduler). A --no-agent-style script run costs no LLM tokens — the script does the work, its stdout is the result.

Pitfalls

  • Use an allowlist .gitignore, not a denylist. A denylist fails open — the day you add a new secret file you forgot to exclude, it ships. An allowlist fails closed.
  • Never name a file .gitignore inside a skill subfolder if you keep a template of these rules in another repo — git will treat it as nested, scope-limited rules. Store the template under a different name (e.g. gitignore.template) and only the real root copy stays active.
  • Never --amend or force-push. Always a fresh commit, so history stays linear and auditable.
  • On a partial failure (e.g. one optional file can't be staged), still push the rest — a mostly-current backup beats none.
  • Surface auth errors immediately — a push auth failure usually means the deploy key rotated or was revoked.
  • Never echo the secrets file or any credential, even in error output.

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.