Skip to main content
Extend Macroscope’s default correctness check with context to improve precision and avoid false positives. Custom correctness instructions teach our core code review what’s idiomatic, intentional, or off-limits in your codebase, so it flags real issues and stays quiet on patterns it would otherwise misread. Drop markdown files into .macroscope/correctness/, optionally scope them with glob patterns, and your team’s domain knowledge is folded into the same correctness review you already get.

File layout

Create one or more markdown files inside .macroscope/correctness/ at the root of your repo:
Subdirectories are walked recursively, so you can organize instructions by team or service — useful in monorepos:
Nesting is purely organizational. A file’s location does not affect which changes it applies to — that is controlled entirely by the include/exclude front matter. Only *.md files are read; any other files (and README.md) are ignored.

Front matter

Custom correctness instruction files support YAML front matter with the following fields: If both include and exclude are omitted, the instructions apply globally to every file Macroscope reviews in the repo.

Example

.macroscope/correctness/configuration-principles.md:
In this example, the rules apply to all Go files and anything under a config/ directory, but skip tests and test fixtures. When Macroscope reviews a change that touches a matching file, these principles are folded into the correctness review automatically.
Front matter is optional. A correctness instruction file with no front matter applies to every file in the repo.

How matching works

For each file changed in a pull request, Macroscope walks .macroscope/correctness/ and includes the contents of every instruction file whose include/exclude patterns match that file’s path. Multiple instruction files can apply to the same file — they stack. If no instruction file matches, the correctness review behaves exactly as it does for repos without custom instructions.