Skip to content

fix(output): finish the "to X, run Y" sweep and give the default-branch error one form - #4155

Merged
max-sixty merged 3 commits into
mainfrom
config-update-output-overwrite
Sep 16, 2026
Merged

max-sixty merged 3 commits into
mainfrom
config-update-output-overwrite

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

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.

  • Messages: the wt step promote restore hint, the removed-directory hint (plus its "Try: wt switch ^" sibling, so the two read alike), and the wt switch - no-history error still put the command first. They now end with it; the wt switch - error also takes a bold command and drops its trailing period.
  • "Cannot determine default branch": the error had four wordings — two joined with a period, one underlined its command, and wt step relocate wrote an unstyled set with: … set main. 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.
  • Skill examples: the examples marked GOOD under "Styling in Command Code" and "Commands and Branches in Messages", and the pronoun examples, still modeled "Run X to Y"; they now use the new order.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 16, 2026 16:11
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 worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@max-sixty max-sixty changed the title fix(output): order three remaining recovery suggestions "to X, run Y" fix(output): finish the "to X, run Y" sweep and give the default-branch error one form Sep 16, 2026
@max-sixty
max-sixty merged commit 3294048 into main Sep 16, 2026
38 checks passed
@max-sixty
max-sixty deleted the config-update-output-overwrite branch September 16, 2026 23:57
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.

2 participants