Skip to content

Agent sync copies .md verbatim to every target, but different harnesses require different formats #267

Closed

Description

@r-fynn

Problem

Skillshare syncs agents as byte-for-byte copies/symlinks with no per-target format conversion. Since agents have no shared schema (unlike SKILL.md), an agent authored for one harness arrives at every other harness in its original format.

Codebase evidence

The codebase knows agents need conversion — but only for extras targets

"Some tools do not read markdown. Gemini CLI expects TOML commands; Codex CLI expects TOML agents. The extension field on a target runs an external script that converts each source file into the target's native format during sync." — website/docs/reference/commands/extras.md:279-298

The reference codex-agents extension maps only the 3 fields Codex's TOML schema accepts and drops the rest — extensions/codex-agents/convert.js:4-30. This proves the codebase already recognizes the problem — but the fix only works for extras targets. Native agents: targets get no such treatment.

Format gap per harness

Field Claude Code (~/.claude/agents/) OpenCode (~/.config/opencode/agents/) Codex CLI (.codex/agents/*.toml)
Name name: in frontmatter (required) Filename only — name: ignored name in TOML (required)
mode not a field primary | subagent | all, defaults to all not applicable
model alias sonnet/opus/haiku or full ID provider/model-id only via config.toml, not per-agent
tools camelCase (Read, Write, Bash(...)) lowercase (read, write, bash); deprecated not per-agent
permission default / acceptEdits / auto / bypassPermissions / plan object keyed by tool → allow | ask | deny not per-agent
Extra fields disallowedTools, maxTurns, memory, hooks, initialPrompt prompt, temperature, steps, hidden, color, top_p developer_instructions (required, maps from body)

Concrete walkthrough

An agent authored for Claude in ~/.config/skillshare/agents/code-reviewer.md:

---
name: code-reviewer
description: Reviews code for quality
tools: Read, Write, Bash(git log)
model: sonnet
---

After skillshare sync this file sits verbatim at ~/.config/opencode/agents/code-reviewer.md. OpenCode reads:

  • name from filename → code-reviewer (OK here, but name: is silently dropped)
  • mode → defaults to all, making a review subagent appear as a Tab-selectable primary agent
  • model sonnet → not a provider/model-id, can't resolve
  • tools Read, Write, Bash(git log) → camelCase doesn't match lowercase read/write/bash

A "sync succeeded" produces a file OpenCode either misconfigures or ignores. The reverse direction (skillshare collect agents) has the same problem pulling files back.

Suggested direction

  1. Native agent targets should support format conversion the way extras targets already do via extensions (reuse the extension mechanism on agents: targets, or add per-target agent translators)
  2. doctor/check should warn when an agent's frontmatter won't map to a target's schema (no mode for OpenCode → defaults to all)
  3. The agents docs should stop implying one generic .md format works for every supported target%

Activity

  1. self-assigned this
    on Sep 2, 2026
  2. runkids commented on Sep 2, 2026

    @runkids
    Owner

    Thanks for the thorough write-up — the codebase references all check out, and this is a real gap. It's also the fourth report pointing at the same capability (#170 Codex agents, #136 Gemini commands, #241 OpenCode permission: vs tools:), so it's clearly not a one-off.

    What landed now (e780fbf)

    Agent discovery already parsed a targets: list from agent frontmatter, but no sync path ever applied it — so there was no way to keep a per-harness variant of the same agent. That's fixed: agents now honour targets: the same way skills honour metadata.targets, in CLI sync (global + project), the dashboard sync, doctor, and the target summary.

    # ~/.config/skillshare/agents/code-reviewer.md
    ---
    name: code-reviewer
    targets: [claude]
    tools: Read, Write, Bash(git log)
    model: sonnet
    ---
    
    # ~/.config/skillshare/agents/code-reviewer-opencode.md
    ---
    targets: [opencode]
    mode: subagent
    model: anthropic/claude-sonnet-4-5
    permission: { read: allow, write: allow, bash: ask }
    ---

    Omitting targets: keeps today's behaviour (sync everywhere). Aliases work (claude-code matches claude). Docs: understand/agents.md and reference/filtering.md now say frontmatter is passed through verbatim and point to targets: for per-harness variants. It's not conversion, but it stops "sync succeeded" from landing an unusable file, and it's a one-file-per-harness escape hatch that works today.

    On your suggestions

    1. Format conversion for native agents: targets — agreed, and the plan is exactly what you describe: reuse the extras extension mechanism on agent targets (same copy-only contract, same resolver) rather than a parallel translator system, plus a bundled opencode-agents extension (tools → lowercase, model → provider/model, default mode: subagent). That's tracked with feat: per-target agent frontmatter transformation during sync #241; I'll link the PR here when it's up.
    2. doctor/check warning on schema mismatch — I'm going to hold off on this. Six harness schemas that each shift every few months is a maintenance treadmill, and once (1) lands, a failing transform already surfaces the exact field that doesn't map.
    3. Docs implying one generic .md works everywhere — fixed in the commit above.

    Leaving this open until (1) ships. If the targets: escape hatch unblocks you in the meantime, let me know how it goes.

  3. runkids commented on Sep 21, 2026

    @runkids
    Owner

    This is in v0.21.2 🎉

    A target's agents block now takes an extension, which converts each agent while it syncs:

    targets:
      opencode:
        agents:
          extension: opencode-agents

    The new built-in opencode-agents converts Claude-style agents for OpenCode. codex-agents works here too. You can also point extension at your own script if your agents need a different mapping.

    It's conservative on purpose: an agent that restricts its tools (tools, disallowedTools, permissionMode) fails to convert rather than getting a guessed permission: block. For those, a per-harness variant with targets: is still the safe path.

    Docs: https://skillshare.runkids.cc/docs/understand/agents#extensions

    Thanks again for the detailed report! Let me know if this works for your setup.

  4. added
    awaiting-reply
    feature
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

awaiting-replyfeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions