agents

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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).

View Source
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

func CheckClaude(h *config.Host, installRoot string) error

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

func Stale(repoRoot string, h *config.Host) ([]string, error)

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

func Write(repoRoot string, files []File) error

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.

Types

type File

type File struct {
	Name    string
	Content []byte
}

File is one rendered agent TOML: Name is the file stem (e.g. "orch-scout", no extension), Content its fully substituted bytes.

func Render

func Render(h *config.Host) ([]File, error)

Render produces the five agent TOMLs for h's roles, in roleFiles order. h must not be nil — the caller (`orch render-agents`) fails closed before calling Render when hosts.codex is not enabled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL