happier-commit-worktree

Organizes large dirty Git worktrees into coherent validated commits using private indexes.

1.6k|141|Updated Dec 16, 2025
One-click install
npx skills add https://github.com/happier-dev/happier --skill happier-commit-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: happier-commit-worktree
Source: https://github.com/happier-dev/happier/tree/main/skills/happier-commit-worktree
Command: npx skills add https://github.com/happier-dev/happier --skill happier-commit-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Committing a large or continuously changing Git worktree is risky: unrelated changes get mixed, generated artifacts sneak in, concurrent edits get clobbered, and the shared index cannot be trusted. This Skill turns that chaos into a disciplined campaign of reviewable, well-described commits without ever destroying work.

Core Features & Use Cases

  • Rolling commit campaigns: Reconnoiter, classify into green/yellow/red confidence lanes, and drain coherent change packets through a serial commit authority until every path is committed or has an evidence-backed exclusion.
  • Private-index transactions: Stage each commit in a temporary index and advance HEAD with compare-and-swap via git commit-tree and git update-ref, so concurrent work in the shared checkout is never overwritten.
  • Artifact rejection and residual audit: Exclude build output, caches, QA captures, secrets, and oversized binaries with evidence, then close out only after every residual path is classified.
  • Use Case: You return to a checkout with hundreds of uncommitted files from days of parallel work. The Skill groups them by intent, writes Conventional Commit messages, validates each packet, and commits them in dependency order while leaving genuinely uncertain material uncommitted with reasons.

Quick Start

Ask the AI to analyze this dirty worktree and commit all of my pending changes as coherent, reviewable commits using the happier-commit-worktree skill.

Frequently Asked Questions about happier-commit-worktree

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

FAQPage Schema
How do I commit hundreds of uncommitted changes in Git safely?

Group changes by intent into coherent packets, stage each packet in a private temporary index, validate the staged diff, and commit with git commit-tree plus a compare-and-swap update-ref. This Skill automates that rolling campaign until every path is committed or explicitly excluded.

How to commit changes in a shared dirty Git worktree without losing work?

Never use git reset, clean, or checkout. Stage from explicit paths in a private index initialized from the observed HEAD, then advance HEAD only if it still matches the expected parent. Later worktree edits remain visible as uncommitted modifications.

Can I split one file's changes across multiple commits?

Yes. Build a patch containing only the intended hunks, apply it to the private index with git apply --cached, and commit that partial state. The remaining hunks stay in the worktree as uncommitted modifications for a later packet.

Why does git commit-tree skip my pre-commit hooks?

git commit-tree creates commit objects directly and bypasses pre-commit, commit-msg, and post-commit hooks. The Skill requires inspecting repository hook policy and running equivalent checks explicitly before each commit.

What happens if HEAD moves while a commit is being prepared?

The compare-and-swap update-ref fails, so the temporary index is discarded and the packet is rebuilt from the new HEAD and current worktree bytes. The ref is never forced, preventing lost or replayed history.

When should I not use this commit campaign approach?

Do not use it for an ordinary single-purpose commit whose scope is already known; a normal git add and commit is sufficient. It is designed for large, moving, or long-running commit campaigns with mixed provenance.