Problem
The Agent Skills spec treats scripts/, references/, and assets/ as optional organizational directories. A valid skill can be completely flat:
my-skill/
├── SKILL.md
├── guide.md
├── extract.py
└── template.txt
The validator currently penalizes this layout in several ways:
-
Root-level file warnings (structure/checks.go): Any file at root besides SKILL.md triggers an "unexpected file" warning, nudging authors toward subdirectories they may not need.
-
Unknown directory warnings (structure/checks.go): Non-standard directories at root generate warnings suggesting they should be references/ or assets/, even though custom directory names are not spec violations.
-
Orphan detection blind spot (structure/orphans.go): Orphan checking only inventories files inside references/, scripts/, and assets/. Root-level support files are invisible to orphan detection — unreferenced files at root are never flagged.
-
"Non-standard" token accounting (structure/tokens.go): Files outside the three recognized directories are bucketed as "non-standard" with separate aggregate limits (25k soft / 100k hard). A flat skill with guide.md at root gets stricter treatment than the same file inside references/.
-
Skill ratio penalty (structure/validate.go): If "non-standard" tokens exceed 10x "standard" tokens, the skill is flagged as possibly misconfigured. A flat skill with substantial reference material would hit this even though the layout is valid.
Proposed Changes
Treat recognized file types at root as first-class
.md files at root (beyond SKILL.md) should be treated equivalently to files in references/
.py, .sh, .js, .ts files at root should be treated equivalently to files in scripts/
- Other files at root should be treated equivalently to files in
assets/
- Remove or downgrade the "unexpected file at root" warnings for files that have recognized extensions
Extend orphan detection to root-level files
- Include root-level support files in the orphan inventory
- Apply the same BFS reachability check from SKILL.md to these files
Unify token accounting
- Count root-level support files under the same limits as their subdirectory equivalents (e.g., a root
guide.md counts toward reference token limits, not "non-standard" limits)
- Adjust
checkSkillRatio() to not penalize flat layouts
Preserve hints without penalizing
- It's still useful to inform authors that subdirectories exist for organization, but this should be
Info-level, not Warning-level, and only when there are enough files that organization would genuinely help (e.g., 5+ support files at root)
Context
The spec explicitly says:
A skill is a directory containing at minimum a SKILL.md file
and presents the three subdirectories under "Optional directories." The validator should validate the spec, not enforce a preference for structured layouts over flat ones.
Problem
The Agent Skills spec treats
scripts/,references/, andassets/as optional organizational directories. A valid skill can be completely flat:The validator currently penalizes this layout in several ways:
Root-level file warnings (
structure/checks.go): Any file at root besides SKILL.md triggers an "unexpected file" warning, nudging authors toward subdirectories they may not need.Unknown directory warnings (
structure/checks.go): Non-standard directories at root generate warnings suggesting they should bereferences/orassets/, even though custom directory names are not spec violations.Orphan detection blind spot (
structure/orphans.go): Orphan checking only inventories files insidereferences/,scripts/, andassets/. Root-level support files are invisible to orphan detection — unreferenced files at root are never flagged."Non-standard" token accounting (
structure/tokens.go): Files outside the three recognized directories are bucketed as "non-standard" with separate aggregate limits (25k soft / 100k hard). A flat skill withguide.mdat root gets stricter treatment than the same file insidereferences/.Skill ratio penalty (
structure/validate.go): If "non-standard" tokens exceed 10x "standard" tokens, the skill is flagged as possibly misconfigured. A flat skill with substantial reference material would hit this even though the layout is valid.Proposed Changes
Treat recognized file types at root as first-class
.mdfiles at root (beyond SKILL.md) should be treated equivalently to files inreferences/.py,.sh,.js,.tsfiles at root should be treated equivalently to files inscripts/assets/Extend orphan detection to root-level files
Unify token accounting
guide.mdcounts toward reference token limits, not "non-standard" limits)checkSkillRatio()to not penalize flat layoutsPreserve hints without penalizing
Info-level, notWarning-level, and only when there are enough files that organization would genuinely help (e.g., 5+ support files at root)Context
The spec explicitly says:
and presents the three subdirectories under "Optional directories." The validator should validate the spec, not enforce a preference for structured layouts over flat ones.