Skip to content

Bug: SkillInvalidError during frontmatter parsing in SKILL.md #5991

@GratefulDave

Description

@GratefulDave

Description

Description

PLEASE NOTE: This worked fine 12 hours ago, prior to one of your latest updates... I have even removed that skill and then the next skill has issues.... claude works fine.

An unhandled or validation-driven SkillInvalidError is triggered when loading a skill. The error occurs during the frontmatter parsing stage in src/skill/skill.ts. It appears that the SKILL.md file for the pair-programming skill contains frontmatter that does not conform to the Frontmatter schema (likely a Zod safeParse failure).

Error Details

  • Error Type: SkillInvalidError
  • Location: src/skill/skill.ts:110:13
  • Affected File: ~/.claude/skills/pair-programming/SKILL.md
  • Context: Frontmatter.safeParse(md.data) returned success: false.

Stack Trace / Logs

108 |     const parsed = Frontmatter.safeParse(md.data)
109 |     if (!parsed.success) {
110 |       throw new InvalidError({
                  ^
SkillInvalidError: SkillInvalidError
 data: {
  path: "/Users/{project_name}/PycharmProjects/lexgenius/.claude/skills/pair-programming/SKILL.md",
  issues: [
    [Object ...] // Validation issues in the markdown frontmatter
  ], 
},
      at load (src/skill/skill.ts:110:13)

Steps to Reproduce

  1. Run the opencode.
  2. The system attempts to load the pair-programming skill from .claude/skills/pair-programming/SKILL.md.
  3. The loader fails because the markdown frontmatter (YAML) is either missing required fields or has incorrect data types.
  4. This worked PRIOR to opencode's last update.

Possible Causes

  1. Malformed YAML: The frontmatter in SKILL.md has syntax errors.
  2. Schema Mismatch: The Frontmatter Zod schema in the codebase was updated, but the SKILL.md file was not updated to match.
  3. Empty Fields: Required fields like name, description, or version might be missing.

Proposed Solution

  • Inspect the issues array in the console log to identify specifically which field in the SKILL.md frontmatter is failing validation.
  • Update SKILL.md to match the required schema.
  • Add better error logging in src/skill/skill.ts to print the specific Zod validation errors (formatted) instead of just [Object ...].

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions