OFTR-003: Agents and Resolution
Synced from
outfitter/docs/requirements/OFTR-003-profiles.md. The repository is the source of truth.
Amendment (2026-07-17, RFC #165): Profiles fold into agents. Authored
profile.ymlfiles, profile-era inheritance,templateprofiles, andprofile_exportare removed; agent inheritance is declared byinheritsinagents/<id>/agent.mdfrontmatter. An agent may also have an optionalconfig.jsonand resolves by slug across.agentslayers with merge-by-ID. Section IDs are preserved for pinned-test traceability. Target design: docs/documentation/agents.md and docs/architecture/README.md.
Overview
Section titled “Overview”An agent is the protocol’s identity resource and the thing Outfitter runs.
Outfitter resolves agents and other resources from layered .agents trees into one immutable effective resource set that every command shares.
Requirements
Section titled “Requirements”OFTR-003.1: Agent Resource Layout
Section titled “OFTR-003.1: Agent Resource Layout”- An agent MUST be represented by a directory
agents/<id>/containing a requiredagent.mdfile. agent.mdMUST begin with a---YAML frontmatter block declaring at leastname.- An agent directory MAY contain an optional
config.jsoncarrying structured loadout overrides. - Outfitter MUST provide a JSON Schema for
agent.mdfrontmatter and validate every loaded agent against it. - A skill MAY be catalog-wide at
skills/<id>/SKILL.mdor private to one agent atagents/<agent-id>/skills/<id>/SKILL.md; knowledge and commands remain separate protocol resources underknowledge/andcommands/. agents/<agent-id>/hooks/<id>/is reserved for a future portable hook entity and MUST NOT be interpreted as a skill.
OFTR-003.2: Agent Identity
Section titled “OFTR-003.2: Agent Identity”- Agent IDs MUST be filesystem-safe slugs matching
^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)*$, at most 64 characters. Dots MAY group profiles by namespace convention (for example,environment.agent-operator-podorenvironment.sample), while plain hyphenated slugs remain valid. A dot has naming significance only: it MUST NOT imply hierarchy, wildcard matching, or inheritance. - The agent’s frontmatter
nameMUST match its directory ID; a mismatch MUST be a validation error. - Agents MAY include a
descriptionused by discovery surfaces.
OFTR-003.3: Layer Precedence
Section titled “OFTR-003.3: Layer Precedence”- Outfitter MUST resolve resources from layered
.agentstrees ordered highest precedence first: workspace<project>/.agents, then global~/.agents, then configuredsourcesin order. - Only layers whose payload root exists on disk are included.
- A local
pathsource’s payload root is the directory itself; a remote source’s root is its synced cache directory plus any configured subpath.
OFTR-003.4: Merge by ID
Section titled “OFTR-003.4: Merge by ID”- Resources MUST merge by ID across layers: the highest-precedence definition of a slug wins and replaces lower ones. Markdown resources are not partially merged.
- Per-agent
config.jsonMUST shallow-merge by key over theagent.mdfrontmatter loadout for the same agent directory. - Legacy profile inheritance MUST NOT be restored; agent inheritance follows OFTR-003.9 and shared context lives in tree-level
system-prompt.md/agents.md. - Agent-local resources MUST merge by owner and ID across layers before catalog-wide fallback is considered.
- An agent-local skill MAY shadow a catalog-wide skill for its owner without being reported as a catalog collision.
OFTR-003.5: Effective Resource Set
Section titled “OFTR-003.5: Effective Resource Set”- Outfitter MUST produce one immutable effective resource set per invocation mapping every slug to its winning definition.
- Lower-precedence definitions that a winner shadows MUST be retained for diagnostics.
list,validate,run, anddumpMUST consume the same effective resource set produced by a single shared resolver.- The effective resource set MUST retain agent ownership for local resources so equal local IDs under different agents remain distinct.
OFTR-003.6: Loadout
Section titled “OFTR-003.6: Loadout”- An agent’s frontmatter/
config.jsonMAY declare a loadout:skills,subagents,mcp,extensions,plugins,model,thinking, andtools. - A skill loadout entry MUST resolve first against the owning agent’s local skill namespace across layers, then against catalog-wide skills across layers.
- An agent-local skill MUST be invisible to other agents unless they define their own local skill of that ID or a catalog-wide fallback exists.
- Settings MUST NOT carry loadout selections.
OFTR-003.7: Resolution Validation
Section titled “OFTR-003.7: Resolution Validation”- Outfitter MUST report an error when an agent’s loadout references a
skillsorsubagentsslug that does not resolve. - Outfitter MUST report a warning when a resource shadows a lower-precedence definition of the same slug.
outfitter validate --strictMUST treat warnings as failures.- Validation MUST parse every discovered agent-local skill and report malformed definitions, name/directory mismatches, and local resources without a resolvable owning agent.
OFTR-003.8: Listing Resources
Section titled “OFTR-003.8: Listing Resources”outfitter listMUST list resolvable resources by kind from the effective resource set.outfitter list <kind>MUST restrict output to one kind ofagents,skills,knowledge, orcommandsand MUST reject unknown kinds.- Listed resources MUST report the winning layer for each slug deterministically.
outfitter list skills --agent <id>MUST show the agent’s local-first effective skill view and distinguish agent-local winners.
OFTR-003.9: Agent Inheritance Graph
Section titled “OFTR-003.9: Agent Inheritance Graph”agent.mdfrontmatter MAY declareinheritsas one parent slug or an ordered non-empty list of parent slugs.- Outfitter MUST resolve every inherited parent through the same effective layered resource set used for the selected child.
- Inheritance traversal MUST be recursive, parent-first, and left-to-right for multiple parents.
- A diamond inheritance graph MUST compose each ancestor once in deterministic first-encounter order.
- Missing parents, self-inheritance, and direct or indirect cycles MUST fail validation and composition with the relevant chain.
- Inheritance MUST extend the
.agentsagent model and MUST NOT reintroduce.outfitter/profiles,profile.yml, profile templates, or legacy profile readers.
OFTR-003.10: Inherited Merge Policy
Section titled “OFTR-003.10: Inherited Merge Policy”- Agent Markdown bodies MUST compose ancestor-first and selected-child-last.
skills,subagents,mcp,extensions,plugins, andappend_system_promptMUST use stable parent-first de-duplication.system_prompt,prompt_template,model,thinking,label, anddescriptionMUST use the nearest child declaration.tools.allowandtools.denyMUST union stably; denied tools MUST win when projected.- Outfitter MUST retain declaring-agent provenance for inherited selections so parent-local skills and configuration resolve against the parent that declared them.
- Inheritance MUST NOT support subtraction syntax or arbitrary per-field merge operators.
OFTR-003.11: Prompt Source Controls
Section titled “OFTR-003.11: Prompt Source Controls”system_prompt,append_system_prompt, andprompt_templateMUST accept only explicit prompt source objects using exactly one offileorrepo_file.fileprompt sources MUST resolve relative to the.agentslayer that owns the declaring agent and MUST fail on missing files, directories, path traversal, absolute paths, unsafe symlink targets, and reads outside that layer.repo_fileprompt sources MUST resolve relative to the active project root, MUST remain contained after symlink resolution, and MUST be attributed as untrusted repository content.- Missing optional
repo_fileprompt fragments SHOULD produce observable composition warnings instead of making reusable catalog agents fail across repositories. - Prompt fragments MUST retain source kind, path or reference, declaring agent, owning layer, content, order, and trust provenance in the composition plan.
- Named prompt slug shorthand MUST NOT be accepted until its namespace, layer semantics, protocol compatibility, and dump behavior are specified in these requirements.