Skip to content

Log invalid skills at debug level instead of writing to stderr - #1183

Merged
SamSaffron merged 1 commit into
SamSaffron:mainfrom
supercobra:skills-quiet-invalid-skill-warnings
Sep 27, 2026
Merged

SamSaffron merged 1 commit into
SamSaffron:mainfrom
supercobra:skills-quiet-invalid-skill-warnings

Conversation

@supercobra

Copy link
Copy Markdown
Contributor

Summary

Skill discovery wrote warning: skipping invalid skill ... directly to stderr for every invalid skill on each registry scan. Ecosystem skill directories (Claude, Codex, etc.) commonly contain skills that fail validation, such as legacy underscore names like md_solve_tickets. Because the registry is scanned repeatedly, those raw stderr writes bypass the TUI and corrupt the terminal display.

This change:

  • Adds a logSkippedInvalidSkill helper that logs through slog.Debug with the skill path and error.
  • Replaces the four direct fmt.Fprintf(os.Stderr, ...) calls in HasAnySkill and scanDirWithFingerprint with the helper.
  • Leaves discovery behavior unchanged: invalid skills are still skipped and never listed.

Test plan

  • New TestRegistryInvalidSkillDoesNotWriteToStderr creates an invalid skill, scans it via HasAnySkill and List, and asserts it is skipped with nothing written to stderr. This test fails before the fix.
  • go test ./internal/skills/ passes (81 tests).
  • go vet ./internal/skills/, make build, and make complexity pass.

🤖 Generated with Claude Code

Skill discovery printed a warning to stderr for every invalid skill on
each registry scan. Ecosystem skill directories commonly contain skills
that fail validation (for example legacy underscore names), and the raw
stderr writes bypass the terminal UI and corrupt the display.

Route the diagnostic through slog at debug level so it stays available
without interfering with rendering. Add a regression test that scans an
invalid skill and asserts nothing is written to stderr.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@supercobra

Copy link
Copy Markdown
Contributor Author

Example of warning message bleeding in the TUI:

Pasted Graphic

@SamSaffron

Copy link
Copy Markdown
Owner

looks good, seems like there is one more pokemon to catch ... will catch them all folowing this

@SamSaffron
SamSaffron merged commit bc6e1b8 into SamSaffron:main Sep 27, 2026
6 checks passed
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