ADR 0008doc/{zh,en}/adr/0008-binary-skill-files.md
ADR 0008: Binary Skill Files
Status: accepted, 2026-11-18 (P36; the owner chose to build it the same day).
Status: accepted, 2026-11-18 (P36; the owner chose to build it the same day).
Context
When a skill loads, its files are placed in the workspace under .orquelo/skills/<name>/ through the write tool, so its scripts can run (P36, built for text). Some published skills ship binary files: fonts, document templates, images. SkillDoc.Content is a string, so a skill source handed such a file over as text; over a process plugin's JSON-RPC it would be corrupted, and write takes text only. Such files were skipped with a note.
Decision
- Contract.
plugin.SkillDocgainsData []byte(JSONdata, base64): the bytes of a file that is not text.Contentis then empty. A file is not text when it is not valid UTF-8 or holds a NUL byte (internal/skillfile, used byskilldirand manifest plugins). - Workspace.
localenv'swritetakescontent_base64instead ofcontentfor a binary file; exactly one of the two is given, with the same size limit and the same read-before-overwrite rule. - Agent. Placing a skill's files writes a binary file with
content_base64, within the same per-file and per-skill limits.load_skillof a binary file shows its size and where it is placed, not its bytes. - Amended 2026-11-18 (P85).
plugin.SkillDocgainsVersion string(JSONversion, optional), which changes wheneverSKILL.mdor any file of the skill changes (internal/skillfilehashesSKILL.mdand each file's path, size and modification time). Loading a skill no longer places its files; the agent toolskill_filesdoes, under a folder per version, and refuses a skill whose version changed since the run loaded it. A source that sends no version still works; its files are placed without one.
Consequences
- ◆JSON stays compatible: a source that never fills
databehaves as before; an old consumer sees an emptycontentfor a binary file, as it would have seen garbled text. - ◆The Host passes
SkillDocthrough unchanged; no Host branch readsdata. - ◆The model could write binary files with
content_base64too; it changes nothing it could not already do withbash.