fnl-restore-point · git:20261105.ebd396d · 2026-11-05 · sha256 973196e20c9f7b03

fnl-restore-point git:20261105.ebd396dA

Immutable. This exact content never changes and is served at /api/v1/blob/973196e20c9f7b03.

---
name: fnl-restore-point
description: Save, list or restore a working-tree snapshot on a private local git ref without touching the index, branch or HEAD. Run only when the user asks.
disable-model-invocation: true
argument-hint: "[list|create|restore <name>]"
---

# Save, list or restore a working-tree restore point

This procedure is user-invoked only; there is no automatic hook. The agent enforces the user's clear yes before restoring by judgment (advisory). The script enforces git-only operation, restore-point name validation, symlink refusal across the repository root, `.git` and ref paths, a private temporary index that leaves the real index, branch and HEAD untouched, preview by default with a SHA-256 digest, an automatic `pre-restore` snapshot before overwriting files, keeping files that exist now but not in the point, bounded printable output, and local-only execution with no network.

1. For `list` (or when no action is named), run `python3 -I <this skill folder>/scripts/restore_point.py list`. In a git repository it lists restore points under `refs/finolabs/restore/` newest first with their name, timestamp and files changed against the commit they were taken from (enforced by the script). Outside a git repository, every action prints "Not a git repository: this cannot help here. Run `git init` yourself to start one; nothing was created." and exits 0 without creating anything (enforced by the script); report that message and stop (advisory: agent judgment).
2. For `create`, run `python3 -I <this skill folder>/scripts/restore_point.py create`. Using `GIT_INDEX_FILE` inside a fresh `0700` temporary folder that is removed afterwards, the script snapshots tracked, modified and non-ignored untracked files into a commit object on `refs/finolabs/restore/<YYYYMMDDTHHMMSSZ>` without modifying the user's index, branch, HEAD or working tree, and without creating branches or tags or running `git gc` or `git stash` (enforced by the script). Report the ref name and the number of files.
3. For `restore <name>`, first run `python3 -I <this skill folder>/scripts/restore_point.py restore <name>` without `--yes`. The script validates `<name>` against `^[0-9]{8}T[0-9]{6}Z(-[a-z0-9-]{1,20})?$`, refuses any symlinked `.git`, repository root component or ref path, and prints a preview only: the diff stat and name-status against a temporary-index tree of the current working tree, which files would be overwritten, which files exist now but not in the restore point (and states that these are NOT deleted), and a `Digest:` line (enforced by the script). Show the preview and ask for a clear yes to restore `<name>`, through the host's native question tool when the session has one (advisory: agent judgment). Offer neutral Yes and No choices with none preselected or marked recommended; a default, a timeout or an auto-selected option never counts as the yes (advisory: agent judgment).
4. Only after that yes (advisory: agent judgment), run `python3 -I <this skill folder>/scripts/restore_point.py restore <name> --yes --digest <sha256 prefix>` with at least eight hexadecimal characters of the `Digest:` printed by the preview. On a missing or mismatched digest the script writes nothing; on a match it first creates a `pre-restore` restore point of the current working tree so the restore can be undone, then checks out the restore point's files into the working tree via a temporary index without deleting extra current files or touching the real index, HEAD or branches (enforced by the script). Report the `pre-restore` restore point and the restored state.