> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gitar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Example repository policies

> Copy and adapt risk, review, and automation policies for your repository.

Start with `.gitar/config/risk.md` at the root of one repository. Choose the example that fits how your team reviews changes. Before enabling auto-approval, compare Gitar's explanations on a few familiar PRs with the risk levels your reviewers would assign.

Repository guidance can raise, but cannot lower, the organization's risk level, so a Low rule in `risk.md` only takes effect when the organization's assessment is already Low. Gitar considers the default branch's `risk.md` and additions in the PR under review. See [Risk triage](https://docs.gitar.ai/features/code-review/risk-triage.md).

## Rate changes by their impact

This example suits a service that stores customer records. A change to who can read a record deserves closer review even when the diff is one line and the review finds no defects.

```markdown .gitar/config/risk.md theme={null}
# Risk levels

Use the highest level that applies to the whole PR.

- Use High for changes to who can read or write customer records, when stored
  data is deleted, or whether a deployment can skip a required check.
- Use Medium for behavior changes within one feature, such as rejecting
  an invalid search filter. Use at least Medium when the impact is unclear.
- Use Low for prose corrections, formatting, or added tests that preserve
  existing assertions and leave runtime behavior unchanged.

Rate a comment edit in an access check as Low if only the wording changes.
Rate a change to the check's decision as High, even in a shared helper.
```

## Account for gaps in release tests

Use this alternative when a team relies on a release test that exercises only part of a workflow. Replace the import example with the path your test actually covers. Revise that description when the test changes.

```markdown .gitar/config/risk.md theme={null}
# Import service risk levels

Our release test imports a valid file and checks the resulting records.
It does not interrupt an import or retry one after a partial write.
Use the highest applicable level across the whole PR.

- Use High if the change alters which account receives imported records,
  can overwrite existing records on retry, or disables the release test.
- Use at least Medium if the change affects recovery after a partial write,
  even through a shared helper. Name the step the release test misses.
  Use the same minimum if the affected paths are unclear.
- Keep the organization's risk level for changes confined to the tested
  success path. Passing the release test alone cannot lower the level.
- Use Low for edits that only clarify import instructions or add test cases
  without weakening existing checks or changing import behavior.
```

## Limit what Gitar can do automatically

Add only the files for the actions your team uses. Gitar reads these criteria from the default branch and applies them alongside organization criteria. Adding these files does not enable automation. Enable auto-apply, auto-approve, and auto-merge separately when ready. Auto-merge also requires auto-approve to be enabled. Enforce required CI checks on the code host.

### Fix review findings

This example limits automatic fixes for review findings to spelling corrections in prose. CI fixes and explicit fix requests run independently. See [Auto-apply](https://docs.gitar.ai/features/code-review/auto-apply.md).

```markdown .gitar/config/apply.md theme={null}
On Low-risk PRs, fix spelling errors in user documentation only.
Preserve code samples and commands exactly. Skip the fix if the PR's
risk is unavailable or the proposed edit changes an instruction's meaning.
```

### Approve low-risk changes

```markdown .gitar/config/approve.md theme={null}
Approve only when the current review is complete, the whole PR is Low
risk, and there are zero unresolved findings. Withhold approval if the
risk assessment is unavailable.
```

### Merge a subset of approved changes

```markdown .gitar/config/merge.md theme={null}
Merge only a PR that Gitar has approved and assessed as Low risk, where
every change is a prose correction in a Markdown file under docs/.
Hold the merge if any change affects a code sample or command.
```

With these examples, a PR that only adds a regression test can qualify for [auto-approval](https://docs.gitar.ai/features/code-review/auto-approve.md) and still need a person to merge it. The [auto-merge](https://docs.gitar.ai/features/code-review/auto-merge.md) example assumes the repository keeps user documentation under `docs/`.

## Tell reviewers what to look for

A review instruction can point to a specific defect that would matter in a high-risk area. For the import example, give Gitar a failure case it can trace in the diff.

```markdown .gitar/review/import-retries.md theme={null}
When a PR changes import retries, check what happens if the first attempt
writes a record and then stops before marking the row complete. If a retry
can insert a duplicate, identify the write that can run twice and explain
how the second attempt reaches it.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.