Skip to main content

Module instruction_provider

Module instruction_provider 

Source
Expand description

InstructionProvider and RuleProvider — where the project’s standing instructions come from.

Two things reach the model without anyone asking for them: the instruction file (AGENTS.md / CLAUDE.md), injected verbatim, and the .agix/rules/ index, advertised by name and first line so the model knows the documents exist. Both were a fixed answer to a question a deployment may answer differently — one path out of settings.prompt.instruction_files, and three directory tiers written into the discovery function. A host whose conventions live in a service, a monorepo tool that composes its own tier list, or an embedder with no filesystem at all had nothing to replace.

The two stay separate contracts because they are read differently: instruction documents are content that goes into the prompt, rules are an index whose content is deliberately not loaded until the model asks for it. The sources that read files (InstructionFile, RuleDirectory) live in prompt_files; what is here is the contract and the in-memory ones.

Structs§

InlineInstructions
Instructions the host already has in memory.
InstructionDoc
One standing-instruction document.
StaticRules
Rules the host already knows about.

Traits§

InstructionProvider
A place standing instructions come from.
RuleProvider
A place rule documents come from.