Skip to content

Org shell: worktree helper and org.check.extraCommands - #39

Merged
andrewthomaslee merged 2 commits into
mainfrom
org-shell-worktree-check
Nov 15, 2026
Merged

andrewthomaslee merged 2 commits into
mainfrom
org-shell-worktree-check

Conversation

@andrewthomaslee

Copy link
Copy Markdown
Member

Summary

 devenv/devenv.nix
+  options.org.check.extraCommands   # listOf str, run by `check` after the flake checks
   scripts.check                     # now `set -euo pipefail` + the extra commands
+  scripts.worktree                  # devenv/worktree.sh
+  packages: gh
+devenv/worktree.sh
worktree new <branch>   fetch; git worktree add <clones>/.worktrees/<repo>/<branch> -b <branch> origin/main; print path
worktree list           branch, PR state (gh), path
worktree prune          MERGED/CLOSED → worktree remove + branch -D (dirty worktrees kept); worktree prune; ff main if clean

This is the tooling behind the new ground rules (external-systems/skills rules/ground-rules.md). home will set org.check.extraCommands = ["clan vars check"].

Evidence

  • In this worktree's own shell: worktree list → lists org-shell-worktree-check NONE … and remove-code-agent-image OPEN …. worktree alone prints the usage and exits 2.
  • devenv shell -- check → all checks passed!. shellcheck (treefmt) passes on worktree.sh.

Merge Danger

Door: two-way

Blast Radius: dev shells

Every repo's check script gains set -euo pipefail (same exit status as before when there are no extra commands) and a new worktree command. Repos pick it up when they bump org-pkgs in devenv.yaml.

🤖 Generated with Claude Code

`worktree new|list|prune` gives every PR branch its own worktree under
<clones>/.worktrees/<repo>/<branch>, so several sessions can work in one
repo while the clone stays on main; prune removes worktrees whose PR
merged or closed and fast-forwards main.

`org.check.extraCommands` lets a repo add gates `nix flake check` cannot
run (repo CLIs, network), such as `clan vars check` in a clan repo;
`check` runs them after the flake checks and fails on the first error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee enabled auto-merge (squash) November 15, 2026 02:43
@andrewthomaslee
andrewthomaslee merged commit 2bacfc8 into main Nov 15, 2026
3 checks passed
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.

1 participant