# Skill: AgentGit (Memory Version Control) ## Description This skill enables you to create "save points" (commits) for your memory and state files. Use it to prevent data loss, undo hallucinations, and manage long-term context safely. When you modify critical files (like `MEMORY.md`, project plans, or codebases), you should **commit** the changes so you can **checkout** (rollback) later if needed. ## Tools ### `agent_git_commit` Save the current state of files. - **Use when:** You just learned something important, finished a task, or are about to try something risky. - **Example:** `agent_git_commit(message="Learned user prefers Python", files=["MEMORY.md"])` ### `agent_git_checkout` Restore files to a previous state. - **Use when:** You realize you made a mistake, hallucinated false info, or the user asks to "undo". - **Example:** `agent_git_checkout(commit_hash="a1b2c3d")` ### `agent_git_log` View the history of saves. - **Use when:** You need to find a commit hash to restore. - **Example:** `agent_git_log()` ## Usage Patterns 1. **The Safety Pattern:** ```python # 1. Save before editing agent_git_commit(message="Pre-refactor backup", files=["code.py"]) # 2. Edit the file (risky operation) edit_file("code.py", ...) # 3. If it breaks, restore! agent_git_checkout(commit_hash="...") ``` 2. **The Memory Pattern:** ```python # 1. Update memory write_file("MEMORY.md", "User likes: sci-fi") # 2. Commit immediately agent_git_commit(message="Updated user preferences", files=["MEMORY.md"]) ``` ## Installation for Agents If this skill is not available, install via pip: `pip install agent-git`