Skip to main content

Overview

Repository rules let you define automated workflows using plain markdown files. When conditions are met, Gitar automatically executes actions, with no code required.

Natural Language

Write rules in plain English, not code

Git-Native

Rules live in your repo as .gitar/rules/*.md

Integrations

Connect to Jira, Linear, Slack, and more

Quick Start

1

Create the Rules Directory

2

Add a Rule File

Create .gitar/rules/security-review.md:
3

Commit and Push

4

Open a PR

Gitar evaluates your rules on every PR. Check the dashboard comment to see which rules matched. When none of them apply, the comment says how many were skipped, and gitar display:verbose shows why each was skipped.

Rule Structure

Rules are markdown files with YAML frontmatter:

Frontmatter Fields

Triggers

Supported Actions

Post comments on the PR or as inline code reviews.
Add or remove labels based on detected conditions.
Assign specific reviewers when changes are detected.
Suggest or make code modifications.

Integrations

Every integration your organization has enabled is available to every rule. Name one in the rule and the agent uses it, so post to #releases finds Slack and move the ticket to In Review finds Linear.

Custom Integrations (MCP)

On the Enterprise plan you can connect your own MCP servers as custom integrations. Name one in a rule the same way you name a built-in.
See Custom Integrations for setup instructions.

Skills

A rule can also call a skill, a procedure committed under .gitar/skills/<name>/SKILL.md. Name it in the rule body and the agent loads it and follows it.
Naming the skill is what invokes it. Gitar has no slash-command syntax. See Skills for the file format. To call the same skill from rules in every repository, commit it once to your configuration repository.

Rules for Every Repository

A rule in .gitar/rules/ applies to the repository that holds it. To apply one across the organization, commit it to your configuration repository instead and every repository evaluates it. A repository overrides an inherited rule with a file of the same name, ignoring case and treating - and _ alike. Commit .gitar/rules/no-raw-sql.md and the configuration repository’s no-raw-sql.md (or no_raw_sql.md) is skipped for that repository.

Example Rules

Each example below is one complete .gitar/rules/*.md file.

Documentation Required

Breaking Change Review

For dependency updates that should merge automatically, configure Auto-Approve and Auto-Merge criteria.

Debugging

Use display mode commands to see how rules are being evaluated:

Best Practices

Keep each rule focused on one outcome. Name specific paths and conditions, and include the exceptions that matter to the team. Use gitar display:verbose to check why a rule matched or was skipped.