Skip to content

fix(skills): allow underscore directory names to match kebab-case skill names#4864

Open
MarceloCorreiaData wants to merge 5 commits intogoogle:mainfrom
MarceloCorreiaData:fix/skill-dir-underscore-kebab-compat
Open

fix(skills): allow underscore directory names to match kebab-case skill names#4864
MarceloCorreiaData wants to merge 5 commits intogoogle:mainfrom
MarceloCorreiaData:fix/skill-dir-underscore-kebab-compat

Conversation

@MarceloCorreiaData
Copy link

Link to Issue or Description of Change

2. Or, if no issue exists, describe the change:

Problem:
The ADK skill spec requires kebab-case names in SKILL.md frontmatter, but Python
cannot import modules whose names contain hyphens. This forces developers to
choose between valid skill names and valid Python module paths, with no
workaround. A skill directory named my_skill (required for Python imports)
must have name: my-skill in its SKILL.md (required by ADK validation), but
the current code rejects this because the directory name does not exactly match
the frontmatter name.

Solution:

  • models.py: Normalize underscores to hyphens in the Frontmatter name
    validator before applying kebab-case validation, so both my_skill and
    my-skill are accepted and stored as my-skill.
  • _utils.py: Normalize directory names with .replace("_", "-") in all
    four name-matching checks (_load_skill_from_dir, _validate_skill_dir,
    _list_skills_in_dir, _load_skill_from_gcs_dir).

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Manual End-to-End (E2E) Tests:
Verified locally that skill directories using snake_case names (e.g.
my_skill/) load correctly when SKILL.md contains the equivalent kebab-case
name (name: my-skill). Previously this raised a ValidationError on the
Frontmatter name field and a ValueError on the directory name mismatch.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

…validator

Python cannot import modules whose names contain hyphens, but the ADK skill spec requires kebab-case names in SKILL.md frontmatter. 
This normalizes underscores to hyphens before validation, so both
snake_case and kebab-case are accepted.
Allow snake_case directory names to match kebab-case frontmatter names in _load_skill_from_dir, _validate_skill_dir, _list_skills_in_dir,
and _load_skill_from_gcs_dir.
@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants