Skip to content

Rules

Write project instructions that agents can actually follow.

Rules are persistent project expectations. Put everyday engineering rules in AGENTS.md: package boundaries, test commands, style rules, deployment constraints, and files that require explicit approval. Keep rules operational. “Run bun typecheck from the changed package” is better than “write clean code.” Use memory for durable project facts; use rules for behavior every run must follow.

Instruction Sources

NextOS combines managed defaults, user memory, project memory, local workspace rules, and configured instruction files into the rendered prompt. The Memory settings screen and config.instructions.rendered() API show which sources were active, which sources failed to load, and where conflicts were detected.

Local Includes

Rule files can include nearby Markdown files with references such as @docs/testing.md, @./style.md, @../shared.md, or @~/global.md. NextOS expands local Markdown includes before the final instruction prompt is rendered, so teams can keep AGENTS.md concise while storing detailed standards in reusable files.

Include expansion is cycle-safe. When recursive includes point back to an already visited file, NextOS stops expanding that path and reports an instruction.include_cycle warning in rendered instruction diagnostics.