tidy-history
tidy-history, folds the commits of the current branch into one commit per change.
Skill by renefatuaki
Chalk Labs
Need help deploying tidy-history?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/renefatuaki-tidy-history
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/tidy-history
What's inside
- Skill name
tidy-history- Description
- tidy-history, folds the commits of the current branch into one commit per change. Use whenever the user wants to tidy, clean up, squash or rewrite the history of a branch, fold fixups into the commits they finish, or when the pull-request skill pushes a branch.
- License
- MIT
- Instructions
- 36 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
Rebuilds the history of the branch checked out in the session's worktree, so a reviewer reads one commit per change. The tree stays the same.
## Steps
1. **Find the base.** The base is the branch the user or the calling skill named, otherwise the `baseRefName` of the open pull request that `gh pr view --json number,baseRefName` finds for the branch, otherwise `dev` when the remote has it and the current branch is another one, otherwise the default branch. Run `git fetch origin <base>`. `<fork>` is `git merge-base origin/<base> HEAD`. Stop and say why when the current branch is the base or has no commit beyond it.
2. **Check that the branch may be rewritten.** Stop and say why when one of these holds.
- The stage is not empty, so `git diff --cached --quiet` fails.
- A person has reviewed the open pull request, so the command prints more than 0, unless the user asks for the tidy anyway. Reviews of apps do not count.
```sh
gh api graphql -F owner='{owner}' -F repo='{repo}' -F number=<number> \
-f query='query($owner: String!, $repo: String!, $number: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $number) { reviews(first: 100) { nodes { author { __typename } } } } } }' \
--jq '[.data.repository.pullRequest.reviews.nodes[] | select(.author.__typename == "User")] | length'
```
- The remote holds commits the branch lacks. `git fetch origin <branch>` succeeds and `git merge-base --is-ancestor origin/<branch> HEAD` fails.
- Layers of a stack build on the branch, so `gh pr list --base <branch> --state open --json number` lists a pull request, unless the calling skill rebases them after the push.
3. **Name the changes.** A reviewer reads one commit per change, such as a criterion of the issue, a refactoring it builds on or a diagram update. A commit that only finishes an earlier one of the branch belongs to that commit, such as a fix from a review or a check, a revert, a format or lint pass, or work in progress. Read `git log --reverse --format='%h %s%n%b' <fork>..HEAD` and name the changes. When the branch holds no more commits than changes, the history is tidy and this is the end.
4. **Rebuild the branch.** Note `git rev-parse HEAD` as `<old>`.
```sh
git reset --soft <fork>
```
Commit the stage with the `commit` skill, one commit per named change in the order of the old history, each with the `Refs` and `Closes` trailers its old commits carried. The commit skill prints its plan without waiting and takes the issue from those trailers. A change whose old commits carry none is committed without a reference. Then `git diff --quiet <old> HEAD` must succeed. When it fails, `git reset <old>` restores the branch and leaves the working tree alone.
5. **Push** the rebuilt history when the branch is on the remote. Report a rejected push and stop.
```sh
git push --force-with-lease origin <branch>
```
6. **Reply** with the commits before and after the tidy, or why it did not run.
Done when the branch holds one commit per change with the tree of `<old>`, is pushed with lease when it is on the remote, or the reply says why the tidy did not run.From renefatuaki/skills, MIT.
More from renefatuaki/skills
- 0.570score
project
renefatuaki
project, the rules for every GitHub Project.
SkillAFreshness: AClaude Code +9 - 0.570score
clean-code
renefatuaki
clean-code, the rules for readable code.
SkillAFreshness: AClaude Code +9 - 0.570score
pull-request-review
renefatuaki
pull-request-review, the rules for testing a pull request in the running application.
SkillAFreshness: AClaude Code +9 - 0.570score
issue
renefatuaki
issue, the rules for every GitHub issue.
SkillAFreshness: AClaude Code +9 - 0.570score
pull-request
renefatuaki
pull-request, the rules for every GitHub pull request.
SkillAFreshness: AClaude Code +9 - 0.567score
today-issues
renefatuaki
today-issues, the plan for today's tickets of a GitHub Project.
SkillAFreshness: AClaude Code +9 - 0.565score
project-docs
renefatuaki
project-docs, the rules for every Markdown file that documents a project.
SkillAFreshness: AClaude Code +9 - 0.565score
diagrams
renefatuaki
diagrams, the rules for every Mermaid diagram.
SkillAFreshness: AClaude Code +9 - 0.565score
commit
renefatuaki
commit, the rules for every git commit.
SkillAFreshness: AClaude Code +9 - 0.565score
code-comments
renefatuaki
code-comments, the rules for every code comment.
SkillAFreshness: AClaude Code +9 - 0.561score
next-steps
renefatuaki
next-steps, what is still open and in which order to do it, as a short numbered list.
SkillAFreshness: AClaude Code +9 - 0.561score
review-queue
renefatuaki
review-queue, the open pull requests of a repository as a table in the order to review them.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 23, 2026 (7 days ago)
- Last release
- Oct 24, 2026 (7 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/renefatuaki/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from renefatuaki
- 0.570score
project
renefatuaki
project, the rules for every GitHub Project.
SkillAFreshness: AClaude Code +9 - 0.570score
clean-code
renefatuaki
clean-code, the rules for readable code.
SkillAFreshness: AClaude Code +9 - 0.570score
pull-request-review
renefatuaki
pull-request-review, the rules for testing a pull request in the running application.
SkillAFreshness: AClaude Code +9 - 0.570score
issue
renefatuaki
issue, the rules for every GitHub issue.
SkillAFreshness: AClaude Code +9 - 0.570score
pull-request
renefatuaki
pull-request, the rules for every GitHub pull request.
SkillAFreshness: AClaude Code +9 - 0.567score
today-issues
renefatuaki
today-issues, the plan for today's tickets of a GitHub Project.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get tidy-history running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
tidy-history skill. Agent Mart. https://agentmart.dev/skills/renefatuaki-tidy-history (last updated 2026-10-24)