Skip to content

Rules

Rules are markdown files that instruct the AI agent how to behave — enforcing coding conventions, architectural decisions, or any guidelines you want applied consistently.

Rules are stored as .md files in .agents/rules/ directories.

Open Settings → Rules from the sidebar. You can:

  • Browse installed rules (global and project-level)
  • Install rules from the marketplace
  • Create new rules with the Add Rule button
  • Edit rule files in the .agents/rules/ file tree when a project is selected
LocationScope
~/.agents/rules/Global — available to all projects
<project>/.agents/rules/Project-level — overrides global rules with the same name

Project-level rules take precedence over global rules with the same filename.

From Settings → Rules, click Add Rule (or use the + button on the .agents/rules/ folder in the file tree). Fill in the form:

  • Name — A human-readable name (e.g. Code Style Guide). The file will be saved as its slugified equivalent (e.g. code-style-guide.md).
  • Description — Explains what the rule enforces and when it applies. This is used by the agent to decide whether to consult the rule.
  • Always Apply — Controls how the rule is loaded into context:
    • On — The full rule content is always included in every conversation.
    • Off — Only the description is included; the agent reads the full rule file when it determines it is relevant.

Click Continue to create the rule. The file opens immediately so you can write the rule content.

After creation, add your guidelines to the rule file below the frontmatter:

---
description: Enforce consistent React component patterns across the codebase.
alwaysApply: false
---
## Component Structure
- Use functional components with TypeScript interfaces
- Export components as named exports: `export const ComponentName`
## Hooks
- Use `useState` for local state, `useReducer` for complex state
- Always specify dependency arrays in `useEffect`

Write clear, actionable instructions. The agent follows the content literally, so be specific.

Open any rule file from the .agents/rules/ folder in the file tree to edit it directly. You can update both the frontmatter fields (description, alwaysApply) and the rule content at any time.

To delete a rule, use the file actions available in the file tree.

Settings → Rules includes a marketplace of community rules you can browse and install with one click. Installed rules are saved to your global or project .agents/rules/ directory.