Skip to content

check_skill_frontmatter: also catch name/description length and name-directory mismatch #256

Description

@antonyprasad-db

Problem or opportunity

check_skill_frontmatter in scripts/skillsgen/validators.py guards one silent-drop failure today: an unquoted : in a description, which strict-YAML loaders read as a mapping separator and discard. Its docstring names the failure well — the skill is dropped at load time and the author is never told.

Three more failures behave identically and are not checked. Consuming loaders enforce constraints beyond "the YAML parses":

  • name outside 1–64 characters
  • description longer than 1024 characters
  • name not equal to the skill's directory name

A loader that hits any of these drops the skill with at most a warning in its own log. Nothing in this repo's CI notices, and the skill author sees no error — the skill just silently stops being available in that agent.

The name/directory mismatch is not hypothetical. Two skills published elsewhere in the ecosystem are dropped for exactly this reason when installed into an agent that enforces it:

name: analyzing-mlflow-trace     directory: analyze-mlflow-trace
name: analyzing-mlflow-session   directory: analyze-mlflow-chat-session

No skill in this repo violates any of the three rules today, so this is preventive rather than a live bug. The margin is thinner than it looks though — measured with folded blocks resolved:

skill description length of 1024
databricks-app-design 845 82.5%
databricks-dbsql 737 72.0%
databricks-model-serving 717 70.0%

One ordinary edit to either of the top two would push it over, and the skill would disappear from any agent enforcing that ceiling with no signal here.

Proposed change

Extend check_skill_frontmatter with those three checks, alongside the existing unquoted-colon check, so the same class of failure is caught in one place.

One implementation detail is worth calling out because it is easy to get wrong: measuring the description with a first-line-only regex under-counts folded and literal blocks badly. skills/databricks-dbsql/SKILL.md uses description: >- with the text on indented continuation lines, so a naive regex measures it as 2 characters rather than 737 — which would let an over-long folded description pass the very check being added. The measurement needs to resolve >, >- and | blocks as well as plain and quoted scalars, and stay regex-based rather than yaml.safe_load to keep the package stdlib-only per the existing note about the CI runner having no PyPI.

Affected skill or area

scripts/skillsgen/validators.py (check_skill_frontmatter), scripts/skills.py (re-export of the two limit constants), tests/skills_generator_test.py (SkillFrontmatterTest).

No skill content changes.

Additional context

I have this implemented and tested against the repo, since PR creation here is restricted to collaborators. Happy to hand over the patch, or to land it in the internal source of truth myself once my Universe access is set up — whichever is less work for you.

Test results with the change applied: 126 tests pass (7 added), including the existing test_repo_skills_are_clean, which confirms all 32 shipped skills already satisfy the new rules. The added cases cover one per rule, the description boundary at exactly the ceiling, and folded descriptions both over and within the limit.

Constraints referenced above were read from a consuming loader's shipped implementation and confirmed by observing which skills it accepted and rejected in practice, rather than from documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions