Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
PR Review — Worktrunk Specifics
Data-Loss Surface: Hold for Human Review
Worktrunk's worst failure is silently destroying a user's work. A change that could cause that is not an agent's to merge: a force-flag bypass can read as harmless and still discard committed work.
Hold a PR when its diff could make worktrunk destroy something it used to keep:
it adds a deletion, widens what an existing one can delete, or loosens a check
that gates one, such as the dirty-worktree check or the integration check that
lets wt remove delete a branch. Deletions include:
wt remove, especially-D/--force-deleteor-f/--forcegit branch -D/-d,git worktree remove --forcegit reset --hard,git checkout -f,git cleanwith-f/-d/-xrm -rf,std::fs::remove_dir_all,std::fs::remove_file- shipped automation that runs the above:
plugins/*/hooks/hooks.json,hooks/hooks.json,hooks/wt.sh, and skill or alias examples users copy
The hold is for what a user can't get back: a worktree, a repository, a branch,
uncommitted work, or a file worktrunk writes on their behalf (its own config and
state, an rc file, another tool's settings). A deletion reaches none of that when
everything under its target can be regenerated, or when it is confined to a
throwaway CI or development environment. The test is the contents rather than the
directory's age: wt step promote creates its staging directory and removes it
inside one operation, and in between the directory holds the user's only copy of
both worktrees' ignored files.
On a match:
- Name the deletion in the review, and how the diff could make it destroy more.
- Request review from @max-sixty.
- Do not approve or authorize the merge, even if it looks acceptable.
Review Criteria
Idiomatic Rust and project conventions:
- Does the code follow Rust idioms? (Iterator chains over manual loops,
?over match-on-error, proper use of Option/Result, etc.) - Are there unnecessary allocations, clones, or owned types where borrows would suffice?
- Does new code use
.expect()or.unwrap()in functions returningResult? These should use?orbail!instead.
Testing:
- Do the tests follow the project's testing conventions (see tests/AGENTS.md)?
AGENTS.md compliance:
- Review the AGENTS.md sections relevant to the changed code and flag deviations — code quality, error handling, command execution, data safety, system docstrings, etc.
Documentation accuracy:
When a PR changes behavior, check that related documentation still matches:
- Does
after_long_helpinsrc/cli/mod.rsandsrc/cli/config.rsstill describe what the code does? (These are the primary sources for doc pages.) - Do inline TOML comments in config examples match the actual behavior?
- If a new feature was added, does the relevant help text mention it?
Documentation cruft:
LLM-generated PRs tend to add doc sentences that teach a reader nothing: a note that the edge case a fix covers now works, or a restatement of what the surrounding text already implies. For each added doc sentence, ask what a reader learns that they wouldn't already assume, and how many readers need it. When the answer is nothing, ask for its removal in the review rather than approving past it.
Proportionality and the canonical approach:
A correct diff is not yet an approval. Approve only when the change leaves the codebase better, weighing the code it adds against how many users the fix reaches:
- A rare corner case fixed with a lot of new code — a new helper or parser, a parameter threaded through many call sites, a new error-handling branch — is not a clear win. Name the cost, and the smaller alternative if you see one, such as reusing an existing parser or reading an already-cached value.
- Special-casing one error, variant, or input where the underlying problem is general suggests the fix sits at the wrong layer. Ask whether it should be handled generally.
- Before accepting new machinery, find how the codebase already solves the same problem, and ask the author to reuse that rather than add a second copy.
When one of these holds, submit COMMENT naming it rather than APPROVE, even
after every correctness finding is closed.
Duplication search patterns (Rust-specific):
# For a new function, search for existing implementations
rg "fn detect.*provider|fn get.*platform|fn .*_provider" --type rust
# For code that iterates remotes and parses URLs
rg "all_remote_urls|remote_url|GitRemoteUrl::parse" --type rust
Flake Tracking
When reporting flakes, use worktrunk-bot as the bot login for comment
deduplication:
LAST_COMMENT=$(gh issue view <issue-number> --json comments \
--jq '[.comments[] | select(.author.login == "worktrunk-bot")] | last | {id: .url, createdAt: .createdAt}')