Skip to content

feat: add compact output format - #84

Open
choplin wants to merge 1 commit into
agent-ecosystem:mainfrom
choplin:feature/compact-output
Open

feat: add compact output format#84
choplin wants to merge 1 commit into
agent-ecosystem:mainfrom
choplin:feature/compact-output

Conversation

@choplin

@choplin choplin commented Jul 29, 2026

Copy link
Copy Markdown

What this PR does

Adds -o compact, a text output format that reduces each skill to a single line and lists only its warnings and errors.

The default text output prints every passing check, the token tables, and the content and contamination analysis sections for each skill. That is the right default when you are working on one skill, but when running check over a directory of skills — the common pre-commit and CI case — it produces hundreds of lines in which the few findings that need attention are buried. Today the only way to get a terse view is -o json plus a jq filter.

Compact output looks like this:

⚠ skills/algorithmic-art: 1 warning
    ⚠ SKILL.md body is 5233 tokens (spec recommends < 5000)
✓ skills/brand-guidelines: passed
✓ skills/data-cleaning: passed
✓ skills/pdf-processing: passed

4 skills validated: all passed
Total: 1 warning

Passing and informational findings, token counts, and the analysis sections are omitted. Separators are not drawn, so the per-skill lines read as a list.

Only the rendering changes. Finding counts, the overall summary, and exit codes are still computed from the full report, so -o compact and -o text always agree on pass/fail and on --strict behaviour.

Design notes

An output format rather than a --compact flag. A boolean flag would raise the question of what --compact -o json means, and would need either an error or a documented precedence rule. Making compact a value of the existing --output enum makes it mutually exclusive with the other renderers by construction, and matches how it is used in practice: it is a way to render a report, like markdown. --emit-annotations still composes with it, as with every other format.

A separate renderer rather than a mode inside Print. report/compact.go builds its own output from types.Report instead of adding suppression branches to the existing renderer, which keeps the full text output exactly as it was.

Level threshold is fixed at warning. An earlier draft exposed a --min-level flag so the threshold was configurable. It was dropped: the only threshold with a real use case is "show me what needs attention", and error-only would hide warnings that still affect the exit code, which is a confusing thing to offer. If a use case for error-only output appears later, it can be added without changing this format.

How to test

go build -o skill-validator ./cmd/skill-validator

# One line for a passing skill
./skill-validator check -o compact testdata/valid-skill

# Summary line plus the findings, indented
./skill-validator check -o compact testdata/warnings-only-skill
./skill-validator check -o compact testdata/invalid-skill

# Unchanged
./skill-validator check testdata/warnings-only-skill

Covered by tests:

  • report/compact_test.go — a passing skill renders as exactly one line; warnings and errors are listed indented beneath the summary; pass and info findings, token counts and analysis sections are omitted; the icon reflects the worst level present; multi-skill output has no separators and keeps the overall summary.
  • cmd/compact_integration_test.go — drives the built binary end to end, asserting the rendering above and that exit codes (0/1/2) are unaffected, plus a guard that the default text output is unchanged.

Checklist

  • Tests pass locally (go test -race ./... -count=1)
  • Lint passes locally (golangci-lint run)
  • New functionality includes tests
  • Breaking changes are noted above (if any) — there are none; -o compact is additive and the existing formats are untouched

Note: CONTRIBUTING.md asks that new output formats be discussed in an issue first. I had already built this for my own use, so I am opening it as a concrete proposal rather than a request to write it — happy to move the discussion to an issue, or to close this if the direction does not fit the project.

The default text output prints every passing check, the token tables, and the analysis sections for each skill. Validating a directory of skills produces hundreds of lines in which the few findings that need attention are buried.

Add -o compact, which renders each skill as a single line naming it and its outcome, with any warnings and errors listed beneath it. Passing and informational findings, token counts, and the content and contamination analysis sections are omitted. Only the rendering changes: finding counts, the overall summary, and exit codes are still computed from the full report, and the other output formats are untouched.
@choplin
choplin force-pushed the feature/compact-output branch from 0404e01 to 25d15a3 Compare July 29, 2026 07:36
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.

1 participant