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.

Store rules as .md or .mdc files in .agents/rules/ or its subdirectories.

Rules are files you edit directly. Open the Files window in the chat dock, or use any editor on disk:

  • Edit the project’s .agents/rules/ directory to change the project’s rules.
  • Add files to ~/.agents/rules/ to make rules available to every project.
LocationScope
~/.agents/rules/Global — available to all projects
<project>/.agents/rules/Project-level — overrides global rules with the same basename

Tarsk loads local rules from the thread’s .agents/rules/ directory. Local rules override global rules with the same basename, without the .md or .mdc extension.

Create a markdown file in the project’s .agents/rules/ directory, or in ~/.agents/rules/ for a global rule. The file name identifies the rule, so use a descriptive name such as code-style-guide.md. Add these frontmatter fields to control how the rule loads:

  • description — Explains what the rule enforces and when it applies. The agent uses this to decide whether to consult the rule.
  • alwaysApply — Controls how the rule is loaded into context:
    • true — The full rule content is always included in every conversation.
    • false or missing — Only the description is included; the agent reads the full rule file when it determines it is relevant.

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.

Tarsk has no in-app rules marketplace. To use a rule someone shared with you, add its .md or .mdc file to your project’s .agents/rules/ directory.