Skip to content

fix: use block-style YAML sequences in SKILL.md frontmatter#580

Open
ademakdogan wants to merge 1 commit intogoogleworkspace:mainfrom
ademakdogan:fix/skill-frontmatter-block-sequences
Open

fix: use block-style YAML sequences in SKILL.md frontmatter#580
ademakdogan wants to merge 1 commit intogoogleworkspace:mainfrom
ademakdogan:fix/skill-frontmatter-block-sequences

Conversation

@ademakdogan
Copy link

Description

Replace flow sequences (bins: ["gws"], skills: [...]) with block-style sequences in all generated SKILL.md frontmatter templates.
Flow sequences are valid YAML but rejected by strictyaml, which the Agent Skills reference implementation (agentskills validate) uses to parse frontmatter. This caused all 93 generated skills to fail validation.
Also adds unit tests verifying that service, shared, persona, and recipe skill templates produce block-style sequences only.
Fixes #521
Dry Run Output:

N/A

Checklist:

  • My code follows the AGENTS.md guidelines (no generated google-* crates).
  • I have run cargo fmt --all to format the code perfectly.
  • I have run cargo clippy -- -D warnings and resolved all warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have provided a Changeset file (e.g. via pnpx changeset) to document my changes.

@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2026

🦋 Changeset detected

Latest commit: a4b477b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
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 addresses a critical validation issue where generated SKILL.md frontmatter failed to parse correctly with strictyaml due to the use of flow sequences. By updating the generation logic to output block-style YAML sequences, all 93 generated skills will now pass validation, ensuring the integrity and usability of the Agent Skills reference implementation. The change also includes robust unit tests to safeguard against regressions in YAML formatting.

Highlights

  • YAML Formatting Fix: Replaced flow sequences (e.g., bins: ["gws"]) with block-style YAML sequences (e.g., bins:\n - gws) in all generated SKILL.md frontmatter templates to ensure compatibility with strictyaml.
  • Unit Test Coverage: Added new unit tests and helper functions to verify that service, shared, persona, and recipe skill templates correctly produce block-style YAML sequences, preventing future validation issues.
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 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 counter productive. 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 Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 correctly addresses an issue with YAML frontmatter formatting by switching from flow-style to block-style sequences, which is required by the strictyaml parser. The changes are applied consistently across all skill generation templates, and the addition of unit tests to verify this new format is a great improvement. I've found one issue in a new test helper function that could make the tests brittle, which I've commented on.

@ademakdogan ademakdogan force-pushed the fix/skill-frontmatter-block-sequences branch from 923a1d6 to bee1af2 Compare March 22, 2026 07:44
@googleworkspace-bot
Copy link
Collaborator

/gemini review

Copy link
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 correctly addresses an issue with YAML frontmatter generation by switching from flow-style to block-style sequences, which is required by the strictyaml parser. The changes are applied consistently across all relevant skill generation templates. The addition of unit tests to verify the output format is an excellent improvement that will help prevent future regressions. I've found one potential issue in a test helper function that could make the new tests less reliable, and I've provided a suggestion to make it more robust.

@ademakdogan ademakdogan force-pushed the fix/skill-frontmatter-block-sequences branch from bee1af2 to d45f7fd Compare March 22, 2026 07:49
@googleworkspace-bot
Copy link
Collaborator

/gemini review

Copy link
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 effectively addresses the YAML compatibility issue with strictyaml by converting all generated frontmatter to use block-style sequences instead of flow-style. The changes are clean and directly solve the problem described. The addition of comprehensive unit tests is excellent, as it verifies the fix for various skill types and will prevent future regressions. I have one suggestion to make the new test logic even more robust.

@ademakdogan ademakdogan force-pushed the fix/skill-frontmatter-block-sequences branch from d45f7fd to bf4b91b Compare March 22, 2026 08:37
@googleworkspace-bot
Copy link
Collaborator

/gemini review

Copy link
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 correctly replaces flow-style YAML sequences with block-style sequences in the generated SKILL.md frontmatter to fix validation issues with strictyaml. The changes are applied consistently across service, shared, persona, and recipe skill templates. The addition of unit tests to verify the output format is a great improvement. I've identified one area for improvement in test coverage to make the fix even more robust.

Replace flow sequences (bins: ["gws"], skills: [...]) with block-style
sequences in all generated SKILL.md frontmatter templates.

Flow sequences are valid YAML but rejected by strictyaml, which the
Agent Skills reference implementation (agentskills validate) uses to
parse frontmatter. This caused all 93 generated skills to fail
validation.

Also adds unit tests verifying that service, shared, persona, and
recipe skill templates produce block-style sequences only.

Fixes googleworkspace#521
@ademakdogan ademakdogan force-pushed the fix/skill-frontmatter-block-sequences branch from bf4b91b to a4b477b Compare March 22, 2026 08:43
@googleworkspace-bot
Copy link
Collaborator

/gemini review

Copy link
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 correctly addresses an issue with YAML flow sequences by converting them to block-style sequences, which is necessary for compatibility with strictyaml. The addition of comprehensive unit tests to validate the frontmatter format is a great improvement. However, I've identified a regression in how empty skill lists are handled for personas and recipes. The new implementation produces a null value instead of an empty list, which could lead to validation failures. I've added two high-severity comments with suggestions to fix this potential bug.

Comment on lines +782 to +783
skills:
{skills}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This will produce skills:\n when required_skills is empty, which is a null value in YAML. The original code produced an empty list []. If the schema expects a list, this will fail validation for any persona without service dependencies.

To fix this, you should handle the empty case in the required_skills generation and adjust this template.

For example, you can modify the required_skills block (lines 762-767) to produce [] for an empty list:

    let required_skills = if persona.services.is_empty() {
        "[]".to_string()
    } else {
        persona
            .services
            .iter()
            .map(|s| format!("\n        - gws-{}", s))
            .collect::<String>()
    };

With that change, this template part should be on a single line.

Suggested change
skills:
{skills}
skills: {skills}

Comment on lines +855 to +856
skills:
{skills}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Similar to the persona skill generation, this will produce skills:\n when required_skills is empty, which is a null value in YAML. The original code produced an empty list []. If the schema expects a list, this will fail validation for any recipe without service dependencies.

To fix this, you should handle the empty case in the required_skills generation and adjust this template.

For example, you can modify the required_skills block (lines 834-839) to produce [] for an empty list:

    let required_skills = if recipe.services.is_empty() {
        "[]".to_string()
    } else {
        recipe
            .services
            .iter()
            .map(|s| format!("\n        - gws-{}", s))
            .collect::<String>()
    };

With that change, this template part should be on a single line.

Suggested change
skills:
{skills}
skills: {skills}

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SKILL.md frontmatter uses flow sequences which fail agentskills validate

2 participants