-
-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Problem
Skills with domain-specific directory layouts (e.g. domains/, databases/) are incorrectly flagged by the token ratio check as "not structured as a skill" because only references/, scripts/, and assets/ are recognized as standard directories.
The countOtherFiles function in structure/tokens.go counts all files in unrecognized directories as "non-standard" tokens. When these exceed 25,000 tokens and are 10× the standard content, the checkSkillRatio check in validate.go emits a blocking error:
Error: this content doesn't appear to be structured as a skill — there are 92,973 tokens of non-standard content but only 5,432 tokens in the standard skill structure
This blocks skills that intentionally organize content into custom directories (e.g. a risk analysis skill with a domains/ directory containing per-domain reference files).
Proposed fix
Add an --allow-dir CLI flag (repeatable) that treats named directories as standard:
- Excludes them from the non-standard ("other") token count in
countOtherFiles - Suppresses the "unknown directory" structural warning in
CheckStructure
Implementation
A working implementation with tests is available at: https://github.com/mpolce-squareup/skill-validator/tree/mpolce/allow-custom-dirs
Changes:
structure/validate.go: AddAllowDirs []stringtoOptionsstructure/tokens.go:countOtherFilesskips directories inAllowDirsstructure/checks.go:CheckStructureskips warning for directories inAllowDirscmd/check.go: Add--allow-dirStringSliceVarflag
All existing tests pass + 7 new tests added.