Repository navigation
Description
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
- Agent sync reads source bytes and writes them verbatim —
internal/sync/agent_sync.go:233-276(copy) andinternal/sync/agent_sync.go:88-158(symlink/merge). No per-target transform. - The only frontmatter ever read are
nameandtargets—internal/resource/agent.go:109-110, 160-168. - Validation never inspects frontmatter content — only filename, extension, and size —
internal/validate/agent.go:26-42. - OpenCode is a supported agent target defined solely by directory paths —
internal/config/targets.yaml:233-239. The docs list it alongside Claude/Cursor/Augment —website/docs/understand/agents.md:100-112. - The docs present one generic markdown format for all targets —
website/docs/understand/agents.md:74-87.
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
extensionfield 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, butname:is silently dropped) - mode → defaults to
all, making a review subagent appear as a Tab-selectable primary agent - model
sonnet→ not aprovider/model-id, can't resolve - tools
Read, Write, Bash(git log)→ camelCase doesn't match lowercaseread/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
- 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) doctor/checkshould warn when an agent's frontmatter won't map to a target's schema (nomodefor OpenCode → defaults toall)- The agents docs should stop implying one generic
.mdformat works for every supported target%
Activity
fix(sync): honour agent frontmatter targets when syncing agents
runkids commentedon Sep 2, 2026
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:vstools:), 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 honourtargets:the same way skills honourmetadata.targets, in CLI sync (global + project), the dashboard sync,doctor, and the target summary.Omitting
targets:keeps today's behaviour (sync everywhere). Aliases work (claude-codematchesclaude). Docs:understand/agents.mdandreference/filtering.mdnow say frontmatter is passed through verbatim and point totargets: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
agents:targets — agreed, and the plan is exactly what you describe: reuse the extrasextensionmechanism on agent targets (same copy-only contract, same resolver) rather than a parallel translator system, plus a bundledopencode-agentsextension (tools→ lowercase,model→provider/model, defaultmode: subagent). That's tracked with feat: per-target agent frontmatter transformation during sync #241; I'll link the PR here when it's up.doctor/checkwarning 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..mdworks 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.feat(agents): convert agents with a target extension
feat(ui): set an agent target's extension from the target page
docs(agents): document converting agents with an extension
feat(ui): tag targets that convert agents in the targets list
runkids commentedon Sep 21, 2026
This is in v0.21.2 🎉
A target's
agentsblock now takes anextension, which converts each agent while it syncs:The new built-in
opencode-agentsconverts Claude-style agents for OpenCode.codex-agentsworks here too. You can also pointextensionat 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 guessedpermission:block. For those, a per-harness variant withtargets: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.