Skip to main content

Module verify

Module verify 

Source
Expand description

The skillpack verify subcommand: load the generated distribution files and run discovery + invocation checks against them.

Design §5.2. verify works even on hand-written plugin files (not just init output) — see §4.2 — so the loader is tolerant of missing pieces and each check degrades gracefully.

Re-exports§

pub use self::result::VerifyReport;

Modules§

discovery
Discovery checks — structural validation against the documented Claude Code plugin schema. Pure functions over their inputs: file reads of the committed artifacts plus the repo_url the caller threads in (so the URL-drift check stays free of git subprocess spawns we’d otherwise own here). See crate::verify::schema for the cited source of each rule.
fix
verify --fix: typed fix actions + appliers for mechanical drift.
invocation
Invocation checks — actually run the documented CLI and catch drift between what SKILL.md advertises and what --help actually offers.
result
The result of a single verify check.
schema
The Claude Code schema constants that verify enforces.

Structs§

VerifyInput
Where the invocation stage should look for skill text. Passed in so the dispatcher owns the single find_skill_file call.

Enums§

OutputFormat
How verify presents its results (Improvement B). The human format is the default; json is for CI gating / scripting and uses the machine-readable check_ids already on each CheckResult.

Functions§

render
Pretty-print a report as the human-facing output (design §5.2 step 4). Returns a single string the CLI writes to stdout.
render_github_annotations
Render the report as GitHub Actions workflow commands (::error / ::warning). Emitted to stdout so a CI step like skillpack verify --format github annotates the PR diff inline. Each Error maps to ::error, each Warn to ::warning; file/line are threaded from the result’s location (absent when the check has no file location). Newlines in messages are flattened to spaces — a workflow command is a single line.
render_json
Render the report as a stable JSON object for CI / scripting. Shape: { "ok": bool, "discoverability_score": u8, "counts": {pass,warn,fail,skip}, "results": [ {check_id, check_name, severity, message, suggestion?, location?} ... ] }. The score weights Pass=1.0, Warn=0.5, Error=0; Skipped excluded from the denominator.
render_junit
Render the report as JUnit XML (xUnit-style) for CI dashboards that consume test-report artifacts (GitLab CI, Jenkins, CircleCI). Each result becomes a <testcase name="<check_id>">; Error severities are <failure> elements (counted in failures), Warn severities attach the message + suggestion as a <system-out> note on an otherwise-passing case, and Skipped emit a <skipped/> marker.
render_sarif
Render the report as SARIF 2.1.0 for GitHub Code Scanning upload-sarif. Only Warn and Error results are emitted (SARIF reports failures, not passes). Each result maps ruleIdcheck_id, level"warning" or "error", message → CheckResult message, locations → file + line when available. Pass/Skipped results are omitted.
run
Run the full verify suite against root, returning the aggregate report.