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

Aberta Para iniciantes
#66,970 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
tooling

Direção de pesquisa

A correção pertence ao ramo if (parsed._tag === "Parsed") do carregador de compatibilidade em packages/core/src/config/plugin/compatibility.ts, que atualmente descarta silenciosamente os resultados Skipped. Leia como agent.ts (por volta das linhas 153 e 175) e command.ts (por volta das linhas 142 e 150) registram um arquivo que existe mas não pode ser usado, e siga esse mesmo formato. Está concluído quando um aviso nomeia o arquivo e o motivo dos descartes de markdown e frontmatter, e um teste confirma que a mensagem aparece.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
228k
Forks
31k
Merge médio
5h 16min
PRs com merge (30d)
464

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de anomalyco/opencode

Todas as issues de anomalyco/opencode

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.