Repo Conventions

The coding patterns Scrubby has learned for a single repository, and how to curate them.

Conventions are the patterns a codebase follows. Scrubby reviews changes against these patterns instead of a generic set of rules.

How conventions are learned

During indexing, Scrubby groups related files into segments (cohesive clusters based on imports, naming, and directory structure) and extracts the conventions each segment follows. Each convention carries a confidence score reflecting how consistently it appears. Higher-confidence conventions are prioritized in reviews. A convention that shows up across many segments in a repository is stronger evidence that it's a real, repo-wide pattern rather than a one-off.

Starting convention categories

The set of categories is open. Scrubby labels other patterns as it finds them.

Curating conventions

The dashboard's convention list for a repository shows one entry per distinct rule, each with the segments it was found in. From there you can:

Only one person can edit a repository's convention list at a time. The dashboard acquires a lock while you're making changes, and releases it when you're done or when it expires. Two people editing at once can't overwrite each other's changes.

How conventions are used

In your editor

When your editor calls scrubby_review on a file, the response includes the conventions for that file's segment, so generated code matches the repository's style on the first pass.

In PR reviews

Each changed file is checked against its segment's conventions. Violations are flagged with inline suggestions showing the expected pattern. See PR Reviews.

Conventions are descriptive, not prescriptive. Scrubby reflects what a codebase actually does, not what a style guide says it should do. If a repository consistently uses a pattern that contradicts a popular convention, Scrubby follows the repository's own practice.

Pinning conventions to a snapshot

To have Scrubby learn conventions as of a date in the past (for example, before a team adopted AI tools heavily) set an index cutoff date on the repository:

  1. Open the repository's detail page in the dashboard.
  2. Scroll to the Settings section.
  3. Pick a date in the Index cutoff date field and save. Scrubby rejects a date earlier than the repository's first commit.

Setting a cutoff pins indexing to the most recent commit at or before that date on the default branch. Every derived signal for the repository is cleared and rebuilt from that pinned snapshot. Pushes to the default branch stop moving the index forward while a cutoff is set. Pull request reviews still read each PR's own diff fresh; only the context used to inform the review comes from the pinned window.

The dashboard marks any repository with a cutoff set. To move or clear it, edit the date and save again, or clear the field to resume indexing from the latest commit. A cutoff is set per repository, not for an entire organization.