Structured standards your AI tools can understand
Contexts are the atomic unit of ContextRail — structured documents that capture one standard, decision, or pattern so AI tools can retrieve and enforce it automatically.
Anatomy of a context
Every context is composed of six sections. Each section serves a specific role in retrieval and enforcement.
Unique URI used for retrieval, dependency linking, and search.
Gives agents and teammates instant context without reading everything.
Strict MUST/NEVER rules agents parse and enforce in every code review.
Ground-truth examples the agent can cite or copy.
Ordered steps for implementation or verification.
Related contexts the agent should load alongside this one.
What makes a good context
Follow these practices to write contexts that agents retrieve reliably and teams trust.
One standard or decision per context. Narrow scope means better retrieval precision.
A named owner and review cadence keeps standards from going stale.
Write imperatives that are testable, not vague advice. "MUST use X" beats "prefer X."
Show the preferred pattern and common edge cases so agents can cite real code.
Add related contexts so agents can follow the standards chain automatically.
Use your org's tagging taxonomy so search and filters return predictable results.
Creating your first context
Follow these steps to publish a context and start enforcing it through your AI tools.
Identify a single standard, decision, or pattern. Give it a clear domain and subdomain — for example, development/frontend or design/language.
List the rules your team must follow as MUST/NEVER statements. Keep each rule specific and testable.
Paste the canonical code or config snippet that shows the right pattern. Add a counter-example if the wrong pattern is common.
Link any related contexts so agents automatically load the full chain of relevant standards.
Save the context and confirm it appears in search with the right tags and domain. Ask your AI tool to retrieve it and verify the output.
- The context appears in the Contexts list with correct tags and domain.
- Your AI tool retrieves the context and references its imperatives in responses.
- Dependencies resolve and linked contexts load alongside this one.
- Not searchable: check that tags, domain, and subdomain are set correctly.
- Not retrieved: confirm your AI tool is connected to the right organization and token.
- Rules not enforced: ensure imperatives use the exact MUST/NEVER prefix format.