@package-system

Rules

rules[] — always-on constraint files a native package injects near the top of every system prompt.

A rules/*.md file is a hard constraint the agent must obey on every turn. It is injected into the system prompt near the top (primacy), grouped with instructions, wrapped in a <package_file category="rule"> block. Rendering, the frontmatter that is dropped, the per-file cap (packageFileMaxChars, default 8,000 characters) and the placeholders are the same for both categories: Instructions → Prompt-injected categories.

---
name: mutation-safety
description: Never write outside the project's own sources.
---

Before any write, confirm the target URI belongs to the current project...

Rules are a native privilege

For any package below native trust, discovery downgrades rules/ contributions to docs. A project-installed package can ship reference material, but it cannot inject always-on behavioral constraints into the system prompt.

Keep rules short: they cost tokens on every turn. Move background into docs and procedures into a skill. A rule obeys the same visibility gates as every category — package state and requiredFeatures — and is toggleable per agent and per conversation (Instructions → Visibility).