What is a facet?
A facet is a self-contained bundle that adds capabilities to an AI coding assistant. Each facet can include any combination of:| Resource | Purpose | Installed to |
|---|---|---|
| Skills | Domain-specific instructions and workflows | .opencode/skills/<name>/SKILL.md |
| Agents | Specialized agent prompts with tool permissions | .opencode/agents/<name>.md |
| Commands | Custom slash commands | .opencode/commands/<name>.md |
| Tools | TypeScript tool implementations | .opencode/tools/<name>.ts |
The manifest
Every facet is defined by afacet.yaml manifest. This is the single source of truth for what a facet contains and how it should be installed.
Local vs remote facets
Facets can come from two sources:- Remote — Fetched from a URL and cached locally. Declared in
facets.yamlunderremote:with a URL and optional version pin. - Local — Stored directly in your project at
.facets/<name>/. Declared infacets.yamlunderlocal:. Useful for facets you’re developing or that are project-specific.
The cache
When youfacets add a remote facet, it’s cached to ~/.cache/facets/<name>/. The cache stores the manifest and all referenced resource files. This means subsequent installs don’t need network access.
The cache is global across all projects. Use facets cache clear to wipe it.
Project registry
Your project tracks facet dependencies in two files inside.opencode/:
facets.yaml
The dependency declaration file. Lists which facets your project uses:
facets.lock
The lock file. Records the exact version and integrity hash (SHA-256) of each remote facet:
Installation lifecycle
When you runfacets install, this is what happens:
- Resolve — Find the facet directory (local
.facets/<name>/first, then cache~/.cache/facets/<name>/) - Load — Read and validate
facet.yaml - Prereq check — If the manifest declares
requires, prompt for approval and run each command (e.g.gh --version). Results are cached so you’re only asked once. - Copy resources — Materialize files into
.opencode/:- Skills are copied verbatim
- Agents and commands get YAML frontmatter assembled from the manifest descriptor
- Tools are copied verbatim