Skip to content

skills(writing-user-outputs): document the stderr half of the anstream macro rule - #3797

Open
worktrunk-bot wants to merge 1 commit into
mainfrom
skills/stderr-macros-31363066936
Open

skills(writing-user-outputs): document the stderr half of the anstream macro rule#3797
worktrunk-bot wants to merge 1 commit into
mainfrom
skills/stderr-macros-31363066936

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Skill drift. writing-user-outputs is the thing loaded before editing anything that produces user-visible strings, and its "Printing output" section states only the stdout half of a two-sided rule — which println! is in scope, and the BrokenPipe panic that turns on it. The stderr half is absent, even though ec0f3a3 (#3771) made it structural: check_stderr_macros_come_from_styling now requires every bare eprint! / eprintln! under src/ to resolve to anstream's.

The gap is exactly the mistake #3771 fixed in five files. A developer following the skill's own example import — use worktrunk::styling::{eprintln, println, stderr}; — and then reaching for eprint! mid-block gets std's macro, which keeps ANSI on a redirected stderr where the eprintln! two lines up drops it. The skill never names eprint! at all, and #3771's commit message notes the suite cannot catch this: CLICOLOR_FORCE=1 forces color on both printers, so every snapshot agrees whichever macro is in scope.

One paragraph, placed directly after the println! one it mirrors: the stripping asymmetry and its user-visible symptom, that eprint! is the half that slips and why, the two ways to satisfy the rule (import, or qualify as styling::eprintln!(…)), the guard test that enforces it, and that STD_STDERR_ALLOWED_PATHS exempts whole files rather than calls.

No regression test — the change is skill prose. The behavior it describes is already pinned by check_stderr_macros_come_from_styling and test_stderr_narration_strips_ansi_when_piped; what was missing is that a developer reads the rule before tripping the guard rather than after.

@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant