Overview
Repository rules let you define automated workflows using plain markdown files. When conditions are met, Gitar automatically executes actions — no code required.Natural Language
Write rules in plain English, not code
Git-Native
Rules live in your repo as
.gitar/rules/*.mdIntegrations
Connect to Jira, Slack, and more
Quick Start
Rule Structure
Rules are markdown files with YAML frontmatter:Frontmatter Fields
| Field | Required | Description |
|---|---|---|
title | Yes | Rule name displayed in the dashboard |
description | Yes | Brief summary shown in compact mode |
when | Yes | Natural language condition that triggers the rule |
actions | Yes | What Gitar does when the condition is met |
integrations | No | External tools the rule needs (jira, slack) |
Triggers
Rules are evaluated when:- Every push to a PR — Any new commits pushed to a pull request
- Metadata updates — Changes to PR title, description, reviewers, or labels
Supported Actions
Post Comments
Post Comments
Post comments on the PR or as inline code reviews.
Apply Labels
Apply Labels
Add or remove labels based on detected conditions.
Assign Reviewers
Assign Reviewers
Assign specific reviewers when changes are detected.
Suggest Code Changes
Suggest Code Changes
Suggest or make code modifications.
Integrations
Jira
Link PRs to Jira tickets and update issue status automatically.Slack
Send notifications to Slack channels.Example Rules
Documentation Required
Breaking Change Review
Auto-merge Dependabot
Debugging
Use display mode commands to see how rules are being evaluated:| Command | Description |
|---|---|
gitar display:verbose | Show all rules with explanations for why each matched or didn’t |
gitar display:compact | Show only relevant rules (default) |
Best Practices
Be Specific
Narrow conditions prevent false positives. “PRs modifying
src/auth/*.ts” is better than “PRs with auth changes”.Keep Rules Focused
One rule, one purpose. Split complex logic into multiple rules.
Test with Verbose Mode
Use
gitar display:verbose to debug why rules aren’t matching.Document Edge Cases
Include examples and edge cases in the rule body.