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.
Accessing Rules
Section titled “Accessing Rules”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.
Rule Locations
Section titled “Rule Locations”| Location | Scope |
|---|---|
~/.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.
Creating a Rule
Section titled “Creating a Rule”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.falseor missing — Only the description is included; the agent reads the full rule file when it determines it is relevant.
Writing Rule Content
Section titled “Writing Rule Content”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.
Editing and Deleting Rules
Section titled “Editing and Deleting Rules”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.
Sharing Rules
Section titled “Sharing Rules”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.