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

Closed
opened 2026-02-16 17:41:24 -05:00 by yindo · 6 comments
Owner

Originally created by @GratefulDave on GitHub (Dec 22, 2025).

Originally assigned to: @thdxr on GitHub.

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

Originally created by @GratefulDave on GitHub (Dec 22, 2025). Originally assigned to: @thdxr on GitHub. ### 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** ```typescript 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_
yindo added the bug label 2026-02-16 17:41:24 -05:00
yindo closed this issue 2026-02-16 17:41:24 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

can u share ur skill plz?

@rekram1-node commented on GitHub (Dec 22, 2025): can u share ur skill plz?
Author
Owner

@GratefulDave commented on GitHub (Dec 22, 2025):

This resolved with your latest update.

@GratefulDave commented on GitHub (Dec 22, 2025): This resolved with your latest update.
Author
Owner

@malhashemi commented on GitHub (Dec 22, 2025):

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

@malhashemi commented on GitHub (Dec 22, 2025): 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
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

Yeah that was intentional i just disabled the claude ones

@rekram1-node commented on GitHub (Dec 22, 2025): Yeah that was intentional i just disabled the claude ones
Author
Owner

@malhashemi commented on GitHub (Dec 22, 2025):

@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!

@malhashemi commented on GitHub (Dec 22, 2025): @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!
Author
Owner

@malhashemi commented on GitHub (Dec 22, 2025):

@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

@malhashemi commented on GitHub (Dec 22, 2025): @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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3765