Skip to content

Instruction architecture

Resolve instruction precedence before editing

Section titled “Resolve instruction precedence before editing”

More specific applicable guidance can refine broader guidance; the current user request remains authoritative. Tool schemas and permissions are runtime constraints, not prose preferences.

Resolve instruction precedence before editing

User request

Project instructions

Global guidance

Selected skill

Role instructions

Tool schema and permissions

Wide diagrams scroll horizontally. Focus the figure to use arrow keys.

A project AGENTS.md can add a test route without replacing the requested phase. A role can narrow its assignment but cannot grant tools or bypass approval policy.

PurposeSourceTargetApply
Shared engineering guidanceagents-common.mdharness wrapperschezmoi apply
Shared voicevoice-common.mdCodex/OpenCode/Pi/Cursor directly; Claude output stylechezmoi apply
Codex global guidanceAGENTS.md.tmpl~/.codex/AGENTS.mdchezmoi apply ~/.codex/AGENTS.md
Claude global guidanceCLAUDE.md.tmpl~/.claude/CLAUDE.mdchezmoi apply ~/.claude/CLAUDE.md
Cursor global guidanceAGENTS.md.tmpl, cursor-agents.md~/.cursor/AGENTS.md, ~/.cursor/rules/personal.mdcchezmoi apply ~/.cursor/AGENTS.md
Codex roles/hooksagents, hooks.json~/.codex/agents/, ~/.codex/hooks.jsonbash install/codex.sh sync-config

The Codex installer owns generated role files and scopes. Do not edit deployed ~/.codex/agents/*.toml; see install/codex.sh and install/codex-config.py.

Put cross-project authorization, evidence, language, and failure behavior in the common partial; client behavior in a client wrapper; project conventions in project instructions; reusable procedures in skills. For example, keep this next to a Rust project:

## Validation
Run `cargo nextest run` after changing Rust behavior. Do not claim a physical-device result from the simulator.

Change and test an instruction deliberately

Section titled “Change and test an instruction deliberately”
  1. Name the target layer and realistic expected behavior.
  2. Edit one owner, render it, and inspect expansion/links.
  3. Compare baseline and candidate tasks with identical model, effort, inputs, and tools.
  4. Retain instruction fingerprint, artifacts, verifier result, usage, and parent rework.

Use writing-skills for meaningful comparisons. Prompt size or one successful sample does not establish quality, latency, or cost. Check current Codex configuration before new settings.