git-checkpoint
What it does
This skill uses Git commits as a safety net for an agent's work. It is for developers who want an agent to attempt large refactors without the risk of losing good code.
When to use it
- ✓When you are about to make a large or risky change to a project.
- ✓When you want to do a multi-file refactor and keep a safe starting point.
- ✓When a change has made things worse and you want to return to the last good state.
Skill link
https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/git-checkpoint/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Save a checkpoint of the current code, then refactor the payment module. If it breaks, roll back to the checkpoint.”
5 new skills a week. 1 minute to read.
How it works
The skill creates a checkpoint commit before the risky work and records its ID. If the change goes wrong, it discards the uncommitted changes or resets to the checkpoint and tries another approach.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Git Checkpoint and Rollback
You work in a git-backed sandbox. Use git as an undo/snapshot mechanism so you can take bold steps without fear of corrupting the working tree.
Checkpoint before risky work
Before a large refactor or anything you are unsure about, save the current good state:
git add -A && git commit -m "checkpoint: before <short description>" --no-verify
Record the commit hash (git rev-parse HEAD) so you can return to it.
Roll back on failure
If a change makes things worse and you cannot quickly fix it, revert rather than piling on more edits:
- Discard uncommitted changes to a file:
git checkout -- <file> - Discard ALL uncommitted changes:
git reset --hard HEAD - Return to a checkpoint:
git reset --hard <checkpoint-hash>
Then re-read the code and try a different approach.
Rules
- NEVER create
.bak/ backup files — git is your history. - Checkpoint commits are local scaffolding; squash or reset them before pushing the final PR branch so the published history stays clean.
FAQ
Does it delete my unsaved work?
It discards uncommitted changes only when a rollback is needed, so save important work first.
Will it make backup files?
No, the skill says not to create backup files because Git keeps the history.
What happens to checkpoint commits?
The skill says to clean them up before pushing the final branch.
Details
Original description by the author
Use git as a safety net - create a checkpoint commit before risky or large changes and roll back cleanly if a change makes things worse. Use before multi-file refactors.
Popularity
- GitHub stars
- 6.2k
- Ranking position
- #14388
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agentscope-java
6.2kHelps your agent write non-blocking Java code for AgentScope, a multi-agent framework built on Project Reactor.
data-report
6.2kHelps your agent summarize a dataset into a report with averages, totals, ranges and trends, saved as a Markdown file.
data-transform
6.2kHelps your agent convert a data file between formats such as CSV and JSON, so the data can be used in other tools.
git-changelog
6.2kHelps your agent write a changelog or release notes from a Git history, grouped into features, fixes and other changes.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.