Rules Compendium.AgentText

June 13, 2026 ยท View on GitHub

AgentText

PropertyValue
LanguageAgentText
GrammarEmbedded below
Added2026-06-12
Sprint task8.23

AgentText models AI agent and instruction text as RRSBS data that can be loaded from existing native files, stored with stable identity and minimal tool surfaces, and instantiated back into native adapters for Claude, Codex, GitHub Copilot, and future tools.

Purpose

The AgentText kind covers:

  • Agent identity and metadata.
  • Instruction body text in Markdown, TOML, or plain text.
  • Declared tool surfaces.
  • Ordered runbook steps.
  • Guardrails and return contracts.
  • Adapter targets and materialization mode.
  • Round-trip expectations, including byte-for-byte generated adapters and semantic-only normalization.

Primitives

PrimitiveBNF SymbolData typeRequiredDescription
AgentIdentityagent-identityobjectyesStable agent, skill, or instruction identity plus metadata.
InstructionBodyinstruction-bodymarkdown/toml/textyesSource instruction text to load or render.
ToolSurfacetool-surfacestring arraynoMinimal native tool declarations for the agent or skill.
RunbookSteprunbook-stepordered markdown listzero or moreExecutable or review steps.
Guardrailguardrailmarkdown listzero or moreSafety, ownership, and scope constraints.
ReturnContractreturn-contractschema referencenoStructured result shape expected by an orchestrator.
AdapterTargetadapter-targetobject arrayzero or moreNative output path, tool name, and materialization mode.
RoundTripPolicyround-trip-policyenumyesbyte-for-byte for generated adapters, semantic for normalized imports.

Inputs

PrimitiveInputTypeRequiredDefaultNotes
AgentIdentitySourceIdstringyesStable manifest or RRSBS identifier.
AgentIdentityDisplayNamestringnoHuman-readable title.
InstructionBodyBodystringyesRaw text after frontmatter normalization.
InstructionBodyBodyFormatstringyesmarkdownmarkdown, toml, or text.
ToolSurfaceToolsstring[]no[]Native names such as read, terminal, or agent/runSubagent.
RunbookStepSequenceKeystringyesOrdered key such as 001.
RunbookStepTextstringyesStep body.
GuardrailTextstringyesGuardrail body.
ReturnContractSchemaRefstringnoInline schema id or path.
AdapterTargetToolstringyesClaude, Codex, GitHub Copilot, or other adapter family.
AdapterTargetPathstringyesNative output path relative to the consuming repo.
AdapterTargetMaterializationstringyescopycopy, symlink, junction, or generated-wrapper.
AdapterTargetRenderedSha256stringnoExpected rendered hash.
RoundTripPolicyPolicystringyessemanticbyte-for-byte or semantic.

Composition

PosPrimitiveCardinalityOptional
1AgentIdentity1no
2InstructionBody1no
3ToolSurface?yes
4RunbookStep*yes
5Guardrail*yes
6ReturnContract?yes
7AdapterTarget*yes
8RoundTripPolicy1no

Grammar

# AgentText.grammar.ebnf
# Language: AgentText
# Kind: AgentText
# Created: 2026-06-12
# Description: Agent and instruction text model for loading, storing, and rendering AI tool adapters.

agent-text-document     ::= agent-identity instruction-body tool-surface? runbook-step* guardrail* return-contract? adapter-target* round-trip-policy

# --- Primitive definitions ---
agent-identity          ::= "agent" identifier metadata*
instruction-body        ::= markdown-block | toml-block | text-block
tool-surface            ::= "tools" "[" tool-name ("," tool-name)* "]"
runbook-step            ::= "step" integer ":" markdown-block
guardrail               ::= "guardrail" ":" markdown-block
return-contract         ::= "returns" json-schema-ref
adapter-target          ::= "target" tool-name path materialization-mode rendered-hash?
round-trip-policy       ::= "roundtrip" ("byte-for-byte" | "semantic")

metadata                ::= identifier "=" quoted-string
identifier              ::= letter (letter | digit | "-" | "_" | ".")*
tool-name               ::= identifier ("/" identifier)?
path                    ::= quoted-string
materialization-mode    ::= "copy" | "symlink" | "junction" | "generated-wrapper"
rendered-hash           ::= "sha256:" hex-digit{64}
json-schema-ref         ::= quoted-string
markdown-block          ::= fenced-markdown | quoted-string
toml-block              ::= fenced-toml | quoted-string
text-block              ::= quoted-string

Round-Trip Rules

Generated adapters are expected to round-trip byte-for-byte when the source manifest owns the output. Imported legacy files may round-trip semantically until their frontmatter, whitespace, and generated headers have been normalized and documented.

Pilot Files

The Sprint 0008 pilot loads and exports:

  • SharedVSCode/.ai/manifests/instruction-map.json
  • SharedVSCode/.ai/agents/claude/version-control-commit.agent.md
  • SharedVSCode/.ai/agents/codex/version-control-commit.toml
  • SharedVSCode/.ai/languages/powershell.instructions.md
  • SharedVSCode/.ai/skills/codex/git-commit/SKILL.md

Examples

agent version-control-commit kind="CodexCustomAgentSource"
tools ["terminal", "read"]
target "Codex" ".codex/agents/version-control-commit.toml" "copy"
roundtrip byte-for-byte
agent powershell-language-rule kind="LanguageRule"
target "GitHub Copilot" ".github/instructions/Powershell.instructions.md" "copy"
target "Claude" ".claude/Rules/Powershell.md" "generated-wrapper"
roundtrip semantic