Skip to content

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

Closed

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

Activity

  1. rekram1-node commented on Dec 22, 2025

    @rekram1-node
    Collaborator

    can u share ur skill plz?

  2. GratefulDave commented on Dec 22, 2025

    @GratefulDave
    Author

    This resolved with your latest update.

  3. malhashemi commented on Dec 22, 2025

    @malhashemi
    Contributor

    Hey @rekram1-node I think I found the skill that is causing the crash, that is https://github.com/ruvnet/claude-flow/blob/87cc5634085b4696daba0bd2e63c09745aa0b90b/.claude/skills/pair-programming/SKILL.md?plain=1 it only worked after your update cause you are not reading from claude directory. If that skill gets moved to .opencode/skills it would still crash opencode. I am investigating the validation logic

  4. rekram1-node commented on Dec 22, 2025

    @rekram1-node
    Collaborator

    Yeah that was intentional i just disabled the claude ones

  5. malhashemi commented on Dec 22, 2025

    @malhashemi
    Contributor

    @GratefulDave The issue is not with OpenCode implementation it is with ClaudeCode not following their own standards in validating skill

    From https://agentskills.io/specification#name-field

    The required name field:
    
        Must be 1-64 characters
        May only contain unicode lowercase alphanumeric characters and hyphens (a-z and -)
        Must not start or end with -
        Must not contain consecutive hyphens (--)
        Must match the parent directory name
    

    The skill you are referring to is using name: Pair Programming but it seems CC does not enforce the specs!

  6. malhashemi commented on Dec 22, 2025

    @malhashemi
    Contributor

    @rekram1-node / @thdxr this could cause many skills coming from Claude to crash, if you have connections in Anthropic, they either enforce the specs in CC or adjust the name field in the specs to allow for spaces. Or we just loosen the validation on OpenCode side not following the specs similar to them haha

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

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