Critical:
- Handle git status failure with clear error instead of silently skipping uncommitted-changes guard
- Add path-exists check before removal attempt (fail-fast)
Major:
- Reuse WorktreeError from create module instead of duplicating WorktreeRemoveError
- Add force parameter to TypeBox schema and wire it through to command builder
- Add baseDir parameter to isMainRepository for deterministic relative path resolution
- Fix environment-dependent test (use absolute paths / explicit baseDir)
Minor:
- Update stale JSDoc on resolveWorktreeTarget
- Add integration test section for execute path
- Include branch name in success response
- Add test for relative path with explicit baseDir
Suggestions:
- List remaining worktrees in success response details
Add validation and error handling for removing linked worktrees:
- validateRemoveWorktreeInput() — validates path is non-empty
- isMainRepository() — refuses removal of main repo root
- hasUncommittedChanges() — checks git status --porcelain output
- buildWorktreeRemoveCommand() — builds git worktree remove args
Wire up createRemoveWorktreeTool with full validation pipeline:
1. Validate input parameters (path)
2. Check if target is the main repo — refuse with prune suggestion
3. Check for uncommitted changes — refuse with stash/commit message
4. Run git worktree remove <path>
5. Surface git errors with helpful suggestions