Documentation
¶
Overview ¶
Package agents renders the five Codex agent TOMLs `orch render-agents` writes into <repo>/.codex/agents/ (PRD §22): each file's model and model_reasoning_effort are substituted from the effective configuration's hosts.codex.roles, but the surrounding body — name, description, developer_instructions — is the canonical shipped text embedded from adapters/codex/agents/*.toml (adapters/codex/embed.go's AgentTOMLs). That embed is the one source of truth: this package never carries its own copy of the prose, so the shipped plugin files and this package's rendered output cannot silently diverge from one another.
CheckClaude (claude.go) is the one Claude-side member: a read-only comparison of the installed Claude agent definitions' pinned models against the same effective configuration, for `orch doctor`. It shares roleFiles and profileFor with the Codex rendering above because both hosts name their five definitions identically; it renders and writes nothing.
Index ¶
Constants ¶
const ClaudeAgentsSubdir = "agents"
ClaudeAgentsSubdir is the subdirectory of the installed Claude plugin root that holds the agent definitions, as the plugin lays them out (adapters/claude/agents/*.md).
const Dir = ".codex/agents"
Dir is the repo-relative, slash-form destination directory `orch render-agents` writes into. It is a machine-local artifact (like config.local.toml), not a committed one: a repository's own .gitignore, not this package, decides whether it is tracked.
Variables ¶
This section is empty.
Functions ¶
func CheckClaude ¶ added in v0.6.1
CheckClaude compares the model h gives each of the five roles that ship a Claude agent definition against the model the installed definition for that role pins in its frontmatter, and returns an error naming every role whose two models differ. installRoot is the install path the Claude CLI's own plugin listing reports for the Orch Claude plugin; the definitions live in its ClaudeAgentsSubdir. The architect has no agent definition (the Architect is the host session itself, never a dispatched agent) and so is not compared.
This is a read-only report: unlike the Codex side, nothing here renders or writes a Claude agent file, so a mismatch is reconciled by updating the installed plugin or the configuration, not by a render verb. It fails closed — an empty installRoot, an absent agents directory, an unreadable definition, and a definition carrying no model are each an error, never a pass.
func Stale ¶ added in v0.6.0
Stale reports every file Write would produce that is absent, unreadable, or byte-different from Render's current output. Paths are repo-relative and slash-form; read errors are joined after every expected file has been checked so callers can name all bad files.
func Write ¶
Write atomically writes each of files into repoRoot's Dir, creating the directory if absent and overwriting any existing file: a temp file in the same directory, synced, then renamed over the destination (internal/config.WriteLocal's shape, which also replaces atomically on Windows). On any single file's failure the files written before it are left in place; the failing file's own prior content, if any, is left untouched and its temp file removed on a best-effort basis.