# Safe Git Split — Messy Diff to Clean Commit Plan

> Your agent plans the commits. You approve each one. Secrets get flagged — and their commit blocked — before they reach your history.

Safe Git Split — Messy Diff to Clean Commit Plan is a free AI agent skill on Agensi by LINH RATHHENRY, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [LINH RATHHENRY](https://www.agensi.io/creators/linh-rathhenry)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.1
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/safe-git-split-messy-diff-to-clean-commit-plan
- Tags: code-review, git, security, python, workflow-automation

## About this skill

Every agent session ends the same way: a working tree full of mixed changes — the fix, the tests for the fix, a README tweak, a config bump, a file that was only reindented, and (somewhere in there) an API key you pasted during debugging. Committing that as one blob ruins your history; splitting it by hand is tedious; letting the agent "just commit it" is how secrets get published. Safe Git Split is the middle path. Run it and you get a Markdown commit PLAN: changes grouped logically (code by module, tests, docs, config/build, formatting-only files in their own style: group); a Conventional Commits message suggested for every group, with the exact git add / git commit commands — as text in the plan, never executed; a danger section at the top: possible secrets (AWS/GitHub/Stripe/OpenAI-style keys, private keys, DB URLs with passwords, plain passwords — reported by file and line, values never shown), generated & lock files, and oversized changes; a hard stop where it matters: a group containing a secret-flagged file is marked STOP and its commit commands are withheld until the secret is removed and rotated; safety refusals: it will not emit a plan while a merge, rebase, or cherry-pick is in progress. Brand-new repos with no commits yet work fine. The included SKILL.md teaches your agent the full discipline: generate the plan, review it with you, then execute ONE group at a time — only after your explicit approval for that group — verifying git status after each commit. The tool is strictly read-only (a test proves the repo is byte-identical after a run), standard-library only, and ships with 32 passing tests and a demo that plants a fake secret and proves the plan flags it — and blocks its commit — without leaking it. One honest limit: splitting is file-level; two unrelated changes inside the same file land in the same group; use git add -p inside a group when you need hunk-level control. What's inside: safe_git_split/ CLI tool; SKILL.md agent workflow; demo/ one-command demo repo + generated sample plan; tests/ (32 pytest tests); README. Requirements: Python 3.10+, git. No pip dependencies.

## Requires

- Python
- Git

## Known limitations

Does not support repositories in a merge, rebase, or cherry-pick state. Requires Python for the analysis script. Secret detection is a heuristic safety net, not a guarantee.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Safe Git Split — Messy Diff to Clean Commit Plan skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How is this different from just using 'git add -p' or a generic AI prompt?

Safe Git Split analyzes your uncommitted changes and uses a specialized scanning engine to group them into atomic, logical commits (like separating logic from formatting) while scanning for secrets that manual 'git add' might miss.

### What environments and programming languages are supported?

The skill works with any standard Git repository and supports common project structures like Python, Node.js, and Docker; it requires Python and the Git CLI to be installed on your local environment.

### What exactly is included in my purchase of this skill?

You receive the complete skill package, including the analysis engine, the secret detection module, and a step-by-step workflow guide to integrate the agent into your local Git development cycle.

### Does the agent automatically commit and push my code?

For safety, the skill generates a Markdown plan for you to review first; no commits are executed or pushed until you have human-approved the grouped changes and messages.

### Can I use Safe Git Split while I'm in the middle of a merge or rebase?

No, for safety reasons the tool will not run if your repository is currently in a merge, rebase, or cherry-pick state to prevent potential data loss or conflict resolution errors.

### How are updates and new secret detection patterns handled?

Updates to the scanning patterns and logic are delivered through the marketplace platform, ensuring you have the latest protections against new secret formats and improved commit categorization.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
