Ship a form OpenCode loads from its system directory #268

Closed
opened 2026-12-01 15:35:11 +01:00 by motoko · 0 comments
Collaborator

Agent Foundry could ship in a form OpenCode loads from its system
directory, so a repository gets the policy, skills, subagents, and hooks
without holding any foundry file and without an umbrella repository.

Scenario

https://git.unitoo.it/claudiomaradonna/ministry launches bots on
OpenCode through Azkaban, on repositories that should stay free of agent
files. It can mount one read-only folder per project at /etc/opencode,
which OpenCode reads on Linux beside the project's own configuration and
above it.

Evidence

Tried on 2026-12-01 with OpenCode 2.4.2 in Azkaban's container, a folder
mounted read-only at /etc/opencode:

  • a file named in the instructions array of its opencode.json
    reached the model, with no tool call;
  • a skill under its skills/ was listed and loaded;
  • its MCP servers connected, and its mcp.use policies removed a server
    the workspace's own opencode.json added.

Not tried: its agents/ and plugins/ folders, which
https://opencode.ai/docs/config/ says it loads too.

What stands in the way

Seen at 7e74699f3e7e7502f5247fa6c6c862179016628a:

  • skills and the OpenCode plugins name .agents/scripts/,
    .agents/templates/, and .agents/hooks/ by their path in the
    repository;
  • AGENTS.md holds the policy together with the project's facts,
    Architecture and How to interact with the project, which a mounted
    file cannot hold;
  • .plans/ and .worktrees/ count on the repository's .gitignore;
  • the Verify command and foundry-upgrade's Record assume the files
    are tracked in the repository.

Smallest change

A build that lays the foundry out as that folder: opencode.json with
the policy as instructions, skills/, agents/, plugins/, and the
scripts, templates, and hooks at a path the skills resolve from their
own folder. Claude Code and Codex keep the forms they have.

Agent Foundry could ship in a form OpenCode loads from its system directory, so a repository gets the policy, skills, subagents, and hooks without holding any foundry file and without an umbrella repository. ## Scenario <https://git.unitoo.it/claudiomaradonna/ministry> launches bots on OpenCode through Azkaban, on repositories that should stay free of agent files. It can mount one read-only folder per project at `/etc/opencode`, which OpenCode reads on Linux beside the project's own configuration and above it. ## Evidence Tried on 2026-12-01 with OpenCode 2.4.2 in Azkaban's container, a folder mounted read-only at `/etc/opencode`: - a file named in the `instructions` array of its `opencode.json` reached the model, with no tool call; - a skill under its `skills/` was listed and loaded; - its MCP servers connected, and its `mcp.use` policies removed a server the workspace's own `opencode.json` added. Not tried: its `agents/` and `plugins/` folders, which <https://opencode.ai/docs/config/> says it loads too. ## What stands in the way Seen at `7e74699f3e7e7502f5247fa6c6c862179016628a`: - skills and the OpenCode plugins name `.agents/scripts/`, `.agents/templates/`, and `.agents/hooks/` by their path in the repository; - `AGENTS.md` holds the policy together with the project's facts, Architecture and How to interact with the project, which a mounted file cannot hold; - `.plans/` and `.worktrees/` count on the repository's `.gitignore`; - the Verify command and `foundry-upgrade`'s Record assume the files are tracked in the repository. ## Smallest change A build that lays the foundry out as that folder: `opencode.json` with the policy as `instructions`, `skills/`, `agents/`, `plugins/`, and the scripts, templates, and hooks at a path the skills resolve from their own folder. Claude Code and Codex keep the forms they have.
Sign in to join this conversation.
No description provided.