skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log

オープン 初心者向け
#66,970 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
tooling

調査の方向性

修正は packages/core/src/config/plugin/compatibility.ts の互換性ローダーにある if (parsed._tag === "Parsed") のブランチに入れてください。現在このブランチは Skipped の結果を黙って破棄しています。agent.ts(153行目と175行目付近)と command.ts(142行目と150行目付近)が、存在するが使用できないファイルをどのように記録しているかを読み、同じ形式に合わせてください。markdown と frontmatter のスキップについて、警告にファイル名と理由が含まれ、テストでそのメッセージが表示されることを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area/plugins platform/linux reproduced type/bug version/v2

Summary

The compatibility loader reads SKILL.md files from Claude and agent skill roots (packages/core/src/config/plugin/compatibility.ts). When SkillFile.parse returns Skipped, the file is simply not added to the loaded map:

const parsed = SkillFile.parse(resolved, filepath, content)
if (parsed._tag === "Parsed") loaded.set(parsed.skill.id, parsed.skill)

There is no log call on the other branch, so a skill that exists but cannot be parsed disappears without a trace at every log level, including DEBUG. The model then works without instructions the user believes are loaded.

This is the same symptom as #66716, which covers the native skill loader (skill.ts, which logs the skip at logDebug). This loader is the only one of the three that reports nothing at all.

Environment

  • opencode version: 2.4.2, and dev at 2204311e
  • Client: TUI / shared service
  • Model and provider: Not relevant
  • OS: Linux 6.x x86_64
  • Terminal: xterm-kitty, truecolor
  • Shell: /bin/bash
  • Install/channel: latest (release)
  • Active plugins: none related

Reproduction

  1. Create a skill under a compatibility root, for example ~/.claude/skills/repro/SKILL.md, with frontmatter that parses as YAML but does not decode into the expected shape:

    ---
    name: repro
    description: [not, a, string]
    ---
    body
    
  2. Make sure that root is part of compatibility.claude so ConfigCompatibilityPlugin scans it.

  3. Start opencode and open the skills list (/skills).

  4. The skill is absent.

  5. Search the log for the path: there is no line naming the file, at the default level or with OPENCODE_LOG_LEVEL=DEBUG.

Expected Behavior

A warning that names the file and the reason it was skipped, in the same shape the other two loaders already use for a file that exists but cannot be used (agent.ts:153/agent.ts:175, command.ts:142/command.ts:150). Both skip reasons should be reported, since both mean the file was found and then dropped.

Actual Behavior

No log output at any level; the skill is silently missing from the catalog.

Additional Context

SkillFile.parse returns { _tag: "Skipped", reason: "markdown" } when the frontmatter block cannot be read at all, and { _tag: "Skipped", reason: "frontmatter", issue } when it decodes into the wrong shape. Both are currently discarded by the if above.

主要言語
TypeScript
スター
228k
フォーク
31k
平均マージ
5時間 16分
マージ済み PR(30日)
464

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。