Understand the `.ruler/` directory structure and precedence
mainThe .ruler/ directory serves as the central hub for AI agent instructions. Ruler discovers and concatenates .md rule files recursively.
File Precedence Order:
AGENTS.mdat the repository root (highest precedence, prepended)..ruler/AGENTS.md..ruler/instructions.md(legacy fallback, used only if.ruler/AGENTS.mdis absent).- All other
.mdfiles under.ruler/and its subdirectories, sorted by name.
Each file's content is prepended with a traceability marker: <!-- Source: <relative_path_to_md_file> -->.
Configuration Files:
ruler.toml: The master configuration for behavior, agent selection, output paths, and MCP server settings.mcp.json: Legacy/deprecated shared MCP server settings (still supported for backward compatibility).