diff --git a/packages/skilllint/plugin_validator.py b/packages/skilllint/plugin_validator.py index e64e3833..c9d50e25 100644 --- a/packages/skilllint/plugin_validator.py +++ b/packages/skilllint/plugin_validator.py @@ -1822,7 +1822,18 @@ def _validate_with_cache( # ============================================================================= # Create Typer app -app = typer.Typer(help="Validate Claude Code plugins and skills", add_completion=False) +app = typer.Typer( + help="Validate Claude Code plugins and skills", + add_completion=False, + # Help is read by agents, so it must not wrap or truncate to the caller's + # terminal. Click uses terminal_width as the exact help width (otherwise + # min(terminal columns, 80) - 2; typer/_click/formatting.py). 800 matches the + # Typer apps in claude_skills (daily-releases, receiving-pr-reviews, + # create-merge-request-changelog); lines longer than 800 columns still wrap. + context_settings={"terminal_width": 800}, + rich_markup_mode=None, + pretty_exceptions_enable=False, +) app.add_typer(docs_app, name="docs") # Version option handled via callback diff --git a/packages/skilllint/tests/test_cli.py b/packages/skilllint/tests/test_cli.py index f25659d2..b71d5213 100644 --- a/packages/skilllint/tests/test_cli.py +++ b/packages/skilllint/tests/test_cli.py @@ -836,15 +836,14 @@ def test_check_help_lists_every_registered_platform(self, cli_runner: CliRunner) How: Render ``check --help`` and look for each ADAPTERS key in CLI form Why: Agents are told to read accepted platform names from this help """ - result = cli_runner.invoke(plugin_validator.app, ["check", "--help"]) + # A narrow terminal must not wrap or truncate help: the app fixes terminal_width. + result = cli_runner.invoke(plugin_validator.app, ["check", "--help"], env={"COLUMNS": "40"}) assert result.exit_code == 0 assert plugin_validator.ADAPTERS expected = ", ".join(sorted(plugin_validator.PLATFORM_CLI_IDS)) assert expected == plugin_validator.PLATFORM_CHOICES - assert "Platform adapter. Choices:" in result.output - for choice in expected.split(", "): - assert choice in result.output + assert f"Platform adapter. Choices: {expected}" in result.output def test_hyphenated_third_party_platform_id_resolves_exactly(self, monkeypatch) -> None: """Registered adapter IDs containing hyphens remain directly selectable."""