Create custom context and instructions for your AI agents with project-specific markdown rules that enhance code understanding and consistency.
.zencoder/rules/*.md
files in your repository. Applied conditionally based on file patterns or always when specified.alwaysApply: true
) or conditionally based on glob patterns. Perfect for team standards, architecture guidelines, and project-specific conventions.
Instructions for AI
. These apply across all your projects and are ideal for general coding style preferences or tone of voice the agent is using to respond to you.
/repo-info
agent). This runs with alwaysApply: true
to help all agents understand your project better.
.zencoder/rules
directory at your project root. When you upgrade to the latest version of Zencoder, this directory is created automatically with proper migrations handled for you.
repo.md
file already present in your .zencoder/rules
directory. This file is created by the Repo Info Agent and provides project context. Learn more about working with repo.md in the Repo Info Agent documentation.Since repo.md and custom Zen Rules serve different purposes, check out our quick guide on choosing the right approach to understand when to use each one.If you had rules in the previous .zencoder/docs
location, we’ve migrated them to the new .zencoder/rules
structure. The old .zencoder/docs
location is now deprecated for rules.If you check your git commit history after upgrading, you’ll see the migration reflected as file moves from .zencoder/docs/
to .zencoder/rules/
:markdown-writing-styles.md
rule from this repository:
@
and then select Zen Rules
from the dropdown, then choose from the list of available rules:
alwaysApply: true
or matching glob patterns as described earlier.
Field | Required | Description |
---|---|---|
description | Yes | Brief description of the rule’s purpose. Displayed in chat when @mentioning rules and used by agents to understand rule relevance. Example: "TypeScript coding guidelines and best practices" |
globs | No | Array of file patterns that trigger this rule. Rule is automatically included when working with matching files. Examples: ["*.ts", "*.tsx"] , ["src/**/*.js"] , ["*.md", "*.mdx"] |
alwaysApply | No | Boolean (default: false). When true , rule is included in every request regardless of file context. Note: When true , the globs field is ignored |
Markdown Style Guide - Content formatting rules
API Development Standards - Backend development guidelines
alwaysApply: true
in the frontmatter. That’s the case with repo.md
, for example.typescript-standards.md
instead of generic names.
Use globs effectively to target specific directories or file types. This allows you to apply rules only where they are relevant, reducing noise in the AI’s context.
Turn repetitive prompts into rules - if you find yourself writing the same prompts over and over again, consider creating a rule file to capture that knowledge.
For complex workflows, if you’re facing increasingly complex and repeatable prompts that need to use different tools and MCPs, consider exploring Custom Agents for more advanced automation.