Get the FREE Ultimate OpenClaw Setup Guide →

Squash

npx machina-cli add skill Speedy0000007/claude-tandem/squash --openclaw
Files (1)
SKILL.md
1.2 KB

Tandem Squash

Squash consecutive Tandem auto-commits from HEAD into a single clean commit.

Steps

  1. Check for consecutive auto-commits from HEAD. A commit is a Tandem auto-commit if its body contains the trailer Tandem-Auto-Commit: true or its subject is chore(tandem): session checkpoint.

  2. Walk HEAD backwards counting consecutive auto-commits. Stop at the first non-auto-commit.

  3. If no auto-commits found, tell the user: "No Tandem auto-commits at HEAD. Nothing to squash."

  4. If auto-commits found, report what will be squashed:

    • How many auto-commits
    • The short log of those commits
  5. Run git reset --soft HEAD~N where N is the count.

  6. If $ARGUMENTS contains a commit message, use it. Otherwise, ask the user what commit message to use. Suggest a message based on the progress notes in the auto-commit bodies.

  7. Commit the staged changes with the user's message. The commit must follow conventional commit format with a body (the normal validate-commit hook will enforce this).

  8. Confirm: show the new commit's short log entry.

Source

git clone https://github.com/Speedy0000007/claude-tandem/blob/main/plugins/tandem/skills/squash/SKILL.mdView on GitHub

Overview

Squash consecutive Tandem auto-commits from HEAD into a single clean commit. It detects Tandem auto-commits by the trailer Tandem-Auto-Commit: true or the subject chore(tandem): session checkpoint, counts back to the first non-auto-commit, and creates a consolidated commit to keep history tidy.

How This Skill Works

The skill walks HEAD backwards to collect consecutive Tandem auto-commits via trailer or subject, then uses git reset --soft HEAD~N to stage changes. It then commits with the provided message or a generated one based on progress notes in the auto-commit bodies, enforcing a conventional commit format with a body. Finally, it shows the new short log entry.

When to Use It

  • When you want to squash multiple Tandem auto-commits at HEAD into one clean commit.
  • When you explicitly mention squash auto-commits, squash tandem commits, or clean up checkpoints.
  • When you need to summarize progress notes from auto-commits into a single message.
  • When there are back-to-back auto-commits that clutter your Git history and you want a single entry.
  • When you want the final commit to follow a conventional commit format with a body.

Quick Start

  1. Step 1: Detect consecutive Tandem auto-commits at HEAD by the trailer Tandem-Auto-Commit: true or the subject chore(tandem): session checkpoint.
  2. Step 2: If found, display how many commits and their short log, then run git reset --soft HEAD~N to stage changes.
  3. Step 3: Commit with the provided or generated message in conventional format and show the new short log.

Best Practices

  • Detect auto-commits by the trailer Tandem-Auto-Commit: true or the subject chore(tandem): session checkpoint.
  • Count consecutive auto-commits until you reach the first non-auto-commit.
  • Show the user how many commits will be squashed and display their short log before rewriting history.
  • Use git reset --soft HEAD~N to preserve changes for a single recommit.
  • Ensure the final commit uses a conventional commit format with a body; the normal validate-commit hook will enforce this.

Example Use Cases

  • Three Tandem auto-commits at HEAD are squashed into one chore(tandem): update session checkpoints.
  • Squash 2 Tandem auto-commits into a single chore(tandem): refine session checkpoints.
  • No Tandem auto-commits at HEAD; the tool reports no action.
  • User provides a custom commit message; the squashed commit uses it for the final commit.
  • Auto-commit notes provide progress; the final message is generated as a concise summary.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers