Agent skill
git-clean-history
Reimplement the current Git branch on a fresh branch off `main` with a clean, narrative-quality commit history.
Install this agent skill to your Project
npx add-skill https://github.com/goncalossilva/.agents/tree/main/skills/git-clean-history
SKILL.md
Git Rebase
Use this skill to reimplement the current branch on a new branch with a clean, narrative-quality git commit history suitable for reviewer comprehension.
Steps
-
Validate the source branch
- Ensure no uncommitted changes or merge conflicts
- Confirm it is up to date with
main
-
Analyze the diff
- Study all changes between source branch and
main - Form a clear understanding of the final intended state
- Study all changes between source branch and
-
Create the clean branch
- Create a new branch off of
mainusing the new branch name - Use the
{source_branch}-cleanname unless another name is provided by the user
- Create a new branch off of
-
Plan the commit storyline
- Break the implementation into self-contained logical steps
- Each step should reflect a stage of development, as if writing a tutorial
-
Reimplement the work
- Recreate changes in the clean branch, committing step by step
- Each commit must:
- Introduce a single coherent idea
- Include a clear commit message and description
- Follow best practices for the message as outlined by the
git-commitskill
- Use
git commit --no-verifyfor all intermediate commits- Pre-commit hooks check tests, types, and imports that may not pass until the full implementation is complete; do not waste time fixing issues in intermediate commits that will be resolved by later commits
-
Verify correctness
- Confirm the final state exactly matches the source branch
- Run the final commit without
--no-verifyto ensure all checks pass
Rules
- Do not add yourself as an author or contributor
- Do not include "Generated with ...", "Co-Authored-By: ...", or any AI attribution
- The end state of the clean branch must be identical to the source branch
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
update-changelog
Update CHANGELOG.md following Keep a Changelog (https://keepachangelog.com/en/1.1.0/)
git-commit
Commit changes with an emphasis on tidiness and reviewability: small, focused commits, with clear rationale in messages.
homeassistant-ops
Operate a Home Assistant instance via the official REST/WebSocket APIs and backups, with safe plan/apply workflows for bulk, reviewable changes.
browser-tools
Interactive browser automation via Chrome DevTools Protocol. Use when you need to interact with web pages, test frontends, or when user interaction with a visible browser is required.
oracle
Get a second opinion by bundling a prompt + a curated file set, then asking another powerful LLM for debugging, refactor advice, design checks, or code reviews.
sentry
Fetch and analyze Sentry issues, events, transactions, and logs. Helps agents debug errors, find root causes, and understand what happened at specific times.
Didn't find tool you were looking for?