# owndiff.json (https://docs.owndiff.com/configuration/owndiff-json)

`owndiff.json` sits in the repository root. Every field is optional, and without the file the defaults apply. Most repositories don't need it.

```json title="owndiff.json"
{
  "$schema": "https://docs.owndiff.com/schema/config.json",
  "version": 1,
  "areas": {
    "billing": ["apps/billing/**", "packages/stripe/**"],
    "onboarding": ["apps/web/src/onboarding/**"]
  },
  "context": ["docs/adr/**/*.md", "docs/product/**/*.md"],
  "ignore": ["**/*.generated.ts", "migrations/**"],
  "triggers": {
    "excludeAuthors": ["dependabot[bot]"]
  }
}
```

## Fields [#fields]

| Field                     | Meaning                                                                                                |
| ------------------------- | ------------------------------------------------------------------------------------------------------ |
| `areas`                   | Product areas and the files in them. owndiff finds areas from the code; setting `areas` replaces them. |
| `context`                 | Docs owndiff reads as knowledge in place. Replaces the default discovery.                              |
| `ignore`                  | Files that don't count toward the diff limit, such as generated code.                                  |
| `triggers.excludeAuthors` | Pull request authors owndiff skips, such as dependency bots.                                           |
| `triggers.skipDrafts`     | `true` by default: drafts wait until they are marked ready. `false` reviews drafts on every push.      |
| `triggers.mode`           | `auto` by default. `tag_only` reviews a pull request only while it has the `owndiff` label.            |

owndiff reads `triggers` from the pull request's latest commit. With `tag_only`, adding the `owndiff` label starts the review.

## Default docs [#default-docs]

Without `context`, owndiff reads these as knowledge:

```text
README.md
docs/**/*.md
doc/**/*.md
adr/**/*.md
**/*ADR*.md
**/*PRD*.md
**/stories/**/*.md
**/user-stories/**/*.md
**/*user-stor*.md
**/*USER-STOR*.md
```

The reviewer reads the content of these docs, not only their titles. The ones that matter most for the pull request come first: docs its description or a linked issue names, docs whose path or title names a touched area, then PRDs and user stories.

The pull request summary lists every file owndiff read and how it read it, so a wrong match is easy to spot. Set `context` when your docs live somewhere else, or when the defaults pick up files that aren't about the product.

## Validation [#validation]

[`/schema/config.json`](/schema/config.json) is the JSON Schema. With `$schema` set, editors complete and check the file as you type. An invalid file is not applied. owndiff reviews with the defaults and shows a warning with the reason in the pull request summary and the `owndiff` check run.
