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

  1. Contract. plugin.SkillDoc gains Data []byte (JSON data, base64): the bytes of a file that is not text. Content is then empty. A file is not text when it is not valid UTF-8 or holds a NUL byte (internal/skillfile, used by skilldir and manifest plugins).
  2. Workspace. localenv's write takes content_base64 instead of content for a binary file; exactly one of the two is given, with the same size limit and the same read-before-overwrite rule.
  3. Agent. Placing a skill's files writes a binary file with content_base64, within the same per-file and per-skill limits. load_skill of a binary file shows its size and where it is placed, not its bytes.
  4. Amended 2026-11-18 (P85). plugin.SkillDoc gains Version string (JSON version, optional), which changes whenever SKILL.md or any file of the skill changes (internal/skillfile hashes SKILL.md and each file's path, size and modification time). Loading a skill no longer places its files; the agent tool skill_files does, 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 data behaves as before; an old consumer sees an empty content for a binary file, as it would have seen garbled text.
  • ◆The Host passes SkillDoc through unchanged; no Host branch reads data.
  • ◆The model could write binary files with content_base64 too; it changes nothing it could not already do with bash.