Skip to content
Skillpedia
General coding6.2k · #14388

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.md

Copy 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

Use this skill to help me: https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/git-checkpoint/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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.

repo: agentscope-ai/agentscope-java

Popularity

GitHub stars
6.2k
Ranking position
#14388
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills