Repository navigation
skills(worktrunk): drop --no-hooks from the sub-Agent example - #4219
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
worktrunk-bot
left a comment
There was a problem hiding this comment.
The rewrite is right about what it fixes, and the regenerated digest in docs/public/.well-known/agent-skills/index.json matches the new SKILL.md byte-for-byte, so the sync check is satisfied.
One gap the new example opens. With --no-hooks gone, the block is a command an agent runs from a non-TTY tool call, and wt switch --create gates project-config hooks before it creates anything: approve_switch_hooks calls HookPlanBuilder::finish().approve(...) and propagates its error, and the prompt helper behind it (prompt_for_batch_approval_with_header in src/commands/command_approval.rs) returns GitError::NotInteractive as soon as it sees !io::stdin().is_terminal(). So in a repo whose .config/wt.toml declares pre-start/post-start/post-switch commands that aren't yet in approvals.toml — worktrunk's own repo among them — the recipe now fails with Cannot prompt for approval in non-interactive environment and creates no worktree, where the old command with --no-hooks never reached the gate.
Failing loudly there is the right behaviour, and this file already documents it under Hook approvals in non-interactive sessions. The problem is distance: that section is several blocks up, and the paragraph an agent reads next to the example gives it no reason to connect the error to it. One clause pointing there closes the loop. User-config hooks — the case that motivated this PR — are never approvable, so they're unaffected either way.
The inline suggestion also restores "build/test step" for the cargo run -- hook pre-merge --yes example. The rewrite relabels it as the sub-Agent's own "setup", and hook pre-merge is the gate that runs after provisioning, not provisioning itself.
Apply it on skills/worktrunk/SKILL.md only — cargo test --test integration test_docs_are_in_sync rewrites plugins/worktrunk/skills/worktrunk/SKILL.md and the index digest from the authored copy.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Apologies for not opening an Issue first. We are loving |
|
No need to restart — there's no issue-first requirement here, and for a docs change this size the diff is the clearest statement of the proposal. Reopening it as an issue would only lose the review thread. Nothing outstanding from my side either: the approvals clause landed in 6af2ff5, and And thanks for the report behind it: a |
|
thanks @passitalong ! this is much better |
Bumps 0.79.0 → 0.80.0 and adds the `## 0.80.0` changelog section, cut from `12efb5159`. The bump is minor because the library API breaks (see Verification). ## Verification - `cargo run -- hook pre-merge --yes` on the cut tip: 4985 passed. - `nightly.yaml` on `12efb5159`, all jobs green including feature-powerset: https://github.com/max-sixty/worktrunk/actions/runs/36338233859 - `cargo semver-checks check-release -p worktrunk` reports five major-level lints, the removals and signature changes listed in the Internal entry. - Changelog: repeated verification passes against source until one came back clean. Fixed headlines name the condition a bug needed rather than its worst case, and near-zero-reach fixes are folded into two roll-up bullets, per #4295. - Data-loss surface review over `v0.79.0..HEAD` with independent finders. The one real finding, a nested stale detached worktree read as the enclosing repo's rebase so `wt step prune` could unregister it, was fixed in #4302. The review also found a squash regression in the backup path, fixed in #4303. The remaining candidates were adjudicated acceptable and signed off: #4228 unregistering stale worktrees whose directory remains (files stay on disk; the branch is deleted only if integrated), #4206 leaving a detached `HEAD` on Ctrl-C during a slow commit hook, #4251 allowing `--no-squash` merges with untracked files, #4219 dropping `--no-hooks` from the skill example, and #4279's `docker stop` recipe. #4252 closes a submodule data-loss path. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The "Parallel sub-Agents" example runs
wt switch --create <branch> --no-cd --no-hooks. On a machine with apre-starthook in user config — mine symlinks the primary worktree's Python venv, which is gitignored and so never arrives with the checkout — that flag skips the provisioning, and the sub-Agent gets a worktree with no interpreter. Every command it runs fails, and nothing in the worktree says why.The prose is already conditional, but the example is what an agent copies: it reads the command block, not the paragraph three blocks down. So the example now omits
--no-hooks, and the sentence states when to add it — only when no user or project hooks provision the worktree and each sub-Agent does its own setup.Docs only; the flag's behaviour is unchanged.
🤖 Generated with Claude Code