Repository navigation
fix(output): finish the "to X, run Y" sweep and give the default-branch error one form - #4155
Conversation
The `wt step promote` restore hint, the removed-directory hint, and the
`wt switch -` no-history error still put the command before its purpose
("Run wt list to see worktrees"), the order the writing-user-outputs
skill marks BAD. They now end with the command, joined by a semicolon.
The `wt switch -` error is an error, so its command is bold rather than
underlined and it drops its trailing period. The removed-directory hint's
sibling ("Try: wt switch ^") takes the same shape so the two read alike.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two places where the sweep stops one step short of the pattern it's clearing.
The skill still teaches the order this PR removes. #4153 added the rule to
.claude/skills/writing-user-outputs/SKILL.md under Description + command in
single message — "order the recovery 'To X, run Y' as hints do, so the command
still ends the line" — and fixed the example in that section. Two examples
further down still model the old order: under Colors & Styling,
hint_message(cformat!("Run <underline>wt merge</> to continue")), and under
Commands and Branches in Messages,
hint_message(cformat!("Run <underline>wt list</> to see worktrees")), marked
// GOOD. That second string is the literal one this PR deletes from
hint_for_repo. Once src/ is clean, the skill is the only remaining source of
the pattern — and it's the file the next hint gets written from, so leaving it
reintroduces what this PR just removed.
The sibling arm in the same match keeps <underline>. expand_shortcut in
src/git/repository/worktrees.rs now styles the - arm's command <bold>, per
"only hints use <underline>". The ^ arm nine lines below is the same
GitError::Other and still renders
<underline>wt config state default-branch set <bold>BRANCH</></>. Two adjacent
arms of one match now disagree about how an error styles its command, which is
the inconsistency the PR set out to remove.
resolve_target_selector in src/git/repository/config.rs and
handle_state_get in src/commands/config/state.rs both raise the same
"Cannot determine default branch" error with <bold>, so expand_shortcut's
copy is the outlier rather than the convention.
Both are one-line changes with no snapshot churn on the second (nothing pins
that arm's output). Happy to push them onto this branch if you'd like them here
rather than in a follow-up.
… the skill's examples Review follow-up. Two skill examples marked GOOD still modeled "Run X to Y", as did the pronoun examples; they now read "To X, run Y". The "Cannot determine default branch" error had four wordings: two joined with a period, one underlined its command, and `wt step relocate` wrote `set with: … set main` unstyled. All four now read "Cannot determine default branch; to configure one, run wt config state default-branch set BRANCH", with "specify the target explicitly, or" before the recovery where a target is accepted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Finishes the recovery-suggestion sweep #4153 started, where the writing-user-outputs skill settled on "To X, run Y" so the command ends the line.
wt step promoterestore hint, the removed-directory hint (plus its "Try:wt switch ^" sibling, so the two read alike), and thewt switch -no-history error still put the command first. They now end with it; thewt switch -error also takes a bold command and drops its trailing period.wt step relocatewrote an unstyledset with: … set main. All four now read "Cannot determine default branch; to configure one, runwt config state default-branch set BRANCH", with "specify the target explicitly, or" before the recovery where a target is accepted.🤖 Generated with Claude Code