fix(validator): address all remaining review feedback from @mukul975

Three issues fixed:

1. Description list check — added elif isinstance(desc, list) branch that
   emits 'Description must be a string value, not a list'. Previously the
   block was silently skipped when YAML returned a list, causing the skill
   to pass without validating the description field.

2. tools/README.md synced — updated description constraint from '20-500
   characters' to 'at least 50 characters (no upper limit)' to match the
   current code (DESCRIPTION_MIN_CHARS=50, no max enforced).

3. --all with wrong CWD now exits 1 — if glob returns no skill dirs,
   the script prints an error and exits with code 1 instead of reporting
   'Total: 0 Passed: 0 Failed: 0' and exiting 0, which would cause CI to
   silently pass while validating nothing.

All 754 skills continue to pass (0 regressions).
This commit is contained in:
Julio César Suástegui
2026-04-04 05:34:31 -06:00
parent 31f745385b
commit efc9598525
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ python tools/validate-skill.py --all
- Valid YAML frontmatter (between `---` markers)
- Required fields present: `name`, `description`, `domain`, `subdomain`, `tags`
- Name is kebab-case, 164 characters
- Description is 20500 characters
- Description is at least 50 characters (no upper limit; multi-line folded scalars are valid)
- Domain is `cybersecurity`
- Subdomain is from the allowed list
- Tags is a list with at least 2 items
+6 -1
View File
@@ -205,7 +205,9 @@ def validate_skill(skill_dir):
# Validate description.
desc = fm.get("description", "")
if isinstance(desc, str):
if isinstance(desc, list):
errors.append("Description must be a string value, not a list")
elif isinstance(desc, str):
if len(desc) < DESCRIPTION_MIN_CHARS:
errors.append(
f"Description too short ({len(desc)} chars, min {DESCRIPTION_MIN_CHARS})"
@@ -251,6 +253,9 @@ def main():
if sys.argv[1] == "--all":
skill_dirs = sorted(glob.glob("skills/*/"))
if not skill_dirs:
print("ERROR: No skill directories found. Run from the repository root.")
sys.exit(1)
else:
skill_dirs = [sys.argv[1].rstrip("/") + "/"]