ai-badger-worktree-pitfalls

Documents git worktree pitfalls and recovery steps for scaffold guards and amend traps.

2|Updated Aug 2, 2026
One-click install
npx skills add https://github.com/Arasz/ai-raccoon --skill ai-badger-worktree-pitfalls-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-badger-worktree-pitfalls
Source: https://github.com/Arasz/ai-raccoon/tree/main/.ai-badger/skills/learned/uncategorized/ai-badger-worktree-pitfalls
Command: npx skills add https://github.com/Arasz/ai-raccoon --skill ai-badger-worktree-pitfalls-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Agents working in git worktrees lose changes when the scaffold-freshness-guard pre-commit hook reverts hand-edits, when amend-after-rescaffold merges into the wrong parent, or when absolute paths leak edits onto the main branch. ## Core Features & Use Cases - Scaffold Guard Recovery: Explains how the scaffold-freshness-guard deletes re-added files and how to commit with --no-verify, then re-scaffold separately. - Amend Trap Warning: Documents why git commit --amend after a re-scaffold picks the wrong parent and message. - Worktree Isolation Guidance: Instructs agents to do all work inside the task worktree and avoid absolute paths that leak edits to main. - Use Case: An agent in a task worktree sees its new files deleted at commit time; it follows the documented --no-verify commit flow and re-scaffolds separately to preserve its work. ## Quick Start Ask the agent to review the worktree pitfalls before committing changes inside an ai-badger task worktree.

Frequently Asked Questions about ai-badger-worktree-pitfalls

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

FAQPage Schema
How do I commit when scaffold-freshness-guard deletes my files?

Commit with git commit --no-verify to bypass the pre-commit hook, then run the scaffold separately afterward. The guard treats re-added files as drift and reverts them, so skipping the hook preserves your hand-edits.

Why does git commit --amend break after a re-scaffold?

Amending after a re-scaffold can merge your feature into the wrong parent commit with the wrong message. The regenerated scaffold changes the commit context, so the amend attaches to an unintended parent.

How do I prevent edits from leaking to the main branch in a worktree?

Use relative paths starting with ./ after cd-ing into the worktree, or derive absolute paths dynamically from pwd or Path.cwd(). Hardcoded absolute paths to the main repository root bypass worktree isolation and modify main directly.

Should I work on main or inside the task worktree?

Always work inside the task worktree created by the task skill. Branch-switching in-place on main provides no isolation, so scaffold reverts can destroy uncommitted work.

What platforms does this worktree guidance support?

The documented pitfalls and fixes apply to Linux and macOS environments, as declared in the skill metadata. The git commands used are standard and shell-based.