Repository navigation
Description
🔴 Required Information
Describe the Bug:
_parse_skill_md_content (src/google/adk/skills/_utils.py) splits SKILL.md with content.split("---", 2), so the frontmatter ends at the first --- anywhere in the file, not at the closing --- line. Any --- inside a frontmatter value (a spaced em-dash in a description, a horizontal rule inside a | block scalar) cuts the frontmatter short. Every skill loader goes through this function (load_skill_from_dir, zip loading, GCS loading, SkillToolset).
Steps to Reproduce:
- Create
compare-skill/SKILL.md:--- name: compare-skill description: Compare two options --- pros, cons and a verdict. --- # Instructions Do the thing. - Load it with
google.adk.skills.load_skill_from_dir("compare-skill"). - Repeat with the description quoted:
description: "Draft release notes --- never publish them."
Expected Behavior:
frontmatter.description is the full string and instructions is # Instructions\nDo the thing. in both cases.
Observed Behavior:
- Unquoted:
description == 'Compare two options', and the rest of the description plus the real closing---leak into the instructions:'pros, cons and a verdict.\n---\n# Instructions\nDo the thing.'. The model sees a truncated description when choosing skills. - Quoted: the skill fails to load with
ValueError: Invalid YAML in frontmatter: while scanning a quoted scalar, although the file is valid. - With a
description: |block scalar containing a---line, the description is cut and every key after it (license,metadata,allowed-tools) is silently dropped, includingadk_additional_toolsin metadata.
Environment Details:
- ADK Library Version (pip show google-adk): 2.13.0 (main at da35ca7)
- Desktop OS: Linux
- Python Version (python -V): 3.12
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A (happens while loading the skill, before any model call)
🟡 Optional Information
Minimal Reproduction Code:
import pathlib, tempfile
from google.adk.skills import load_skill_from_dir
d = pathlib.Path(tempfile.mkdtemp()) / "compare-skill"
d.mkdir()
(d / "SKILL.md").write_text(
"---\nname: compare-skill\n"
"description: Compare two options --- pros, cons and a verdict.\n"
"---\n# Instructions\nDo the thing.\n"
)
skill = load_skill_from_dir(d)
print(repr(skill.frontmatter.description)) # 'Compare two options'
print(repr(skill.instructions)) # 'pros, cons and a verdict.\n---\n# Instructions\nDo the thing.'Additional Context:
I have a fix ready that matches the opening and closing --- as whole lines (CRLF still handled), with regression tests in tests/unittests/skills/test__utils.py, and can open a PR referencing this issue.
How often has this issue occurred?:
- Always (100%)
Activity
_parse_skill_md_content split the file on the first "---" substring, …
fix: match SKILL.md frontmatter delimiters as whole lines