feat: add scope-reduction advisory check to waza check#219
Merged
Conversation
Add a new advisory checker (scope-reduction) that parses SKILL.md for capability signals — USE FOR phrases, level-2 headings, and numbered step sequences — and warns when few are detected, suggesting possible token-limit compression loss. - ScopeReductionChecker with configurable MinCapabilities threshold - 13 unit tests covering all signal types and edge cases - Updated display and loop tests for new advisory output line - Added documentation in CLI reference (site/) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Run gofmt on scope_reduction.go and scope_reduction_test.go - Fix unchecked type assertions (errcheck check-type-assertions: true) Use two-value form with require.True(t, ok) throughout test file - Remove extra blank line between variable declarations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
abecbce to
a64496e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
scope-reductionadvisory check towaza checkthat detects potential token-limit compression loss in SKILL.md files.Closes #183
What it does
The checker parses SKILL.md for three capability signals:
USE FOR:lines## Headinglines in the body1. / 2. / 3.blocksThe total capability score is
max(useForCount, headingCount, stepSequences). When the score falls below the threshold (default: 2), the checker emits a warning suggesting the skill may have lost capability scope due to token-limit compression.Files changed
internal/checks/scope_reduction.go— NewScopeReductionCheckerimplementationinternal/checks/scope_reduction_test.go— 13 test cases covering all signal types and edge casesinternal/checks/score_checkers.go— Registered inAdvisoryCheckers()registrycmd/waza/dev/display_test.go— Updated expected output strings (3 tests)cmd/waza/dev/loop_test.go— Updated expected output strings (8 locations)site/src/content/docs/reference/cli.mdx— Added scope-reduction documentationTesting
go vetcleanWorking as Linus (Backend Developer)