squash-workspace-commits

Squash completed task commits into one commit after auditing history safety.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/toderian/project_template --skill squash-workspace-commits-toderian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squash-workspace-commits
Source: https://github.com/toderian/project_template/tree/main/plugins/agents-core/skills/squash-workspace-commits
Command: npx skills add https://github.com/toderian/project_template --skill squash-workspace-commits-toderian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? After an agent or developer finishes a task across many small phase commits, the Git history is noisy and hard to review. This Skill compacts those completed commits into a single clean commit while protecting unrelated work and refusing to rewrite pushed or shared history without explicit approval. ## Core Features & Use Cases - Read-only safety audit: A bundled Python helper inspects the worktree, candidate commit range, remote branches, merge commits, and path overlap before any rewrite is planned. - Two rewrite strategies: Uses a soft reset for contiguous task commits at HEAD, or a scripted mixed rewrite that cherry-picks unrelated commits in their original order when commits are interleaved. - Protected history: Refuses to rewrite commits already on remote branches, merge commits, dirty worktrees, or ranges with overlapping file paths unless the user explicitly opts in. - Use Case: After finishing task AUTH-001 across five phase commits, ask the agent to squash the task commits; it audits the range, creates a backup ref, squashes into one conventional commit, and reruns the validation checks. ## Quick Start Ask the agent to squash the completed commits for your task, for example by saying "squash the AUTH-001 task commits after validation".

Frequently Asked Questions about squash-workspace-commits

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I squash task commits in Git safely?

Run the bundled audit helper with a task ID or explicit SHAs to verify the range is clean, local, and free of merge commits. If the audit allows it, create a backup branch, then soft reset to the reported base and commit once with a conventional message.

How to squash commits that are interleaved with unrelated commits?

When selected commits are interleaved, the audit reports a mixed-rewrite method. Create a backup ref, build a temporary branch from the base, apply the squashed task diff, then cherry-pick unrelated commits in their original order, but only when no file paths overlap.

Can I squash commits that have already been pushed to a remote?

By default no. The audit blocks any commit contained in a remote branch, and the rewrite proceeds only if the user explicitly names the range and approves rewriting pushed history. Rewritten history is never pushed unless separately requested.

Why does the squash audit block my rewrite?

Common blockers include a dirty worktree or index, merge commits in the range, commits already on remote branches, missing or out-of-range selected SHAs, and overlapping file paths between selected and unrelated commits. The audit report lists each blocker.

When should I not squash workspace commits?

Do not squash while implementation is still in progress or before validation checks exist. Also skip the squash when task ownership is ambiguous or the audit is uncertain, since a non-squashed but correct history is safer than an unclear rewrite.