Skip to content

bug: skill validators reject CRLF checkouts on Windows #258

Description

@dajiaohuang

What happened?

On a Windows checkout with core.autocrlf=true, the native skill-package validators fail for both newly added workbenches even though their SKILL.md frontmatter is valid:

  • demohouse/car-decision-assistant/scripts/validate-skill-package.mjs
  • demohouse/sales-intelligence-workbench/scripts/validate-skill-package.mjs

Both validators match the opening frontmatter with a literal LF-only expression (^---\nname: ...\n). Git converts the tracked LF files to CRLF in this checkout, so fs.readFileSync(..., "utf8") returns \r\n and the assertion fails.

How can we reproduce it?

  1. On Windows, enable Git's standard line-ending conversion: git config --global core.autocrlf true.
  2. Clone the repository at current main (b943185fae20853609fe41d433c73874a251d587).
  3. In each project, run npm ci followed by npm run skill:validate.

Both commands fail at the frontmatter assertion. Byte-level checks show the working-tree files contain CRLF, while the Git blobs contain LF; the existing regex matches only the blobs.

What did you expect to happen?

The validators should accept valid frontmatter with either LF or CRLF line endings. Using \r?\n for the two asserted newlines keeps the current LF behavior and permits Windows checkouts without weakening the frontmatter requirement.

Which kind of issue is this?

Demohouse application

Environment

  • Windows
  • Git 2.51.2.windows.1, core.autocrlf=true
  • Node.js 24.14.1
  • npm 11.11.0

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