Skip to content

fix(skills): support single-line YAML descriptions in SKILL.md frontm…#26765

Open
anishs1207 wants to merge 2 commits into
google-gemini:mainfrom
anishs1207:fix-skill-frontmatter-description-parsing
Open

fix(skills): support single-line YAML descriptions in SKILL.md frontm…#26765
anishs1207 wants to merge 2 commits into
google-gemini:mainfrom
anishs1207:fix-skill-frontmatter-description-parsing

Conversation

@anishs1207
Copy link
Copy Markdown
Contributor

Summary

This PR enables support for single line YAML descriptions inside the SKILL.md files at (packages/core/src/skills/skillLoader.ts). Also added test coverage (packages/core/src/skills/skillLoader.test.ts‎)

Related Issues

It fixes #25693

How to Validate

  1. Create two test skill directories:
    mkdir -p .agents/skills/test-skill
    mkdir -p .agents/skills/test-skill-2
    
  2. Create .agents/skills/test-skill/SKILL.md with a single-line description:
---
name: test-skill
description: A single line description that is relatively long and contains some punctuation.
---
# Test Skill
Content here.
  1. Create .agents/skills/test-skill-2/SKILL.md with a multi-line description:
---
name: test-skill-2
description: >
  A multi-line description that is relatively long
  and contains some punctuation.
---

# Test Skill 2
Content here.
  1. Run:
gemini chat
  1. Inside the CLI, execute:
/skills list

Verify that both skills appear in the discovered skills list:

  • test-skill
  • test-skill-2

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker
fix2.mp4

@anishs1207 anishs1207 requested a review from a team as a code owner May 10, 2026 07:35
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the reliability of the skill loader by refining how frontmatter is parsed from SKILL.md files. It addresses issues with special characters and formatting, ensuring that skill metadata is correctly extracted even when descriptions contain quotes or files include non-standard headers like BOMs.

Highlights

  • Frontmatter Parsing: Updated the FRONTMATTER_REGEX to handle leading whitespace and Byte Order Marks (BOM), ensuring more robust file parsing.
  • Description and Name Sanitization: Added logic to strip surrounding quotes from skill names and descriptions during frontmatter parsing to ensure clean metadata extraction.
  • Test Coverage: Added new test cases to verify parsing of long single-line descriptions with punctuation and files containing BOM/leading whitespace.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 10, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the skill loader's robustness by updating the frontmatter regex to support leading whitespace and Byte Order Marks (BOM). Additionally, the simple frontmatter parser now correctly strips outer single or double quotes from the 'name' and 'description' fields. New test cases have been added to verify these changes, including handling of BOM and long descriptions. I have no feedback to provide as there were no review comments.

@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/extensions Issues related to Gemini CLI extensions capability help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Issues related to Gemini CLI extensions capability help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Skills discovery fails when 'description' in SKILL.md frontmatter is a single line

1 participant