Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(cli): validate Tier 1 before preparing scanners (#706)
Christopher Kevin680e1c0f0afb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bbc9d217..74ff1867 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -433,6 +433,8 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed+- Direct Tier 1 validates the target, selected checks and LLM configuration before+ preparing scanners, so configuration errors do not trigger downloads or stdout noise.- Documentation-only CI follows imports through collected test modules andpackage initializers, so dependent documentation assertions are included.- The Tier 1 PII scan no longer stalls on a long identifier before an IPv4-shaped value. A line with adiff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.pyindex 442ec06d..dee2e0f9 100644--- a/src/skillevaluator/cli.py+++ b/src/skillevaluator/cli.py@@ -3591,7 +3591,6 @@ def _tier1_workflow(policy = resolve_policy(profile=profile, policy_path=policy_path)except (FileNotFoundError, ValueError) as exc:raise click.ClickException(str(exc)) from exc- _offer_scanner_install(checks, skip)results = run_tier1_workflow(skill_path,checks=checks,@@ -3603,6 +3602,7 @@ def _tier1_workflow(profile=policy,previous_version=previous_version,skillspector_baseline=skillspector_baseline,+ prepare_scanners=lambda: _offer_scanner_install(checks, skip),)# Resolved after the run so configuration errors still leave no output.output_dir = _resolve_file_report_output_location(skill_path.resolve(), output_dir, report_formats)diff --git a/src/skillevaluator/tier_workflows.py b/src/skillevaluator/tier_workflows.pyindex 708cbb56..7a1e661e 100644--- a/src/skillevaluator/tier_workflows.py+++ b/src/skillevaluator/tier_workflows.py@@ -6,6 +6,7 @@from __future__ import annotationsimport os+from collections.abc import Callablefrom pathlib import Pathfrom typing import TYPE_CHECKING@@ -75,7 +76,9 @@ def run_tier1_workflow(pii_waivers: Path | None = None,skillspector_baseline: Path | None = None,skip: str | None = None,+ prepare_scanners: Callable[[], None] | None = None,) -> list[ValidationResult]:+ """Validate local configuration before optional scanner preparation and checks."""require_skill(skill_path)if checks is not None and not checks.strip(", \t\n"):raise click.UsageError("--checks must name at least one static check.")@@ -90,6 +93,8 @@ def run_tier1_workflow(import openai # noqa: F401 -- fail before scanning if the LLM extra is absentexcept ImportError as exc:raise click.ClickException("Install skillevaluator[llm] to run LLM checks.") from exc+ if prepare_scanners is not None:+ prepare_scanners()results = tier1.run_validation(skill_path,checks=selected,diff --git a/tests/cli/test_tier_workflows.py b/tests/cli/test_tier_workflows.pyindex 38c883cb..3655c332 100644--- a/tests/cli/test_tier_workflows.py+++ b/tests/cli/test_tier_workflows.py@@ -42,6 +42,13 @@ def skill(tmp_path):return path[email protected](autouse=True)+def isolate_scanner_preparation(monkeypatch):+ # Workflow composition tests do not install tools. Ordering tests below+ # replace this stub with explicit spies for both rejected and valid inputs.+ monkeypatch.setattr("skillevaluator.cli._offer_scanner_install", lambda *_args: None)++def _result(name):result = ValidationResult(validator_name=name)result.add_success("checked", "Completed this check")@@ -150,7 +157,9 @@ def test_keyless_tier1_reports_unrun_llm_scope(skill, tmp_path):@pytest.mark.parametrize("tier,options", [("tier1", ["--llm"]), ("tier2", [])])-def test_required_provider_failure_is_a_configuration_error(tier, options, skill, tmp_path):+def test_required_provider_failure_is_a_configuration_error(tier, options, skill, tmp_path, monkeypatch):+ preparations = []+ monkeypatch.setattr("skillevaluator.cli._offer_scanner_install", lambda *_args: preparations.append("prepare"))result = CliRunner().invoke(cli, [tier, str(skill), *options, "-o", str(tmp_path / "reports")])assert result.exit_code == 1assert result.stdout == ""@@ -159,6 +168,98 @@ def test_required_provider_failure_is_a_configuration_error(tier, options, skillassert ("--no-llm" in result.stderr) is (tier == "tier1")assert "No such command" not in result.outputassert not (tmp_path / "reports").exists()+ assert preparations == []++[email protected]("case", ["unknown_checks", "empty_checks", "missing_manifest"])+def test_tier1_rejects_local_configuration_before_scanner_preparation(case, skill, tmp_path, monkeypatch):+ preparations = []+ monkeypatch.setattr("skillevaluator.cli._offer_scanner_install", lambda *_args: preparations.append("prepare"))+ options = ["--no-llm"]+ if case == "unknown_checks":+ options += ["--checks", "schema,unknown"]+ elif case == "empty_checks":+ options += ["--checks", " , "]+ else:+ (skill / "SKILL.md").unlink()++ result = CliRunner().invoke(cli, ["tier1", str(skill), *options, "-o", str(tmp_path / "reports")])++ assert result.exit_code == 2, result.output+ assert preparations == []+ assert not (tmp_path / "reports").exists()+++def test_tier1_rejects_missing_llm_extra_before_scanner_preparation(skill, tmp_path, monkeypatch):+ import sys++ preparations = []+ monkeypatch.setattr("skillevaluator.cli._offer_scanner_install", lambda *_args: preparations.append("prepare"))+ monkeypatch.setenv("SKILL_EVAL_LLM_PROVIDER", "nv_build")+ monkeypatch.setenv("NVIDIA_API_KEY", "test-credential")+ monkeypatch.setitem(sys.modules, "openai", None)++ result = CliRunner().invoke(cli, ["tier1", str(skill), "--llm", "-o", str(tmp_path / "reports")])++ assert result.exit_code == 1, result.output+ assert "Install skillevaluator[llm]" in result.stderr+ assert result.stdout == ""+ assert preparations == []+ assert not (tmp_path / "reports").exists()++[email protected]("mode", ["keyless", "no_llm", "configured_llm"])+def test_tier1_prepares_scanners_once_after_preflight_and_before_checks(mode, skill, tmp_path, monkeypatch):+ from skillevaluator.tier1 import commands++ stages = []+ monkeypatch.setattr(+ "skillevaluator.cli._offer_scanner_install",+ lambda checks, skip: stages.append(("prepare", checks, skip)),+ )++ def validation(_path, **kwargs):+ stages.append(("validation", kwargs["checks"], kwargs["skip"]))+ return _result("Schema Validation")++ def rubric(_path, **_kwargs):+ stages.append(("rubric", None, None))+ return _result("Rubric Evaluation")++ monkeypatch.setattr(commands, "run_validation", validation)+ monkeypatch.setattr(commands, "run_rubric_eval", rubric)+ options = []+ if mode == "no_llm":+ options = ["--no-llm"]+ elif mode == "configured_llm":+ monkeypatch.setenv("SKILL_EVAL_LLM_PROVIDER", "nv_build")+ monkeypatch.setenv("NVIDIA_API_KEY", "test-credential")+ options = ["--llm"]+ reports = tmp_path / "reports"++ result = CliRunner().invoke(+ cli,+ [+ "tier1",+ str(skill),+ "--checks",+ "schema,security",+ "--skip",+ "security",+ *options,+ "-r",+ "json",+ "-o",+ str(reports),+ ],+ )++ assert result.exit_code == 0, result.output+ expected = [("prepare", "schema,security", "security"), ("validation", "schema,security", "security")]+ if mode == "configured_llm":+ expected.append(("rubric", None, None))+ assert stages == expected+ assert _report(reports)["results"][0]["workflow"]["tier"] == 1def test_tier2_combines_intra_and_catalog_comparison_once(skill, tmp_path, monkeypatch):