本文へスキップ
Skillpedia
一般的なプログラミング6.2k · #14388

git-checkpoint

できること

Gitのコミットを、エージェントの作業の安全網として使います。大きなリファクタリングを、良いコードを失うリスクなしに試したい開発者向けです。

使う場面

  • ✓プロジェクトに大きな、またはリスクのある変更を加える直前のとき。
  • ✓安全な出発点を残して、複数のファイルにわたるリファクタリングをしたいとき。
  • ✓変更で状態が悪化し、最後の良い状態に戻したいとき。

スキルのリンク

https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/git-checkpoint/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/git-checkpoint/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“今のコードのチェックポイントを保存してから、支払いモジュールをリファクタリングしてください。壊れたら、チェックポイントまで戻してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、危険な作業の前にチェックポイントのコミットを作り、そのIDを記録します。変更がうまくいかない場合、コミットされていない変更を破棄するか、チェックポイントにリセットして、別のアプローチを試します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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.
よくある質問

保存していない作業を削除しますか?

ロールバックが必要なときにだけ、コミットされていない変更を破棄します。大事な作業は先に保存してください。

バックアップファイルを作りますか?

いいえ。Gitが履歴を残すため、バックアップファイルは作らないよう説明されています。

チェックポイントのコミットはどうなりますか?

最終的なブランチをプッシュする前に、それらを片付けるよう説明されています。

詳細

作者による元の説明

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

人気

GitHubのスター
6.2k
ランキング
#14388
ライセンス
Apache-2.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル