feat(lint): expand Vale audit prefilter into a broader plugin-content harness

Deferred item from PR #85 review. Per ADR-0013: cherry-picks two low-noise
rules from trialing write-good/alex against the real corpus (VagueQualifier,
SentenceOpenerThereIs) into styles/Kyberforge rather than adopting either
package wholesale (both are tuned for blog prose and were noisy on this
repo's terse, imperative instruction files - see the ADR's rejected-rule
list). Adds a new skill-size-check pre-commit hook enforcing agentskills.io's
500-line/5,000-token SKILL.md ceiling, currently unenforced. Fixes the 28
resulting violations across 20 existing SKILL.md/agent files so the
enforcing pre-commit hook lands clean.

governance.md/CONTROLS.md were evaluated and excluded as rule sources -
they're org/CI-infrastructure controls, not prose patterns Vale can express.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUDczvw1H3eEeMD29Q9Lbi
This commit is contained in:
2026-07-24 20:04:10 +00:00
parent 28058d35b5
commit 2eb13f702e
23 changed files with 263 additions and 25 deletions

35
scripts/skill-size-check.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail
# Enforces agentskills.io's skill-authoring.md guidance: keep SKILL.md under 500
# lines and 5,000 tokens, so the full body doesn't crowd out conversation
# history and other active skills once loaded into context. Vale can't express
# a whole-file length ceiling (its checks operate on text patterns, not raw
# file size), so this is a plain script instead of a Vale rule.
#
# Token counts aren't computed exactly here — word count (`wc -w`) is used as
# a proxy. For English prose this typically runs somewhat below true BPE token
# counts, so a 5,000-word file is already at or past 5,000 tokens in practice;
# treat this as a conservative, cheap approximation, not an exact measure.
MAX_LINES=500
MAX_WORDS=5000
FAIL=0
for f in "$@"; do
[[ -f "$f" ]] || continue
lines=$(wc -l < "$f")
if (( lines > MAX_LINES )); then
echo "ERROR: $f has $lines lines, exceeding the $MAX_LINES-line ceiling (agentskills.io skill-authoring.md)" >&2
FAIL=1
fi
words=$(wc -w < "$f")
if (( words > MAX_WORDS )); then
echo "ERROR: $f has $words words (proxy for tokens), exceeding the $MAX_WORDS-token ceiling (agentskills.io skill-authoring.md)" >&2
FAIL=1
fi
done
exit $FAIL