git-phase-restore — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited git-phase-restore (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Leverage Git's full history to identify development phases and restore any project state automatically. No manual snapshots needed — Git already has everything.
Every Git repository already contains a complete record of every development phase. This skill teaches Claude to read that record intelligently and act on it:
Instead of maintaining separate snapshot systems, this skill mines Git itself as the single source of truth.
Always trigger this skill when the user wants to:
| Intent | Example phrases |
|---|---|
| Restore a phase | "go back to when auth worked", "restore to v1.2", "undo last feature" |
| Explore history | "show project phases", "what was the state on March 1st", "git timeline" |
| Find a regression | "when did this bug appear", "find when X broke", "bisect this issue" |
| Compare phases | "diff between auth and current", "what changed since last week" |
| Inspect a past state | "show me the code before the refactor", "what did file X look like in phase Y" |
| Undo / rollback | "roll back", "undo", "revert", "go back" (in any Git project context) |
Development phases are identified by analyzing Git history through multiple lenses. Run scripts/detect_phases.sh in the project root to get a structured phase map, or follow the manual steps below.
Tags are explicit developer-placed milestones. Always check these first.
# List all tags with dates and messages
git tag -l --sort=-creatordate --format='%(creatordate:short) %(refname:short) %(subject)'Parse conventional commit messages to detect phase boundaries. A new phase starts when:
feat: commit introduces a major new capabilityrefactor: or chore: commit restructures the project# Show commit history with type prefixes for phase detection
git log --oneline --decorate --all --date=short --format='%h %ad %s'Group consecutive commits by their semantic prefix and the files they touch. A phase = a cluster of commits that share a purpose.
Each feature/bugfix branch represents a development phase.
# All branches (local + remote) with last commit date
git branch -a --sort=-committerdate --format='%(committerdate:short) %(refname:short)'
# Merged branches = completed phases
git branch --merged mainWhen the user references a date or relative time period.
# Commits in a date range
git log --after="2025-01-01" --before="2025-02-01" --oneline
# Find the exact commit at a point in time
git rev-list -1 --before="2025-01-15" HEADWhen the user references a specific feature or module, find phases by file paths.
# All commits that touched a specific path
git log --oneline -- src/auth/
# First and last commit touching a path = phase boundaries
git log --diff-filter=A --oneline -- src/auth/ # First appearance
git log -1 --oneline -- src/auth/ # Last changeTrigger: "show phases", "project timeline", "what phases exist"
Steps:
git rev-parse --is-inside-work-tree)PROJECT PHASE TIMELINE
━━━━━━━━━━━━━━━━━━━━━
Phase 1: Project Init [abc1234] 2025-01-10
└─ Initial scaffold, deps, config
Phase 2: Database Layer [def5678] 2025-01-12 → [ghi9012] 2025-01-15
└─ Room setup, DAOs, migrations (12 commits)
Phase 3: Auth System [jkl3456] 2025-01-16 → [mno7890] 2025-01-22
└─ JWT auth, login/register, token refresh (18 commits)
└─ TAG: v0.1.0-alpha
Phase 4: Profile Feature [pqr1234] 2025-01-23 → [stu5678] 2025-01-28
└─ User profile CRUD, avatar upload (9 commits)
Phase 5: Current (HEAD) [vwx9012] 2025-01-29 → now
└─ Settings screen, bug fixes (6 commits)Trigger: "restore to phase X", "go back to [tag/commit/date/description]"
Steps:
git rev-parse <tag>git rev-list -1 --before="<date>" HEADgit log --all --grep="<keyword>" --oneline # Check for uncommitted changes
git status --porcelain
# If dirty, auto-stash
git stash push -m "auto-stash before phase restore $(date +%Y%m%d_%H%M%S)"Option A: Detached HEAD inspection (non-destructive, default for "show me")
git checkout <target-commit>
# User can look around, then return with:
git checkout -Option B: New branch from phase (recommended for "restore and continue")
git checkout -b restore/<phase-label> <target-commit>Option C: Hard reset (destructive — ONLY with explicit user confirmation)
git reset --hard <target-commit>
# Original HEAD saved in reflog for 90 daysOption D: Revert range (safe undo of specific phases)
git revert --no-commit <start-commit>..<end-commit>
git commit -m "revert: undo phase [label] (commits <start>..<end>)" # Confirm HEAD is where expected
git log -1 --oneline
# Show what's different from where we were
git diff --stat <original-head> HEADTrigger: "when did X break", "find the regression", "bisect"
Steps:
git bisect start
git bisect bad HEAD
git bisect good <known-good-commit>
# If there's a test command:
git bisect run <test-command>
# Otherwise, manual bisect — Claude checks each midpointgit revert <bad-commit>Trigger: "diff between phases", "what changed since X", "compare auth phase to current"
Steps:
# Stat summary between two phase boundary commits
git diff --stat <phase-start>..<phase-end>
# Detailed diff for specific files
git diff <commit-a> <commit-b> -- <path>
# Show which files were added/modified/deleted
git diff --name-status <commit-a> <commit-b>Present as a structured summary:
Trigger: "show me file X at phase Y", "what did config look like before"
# Show file content at a specific commit
git show <commit>:<file-path>
# Compare a file between two commits
git diff <commit-a> <commit-b> -- <file-path>These are non-negotiable safeguards:
git reflog shows the safety netgit status --porcelain must be empty or stashedWhen commits follow conventional commit format (feat:, fix:, refactor:, etc.), Claude should auto-generate human-readable phase labels:
| Commit pattern | Auto-label |
|---|---|
feat: add user authentication | "Auth System" |
feat: implement payment gateway | "Payment Integration" |
refactor: extract service layer | "Service Layer Refactor" |
chore: initial project setup | "Project Init" |
Cluster of fix: commits | "Bug Fix Sprint" |
Merge of feature/X branch | Phase named after branch |
# Phase detection
git log --oneline --graph --decorate --all # Visual history
git tag -l --sort=-creatordate # Tags = milestones
git branch -a --sort=-committerdate # Branches = phases
# Time travel
git checkout <commit> # Inspect (detached HEAD)
git checkout -b restore/<label> <commit> # Restore as branch
git stash push -m "before restore" # Save current work
# Investigation
git bisect start && git bisect bad && git bisect good <commit>
git log --all --grep="<keyword>" --oneline # Search commits
git log --after="<date>" --before="<date>" --oneline # Time range
# Recovery (always available)
git reflog # Full undo history
git stash list # Stashed work
git checkout - # Go back to previous branch| Situation | Action |
|---|---|
| Not a git repo | Tell user, offer to git init + initial commit |
| Dirty working tree | Auto-stash with descriptive message |
| Commit not found | Broaden search: try --all, check reflog, search by message |
| Merge conflicts on revert | Show conflicts, help resolve, or abort and try different strategy |
| Detached HEAD confusion | Explain clearly, offer to create a branch or return |
| User wants to undo the restore | Use reflog: git reset --hard HEAD@{1} or pop stash |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.