Skip to content

fix(#85): Add safeguards against losing unpushed work on main - #98

Merged
admarble merged 1 commit into
mainfrom
feature/85-fix-add-safeguards-against-losing-unpushed-work
Jan 16, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/85-fix-add-safeguards-against-losing-unpushed-work

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add hard reset protection hook that blocks git reset --hard when unpushed commits exist on main/master
  • Update /exec skill to enforce worktree usage before implementation
  • Add Safety Safeguards documentation to docs/concepts/worktree-isolation.md

Changes

File Change
.claude/hooks/pre-tool.sh Add hard reset protection (AC-1, AC-2, AC-3)
templates/hooks/pre-tool.sh Same protection for new installations
.claude/skills/exec/SKILL.md Main branch safeguard (AC-4)
docs/concepts/worktree-isolation.md Safety Safeguards section (AC-5)

Acceptance Criteria

  • git reset --hard origin/main is blocked when unpushed commits exist on main
  • Warning message shows number of commits that would be lost
  • Hook log records blocked reset attempts
  • /exec skill refuses to implement on main without worktree
  • Documentation updated with worktree workflow requirements

Test plan

  • npm test - 363 tests pass
  • npm run build - TypeScript compiles successfully
  • Manual test: Create unpushed commit on main, verify git reset --hard origin/main is blocked

Closes #85

🤖 Generated with Claude Code

- Add hard reset protection to pre-tool.sh hooks that blocks
  `git reset --hard` when unpushed commits exist on main/master
- Update /exec skill to enforce worktree usage before implementation
- Add Safety Safeguards documentation section to worktree-isolation.md

Closes #85

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit ef1b774 into main Jan 16, 2026
@admarble
admarble deleted the feature/85-fix-add-safeguards-against-losing-unpushed-work branch January 16, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Add safeguards against losing unpushed work on main

1 participant