Update agent instructions; check a worktree is clean before its pre-rm hook

- AGENTS.md and the skill: only the user's browser is off (xdg-open); browser tools run
  in the sandbox, headless or in a Wayland window; host-run project files are read-only
- wt rm: refuse a dirty worktree before wt-pre-rm runs, so its stack is not stopped for
  nothing
This commit is contained in:
2026-10-30 01:41:08 -07:00
parent 01fc1627c1
commit 727feb6be3
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -64,12 +64,12 @@ ocsb_wt_rm() {
[[ $(realpath "${dir}") != "$(realpath "${main}")" ]] || ocsb_die "refusing to remove the main worktree"
branch=$(git -C "${dir}" rev-parse --abbrev-ref HEAD 2>/dev/null || true)
export WT_DIR=${dir} WT_BRANCH=${branch} WT_SLUG=${name##*/} MAIN_ROOT=${main}
ocsb_wt_hook wt-pre-rm "${dir}" "${extra[@]}"
status=$(git -C "${dir}" status --porcelain)
if [[ -n ${status} && ${force} -ne 1 ]]; then
echo "${status}" >&2
ocsb_die "worktree has uncommitted changes — commit them or pass --force (they will be lost)"
fi
ocsb_wt_hook wt-pre-rm "${dir}" "${extra[@]}"
if [[ ${force} -eq 1 ]]; then
git -C "${main}" worktree remove --force "${dir}"
else