# Architecture: Ship the Factory Skill in the OpenCode Agent Image ## Fit - `Dockerfile` builds the immutable runtime image and will include the skill definition under `/usr/local/share/opencode/skills/software-factory/`. - `docker/entrypoint.sh` writes the ephemeral OpenCode user config and will configure the baked-in skills directory as an explicit skill source. This keeps discovery working even though `/home/opencode` is a tmpfs mount. - A versioned skill source in the repository is the source of truth; the installed skill remains read-only in the image. ## Endpoints None added. Existing authenticated `GET /api/skill` can verify that OpenCode discovers and advertises the skill. ## Data No database or persistent state. The skill Markdown is a build-time image asset. The runtime config pointing to it is recreated in the ephemeral home at startup. ## Flow 1. Docker builds the image and copies the repository's skill definition into `/usr/local/share/opencode/skills/software-factory/`. 2. Compose mounts the temporary home and starts `docker/entrypoint.sh`. 3. The entrypoint writes OpenCode config with the existing shell setting and the explicit baked-in skills directory. 4. OpenCode discovers `software-factory` and exposes it to the agent through its skill tool; the authenticated skill-list API can be used to verify availability. ## External None added. No new runtime environment variables, services, or third-party APIs.